diff --git a/DEPS b/DEPS index 93f12ab2..38b212c 100644 --- a/DEPS +++ b/DEPS
@@ -280,15 +280,15 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'e107cb001d4b1cc4ebccc98e4e250df03637f25d', + 'skia_revision': '787f0044989bcfd923bd18776fc1c61360a49e48', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': 'ddbe1ac33e0e0753463d4a71c045e2c9ff80237b', + 'v8_revision': '40f1a54474084d9016f8b7e66fea1f235a42028a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '7c766c0edc707b9d8201c550cec8036d3e13e3f3', + 'angle_revision': '0559bc5a08d7162b1ea32a105e469952bd34cf71', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -372,7 +372,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': 'da76e16c8739ce12d5eceda3e0ce66984f838a82', + 'devtools_frontend_revision': 'b434f78c13e1e70adb06b724d6c22f2dd5d238eb', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -496,7 +496,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling llvm-libc # and whatever else without interference from each other. - 'llvm_libc_revision': '74a86e874eb25533d83c34b09ec925c091039a7c', + 'llvm_libc_revision': 'fa202ff628394205418d311c5759874336921dd4', # If you change this, also update the libc++ revision in # //buildtools/deps_revisions.gni. @@ -1304,7 +1304,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - 'a08fabe658a48177291e1cabb4f60178ee9616d1', + 'feab2c5b2ea85e757fb381ec2588419d2b9b8434', 'condition': 'checkout_android and checkout_src_internal', }, @@ -2669,7 +2669,7 @@ Var('chromium_git') + '/webpagereplay.git' + '@' + Var('webpagereplay_revision'), 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '0d50581699bbd0b10b595f88382545fae97f89d1', + Var('webrtc_git') + '/src.git' + '@' + '28d3fffde3dbe2b90699377b270580ac29c72dc3', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -2806,7 +2806,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'CBNVyLiEup2AT6h2XX0Aw8FcXwRbbjsARGsP_v3_J-4C', + 'version': 'fxNBLjWYNv5uSGoHxgwbCKZiYyba3Wc4pBMseOBNTCAC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2817,7 +2817,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'ZSx0hatylmSi3tMoPAfMnbxEzR1wamAK4kSE9tjymkoC', + 'version': 'cloSiswPWJwkkFJ-R6008kyvLY7O1lfjBr8jQa9qY5gC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2850,7 +2850,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': 'H7lcuN1pKjlq6IrgyKqwZQbHZ0vC0pRrS83htXqa9_MC', + 'version': 't4Xj8M5F0v_zl2HG4xUCc_sLtzArSez57_fpKAU68YkC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -4408,7 +4408,7 @@ 'src/components/autofill/core/browser/form_parsing/internal_resources': { 'url': Var('chrome_git') + '/chrome/components/autofill_regex_patterns.git' + '@' + - '8572e719bbf714846a735cdbfc1380ff6cf6a6a7', + 'dee24bc5ecb2e65d6b520043b75ca27cba7e39e8', 'condition': 'checkout_src_internal', }, @@ -4467,7 +4467,7 @@ 'src/components/test/data/autofill/heuristics-json/internal': { 'url': Var('chrome_git') + '/chrome/test/autofill/structured_forms.git' + '@' + - 'e2194054cb0a44ecb7a11bc71a09d0600f3d2a2d', + 'd0524b82fce8759735662106f37ce0b397e466ba', 'condition': 'checkout_chromium_autofill_test_dependencies', }, @@ -4497,7 +4497,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - '622a57c0b67faa85ade29d34028d20ecf9c70971', + '8577b74f6d5eb456ea3d5db7d4879fb7c68bc325', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/ash/strings/ash_strings_vi.xtb b/ash/strings/ash_strings_vi.xtb index ca818369..8ff4629c 100644 --- a/ash/strings/ash_strings_vi.xtb +++ b/ash/strings/ash_strings_vi.xtb
@@ -1275,7 +1275,7 @@ <translation id="5308380583665731573">Kết nối</translation> <translation id="5313326810920013265">Cài đặt Bluetooth</translation> <translation id="5314219114274263156">Đã ghi màn hình</translation> -<translation id="5314489738835854379">Di chuyển lùi lại qua các cửa sổ</translation> +<translation id="5314489738835854379">Di chuyển lùi qua các cửa sổ</translation> <translation id="5316716239522500219">Phản chiếu màn hình</translation> <translation id="5317780077021120954">Lưu</translation> <translation id="5319712128756744240">Ghép nối thiết bị mới</translation> @@ -1474,7 +1474,7 @@ <translation id="5958529069007801266">Người dùng được giám sát</translation> <translation id="5960410286721553511">Xem nội dung phương tiện và ảnh mới đây trên điện thoại</translation> <translation id="5965524703725988602">Bật/tắt Giao diện tối. <ph name="STATE_TEXT" />.</translation> -<translation id="5975235751479998104">Di chuyển tiến lên qua các cửa sổ</translation> +<translation id="5975235751479998104">Di chuyển tiến qua các cửa sổ</translation> <translation id="5978382165065462689">Chia sẻ quyền kiểm soát màn hình của bạn qua Trợ giúp từ xa.</translation> <translation id="5980301590375426705">Thoát phiên khách</translation> <translation id="5983567367406220847">Điểm phát sóng đã tắt do không hoạt động.</translation>
diff --git a/cc/test/fake_proxy.cc b/cc/test/fake_proxy.cc index 5cf4ea3e..cf917af 100644 --- a/cc/test/fake_proxy.cc +++ b/cc/test/fake_proxy.cc
@@ -32,7 +32,7 @@ bool FakeProxy::CommitRequested() const { return false; } -void FakeProxy::QueueImageDecode(int request_id, const DrawImage& image) {} +void FakeProxy::QueueImageDecode(int request_id, const PaintImage& image) {} void FakeProxy::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) {}
diff --git a/cc/test/fake_proxy.h b/cc/test/fake_proxy.h index f7a5aa7..2be2c83 100644 --- a/cc/test/fake_proxy.h +++ b/cc/test/fake_proxy.h
@@ -47,7 +47,7 @@ bool CommitRequested() const override; void Start() override {} void Stop() override {} - void QueueImageDecode(int request_id, const DrawImage& image) override; + void QueueImageDecode(int request_id, const PaintImage& image) override; void SetMutator(std::unique_ptr<LayerTreeMutator> mutator) override; void SetPaintWorkletLayerPainter( std::unique_ptr<PaintWorkletLayerPainter> painter) override;
diff --git a/cc/tiles/decoded_image_tracker.cc b/cc/tiles/decoded_image_tracker.cc index 27685e4..26183da 100644 --- a/cc/tiles/decoded_image_tracker.cc +++ b/cc/tiles/decoded_image_tracker.cc
@@ -38,18 +38,24 @@ } void DecodedImageTracker::QueueImageDecode( - const DrawImage& image, + const PaintImage& image, + const TargetColorParams& target_color_params, base::OnceCallback<void(bool)> callback) { + size_t frame_index = PaintImage::kDefaultFrameIndex; TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug"), "DecodedImageTracker::QueueImageDecode", "frame_key", - image.frame_key().ToString()); + image.GetKeyForFrame(frame_index).ToString()); DCHECK(image_controller_); // Queue the decode in the image controller, but switch out the callback for // our own. + auto image_bounds = SkIRect::MakeWH(image.width(), image.height()); + DrawImage draw_image(image, false, image_bounds, + PaintFlags::FilterQuality::kNone, SkM44(), frame_index, + target_color_params); image_controller_->QueueImageDecode( - image, base::BindOnce(&DecodedImageTracker::ImageDecodeFinished, - base::Unretained(this), std::move(callback), - image.paint_image().stable_id())); + draw_image, base::BindOnce(&DecodedImageTracker::ImageDecodeFinished, + base::Unretained(this), std::move(callback), + image.stable_id())); } void DecodedImageTracker::UnlockAllImages() {
diff --git a/cc/tiles/decoded_image_tracker.h b/cc/tiles/decoded_image_tracker.h index 3ab0588..4db4947f 100644 --- a/cc/tiles/decoded_image_tracker.h +++ b/cc/tiles/decoded_image_tracker.h
@@ -41,7 +41,8 @@ // Request that the given image be decoded. This issues a callback upon // completion. The callback takes a bool indicating whether the decode was // successful or not. - void QueueImageDecode(const DrawImage& image, + void QueueImageDecode(const PaintImage& image, + const TargetColorParams& target_color_params, base::OnceCallback<void(bool)> callback); // Unlock all locked images - used to respond to memory pressure or
diff --git a/cc/tiles/decoded_image_tracker_unittest.cc b/cc/tiles/decoded_image_tracker_unittest.cc index 5f0ba167..e945be3 100644 --- a/cc/tiles/decoded_image_tracker_unittest.cc +++ b/cc/tiles/decoded_image_tracker_unittest.cc
@@ -67,15 +67,6 @@ task_runner_->GetMockTickClock()); } - DrawImage DrawImageForDecoding(const PaintImage& paint_image, - const TargetColorParams& color_params) const { - return DrawImage(paint_image, - /*use_dark_mode=*/false, - SkIRect::MakeWH(paint_image.width(), paint_image.height()), - PaintFlags::FilterQuality::kNone, SkM44(), - PaintImage::kDefaultFrameIndex, color_params); - } - TestImageController* image_controller() { return &image_controller_; } DecodedImageTracker* decoded_image_tracker() { return &decoded_image_tracker_; @@ -91,8 +82,7 @@ TEST_F(DecodedImageTrackerTest, QueueImageLocksImages) { bool locked = false; decoded_image_tracker()->QueueImageDecode( - DrawImageForDecoding(CreateDiscardablePaintImage(gfx::Size(1, 1)), - TargetColorParams()), + CreateDiscardablePaintImage(gfx::Size(1, 1)), TargetColorParams(), base::BindOnce([](bool* locked, bool success) { *locked = true; }, base::Unretained(&locked))); EXPECT_TRUE(locked); @@ -108,7 +98,7 @@ TargetColorParams target_color_params; target_color_params.color_space = decoded_color_space; decoded_image_tracker()->QueueImageDecode( - DrawImageForDecoding(paint_image, target_color_params), + paint_image, target_color_params, base::BindOnce([](bool* locked, bool success) { *locked = true; }, base::Unretained(&locked))); @@ -132,8 +122,7 @@ // Add an image, this will start a 250ms timeout to release it. bool locked = false; decoded_image_tracker()->QueueImageDecode( - DrawImageForDecoding(CreateDiscardablePaintImage(gfx::Size(1, 1)), - TargetColorParams()), + CreateDiscardablePaintImage(gfx::Size(1, 1)), TargetColorParams(), base::BindOnce([](bool* locked, bool success) { *locked = true; }, base::Unretained(&locked))); EXPECT_TRUE(locked); @@ -144,10 +133,8 @@ EXPECT_EQ(1u, image_controller()->num_locked_images()); // Add an image, this will not start a new timeout, as one is pending. - locked = false; decoded_image_tracker()->QueueImageDecode( - DrawImageForDecoding(CreateDiscardablePaintImage(gfx::Size(1, 1)), - TargetColorParams()), + CreateDiscardablePaintImage(gfx::Size(1, 1)), TargetColorParams(), base::BindOnce([](bool* locked, bool success) { *locked = true; }, base::Unretained(&locked))); EXPECT_TRUE(locked); @@ -170,16 +157,15 @@ bool locked = false; auto paint_image_1 = CreateDiscardablePaintImage(gfx::Size(1, 1)); decoded_image_tracker()->QueueImageDecode( - DrawImageForDecoding(paint_image_1, target_color_params), + paint_image_1, TargetColorParams(), base::BindOnce([](bool* locked, bool success) { *locked = true; }, base::Unretained(&locked))); EXPECT_TRUE(locked); EXPECT_EQ(1u, image_controller()->num_locked_images()); - locked = false; auto paint_image_2 = CreateDiscardablePaintImage(gfx::Size(1, 1)); decoded_image_tracker()->QueueImageDecode( - DrawImageForDecoding(paint_image_2, target_color_params), + paint_image_2, target_color_params, base::BindOnce([](bool* locked, bool success) { *locked = true; }, base::Unretained(&locked))); EXPECT_TRUE(locked); @@ -209,16 +195,13 @@ // Insert two images: bool locked = false; decoded_image_tracker()->QueueImageDecode( - DrawImageForDecoding(CreateDiscardablePaintImage(gfx::Size(1, 1)), - TargetColorParams()), + CreateDiscardablePaintImage(gfx::Size(1, 1)), TargetColorParams(), base::BindOnce([](bool* locked, bool success) { *locked = true; }, base::Unretained(&locked))); EXPECT_TRUE(locked); EXPECT_EQ(1u, image_controller()->num_locked_images()); - locked = false; decoded_image_tracker()->QueueImageDecode( - DrawImageForDecoding(CreateDiscardablePaintImage(gfx::Size(1, 1)), - TargetColorParams()), + CreateDiscardablePaintImage(gfx::Size(1, 1)), TargetColorParams(), base::BindOnce([](bool* locked, bool success) { *locked = true; }, base::Unretained(&locked))); EXPECT_TRUE(locked);
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index bc34a41..cac4a95e 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc
@@ -67,15 +67,6 @@ namespace cc { namespace { -DrawImage DrawImageForDecoding(const PaintImage& paint_image, - const TargetColorParams& color_params) { - return DrawImage(paint_image, - /*use_dark_mode=*/false, - SkIRect::MakeWH(paint_image.width(), paint_image.height()), - PaintFlags::FilterQuality::kNone, SkM44(), - PaintImage::kDefaultFrameIndex, color_params); -} - // A version of simple task runner that lets the user control if all tasks // posted should run synchronously. class SynchronousSimpleTaskRunner : public base::TestSimpleTaskRunner { @@ -3871,9 +3862,9 @@ // Add the images to our decoded_image_tracker. host_impl()->tile_manager()->decoded_image_tracker().QueueImageDecode( - DrawImageForDecoding(image1, TargetColorParams()), base::DoNothing()); + image1, TargetColorParams(), base::DoNothing()); host_impl()->tile_manager()->decoded_image_tracker().QueueImageDecode( - DrawImageForDecoding(image2, TargetColorParams()), base::DoNothing()); + image2, TargetColorParams(), base::DoNothing()); EXPECT_EQ(0u, host_impl() ->tile_manager() ->decoded_image_tracker() @@ -3955,8 +3946,7 @@ TargetColorParams target_color_params; target_color_params.color_space = output_cs; host_impl()->tile_manager()->decoded_image_tracker().QueueImageDecode( - DrawImageForDecoding(hdr_image, target_color_params), - base::DoNothing()); + hdr_image, target_color_params, base::DoNothing()); FlushDecodeTasks(); // Add images to a fake recording source.
diff --git a/cc/trees/commit_state.h b/cc/trees/commit_state.h index a75a74f..5a0fda5 100644 --- a/cc/trees/commit_state.h +++ b/cc/trees/commit_state.h
@@ -27,7 +27,7 @@ #include "cc/layers/layer_list_iterator.h" #include "cc/metrics/begin_main_frame_metrics.h" #include "cc/metrics/event_metrics.h" -#include "cc/paint/draw_image.h" +#include "cc/paint/paint_image.h" #include "cc/resources/ui_resource_request.h" #include "cc/trees/begin_main_frame_trace_id.h" #include "cc/trees/browser_controls_params.h" @@ -143,7 +143,7 @@ std::unique_ptr<gfx::DelegatedInkMetadata> delegated_ink_metadata; std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation; - std::vector<std::pair<int, std::unique_ptr<DrawImage>>> queued_image_decodes; + std::vector<std::pair<int, std::unique_ptr<PaintImage>>> queued_image_decodes; // Presentation time callbacks requested for the next frame are initially // added here.
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 4033f99..c7a7bbe6 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc
@@ -1990,7 +1990,7 @@ return !task_runner_provider_ || task_runner_provider_->IsMainThread(); } -void LayerTreeHost::QueueImageDecode(const DrawImage& image, +void LayerTreeHost::QueueImageDecode(const PaintImage& image, base::OnceCallback<void(bool)> callback) { TRACE_EVENT0("cc", "LayerTreeHost::QueueImageDecode"); int next_id = s_image_decode_sequence_number.GetNext(); @@ -1999,7 +1999,7 @@ proxy()->QueueImageDecode(next_id, image); } else { pending_commit_state()->queued_image_decodes.emplace_back( - next_id, std::make_unique<DrawImage>(image)); + next_id, std::make_unique<PaintImage>(image)); } pending_image_decodes_.emplace(next_id, std::move(callback)); SetNeedsCommit();
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index 9da7619..86e95b6 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h
@@ -869,7 +869,7 @@ void NotifyAnimationWorkletStateChange(AnimationWorkletMutationState state, ElementListType tree_type) override {} - void QueueImageDecode(const DrawImage& image, + void QueueImageDecode(const PaintImage& image, base::OnceCallback<void(bool)> callback); void ImageDecodesFinished(const std::vector<std::pair<int, bool>>& results);
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 5e359aa..2fe2061 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -4145,23 +4145,19 @@ } void LayerTreeHostImpl::QueueImageDecode(int request_id, - const DrawImage& image) { + const PaintImage& image) { DCHECK(!settings_.is_display_tree); - const PaintImage& paint_image = image.paint_image(); - TRACE_EVENT1( - TRACE_DISABLED_BY_DEFAULT("cc.debug"), - "LayerTreeHostImpl::QueueImageDecode", "frame_key", - paint_image.GetKeyForFrame(PaintImage::kDefaultFrameIndex).ToString()); + TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug"), + "LayerTreeHostImpl::QueueImageDecode", "frame_key", + image.GetKeyForFrame(PaintImage::kDefaultFrameIndex).ToString()); // Optimistically specify the current raster color space, since we assume that // it won't change. - DrawImage image_copy( - image, /*scale_adjustment=*/1.0, - /*frame_index=*/PaintImage::kDefaultFrameIndex, - GetTargetColorParams(paint_image.GetContentColorUsage())); + auto content_color_usage = image.GetContentColorUsage(); tile_manager_.decoded_image_tracker().QueueImageDecode( - image_copy, base::BindOnce(&LayerTreeHostImpl::ImageDecodeFinished, - weak_factory_.GetWeakPtr(), request_id)); - tile_manager_.checker_image_tracker().DisallowCheckeringForImage(paint_image); + image, GetTargetColorParams(content_color_usage), + base::BindOnce(&LayerTreeHostImpl::ImageDecodeFinished, + weak_factory_.GetWeakPtr(), request_id)); + tile_manager_.checker_image_tracker().DisallowCheckeringForImage(image); } void LayerTreeHostImpl::ImageDecodeFinished(int request_id,
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index e94fd9e..7eadb882 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -853,7 +853,7 @@ return paint_worklet_painter_.get(); } - void QueueImageDecode(int request_id, const DrawImage& image); + void QueueImageDecode(int request_id, const PaintImage& image); std::vector<std::pair<int, bool>> TakeCompletedImageDecodeRequests(); // Returns mutator events to be handled by BeginMainFrame. std::unique_ptr<MutatorEvents> TakeMutatorEvents();
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 8d46ff29..1198cdc 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc
@@ -8296,8 +8296,8 @@ &LayerTreeHostTestQueueImageDecode::ImageDecodeFinished, base::Unretained(this)); // Schedule the decode twice for the same image. - layer_tree_host()->QueueImageDecode(image_, callback); - layer_tree_host()->QueueImageDecode(image_, callback); + layer_tree_host()->QueueImageDecode(image_.paint_image(), callback); + layer_tree_host()->QueueImageDecode(image_.paint_image(), callback); } void ReadyToCommitOnThread(LayerTreeHostImpl* impl) override { @@ -8350,12 +8350,7 @@ auto callback = base::BindOnce( &LayerTreeHostTestQueueImageDecodeNonLazy::ImageDecodeFinished, base::Unretained(this)); - layer_tree_host()->QueueImageDecode( - DrawImage(image, - /*use_dark_mode=*/false, - SkIRect::MakeWH(image.width(), image.height()), - PaintFlags::FilterQuality::kNone, SkM44()), - std::move(callback)); + layer_tree_host()->QueueImageDecode(image, std::move(callback)); } void ImageDecodeFinished(bool decode_succeeded) {
diff --git a/cc/trees/proxy.h b/cc/trees/proxy.h index ccf0b68..5223a36 100644 --- a/cc/trees/proxy.h +++ b/cc/trees/proxy.h
@@ -92,7 +92,7 @@ // Must be called before deleting the proxy. virtual void Stop() = 0; - virtual void QueueImageDecode(int request_id, const DrawImage& image) = 0; + virtual void QueueImageDecode(int request_id, const PaintImage& image) = 0; virtual void SetMutator(std::unique_ptr<LayerTreeMutator> mutator) = 0; virtual void SetPaintWorkletLayerPainter(
diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc index 67b7f1e3..849b637 100644 --- a/cc/trees/proxy_impl.cc +++ b/cc/trees/proxy_impl.cc
@@ -1035,7 +1035,7 @@ } void ProxyImpl::QueueImageDecodeOnImpl(int request_id, - std::unique_ptr<DrawImage> image) { + std::unique_ptr<PaintImage> image) { host_impl_->QueueImageDecode(request_id, *image); }
diff --git a/cc/trees/proxy_impl.h b/cc/trees/proxy_impl.h index ba43107..b41e401 100644 --- a/cc/trees/proxy_impl.h +++ b/cc/trees/proxy_impl.h
@@ -81,7 +81,8 @@ bool scroll_and_viewport_changes_synced, CommitTimestamps* commit_timestamps, bool commit_timeout = false); - void QueueImageDecodeOnImpl(int request_id, std::unique_ptr<DrawImage> image); + void QueueImageDecodeOnImpl(int request_id, + std::unique_ptr<PaintImage> image); void SetSourceURL(ukm::SourceId source_id, const GURL& url); void SetUkmSmoothnessDestination( base::WritableSharedMemoryMapping ukm_smoothness_data);
diff --git a/cc/trees/proxy_main.cc b/cc/trees/proxy_main.cc index aa65cc19..7c2d4a6 100644 --- a/cc/trees/proxy_main.cc +++ b/cc/trees/proxy_main.cc
@@ -787,12 +787,12 @@ started_ = false; } -void ProxyMain::QueueImageDecode(int request_id, const DrawImage& image) { +void ProxyMain::QueueImageDecode(int request_id, const PaintImage& image) { TRACE_EVENT1("cc", "ProxyMain::QueueImageDecode", "request_id", request_id); ImplThreadTaskRunner()->PostTask( FROM_HERE, base::BindOnce(&ProxyImpl::QueueImageDecodeOnImpl, base::Unretained(proxy_impl_.get()), request_id, - std::make_unique<DrawImage>(image))); + std::make_unique<PaintImage>(image))); } void ProxyMain::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) {
diff --git a/cc/trees/proxy_main.h b/cc/trees/proxy_main.h index 608643c3..bbcbae6 100644 --- a/cc/trees/proxy_main.h +++ b/cc/trees/proxy_main.h
@@ -113,7 +113,7 @@ bool CommitRequested() const override; void Start() override; void Stop() override; - void QueueImageDecode(int request_id, const DrawImage& image) override; + void QueueImageDecode(int request_id, const PaintImage& image) override; void SetMutator(std::unique_ptr<LayerTreeMutator> mutator) override; void SetPaintWorkletLayerPainter( std::unique_ptr<PaintWorkletLayerPainter> painter) override;
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index 22c925a..3e430d5 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc
@@ -461,7 +461,7 @@ } void SingleThreadProxy::QueueImageDecode(int request_id, - const DrawImage& image) { + const PaintImage& image) { DCHECK(task_runner_provider_->IsMainThread()); DebugScopedSetImplThread impl(task_runner_provider_); host_impl_->QueueImageDecode(request_id, image);
diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h index 894dae9e..5d24cc9 100644 --- a/cc/trees/single_thread_proxy.h +++ b/cc/trees/single_thread_proxy.h
@@ -73,7 +73,7 @@ bool CommitRequested() const override; void Start() override; void Stop() override; - void QueueImageDecode(int request_id, const DrawImage& image) override; + void QueueImageDecode(int request_id, const PaintImage& image) override; void SetMutator(std::unique_ptr<LayerTreeMutator> mutator) override; void SetPaintWorkletLayerPainter( std::unique_ptr<PaintWorkletLayerPainter> painter) override;
diff --git a/chrome/VERSION b/chrome/VERSION index 8106e42c..62a18fe 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=133 MINOR=0 -BUILD=6926 +BUILD=6928 PATCH=0
diff --git a/chrome/browser/resources/print_preview/BUILD.gn b/chrome/browser/resources/print_preview/BUILD.gn index ab8597a..e16bc52 100644 --- a/chrome/browser/resources/print_preview/BUILD.gn +++ b/chrome/browser/resources/print_preview/BUILD.gn
@@ -71,7 +71,6 @@ "dark_mode_mixin.ts", "data/cdd.ts", "data/coordinate2d.ts", - "data/destination.ts", "data/destination_match.ts", "data/destination_store.ts", "data/document_info.ts", @@ -96,11 +95,14 @@ if (is_chromeos) { non_web_component_files += [ + "data/destination_cros.ts", "data/managed_print_options_cros.ts", "data/print_server_store.ts", "data/printer_status_cros.ts", "native_layer_cros.ts", ] + } else { + non_web_component_files += [ "data/destination.ts" ] } # Files that are passed as input to css_to_wrapper().
diff --git a/chrome/browser/resources/print_preview/data/destination.ts b/chrome/browser/resources/print_preview/data/destination.ts index 563d59c..c9000967 100644 --- a/chrome/browser/resources/print_preview/data/destination.ts +++ b/chrome/browser/resources/print_preview/data/destination.ts
@@ -6,18 +6,7 @@ import {assert} from 'chrome://resources/js/assert.js'; -// <if expr="is_chromeos"> -import {NativeLayerCrosImpl} from '../native_layer_cros.js'; - -// </if> - import type {Cdd, ColorCapability, ColorOption, CopiesCapability, DpiOption, DuplexType, MediaSizeOption, MediaTypeOption} from './cdd.js'; -// <if expr="is_chromeos"> -import type {ManagedPrintOptions} from './managed_print_options_cros.ts'; -import type {PrinterStatus} from './printer_status_cros.js'; -import {getStatusReasonFromPrinterStatus, PrinterStatusReason} from './printer_status_cros.js'; -// </if> - /** * Enumeration of the origin types for destinations. */ @@ -27,9 +16,6 @@ // legacy entries in the recent destinations, since we can't guarantee all // such recent printers have been overridden. COOKIES = 'cookies', - // <if expr="is_chromeos"> - DEVICE = 'device', - // </if> PRIVET = 'privet', EXTENSION = 'extension', CROS = 'chrome_os', @@ -47,20 +33,6 @@ CLOUD_PRINTER_DEPRECATED = 4 } -// <if expr="is_chromeos"> -/** - * Enumeration specifying whether a destination is provisional and the reason - * the destination is provisional. - */ -export enum DestinationProvisionalType { - // Destination is not provisional. - NONE = 'NONE', - // User has to grant USB access for the destination to its provider. - // Used for destinations with extension origin. - NEEDS_USB_PERMISSION = 'NEEDS_USB_PERMISSION', -} -// </if> - /** * Enumeration of color modes used by Chromium. */ @@ -80,12 +52,6 @@ } export function isPdfPrinter(id: string): boolean { - // <if expr="is_chromeos"> - if (id === GooglePromotedDestinationId.SAVE_TO_DRIVE_CROS) { - return true; - } - // </if> - return id === GooglePromotedDestinationId.SAVE_AS_PDF; } @@ -125,10 +91,6 @@ export interface DestinationOptionalParams { isEnterprisePrinter?: boolean; - // <if expr="is_chromeos"> - provisionalType?: DestinationProvisionalType; - managedPrintOptions?: ManagedPrintOptions; - // </if> extensionId?: string; extensionName?: string; description?: string; @@ -195,56 +157,6 @@ */ private extensionName_: string; - // <if expr="is_chromeos"> - /** - * Different from DestinationProvisionalType.NONE if - * the destination is provisional. Provisional destinations cannot be - * selected as they are, but have to be resolved first (i.e. extra steps - * have to be taken to get actual destination properties, which should - * replace the provisional ones). Provisional destination resolvment flow - * will be started when the user attempts to select the destination in - * search UI. - */ - private provisionalType_: DestinationProvisionalType; - - /** - * EULA url for printer's PPD. Empty string indicates no provided EULA. - */ - private eulaUrl_: string = ''; - - /** - * True if the user opened the print preview dropdown and selected a different - * printer than the original destination. - */ - private printerManuallySelected_: boolean = false; - - /** - * Stores the printer status reason for a local Chrome OS printer. - */ - private printerStatusReason_: PrinterStatusReason|null = null; - - /** - * Promise returns |key_| when the printer status request is completed. - */ - private printerStatusRequestedPromise_: Promise<string>|null = null; - - /** - * True if the failed printer status request has already been retried once. - */ - private printerStatusRetrySent_: boolean = false; - - /** - * The length of time to wait before retrying a printer status request. - */ - private printerStatusRetryTimerMs_: number = 3000; - - /** - * Default/allowed values of print options for the given printer set by - * policy. - */ - private managedPrintOptions_: ManagedPrintOptions|null = null; - // </if> - private type_: PrinterType; constructor( @@ -259,18 +171,6 @@ this.extensionName_ = (params && params.extensionName) || ''; this.location_ = (params && params.location) || ''; this.type_ = this.computeType_(id, origin); - // <if expr="is_chromeos"> - this.provisionalType_ = - (params && params.provisionalType) || DestinationProvisionalType.NONE; - - assert( - this.provisionalType_ !== - DestinationProvisionalType.NEEDS_USB_PERMISSION || - this.isExtension, - 'Provisional USB destination only supported with extension origin.'); - - this.managedPrintOptions_ = (params && params.managedPrintOptions) || null; - // </if> } private computeType_(id: string, origin: DestinationOrigin): PrinterType { @@ -341,135 +241,8 @@ } } - // <if expr="is_chromeos"> - get eulaUrl(): string { - return this.eulaUrl_; - } - - set eulaUrl(eulaUrl: string) { - this.eulaUrl_ = eulaUrl; - } - - get printerManuallySelected(): boolean { - return this.printerManuallySelected_; - } - - set printerManuallySelected(printerManuallySelected: boolean) { - this.printerManuallySelected_ = printerManuallySelected; - } - - /** - * @return The printer status reason for a local Chrome OS printer. - */ - get printerStatusReason(): PrinterStatusReason|null { - return this.printerStatusReason_; - } - - set printerStatusReason(printerStatusReason: PrinterStatusReason) { - this.printerStatusReason_ = printerStatusReason; - } - - setPrinterStatusRetryTimeoutForTesting(timeoutMs: number) { - this.printerStatusRetryTimerMs_ = timeoutMs; - } - - /** - * Requests a printer status for the destination. - * @return Promise with destination key. - */ - requestPrinterStatus(): Promise<string> { - // Requesting printer status only allowed for local CrOS printers. - if (this.origin_ !== DestinationOrigin.CROS) { - return Promise.reject(); - } - - // Immediately resolve promise if |printerStatusReason_| is already - // available. - if (this.printerStatusReason_) { - return Promise.resolve(this.key); - } - - // Return existing promise if the printer status has already been requested. - if (this.printerStatusRequestedPromise_) { - return this.printerStatusRequestedPromise_; - } - - // Request printer status then set and return the promise. - this.printerStatusRequestedPromise_ = this.requestPrinterStatusPromise_(); - return this.printerStatusRequestedPromise_; - } - - /** - * Requests a printer status for the destination. If the printer status comes - * back as |PRINTER_UNREACHABLE|, this function will retry and call itself - * again once before resolving the original call. - * @return Promise with destination key. - */ - private requestPrinterStatusPromise_(): Promise<string> { - return NativeLayerCrosImpl.getInstance() - .requestPrinterStatusUpdate(this.id_) - .then(status => { - if (status) { - const statusReason = - getStatusReasonFromPrinterStatus(status as PrinterStatus); - const isPrinterUnreachable = - statusReason === PrinterStatusReason.PRINTER_UNREACHABLE; - if (isPrinterUnreachable && !this.printerStatusRetrySent_) { - this.printerStatusRetrySent_ = true; - return this.printerStatusWaitForTimerPromise_(); - } - - this.printerStatusReason_ = statusReason; - } - return Promise.resolve(this.key); - }); - } - - /** - * Pause for a set timeout then retry the printer status request. - * @return Promise with destination key. - */ - private printerStatusWaitForTimerPromise_(): Promise<string> { - return new Promise<void>((resolve, _reject) => { - setTimeout(() => { - resolve(); - }, this.printerStatusRetryTimerMs_); - }) - .then(() => { - return this.requestPrinterStatusPromise_(); - }); - } - - /** @return Whether the destination is ready to be selected. */ - get readyForSelection(): boolean { - return (this.origin_ !== DestinationOrigin.CROS || - this.capabilities_ !== null) && - !this.isProvisional; - } - - get provisionalType(): DestinationProvisionalType { - return this.provisionalType_; - } - - get isProvisional(): boolean { - return this.provisionalType_ !== DestinationProvisionalType.NONE; - } - - /** - * @return Printer specific print job options set via policy. - */ - get managedPrintOptions(): ManagedPrintOptions|null { - return this.managedPrintOptions_; - } - // </if> - /** @return Path to the SVG for the destination's icon. */ get icon(): string { - // <if expr="is_chromeos"> - if (this.id_ === GooglePromotedDestinationId.SAVE_TO_DRIVE_CROS) { - return 'print-preview:save-to-drive'; - } - // </if> if (this.id_ === GooglePromotedDestinationId.SAVE_AS_PDF) { return 'cr:insert-drive-file'; } @@ -658,18 +431,8 @@ */ export enum GooglePromotedDestinationId { SAVE_AS_PDF = 'Save as PDF', - // <if expr="is_chromeos"> - SAVE_TO_DRIVE_CROS = 'Save to Drive CrOS', - // </if> } /* Unique identifier for the Save as PDF destination */ export const PDF_DESTINATION_KEY: string = `${GooglePromotedDestinationId.SAVE_AS_PDF}/${DestinationOrigin.LOCAL}/`; - -// <if expr="is_chromeos"> -/* Unique identifier for the Save to Drive CrOS destination */ -export const SAVE_TO_DRIVE_CROS_DESTINATION_KEY: string = - `${GooglePromotedDestinationId.SAVE_TO_DRIVE_CROS}/${ - DestinationOrigin.LOCAL}/`; -// </if>
diff --git a/chrome/browser/resources/print_preview/data/destination_cros.ts b/chrome/browser/resources/print_preview/data/destination_cros.ts new file mode 100644 index 0000000..82e936e --- /dev/null +++ b/chrome/browser/resources/print_preview/data/destination_cros.ts
@@ -0,0 +1,649 @@ +// Copyright 2012 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import '/strings.m.js'; + +import {assert} from 'chrome://resources/js/assert.js'; + +import {NativeLayerCrosImpl} from '../native_layer_cros.js'; +import type {Cdd, ColorCapability, ColorOption, CopiesCapability, DpiOption, DuplexType, MediaSizeOption, MediaTypeOption} from './cdd.js'; +import type {ManagedPrintOptions} from './managed_print_options_cros.ts'; +import type {PrinterStatus} from './printer_status_cros.js'; +import {getStatusReasonFromPrinterStatus, PrinterStatusReason} from './printer_status_cros.js'; + +/** + * Enumeration of the origin types for destinations. + */ +export enum DestinationOrigin { + LOCAL = 'local', + // Note: Cookies, device and privet are deprecated, but used to filter any + // legacy entries in the recent destinations, since we can't guarantee all + // such recent printers have been overridden. + COOKIES = 'cookies', + DEVICE = 'device', + PRIVET = 'privet', + EXTENSION = 'extension', + CROS = 'chrome_os', +} + +/** + * Printer types for capabilities and printer list requests. + * Must match PrinterType in printing/mojom/print.mojom + */ +export enum PrinterType { + PRIVET_PRINTER_DEPRECATED = 0, + EXTENSION_PRINTER = 1, + PDF_PRINTER = 2, + LOCAL_PRINTER = 3, + CLOUD_PRINTER_DEPRECATED = 4 +} + +/** + * Enumeration specifying whether a destination is provisional and the reason + * the destination is provisional. + */ +export enum DestinationProvisionalType { + // Destination is not provisional. + NONE = 'NONE', + // User has to grant USB access for the destination to its provider. + // Used for destinations with extension origin. + NEEDS_USB_PERMISSION = 'NEEDS_USB_PERMISSION', +} + +/** + * Enumeration of color modes used by Chromium. + */ +export enum ColorMode { + GRAY = 1, + COLOR = 2, +} + +export interface RecentDestination { + id: string; + origin: DestinationOrigin; + capabilities: Cdd|null; + displayName: string; + extensionId: string; + extensionName: string; + icon?: string; +} + +export function isPdfPrinter(id: string): boolean { + if (id === GooglePromotedDestinationId.SAVE_TO_DRIVE_CROS) { + return true; + } + + return id === GooglePromotedDestinationId.SAVE_AS_PDF; +} + +/** + * Creates a |RecentDestination| to represent |destination| in the app + * state. + */ +export function makeRecentDestination(destination: Destination): + RecentDestination { + return { + id: destination.id, + origin: destination.origin, + capabilities: destination.capabilities, + displayName: destination.displayName || '', + extensionId: destination.extensionId || '', + extensionName: destination.extensionName || '', + icon: destination.icon || '', + }; +} + +/** + * @return key that maps to a destination with the selected |id| and |origin|. + */ +export function createDestinationKey( + id: string, origin: DestinationOrigin): string { + return `${id}/${origin}/`; +} + +/** + * @return A key that maps to a destination with parameters matching + * |recentDestination|. + */ +export function createRecentDestinationKey( + recentDestination: RecentDestination): string { + return createDestinationKey(recentDestination.id, recentDestination.origin); +} + +export interface DestinationOptionalParams { + isEnterprisePrinter?: boolean; + provisionalType?: DestinationProvisionalType; + managedPrintOptions?: ManagedPrintOptions; + extensionId?: string; + extensionName?: string; + description?: string; + location?: string; +} + +/** + * List of capability types considered color. + */ +const COLOR_TYPES: string[] = ['STANDARD_COLOR', 'CUSTOM_COLOR']; + +/** + * List of capability types considered monochrome. + */ +const MONOCHROME_TYPES: string[] = ['STANDARD_MONOCHROME', 'CUSTOM_MONOCHROME']; + + +/** + * Print destination data object. + */ +export class Destination { + /** + * ID of the destination. + */ + private id_: string; + + /** + * Origin of the destination. + */ + private origin_: DestinationOrigin; + + /** + * Display name of the destination. + */ + private displayName_: string; + + /** + * Print capabilities of the destination. + */ + private capabilities_: Cdd|null = null; + + /** + * Whether the destination is an enterprise policy controlled printer. + */ + private isEnterprisePrinter_: boolean; + + /** + * Destination location. + */ + private location_: string = ''; + + /** + * Printer description. + */ + private description_: string; + + /** + * Extension ID for extension managed printers. + */ + private extensionId_: string; + + /** + * Extension name for extension managed printers. + */ + private extensionName_: string; + + /** + * Different from DestinationProvisionalType.NONE if + * the destination is provisional. Provisional destinations cannot be + * selected as they are, but have to be resolved first (i.e. extra steps + * have to be taken to get actual destination properties, which should + * replace the provisional ones). Provisional destination resolvment flow + * will be started when the user attempts to select the destination in + * search UI. + */ + private provisionalType_: DestinationProvisionalType; + + /** + * EULA url for printer's PPD. Empty string indicates no provided EULA. + */ + private eulaUrl_: string = ''; + + /** + * True if the user opened the print preview dropdown and selected a different + * printer than the original destination. + */ + private printerManuallySelected_: boolean = false; + + /** + * Stores the printer status reason for a local Chrome OS printer. + */ + private printerStatusReason_: PrinterStatusReason|null = null; + + /** + * Promise returns |key_| when the printer status request is completed. + */ + private printerStatusRequestedPromise_: Promise<string>|null = null; + + /** + * True if the failed printer status request has already been retried once. + */ + private printerStatusRetrySent_: boolean = false; + + /** + * The length of time to wait before retrying a printer status request. + */ + private printerStatusRetryTimerMs_: number = 3000; + + /** + * Default/allowed values of print options for the given printer set by + * policy. + */ + private managedPrintOptions_: ManagedPrintOptions|null = null; + + private type_: PrinterType; + + constructor( + id: string, origin: DestinationOrigin, displayName: string, + params?: DestinationOptionalParams) { + this.id_ = id; + this.origin_ = origin; + this.displayName_ = displayName || ''; + this.isEnterprisePrinter_ = (params && params.isEnterprisePrinter) || false; + this.description_ = (params && params.description) || ''; + this.extensionId_ = (params && params.extensionId) || ''; + this.extensionName_ = (params && params.extensionName) || ''; + this.location_ = (params && params.location) || ''; + this.type_ = this.computeType_(id, origin); + this.provisionalType_ = + (params && params.provisionalType) || DestinationProvisionalType.NONE; + + assert( + this.provisionalType_ !== + DestinationProvisionalType.NEEDS_USB_PERMISSION || + this.isExtension, + 'Provisional USB destination only supported with extension origin.'); + + this.managedPrintOptions_ = (params && params.managedPrintOptions) || null; + } + + private computeType_(id: string, origin: DestinationOrigin): PrinterType { + if (isPdfPrinter(id)) { + return PrinterType.PDF_PRINTER; + } + + return origin === DestinationOrigin.EXTENSION ? + PrinterType.EXTENSION_PRINTER : + PrinterType.LOCAL_PRINTER; + } + + get type(): PrinterType { + return this.type_; + } + + get id(): string { + return this.id_; + } + + get origin(): DestinationOrigin { + return this.origin_; + } + + get displayName(): string { + return this.displayName_; + } + + /** + * @return Whether the destination is an extension managed printer. + */ + get isExtension(): boolean { + return this.origin_ === DestinationOrigin.EXTENSION; + } + + /** + * @return Most relevant string to help user to identify this + * destination. + */ + get hint(): string { + return this.location_ || this.extensionName || this.description_; + } + + /** + * @return Extension ID associated with the destination. Non-empty + * only for extension managed printers. + */ + get extensionId(): string { + return this.extensionId_; + } + + /** + * @return Extension name associated with the destination. + * Non-empty only for extension managed printers. + */ + get extensionName(): string { + return this.extensionName_; + } + + /** @return Print capabilities of the destination. */ + get capabilities(): Cdd|null { + return this.capabilities_; + } + + set capabilities(capabilities: Cdd|null) { + if (capabilities) { + this.capabilities_ = capabilities; + } + } + + get eulaUrl(): string { + return this.eulaUrl_; + } + + set eulaUrl(eulaUrl: string) { + this.eulaUrl_ = eulaUrl; + } + + get printerManuallySelected(): boolean { + return this.printerManuallySelected_; + } + + set printerManuallySelected(printerManuallySelected: boolean) { + this.printerManuallySelected_ = printerManuallySelected; + } + + /** + * @return The printer status reason for a local Chrome OS printer. + */ + get printerStatusReason(): PrinterStatusReason|null { + return this.printerStatusReason_; + } + + set printerStatusReason(printerStatusReason: PrinterStatusReason) { + this.printerStatusReason_ = printerStatusReason; + } + + setPrinterStatusRetryTimeoutForTesting(timeoutMs: number) { + this.printerStatusRetryTimerMs_ = timeoutMs; + } + + /** + * Requests a printer status for the destination. + * @return Promise with destination key. + */ + requestPrinterStatus(): Promise<string> { + // Requesting printer status only allowed for local CrOS printers. + if (this.origin_ !== DestinationOrigin.CROS) { + return Promise.reject(); + } + + // Immediately resolve promise if |printerStatusReason_| is already + // available. + if (this.printerStatusReason_) { + return Promise.resolve(this.key); + } + + // Return existing promise if the printer status has already been requested. + if (this.printerStatusRequestedPromise_) { + return this.printerStatusRequestedPromise_; + } + + // Request printer status then set and return the promise. + this.printerStatusRequestedPromise_ = this.requestPrinterStatusPromise_(); + return this.printerStatusRequestedPromise_; + } + + /** + * Requests a printer status for the destination. If the printer status comes + * back as |PRINTER_UNREACHABLE|, this function will retry and call itself + * again once before resolving the original call. + * @return Promise with destination key. + */ + private requestPrinterStatusPromise_(): Promise<string> { + return NativeLayerCrosImpl.getInstance() + .requestPrinterStatusUpdate(this.id_) + .then(status => { + if (status) { + const statusReason = + getStatusReasonFromPrinterStatus(status as PrinterStatus); + const isPrinterUnreachable = + statusReason === PrinterStatusReason.PRINTER_UNREACHABLE; + if (isPrinterUnreachable && !this.printerStatusRetrySent_) { + this.printerStatusRetrySent_ = true; + return this.printerStatusWaitForTimerPromise_(); + } + + this.printerStatusReason_ = statusReason; + } + return Promise.resolve(this.key); + }); + } + + /** + * Pause for a set timeout then retry the printer status request. + * @return Promise with destination key. + */ + private printerStatusWaitForTimerPromise_(): Promise<string> { + return new Promise<void>((resolve, _reject) => { + setTimeout(() => { + resolve(); + }, this.printerStatusRetryTimerMs_); + }) + .then(() => { + return this.requestPrinterStatusPromise_(); + }); + } + + /** @return Whether the destination is ready to be selected. */ + get readyForSelection(): boolean { + return (this.origin_ !== DestinationOrigin.CROS || + this.capabilities_ !== null) && + !this.isProvisional; + } + + get provisionalType(): DestinationProvisionalType { + return this.provisionalType_; + } + + get isProvisional(): boolean { + return this.provisionalType_ !== DestinationProvisionalType.NONE; + } + + /** + * @return Printer specific print job options set via policy. + */ + get managedPrintOptions(): ManagedPrintOptions|null { + return this.managedPrintOptions_; + } + + /** @return Path to the SVG for the destination's icon. */ + get icon(): string { + if (this.id_ === GooglePromotedDestinationId.SAVE_TO_DRIVE_CROS) { + return 'print-preview:save-to-drive'; + } + if (this.id_ === GooglePromotedDestinationId.SAVE_AS_PDF) { + return 'cr:insert-drive-file'; + } + if (this.isEnterprisePrinter) { + return 'print-preview:business'; + } + return 'print-preview:print'; + } + + /** + * @return Properties (besides display name) to match search queries against. + */ + get extraPropertiesToMatch(): string[] { + return [this.location_, this.description_]; + } + + /** + * Matches a query against the destination. + * @param query Query to match against the destination. + * @return Whether the query matches this destination. + */ + matches(query: RegExp): boolean { + return !!this.displayName_.match(query) || + !!this.extensionName_.match(query) || !!this.location_.match(query) || + !!this.description_.match(query); + } + + /** + * Whether the printer is enterprise policy controlled printer. + */ + get isEnterprisePrinter(): boolean { + return this.isEnterprisePrinter_; + } + + private copiesCapability_(): CopiesCapability|null { + return this.capabilities && this.capabilities.printer && + this.capabilities.printer.copies ? + this.capabilities.printer.copies : + null; + } + + private colorCapability_(): ColorCapability|null { + return this.capabilities && this.capabilities.printer && + this.capabilities.printer.color ? + this.capabilities.printer.color : + null; + } + + /** @return Whether the printer supports copies. */ + get hasCopiesCapability(): boolean { + const capability = this.copiesCapability_(); + if (!capability) { + return false; + } + return capability.max ? capability.max > 1 : true; + } + + /** + * @return Whether the printer supports both black and white and + * color printing. + */ + get hasColorCapability(): boolean { + const capability = this.colorCapability_(); + if (!capability || !capability.option) { + return false; + } + let hasColor = false; + let hasMonochrome = false; + capability.option.forEach(option => { + assert(option.type); + hasColor = hasColor || COLOR_TYPES.includes(option.type); + hasMonochrome = hasMonochrome || MONOCHROME_TYPES.includes(option.type); + }); + return hasColor && hasMonochrome; + } + + /** + * @param isColor Whether to use a color printing mode. + * @return Native color model of the destination. + */ + getNativeColorModel(isColor: boolean): number { + // For printers without capability, native color model is ignored. + const capability = this.colorCapability_(); + if (!capability || !capability.option) { + return isColor ? ColorMode.COLOR : ColorMode.GRAY; + } + const selected = this.getColor(isColor); + const mode = parseInt(selected ? selected.vendor_id! : '', 10); + if (isNaN(mode)) { + return isColor ? ColorMode.COLOR : ColorMode.GRAY; + } + return mode; + } + + /** + * @return The default color option for the destination. + */ + get defaultColorOption(): ColorOption|null { + const capability = this.colorCapability_(); + if (!capability || !capability.option) { + return null; + } + const defaultOptions = capability.option.filter(option => { + return option.is_default; + }); + return defaultOptions.length !== 0 ? defaultOptions[0] : null; + } + + /** + * @return Color option value of the destination with the given binary color + * value. Returns null if the destination doesn't support such color value. + */ + getColor(isColor: boolean): ColorOption|null { + const typesToLookFor = isColor ? COLOR_TYPES : MONOCHROME_TYPES; + const capability = this.colorCapability_(); + if (!capability || !capability.option) { + return null; + } + for (let i = 0; i < typesToLookFor.length; i++) { + const matchingOptions = capability.option.filter(option => { + return option.type === typesToLookFor[i]; + }); + if (matchingOptions.length > 0) { + return matchingOptions[0]; + } + } + return null; + } + + /** + * @return Media size value of the destination with the given width and height + * values. Returns undefined if there is no such media size value. + */ + getMediaSize(width: number, height: number): MediaSizeOption|undefined { + return this.capabilities?.printer.media_size?.option.find(o => { + return o.width_microns === width && o.height_microns === height; + }); + } + + /** + * @return Media type value of the destination with the given vendor id. + * Returns undefined if there is no such media type value. + */ + getMediaType(vendorId: string): MediaTypeOption|undefined { + return this.capabilities?.printer.media_type?.option.find(o => { + return o.vendor_id === vendorId; + }); + } + + /** + * @return DPI (Dots per Inch) value of the destination with the given + * horizontal and vertical resolutions. Returns undefined if there is no such + * DPI value. + */ + getDpi(horizontal: number, vertical: number): DpiOption|undefined { + return this.capabilities?.printer.dpi?.option.find(o => { + return o.horizontal_dpi === horizontal && o.vertical_dpi === vertical; + }); + } + + /** + * @return Returns true if the current printing destination supports the given + * duplex value. Returns false in all other cases. + */ + supportsDuplex(duplex: DuplexType): boolean { + const availableDuplexOptions = this.capabilities?.printer.duplex?.option; + if (!availableDuplexOptions) { + // There are no duplex capabilities reported by the printer. + return false; + } + + return availableDuplexOptions.some(o => { + return o.type === duplex; + }); + } + + /** @return A unique identifier for this destination. */ + get key(): string { + return `${this.id_}/${this.origin_}/`; + } +} + +/** + * Enumeration of Google-promoted destination IDs. + * @enum {string} + */ +export enum GooglePromotedDestinationId { + SAVE_AS_PDF = 'Save as PDF', + SAVE_TO_DRIVE_CROS = 'Save to Drive CrOS', +} + +/* Unique identifier for the Save as PDF destination */ +export const PDF_DESTINATION_KEY: string = + `${GooglePromotedDestinationId.SAVE_AS_PDF}/${DestinationOrigin.LOCAL}/`; + +/* Unique identifier for the Save to Drive CrOS destination */ +export const SAVE_TO_DRIVE_CROS_DESTINATION_KEY: string = + `${GooglePromotedDestinationId.SAVE_TO_DRIVE_CROS}/${ + DestinationOrigin.LOCAL}/`;
diff --git a/chrome/browser/resources/print_preview/data/destination_match.ts b/chrome/browser/resources/print_preview/data/destination_match.ts index 2de225b..6ef78084 100644 --- a/chrome/browser/resources/print_preview/data/destination_match.ts +++ b/chrome/browser/resources/print_preview/data/destination_match.ts
@@ -2,8 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// <if expr="not is_chromeos"> import type {Destination} from './destination.js'; import {PrinterType} from './destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination} from './destination_cros.js'; +import {PrinterType} from './destination_cros.js'; +// </if> export class DestinationMatch { private idRegExp_: RegExp|null;
diff --git a/chrome/browser/resources/print_preview/data/destination_store.ts b/chrome/browser/resources/print_preview/data/destination_store.ts index da4b07348..79d3a23 100644 --- a/chrome/browser/resources/print_preview/data/destination_store.ts +++ b/chrome/browser/resources/print_preview/data/destination_store.ts
@@ -14,11 +14,14 @@ // </if> import type {Cdd, MediaSizeOption} from './cdd.js'; + +// <if expr="not is_chromeos"> import type {RecentDestination} from './destination.js'; import {createDestinationKey, createRecentDestinationKey, Destination, DestinationOrigin, GooglePromotedDestinationId, isPdfPrinter, PDF_DESTINATION_KEY, PrinterType} from './destination.js'; - +// </if> // <if expr="is_chromeos"> -import {DestinationProvisionalType} from './destination.js'; +import type {RecentDestination} from './destination_cros.js'; +import {createDestinationKey, createRecentDestinationKey, Destination, DestinationOrigin, DestinationProvisionalType, GooglePromotedDestinationId, isPdfPrinter, PDF_DESTINATION_KEY, PrinterType} from './destination_cros.js'; // </if> import {DestinationMatch} from './destination_match.js';
diff --git a/chrome/browser/resources/print_preview/data/local_parsers.ts b/chrome/browser/resources/print_preview/data/local_parsers.ts index f5e452a6..e452e17 100644 --- a/chrome/browser/resources/print_preview/data/local_parsers.ts +++ b/chrome/browser/resources/print_preview/data/local_parsers.ts
@@ -5,11 +5,13 @@ import {assertNotReached} from 'chrome://resources/js/assert.js'; import {isChromeOS} from 'chrome://resources/js/platform.js'; +// <if expr="not is_chromeos"> import type {DestinationOptionalParams} from './destination.js'; import {Destination, DestinationOrigin, PrinterType} from './destination.js'; - +// </if> // <if expr="is_chromeos"> -import {DestinationProvisionalType} from './destination.js'; +import type {DestinationOptionalParams} from './destination_cros.js'; +import {Destination, DestinationOrigin, DestinationProvisionalType, PrinterType} from './destination_cros.js'; import type {PrinterStatus} from './printer_status_cros.js'; import type {ManagedPrintOptions} from './managed_print_options_cros.ts'; // </if>
diff --git a/chrome/browser/resources/print_preview/data/model.ts b/chrome/browser/resources/print_preview/data/model.ts index 7480dd97..d7da072 100644 --- a/chrome/browser/resources/print_preview/data/model.ts +++ b/chrome/browser/resources/print_preview/data/model.ts
@@ -16,8 +16,14 @@ import type {CapabilityWithReset, Cdd, CddCapabilities, ColorOption, DpiOption, DuplexOption, MediaSizeOption, MediaTypeOption} from './cdd.js'; import {DuplexType} from './cdd.js'; +// <if expr="not is_chromeos"> import type {Destination, RecentDestination} from './destination.js'; import {DestinationOrigin, GooglePromotedDestinationId, PrinterType} from './destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination, RecentDestination} from './destination_cros.js'; +import {DestinationOrigin, GooglePromotedDestinationId, PrinterType} from './destination_cros.js'; +// </if> import type {DocumentSettings} from './document_info.js'; import type {Margins, MarginsSetting} from './margins.js'; import {CustomMarginsOrientation, MarginsType} from './margins.js';
diff --git a/chrome/browser/resources/print_preview/native_layer.ts b/chrome/browser/resources/print_preview/native_layer.ts index 4834eb6..a43ad06b 100644 --- a/chrome/browser/resources/print_preview/native_layer.ts +++ b/chrome/browser/resources/print_preview/native_layer.ts
@@ -5,7 +5,12 @@ import {sendWithPromise} from 'chrome://resources/js/cr.js'; import type {Cdd} from './data/cdd.js'; +// <if expr="not is_chromeos"> import type {PrinterType} from './data/destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {PrinterType} from './data/destination_cros.js'; +// </if> import type {LocalDestinationInfo} from './data/local_parsers.js'; import type {MeasurementSystemUnitType} from './data/measurement_system.js';
diff --git a/chrome/browser/resources/print_preview/print_preview.ts b/chrome/browser/resources/print_preview/print_preview.ts index 41f68e4d..9b37516 100644 --- a/chrome/browser/resources/print_preview/print_preview.ts +++ b/chrome/browser/resources/print_preview/print_preview.ts
@@ -10,9 +10,11 @@ export {PluralStringProxyImpl as PrintPreviewPluralStringProxyImpl} from 'chrome://resources/js/plural_string_proxy.js'; export {getTrustedHTML} from 'chrome://resources/js/static_types.js'; export {Cdd, ColorOption, DpiOption, DuplexOption, DuplexType, MediaSizeCapability, MediaSizeOption, MediaTypeCapability, MediaTypeOption, PageOrientationOption, SelectOption, VendorCapabilityValueType} from './data/cdd.js'; +// <if expr="not is_chromeos"> export {ColorMode, createDestinationKey, Destination, DestinationOptionalParams, DestinationOrigin, GooglePromotedDestinationId, makeRecentDestination, PDF_DESTINATION_KEY, PrinterType, RecentDestination} from './data/destination.js'; +// </if> // <if expr="is_chromeos"> -export {SAVE_TO_DRIVE_CROS_DESTINATION_KEY} from './data/destination.js'; +export {ColorMode, createDestinationKey, Destination, DestinationOptionalParams, DestinationOrigin, GooglePromotedDestinationId, makeRecentDestination, PDF_DESTINATION_KEY, PrinterType, RecentDestination, SAVE_TO_DRIVE_CROS_DESTINATION_KEY} from './data/destination_cros.js'; // </if> export {DestinationErrorType, DestinationStore, DestinationStoreEventType} from './data/destination_store.js'; export {PageLayoutInfo} from './data/document_info.js';
diff --git a/chrome/browser/resources/print_preview/ui/advanced_options_settings.ts b/chrome/browser/resources/print_preview/ui/advanced_options_settings.ts index 76422ce0..3f33849a 100644 --- a/chrome/browser/resources/print_preview/ui/advanced_options_settings.ts +++ b/chrome/browser/resources/print_preview/ui/advanced_options_settings.ts
@@ -10,7 +10,12 @@ import type {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +// <if expr="not is_chromeos"> import type {Destination} from '../data/destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination} from '../data/destination_cros.js'; +// </if> import type {Settings} from '../data/model.js'; import {getTemplate} from './advanced_options_settings.html.js';
diff --git a/chrome/browser/resources/print_preview/ui/advanced_settings_dialog.ts b/chrome/browser/resources/print_preview/ui/advanced_settings_dialog.ts index 9609918..3b1ab68 100644 --- a/chrome/browser/resources/print_preview/ui/advanced_settings_dialog.ts +++ b/chrome/browser/resources/print_preview/ui/advanced_settings_dialog.ts
@@ -16,7 +16,12 @@ import {removeHighlights} from 'chrome://resources/js/search_highlight_utils.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +// <if expr="not is_chromeos"> import type {Destination} from '../data/destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination} from '../data/destination_cros.js'; +// </if> import {MetricsContext, PrintSettingsUiBucket} from '../metrics.js'; import {getTemplate} from './advanced_settings_dialog.html.js';
diff --git a/chrome/browser/resources/print_preview/ui/app.ts b/chrome/browser/resources/print_preview/ui/app.ts index f233f3c4..faa36196 100644 --- a/chrome/browser/resources/print_preview/ui/app.ts +++ b/chrome/browser/resources/print_preview/ui/app.ts
@@ -16,8 +16,14 @@ import {hasKeyModifiers} from 'chrome://resources/js/util.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +// <if expr="not is_chromeos"> import type {Destination} from '../data/destination.js'; import {DestinationOrigin, PrinterType} from '../data/destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination} from '../data/destination_cros.js'; +import {DestinationOrigin, PrinterType} from '../data/destination_cros.js'; +// </if> import type {DocumentSettings, PrintPreviewDocumentInfoElement} from '../data/document_info.js'; import type {Margins} from '../data/margins.js'; import {MeasurementSystem} from '../data/measurement_system.js';
diff --git a/chrome/browser/resources/print_preview/ui/button_strip.ts b/chrome/browser/resources/print_preview/ui/button_strip.ts index e5ac4be..82d4972 100644 --- a/chrome/browser/resources/print_preview/ui/button_strip.ts +++ b/chrome/browser/resources/print_preview/ui/button_strip.ts
@@ -17,8 +17,14 @@ // </if> import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +// <if expr="not is_chromeos"> import type {Destination} from '../data/destination.js'; import {PrinterType} from '../data/destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination} from '../data/destination_cros.js'; +import {PrinterType} from '../data/destination_cros.js'; +// </if> import {State} from '../data/state.js'; import {getTemplate} from './button_strip.html.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_dialog_cros.ts b/chrome/browser/resources/print_preview/ui/destination_dialog_cros.ts index d6879665..4354b8f 100644 --- a/chrome/browser/resources/print_preview/ui/destination_dialog_cros.ts +++ b/chrome/browser/resources/print_preview/ui/destination_dialog_cros.ts
@@ -28,8 +28,8 @@ import {EventTracker} from 'chrome://resources/js/event_tracker.js'; import {PolymerElement, timeOut} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import type {Destination} from '../data/destination.js'; -import {GooglePromotedDestinationId} from '../data/destination.js'; +import type {Destination} from '../data/destination_cros.js'; +import {GooglePromotedDestinationId} from '../data/destination_cros.js'; import type {DestinationStore} from '../data/destination_store.js'; import {DestinationStoreEventType} from '../data/destination_store.js'; import {PrintServerStore, PrintServerStoreEventType} from '../data/print_server_store.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_dropdown_cros.ts b/chrome/browser/resources/print_preview/ui/destination_dropdown_cros.ts index 51fa9a2e..beffe1f 100644 --- a/chrome/browser/resources/print_preview/ui/destination_dropdown_cros.ts +++ b/chrome/browser/resources/print_preview/ui/destination_dropdown_cros.ts
@@ -13,7 +13,7 @@ import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import type {Destination} from '../data/destination.js'; +import type {Destination} from '../data/destination_cros.js'; import type {PrinterStatusReason} from '../data/printer_status_cros.js'; import {ERROR_STRING_KEY_MAP, getPrinterStatusIcon} from '../data/printer_status_cros.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_list.ts b/chrome/browser/resources/print_preview/ui/destination_list.ts index 1120e8d..0e74021 100644 --- a/chrome/browser/resources/print_preview/ui/destination_list.ts +++ b/chrome/browser/resources/print_preview/ui/destination_list.ts
@@ -19,7 +19,12 @@ import type {IronListElement} from 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +// <if expr="not is_chromeos"> import type {Destination} from '../data/destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination} from '../data/destination_cros.js'; +// </if> import {getTemplate} from './destination_list.html.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_list_item_cros.ts b/chrome/browser/resources/print_preview/ui/destination_list_item_cros.ts index f608274..dbe0af7 100644 --- a/chrome/browser/resources/print_preview/ui/destination_list_item_cros.ts +++ b/chrome/browser/resources/print_preview/ui/destination_list_item_cros.ts
@@ -16,8 +16,8 @@ import {removeHighlights} from 'chrome://resources/js/search_highlight_utils.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import type {Destination} from '../data/destination.js'; -import {DestinationOrigin} from '../data/destination.js'; +import type {Destination} from '../data/destination_cros.js'; +import {DestinationOrigin} from '../data/destination_cros.js'; import {ERROR_STRING_KEY_MAP, getPrinterStatusIcon, getStatusTextColorClass, PrinterStatusReason} from '../data/printer_status_cros.js'; import {getTemplate} from './destination_list_item_cros.html.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_select_cros.ts b/chrome/browser/resources/print_preview/ui/destination_select_cros.ts index 5cdd6fc..67c6b80 100644 --- a/chrome/browser/resources/print_preview/ui/destination_select_cros.ts +++ b/chrome/browser/resources/print_preview/ui/destination_select_cros.ts
@@ -17,8 +17,8 @@ import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import type {Destination} from '../data/destination.js'; -import {DestinationOrigin, GooglePromotedDestinationId, PDF_DESTINATION_KEY} from '../data/destination.js'; +import type {Destination} from '../data/destination_cros.js'; +import {DestinationOrigin, GooglePromotedDestinationId, PDF_DESTINATION_KEY} from '../data/destination_cros.js'; import {ERROR_STRING_KEY_MAP, getPrinterStatusIcon, getStatusTextColorClass, PrinterStatusReason} from '../data/printer_status_cros.js'; import type {Error, State} from '../data/state.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_settings.ts b/chrome/browser/resources/print_preview/ui/destination_settings.ts index d474a18..5bffa97 100644 --- a/chrome/browser/resources/print_preview/ui/destination_settings.ts +++ b/chrome/browser/resources/print_preview/ui/destination_settings.ts
@@ -30,11 +30,13 @@ import {EventTracker} from 'chrome://resources/js/event_tracker.js'; import {beforeNextRender, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +// <if expr="not is_chromeos"> import type {Destination, RecentDestination} from '../data/destination.js'; import {createRecentDestinationKey, isPdfPrinter, makeRecentDestination, PrinterType} from '../data/destination.js'; - +// </if> // <if expr="is_chromeos"> -import {SAVE_TO_DRIVE_CROS_DESTINATION_KEY} from '../data/destination.js'; +import type {Destination, RecentDestination} from '../data/destination_cros.js'; +import {createRecentDestinationKey, isPdfPrinter, makeRecentDestination, PrinterType, SAVE_TO_DRIVE_CROS_DESTINATION_KEY} from '../data/destination_cros.js'; // </if> import {DestinationErrorType, DestinationStore, DestinationStoreEventType} from '../data/destination_store.js';
diff --git a/chrome/browser/resources/print_preview/ui/header.ts b/chrome/browser/resources/print_preview/ui/header.ts index 7786d873..e89f00d 100644 --- a/chrome/browser/resources/print_preview/ui/header.ts +++ b/chrome/browser/resources/print_preview/ui/header.ts
@@ -12,8 +12,14 @@ import {PluralStringProxyImpl} from 'chrome://resources/js/plural_string_proxy.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +// <if expr="not is_chromeos"> import type {Destination} from '../data/destination.js'; import {PrinterType} from '../data/destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination} from '../data/destination_cros.js'; +import {PrinterType} from '../data/destination_cros.js'; +// </if> import {Error, State} from '../data/state.js'; import {getTemplate} from './header.html.js';
diff --git a/chrome/browser/resources/print_preview/ui/link_container.ts b/chrome/browser/resources/print_preview/ui/link_container.ts index 971daa2..3d48873e 100644 --- a/chrome/browser/resources/print_preview/ui/link_container.ts +++ b/chrome/browser/resources/print_preview/ui/link_container.ts
@@ -10,10 +10,14 @@ import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +// <if expr="not is_chromeos"> import type {Destination} from '../data/destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination} from '../data/destination_cros.js'; +// </if> // <if expr="is_win"> import {DestinationOrigin, GooglePromotedDestinationId} from '../data/destination.js'; - // </if> import {getTemplate} from './link_container.html.js';
diff --git a/chrome/browser/resources/print_preview/ui/preview_area.ts b/chrome/browser/resources/print_preview/ui/preview_area.ts index f04c03a..ea79e2ce 100644 --- a/chrome/browser/resources/print_preview/ui/preview_area.ts +++ b/chrome/browser/resources/print_preview/ui/preview_area.ts
@@ -17,7 +17,12 @@ import {DarkModeMixin} from '../dark_mode_mixin.js'; import {Coordinate2d} from '../data/coordinate2d.js'; +// <if expr="not is_chromeos"> import type {Destination} from '../data/destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination} from '../data/destination_cros.js'; +// </if> import type {Margins, MarginsSetting} from '../data/margins.js'; import {CustomMarginsOrientation, MarginsType} from '../data/margins.js'; import type {MeasurementSystem} from '../data/measurement_system.js';
diff --git a/chrome/browser/resources/print_preview/ui/provisional_destination_resolver.ts b/chrome/browser/resources/print_preview/ui/provisional_destination_resolver.ts index f4c4270e..b0779f2 100644 --- a/chrome/browser/resources/print_preview/ui/provisional_destination_resolver.ts +++ b/chrome/browser/resources/print_preview/ui/provisional_destination_resolver.ts
@@ -17,7 +17,7 @@ import {PromiseResolver} from 'chrome://resources/js/promise_resolver.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import type {Destination} from '../data/destination.js'; +import type {Destination} from '../data/destination_cros.js'; import type {DestinationStore} from '../data/destination_store.js'; import {getTemplate} from './provisional_destination_resolver.html.js';
diff --git a/chrome/browser/resources/print_preview/ui/sidebar.ts b/chrome/browser/resources/print_preview/ui/sidebar.ts index 5de759a..adea7cf 100644 --- a/chrome/browser/resources/print_preview/ui/sidebar.ts +++ b/chrome/browser/resources/print_preview/ui/sidebar.ts
@@ -37,7 +37,12 @@ import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {DarkModeMixin} from '../dark_mode_mixin.js'; +// <if expr="not is_chromeos"> import type {Destination} from '../data/destination.js'; +// </if> +// <if expr="is_chromeos"> +import type {Destination} from '../data/destination_cros.js'; +// </if> import type {Settings} from '../data/model.js'; import type {Error} from '../data/state.js'; import {State} from '../data/state.js';
diff --git a/chrome/browser/screen_ai/BUILD.gn b/chrome/browser/screen_ai/BUILD.gn index eaab3da..6b1e8a9a 100644 --- a/chrome/browser/screen_ai/BUILD.gn +++ b/chrome/browser/screen_ai/BUILD.gn
@@ -3,6 +3,9 @@ # found in the LICENSE file. import("//build/config/ui.gni") +import("//services/screen_ai/buildflags/features.gni") + +assert(enable_screen_ai_service) if (is_chromeos_ash) { source_set("screen_ai_dlc_installer") {
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index d498250..034f6d5 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1735451472-56c060422364a5697f3465a4d7aa0ccac0c407f9-ec5bd1cc104094de4feb80c8161cd9681c7ea6f5.profdata +chrome-android32-main-1735537811-9ff0ebafce33baeb34c46cbd092c651c92cbd185-e7a4449a3f7a905b9bf072183ba73c3a9464ee13.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index c0245436..8d81bb3 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1735459564-7d3e26f09f48c24e8d11a81d4275470d6d081af1-745bf58b851c7926f799fc14ab4f50eeb6655c7f.profdata +chrome-android64-main-1735554516-ebb4e967ca74437847066ff5c5f3c13191ca5f76-99fb87b6c7a8449a525c2435b173b5c7d0dd3e96.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index ca8c0a5..ea87efe 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1735451472-61239c5932e24e7828a539273ce6a4eef2381765-ec5bd1cc104094de4feb80c8161cd9681c7ea6f5.profdata +chrome-linux-main-1735537811-cb6525447cb02893fa1d337524fd0ce92937f78a-e7a4449a3f7a905b9bf072183ba73c3a9464ee13.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 449f887..e732441 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1735459037-8037fce1d215c23d9d362033d6565e7939d8f7c1-47f55e53034b7e5b3cfbbca6420d0988a9cd813b.profdata +chrome-mac-arm-main-1735552732-b3f588a7e80b2ac7ae3f0b32734ff5aca9b13f93-505229a9411e35532e0a94bd50551c1cbb3e90cc.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index a8d6c965..85138e17 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1735430345-c84ddd63d1fedd22ca9a33a162f610b90938a06e-f64374e56aced57a05bc90b9fcac08bd0ec5e359.profdata +chrome-mac-main-1735537811-9541df61cd23f3aee6ed74f41eb1cc5eaa349c86-e7a4449a3f7a905b9bf072183ba73c3a9464ee13.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index 750cc01..02af85c 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1735451472-40a8055d067f40efb423eba8ee1c5c4a0db9acf3-ec5bd1cc104094de4feb80c8161cd9681c7ea6f5.profdata +chrome-win-arm64-main-1735537811-7bf69d82c5db443742045a2c8775e9eea6d92fb3-e7a4449a3f7a905b9bf072183ba73c3a9464ee13.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index e74cbb0..64800c9 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1735430345-c6ce4433101b0faf9e948fc1cac9ae76c649dbd7-f64374e56aced57a05bc90b9fcac08bd0ec5e359.profdata +chrome-win32-main-1735537811-7ec77ff200c5a31b304dee665828bf3db84c328f-e7a4449a3f7a905b9bf072183ba73c3a9464ee13.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index a27a5332..370a514 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1735440228-24a5814026d05e378b99d24ed40f64db1924377e-61ba7b9de55bffa119bde2ed40304457a0455705.profdata +chrome-win64-main-1735525590-33ff5cf54d6ff75ac3c4a6dd1bad415d9189c503-b4435a64f29bea2877e54c65db67b6c0f648e2c4.profdata
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index 2c3a7d7..845cfbe5 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -16142.0.0-1065722 \ No newline at end of file +16143.0.0-1065741 \ No newline at end of file
diff --git a/chromeos/ash/components/BUILD.gn b/chromeos/ash/components/BUILD.gn index 7453819..ae46842 100644 --- a/chromeos/ash/components/BUILD.gn +++ b/chromeos/ash/components/BUILD.gn
@@ -61,7 +61,6 @@ "//chromeos/ash/components/scalable_iph:unit_tests", "//chromeos/ash/components/settings:unit_tests", "//chromeos/ash/components/smbfs:unit_tests", - "//chromeos/ash/components/sparky:unit_tests", "//chromeos/ash/components/specialized_features:unit_tests", "//chromeos/ash/components/string_matching:unit_tests", "//chromeos/ash/components/sync_wifi:unit_tests",
diff --git a/chromeos/ash/components/dbus/printscanmgr/printscanmgr_client.cc b/chromeos/ash/components/dbus/printscanmgr/printscanmgr_client.cc index ce293b3f..b92af66 100644 --- a/chromeos/ash/components/dbus/printscanmgr/printscanmgr_client.cc +++ b/chromeos/ash/components/dbus/printscanmgr/printscanmgr_client.cc
@@ -30,6 +30,8 @@ PrintscanmgrClient* g_instance = nullptr; +constexpr base::TimeDelta kAutoconfiguredTimeout = base::Seconds(30); + printscanmgr::AddPrinterResult DBusErrorFromString( const std::string& dbus_error_string) { static const base::NoDestructor< @@ -109,7 +111,7 @@ } printscanmgr_proxy_->CallMethodWithErrorResponse( - &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, + &method_call, kAutoconfiguredTimeout.InMilliseconds(), base::BindOnce(&PrintscanmgrClientImpl::OnPrinterAdded< printscanmgr::CupsAddAutoConfiguredPrinterResponse>, weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
diff --git a/chromeos/ash/components/dbus/printscanmgr/printscanmgr_client_unittest.cc b/chromeos/ash/components/dbus/printscanmgr/printscanmgr_client_unittest.cc index 2fe3e30c..ae4e5f4 100644 --- a/chromeos/ash/components/dbus/printscanmgr/printscanmgr_client_unittest.cc +++ b/chromeos/ash/components/dbus/printscanmgr/printscanmgr_client_unittest.cc
@@ -31,6 +31,8 @@ namespace { +constexpr base::TimeDelta kAutoconfiguredTimeout = base::Seconds(30); + // Convenience method for creating a CupsAddManuallyConfiguredPrinterRequest. printscanmgr::CupsAddManuallyConfiguredPrinterRequest CreateCupsAddManuallyConfiguredPrinterRequest() { @@ -169,7 +171,7 @@ EXPECT_CALL(*mock_proxy_.get(), DoCallMethodWithErrorResponse( HasMember(printscanmgr::kCupsAddAutoConfiguredPrinter), - dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + kAutoconfiguredTimeout.InMilliseconds(), _)) .WillOnce(Invoke( this, &PrintscanmgrClientTest::OnCallCupsAddAutoConfiguredPrinter)); }
diff --git a/chromeos/ash/components/sparky/BUILD.gn b/chromeos/ash/components/sparky/BUILD.gn deleted file mode 100644 index 30adcff..0000000 --- a/chromeos/ash/components/sparky/BUILD.gn +++ /dev/null
@@ -1,54 +0,0 @@ -# Copyright 2024 The Chromium Authors -# Use of this source code is governed by a BSD - style license that can be -# found in the LICENSE file. - -import("//build/config/chromeos/ui_mode.gni") - -assert(is_chromeos_ash, "Non-ChromeOS builds cannot depend on //ash") - -component("sparky") { - sources = [ - "snapshot_util.cc", - "snapshot_util.h", - "sparky_util.cc", - "sparky_util.h", - "system_info_delegate_impl.cc", - "system_info_delegate_impl.h", - ] - - defines = [ "IS_CHROMEOS_ASH_COMPONENTS_SPARKY_IMPL" ] - - deps = [ - "//ash", - "//ash/strings:strings", - "//base", - "//chromeos/ash/components/system_info", - "//chromeos/ash/services/cros_healthd/public/cpp", - "//chromeos/ash/services/cros_healthd/public/mojom:mojom", - "//chromeos/constants:constants", - "//chromeos/dbus/power", - "//components/manta", - "//mojo/public/cpp/bindings", - "//ui/base", - "//ui/gfx", - "//ui/snapshot", - ] -} - -source_set("unit_tests") { - testonly = true - - sources = [ "system_info_delegate_impl_unittest.cc" ] - - deps = [ - ":sparky", - "//base/test:test_support", - "//chromeos/ash/components/mojo_service_manager:test_support", - "//chromeos/ash/components/system_info", - "//chromeos/ash/services/cros_healthd/public/cpp:fakes", - "//chromeos/dbus/power", - "//components/manta", - "//testing/gtest", - "//testing/gtest", - ] -}
diff --git a/chromeos/ash/components/sparky/DEPS b/chromeos/ash/components/sparky/DEPS deleted file mode 100644 index c1cc697a..0000000 --- a/chromeos/ash/components/sparky/DEPS +++ /dev/null
@@ -1,13 +0,0 @@ -include_rules = [ - "+ash/shell.h", - "+chromeos/ash/components/mojo_service_manager/fake_mojo_service_manager.h", - "+chromeos/ash/components/system_info", - "+chromeos/ash/services/cros_healthd/public/cpp", - "+chromeos/ash/services/cros_healthd/public/mojom", - "+chromeos/dbus/power", - "+components/manta", - "+mojo/public/cpp/bindings/remote.h", - "+ui/base/text/bytes_formatting.h", - "+ui/gfx/image", - "+ui/snapshot" -]
diff --git a/chromeos/ash/components/sparky/OWNERS b/chromeos/ash/components/sparky/OWNERS deleted file mode 100644 index e2e1a59f..0000000 --- a/chromeos/ash/components/sparky/OWNERS +++ /dev/null
@@ -1,3 +0,0 @@ -laurencom@chromium.org -chenjih@google.com -tby@chromium.org
diff --git a/chromeos/ash/components/sparky/snapshot_util.cc b/chromeos/ash/components/sparky/snapshot_util.cc deleted file mode 100644 index aba4651..0000000 --- a/chromeos/ash/components/sparky/snapshot_util.cc +++ /dev/null
@@ -1,35 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chromeos/ash/components/sparky/snapshot_util.h" - -#include <algorithm> - -#include "ash/shell.h" -#include "base/check.h" -#include "base/containers/span.h" -#include "base/memory/ptr_util.h" -#include "base/memory/scoped_refptr.h" -#include "ui/gfx/image/image.h" -#include "ui/snapshot/snapshot.h" - -namespace sparky { - -ScreenshotHandler::ScreenshotHandler() = default; - -ScreenshotHandler::~ScreenshotHandler() = default; - -void ScreenshotHandler::TakeScreenshot(ScreenshotDataCallback done_callback) { - // TODO: Support multiple displays. For now, use the most - // recently active display. - aura::Window* root = ash::Shell::GetRootWindowForNewWindows(); - DCHECK(root); - - ui::GrabWindowSnapshotAsPNG( - root, - /*source_rect=*/gfx::Rect(gfx::Point(), root->bounds().size()), - base::BindOnce(std::move(done_callback))); -} - -} // namespace sparky
diff --git a/chromeos/ash/components/sparky/snapshot_util.h b/chromeos/ash/components/sparky/snapshot_util.h deleted file mode 100644 index 01d4994..0000000 --- a/chromeos/ash/components/sparky/snapshot_util.h +++ /dev/null
@@ -1,33 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROMEOS_ASH_COMPONENTS_SPARKY_SNAPSHOT_UTIL_H_ -#define CHROMEOS_ASH_COMPONENTS_SPARKY_SNAPSHOT_UTIL_H_ - -#include "base/component_export.h" -#include "base/functional/callback.h" -#include "base/memory/ref_counted_memory.h" - -namespace sparky { - -using ScreenshotDataCallback = - base::OnceCallback<void(scoped_refptr<base::RefCountedMemory>)>; - -// Handles taking a screenshot of the open windows. -// Encodes the screenshot as jpg and returns it with the callback. -class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SPARKY) ScreenshotHandler { - public: - ScreenshotHandler(); - ScreenshotHandler(const ScreenshotHandler&) = delete; - ScreenshotHandler& operator=(const ScreenshotHandler&) = delete; - ~ScreenshotHandler(); - - // Takes a screenshot of the windows on the active desk and writes it to disk. - // Invokes `done_callback` when done. - void TakeScreenshot(ScreenshotDataCallback done_callback); -}; - -} // namespace sparky - -#endif // CHROMEOS_ASH_COMPONENTS_SPARKY_SNAPSHOT_UTIL_H_
diff --git a/chromeos/ash/components/sparky/sparky_util.cc b/chromeos/ash/components/sparky/sparky_util.cc deleted file mode 100644 index 5720ea3..0000000 --- a/chromeos/ash/components/sparky/sparky_util.cc +++ /dev/null
@@ -1,34 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chromeos/ash/components/sparky/sparky_util.h" - -namespace sparky { - -int64_t RoundByteSize(int64_t bytes) { - if (bytes < 0) { - return -1; - } - - if (bytes == 0) { - return 0; - } - - // Subtract one to the original number of bytes. - bytes--; - // Set all the lower bits to 1. - bytes |= bytes >> 1; - bytes |= bytes >> 2; - bytes |= bytes >> 4; - bytes |= bytes >> 8; - bytes |= bytes >> 16; - bytes |= bytes >> 32; - // Add one. The one bit beyond the highest set bit is set to 1. All the lower - // bits are set to 0. - bytes++; - - return bytes; -} - -} // namespace sparky
diff --git a/chromeos/ash/components/sparky/sparky_util.h b/chromeos/ash/components/sparky/sparky_util.h deleted file mode 100644 index 8c14ff4..0000000 --- a/chromeos/ash/components/sparky/sparky_util.h +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROMEOS_ASH_COMPONENTS_SPARKY_SPARKY_UTIL_H_ -#define CHROMEOS_ASH_COMPONENTS_SPARKY_SPARKY_UTIL_H_ - -#include <cstdint> - -#include "base/component_export.h" - -namespace sparky { - -// Round |bytes| to the next power of 2, where the next power of 2 is greater -// than or equal to |bytes|. -// RoundByteSize(3) will return 4. -// RoundByteSize(4) will return 4. -int64_t COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SPARKY) - RoundByteSize(int64_t bytes); - -} // namespace sparky - -#endif // CHROMEOS_ASH_COMPONENTS_SPARKY_SPARKY_UTIL_H_
diff --git a/chromeos/ash/components/sparky/system_info_delegate_impl.cc b/chromeos/ash/components/sparky/system_info_delegate_impl.cc deleted file mode 100644 index 89b8f31..0000000 --- a/chromeos/ash/components/sparky/system_info_delegate_impl.cc +++ /dev/null
@@ -1,274 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chromeos/ash/components/sparky/system_info_delegate_impl.h" - -#include <memory> -#include <optional> - -#include "base/strings/string_number_conversions.h" -#include "base/strings/utf_string_conversions.h" -#include "base/time/time.h" -#include "chromeos/ash/components/system_info/battery_health.h" -#include "chromeos/ash/components/system_info/memory_data.h" -#include "chromeos/ash/components/system_info/system_info_util.h" -#include "chromeos/ash/services/cros_healthd/public/cpp/service_connection.h" -#include "chromeos/dbus/power/power_manager_client.h" -#include "components/manta/sparky/system_info_delegate.h" -#include "ui/base/text/bytes_formatting.h" - -namespace sparky { - -namespace { - -using ProbeCategories = ::ash::cros_healthd::mojom::ProbeCategoryEnum; -using ::ash::cros_healthd::mojom::BatteryInfo; -using ::ash::cros_healthd::mojom::CpuInfo; -using ::ash::cros_healthd::mojom::PhysicalCpuInfoPtr; -using ::ash::cros_healthd::mojom::TelemetryInfoPtr; - -constexpr int kCpuUsageRefreshIntervalInMilliseconds = 200; - -double ConvertKBtoGB(uint32_t amount) { - return static_cast<double>(amount) / 1024 / 1024; -} - -void PopulatePowerStatus(const power_manager::PowerSupplyProperties& proto, - system_info::BatteryHealth& battery_health) { - bool calculating = proto.is_calculating_battery_time(); - int percent = system_info::GetRoundedBatteryPercent(proto.battery_percent()); - CHECK(percent <= 100 && percent >= 0); - - if (!calculating) { - bool charging = - proto.battery_state() == power_manager::PowerSupplyProperties::CHARGING; - base::TimeDelta time_left = - base::Seconds(charging ? proto.battery_time_to_full_sec() - : proto.battery_time_to_empty_sec()); - if (system_info::ShouldDisplayBatteryTime(time_left)) { - // TODO (b:342609231) replace with a translation string. - battery_health.SetPowerTime( - charging ? system_info::GetBatteryTimeText(time_left) + u" until full" - : system_info::GetBatteryTimeText(time_left) + u" left"); - } - } - battery_health.SetBatteryPercentage(percent); -} - -} // namespace - -SystemInfoDelegateImpl::SystemInfoDelegateImpl() - : cpu_usage_timer_(std::make_unique<base::RepeatingTimer>()) {} - -SystemInfoDelegateImpl::~SystemInfoDelegateImpl() {} - -void SystemInfoDelegateImpl::ObtainDiagnostics( - const std::vector<manta::Diagnostics>& diagnostics, - manta::DiagnosticsDataCallback diagnostics_callback) { - // Invalidate weak pointers to cancel existing searches. - weak_factory_.InvalidateWeakPtrs(); - diagnostics_callback_ = std::move(diagnostics_callback); - diagnostics_error_ = false; - for (manta::Diagnostics diagnostics_option : diagnostics) { - switch (diagnostics_option) { - case manta::Diagnostics::kMemory: { - UpdateMemoryUsage(); - break; - } - case manta::Diagnostics::kBattery: { - UpdateBatteryInfo(); - break; - } - case manta::Diagnostics::kCpu: { - cpu_refreshes_left_ = 2; - cpu_usage_timer_->Start( - FROM_HERE, - base::Milliseconds(kCpuUsageRefreshIntervalInMilliseconds), - base::BindRepeating(&SystemInfoDelegateImpl::UpdateCpuUsage, - weak_factory_.GetWeakPtr())); - break; - } - case manta::Diagnostics::kStorage: { - // TODO (b:340963863) This field will be handled within the Sparky - // Delegate Impl as it requires a profile to obtain the storage data. - break; - } - } - } - diagnostics_requested_ = diagnostics; -} - -void SystemInfoDelegateImpl::OnDiagnosticsUpdated() { - if (diagnostics_error_) { // TODO (b:343072278) add in a test case for - // diagnostics error. - return; - } - // Check if all of the requested diagnostics fields have been calculated yet. - // Only return the results once all of the values are found. - for (auto diagnostics_type : diagnostics_requested_) { - if (diagnostics_type == manta::Diagnostics::kMemory && !memory_data_) { - return; - } - if (diagnostics_type == manta::Diagnostics::kCpu && !cpu_data_) { - return; - } - if (diagnostics_type == manta::Diagnostics::kBattery && !battery_data_) { - return; - } - } - if (diagnostics_callback_) { - std::move(diagnostics_callback_) - .Run(std::make_unique<manta::DiagnosticsData>( - battery_data_ ? std::optional<manta::BatteryData>(*battery_data_) - : std::nullopt, - cpu_data_ ? std::optional<manta::CpuData>(*cpu_data_) - : std::nullopt, - memory_data_ ? std::optional<manta::MemoryData>(*memory_data_) - : std::nullopt, - std::nullopt)); - } -} - -void SystemInfoDelegateImpl::ReturnWithNullptr() { - diagnostics_error_ = true; - if (diagnostics_callback_) { - std::move(diagnostics_callback_).Run(nullptr); - } - // Invalidate weak pointers to cancel existing searches. - weak_factory_.InvalidateWeakPtrs(); -} - -void SystemInfoDelegateImpl::UpdateMemoryUsage() { - auto* probe_service = - ash::cros_healthd::ServiceConnection::GetInstance()->GetProbeService(); - - probe_service->ProbeTelemetryInfo( - {ProbeCategories::kMemory}, - base::BindOnce(&SystemInfoDelegateImpl::OnMemoryUsageUpdated, - weak_factory_.GetWeakPtr())); -} - -void SystemInfoDelegateImpl::UpdateCpuUsage() { - auto* probe_service = - ash::cros_healthd::ServiceConnection::GetInstance()->GetProbeService(); - - probe_service->ProbeTelemetryInfo( - {ProbeCategories::kCpu}, - base::BindOnce(&SystemInfoDelegateImpl::OnCpuUsageUpdated, - weak_factory_.GetWeakPtr())); -} - -void SystemInfoDelegateImpl::UpdateBatteryInfo() { - auto* probe_service = - ash::cros_healthd::ServiceConnection::GetInstance()->GetProbeService(); - - probe_service->ProbeTelemetryInfo( - {ProbeCategories::kBattery}, - base::BindOnce(&SystemInfoDelegateImpl::OnBatteryInfoUpdated, - weak_factory_.GetWeakPtr())); -} - -void SystemInfoDelegateImpl::OnMemoryUsageUpdated(TelemetryInfoPtr info_ptr) { - auto* memory_info = system_info::GetMemoryInfo(*info_ptr, ""); - if (!memory_info) { - LOG(ERROR) << "Memory information not provided by croshealthd"; - ReturnWithNullptr(); - return; - } - - double available_memory_gb = ConvertKBtoGB(memory_info->available_memory_kib); - double total_memory_gb = ConvertKBtoGB(memory_info->total_memory_kib); - - memory_data_ = - std::make_unique<manta::MemoryData>(available_memory_gb, total_memory_gb); - OnDiagnosticsUpdated(); -} - -void SystemInfoDelegateImpl::OnCpuUsageUpdated( - ash::cros_healthd::mojom::TelemetryInfoPtr info_ptr) { - const CpuInfo* cpu_info = system_info::GetCpuInfo(*info_ptr, ""); - if (cpu_info == nullptr) { - LOG(ERROR) << "No CpuInfo in response from cros_healthd."; - ReturnWithNullptr(); - return; - } - - if (cpu_info->physical_cpus.empty()) { - LOG(ERROR) << "Device reported having zero physical CPUs."; - ReturnWithNullptr(); - return; - } - - if (cpu_info->physical_cpus[0]->logical_cpus.empty()) { - LOG(ERROR) << "Device reported having zero logical CPUs."; - ReturnWithNullptr(); - return; - } - - // For simplicity, assumes that all devices have just one physical CPU, made - // up of one or more virtual CPUs. - if (cpu_info->physical_cpus.size() > 1) { - VLOG(1) << "Device has more than one physical CPU."; - } - - const PhysicalCpuInfoPtr& physical_cpu_ptr = cpu_info->physical_cpus[0]; - - system_info::CpuUsageData new_cpu_usage_data = - system_info::CalculateCpuUsage(physical_cpu_ptr->logical_cpus); - std::unique_ptr<system_info::CpuData> new_cpu_usage = - std::make_unique<system_info::CpuData>(); - - system_info::PopulateCpuUsage(new_cpu_usage_data, previous_cpu_usage_data_, - *new_cpu_usage.get()); - system_info::PopulateAverageCpuTemperature(*cpu_info, *new_cpu_usage.get()); - system_info::PopulateAverageScaledClockSpeed(*cpu_info, *new_cpu_usage.get()); - - previous_cpu_usage_data_ = new_cpu_usage_data; - cpu_refreshes_left_--; - if (cpu_refreshes_left_ == 0) { - int percentage; - base::StringToInt(new_cpu_usage->GetPercentUsageTotalString(), &percentage); - cpu_data_ = std::make_unique<manta::CpuData>( - percentage, new_cpu_usage->GetAverageCpuTempCelsius(), - static_cast<double>( - new_cpu_usage->GetScalingAverageCurrentFrequencyKhz() / 10000) / - 100); - cpu_usage_timer_->Stop(); - OnDiagnosticsUpdated(); - } -} - -void SystemInfoDelegateImpl::OnBatteryInfoUpdated( - ash::cros_healthd::mojom::TelemetryInfoPtr info_ptr) { - const BatteryInfo* battery_info_ptr = - system_info::GetBatteryInfo(*info_ptr, "", ""); - if (!battery_info_ptr) { - LOG(ERROR) << "BatteryInfo requested by device does not have a battery."; - ReturnWithNullptr(); - return; - } - - std::unique_ptr<system_info::BatteryHealth> new_battery_health = - std::make_unique<system_info::BatteryHealth>(); - - system_info::PopulateBatteryHealth(*battery_info_ptr, - *new_battery_health.get()); - - const std::optional<power_manager::PowerSupplyProperties>& proto = - chromeos::PowerManagerClient::Get()->GetLastStatus(); - if (!proto) { - LOG(ERROR) << "No data from Power Manager."; - ReturnWithNullptr(); - return; - } - PopulatePowerStatus(proto.value(), *new_battery_health.get()); - battery_data_ = std::make_unique<manta::BatteryData>( - new_battery_health->GetCycleCount(), - new_battery_health->GetBatteryWearPercentage(), - base::UTF16ToUTF8(new_battery_health->GetPowerTime()), - new_battery_health->GetBatteryPercentage()); - OnDiagnosticsUpdated(); -} - -} // namespace sparky
diff --git a/chromeos/ash/components/sparky/system_info_delegate_impl.h b/chromeos/ash/components/sparky/system_info_delegate_impl.h deleted file mode 100644 index b3e796c..0000000 --- a/chromeos/ash/components/sparky/system_info_delegate_impl.h +++ /dev/null
@@ -1,83 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROMEOS_ASH_COMPONENTS_SPARKY_SYSTEM_INFO_DELEGATE_IMPL_H_ -#define CHROMEOS_ASH_COMPONENTS_SPARKY_SYSTEM_INFO_DELEGATE_IMPL_H_ - -#include <memory> - -#include "base/component_export.h" -#include "base/memory/weak_ptr.h" -#include "base/observer_list_types.h" -#include "base/timer/timer.h" -#include "chromeos/ash/components/system_info/battery_health.h" -#include "chromeos/ash/components/system_info/cpu_data.h" -#include "chromeos/ash/components/system_info/cpu_usage_data.h" -#include "chromeos/ash/components/system_info/memory_data.h" -#include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd.mojom.h" -#include "components/manta/sparky/system_info_delegate.h" - -namespace sparky { - -// This class extracts System Information requested by the Sparky Provider. It -// is able to return information on the current CPU, memory and battery status. -class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_SPARKY) SystemInfoDelegateImpl - : public manta::SystemInfoDelegate { - public: - SystemInfoDelegateImpl(); - SystemInfoDelegateImpl(const SystemInfoDelegateImpl&) = delete; - SystemInfoDelegateImpl& operator=(const SystemInfoDelegateImpl&) = delete; - - ~SystemInfoDelegateImpl() override; - - // `manta::SystemInfoDelegate` overrides: - void ObtainDiagnostics( - const std::vector<manta::Diagnostics>& diagnostics, - manta::DiagnosticsDataCallback diagnostics_callback) override; - - private: - // Called once each of the diagnostics has been collected. Will run the - // callback once all of the requested information has been collected. - void OnDiagnosticsUpdated(); - // If there is an error with collected any of the diagnostics information, the - // callback will be returned with a null pointer. - void ReturnWithNullptr(); - // Binds the CrOS Healthd Probe Service which is required to request any - // system information. - void BindCrosHealthdProbeServiceIfNecessary(); - void OnProbeServiceDisconnect(); - - // Functions to update Diagnostics information. - void UpdateMemoryUsage(); - void UpdateBatteryInfo(); - void UpdateCpuUsage(); - - // Functions which are called once the diagnostics information has been - // collected. It formats the returned response and then calls back - // OnDiagnosticsUpdated to potentially return back this information. - void OnMemoryUsageUpdated( - ash::cros_healthd::mojom::TelemetryInfoPtr info_ptr); - void OnBatteryInfoUpdated( - ash::cros_healthd::mojom::TelemetryInfoPtr info_ptr); - void OnCpuUsageUpdated(ash::cros_healthd::mojom::TelemetryInfoPtr info_ptr); - - bool diagnostics_error_{false}; - manta::DiagnosticsDataCallback diagnostics_callback_; - std::vector<manta::Diagnostics> diagnostics_requested_; - std::unique_ptr<manta::BatteryData> battery_data_; - std::unique_ptr<manta::CpuData> cpu_data_; - system_info::CpuUsageData previous_cpu_usage_data_{ - system_info::CpuUsageData()}; - std::unique_ptr<manta::MemoryData> memory_data_; - // A timer is used to request CPU usage info as the first request for CPU data - // results in a spike in CPU usage which leads to an inflated value. - std::unique_ptr<base::RepeatingTimer> cpu_usage_timer_; - // The number of times which CPU usage is calculated before being returned. - int cpu_refreshes_left_ = 2; - base::WeakPtrFactory<SystemInfoDelegateImpl> weak_factory_{this}; -}; - -} // namespace sparky - -#endif // CHROMEOS_ASH_COMPONENTS_SPARKY_SYSTEM_INFO_DELEGATE_IMPL_H_
diff --git a/chromeos/ash/components/sparky/system_info_delegate_impl_unittest.cc b/chromeos/ash/components/sparky/system_info_delegate_impl_unittest.cc deleted file mode 100644 index f54f4c7..0000000 --- a/chromeos/ash/components/sparky/system_info_delegate_impl_unittest.cc +++ /dev/null
@@ -1,394 +0,0 @@ -// Copyright 2024 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chromeos/ash/components/sparky/system_info_delegate_impl.h" - -#include <memory> - -#include "base/system/sys_info.h" -#include "base/test/bind.h" -#include "base/test/task_environment.h" -#include "chromeos/ash/components/mojo_service_manager/fake_mojo_service_manager.h" -#include "chromeos/ash/components/system_info/cpu_usage_data.h" -#include "chromeos/ash/components/system_info/system_info_util.h" -#include "chromeos/ash/services/cros_healthd/public/cpp/fake_cros_healthd.h" -#include "chromeos/ash/services/cros_healthd/public/mojom/cros_healthd_probe.mojom.h" -#include "chromeos/dbus/power/fake_power_manager_client.h" -#include "components/manta/sparky/system_info_delegate.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace sparky { -namespace { - -namespace healthd_mojom = ash::cros_healthd::mojom; - -void SetProbeTelemetryInfoResponse(healthd_mojom::BatteryInfoPtr battery_info, - healthd_mojom::CpuInfoPtr cpu_info, - healthd_mojom::MemoryInfoPtr memory_info) { - auto info = healthd_mojom::TelemetryInfo::New(); - if (battery_info) { - info->battery_result = - healthd_mojom::BatteryResult::NewBatteryInfo(std::move(battery_info)); - } - if (memory_info) { - info->memory_result = - healthd_mojom::MemoryResult::NewMemoryInfo(std::move(memory_info)); - } - if (cpu_info) { - info->cpu_result = - healthd_mojom::CpuResult::NewCpuInfo(std::move(cpu_info)); - } - - ash::cros_healthd::FakeCrosHealthd::Get() - ->SetProbeTelemetryInfoResponseForTesting(info); -} - -ash::cros_healthd::mojom::CpuInfoPtr GetCpuResponse( - const std::vector<system_info::CpuUsageData>& usage_data, - const std::vector<int32_t>& cpu_temps, - const std::vector<uint32_t>& scaled_cpu_clock_speed) { - auto cpu_info_ptr = healthd_mojom::CpuInfo::New(); - auto physical_cpu_info_ptr = healthd_mojom::PhysicalCpuInfo::New(); - - DCHECK_EQ(usage_data.size(), scaled_cpu_clock_speed.size()); - for (size_t i = 0; i < usage_data.size(); ++i) { - const auto& data = usage_data[i]; - auto logical_cpu_info_ptr = healthd_mojom::LogicalCpuInfo::New(); - - logical_cpu_info_ptr->user_time_user_hz = data.GetUserTime(); - logical_cpu_info_ptr->system_time_user_hz = data.GetSystemTime(); - logical_cpu_info_ptr->idle_time_user_hz = data.GetIdleTime(); - - logical_cpu_info_ptr->scaling_current_frequency_khz = - scaled_cpu_clock_speed[i]; - - physical_cpu_info_ptr->logical_cpus.emplace_back( - std::move(logical_cpu_info_ptr)); - } - - cpu_info_ptr->physical_cpus.push_back(std::move(physical_cpu_info_ptr)); - for (const auto& cpu_temp : cpu_temps) { - auto cpu_temp_channel_ptr = healthd_mojom::CpuTemperatureChannel::New(); - cpu_temp_channel_ptr->temperature_celsius = cpu_temp; - cpu_info_ptr->temperature_channels.emplace_back( - std::move(cpu_temp_channel_ptr)); - } - return cpu_info_ptr; -} - -void SetCrosHealthdCpuResponse( - const std::vector<system_info::CpuUsageData>& usage_data, - const std::vector<int32_t>& cpu_temps, - const std::vector<uint32_t>& scaled_cpu_clock_speed) { - auto cpu_info_ptr = - GetCpuResponse(usage_data, cpu_temps, scaled_cpu_clock_speed); - - SetProbeTelemetryInfoResponse(/*battery_info=*/nullptr, - std::move(cpu_info_ptr), - /*memory_info=*/nullptr); -} - -void SetCrosHealthdMemoryUsageResponse(uint32_t total_memory_kib, - uint32_t free_memory_kib, - uint32_t available_memory_kib) { - healthd_mojom::MemoryInfoPtr memory_info = healthd_mojom::MemoryInfo::New( - total_memory_kib, free_memory_kib, available_memory_kib, - /*page_faults_since_last_boot=*/0); - SetProbeTelemetryInfoResponse(/*battery_info=*/nullptr, /*cpu_info=*/nullptr, - /*memory_info=*/std::move(memory_info)); -} - -// Constructs a BatteryInfoPtr. -healthd_mojom::BatteryInfoPtr CreateCrosHealthdBatteryHealthResponse( - double charge_full_now, - double charge_full_design, - int32_t cycle_count) { - healthd_mojom::NullableUint64Ptr temp_value_ptr( - healthd_mojom::NullableUint64::New()); - auto battery_info = healthd_mojom::BatteryInfo::New( - /*cycle_count=*/cycle_count, /*voltage_now=*/0, - /*vendor=*/"", - /*serial_number=*/"", /*charge_full_design=*/charge_full_design, - /*charge_full=*/charge_full_now, - /*voltage_min_design=*/0, - /*model_name=*/"", - /*charge_now=*/0, - /*current_now=*/0, - /*technology=*/"", - /*status=*/"", - /*manufacture_date=*/std::nullopt, std::move(temp_value_ptr)); - return battery_info; -} - -void SetCrosHealthdBatteryHealthResponse(double charge_full_now, - double charge_full_design, - int32_t cycle_count) { - healthd_mojom::BatteryInfoPtr battery_info = - CreateCrosHealthdBatteryHealthResponse(charge_full_now, - charge_full_design, cycle_count); - SetProbeTelemetryInfoResponse(std::move(battery_info), - /*cpu_info=*/nullptr, - /*memory_info=*/nullptr); -} - -bool AreValidPowerTimes(int64_t time_to_full, int64_t time_to_empty) { - // Exactly one of `time_to_full` or `time_to_empty` must be zero. The other - // can be a positive integer to represent the time to charge/discharge or -1 - // to represent that the time is being calculated. - return (time_to_empty == 0 && (time_to_full > 0 || time_to_full == -1)) || - (time_to_full == 0 && (time_to_empty > 0 || time_to_empty == -1)); -} - -power_manager::PowerSupplyProperties ConstructPowerSupplyProperties( - power_manager::PowerSupplyProperties::ExternalPower power_source, - power_manager::PowerSupplyProperties::BatteryState battery_state, - bool is_calculating_battery_time, - int64_t time_to_full, - int64_t time_to_empty, - double battery_percent) { - power_manager::PowerSupplyProperties props; - props.set_external_power(power_source); - props.set_battery_state(battery_state); - - if (battery_state == - power_manager::PowerSupplyProperties_BatteryState_NOT_PRESENT) { - // Leave `time_to_full` and `time_to_empty` unset. - return props; - } - - DCHECK(AreValidPowerTimes(time_to_full, time_to_empty)); - - props.set_is_calculating_battery_time(is_calculating_battery_time); - props.set_battery_time_to_full_sec(time_to_full); - props.set_battery_time_to_empty_sec(time_to_empty); - props.set_battery_percent(battery_percent); - - return props; -} - -// Sets the PowerSupplyProperties on FakePowerManagerClient. Calling this -// method immediately notifies PowerManagerClient observers. One of -// `time_to_full` or `time_to_empty` must be either -1 or a positive number. -// The other must be 0. If `battery_state` is NOT_PRESENT, both `time_to_full` -// and `time_to_empty` will be left unset. -void SetPowerManagerProperties( - power_manager::PowerSupplyProperties::ExternalPower power_source, - power_manager::PowerSupplyProperties::BatteryState battery_state, - bool is_calculating_battery_time, - int64_t time_to_full, - int64_t time_to_empty, - double battery_percent) { - power_manager::PowerSupplyProperties props = ConstructPowerSupplyProperties( - power_source, battery_state, is_calculating_battery_time, time_to_full, - time_to_empty, battery_percent); - chromeos::FakePowerManagerClient::Get()->UpdatePowerProperties(props); -} - -} // namespace - -class SystemInfoDelegateImplTest : public testing::Test { - public: - SystemInfoDelegateImplTest() = default; - - SystemInfoDelegateImplTest(const SystemInfoDelegateImplTest&) = delete; - SystemInfoDelegateImplTest& operator=(const SystemInfoDelegateImplTest&) = - delete; - - ~SystemInfoDelegateImplTest() override = default; - - void SetUp() override { - chromeos::PowerManagerClient::InitializeFake(); - ash::cros_healthd::FakeCrosHealthd::Initialize(); - system_info_delegate_impl_ = std::make_unique<SystemInfoDelegateImpl>(); - Wait(); - } - - void TearDown() override { - ash::cros_healthd::FakeCrosHealthd::Shutdown(); - chromeos::PowerManagerClient::Shutdown(); - } - - void Wait() { task_environment_.RunUntilIdle(); } - - void OnDiagnosticsReceived( - std::unique_ptr<manta::DiagnosticsData> diagnostics_data) {} - - protected: - base::test::TaskEnvironment task_environment_; - ::ash::mojo_service_manager::FakeMojoServiceManager fake_service_manager_; - std::unique_ptr<SystemInfoDelegateImpl> system_info_delegate_impl_; -}; - -TEST_F(SystemInfoDelegateImplTest, Memory) { - const uint32_t total_memory_kib = 8000000; - const uint32_t free_memory_kib = 2000000; - const uint32_t available_memory_kib = 4000000; - - SetCrosHealthdMemoryUsageResponse(total_memory_kib, free_memory_kib, - available_memory_kib); - Wait(); - auto quit_closure = task_environment_.QuitClosure(); - - system_info_delegate_impl_->ObtainDiagnostics( - {manta::Diagnostics::kMemory}, - base::BindLambdaForTesting( - [&quit_closure, - this](std::unique_ptr<manta::DiagnosticsData> diagnostics_data) { - Wait(); - ASSERT_TRUE(diagnostics_data->memory_data); - ASSERT_DOUBLE_EQ(diagnostics_data->memory_data->available_memory_gb, - 3.814697265625); - ASSERT_DOUBLE_EQ(diagnostics_data->memory_data->total_memory_gb, - 7.62939453125); - quit_closure.Run(); - })); - task_environment_.RunUntilQuit(); -} - -TEST_F(SystemInfoDelegateImplTest, CPU) { - int temp_1 = 40; - int temp_2 = 50; - int temp_3 = 15; - uint32_t core_1_speed = 4000000; - uint32_t core_2_speed = 2000000; - system_info::CpuUsageData core_1(1000, 1000, 1000); - system_info::CpuUsageData core_2(2000, 2000, 2000); - - SetCrosHealthdCpuResponse({core_1, core_2}, {temp_1, temp_2, temp_3}, - {core_1_speed, core_2_speed}); - Wait(); - auto quit_closure = task_environment_.QuitClosure(); - - system_info_delegate_impl_->ObtainDiagnostics( - {manta::Diagnostics::kCpu}, - base::BindLambdaForTesting( - [&quit_closure, - this](std::unique_ptr<manta::DiagnosticsData> diagnostics_data) { - Wait(); - ASSERT_TRUE(diagnostics_data->cpu_data); - ASSERT_EQ(diagnostics_data->cpu_data->average_cpu_temp_celsius, 35); - ASSERT_EQ(diagnostics_data->cpu_data->scaling_current_frequency_ghz, - 3.0); - quit_closure.Run(); - })); - task_environment_.RunUntilQuit(); -} - -TEST_F(SystemInfoDelegateImplTest, Battery) { - const double charge_full_now = 20; - const double charge_full_design = 26; - const int32_t cycle_count = 500; - - SetCrosHealthdBatteryHealthResponse(charge_full_now, charge_full_design, - cycle_count); - - const auto power_source = - power_manager::PowerSupplyProperties_ExternalPower_AC; - const auto battery_state = - power_manager::PowerSupplyProperties_BatteryState_CHARGING; - const bool is_calculating_battery_time = false; - const int64_t time_to_full_secs = 1000; - const int64_t time_to_empty_secs = 0; - const double battery_percent = 94.0; - - SetPowerManagerProperties(power_source, battery_state, - is_calculating_battery_time, time_to_full_secs, - time_to_empty_secs, battery_percent); - Wait(); - auto quit_closure = task_environment_.QuitClosure(); - - system_info_delegate_impl_->ObtainDiagnostics( - {manta::Diagnostics::kBattery}, - base::BindLambdaForTesting( - [&quit_closure, - this](std::unique_ptr<manta::DiagnosticsData> diagnostics_data) { - Wait(); - ASSERT_TRUE(diagnostics_data->battery_data); - ASSERT_EQ(diagnostics_data->battery_data->battery_percentage, 94); - ASSERT_EQ(diagnostics_data->battery_data->battery_wear_percentage, - 76); - ASSERT_EQ(diagnostics_data->battery_data->cycle_count, 500); - ASSERT_EQ(diagnostics_data->battery_data->power_time, - "17 minutes until full"); - quit_closure.Run(); - })); - task_environment_.RunUntilQuit(); -} - -TEST_F(SystemInfoDelegateImplTest, MultipleFields) { - const uint32_t total_memory_kib = 8000000; - const uint32_t free_memory_kib = 2000000; - const uint32_t available_memory_kib = 4000000; - - int temp_1 = 40; - int temp_2 = 50; - int temp_3 = 15; - uint32_t core_1_speed = 4000000; - uint32_t core_2_speed = 2000000; - system_info::CpuUsageData core_1(1000, 1000, 1000); - system_info::CpuUsageData core_2(2000, 2000, 2000); - - healthd_mojom::MemoryInfoPtr memory_info = healthd_mojom::MemoryInfo::New( - total_memory_kib, free_memory_kib, available_memory_kib, - /*page_faults_since_last_boot=*/0); - auto cpu_info = GetCpuResponse({core_1, core_2}, {temp_1, temp_2, temp_3}, - {core_1_speed, core_2_speed}); - const double charge_full_now = 20; - - const double charge_full_design = 26; - const int32_t cycle_count = 500; - - healthd_mojom::BatteryInfoPtr battery_info = - CreateCrosHealthdBatteryHealthResponse(charge_full_now, - charge_full_design, cycle_count); - - SetProbeTelemetryInfoResponse(std::move(battery_info), std::move(cpu_info), - std::move(memory_info)); - - Wait(); - - const auto power_source = - power_manager::PowerSupplyProperties_ExternalPower_AC; - const auto battery_state = - power_manager::PowerSupplyProperties_BatteryState_CHARGING; - const bool is_calculating_battery_time = false; - const int64_t time_to_full_secs = 1000; - const int64_t time_to_empty_secs = 0; - const double battery_percent = 94.0; - - SetPowerManagerProperties(power_source, battery_state, - is_calculating_battery_time, time_to_full_secs, - time_to_empty_secs, battery_percent); - Wait(); - auto quit_closure = task_environment_.QuitClosure(); - - system_info_delegate_impl_->ObtainDiagnostics( - {manta::Diagnostics::kMemory, manta::Diagnostics::kCpu, - manta::Diagnostics::kBattery}, - base::BindLambdaForTesting( - [&quit_closure, - this](std::unique_ptr<manta::DiagnosticsData> diagnostics_data) { - Wait(); - ASSERT_TRUE(diagnostics_data->memory_data); - ASSERT_DOUBLE_EQ(diagnostics_data->memory_data->available_memory_gb, - 3.814697265625); - ASSERT_DOUBLE_EQ(diagnostics_data->memory_data->total_memory_gb, - 7.62939453125); - ASSERT_TRUE(diagnostics_data->cpu_data); - ASSERT_EQ(diagnostics_data->cpu_data->average_cpu_temp_celsius, 35); - ASSERT_EQ(diagnostics_data->cpu_data->scaling_current_frequency_ghz, - 3.0); - ASSERT_TRUE(diagnostics_data->battery_data); - ASSERT_EQ(diagnostics_data->battery_data->battery_percentage, 94); - ASSERT_EQ(diagnostics_data->battery_data->battery_wear_percentage, - 76); - ASSERT_EQ(diagnostics_data->battery_data->cycle_count, 500); - ASSERT_EQ(diagnostics_data->battery_data->power_time, - "17 minutes until full"); - quit_closure.Run(); - })); - task_environment_.RunUntilQuit(); -} - -} // namespace sparky
diff --git a/chromeos/ash/components/specialized_features/feature_access_checker.cc b/chromeos/ash/components/specialized_features/feature_access_checker.cc index 0948c551..e8b8a5b 100644 --- a/chromeos/ash/components/specialized_features/feature_access_checker.cc +++ b/chromeos/ash/components/specialized_features/feature_access_checker.cc
@@ -29,7 +29,7 @@ identity_manager_(identity_manager), variations_service_(variations_service) {} -FeatureAccessFailureSet FeatureAccessChecker::Check() { +FeatureAccessFailureSet FeatureAccessChecker::Check() const { FeatureAccessFailureSet failures; if (config_.settings_toggle_pref.has_value()) {
diff --git a/chromeos/ash/components/specialized_features/feature_access_checker.h b/chromeos/ash/components/specialized_features/feature_access_checker.h index 4b6dccf..fc508c5 100644 --- a/chromeos/ash/components/specialized_features/feature_access_checker.h +++ b/chromeos/ash/components/specialized_features/feature_access_checker.h
@@ -108,7 +108,7 @@ // Uses the set config and dependencies to check. Returns a list of errors. // For details of errors, please refer the comments of FeatureAccessConfig. - FeatureAccessFailureSet Check(); + FeatureAccessFailureSet Check() const; private: FeatureAccessConfig config_;
diff --git a/chromeos/strings/chromeos_strings_bg.xtb b/chromeos/strings/chromeos_strings_bg.xtb index a773d9cd..bab02d1e4 100644 --- a/chromeos/strings/chromeos_strings_bg.xtb +++ b/chromeos/strings/chromeos_strings_bg.xtb
@@ -902,6 +902,7 @@ <translation id="5302048478445481009">Език</translation> <translation id="5303837385540978511">Тапет специално за <ph name="PRODUCT_NAME" /></translation> <translation id="5304899856529773394">EVDO</translation> +<translation id="530883153651464140">Актуализиране на <ph name="DEVICE_NAME" /> до версия <ph name="VERSION" /></translation> <translation id="5315873049536339193">Самоличност</translation> <translation id="5317780077021120954">Запазване</translation> <translation id="5318310531701770497">Не могат да се създадат имена. Опитайте с по-дълъг препис.</translation>
diff --git a/chromeos/strings/chromeos_strings_iw.xtb b/chromeos/strings/chromeos_strings_iw.xtb index 768e481..9fdc6cf 100644 --- a/chromeos/strings/chromeos_strings_iw.xtb +++ b/chromeos/strings/chromeos_strings_iw.xtb
@@ -902,6 +902,7 @@ <translation id="5302048478445481009">שפה</translation> <translation id="5303837385540978511">טפט בלעדי ל-<ph name="PRODUCT_NAME" /></translation> <translation id="5304899856529773394">נתוני EvDo</translation> +<translation id="530883153651464140">צריך לעדכן את <ph name="DEVICE_NAME" /> לגרסה <ph name="VERSION" /></translation> <translation id="5315873049536339193">זהות</translation> <translation id="5317780077021120954">שמירה</translation> <translation id="5318310531701770497">לא ניתן ליצור שמות. צריך לנסות תמליל ארוך יותר.</translation>
diff --git a/chromeos/strings/chromeos_strings_ms.xtb b/chromeos/strings/chromeos_strings_ms.xtb index ae746db..f2a0008af 100644 --- a/chromeos/strings/chromeos_strings_ms.xtb +++ b/chromeos/strings/chromeos_strings_ms.xtb
@@ -902,6 +902,7 @@ <translation id="5302048478445481009">Bahasa</translation> <translation id="5303837385540978511">Hiasan latar eksklusif <ph name="PRODUCT_NAME" /></translation> <translation id="5304899856529773394">EVDO</translation> +<translation id="530883153651464140">Kemas kinikan <ph name="DEVICE_NAME" /> kepada versi <ph name="VERSION" /></translation> <translation id="5315873049536339193">Identiti</translation> <translation id="5317780077021120954">Simpan</translation> <translation id="5318310531701770497">Tidak dapat membuat nama. Cuba transkrip yang lebih panjang.</translation>
diff --git a/clank b/clank index a08fabe..feab2c5 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit a08fabe658a48177291e1cabb4f60178ee9616d1 +Subproject commit feab2c5b2ea85e757fb381ec2588419d2b9b8434
diff --git a/components/autofill/core/browser/form_parsing/internal_resources b/components/autofill/core/browser/form_parsing/internal_resources index 8572e719..dee24bc5 160000 --- a/components/autofill/core/browser/form_parsing/internal_resources +++ b/components/autofill/core/browser/form_parsing/internal_resources
@@ -1 +1 @@ -Subproject commit 8572e719bbf714846a735cdbfc1380ff6cf6a6a7 +Subproject commit dee24bc5ecb2e65d6b520043b75ca27cba7e39e8
diff --git a/components/certificate_transparency/data/log_list.json b/components/certificate_transparency/data/log_list.json index 429636c..4eca6fcf 100644 --- a/components/certificate_transparency/data/log_list.json +++ b/components/certificate_transparency/data/log_list.json
@@ -1,6 +1,6 @@ { - "version": "50.52", - "log_list_timestamp": "2024-12-28T12:57:28Z", + "version": "50.53", + "log_list_timestamp": "2024-12-29T12:55:11Z", "operators": [ { "name": "Google",
diff --git a/components/strings/components_strings_bg.xtb b/components/strings/components_strings_bg.xtb index 8453c0fa..631a68a8 100644 --- a/components/strings/components_strings_bg.xtb +++ b/components/strings/components_strings_bg.xtb
@@ -109,6 +109,7 @@ <translation id="1186201132766001848">Проверка на паролите</translation> <translation id="1187430513518041110">Автомобили и превозни средства</translation> <translation id="1190491977647722791">Хартия (тежка)</translation> +<translation id="1194278116501666615">Актуализация на напредъка на предварителното зареждане на ArcVm</translation> <translation id="1195073053842921378">Адресът ще бъде изтрит от това устройство</translation> <translation id="1195558154361252544">Известията се блокират автоматично за всички сайтове освен за онези, за които ги разрешите</translation> <translation id="1197088940767939838">оранжево</translation> @@ -1146,6 +1147,7 @@ <translation id="3061707000357573562">Услуга за корекции</translation> <translation id="306198082577913404">Включване на подобренията на предвижданията</translation> <translation id="3062655045399308513">Изтр. на данните за сърф.</translation> +<translation id="3063453392496098461">Инсталирането на фоновите услуги за VPN не бе успешно.</translation> <translation id="306573536155379004">Играта е стартирана.</translation> <translation id="3067505415088964188">Цената е ниска</translation> <translation id="3068118691172921711">Качването на файловете ви в(ъв) <ph name="CLOUD_PROVIDER" /> ще започне след 1 минута</translation> @@ -1755,6 +1757,7 @@ <translation id="4103592298805904008">Картон (едностенен)</translation> <translation id="4104702906064390950">Информацията за IBAN се запазва</translation> <translation id="4106887816571530227">Вграденото съдържание е забранено</translation> +<translation id="4107047499377819067">Инсталирането на фоновите услуги за VPN стартира. Това може да отнеме няколко минути.</translation> <translation id="4110652170750985508">Преглед на плащането ви</translation> <translation id="4111546256784973544">Пейнтбол</translation> <translation id="4112140312785995938">Придвижване назад</translation> @@ -2784,6 +2787,7 @@ <translation id="6001839398155993679">Начало</translation> <translation id="6002122790816966947">Вашите устройства</translation> <translation id="6002968396561884726">Наскоро прегледано</translation> +<translation id="6005188329423473970">Инсталирането на фоновите услуги за VPN завърши. Ако не виждате приложенията за VPN, моля, излезте от профила си и влезте отново.</translation> <translation id="6005659677094197001">Непрекъснат носител</translation> <translation id="6005765687956866568">Автоматично попълнената информация е изчистена от формуляра</translation> <translation id="6006365096047131769">3 x 5 инча</translation>
diff --git a/components/strings/components_strings_cs.xtb b/components/strings/components_strings_cs.xtb index 00a79a4..5b15355 100644 --- a/components/strings/components_strings_cs.xtb +++ b/components/strings/components_strings_cs.xtb
@@ -281,7 +281,7 @@ <translation id="1473495410389165587">Pokud chcete získat pomoc s psaním, zadejte alespoň tři slova</translation> <translation id="147358896496811705">2A0</translation> <translation id="1474576429883213321">Úklidové služby</translation> -<translation id="1476595624592550506">Změňte heslo</translation> +<translation id="1476595624592550506">Změna hesla</translation> <translation id="1482372785911828880">Extra tenký</translation> <translation id="1482879811280872320">Cyklistika</translation> <translation id="1483493594462132177">Odeslat</translation>
diff --git a/components/strings/components_strings_iw.xtb b/components/strings/components_strings_iw.xtb index 293dacf..01a3a45 100644 --- a/components/strings/components_strings_iw.xtb +++ b/components/strings/components_strings_iw.xtb
@@ -109,6 +109,7 @@ <translation id="1186201132766001848">בדיקת הסיסמאות</translation> <translation id="1187430513518041110">כלי רכב</translation> <translation id="1190491977647722791">Paper (Heavyweight)</translation> +<translation id="1194278116501666615">עדכון לגבי התקדמות הטעינה מראש של ArcVm</translation> <translation id="1195073053842921378">הכתובת הזו תימחק מהמכשיר</translation> <translation id="1195558154361252544">הצגת ההודעות חסומה באופן אוטומטי בכל האתרים, מלבד האתרים שבהם היא אושרה</translation> <translation id="1197088940767939838">כתום</translation> @@ -1146,6 +1147,7 @@ <translation id="3061707000357573562">שירות תיקון</translation> <translation id="306198082577913404">הפעלת השיפורים בחיזוי</translation> <translation id="3062655045399308513">מחיקת נתוני הגלישה מתבצעת…</translation> +<translation id="3063453392496098461">ההתקנה של שירותי ה-VPN שפועלים ברקע נכשלה.</translation> <translation id="306573536155379004">המשחק התחיל.</translation> <translation id="3067505415088964188">המחיר נמוך</translation> <translation id="3068118691172921711">העלאת הקבצים אל <ph name="CLOUD_PROVIDER" /> תתחיל בעוד דקה</translation> @@ -1755,6 +1757,7 @@ <translation id="4103592298805904008">Cardboard (Single Wall)</translation> <translation id="4104702906064390950">מתבצעת שמירה של פרטי ה-IBAN</translation> <translation id="4106887816571530227">אין הרשאה לתוכן מוטמע</translation> +<translation id="4107047499377819067">ההתקנה של שירותי ה-VPN שפועלים ברקע החלה. יכול להיות שזה ייקח כמה דקות.</translation> <translation id="4110652170750985508">בדיקת התשלום</translation> <translation id="4111546256784973544">פיינטבול</translation> <translation id="4112140312785995938">הרצה לאחור</translation> @@ -2789,6 +2792,7 @@ <translation id="6001839398155993679">קדימה!</translation> <translation id="6002122790816966947">המכשירים שלך</translation> <translation id="6002968396561884726">הוצגו לאחרונה</translation> +<translation id="6005188329423473970">ההתקנה של שירותי ה-VPN שפועלים ברקע הושלמה. אם אפליקציות ה-VPN לא מופיעות, צריך לצאת מהן ולהתחבר אליהן מחדש.</translation> <translation id="6005659677094197001">Continuous</translation> <translation id="6005765687956866568">הפרטים שמולאו באופן אוטומטי נוקו מהטופס</translation> <translation id="6006365096047131769">3x5 אינץ'</translation>
diff --git a/components/strings/components_strings_ms.xtb b/components/strings/components_strings_ms.xtb index 8c2dfccec..7582e22a 100644 --- a/components/strings/components_strings_ms.xtb +++ b/components/strings/components_strings_ms.xtb
@@ -109,6 +109,7 @@ <translation id="1186201132766001848">Semak Kata Laluan</translation> <translation id="1187430513518041110">Kereta & Kenderaan</translation> <translation id="1190491977647722791">Kertas (Tebal)</translation> +<translation id="1194278116501666615">Kemaskinian kemajuan pramuat ArcVm</translation> <translation id="1195073053842921378">Alamat ini akan dipadamkan daripada peranti ini</translation> <translation id="1195558154361252544">Pemberitahuan disekat secara automatik untuk semua tapak kecuali tapak yang anda benarkan</translation> <translation id="1197088940767939838">Oren</translation> @@ -1146,6 +1147,7 @@ <translation id="3061707000357573562">Perkhidmatan Tampung</translation> <translation id="306198082577913404">Hidupkan peningkatan ramalan</translation> <translation id="3062655045399308513">Padamkan Data Semakan Imbas...</translation> +<translation id="3063453392496098461">Pemasangan perkhidmatan latar VPN gagal.</translation> <translation id="306573536155379004">Permainan dimulakan.</translation> <translation id="3067505415088964188">Harga rendah</translation> <translation id="3068118691172921711">Fail anda akan dimuat naik kepada <ph name="CLOUD_PROVIDER" /> selepas 1 minit</translation> @@ -1756,6 +1758,7 @@ <translation id="4103592298805904008">Kadbod (Dinding Satu Lapisan)</translation> <translation id="4104702906064390950">Menyimpan maklumat IBAN</translation> <translation id="4106887816571530227">Kandungan terbenam tidak dibenarkan</translation> +<translation id="4107047499377819067">Pemasangan perkhidmatan latar VPN telah bermula. Proses ini mungkin mengambil masa beberapa minit.</translation> <translation id="4110652170750985508">Semak pembayaran anda</translation> <translation id="4111546256784973544">Paintball</translation> <translation id="4112140312785995938">Cari Ke Belakang</translation> @@ -2785,6 +2788,7 @@ <translation id="6001839398155993679">Jom</translation> <translation id="6002122790816966947">Peranti anda</translation> <translation id="6002968396561884726">Dilihat Baru-baru Ini</translation> +<translation id="6005188329423473970">Pemasangan Perkhidmatan Latar VPN selesai. Jika anda tidak melihat aplikasi VPN, sila log keluar dan log masuk semula.</translation> <translation id="6005659677094197001">Berterusan</translation> <translation id="6005765687956866568">Maklumat dalam borang yang diisi secara automatik telah dikosongkan</translation> <translation id="6006365096047131769">3 x 5 in</translation>
diff --git a/components/test/data/autofill/heuristics-json/internal b/components/test/data/autofill/heuristics-json/internal index e219405..d0524b8 160000 --- a/components/test/data/autofill/heuristics-json/internal +++ b/components/test/data/autofill/heuristics-json/internal
@@ -1 +1 @@ -Subproject commit e2194054cb0a44ecb7a11bc71a09d0600f3d2a2d +Subproject commit d0524b82fce8759735662106f37ce0b397e466ba
diff --git a/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate.mm b/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate.mm index 53dd63b9..31482e2 100644 --- a/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate.mm +++ b/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate.mm
@@ -109,11 +109,8 @@ const data_sharing::SharedDataPreview& preview_data, ResultCallback result) { CHECK_EQ(flow_config_->type(), CollaborationFlowConfiguration::Type::kJoin); - const CollaborationFlowConfigurationJoin& join_flow = - flow_config_->As<CollaborationFlowConfigurationJoin>(); ShareKitJoinConfiguration* config = [[ShareKitJoinConfiguration alloc] init]; - config.URL = join_flow.url(); config.token = token; config.baseViewController = base_view_controller_; auto completion_block = base::CallbackToBlock(std::move(result));
diff --git a/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate_unittest.mm b/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate_unittest.mm index 867bbef..0c881da 100644 --- a/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate_unittest.mm +++ b/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate_unittest.mm
@@ -88,9 +88,7 @@ void InitJoinFlowDelegate() { delegate_ = std::make_unique<IOSCollaborationControllerDelegate>( browser_.get(), base_view_controller_, - std::make_unique<CollaborationFlowConfigurationJoin>( - - GURL())); + std::make_unique<CollaborationFlowConfigurationJoin>()); } // Sign in in the authentication service with a fake identity.
diff --git a/ios/chrome/browser/collaboration/model/ios_collaboration_flow_configuration.h b/ios/chrome/browser/collaboration/model/ios_collaboration_flow_configuration.h index 023f7acd..041d5f0 100644 --- a/ios/chrome/browser/collaboration/model/ios_collaboration_flow_configuration.h +++ b/ios/chrome/browser/collaboration/model/ios_collaboration_flow_configuration.h
@@ -10,7 +10,6 @@ #import "base/memory/raw_ptr.h" #import "base/memory/weak_ptr.h" #import "components/saved_tab_groups/public/types.h" -#import "url/gurl.h" class TabGroup; @@ -79,18 +78,11 @@ static constexpr Type kType = Type::kJoin; // Constructs a new CollaborationFlowConfigurationJoin object. - explicit CollaborationFlowConfigurationJoin( - const GURL& url); + explicit CollaborationFlowConfigurationJoin(); ~CollaborationFlowConfigurationJoin() override; // CollaborationFlowConfiguration. Type type() const final; - - // Returns URL containing the collab ID and the token. - const GURL& url() const { return url_; } - - private: - const GURL url_; }; } // namespace collaboration
diff --git a/ios/chrome/browser/collaboration/model/ios_collaboration_flow_configuration.mm b/ios/chrome/browser/collaboration/model/ios_collaboration_flow_configuration.mm index de63d9df..0b3ba02 100644 --- a/ios/chrome/browser/collaboration/model/ios_collaboration_flow_configuration.mm +++ b/ios/chrome/browser/collaboration/model/ios_collaboration_flow_configuration.mm
@@ -32,9 +32,7 @@ #pragma mark - CollaborationFlowConfigurationJoin -CollaborationFlowConfigurationJoin::CollaborationFlowConfigurationJoin( - const GURL& url) - : url_(url) {} +CollaborationFlowConfigurationJoin::CollaborationFlowConfigurationJoin() {} CollaborationFlowConfigurationJoin::~CollaborationFlowConfigurationJoin() {}
diff --git a/ios/chrome/browser/data_sharing/model/data_sharing_ui_delegate_ios.mm b/ios/chrome/browser/data_sharing/model/data_sharing_ui_delegate_ios.mm index 24d9d4e..0bc2ea0 100644 --- a/ios/chrome/browser/data_sharing/model/data_sharing_ui_delegate_ios.mm +++ b/ios/chrome/browser/data_sharing/model/data_sharing_ui_delegate_ios.mm
@@ -61,7 +61,7 @@ std::unique_ptr<IOSCollaborationControllerDelegate> delegate = std::make_unique<IOSCollaborationControllerDelegate>( browser, base_view_controller, - std::make_unique<CollaborationFlowConfigurationJoin>(url)); + std::make_unique<CollaborationFlowConfigurationJoin>()); collaboration_service_->StartJoinFlow(std::move(delegate), url); }
diff --git a/ios/chrome/browser/link_to_text/ui_bundled/link_to_text_egtest.mm b/ios/chrome/browser/link_to_text/ui_bundled/link_to_text_egtest.mm index 63c677b..2fc0410 100644 --- a/ios/chrome/browser/link_to_text/ui_bundled/link_to_text_egtest.mm +++ b/ios/chrome/browser/link_to_text/ui_bundled/link_to_text_egtest.mm
@@ -208,7 +208,8 @@ performAction:grey_tap()]; } -- (void)testInputDisablesGenerateLink { +// TODO(crbug.com/386205292): Test is flaky. +- (void)FLAKY_testInputDisablesGenerateLink { // In order to make the menu show up later in the test, the pasteboard can't // be empty. UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
diff --git a/ios/chrome/browser/share_kit/model/share_kit_join_configuration.h b/ios/chrome/browser/share_kit/model/share_kit_join_configuration.h index 67818c0f..415be49 100644 --- a/ios/chrome/browser/share_kit/model/share_kit_join_configuration.h +++ b/ios/chrome/browser/share_kit/model/share_kit_join_configuration.h
@@ -9,18 +9,12 @@ #import "components/data_sharing/public/group_data.h" -class GURL; - // Configuration object for joining a shared group. @interface ShareKitJoinConfiguration : NSObject // The base view controller on which the join flow will be presented. @property(nonatomic, weak) UIViewController* baseViewController; -// The URL used to join the group, containing the collab ID and the token. -// TODO(crbug.com/377306986): Remove this. -@property(nonatomic, assign) GURL URL; - // The token used to join the group, containing the collab ID and the secret. @property(nonatomic, assign) data_sharing::GroupToken token;
diff --git a/ios/chrome/browser/share_kit/model/share_kit_join_configuration.mm b/ios/chrome/browser/share_kit/model/share_kit_join_configuration.mm index f4beee2..08cb73d 100644 --- a/ios/chrome/browser/share_kit/model/share_kit_join_configuration.mm +++ b/ios/chrome/browser/share_kit/model/share_kit_join_configuration.mm
@@ -4,8 +4,6 @@ #import "ios/chrome/browser/share_kit/model/share_kit_join_configuration.h" -#import "url/gurl.h" - @implementation ShareKitJoinConfiguration @end
diff --git a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 index bc7a0e1..4af10a4 100644 --- a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -287b677eb0720272e5205a9725302d7eb97448d3 \ No newline at end of file +4ccaa31237fcd45191377b8788405a3e10344dbc \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 index 8f32f56d..5fca8e5038 100644 --- a/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeExtensionKeychainInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -7b0f99c37ddfe8b9434e5d4fa1d648d4cd28fe04 \ No newline at end of file +643c48af54ee3e2c43b200525386986a3848a834 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 index 58bb9d8..9f82aa27 100644 --- a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -2e2ab9bbbdd13d4793eda892dc02080d4ebf93da \ No newline at end of file +6200db25b21c015528f2be1f9f6df2ae4a25a1a6 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 index f05db34..48adb3b 100644 --- a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -b7caca144261479366ad9a42206d89a33d0e20cc \ No newline at end of file +1b80783930f28a7f121bf95b3258dffe68a9c47b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 index 82d3ef7..605db8a 100644 --- a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -8a50420527081d28df1fdd0af55a68004ae37823 \ No newline at end of file +a04fc22c68ef189258fbf0902565f2b472d7c401 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 index 067a37d..3e32460 100644 --- a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios_asan.zip.sha1
@@ -1 +1 @@ -152fb277d3250d9b1afd4c1eb1104d06fdec21ef \ No newline at end of file +09fee75e20fc61a69bdd0bb7a0c1b104b350e61b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 index 2e74b550..12b93c0 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -6e6e279a9138e3e047b2d7641b07cb3be60c85ce \ No newline at end of file +b0da82a0ceb2945a29fdfdf5582c3fde893788c6 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 index ae3a5d6..eae030a 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -3321c14f4d6c8f3f8fcbef4144681d1d03d6ce3a \ No newline at end of file +0b0ededa8d29096aec5c5bb0b5dc27fabeeb95b8 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 index ae56411c..146ec50 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -474492f64e15d683087f1e45b6aace11210b371a \ No newline at end of file +f151e651e6680dce6c373ad32de81894a71da91b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 index cc69d69..f80e9a8 100644 --- a/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_extension_keychain_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -5300d0950b83e344d5a598f219443dcd5eaf190c \ No newline at end of file +a626cd7c17f6b8c7e638c87cab0fc664f665e95c \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 index 41b91a0c..5154825 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -7e232057314532cd8d050a26f428458c5148164c \ No newline at end of file +737f77456f92c6855521432ed86e3d6e9777370b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 index 73ba1d4a..a27f36e 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -022a9ad20f75f33f94a0f5e546fb2fb8aad4efc3 \ No newline at end of file +15e612b215edfd78609a2c678efaccf3725248b4 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 index 8404f68..5fc624e5 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -97cfd46a232609d329b6eab38ef06fdc2be6c31b \ No newline at end of file +a53efbd0d64772c83e5dd437720179cfeb1af07e \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 12e061d..c36f02c 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -11d8f2788d68785658c03c850f07da5e7f9505eb \ No newline at end of file +b50b77cc82678fb50712a859efc32418536daf4e \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 index 7ddeec3..3b91b930 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -a156fb7c27005989c435e60c4ae862c78797f9f2 \ No newline at end of file +8406be65095c5b58585e2c2a33b963f5b291915b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 index fe3856d..31567ff 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -e2726eb35accbabb6be7cb8224bde37628127a80 \ No newline at end of file +186d3e24afe4eb27a3e8f03b95942b13a1ef0e59 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 index 28aaf4c..3961a54 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -9099c79a2356ce61cb0fd95522a780d240929864 \ No newline at end of file +51a3d46a4c07e6ed3865855fb4d13b5b9f74df6d \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 4d68fc2..5d0d481 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -0682932775e08163d06efa772e6c03e0fd10bb17 \ No newline at end of file +5d6523aca58e870e5be2a33b8cebf140bcc4edf9 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 index aab37a3..9b15792 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -25fe40fc97f45f16ae26f9f5ef87aa73c31401bd \ No newline at end of file +704be8a3f1c12bd8eed1f158581fd592746191e0 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 index 302b089..88bf4fd 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -ff4cd7fb8ebf0174487a2b8f16da891f3f9caa1b \ No newline at end of file +18aad5a84a05b265b79e25e60f51c559d71f598a \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 index 2f2a00c..33716b3 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -1db07979699b442cccc89f3bd9e8bb4e31c0c913 \ No newline at end of file +9056341da4e5bd9bcfc357c90ed323ba5eebf80b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 index 7f809a4..2b3db542 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -89abd98be104cc94404c8efbe6be7ce81be6f328 \ No newline at end of file +914a7f33fe66a3bb4082e0beadcce5a75a5cdf72 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 index 2394e51..47016d33 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -49a8d06d76c155568d4ae8088f47b9ea044e059e \ No newline at end of file +90cf4ee6cf926ff792d1632535181c0d29bc52d5 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 index 187baf3..888a482e 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -ed879300f43367a3f511f53c5f066b965d0ac30b \ No newline at end of file +d6e56d7ce2471a660e4ddfd7b9081874113591eb \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 index bd2d8e2..f588eb38 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -75c10d685153b8ae7df92f9e187061598e8cf391 \ No newline at end of file +9d621b52bc1a3b6c34dd0a9984f85c454b9d6fd4 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 index 58778df..6ecebfe4 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios_asan.zip.sha1
@@ -1 +1 @@ -503ea74ca270e319e6598853416224c88d633116 \ No newline at end of file +59abcc2f780cddcd513a26847c56ddf72a5cb367 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 index 5b5b5d9d..89e211c 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -83c418b72862813604980fa62c998fd658aa0656 \ No newline at end of file +8de453c0d253f8ea47be10d9127f49363d39751a \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 index de48fdd6..243ac01f 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator_asan.zip.sha1
@@ -1 +1 @@ -9efe4913f72c6edfdb27246e2b559f10ade01d03 \ No newline at end of file +1d25c6be9d92de7da73e797be1b44d641294e578 \ No newline at end of file
diff --git a/ios_internal b/ios_internal index 622a57c..8577b74 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit 622a57c0b67faa85ade29d34028d20ecf9c70971 +Subproject commit 8577b74f6d5eb456ea3d5db7d4879fb7c68bc325
diff --git a/net/http/transport_security_state_static.pins b/net/http/transport_security_state_static.pins index 792055c..5f2460b 100644 --- a/net/http/transport_security_state_static.pins +++ b/net/http/transport_security_state_static.pins
@@ -43,9 +43,9 @@ # hash function for preloaded entries again (we have already done so once). # -# Last updated: 2024-12-28 12:57 UTC +# Last updated: 2024-12-29 12:55 UTC PinsListTimestamp -1735390648 +1735476911 TestSPKI sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
diff --git a/net/http/transport_security_state_static_pins.json b/net/http/transport_security_state_static_pins.json index 9db956b4..0274be3b 100644 --- a/net/http/transport_security_state_static_pins.json +++ b/net/http/transport_security_state_static_pins.json
@@ -31,7 +31,7 @@ // the 'static_spki_hashes' and 'bad_static_spki_hashes' fields in 'pinsets' // refer to, and the timestamp at which the pins list was last updated. // -// Last updated: 2024-12-28 12:57 UTC +// Last updated: 2024-12-29 12:55 UTC // { "pinsets": [
diff --git a/third_party/angle b/third_party/angle index 7c766c0..0559bc5a 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit 7c766c0edc707b9d8201c550cec8036d3e13e3f3 +Subproject commit 0559bc5a08d7162b1ea32a105e469952bd34cf71
diff --git a/third_party/blink/renderer/core/frame/frame_test_helpers.cc b/third_party/blink/renderer/core/frame/frame_test_helpers.cc index e199fa9d..b7c8313d 100644 --- a/third_party/blink/renderer/core/frame/frame_test_helpers.cc +++ b/third_party/blink/renderer/core/frame/frame_test_helpers.cc
@@ -1011,7 +1011,7 @@ } void TestWebFrameWidget::RequestDecode( - const cc::DrawImage&, + const cc::PaintImage&, base::OnceCallback<void(bool)> callback) { // TODO(paint-dev): probably this should `std::move(callback).Run(true)`, but // that could cause deep recursion into
diff --git a/third_party/blink/renderer/core/frame/frame_test_helpers.h b/third_party/blink/renderer/core/frame/frame_test_helpers.h index 9da4d161..9edee30 100644 --- a/third_party/blink/renderer/core/frame/frame_test_helpers.h +++ b/third_party/blink/renderer/core/frame/frame_test_helpers.h
@@ -278,7 +278,7 @@ return last_overscroll_; } - void RequestDecode(const cc::DrawImage&, + void RequestDecode(const cc::PaintImage&, base::OnceCallback<void(bool)>) override; using WebFrameWidgetImpl::GetOriginalScreenInfo;
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc index 3287ea3..e2488c4 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -829,6 +829,7 @@ document_->GetViewportData().UpdateViewportDescription(); auto* frame_scheduler = GetFrame()->GetFrameScheduler(); + frame_scheduler->OnDidInstallNewDocument(); frame_scheduler->TraceUrlChange(document_->Url().GetString()); frame_scheduler->SetCrossOriginToNearestMainFrame( GetFrame()->IsCrossOriginToNearestMainFrame());
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc index cbbcbd4..4b608c0 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc +++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
@@ -1594,7 +1594,7 @@ } void WebFrameWidgetImpl::RequestDecode( - const cc::DrawImage& image, + const PaintImage& image, base::OnceCallback<void(bool)> callback) { widget_base_->LayerTreeHost()->QueueImageDecode(image, std::move(callback)); }
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h index 33dd5593..b9abe22d 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h +++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h
@@ -227,7 +227,7 @@ const cc::OverscrollBehavior& overscroll_behavior) final; void RequestAnimationAfterDelay(const base::TimeDelta&) final; void SetRootLayer(scoped_refptr<cc::Layer>) override; - void RequestDecode(const cc::DrawImage&, + void RequestDecode(const cc::PaintImage&, base::OnceCallback<void(bool)>) override; void RequestBeginMainFrameNotExpected(bool request) final; int GetLayerTreeId() final;
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_test.cc b/third_party/blink/renderer/core/frame/web_frame_widget_test.cc index 22d87ea3..833a9498 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_test.cc +++ b/third_party/blink/renderer/core/frame/web_frame_widget_test.cc
@@ -274,7 +274,7 @@ bool event_processed)); MOCK_METHOD2(RequestDecode, - void(const cc::DrawImage&, base::OnceCallback<void(bool)>)); + void(const cc::PaintImage&, base::OnceCallback<void(bool)>)); }; class WebFrameWidgetImplSimTest : public SimTest {
diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index 1d9942b..c233e36 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc
@@ -2207,14 +2207,6 @@ screen_area); } -void LayoutBox::GetSpeculativeDecodeParameters( - gfx::Size& size, - InterpolationQuality& quality) const { - NOT_DESTROYED(); - size = PhysicalContentBoxRect().PixelSnappedSize(); - quality = StyleRef().GetInterpolationQuality(); -} - void LayoutBox::LocationChanged() { NOT_DESTROYED(); // The location may change because of layout of other objects. Should check
diff --git a/third_party/blink/renderer/core/layout/layout_box.h b/third_party/blink/renderer/core/layout/layout_box.h index 56278279..99ce76a 100644 --- a/third_party/blink/renderer/core/layout/layout_box.h +++ b/third_party/blink/renderer/core/layout/layout_box.h
@@ -848,9 +848,6 @@ void ImageChanged(WrappedImagePtr, CanDeferInvalidation) override; ResourcePriority ComputeResourcePriority() const final; - void GetSpeculativeDecodeParameters( - gfx::Size& size, - InterpolationQuality& quality) const override; PositionWithAffinity PositionForPointInFragments(const PhysicalOffset&) const;
diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/third_party/blink/renderer/core/loader/frame_fetch_context.cc index 7e077ec9..a8ad9f1 100644 --- a/third_party/blink/renderer/core/loader/frame_fetch_context.cc +++ b/third_party/blink/renderer/core/loader/frame_fetch_context.cc
@@ -892,33 +892,8 @@ } PaintImage paint_image = image->PaintImageForCurrentFrame(); if (paint_image) { - SkM44 matrix; - gfx::Size image_size(image->width(), image->height()); - gfx::SizeF content_size(image_resource->GetContent()->MaxSize()); - // If LayoutImage has zero size, it might be waiting for intrinsic size - // info, so decode to the image intrinsic size; otherwise scale to content. - if (!content_size.IsZero()) { - if (content_size.IsEmpty()) { - // If one dimension is zero, preserve aspect ratio. - if (content_size.width() == 0.) { - content_size.set_width(image_size.width() * - (content_size.height() / image_size.height())); - } else { - content_size.set_height(image_size.height() * - (content_size.width() / image_size.width())); - } - } - matrix.setScale(content_size.width() / image_size.width(), - content_size.height() / image_size.height()); - } - cc::DrawImage draw_image( - paint_image, /*use_dark_mode=*/false, - SkIRect::MakeWH(image_size.width(), image_size.height()), - static_cast<cc::PaintFlags::FilterQuality>( - image_resource->GetContent()->MaxInterpolationQuality()), - matrix, PaintImage::kDefaultFrameIndex); document_->GetFrame()->GetChromeClient().RequestDecode( - document_->GetFrame(), draw_image, + document_->GetFrame(), paint_image, WTF::BindOnce([](base::OnceClosure cb, bool) { std::move(cb).Run(); }, std::move(callback))); return true;
diff --git a/third_party/blink/renderer/core/loader/image_loader.cc b/third_party/blink/renderer/core/loader/image_loader.cc index 402a7c3b..765edce9 100644 --- a/third_party/blink/renderer/core/loader/image_loader.cc +++ b/third_party/blink/renderer/core/loader/image_loader.cc
@@ -210,16 +210,11 @@ it = decode_requests_.erase(it); continue; } - cc::DrawImage draw_image(image->PaintImageForCurrentFrame(), - /*use_dark_mode=*/false, - SkIRect::MakeWH(image->width(), image->height()), - cc::PaintFlags::FilterQuality::kNone, SkM44(), - PaintImage::kDefaultFrameIndex); // ImageLoader should be kept alive when decode is still pending. JS may // invoke 'decode' without capturing the Image object. If GC kicks in, // ImageLoader will be destroyed, leading to unresolved/unrejected Promise. frame->GetChromeClient().RequestDecode( - frame, draw_image, + frame, image->PaintImageForCurrentFrame(), WTF::BindOnce(&ImageLoader::DecodeRequestFinished, MakeUnwrappingCrossThreadHandle(this), request->request_id()));
diff --git a/third_party/blink/renderer/core/loader/resource/image_resource_content.cc b/third_party/blink/renderer/core/loader/resource/image_resource_content.cc index 41739039..5a4c5fc 100644 --- a/third_party/blink/renderer/core/loader/resource/image_resource_content.cc +++ b/third_party/blink/renderer/core/loader/resource/image_resource_content.cc
@@ -214,27 +214,16 @@ void ImageResourceContent::UpdateResourceInfoFromObservers() { ProhibitAddRemoveObserverInScope prohibit_add_remove_observer_in_scope(this); - cached_info_.priority_ = ResourcePriority(); - cached_info_.priority_excluding_image_loader_ = ResourcePriority(); - cached_info_.max_size_ = gfx::Size(); - cached_info_.max_interpolation_quality_ = kInterpolationNone; - - auto update = [this](const ImageResourceObserver* observer) -> void { - PriorityFromObserver(observer, cached_info_.priority_, - cached_info_.priority_excluding_image_loader_); - gfx::Size resource_size; - InterpolationQuality resource_quality; - observer->GetSpeculativeDecodeParameters(resource_size, resource_quality); - cached_info_.max_size_.SetToMax(resource_size); - cached_info_.max_interpolation_quality_ = - std::max(cached_info_.max_interpolation_quality_, resource_quality); - }; + cached_info_.priority_ = cached_info_.priority_excluding_image_loader_ = + ResourcePriority(); for (const auto& it : finished_observers_) { - update(it.key); + PriorityFromObserver(it.key, cached_info_.priority_, + cached_info_.priority_excluding_image_loader_); } for (const auto& it : observers_) { - update(it.key); + PriorityFromObserver(it.key, cached_info_.priority_, + cached_info_.priority_excluding_image_loader_); } }
diff --git a/third_party/blink/renderer/core/loader/resource/image_resource_content.h b/third_party/blink/renderer/core/loader/resource/image_resource_content.h index 51c25b4..a72ad373 100644 --- a/third_party/blink/renderer/core/loader/resource/image_resource_content.h +++ b/third_party/blink/renderer/core/loader/resource/image_resource_content.h
@@ -194,10 +194,6 @@ void SetImageResourceInfo(ImageResourceInfo*); void UpdateResourceInfoFromObservers(); - gfx::Size MaxSize() const { return cached_info_.max_size_; } - InterpolationQuality MaxInterpolationQuality() const { - return cached_info_.max_interpolation_quality_; - } // Returns priority information to be used for setting the Resource's // priority. This is NOT the current Resource's priority. @@ -269,8 +265,6 @@ struct { ResourcePriority priority_; ResourcePriority priority_excluding_image_loader_; - gfx::Size max_size_; - InterpolationQuality max_interpolation_quality_ = kInterpolationNone; } cached_info_; // Keep one-byte members together to avoid wasting space on padding.
diff --git a/third_party/blink/renderer/core/loader/resource/image_resource_observer.h b/third_party/blink/renderer/core/loader/resource/image_resource_observer.h index 51227d8acd..3528ed0 100644 --- a/third_party/blink/renderer/core/loader/resource/image_resource_observer.h +++ b/third_party/blink/renderer/core/loader/resource/image_resource_observer.h
@@ -26,7 +26,6 @@ #include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom-blink-forward.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/style/style_image.h" -#include "third_party/blink/renderer/platform/graphics/graphics_types.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_priority.h" namespace WTF { @@ -88,9 +87,6 @@ return ResourcePriority(); } virtual bool CanBeSpeculativelyDecoded() const { return true; } - virtual void GetSpeculativeDecodeParameters( - gfx::Size& size, - InterpolationQuality& quality) const {} // Name for debugging, e.g. shown in memory-infra. virtual WTF::String DebugName() const = 0;
diff --git a/third_party/blink/renderer/core/page/chrome_client.h b/third_party/blink/renderer/core/page/chrome_client.h index bae1d03..dc69bdf 100644 --- a/third_party/blink/renderer/core/page/chrome_client.h +++ b/third_party/blink/renderer/core/page/chrome_client.h
@@ -29,7 +29,7 @@ #include "base/time/time.h" #include "cc/input/event_listener_properties.h" #include "cc/input/overscroll_behavior.h" -#include "cc/paint/draw_image.h" +#include "cc/paint/paint_image.h" #include "cc/trees/paint_holding_commit_trigger.h" #include "cc/trees/paint_holding_reason.h" #include "components/viz/common/surfaces/frame_sink_id.h" @@ -554,7 +554,7 @@ } virtual void RequestDecode(LocalFrame*, - const cc::DrawImage& image, + const cc::PaintImage& image, base::OnceCallback<void(bool)> callback) { std::move(callback).Run(false); }
diff --git a/third_party/blink/renderer/core/page/chrome_client_impl.cc b/third_party/blink/renderer/core/page/chrome_client_impl.cc index 79ccb4e5..4993d90 100644 --- a/third_party/blink/renderer/core/page/chrome_client_impl.cc +++ b/third_party/blink/renderer/core/page/chrome_client_impl.cc
@@ -1041,7 +1041,7 @@ } void ChromeClientImpl::RequestDecode(LocalFrame* frame, - const cc::DrawImage& image, + const PaintImage& image, base::OnceCallback<void(bool)> callback) { FrameWidget* widget = frame->GetWidgetForLocalRoot(); widget->RequestDecode(image, std::move(callback));
diff --git a/third_party/blink/renderer/core/page/chrome_client_impl.h b/third_party/blink/renderer/core/page/chrome_client_impl.h index c060c943..383ec7d 100644 --- a/third_party/blink/renderer/core/page/chrome_client_impl.h +++ b/third_party/blink/renderer/core/page/chrome_client_impl.h
@@ -293,7 +293,7 @@ viz::FrameSinkId GetFrameSinkId(LocalFrame*) override; void RequestDecode(LocalFrame*, - const cc::DrawImage&, + const cc::PaintImage&, base::OnceCallback<void(bool)>) override; void NotifyPresentationTime(LocalFrame& frame,
diff --git a/third_party/blink/renderer/core/scheduler/scripted_idle_task_controller_test.cc b/third_party/blink/renderer/core/scheduler/scripted_idle_task_controller_test.cc index c9fc0db2..100aea0 100644 --- a/third_party/blink/renderer/core/scheduler/scripted_idle_task_controller_test.cc +++ b/third_party/blink/renderer/core/scheduler/scripted_idle_task_controller_test.cc
@@ -191,6 +191,7 @@ void OnMainFrameInteractive() override {} void OnFirstMeaningfulPaint(base::TimeTicks timestamp) override {} void OnDispatchLoadEvent() override {} + void OnDidInstallNewDocument() override {} bool IsExemptFromBudgetBasedThrottling() const override { return false; } std::unique_ptr<blink::mojom::blink::PauseSubresourceLoadingHandle> GetPauseSubresourceLoadingHandle() override {
diff --git a/third_party/blink/renderer/core/scheduler_integration_tests/frame_scheduler_test.cc b/third_party/blink/renderer/core/scheduler_integration_tests/frame_scheduler_test.cc index 9dc1c78..ea8d9d9 100644 --- a/third_party/blink/renderer/core/scheduler_integration_tests/frame_scheduler_test.cc +++ b/third_party/blink/renderer/core/scheduler_integration_tests/frame_scheduler_test.cc
@@ -8,6 +8,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/features.h" #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" +#include "third_party/blink/renderer/core/html/html_anchor_element.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/core/testing/sim/sim_request.h" #include "third_party/blink/renderer/core/testing/sim/sim_test.h" @@ -17,6 +18,108 @@ namespace blink { +class FrameSchedulerTest : public SimTest {}; + +TEST_F(FrameSchedulerTest, BackForwardCacheOptOut_FrameNavigated) { + SimRequest main_resource_1("https://example.com/example_1.html", "text/html"); + LoadURL("https://example.com/example_1.html"); + main_resource_1.Complete(R"HTML( + <!DOCTYPE html> + <a id="anchorlink" href="#bottom">Link to bottom of the page</a> + <div style="height: 1000px;"></div> + <input id="bottom">Bottom of the page</input> + )HTML"); + FrameScheduler* frame_scheduler = MainFrame().GetFrame()->GetFrameScheduler(); + + const auto bf_cache_metrics_contains = + [&frame_scheduler](SchedulingPolicy::Feature feature) { + return frame_scheduler + ->GetActiveFeaturesTrackedForBackForwardCacheMetrics() + .Contains(feature); + }; + EXPECT_FALSE( + bf_cache_metrics_contains(SchedulingPolicy::Feature::kWebSocket)); + EXPECT_FALSE(bf_cache_metrics_contains( + SchedulingPolicy::Feature::kMainResourceHasCacheControlNoStore)); + + auto feature_handle = frame_scheduler->RegisterFeature( + SchedulingPolicy::Feature::kWebSocket, + {SchedulingPolicy::DisableBackForwardCache()}); + + EXPECT_TRUE(bf_cache_metrics_contains(SchedulingPolicy::Feature::kWebSocket)); + EXPECT_FALSE(bf_cache_metrics_contains( + SchedulingPolicy::Feature::kMainResourceHasCacheControlNoStore)); + + frame_scheduler->RegisterStickyFeature( + SchedulingPolicy::Feature::kMainResourceHasCacheControlNoStore, + {SchedulingPolicy::DisableBackForwardCache()}); + + EXPECT_TRUE(bf_cache_metrics_contains(SchedulingPolicy::Feature::kWebSocket)); + EXPECT_TRUE(bf_cache_metrics_contains( + SchedulingPolicy::Feature::kMainResourceHasCacheControlNoStore)); + + // Click on the anchor element. This will cause a synchronous same-document + // navigation. Same document navigations don't affect anything. + auto* anchor = To<HTMLAnchorElement>( + GetDocument().getElementById(AtomicString("anchorlink"))); + anchor->click(); + + EXPECT_TRUE(bf_cache_metrics_contains(SchedulingPolicy::Feature::kWebSocket)); + EXPECT_TRUE(bf_cache_metrics_contains( + SchedulingPolicy::Feature::kMainResourceHasCacheControlNoStore)); + + // Regular navigations should reset the registered features. + SimRequest main_resource_2("https://example.com/example_2.html", "text/html"); + LoadURL("https://example.com/example_2.html"); + main_resource_2.Complete(R"HTML( + <!DOCTYPE HTML> + <body> + </body> + )HTML"); + EXPECT_FALSE( + bf_cache_metrics_contains(SchedulingPolicy::Feature::kWebSocket)); + EXPECT_FALSE(bf_cache_metrics_contains( + SchedulingPolicy::Feature::kMainResourceHasCacheControlNoStore)); + + // Resetting a feature handle after navigation shouldn't do anything. + feature_handle.reset(); + + EXPECT_FALSE( + bf_cache_metrics_contains(SchedulingPolicy::Feature::kWebSocket)); + EXPECT_FALSE(bf_cache_metrics_contains( + SchedulingPolicy::Feature::kMainResourceHasCacheControlNoStore)); +} + +// Regression test for crbug.com/375923380. Ensures scheduled features scoped to +// a document will not be scheduled when the frame is reused but the document is +// replaced. +TEST_F(FrameSchedulerTest, SchedulingFeatureHandlesResetWhenDocumentReplaced) { + SimRequest main_resource("https://example.com/", "text/html"); + LoadURL("https://example.com/"); + main_resource.Complete(R"HTML( + <!DOCTYPE HTML> + <body> + </body> + )HTML"); + + // Register an arbitrary feature for scheduling. + Document* initial_document = MainFrame().GetFrame()->GetDocument(); + auto scheduling_feature_handle = + MainFrame().GetFrame()->GetFrameScheduler()->RegisterFeature( + SchedulingPolicy::Feature::kWebSocket, {}); + EXPECT_TRUE(scheduling_feature_handle); + + // Perform a frame discard operation, this should replace the main frame's + // document. + MainFrame().GetFrame()->Discard(); + Document* final_document = MainFrame().GetFrame()->GetDocument(); + EXPECT_NE(initial_document, final_document); + + // The scheduling feature handle should no longer be valid after the frame's + // document is replaced. + EXPECT_FALSE(scheduling_feature_handle); +} + class FrameSchedulerFrameTypeTest : public SimTest {}; TEST_F(FrameSchedulerFrameTypeTest, GetFrameType) {
diff --git a/third_party/blink/renderer/core/web_test/web_test_web_frame_widget_impl.cc b/third_party/blink/renderer/core/web_test/web_test_web_frame_widget_impl.cc index 2b25284..69183da 100644 --- a/third_party/blink/renderer/core/web_test/web_test_web_frame_widget_impl.cc +++ b/third_party/blink/renderer/core/web_test/web_test_web_frame_widget_impl.cc
@@ -345,7 +345,7 @@ } void WebTestWebFrameWidgetImpl::RequestDecode( - const cc::DrawImage& image, + const PaintImage& image, base::OnceCallback<void(bool)> callback) { WebFrameWidgetImpl::RequestDecode(image, std::move(callback));
diff --git a/third_party/blink/renderer/core/web_test/web_test_web_frame_widget_impl.h b/third_party/blink/renderer/core/web_test/web_test_web_frame_widget_impl.h index 6894a6b..84b9b2e 100644 --- a/third_party/blink/renderer/core/web_test/web_test_web_frame_widget_impl.h +++ b/third_party/blink/renderer/core/web_test/web_test_web_frame_widget_impl.h
@@ -59,7 +59,7 @@ FrameWidgetTestHelper* GetFrameWidgetTestHelperForTesting() override; // FrameWidget overrides. - void RequestDecode(const cc::DrawImage&, + void RequestDecode(const cc::PaintImage&, base::OnceCallback<void(bool)>) override; private:
diff --git a/third_party/blink/renderer/platform/scheduler/common/dummy_schedulers.cc b/third_party/blink/renderer/platform/scheduler/common/dummy_schedulers.cc index 30b4156..05b190c 100644 --- a/third_party/blink/renderer/platform/scheduler/common/dummy_schedulers.cc +++ b/third_party/blink/renderer/platform/scheduler/common/dummy_schedulers.cc
@@ -111,6 +111,7 @@ void OnFirstContentfulPaintInMainFrame() override {} void OnFirstMeaningfulPaint(base::TimeTicks timestamp) override {} void OnDispatchLoadEvent() override {} + void OnDidInstallNewDocument() override {} void OnMainFrameInteractive() override {} bool IsExemptFromBudgetBasedThrottling() const override { return false; } std::unique_ptr<blink::mojom::blink::PauseSubresourceLoadingHandle>
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.cc b/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.cc index 0ee8999..91d795f 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.cc
@@ -725,7 +725,6 @@ } void FrameSchedulerImpl::ResetForNavigation() { - document_bound_weak_factory_.InvalidateWeakPtrs(); back_forward_cache_disabling_feature_tracker_.Reset(); } @@ -1028,6 +1027,10 @@ is_load_event_dispatched_ = true; } +void FrameSchedulerImpl::OnDidInstallNewDocument() { + document_bound_weak_factory_.InvalidateWeakPtrs(); +} + bool FrameSchedulerImpl::IsWaitingForContentfulPaint() const { return waiting_for_contentful_paint_; }
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.h b/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.h index 69984167..ae0976b 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.h +++ b/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.h
@@ -127,6 +127,7 @@ void OnFirstMeaningfulPaint(base::TimeTicks timestamp) override; void OnMainFrameInteractive() override; void OnDispatchLoadEvent() override; + void OnDidInstallNewDocument() override; base::TimeDelta UnreportedTaskTime() const override; bool IsWaitingForContentfulPaint() const;
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl_unittest.cc b/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl_unittest.cc index 389693f..4244199 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl_unittest.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl_unittest.cc
@@ -1702,53 +1702,6 @@ testing::UnorderedElementsAre()); } -TEST_F(FrameSchedulerImplTest, BackForwardCacheOptOut_FrameNavigated) { - EXPECT_THAT( - frame_scheduler_->GetActiveFeaturesTrackedForBackForwardCacheMetrics(), - testing::UnorderedElementsAre()); - - auto feature_handle = frame_scheduler_->RegisterFeature( - SchedulingPolicy::Feature::kWebSocket, - {SchedulingPolicy::DisableBackForwardCache()}); - - EXPECT_THAT( - frame_scheduler_->GetActiveFeaturesTrackedForBackForwardCacheMetrics(), - testing::UnorderedElementsAre(SchedulingPolicy::Feature::kWebSocket)); - - frame_scheduler_->RegisterStickyFeature( - SchedulingPolicy::Feature::kMainResourceHasCacheControlNoStore, - {SchedulingPolicy::DisableBackForwardCache()}); - - EXPECT_THAT( - frame_scheduler_->GetActiveFeaturesTrackedForBackForwardCacheMetrics(), - testing::UnorderedElementsAre( - SchedulingPolicy::Feature::kWebSocket, - SchedulingPolicy::Feature::kMainResourceHasCacheControlNoStore)); - - // Same document navigations don't affect anything. - frame_scheduler_->DidCommitProvisionalLoad( - false, FrameScheduler::NavigationType::kSameDocument); - EXPECT_THAT( - frame_scheduler_->GetActiveFeaturesTrackedForBackForwardCacheMetrics(), - testing::UnorderedElementsAre( - SchedulingPolicy::Feature::kWebSocket, - SchedulingPolicy::Feature::kMainResourceHasCacheControlNoStore)); - - // Regular navigations reset all features. - frame_scheduler_->DidCommitProvisionalLoad( - false, FrameScheduler::NavigationType::kOther); - EXPECT_THAT( - frame_scheduler_->GetActiveFeaturesTrackedForBackForwardCacheMetrics(), - testing::UnorderedElementsAre()); - - // Resetting a feature handle after navigation shouldn't do anything. - feature_handle.reset(); - - EXPECT_THAT( - frame_scheduler_->GetActiveFeaturesTrackedForBackForwardCacheMetrics(), - testing::UnorderedElementsAre()); -} - TEST_F(FrameSchedulerImplTest, FeatureUpload) { ResetFrameScheduler(/*is_in_embedded_frame_tree=*/false, FrameScheduler::FrameType::kMainFrame);
diff --git a/third_party/blink/renderer/platform/scheduler/public/frame_scheduler.h b/third_party/blink/renderer/platform/scheduler/public/frame_scheduler.h index a784cd5b..c435569 100644 --- a/third_party/blink/renderer/platform/scheduler/public/frame_scheduler.h +++ b/third_party/blink/renderer/platform/scheduler/public/frame_scheduler.h
@@ -163,6 +163,9 @@ // Tells the scheduler that the load event has been dispatched for this frame. virtual void OnDispatchLoadEvent() = 0; + // Tells the scheduler that a new document has been installed for this frame. + virtual void OnDidInstallNewDocument() = 0; + // Returns true if this frame is should not throttled (e.g. due to an active // connection). // Note that this only applies to the current frame,
diff --git a/third_party/blink/renderer/platform/widget/frame_widget.h b/third_party/blink/renderer/platform/widget/frame_widget.h index 2d97b979..3827655 100644 --- a/third_party/blink/renderer/platform/widget/frame_widget.h +++ b/third_party/blink/renderer/platform/widget/frame_widget.h
@@ -26,12 +26,12 @@ namespace cc { class AnimationHost; class AnimationTimeline; -class DrawImage; enum class EventListenerClass; enum class EventListenerProperties; class Layer; class LayerTreeSettings; class LayerTreeDebugState; +class PaintImage; struct ElementId; } // namespace cc @@ -81,7 +81,7 @@ virtual void SetRootLayer(scoped_refptr<cc::Layer> layer) = 0; // Image decode functionality. - virtual void RequestDecode(const cc::DrawImage&, + virtual void RequestDecode(const cc::PaintImage&, base::OnceCallback<void(bool)>) = 0; // Forwards to `WebFrameWidget::NotifyPresentationTime()`.
diff --git a/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py b/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py index fe2aae3..2d69da4 100755 --- a/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py +++ b/third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
@@ -452,7 +452,6 @@ 'cc::AuxImage', 'cc::CategorizedWorkerPool', 'cc::ColorFilter', - 'cc::DrawImage', 'cc::DrawLooper', 'cc::InspectablePaintRecorder', 'cc::InspectableRecordPaintCanvas',
diff --git a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_l1.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_l1.https.any.js index 3bbb85b..d2d39b3b 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_l1.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_l1.https.any.js
@@ -611,6 +611,504 @@ } } } + }, + + // float16 tests + { + 'name': 'reduceL1 float16 0D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [5.5078125], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': [5.5078125], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceL1 float16 0D constant tensor empty axes', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [5.5078125], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}, {'options': {'axes': []}}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': [5.5078125], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceL1 float16 1D constant tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [24], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [1093], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 1D tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [1093], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 1D tensor all negative default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + -98.8125, -57.65625, -57.09375, -6.69140625, -45.3125, + -86.6875, -74.75, -76.4375, -75.375, -18.21875, + -54.65625, -36.4375, -18.328125, -47.9375, -40.1875, + -15.828125, -48.875, -41.59375, -20.65625, -92.3125, + -46.28125, -80.5625, -25.5, -48.96875 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [1215], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 1D tensor all positive integers default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 18, 29, 35, 36, 4, 76, 41, 18, 53, 29, 25, 94, + 26, 1, 3, 68, 39, 25, 87, 30, 39, 75, 76, 66 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [993], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 1D tensor all negative integers default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + -92, -52, -88, -78, -20, -73, -42, -57, -39, -75, -17, -36, + -81, -24, -88, -91, -76, -5, -44, -66, -96, -8, -69, -27 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [1344], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 2D tensor default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [4, 6], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [1093], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 3D tensor default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [1093], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 4D tensor default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [1093], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 5D tensor default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [1093], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 3D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}, {'options': {'axes': [2]}}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': [142, 106.625, 175.375, 286.75, 169.375, 212.5], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceL1 float16 4D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': + [{'input': 'reduceL1Input'}, {'options': {'axes': [0, 2]}}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': [258.5, 174.5, 102.1875, 134.5, 208, 215], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceL1 float16 3D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [ + {'input': 'reduceL1Input'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [1093], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 3D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': + [{'input': 'reduceL1Input'}, {'options': {'keepDimensions': true}}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': [1093], + 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceL1 float16 4D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [ + {'input': 'reduceL1Input'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': + {'data': [1093], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL1 float16 4D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': + [{'input': 'reduceL1Input'}, {'options': {'keepDimensions': true}}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': [1093], + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceL1 float16 4D tensor options.axes with options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [ + {'input': 'reduceL1Input'}, + {'options': {'axes': [1, 3], 'keepDimensions': false}} + ], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': [108.4375, 315.5, 359.5, 309], + 'descriptor': {shape: [2, 2], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceL1 float16 4D tensor options.axes with options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [ + 5.5078125, 50.625, 1.677734375, 84.1875, 15.6640625, 52.90625, + 9.125, 28.9375, 12.5703125, 11.3984375, 86.9375, 64.5, + 71.3125, 76.375, 41.53125, 97.5625, 31.796875, 6.08984375, + 61.71875, 69.75, 38.90625, 52.28125, 22.3125, 99.0625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [ + {'input': 'reduceL1Input'}, + {'options': {'axes': [1, 3], 'keepDimensions': true}} + ], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': [108.4375, 315.5, 359.5, 309], + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} + } + } + } } ];
diff --git a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_l2.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_l2.https.any.js index d5791589..d8b9acd 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_l2.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_l2.https.any.js
@@ -614,6 +614,499 @@ } } } + }, + + // float16 tests + { + 'name': 'reduceL2 float16 0D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [4.859375], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [4.859375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 0D constant tensor empty axes', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [4.859375], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}, {'options': {'axes': []}}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [4.859375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 1D constant tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [24], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [272], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 1D tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [272], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 1D tensor all negative default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + -66.8125, -53, -59.59375, -46.15625, -49.59375, -12.8359375, + -88.0625, -75.5625, -50.78125, -36.96875, -26.34375, -58.90625, + -94.3125, -22.78125, -84.375, -60.46875, -41.46875, -92.875, + -85.0625, -30.234375, -47.34375, -25.265625, -78.125, -28.328125 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [292.5], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 1D tensor all positive integers default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4, 29, 8, 56, 42, 78, 89, 64, 56, 81, 85, 18, + 6, 39, 35, 63, 87, 50, 81, 89, 5, 8, 37, 37 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [274.5], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 1D tensor all negative integers default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + -70, -78, -65, -77, -25, -47, -63, -67, -66, -15, -28, -75, + -88, -54, -13, -27, -5, -18, -68, -71, -50, -56, -99, -99 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [300.5], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 2D tensor default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [4, 6], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [272], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 3D tensor default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [272], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 4D tensor default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [272], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 5D tensor default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [272], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 3D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}, {'options': {'axes': [2]}}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': { + 'data': [122.375, 124.8125, 128.25, 128.125, 87.1875, 55.03125], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceL2 float16 4D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': + [{'input': 'reduceL2Input'}, {'options': {'axes': [0, 2]}}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': { + 'data': [114.4375, 110.3125, 133.5, 64.9375, 128, 101.6875], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceL2 float16 3D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [ + {'input': 'reduceL2Input'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [272], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 3D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': + [{'input': 'reduceL2Input'}, {'options': {'keepDimensions': true}}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': { + 'data': [272], + 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceL2 float16 4D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [ + {'input': 'reduceL2Input'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [272], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceL2 float16 4D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': + [{'input': 'reduceL2Input'}, {'options': {'keepDimensions': true}}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': { + 'data': [272], + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceL2 float16 4D tensor options.axes with options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [ + {'input': 'reduceL2Input'}, + {'options': {'axes': [1, 3], 'keepDimensions': false}} + ], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': { + 'data': [138.625, 166.625, 149.875, 67.625], + 'descriptor': {shape: [2, 2], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceL2 float16 4D tensor options.axes with options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [ + 4.859375, 88.25, 54.5, 64.75, 6.85546875, 91.375, + 41.875, 73.625, 35.3125, 48.34375, 82.375, 77.875, + 93.3125, 62.5, 60.28125, 13.234375, 20.53125, 53.4375, + 11.3203125, 64.75, 43.65625, 0.83740234375, 0.68505859375, 33.5 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [ + {'input': 'reduceL2Input'}, + {'options': {'axes': [1, 3], 'keepDimensions': true}} + ], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': { + 'data': [138.625, 166.625, 149.875, 67.625], + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} + } + } + } } ];
diff --git a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_log_sum.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_log_sum.https.any.js index ab827e3..2afc4f6 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_log_sum.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_log_sum.https.any.js
@@ -566,6 +566,493 @@ } } } + }, + + // float16 tests + { + 'name': 'reduceLogSum float16 0D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [64.5625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [{'input': 'reduceLogSumInput'}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [4.16796875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 0D constant tensor empty axes', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [64.5625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': + [{'input': 'reduceLogSumInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [4.16796875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceLogSum float16 1D constant tensor all non-negative default options', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [24], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [{'input': 'reduceLogSumInput'}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [7.0390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 1D tensor all non-negative default options', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [{'input': 'reduceLogSumInput'}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [7.0390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceLogSum float16 1D tensor all non-negative integers default options', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 63, 82, 49, 23, 98, 67, 15, 9, 89, 7, 69, 61, + 47, 50, 41, 39, 58, 52, 35, 83, 81, 7, 34, 9 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [{'input': 'reduceLogSumInput'}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': + {'data': [7.0625], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceLogSum float16 2D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [4, 6], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [{'input': 'reduceLogSumInput'}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [7.0390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 3D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [{'input': 'reduceLogSumInput'}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [7.0390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 4D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [{'input': 'reduceLogSumInput'}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [7.0390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 5D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [{'input': 'reduceLogSumInput'}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [7.0390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 3D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': + [{'input': 'reduceLogSumInput'}, {'options': {'axes': [2]}}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [5.59375, 4.7734375, 5.3125, 5.25, 4.97265625, 5.375], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 4D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': + [{'input': 'reduceLogSumInput'}, {'options': {'axes': [0, 2]}}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [ + 5.41015625, 5.3671875, 5.3984375, 4.65234375, 4.74609375, 5.56640625 + ], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 3D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [ + {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [7.0390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 3D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [ + {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [7.0390625], + 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 4D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [ + {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [7.0390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSum float16 4D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [ + {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [7.0390625], + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceLogSum float16 4D tensor options.axes with options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [ + {'input': 'reduceLogSumInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': false}} + ], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [5.7265625, 5.64453125, 5.453125, 5.7578125], + 'descriptor': {shape: [2, 2], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceLogSum float16 4D tensor options.axes with options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [ + 64.5625, 97.875, 26.53125, 79.8125, 50.40625, + 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, + 11.140625, 55.09375, 43.78125, 13.828125, 97.375, + 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, + 69.25, 3.853515625, 70.5625, 72 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [ + {'input': 'reduceLogSumInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': true}} + ], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [5.7265625, 5.64453125, 5.453125, 5.7578125], + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} + } + } + } } ];
diff --git a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_log_sum_exp.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_log_sum_exp.https.any.js index eecdf56f..1a9934e 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_log_sum_exp.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_log_sum_exp.https.any.js
@@ -627,6 +627,569 @@ } } } + }, + + // float16 tests + { + 'name': 'reduceLogSumExp float16 0D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [0.79736328125], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [0.79736328125], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 0D constant tensor empty axes', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [0.79736328125], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': + [{'input': 'reduceLogSumExpInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [0.79736328125], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceLogSumExp float16 1D constant tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [24], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [10.390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 1D tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [10.390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 1D tensor all negative default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + -4.02734375, -9.4453125, -3.119140625, + -5.9453125, -0.3701171875, -4.3984375, + -6.60546875, -5.53515625, -7.36328125, + -1.9990234375, -9.09375, -8.6953125, + -8.4140625, -1.0107421875, -9.8125, + -9.7265625, -9.15625, -0.0016984939575195312, + -9.9609375, -5.9921875, -6.1796875, + -1.2333984375, -0.4423828125, -6.98828125 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [1.1669921875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceLogSumExp float16 1D tensor all positive integers default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 1, 5, 7, 5, 7, 5, 4, 2, 1, 5, 8, 2, + 4, 1, 4, 5, 4, 8, 6, 2, 7, 7, 8, 5 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': + {'data': [9.609375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': + 'reduceLogSumExp float16 1D tensor all negative integers default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + -6, -3, -5, -1, -9, -5, -1, -2, -10, -1, -5, -7, + -7, -3, -10, -10, -8, -6, -2, -6, -1, -9, -5, -2 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [0.7001953125], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 2D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [4, 6], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [10.390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 3D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [10.390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 4D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [10.390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 5D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [10.390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 3D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': + [{'input': 'reduceLogSumExpInput'}, {'options': {'axes': [2]}}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [ + 8.5546875, 3.986328125, 5.52734375, 9.078125, 6.99609375, 9.7578125 + ], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 4D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': + [{'input': 'reduceLogSumExpInput'}, {'options': {'axes': [0, 2]}}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': + [4.671875, 9.078125, 8.5390625, 9.265625, 6.44921875, 8.9140625], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 3D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [ + {'input': 'reduceLogSumExpInput'}, + {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [10.390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 3D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [ + {'input': 'reduceLogSumExpInput'}, + {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [10.390625], + 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 4D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [ + {'input': 'reduceLogSumExpInput'}, + {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [10.390625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceLogSumExp float16 4D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [ + {'input': 'reduceLogSumExpInput'}, + {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [10.390625], + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceLogSumExp float16 4D tensor options.axes with options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [ + {'input': 'reduceLogSumExpInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': false}} + ], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [8.5703125, 5.5, 9.75, 9.203125], + 'descriptor': {shape: [2, 2], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceLogSumExp float16 4D tensor options.axes with options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [ + 0.79736328125, 5.046875, 8.5234375, 1.40625, + 0.11883544921875, 0.285888671875, 1.9326171875, 3.794921875, + 2.603515625, 4.9375, 4.5703125, 0.78662109375, + 0.210205078125, 9.0625, 4.1015625, 4.59765625, + 0.2548828125, 1.1591796875, 6.8046875, 5.234375, + 8.9140625, 9.1640625, 5.71875, 0.325439453125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [ + {'input': 'reduceLogSumExpInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': true}} + ], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [8.5703125, 5.5, 9.75, 9.203125], + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} + } + } + } } ];
diff --git a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_max.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_max.https.any.js index 3695d1d..9d74621 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_max.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_max.https.any.js
@@ -537,6 +537,444 @@ } } }, + + // float16 tests + { + 'name': 'reduceMax float16 0D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [32.15625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [32.15625], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMax float16 0D constant tensor empty axes', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [32.15625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [32.15625], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMax float16 1D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [24], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [99.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMax float16 1D tensor default options', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [99.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMax float16 2D tensor default options', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [4, 6], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [99.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMax float16 3D tensor default options', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [99.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMax float16 4D tensor default options', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [99.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMax float16 5D tensor default options', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [99.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMax float16 3D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}, {'options': {'axes': [2]}}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': { + 'data': [90.4375, 75.875, 95, 96.5625, 99.75, 20.25], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceMax float16 4D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': + [{'input': 'reduceMaxInput'}, {'options': {'axes': [0, 2]}}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': { + 'data': [62.5, 96.5625, 99.75, -21.5625, 95, 37.28125], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceMax float16 3D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [ + {'input': 'reduceMaxInput'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [99.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMax float16 3D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [ + {'input': 'reduceMaxInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': { + 'data': [99.75], + 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceMax float16 4D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [ + {'input': 'reduceMaxInput'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [99.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMax float16 4D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [ + {'input': 'reduceMaxInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': { + 'data': [99.75], + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceMax float16 4D tensor options.axes with options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [ + {'input': 'reduceMaxInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': false}} + ], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': { + 'data': [90.4375, 95, 96.5625, 99.75], + 'descriptor': {shape: [2, 2], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceMax float16 4D tensor options.axes with options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [ + 32.15625, 90.4375, -26.34375, -7.1484375, 75.875, + -48.21875, -53.09375, 66.6875, -96.1875, -88.3125, + 95, 37.28125, -42.21875, 96.5625, 0.880859375, + 62.5, 36.65625, 99.75, -72.875, -46.03125, + 20.25, -21.5625, -51.28125, -42.59375 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [ + {'input': 'reduceMaxInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': true}} + ], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': { + 'data': [90.4375, 95, 96.5625, 99.75], + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} + } + } + } + } ]; if (navigator.ml) {
diff --git a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_mean.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_mean.https.any.js index 01d2a548..834bfb22 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_mean.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_mean.https.any.js
@@ -620,6 +620,521 @@ } } } + }, + + // float16 tests + { + 'name': 'reduceMean float16 0D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [95.875], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [95.875], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMean float16 0D constant tensor empty axes', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [95.875], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [95.875], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': + 'reduceMean float16 1D constant tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [24], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [40.3125], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMean float16 1D tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [40.3125], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMean float16 1D tensor all negative default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + -37.15625, -44.5, -6.125, -6.3203125, -76.5625, + -4.13671875, -20.765625, -38.75, -36.8125, -26.28125, + -12.5703125, -55.28125, -20.703125, -34.1875, -45.375, + -35, -67.8125, -0.74365234375, -21.984375, -61.3125, + -58.59375, -76, -23.921875, -22.9375 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [-34.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': + 'reduceMean float16 1D tensor all positive integers default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 42, 24, 44, 38, 82, 93, 64, 40, 48, 78, 81, 59, + 45, 18, 3, 77, 60, 19, 66, 8, 21, 19, 62, 71 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [48.40625], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': + 'reduceMean float16 1D tensor all negative integers default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + -73, -8, -55, -73, -61, -54, -5, -39, -66, -53, -57, -39, + -62, -98, -36, -1, -75, -8, -71, -72, -67, -16, -21, -31 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': { + 'data': [-47.53125], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceMean float16 2D tensor default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [4, 6], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [40.3125], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMean float16 3D tensor default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [40.3125], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMean float16 4D tensor default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [40.3125], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMean float16 5D tensor default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [40.3125], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMean float16 3D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}, {'options': {'axes': [2]}}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': { + 'data': [45.46875, 49.65625, 50.9375, 44.75, 27.78125, 23.265625], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceMean float16 4D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': + [{'input': 'reduceMeanInput'}, {'options': {'axes': [0, 2]}}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': { + 'data': [54.84375, 40.25, 22.0625, 48.59375, 51.34375, 24.796875], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceMean float16 3D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [ + {'input': 'reduceMeanInput'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [40.3125], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMean float16 3D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [ + {'input': 'reduceMeanInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': { + 'data': [40.3125], + 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceMean float16 4D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [ + {'input': 'reduceMeanInput'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [40.3125], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMean float16 4D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [ + {'input': 'reduceMeanInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': { + 'data': [40.3125], + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceMean float16 4D tensor options.axes with options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [ + {'input': 'reduceMeanInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': false}} + ], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': { + 'data': [52.28125, 45.09375, 47.625, 16.203125], + 'descriptor': {shape: [2, 2], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceMean float16 4D tensor options.axes with options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [ + 95.875, 75.6875, 1.5419921875, 8.7890625, 70.0625, + 13.78125, 20, 94.8125, 25.828125, 94.125, + 67.75, 16.09375, 92.1875, 11.5703125, 52.71875, + 22.46875, 3.662109375, 20.203125, 58.5625, 28.671875, + 42.125, 21.640625, 14.1640625, 15.125 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [ + {'input': 'reduceMeanInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': true}} + ], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': { + 'data': [52.28125, 45.09375, 47.625, 16.203125], + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} + } + } + } } ];
diff --git a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_min.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_min.https.any.js index b09fd5c..c618a92 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_min.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_min.https.any.js
@@ -536,6 +536,444 @@ } } } + }, + + // float16 tests + { + 'name': 'reduceMin float16 0D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [-58.75], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-58.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMin float16 0D constant tensor empty axes', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [-58.75], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-58.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMin float16 1D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [24], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-87.9375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMin float16 1D tensor default options', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-87.9375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMin float16 2D tensor default options', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [4, 6], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-87.9375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMin float16 3D tensor default options', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-87.9375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMin float16 4D tensor default options', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-87.9375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMin float16 5D tensor default options', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-87.9375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMin float16 3D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}, {'options': {'axes': [2]}}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': { + 'data': [-87.9375, -39.5, -53.75, -31.71875, -84.4375, -55.96875], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceMin float16 4D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': + [{'input': 'reduceMinInput'}, {'options': {'axes': [0, 2]}}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': { + 'data': [-58.75, -87.9375, -70.125, -59.40625, -84.4375, -53.75], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceMin float16 3D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [ + {'input': 'reduceMinInput'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-87.9375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMin float16 3D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [ + {'input': 'reduceMinInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': { + 'data': [-87.9375], + 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceMin float16 4D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [ + {'input': 'reduceMinInput'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-87.9375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceMin float16 4D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [ + {'input': 'reduceMinInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': { + 'data': [-87.9375], + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceMin float16 4D tensor options.axes with options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [ + {'input': 'reduceMinInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': false}} + ], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': { + 'data': [-87.9375, -53.75, -84.4375, -55.96875], + 'descriptor': {shape: [2, 2], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceMin float16 4D tensor options.axes with options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [ + -58.75, -87.9375, -70.125, -53.625, -39.5, + 76.5, -18.703125, 44.78125, 30.703125, 61.46875, + 77.8125, -53.75, -31.71875, -9.734375, 77.9375, + 99, 73.375, 92.0625, -59.40625, -84.4375, + 75.875, 96, -55.96875, -1.791015625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [ + {'input': 'reduceMinInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': true}} + ], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': { + 'data': [-87.9375, -53.75, -84.4375, -55.96875], + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} + } + } + } } ];
diff --git a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_product.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_product.https.any.js index 721c9a1e..0669c66 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_product.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_product.https.any.js
@@ -535,6 +535,484 @@ } } } + }, + + // float16 tests + { + 'name': 'reduceProduct float16 0D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [-68.75], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [{'input': 'reduceProductInput'}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': + {'data': [-68.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceProduct float16 0D constant tensor empty axes', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [-68.75], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': + [{'input': 'reduceProductInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': + {'data': [-68.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceProduct float16 1D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [24], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [{'input': 'reduceProductInput'}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [-0.1248779296875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 1D tensor default options', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [{'input': 'reduceProductInput'}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [-0.1248779296875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 2D tensor default options', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [4, 6], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [{'input': 'reduceProductInput'}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [-0.1248779296875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 3D tensor default options', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [{'input': 'reduceProductInput'}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [-0.1248779296875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 4D tensor default options', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [{'input': 'reduceProductInput'}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [-0.1248779296875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 5D tensor default options', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [{'input': 'reduceProductInput'}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [-0.1248779296875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 3D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': + [{'input': 'reduceProductInput'}, {'options': {'axes': [2]}}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [ + -0.3759765625, -4.9140625, -0.332763671875, -3.849609375, + -0.53759765625, 0.0980224609375 + ], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 4D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': + [{'input': 'reduceProductInput'}, {'options': {'axes': [0, 2]}}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [ + 1.2744140625, 1.6640625, -1.1962890625, -1.95703125, + -0.0312042236328125, 0.80615234375 + ], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 3D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [ + {'input': 'reduceProductInput'}, + {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [-0.1248779296875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 3D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [ + {'input': 'reduceProductInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [-0.1248779296875], + 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 4D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [ + {'input': 'reduceProductInput'}, + {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [-0.1248779296875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceProduct float16 4D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [ + {'input': 'reduceProductInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [-0.1248779296875], + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceProduct float16 4D tensor options.axes with options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [ + {'input': 'reduceProductInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': false}} + ], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [1.666015625, -0.369384765625, 3.64453125, 0.0556640625], + 'descriptor': {shape: [2, 2], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceProduct float16 4D tensor options.axes with options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [ + 1.578125, 0.8291015625, 0.81640625, -0.35205078125, + -1.390625, -1.892578125, -1.466796875, 1.2734375, + -0.8349609375, -1.912109375, 0.5244140625, -0.3974609375, + -1.90625, 1.4794921875, 1.134765625, 1.203125, + -0.9755859375, 0.68212890625, -0.6015625, -1.3427734375, + -1.41015625, 1.16015625, 0.0347900390625, -1.72265625 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [ + {'input': 'reduceProductInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': true}} + ], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': [1.666015625, -0.369384765625, 3.64453125, 0.0556640625], + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} + } + } + } } ];
diff --git a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_sum.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_sum.https.any.js index 48b65a77..0f4fe44 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_sum.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_sum.https.any.js
@@ -613,6 +613,502 @@ } } } + }, + + // float16 tests + { + 'name': 'reduceSum float16 0D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [69.625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [69.625], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 0D constant tensor empty axes', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [69.625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [69.625], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 1D constant tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [24], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [1314], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 1D tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [1314], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 1D tensor all negative default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + -51.78125, -34.46875, -40.96875, -83.375, -67.6875, + -18.703125, -20.28125, -20.125, -83.625, -23.65625, + -10.2109375, -36.21875, -76.25, -9.09375, -53.875, + -67.5, -71.125, -82.0625, -96.3125, -68.4375, + -26.109375, -68, -4.83203125, -48.90625 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [-1164], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 1D tensor all positive integers default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 56, 90, 67, 33, 20, 58, 22, 15, 86, 79, 59, 99, + 16, 95, 67, 11, 60, 89, 50, 57, 77, 89, 10, 2 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [1307], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 1D tensor all negative integers default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + -55, -36, -74, -17, -67, -95, -3, -67, -95, -13, -45, -9, + -33, -98, -86, -11, -70, -44, -31, -68, -79, -24, -60, -36 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [-1216], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 2D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [4, 6], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [1314], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 3D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [1314], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 4D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [1314], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 5D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [1314], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 3D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}, {'options': {'axes': [2]}}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': { + 'data': [210.5, 104.5625, 226.25, 239, 260.5, 273.25], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSum float16 4D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': + [{'input': 'reduceSumInput'}, {'options': {'axes': [0, 2]}}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': { + 'data': [179.625, 260.5, 219.375, 246.875, 157.5, 250.125], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSum float16 3D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [ + {'input': 'reduceSumInput'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [1314], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 3D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [ + {'input': 'reduceSumInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': { + 'data': [1314], + 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSum float16 4D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [ + {'input': 'reduceSumInput'}, {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [1314], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSum float16 4D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [ + {'input': 'reduceSumInput'}, {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': { + 'data': [1314], + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceSum float16 4D tensor options.axes with options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [ + {'input': 'reduceSumInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': false}} + ], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': { + 'data': [355.25, 186, 362.25, 410.25], + 'descriptor': {shape: [2, 2], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceSum float16 4D tensor options.axes with options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [ + 69.625, 99.1875, 32.78125, 8.8828125, 16.09375, 11.8046875, + 32.65625, 44, 77, 79.8125, 45, 24.390625, + 57.5, 57.59375, 80.25, 43.65625, 87.5, 94.5, + 35.53125, 42.84375, 88.5625, 98.875, 25.625, 60.1875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [ + {'input': 'reduceSumInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': true}} + ], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': { + 'data': [355.25, 186, 362.25, 410.25], + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} + } + } + } } ];
diff --git a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_sum_square.https.any.js b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_sum_square.https.any.js index 435e748f7..d2c494e9 100644 --- a/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_sum_square.https.any.js +++ b/third_party/blink/web_tests/external/wpt/webnn/conformance_tests/reduce_sum_square.https.any.js
@@ -640,6 +640,584 @@ } } } + }, + + // float16 tests + { + 'name': 'reduceSumSquare float16 0D constant tensor default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [52.5625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': + {'data': [2762], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSumSquare float16 0D constant tensor empty axes', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [52.5625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': + [{'input': 'reduceSumSquareInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': + {'data': [2762], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': + 'reduceSumSquare float16 1D constant tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [24], dataType: 'float16'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [30.515625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 1D tensor all positive default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [30.515625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 1D tensor all negative default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + -1.646484375, -1.2998046875, -0.57763671875, + -0.5869140625, -1.740234375, -0.2020263671875, + -1.28125, -1.92578125, -0.63671875, + -0.5068359375, -1.9462890625, -1.5078125, + -1.212890625, -0.6669921875, -1.1337890625, + -0.450439453125, -0.7978515625, -0.2196044921875, + -0.221923828125, -0.1463623046875, -0.75537109375, + -1.0830078125, -1.3740234375, -0.059600830078125 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [28.015625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceSumSquare float16 1D tensor all positive integers default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 2, 4, 2, 6, 3, 9, 1, 2, 1, 4, 7, 6, + 3, 1, 3, 1, 6, 5, 1, 4, 4, 3, 8, 3 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': + {'data': [453], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': + 'reduceSumSquare float16 1D tensor all negative integers default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + -10, -6, -9, -8, -3, -4, -4, -2, -3, -2, -4, -5, + -2, -2, -3, -3, -1, -6, -1, -3, -9, -8, -5, -2 + ], + 'descriptor': {shape: [24], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': + {'data': [627], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSumSquare float16 1D tensor with empty axes', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': + {'data': [2, 3], 'descriptor': {shape: [2], dataType: 'float16'}} + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': + [{'input': 'reduceSumSquareInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': + {'data': [4, 9], 'descriptor': {shape: [2], dataType: 'float16'}} + } + } + }, + { + 'name': 'reduceSumSquare float16 2D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [4, 6], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [30.515625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 3D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [30.515625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 4D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [30.515625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 5D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [30.515625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 3D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': + [{'input': 'reduceSumSquareInput'}, {'options': {'axes': [2]}}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [ + 4.94140625, 4.30859375, 1.4765625, 3.458984375, 11.359375, + 4.97265625 + ], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 4D tensor options.axes', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': + [{'input': 'reduceSumSquareInput'}, {'options': {'axes': [0, 2]}}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [ + 3.72265625, 5.4453125, 5.75, 5.00390625, 8.6796875, 1.9130859375 + ], + 'descriptor': {shape: [2, 3], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 3D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [ + {'input': 'reduceSumSquareInput'}, + {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [30.515625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 3D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [ + {'input': 'reduceSumSquareInput'}, + {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [30.515625], + 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 4D tensor options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [ + {'input': 'reduceSumSquareInput'}, + {'options': {'keepDimensions': false}} + ], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [30.515625], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { + 'name': 'reduceSumSquare float16 4D tensor options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [ + {'input': 'reduceSumSquareInput'}, + {'options': {'keepDimensions': true}} + ], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [30.515625], + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceSumSquare float16 4D tensor options.axes with options.keepDimensions=false', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [ + {'input': 'reduceSumSquareInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': false}} + ], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [8.828125, 1.8974609375, 9.625, 10.1640625], + 'descriptor': {shape: [2, 2], dataType: 'float16'} + } + } + } + }, + { + 'name': + 'reduceSumSquare float16 4D tensor options.axes with options.keepDimensions=true', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [ + 1.3935546875, 1.20703125, 1.18359375, 0.3759765625, + 0.69677734375, 0.75244140625, 1.068359375, 1.455078125, + 0.87890625, 0.2149658203125, 0.7998046875, 0.135986328125, + 1.099609375, 0.77685546875, 1.1025390625, 0.65625, + 1.703125, 1.6025390625, 1.5185546875, 1.892578125, + 0.8408203125, 1.2294921875, 1.529296875, 0.64404296875 + ], + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [ + {'input': 'reduceSumSquareInput'}, + {'options': {'axes': [1, 3], 'keepDimensions': true}} + ], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': [8.828125, 1.8974609375, 9.625, 10.1640625], + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} + } + } + } } ];
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index da76e16..b434f78 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit da76e16c8739ce12d5eceda3e0ce66984f838a82 +Subproject commit b434f78c13e1e70adb06b724d6c22f2dd5d238eb
diff --git a/third_party/llvm-libc/src b/third_party/llvm-libc/src index 74a86e8..fa202ff 160000 --- a/third_party/llvm-libc/src +++ b/third_party/llvm-libc/src
@@ -1 +1 @@ -Subproject commit 74a86e874eb25533d83c34b09ec925c091039a7c +Subproject commit fa202ff628394205418d311c5759874336921dd4
diff --git a/third_party/skia b/third_party/skia index e107cb0..787f004 160000 --- a/third_party/skia +++ b/third_party/skia
@@ -1 +1 @@ -Subproject commit e107cb001d4b1cc4ebccc98e4e250df03637f25d +Subproject commit 787f0044989bcfd923bd18776fc1c61360a49e48
diff --git a/third_party/webrtc b/third_party/webrtc index 0d50581..28d3fff 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit 0d50581699bbd0b10b595f88382545fae97f89d1 +Subproject commit 28d3fffde3dbe2b90699377b270580ac29c72dc3
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc index 04e3441..aa2d789 100644 --- a/ui/native_theme/native_theme.cc +++ b/ui/native_theme/native_theme.cc
@@ -203,8 +203,7 @@ : should_use_dark_colors_(should_use_dark_colors || IsForcedDarkMode()), system_theme_(system_theme), forced_colors_(IsForcedHighContrast()), - prefers_reduced_transparency_(false), - inverted_colors_(false), + preferred_color_scheme_(CalculatePreferredColorScheme()), preferred_contrast_(CalculatePreferredContrast()) {}
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h index 8489d25..4c8e8c2 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h
@@ -400,16 +400,26 @@ float height) const; // Paint the part to the canvas. - virtual void Paint( - cc::PaintCanvas* canvas, - const ui::ColorProvider* color_provider, - Part part, - State state, - const gfx::Rect& rect, - const ExtraParams& extra, - ColorScheme color_scheme = ColorScheme::kDefault, - bool in_forced_colors = false, - const std::optional<SkColor>& accent_color = std::nullopt) const = 0; + virtual void Paint(cc::PaintCanvas* canvas, + const ui::ColorProvider* color_provider, + Part part, + State state, + const gfx::Rect& rect, + const ExtraParams& extra, + ColorScheme color_scheme, + bool in_forced_colors, + const std::optional<SkColor>& accent_color) const = 0; + void Paint(cc::PaintCanvas* canvas, + const ui::ColorProvider* color_provider, + Part part, + State state, + const gfx::Rect& rect, + const ExtraParams& extra, + ColorScheme color_scheme = ColorScheme::kDefault, + bool in_forced_colors = false) const { + Paint(canvas, color_provider, part, state, rect, extra, color_scheme, + in_forced_colors, std::nullopt); + } // Returns whether the theme uses a nine-patch resource for the given part. // If true, calling code should always paint into a canvas the size of which
diff --git a/ui/native_theme/native_theme_aura.cc b/ui/native_theme/native_theme_aura.cc index 8b30878..0567bf07 100644 --- a/ui/native_theme/native_theme_aura.cc +++ b/ui/native_theme/native_theme_aura.cc
@@ -119,7 +119,7 @@ } } -NativeThemeAura::~NativeThemeAura() {} +NativeThemeAura::~NativeThemeAura() = default; // static NativeThemeAura* NativeThemeAura::web_instance() {
diff --git a/ui/native_theme/native_theme_observer.cc b/ui/native_theme/native_theme_observer.cc index d5aca08..a52f0f4 100644 --- a/ui/native_theme/native_theme_observer.cc +++ b/ui/native_theme/native_theme_observer.cc
@@ -6,6 +6,6 @@ namespace ui { -NativeThemeObserver::~NativeThemeObserver() {} +NativeThemeObserver::~NativeThemeObserver() = default; } // namespace ui
diff --git a/ui/native_theme/native_theme_unittest.cc b/ui/native_theme/native_theme_unittest.cc index c94c66d4..41dd0f0 100644 --- a/ui/native_theme/native_theme_unittest.cc +++ b/ui/native_theme/native_theme_unittest.cc
@@ -35,10 +35,9 @@ State state, const gfx::Rect& rect, const ExtraParams& extra, - ColorScheme color_scheme = ColorScheme::kDefault, - bool in_forced_colors = false, - const std::optional<SkColor>& accent_color = - std::nullopt) const override {} + ColorScheme color_scheme, + bool in_forced_colors, + const std::optional<SkColor>& accent_color) const override {} bool SupportsNinePatch(Part part) const override { return false; } gfx::Size GetNinePatchCanvasSize(Part part) const override { return gfx::Size();
diff --git a/v8 b/v8 index ddbe1ac..40f1a54 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit ddbe1ac33e0e0753463d4a71c045e2c9ff80237b +Subproject commit 40f1a54474084d9016f8b7e66fea1f235a42028a