diff --git a/DEPS b/DEPS index bd8f3d5..b0343bd 100644 --- a/DEPS +++ b/DEPS
@@ -280,7 +280,7 @@ # 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': '23564bd50042bacd4d22c8ffcee0fd2fb9eaf877', + 'skia_revision': '78c1845e6655428ab6f9b35fecf3d3d1032b5348', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -288,7 +288,7 @@ # 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': '1adf46a60a77be9f7fa940a98ad06cbe151b94c9', + 'angle_revision': 'bd1722bccfffa054529e4c931a065229577105fa', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -351,7 +351,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '351bad3feafe6d2ff11b5a3ddc740e38e79f95b4', + 'catapult_revision': '0eef5371808c956e2dd8e438c511d2752cfeb73f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -359,7 +359,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': '54cec76b5ed24a4168aae2a7142cc75852552a3d', + 'devtools_frontend_revision': '45cde6c2f5bfb8e12c81528092edfd7b1429e492', # 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. @@ -395,11 +395,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '60f3832435e7977935897fb0576ce5909343e4a0', + 'dawn_revision': '6d48f573af6004ce4243c97745562a270de9c0e4', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': '815e726bf50ad77a13d219e06a9721a5f3faf370', + 'quiche_revision': 'dad8fadd04563dbeb1cae44b4f2a164032e6dd3c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -456,6 +456,10 @@ # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. 'highway_revision': '424360251cdcfc314cfc528f53c872ecd63af0f0', + # Three lines of non-changing comments so that + # the commit queue can handle CLs rolling ffmpeg + # and whatever else without interference from each other. + 'ffmpeg_revision': 'abfc2628f25d283c27ffc960a8ff820ae8110467', # If you change this, also update the libc++ revision in # //buildtools/deps_revisions.gni. @@ -1141,7 +1145,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '407333d42436270d60043ca49241cedc0ebc6eb1', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '3133f98f3f1e3b46b10a284ff8280d79d7450698', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1172,7 +1176,7 @@ Var('chromium_git') + '/external/github.com/google/farmhash.git' + '@' + '816a4ae622e964763ca0862d9dbd19324a1eaf45', 'src/third_party/ffmpeg': - Var('chromium_git') + '/chromium/third_party/ffmpeg.git' + '@' + 'abfc2628f25d283c27ffc960a8ff820ae8110467', + Var('chromium_git') + '/chromium/third_party/ffmpeg.git' + '@' + Var('ffmpeg_revision'), 'src/third_party/flac': Var('chromium_git') + '/chromium/deps/flac.git' + '@' + 'af862024c8c8fa0ae07ced05e89013d881b00596', @@ -1295,7 +1299,7 @@ Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + '41cdffd71c9948f63c7ad36e1fb0ff519aa7a37e', 'src/third_party/icu': - Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '165825933050109d8331d0faa56cc9f52460fbbf', + Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '12de966fcbe1d1a48dba310aee63807856ffeee8', 'src/third_party/icu4j': { 'packages': [ @@ -1538,7 +1542,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'aee702e883cb0fd9a087a71b467746f54d68ca53', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '29c99a813c0b03800cc2b06f521d9dfbf590194b', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1669,7 +1673,7 @@ 'dep_type': 'cipd', }, - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@12989fc8d7d273b5b95ef988d37469738eb9c39b', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@1762849caed4eaf56fcb8b5b8af04b055a4b05f3', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + 'ebe84bec02c041d28f902da0214bf442743fc907', @@ -1705,10 +1709,10 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'e58ed2132aa47ac110a4cce1763abfa34f4fa34e', 'src/third_party/webgpu-cts/src': - Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '65ea407597c7781c92a87b6d7fac827ba2c5a478', + Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '49e659bea564367588238bd5e88a554014956064', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'ea5a944921af4e1c31aa1e5f4ef28e4a8e942452', + Var('webrtc_git') + '/src.git' + '@' + '932d0799374774d397bf28be9deabac31f7260b6', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1822,7 +1826,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'fh-fgZtda41SvFJJkuWG7HD4e_J7YfUR0hCipRPCZWwC', + 'version': 'g-TmwnBpoUXzzPCOW4dkt9CR5467wYj2GuUmvXMw3H4C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1833,7 +1837,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': 'v62fL-cDQDc5mGDJZAnEuL7iZHmciXfe_ICRdqOUMNUC', + 'version': 'OqbadMsBFiUCD5WGb0d6iYYxq_dQh7b2r6RztHuYCkgC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal',
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 54a4876..1de1a15 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -2380,7 +2380,7 @@ r"^courgette[\\/]courgette_minimal_tool\.cc$", r"^courgette[\\/]courgette_tool\.cc$", r"^extensions[\\/]renderer[\\/]logging_native_handler\.cc$", - r"^fuchsia[\\/]base[\\/]init_logging.cc$", + r"^fuchsia_web[\\/]common[\\/]init_logging.cc$", r"^fuchsia[\\/]engine[\\/]browser[\\/]frame_impl.cc$", r"^fuchsia_web[\\/]runners[\\/]common[\\/]web_component.cc$", r"^headless[\\/]app[\\/]headless_shell\.cc$",
diff --git a/android_webview/browser/gfx/browser_view_renderer.cc b/android_webview/browser/gfx/browser_view_renderer.cc index a05bdfa..f69160ad 100644 --- a/android_webview/browser/gfx/browser_view_renderer.cc +++ b/android_webview/browser/gfx/browser_view_renderer.cc
@@ -888,6 +888,17 @@ layer_tree_frame_sink_id); } +void BrowserViewRenderer::OnCompositorFrameTransitionDirectiveProcessed( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) { + content::SynchronousCompositor* compositor = FindCompositor(frame_sink_id); + if (compositor) { + compositor->OnCompositorFrameTransitionDirectiveProcessed( + layer_tree_frame_sink_id, sequence_id); + } +} + void BrowserViewRenderer::OnInputEvent() { if (root_frame_sink_proxy_) root_frame_sink_proxy_->OnInputEvent();
diff --git a/android_webview/browser/gfx/browser_view_renderer.h b/android_webview/browser/gfx/browser_view_renderer.h index cd8196a1..5a353c7 100644 --- a/android_webview/browser/gfx/browser_view_renderer.h +++ b/android_webview/browser/gfx/browser_view_renderer.h
@@ -180,6 +180,10 @@ viz::FrameSinkId frame_sink_id, uint32_t layer_tree_frame_sink_id, std::vector<viz::ReturnedResource> resources) override; + void OnCompositorFrameTransitionDirectiveProcessed( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) override; // Visible for testing. content::SynchronousCompositor* GetActiveCompositorForTesting() const {
diff --git a/android_webview/browser/gfx/root_frame_sink.cc b/android_webview/browser/gfx/root_frame_sink.cc index c8d3f9e5..87d4c1b 100644 --- a/android_webview/browser/gfx/root_frame_sink.cc +++ b/android_webview/browser/gfx/root_frame_sink.cc
@@ -55,7 +55,10 @@ std::move(resources)); } void OnCompositorFrameTransitionDirectiveProcessed( - uint32_t sequence_id) override {} + uint32_t sequence_id) override { + owner_->OnCompositorFrameTransitionDirectiveProcessed( + frame_sink_id_, layer_tree_frame_sink_id_, sequence_id); + } const viz::FrameSinkId frame_sink_id() { return frame_sink_id_; } @@ -372,6 +375,16 @@ std::move(resources)); } +void RootFrameSink::OnCompositorFrameTransitionDirectiveProcessed( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) { + if (client_) { + client_->OnCompositorFrameTransitionDirectiveProcessed( + frame_sink_id, layer_tree_frame_sink_id, sequence_id); + } +} + void RootFrameSink::DettachClient() { client_ = nullptr; }
diff --git a/android_webview/browser/gfx/root_frame_sink.h b/android_webview/browser/gfx/root_frame_sink.h index 8b78aec..54ebe0c 100644 --- a/android_webview/browser/gfx/root_frame_sink.h +++ b/android_webview/browser/gfx/root_frame_sink.h
@@ -36,6 +36,10 @@ viz::FrameSinkId frame_sink_id, uint32_t layer_tree_frame_sink_id, std::vector<viz::ReturnedResource> resources) = 0; + virtual void OnCompositorFrameTransitionDirectiveProcessed( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) = 0; }; // This class holds per-AwContents classes on the viz thread that do not need @@ -97,6 +101,10 @@ void ReturnResources(viz::FrameSinkId frame_sink_id, uint32_t layer_tree_frame_sink_id, std::vector<viz::ReturnedResource> resources); + void OnCompositorFrameTransitionDirectiveProcessed( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id); bool HasPendingDependency(const viz::SurfaceId& surface_id); void UpdateNeedsBeginFrames(bool needs_begin_frame);
diff --git a/android_webview/browser/gfx/root_frame_sink_proxy.cc b/android_webview/browser/gfx/root_frame_sink_proxy.cc index b627a611..5a8e3c0 100644 --- a/android_webview/browser/gfx/root_frame_sink_proxy.cc +++ b/android_webview/browser/gfx/root_frame_sink_proxy.cc
@@ -28,6 +28,13 @@ owner_->ReturnResourcesOnViz(frame_sink_id, layer_tree_frame_sink_id, std::move(resources)); } + void OnCompositorFrameTransitionDirectiveProcessed( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) override { + owner_->OnCompositorFrameTransitionDirectiveProcessedOnViz( + frame_sink_id, layer_tree_frame_sink_id, sequence_id); + } private: const raw_ptr<RootFrameSinkProxy> owner_; @@ -217,4 +224,26 @@ layer_tree_frame_sink_id, std::move(resources))); } +void RootFrameSinkProxy::OnCompositorFrameTransitionDirectiveProcessedOnUI( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) { + DCHECK_CALLED_ON_VALID_THREAD(ui_thread_checker_); + client_->OnCompositorFrameTransitionDirectiveProcessed( + frame_sink_id, layer_tree_frame_sink_id, sequence_id); +} + +void RootFrameSinkProxy::OnCompositorFrameTransitionDirectiveProcessedOnViz( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) { + DCHECK_CALLED_ON_VALID_THREAD(viz_thread_checker_); + ui_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&RootFrameSinkProxy:: + OnCompositorFrameTransitionDirectiveProcessedOnUI, + weak_ptr_factory_.GetWeakPtr(), frame_sink_id, + layer_tree_frame_sink_id, sequence_id)); +} + } // namespace android_webview
diff --git a/android_webview/browser/gfx/root_frame_sink_proxy.h b/android_webview/browser/gfx/root_frame_sink_proxy.h index 6d53600..f33e049 100644 --- a/android_webview/browser/gfx/root_frame_sink_proxy.h +++ b/android_webview/browser/gfx/root_frame_sink_proxy.h
@@ -23,6 +23,10 @@ viz::FrameSinkId frame_sink_id, uint32_t layer_tree_frame_sink_id, std::vector<viz::ReturnedResource> resources) = 0; + virtual void OnCompositorFrameTransitionDirectiveProcessed( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) = 0; }; // Per-AwContents object. Straddles UI and Viz thread. Public methods should be @@ -67,9 +71,17 @@ void ReturnResourcesOnViz(viz::FrameSinkId frame_sink_id, uint32_t layer_tree_frame_sink_id, std::vector<viz::ReturnedResource> resources); + void OnCompositorFrameTransitionDirectiveProcessedOnViz( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id); void ReturnResourcesOnUI(viz::FrameSinkId frame_sink_id, uint32_t layer_tree_frame_sink_id, std::vector<viz::ReturnedResource> resources); + void OnCompositorFrameTransitionDirectiveProcessedOnUI( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id); bool BeginFrame(const viz::BeginFrameArgs& args);
diff --git a/android_webview/browser/gfx/test/invalidate_test.cc b/android_webview/browser/gfx/test/invalidate_test.cc index 0e293db..1ef70c3 100644 --- a/android_webview/browser/gfx/test/invalidate_test.cc +++ b/android_webview/browser/gfx/test/invalidate_test.cc
@@ -319,6 +319,11 @@ DCHECK(resources.empty()); } + void OnCompositorFrameTransitionDirectiveProcessed( + viz::FrameSinkId frame_sink_id, + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) override {} + protected: std::unique_ptr<ChildFrame> CreateChildFrame( std::unique_ptr<content::SynchronousCompositor::Frame> frame,
diff --git a/ash/app_list/app_list_controller_impl.cc b/ash/app_list/app_list_controller_impl.cc index 43b4eb94..17c9853 100644 --- a/ash/app_list/app_list_controller_impl.cc +++ b/ash/app_list/app_list_controller_impl.cc
@@ -417,6 +417,11 @@ } void AppListControllerImpl::ShowAppList() { + if (Shell::Get()->session_controller()->GetSessionState() != + session_manager::SessionState::ACTIVE) { + return; + } + if (IsKioskSession()) return; @@ -476,10 +481,14 @@ if (state == session_manager::SessionState::ACTIVE) has_session_started_ = true; - if (!IsTabletMode()) + const bool in_clamshell = !IsTabletMode(); + if (state != session_manager::SessionState::ACTIVE || IsKioskSession()) { + if (in_clamshell) + DismissAppList(); return; + } - if (state != session_manager::SessionState::ACTIVE || IsKioskSession()) + if (in_clamshell) return; // Show the app list after signing in in tablet mode. For metrics, the app @@ -614,6 +623,11 @@ int64_t display_id, AppListShowSource show_source, base::TimeTicks event_time_stamp) { + if (Shell::Get()->session_controller()->GetSessionState() != + session_manager::SessionState::ACTIVE) { + return SHELF_ACTION_APP_LIST_DISMISSED; + } + if (IsKioskSession()) return SHELF_ACTION_APP_LIST_DISMISSED;
diff --git a/ash/app_list/app_list_controller_impl_unittest.cc b/ash/app_list/app_list_controller_impl_unittest.cc index 23ef483..32bb7139 100644 --- a/ash/app_list/app_list_controller_impl_unittest.cc +++ b/ash/app_list/app_list_controller_impl_unittest.cc
@@ -1339,6 +1339,280 @@ EXPECT_TRUE(prefs->GetBoolean(prefs::kLauncherContinueSectionHidden)); } +// AppListControllerImpl test that start in inactive session. +class AppListControllerImplNotLoggedInTest + : public AppListControllerImplAppListBubbleTest { + public: + AppListControllerImplNotLoggedInTest() = default; + ~AppListControllerImplNotLoggedInTest() override = default; + + void SetUp() override { + AppListControllerImplAppListBubbleTest::SetUp(); + SetSessionState(session_manager::SessionState::LOGIN_PRIMARY); + } + + void SetSessionState(session_manager::SessionState state) { + SessionInfo info; + info.state = state; + Shell::Get()->session_controller()->SetSessionInfo(info); + } +}; + +TEST_F(AppListControllerImplNotLoggedInTest, ToggleAppListOnLoginScreen) { + auto* controller = Shell::Get()->app_list_controller(); + controller->ToggleAppList(GetPrimaryDisplay().id(), + AppListShowSource::kSearchKey, + /*event_time_stamp=*/{}); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Verify app list cannot be toggled in logged in but inactive state. + SetSessionState(session_manager::SessionState::LOGGED_IN_NOT_ACTIVE); + controller->ToggleAppList(GetPrimaryDisplay().id(), + AppListShowSource::kSearchKey, + /*event_time_stamp=*/{}); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Toggle app list works when session is active. + SetSessionState(session_manager::SessionState::ACTIVE); + controller->ToggleAppList(GetPrimaryDisplay().id(), + AppListShowSource::kSearchKey, + /*event_time_stamp=*/{}); + + EXPECT_TRUE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_TRUE(controller->IsVisible()); +} + +TEST_F(AppListControllerImplNotLoggedInTest, ShowAppListOnLoginScreen) { + auto* controller = Shell::Get()->app_list_controller(); + controller->ShowAppList(); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Verify app list cannot be toggled in logged in but inactive state. + SetSessionState(session_manager::SessionState::LOGGED_IN_NOT_ACTIVE); + controller->ShowAppList(); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Toggle app list works when session is active. + SetSessionState(session_manager::SessionState::ACTIVE); + controller->ShowAppList(); + + EXPECT_TRUE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_TRUE(controller->IsVisible()); +} + +TEST_F(AppListControllerImplNotLoggedInTest, ToggleAppListInOobe) { + SetSessionState(session_manager::SessionState::OOBE); + auto* controller = Shell::Get()->app_list_controller(); + controller->ToggleAppList(GetPrimaryDisplay().id(), + AppListShowSource::kSearchKey, + /*event_time_stamp=*/{}); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + SetSessionState(session_manager::SessionState::LOGGED_IN_NOT_ACTIVE); + controller->ToggleAppList(GetPrimaryDisplay().id(), + AppListShowSource::kSearchKey, + /*event_time_stamp=*/{}); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Toggle app list works when session is active. + SetSessionState(session_manager::SessionState::ACTIVE); + controller->ToggleAppList(GetPrimaryDisplay().id(), + AppListShowSource::kSearchKey, + /*event_time_stamp=*/{}); + + EXPECT_TRUE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_TRUE(controller->IsVisible()); +} + +TEST_F(AppListControllerImplNotLoggedInTest, ShowAppListInOobe) { + SetSessionState(session_manager::SessionState::OOBE); + auto* controller = Shell::Get()->app_list_controller(); + controller->ShowAppList(); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Verify app list cannot be toggled in logged in but inactive state. + SetSessionState(session_manager::SessionState::LOGGED_IN_NOT_ACTIVE); + controller->ShowAppList(); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Toggle app list works when session is active. + SetSessionState(session_manager::SessionState::ACTIVE); + controller->ShowAppList(); + + EXPECT_TRUE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_TRUE(controller->IsVisible()); +} + +TEST_F(AppListControllerImplNotLoggedInTest, ToggleAppListOnLockScreen) { + SetSessionState(session_manager::SessionState::ACTIVE); + + auto* controller = Shell::Get()->app_list_controller(); + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Lock screen - toggling app list should fail. + SetSessionState(session_manager::SessionState::LOCKED); + controller->ToggleAppList(GetPrimaryDisplay().id(), + AppListShowSource::kSearchKey, + /*event_time_stamp=*/{}); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Unlock and verify toggling app list works. + SetSessionState(session_manager::SessionState::ACTIVE); + controller->ToggleAppList(GetPrimaryDisplay().id(), + AppListShowSource::kSearchKey, + /*event_time_stamp=*/{}); + + EXPECT_TRUE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_TRUE(controller->IsVisible()); + + // Locking the session hides the app list. + SetSessionState(session_manager::SessionState::LOCKED); + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); +} + +TEST_F(AppListControllerImplNotLoggedInTest, ShowAppListOnLockScreen) { + SetSessionState(session_manager::SessionState::ACTIVE); + + auto* controller = Shell::Get()->app_list_controller(); + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Lock screen - toggling app list should fail. + SetSessionState(session_manager::SessionState::LOCKED); + controller->ShowAppList(); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Unlock and verify toggling app list works. + SetSessionState(session_manager::SessionState::ACTIVE); + controller->ShowAppList(); + + EXPECT_TRUE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_TRUE(controller->IsVisible()); + + // Locking the session hides the app list. + SetSessionState(session_manager::SessionState::LOCKED); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + controller->ShowAppList(); + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); +} + +TEST_F(AppListControllerImplNotLoggedInTest, ShowAppListWhenInTabletMode) { + // Enable tablet mode while on login screen. + EnableTabletMode(); + + auto* controller = Shell::Get()->app_list_controller(); + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + SetSessionState(session_manager::SessionState::LOGGED_IN_NOT_ACTIVE); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + // Fullscreen app list should be shown upon login. + SetSessionState(session_manager::SessionState::ACTIVE); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_TRUE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_TRUE(controller->IsVisible()); +} + +TEST_F(AppListControllerImplNotLoggedInTest, + FullscreenLauncherInTabletModeWhenLocked) { + auto* controller = Shell::Get()->app_list_controller(); + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + SetSessionState(session_manager::SessionState::ACTIVE); + // Enable tablet mode and lock screen - fullscreen launcher should be shown + // (behind the lock screen). + EnableTabletMode(); + SetSessionState(session_manager::SessionState::LOCKED); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_TRUE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_TRUE(controller->IsVisible()); + + SetSessionState(session_manager::SessionState::ACTIVE); + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_TRUE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_TRUE(controller->IsVisible()); +} + +TEST_F(AppListControllerImplNotLoggedInTest, + FullscreenLauncherShownWhenEnteringTabletModeOnLockScreen) { + auto* controller = Shell::Get()->app_list_controller(); + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + SetSessionState(session_manager::SessionState::ACTIVE); + SetSessionState(session_manager::SessionState::LOCKED); + + // Enable tablet mode and lock screen - fullscreen launcher should be shown + // (behind the lock screen). + EnableTabletMode(); + + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_FALSE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_FALSE(controller->IsVisible()); + + SetSessionState(session_manager::SessionState::ACTIVE); + EXPECT_FALSE(controller->bubble_presenter_for_test()->IsShowing()); + EXPECT_TRUE(controller->fullscreen_presenter()->GetTargetVisibility()); + EXPECT_TRUE(controller->IsVisible()); +} + // Kiosk tests with the bubble launcher enabled. class AppListControllerImplKioskTest : public AppListControllerImplAppListBubbleTest {
diff --git a/ash/app_list/views/app_list_bubble_apps_page.cc b/ash/app_list/views/app_list_bubble_apps_page.cc index 497e0b1..d45409a6 100644 --- a/ash/app_list/views/app_list_bubble_apps_page.cc +++ b/ash/app_list/views/app_list_bubble_apps_page.cc
@@ -30,7 +30,7 @@ #include "ash/public/cpp/style/color_provider.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/strings/grit/ash_strings.h" -#include "ash/style/pill_button.h" +#include "ash/style/icon_button.h" #include "base/bind.h" #include "base/check.h" #include "base/metrics/histogram_functions.h" @@ -55,6 +55,7 @@ #include "ui/views/controls/textfield/textfield.h" #include "ui/views/focus/focus_manager.h" #include "ui/views/layout/box_layout.h" +#include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h" using views::BoxLayout; @@ -72,6 +73,9 @@ // interior apps page container margin. constexpr int kVerticalPaddingBetweenSections = 16; +// Label container padding in DIPs. +constexpr auto kContinueLabelContainerPadding = gfx::Insets::TLBR(0, 16, 0, 16); + // The horizontal interior margin for the apps page container - i.e. the margin // between the apps page bounds and the page content. constexpr int kHorizontalInteriorMargin = 16; @@ -160,25 +164,11 @@ kVerticalPaddingBetweenSections)); layout->set_cross_axis_alignment(BoxLayout::CrossAxisAlignment::kStretch); - // Add the button to show the continue section, wrapped in a view to center it - // horizontally. - { - auto* container = - scroll_contents->AddChildView(std::make_unique<views::View>()); - auto* layout = container->SetLayoutManager( - std::make_unique<BoxLayout>(BoxLayout::Orientation::kVertical)); - layout->set_cross_axis_alignment(BoxLayout::CrossAxisAlignment::kCenter); - show_continue_section_button_ = - container->AddChildView(std::make_unique<PillButton>( - base::BindRepeating( - &AppListBubbleAppsPage::OnPressShowContinueSection, - base::Unretained(this)), - l10n_util::GetStringUTF16(IDS_ASH_LAUNCHER_SHOW_CONTINUE_SECTION), - PillButton::Type::kIcon, &kExpandAllIcon)); - show_continue_section_button_->SetUseDefaultLabelFont(); - // Put the icon on the right. - show_continue_section_button_->SetHorizontalAlignment(gfx::ALIGN_RIGHT); - } + // When feature LauncherHideContinueSection is enabled, the "Continue where + // you left off" label is in a container that is a child of this view. + // Otherwise the label is a child of the ContinueSectionView. + if (features::IsLauncherHideContinueSectionEnabled()) + InitContinueLabelContainer(scroll_contents.get()); // Continue section row. continue_section_ = @@ -188,6 +178,12 @@ continue_section_->SetBorder( views::CreateEmptyBorder(kContinueSectionInsets)); continue_section_->SetNudgeController(app_list_nudge_controller_.get()); + if (features::IsLauncherHideContinueSectionEnabled()) { + // Decrease the between-sections spacing so the continue label is closer to + // the continue tasks section. + continue_section_->SetProperty(views::kMarginsKey, + gfx::Insets::TLBR(-14, 0, 0, 0)); + } // Observe changes in continue section visibility, to keep separator // visibility in sync. @@ -289,9 +285,19 @@ // build a single animation with conditional parts. https://crbug.com/1266020 const int section_offset = is_side_shelf ? -20 : 20; int vertical_offset = 0; + const bool animate_continue_label_container = + continue_label_container_ && continue_label_container_->GetVisible(); + if (animate_continue_label_container) { + vertical_offset += section_offset; + SlideViewIntoPosition(continue_label_container_, vertical_offset, + slide_duration); + } if (continue_section_->GetVisible() && continue_section_->GetTasksSuggestionsCount() > 0) { - vertical_offset += section_offset; + // Only offset if this is the top section, otherwise animate next to the + // continue label container above. + if (!animate_continue_label_container) + vertical_offset += section_offset; SlideViewIntoPosition(continue_section_, vertical_offset, slide_duration); } if (recent_apps_->GetVisible() && recent_apps_->GetItemViewCount() > 0) { @@ -646,19 +652,74 @@ return scroll_view_->contents()->layer(); } +//////////////////////////////////////////////////////////////////////////////// +// private: + +void AppListBubbleAppsPage::InitContinueLabelContainer( + views::View* scroll_contents) { + continue_label_container_ = + scroll_contents->AddChildView(std::make_unique<views::View>()); + continue_label_container_->SetBorder( + views::CreateEmptyBorder(kContinueLabelContainerPadding)); + + auto* layout = continue_label_container_->SetLayoutManager( + std::make_unique<BoxLayout>(BoxLayout::Orientation::kHorizontal)); + layout->set_cross_axis_alignment(BoxLayout::CrossAxisAlignment::kCenter); + + continue_label_ = + continue_label_container_->AddChildView(std::make_unique<views::Label>( + l10n_util::GetStringUTF16(IDS_ASH_LAUNCHER_CONTINUE_SECTION_LABEL))); + bubble_utils::ApplyStyle(continue_label_, + bubble_utils::LabelStyle::kSubtitle); + continue_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); + + // Button should be right aligned, so flex label to fill empty space. + layout->SetFlexForView(continue_label_, 1); + + toggle_continue_section_button_ = + continue_label_container_->AddChildView(std::make_unique<IconButton>( + base::BindRepeating(&AppListBubbleAppsPage::OnToggleContinueSection, + base::Unretained(this)), + IconButton::Type::kTinyFloating, &kChevronUpIcon, + /*is_togglable=*/false, + /*has_border=*/false)); + // The icon is scaled down since the button is tiny. + toggle_continue_section_button_->SetIconSize(16); +} + void AppListBubbleAppsPage::UpdateContinueSectionVisibility() { - // Show the "Show continue section" button if the continue section is hidden. - bool hide_continue_section = view_delegate_->ShouldHideContinueSection(); - show_continue_section_button_->SetVisible(hide_continue_section); // The continue section view and recent apps view manage their own visibility // internally. continue_section_->UpdateElementsVisibility(); recent_apps_->UpdateVisibility(); + UpdateContinueLabelContainer(); UpdateSeparatorVisibility(); } +void AppListBubbleAppsPage::UpdateContinueLabelContainer() { + if (!continue_label_container_) + return; + + // If there are no suggested tasks and no recent apps, it doesn't make sense + // to show the continue label. This can happen for brand-new users. + continue_label_container_->SetVisible( + continue_section_->GetTasksSuggestionsCount() > 0 || + recent_apps_->GetItemViewCount() > 0); + + // Update the toggle continue section button tooltip and image. + bool is_hidden = view_delegate_->ShouldHideContinueSection(); + toggle_continue_section_button_->SetTooltipText(l10n_util::GetStringUTF16( + is_hidden ? IDS_ASH_LAUNCHER_SHOW_CONTINUE_SECTION_TOOLTIP + : IDS_ASH_LAUNCHER_HIDE_CONTINUE_SECTION_TOOLTIP)); + toggle_continue_section_button_->SetVectorIcon(is_hidden ? kChevronDownIcon + : kChevronUpIcon); +} + void AppListBubbleAppsPage::UpdateSeparatorVisibility() { - separator_->SetVisible(recent_apps_->GetVisible() || + // The separator only hides if the user has the continue section shown but + // there are no suggested tasks and no apps. This is rare. + separator_->SetVisible(view_delegate_->ShouldHideContinueSection() || + recent_apps_->GetVisible() || continue_section_->GetVisible()); } @@ -819,9 +880,10 @@ kSlideAnimationTweenType, cleanup); } -void AppListBubbleAppsPage::OnPressShowContinueSection(const ui::Event& event) { - view_delegate_->SetHideContinueSection(false); - UpdateContinueSectionVisibility(); +void AppListBubbleAppsPage::OnToggleContinueSection() { + bool should_hide = !view_delegate_->ShouldHideContinueSection(); + view_delegate_->SetHideContinueSection(should_hide); + // AppListControllerImpl will trigger UpdateContinueSectionVisibility(). } BEGIN_METADATA(AppListBubbleAppsPage, views::View)
diff --git a/ash/app_list/views/app_list_bubble_apps_page.h b/ash/app_list/views/app_list_bubble_apps_page.h index c48306c4..5798457 100644 --- a/ash/app_list/views/app_list_bubble_apps_page.h +++ b/ash/app_list/views/app_list_bubble_apps_page.h
@@ -28,6 +28,7 @@ } // namespace ui namespace views { +class Label; class Separator; } // namespace views @@ -40,7 +41,7 @@ class AppListNudgeController; class AppListViewDelegate; class ContinueSectionView; -class PillButton; +class IconButton; class RecentAppsView; class RoundedScrollBar; class SearchResultPageDialogController; @@ -151,8 +152,11 @@ // Which layer animates is an implementation detail. ui::Layer* GetPageAnimationLayerForTest(); - PillButton* show_continue_section_button_for_test() { - return show_continue_section_button_; + views::View* continue_label_container_for_test() { + return continue_label_container_; + } + IconButton* toggle_continue_section_button_for_test() { + return toggle_continue_section_button_; } RecentAppsView* recent_apps_for_test() { return recent_apps_; } views::Separator* separator_for_test() { return separator_; } @@ -171,6 +175,14 @@ private: friend class AppListTestHelper; + // Creates the `continue_label_container_` view and its contents, the + // continue label and the toggle continue section button. + void InitContinueLabelContainer(views::View* scroll_contents); + + // Updates the continue label container and its child views, including the + // container visibility and the toggle button state. + void UpdateContinueLabelContainer(); + void UpdateSeparatorVisibility(); // Destroys the layer for `view`. Not static so it can be used with weak @@ -206,13 +218,19 @@ int vertical_offset, base::TimeDelta duration); - // Button press callback for `show_continue_section_button_`. - void OnPressShowContinueSection(const ui::Event& event); + // Pressed callback for `toggle_continue_section_button_`. + void OnToggleContinueSection(); AppListViewDelegate* view_delegate_ = nullptr; views::ScrollView* scroll_view_ = nullptr; RoundedScrollBar* scroll_bar_ = nullptr; - PillButton* show_continue_section_button_ = nullptr; + + // Wraps both the continue label and the toggle continue section button. + // Only exists when feature LauncherHideContinueSection is enabled. + views::View* continue_label_container_ = nullptr; + views::Label* continue_label_ = nullptr; + IconButton* toggle_continue_section_button_ = nullptr; + ContinueSectionView* continue_section_ = nullptr; RecentAppsView* recent_apps_ = nullptr; views::Separator* separator_ = nullptr;
diff --git a/ash/app_list/views/app_list_bubble_apps_page_unittest.cc b/ash/app_list/views/app_list_bubble_apps_page_unittest.cc index 132c2ce6..39728a1 100644 --- a/ash/app_list/views/app_list_bubble_apps_page_unittest.cc +++ b/ash/app_list/views/app_list_bubble_apps_page_unittest.cc
@@ -20,7 +20,7 @@ #include "ash/constants/ash_features.h" #include "ash/public/cpp/app_list/app_list_controller.h" #include "ash/shell.h" -#include "ash/style/pill_button.h" +#include "ash/style/icon_button.h" #include "ash/test/ash_test_base.h" #include "ash/test/layer_animation_stopped_waiter.h" #include "base/test/bind.h" @@ -249,17 +249,27 @@ helper->AddAppItems(5); helper->ShowAppList(); - // The show continue section button is hidden. - auto* apps_page = helper->GetBubbleAppsPage(); - EXPECT_FALSE( - apps_page->show_continue_section_button_for_test()->GetVisible()); - // The continue section and recent apps are visible. + auto* apps_page = helper->GetBubbleAppsPage(); EXPECT_TRUE(helper->GetBubbleContinueSectionView()->GetVisible()); EXPECT_TRUE(helper->GetBubbleRecentAppsView()->GetVisible()); EXPECT_TRUE(apps_page->separator_for_test()->GetVisible()); } +TEST_F(AppListBubbleAppsPageTest, ContinueLabelHiddenWhenNoTasksAndNoRecents) { + base::test::ScopedFeatureList feature_list( + features::kLauncherHideContinueSection); + + // Show the app list with no continue suggestions and no recent apps. + auto* helper = GetAppListTestHelper(); + helper->AddAppItems(5); + helper->ShowAppList(); + + auto* apps_page = helper->GetBubbleAppsPage(); + ASSERT_TRUE(apps_page->continue_label_container_for_test()); + EXPECT_FALSE(apps_page->continue_label_container_for_test()->GetVisible()); +} + TEST_F(AppListBubbleAppsPageTest, CanHideContinueSection) { base::test::ScopedFeatureList feature_list( features::kLauncherHideContinueSection); @@ -272,19 +282,24 @@ helper->AddAppItems(5); helper->ShowAppList(); - // Hide the continue section. - Shell::Get()->app_list_controller()->SetHideContinueSection(true); - - // The show continue section button appears. + // The toggle continue section button has the "hide" tooltip. auto* apps_page = helper->GetBubbleAppsPage(); - auto* show_continue_section_button = - apps_page->show_continue_section_button_for_test(); - EXPECT_TRUE(show_continue_section_button->GetVisible()); + IconButton* toggle_continue_section_button = + apps_page->toggle_continue_section_button_for_test(); + ASSERT_TRUE(toggle_continue_section_button); + EXPECT_EQ(toggle_continue_section_button->GetTooltipText(), + u"Hide all suggestions"); + + // Hide the continue section. + LeftClickOn(toggle_continue_section_button); // Continue section and recent apps are hidden. EXPECT_FALSE(helper->GetBubbleContinueSectionView()->GetVisible()); EXPECT_FALSE(helper->GetBubbleRecentAppsView()->GetVisible()); - EXPECT_FALSE(apps_page->separator_for_test()->GetVisible()); + + // Label container and separator stay visible. + EXPECT_TRUE(apps_page->continue_label_container_for_test()->GetVisible()); + EXPECT_TRUE(apps_page->separator_for_test()->GetVisible()); } TEST_F(AppListBubbleAppsPageTest, CanShowContinueSectionByClickingButton) { @@ -302,22 +317,21 @@ helper->AddAppItems(5); helper->ShowAppList(); - // The show continue section button appears. + // The toggle continue section button has the "show" tooltip. auto* apps_page = helper->GetBubbleAppsPage(); - auto* show_continue_section_button = - apps_page->show_continue_section_button_for_test(); - EXPECT_TRUE(show_continue_section_button->GetVisible()); + IconButton* toggle_continue_section_button = + apps_page->toggle_continue_section_button_for_test(); + ASSERT_TRUE(toggle_continue_section_button); + EXPECT_EQ(toggle_continue_section_button->GetTooltipText(), + u"Show all suggestions"); // Continue section and recent apps are hidden. EXPECT_FALSE(helper->GetBubbleContinueSectionView()->GetVisible()); EXPECT_FALSE(helper->GetBubbleRecentAppsView()->GetVisible()); - EXPECT_FALSE(apps_page->separator_for_test()->GetVisible()); + EXPECT_TRUE(apps_page->separator_for_test()->GetVisible()); // Click the show continue section button. - LeftClickOn(show_continue_section_button); - - // The button hides. - EXPECT_FALSE(show_continue_section_button->GetVisible()); + LeftClickOn(toggle_continue_section_button); // The continue section and recent apps are visible. EXPECT_TRUE(helper->GetBubbleContinueSectionView()->GetVisible());
diff --git a/ash/app_list/views/continue_section_view.cc b/ash/app_list/views/continue_section_view.cc index 28285f4..5de317c 100644 --- a/ash/app_list/views/continue_section_view.cc +++ b/ash/app_list/views/continue_section_view.cc
@@ -21,6 +21,7 @@ #include "ash/app_list/views/continue_task_view.h" #include "ash/app_list/views/search_result_page_dialog_controller.h" #include "ash/bubble/bubble_utils.h" +#include "ash/constants/ash_features.h" #include "ash/public/cpp/app_list/app_list_config.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/session/session_controller_impl.h" @@ -108,7 +109,9 @@ views::MinimumFlexSizeRule::kScaleToMinimumSnapToZero, views::MaximumFlexSizeRule::kUnbounded)); - if (!tablet_mode) { + // The launcher "hide continue section" feature makes the label a child of + // AppListBubbleAppsPage. + if (!tablet_mode && !features::IsLauncherHideContinueSectionEnabled()) { continue_label_ = AddChildView(CreateContinueLabel( l10n_util::GetStringUTF16(IDS_ASH_LAUNCHER_CONTINUE_SECTION_LABEL))); continue_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index ac5ab07..137ccd9 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -4568,6 +4568,12 @@ <message name="IDS_ASH_LAUNCHER_HIDE_CONTINUE_SECTION" desc="Context menu label to hide the launcher continue section (which defaults to being shown)."> Hide all suggestions </message> + <message name="IDS_ASH_LAUNCHER_SHOW_CONTINUE_SECTION_TOOLTIP" desc="Tooltip for button that shows the launcher continue section after it has been hidden."> + Show all suggestions + </message> + <message name="IDS_ASH_LAUNCHER_HIDE_CONTINUE_SECTION_TOOLTIP" desc="Tooltip for button that hides the launcher continue section (which defaults to being shown)."> + Hide all suggestions + </message> <message name="IDS_ASH_LAUNCHER_CONTINUE_SECTION_PRIVACY_TEXT" desc="Text for the privacy notice of the continue section of the launcher in clamshell mode, which shows recent files and apps that the user can continue using."> You’ll see recommendations so you can continue where you left off. You can right-click to remove recommendations. </message>
diff --git a/ash/ash_strings_grd/IDS_ASH_LAUNCHER_HIDE_CONTINUE_SECTION_TOOLTIP.png.sha1 b/ash/ash_strings_grd/IDS_ASH_LAUNCHER_HIDE_CONTINUE_SECTION_TOOLTIP.png.sha1 new file mode 100644 index 0000000..35d8038 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_LAUNCHER_HIDE_CONTINUE_SECTION_TOOLTIP.png.sha1
@@ -0,0 +1 @@ +ed6eb6890e5465b0c4bd15d923e24f6d34de4bc7 \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_LAUNCHER_SHOW_CONTINUE_SECTION_TOOLTIP.png.sha1 b/ash/ash_strings_grd/IDS_ASH_LAUNCHER_SHOW_CONTINUE_SECTION_TOOLTIP.png.sha1 new file mode 100644 index 0000000..7a17270 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_LAUNCHER_SHOW_CONTINUE_SECTION_TOOLTIP.png.sha1
@@ -0,0 +1 @@ +52fb662658e02186d2dc3b47a3acff6f85d4dcbe \ No newline at end of file
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index ec1a2e0..6da86ba4 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -1431,7 +1431,7 @@ // Enables or disables using the system input engine for physical typing in // Chinese. const base::Feature kSystemChinesePhysicalTyping{ - "SystemChinesePhysicalTyping", base::FEATURE_DISABLED_BY_DEFAULT}; + "SystemChinesePhysicalTyping", base::FEATURE_ENABLED_BY_DEFAULT}; // Enables or disables the System Extensions platform. const base::Feature kSystemExtensions{"SystemExtensions", @@ -1491,7 +1491,7 @@ // Uses new AuthSession-based API in cryptohome to authenticate users during // sign-in. const base::Feature kUseAuthsessionAuthentication{ - "UseAuthsessionAuthentication", base::FEATURE_ENABLED_BY_DEFAULT}; + "UseAuthsessionAuthentication", base::FEATURE_DISABLED_BY_DEFAULT}; // Enables using the BluetoothSystem Mojo interface for Bluetooth operations. const base::Feature kUseBluetoothSystemInAsh{"UseBluetoothSystemInAsh",
diff --git a/ash/constants/personalization_entry_point.h b/ash/constants/personalization_entry_point.h index 9e4444d..fef4364 100644 --- a/ash/constants/personalization_entry_point.h +++ b/ash/constants/personalization_entry_point.h
@@ -21,10 +21,12 @@ kSettings = 3, // Settings search. kSettingsSearch = 4, - kMaxValue = kSettingsSearch, + // Keyboard brightness slider. + kKeyboardBrightnessSlider = 5, + kMaxValue = kKeyboardBrightnessSlider, }; -constexpr char kPersonalizationEntryPointHistogramName[] = +inline constexpr char kPersonalizationEntryPointHistogramName[] = "Ash.Personalization.EntryPoint"; } // namespace ash
diff --git a/ash/public/cpp/external_arc/message_center/arc_notification_content_view.cc b/ash/public/cpp/external_arc/message_center/arc_notification_content_view.cc index 0bad0aa7..42d18f71 100644 --- a/ash/public/cpp/external_arc/message_center/arc_notification_content_view.cc +++ b/ash/public/cpp/external_arc/message_center/arc_notification_content_view.cc
@@ -486,6 +486,15 @@ } } } + + // Maybe this if-branch is not needed but if the refresh flag is disabled we + // don't have to call |SchedulePaint()| because the notification background is + // opaque. Let's keep this if-branch not to break any existing behavior. + if (ash::features::IsNotificationsRefreshEnabled()) { + // Setting/resetting |surface_| changes the visibility of the snapshot so we + // here request to paint. + SchedulePaint(); + } } void ArcNotificationContentView::UpdatePreferredSize() { @@ -693,9 +702,6 @@ } void ArcNotificationContentView::OnPaint(gfx::Canvas* canvas) { - if (ash::features::IsNotificationsRefreshEnabled()) - return; - views::NativeViewHost::OnPaint(canvas); SkScalar radii[8] = {top_radius_, top_radius_, // top-left @@ -721,7 +727,9 @@ // area out of the surface. // TODO: This can be removed once both ARC and Chrome notifications have // smooth expansion animations. - canvas->DrawColor(SK_ColorWHITE); + canvas->DrawColor(ash::features::IsNotificationsRefreshEnabled() + ? SK_ColorTRANSPARENT + : SK_ColorWHITE); } }
diff --git a/ash/resources/vector_icons/BUILD.gn b/ash/resources/vector_icons/BUILD.gn index 48ad749..ecc065a 100644 --- a/ash/resources/vector_icons/BUILD.gn +++ b/ash/resources/vector_icons/BUILD.gn
@@ -61,7 +61,9 @@ "caret_right.icon", "check.icon", "check_circle.icon", + "chevron_down.icon", "chevron_right.icon", + "chevron_up.icon", "clipboard.icon", "clipboard_empty.icon", "clipboard_launcher_inner.icon",
diff --git a/ash/resources/vector_icons/chevron_down.icon b/ash/resources/vector_icons/chevron_down.icon new file mode 100644 index 0000000..1a7be48 --- /dev/null +++ b/ash/resources/vector_icons/chevron_down.icon
@@ -0,0 +1,13 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +CANVAS_DIMENSIONS, 20, +MOVE_TO, 5.41f, 6, +LINE_TO, 10, 10.95f, +LINE_TO, 14.59f, 6, +LINE_TO, 16, 7.52f, +LINE_TO, 10, 14, +LINE_TO, 4, 7.52f, +LINE_TO, 5.41f, 6, +CLOSE
diff --git a/ash/resources/vector_icons/chevron_up.icon b/ash/resources/vector_icons/chevron_up.icon new file mode 100644 index 0000000..25b7a70 --- /dev/null +++ b/ash/resources/vector_icons/chevron_up.icon
@@ -0,0 +1,13 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +CANVAS_DIMENSIONS, 20, +MOVE_TO, 5.41f, 14, +LINE_TO, 10, 9.06f, +LINE_TO, 14.59f, 14, +LINE_TO, 16, 12.48f, +LINE_TO, 10, 6, +R_LINE_TO, -6, 6.48f, +LINE_TO, 5.41f, 14, +CLOSE
diff --git a/ash/style/icon_button.cc b/ash/style/icon_button.cc index ae645f877..e4f7771d 100644 --- a/ash/style/icon_button.cc +++ b/ash/style/icon_button.cc
@@ -26,6 +26,7 @@ namespace ash { namespace { +constexpr int kTinyButtonSize = 24; constexpr int kSmallButtonSize = 32; constexpr int kMediumButtonSize = 36; constexpr int kLargeButtonSize = 48; @@ -41,6 +42,9 @@ int GetButtonSizeOnType(IconButton::Type type) { switch (type) { + case IconButton::Type::kTiny: + case IconButton::Type::kTinyFloating: + return kTinyButtonSize; case IconButton::Type::kSmall: case IconButton::Type::kSmallFloating: return kSmallButtonSize; @@ -54,7 +58,8 @@ } bool IsFloatingIconButton(IconButton::Type type) { - return type == IconButton::Type::kSmallFloating || + return type == IconButton::Type::kTinyFloating || + type == IconButton::Type::kSmallFloating || type == IconButton::Type::kMediumFloating || type == IconButton::Type::kLargeFloating; } @@ -157,6 +162,13 @@ UpdateVectorIcon(); } +void IconButton::SetIconSize(int size) { + if (icon_size_ == size) + return; + icon_size_ = size; + UpdateVectorIcon(); +} + void IconButton::SetToggled(bool toggled) { if (!is_togglable_ || toggled_ == toggled) return; @@ -249,6 +261,7 @@ const SkColor toggled_icon_color = color_provider->GetContentLayerColor( AshColorProvider::ContentLayerType::kButtonIconColorPrimary); const SkColor icon_color = toggled_ ? toggled_icon_color : normal_icon_color; + const int icon_size = icon_size_.value_or(kIconSize); // Skip repainting if the incoming icon is the same as the current icon. If // the icon has been painted before, |gfx::CreateVectorIcon()| will simply @@ -256,7 +269,7 @@ // assumes that toggled/disabled images changes at the same time as the normal // image, which it currently does. const gfx::ImageSkia new_normal_image = - gfx::CreateVectorIcon(*icon_, kIconSize, icon_color); + gfx::CreateVectorIcon(*icon_, icon_size, icon_color); const gfx::ImageSkia& old_normal_image = GetImage(views::Button::STATE_NORMAL); if (!new_normal_image.isNull() && !old_normal_image.isNull() && @@ -267,7 +280,7 @@ SetImage(views::Button::STATE_NORMAL, new_normal_image); SetImage(views::Button::STATE_DISABLED, gfx::CreateVectorIcon( - *icon_, kIconSize, + *icon_, icon_size, AshColorProvider::GetDisabledColor(normal_icon_color))); }
diff --git a/ash/style/icon_button.h b/ash/style/icon_button.h index 58bd26b..23ba728c 100644 --- a/ash/style/icon_button.h +++ b/ash/style/icon_button.h
@@ -31,9 +31,11 @@ METADATA_HEADER(IconButton); enum class Type { + kTiny, kSmall, kMedium, kLarge, + kTinyFloating, kSmallFloating, kMediumFloating, kLargeFloating @@ -97,6 +99,9 @@ // when it's not toggled. void SetIconColor(const SkColor icon_color); + // Sets the size to use for the vector icon in DIPs. + void SetIconSize(int size); + // Updates the `toggled_` state of the button. void SetToggled(bool toggled); @@ -126,6 +131,9 @@ absl::optional<SkColor> background_color_; absl::optional<SkColor> icon_color_; + // Custom value for icon size (usually used to make the icon smaller). + absl::optional<int> icon_size_; + DisabledButtonBehavior button_behavior_ = DisabledButtonBehavior::kNone; };
diff --git a/ash/system/keyboard_brightness/unified_keyboard_brightness_slider_controller.cc b/ash/system/keyboard_brightness/unified_keyboard_brightness_slider_controller.cc index f560c621..76bc1511d 100644 --- a/ash/system/keyboard_brightness/unified_keyboard_brightness_slider_controller.cc +++ b/ash/system/keyboard_brightness/unified_keyboard_brightness_slider_controller.cc
@@ -7,6 +7,7 @@ #include <memory> #include "ash/constants/ash_features.h" +#include "ash/constants/personalization_entry_point.h" #include "ash/public/cpp/new_window_delegate.h" #include "ash/public/cpp/resources/grit/ash_public_unscaled_resources.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -20,6 +21,7 @@ #include "ash/webui/personalization_app/mojom/personalization_app.mojom-forward.h" #include "base/bind.h" #include "base/memory/weak_ptr.h" +#include "base/metrics/histogram_functions.h" #include "chromeos/dbus/power/power_manager_client.h" #include "ui/base/resource/resource_bundle.h" @@ -99,6 +101,10 @@ } void OnKeyboardBacklightColorIconPressed() { + // Record entry point metric to Personalization Hub. + base::UmaHistogramEnumeration( + kPersonalizationEntryPointHistogramName, + PersonalizationEntryPoint::kKeyboardBrightnessSlider); NewWindowDelegate* primary_delegate = NewWindowDelegate::GetPrimary(); primary_delegate->OpenPersonalizationHub(); return;
diff --git a/ash/system/message_center/unified_message_center_bubble.cc b/ash/system/message_center/unified_message_center_bubble.cc index 21c89a78..495cbde 100644 --- a/ash/system/message_center/unified_message_center_bubble.cc +++ b/ash/system/message_center/unified_message_center_bubble.cc
@@ -157,6 +157,9 @@ if (!message_center_view_->collapsed()) return; + if (tray_->IsShowingCalendarView()) + tray_->bubble()->unified_system_tray_controller()->TransitionToMainView( + /*restore_focus=*/true); message_center_view_->SetExpanded(); UpdatePosition(); tray_->EnsureQuickSettingsCollapsed(true /*animate*/);
diff --git a/ash/system/network/network_detailed_view_controller.cc b/ash/system/network/network_detailed_view_controller.cc index 4d1590cc..15245f6 100644 --- a/ash/system/network/network_detailed_view_controller.cc +++ b/ash/system/network/network_detailed_view_controller.cc
@@ -171,6 +171,11 @@ void NetworkDetailedViewController::OnMobileToggleClicked(bool new_state) {} -void NetworkDetailedViewController::OnWifiToggleClicked(bool new_state) {} +void NetworkDetailedViewController::OnWifiToggleClicked(bool new_state) { + Shell::Get() + ->system_tray_model() + ->network_state_model() + ->SetNetworkTypeEnabledState(NetworkType::kWiFi, new_state); +} } // namespace ash
diff --git a/ash/system/network/network_detailed_view_controller_unittest.cc b/ash/system/network/network_detailed_view_controller_unittest.cc index ff67cce..7cfb416 100644 --- a/ash/system/network/network_detailed_view_controller_unittest.cc +++ b/ash/system/network/network_detailed_view_controller_unittest.cc
@@ -14,6 +14,7 @@ #include "base/test/scoped_feature_list.h" #include "chromeos/network/network_connect.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_state_handler.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" @@ -25,7 +26,7 @@ using chromeos::network_config::mojom::NetworkType; const std::string kCellular = "cellular"; -constexpr char kWifi[] = "WifiGuid"; +constexpr char kWifi[] = "Wifi"; const int kSignalStrength = 50; constexpr char kUser1Email[] = "user1@quicksettings.com"; @@ -123,6 +124,18 @@ base::RunLoop().RunUntilIdle(); } + void ToggleWifiState(bool new_state) { + (static_cast<NetworkDetailedNetworkView::Delegate*>( + network_detailed_view_controller_.get())) + ->OnWifiToggleClicked(new_state); + base::RunLoop().RunUntilIdle(); + } + + chromeos::NetworkStateHandler::TechnologyState GetWifiDeviceState() { + return network_state_helper()->network_state_handler()->GetTechnologyState( + chromeos::NetworkTypePattern::WiFi()); + } + private: chromeos::NetworkStateTestHelper* network_state_helper() { return &network_config_helper_->network_state_helper(); @@ -288,4 +301,23 @@ EXPECT_EQ(shill::kStateIdle, GetWifiNetworkState()); } +TEST_F(NetworkDetailedViewControllerTest, WifiStateChange) { + // By default ash test instantiates WiFi networks and enables them. + EXPECT_EQ(chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED, + GetWifiDeviceState()); + + // Disable wifi. + ToggleWifiState(/*new_state=*/false); + + EXPECT_EQ( + chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_AVAILABLE, + GetWifiDeviceState()); + + // Renable wifi. + ToggleWifiState(/*new_state=*/true); + + EXPECT_EQ(chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED, + GetWifiDeviceState()); +} + } // namespace ash
diff --git a/ash/system/time/date_helper.h b/ash/system/time/date_helper.h index cc1447a..fee55ec2 100644 --- a/ash/system/time/date_helper.h +++ b/ash/system/time/date_helper.h
@@ -9,6 +9,7 @@ #include "ash/ash_export.h" #include "ash/components/settings/timezone_settings.h" +#include "base/gtest_prod_util.h" #include "base/memory/singleton.h" #include "base/scoped_observation.h" #include "base/time/time.h" @@ -18,6 +19,10 @@ #include "third_party/icu/source/i18n/unicode/smpdtfmt.h" #include "third_party/icu/source/i18n/unicode/timezone.h" +// FileManagerStringUtilTest is in the global namespace, need to forward +// declare it before using FRIEND_TEST_ALL_PREFIXES below. +FORWARD_DECLARE_TEST(FileManagerStringUtilTest, GetLocaleBasedWeekStart); + namespace ash { // A singleton class used to create and cache `GregorianCalendar`, @@ -31,7 +36,8 @@ ASH_EXPORT static DateHelper* GetInstance(); // Creates a formatter object used to format dates from the given `pattern`. - icu::SimpleDateFormat CreateSimpleDateFormatter(const char* pattern); + ASH_EXPORT icu::SimpleDateFormat CreateSimpleDateFormatter( + const char* pattern); // Creates a date interval formatter object that formats a `DateInterval` into // text as compactly as possible. @@ -45,8 +51,8 @@ const char* pattern); // Returns a formatted string of a `time` using the given `formatter`. - std::u16string GetFormattedTime(const icu::DateFormat* formatter, - const base::Time& time); + ASH_EXPORT std::u16string GetFormattedTime(const icu::DateFormat* formatter, + const base::Time& time); // Returns a formatted interval string using the given `formatter`. ASH_EXPORT std::u16string GetFormattedInterval( @@ -119,6 +125,8 @@ private: friend base::DefaultSingletonTraits<DateHelper>; friend class DateHelperUnittest; + FRIEND_TEST_ALL_PREFIXES(::FileManagerStringUtilTest, + GetLocaleBasedWeekStart); DateHelper(); DateHelper(const DateHelper& other) = delete;
diff --git a/ash/system/unified/unified_system_tray.cc b/ash/system/unified/unified_system_tray.cc index 16a29d2..1cd6bf69 100644 --- a/ash/system/unified/unified_system_tray.cc +++ b/ash/system/unified/unified_system_tray.cc
@@ -385,12 +385,6 @@ Shell::Get()->focus_cycler()->FocusWidget(message_center_widget); - ExpandMessageCenter(); - - // TODO(1225479): Only collapse if space is an issue. - if (collapse_quick_settings) - EnsureQuickSettingsCollapsed(/*animate*/ false); - // Focus an individual element in the message center if chrome vox is // disabled. if (!ShouldEnableExtraKeyboardAccessibility())
diff --git a/ash/system/unified/unified_system_tray_unittest.cc b/ash/system/unified/unified_system_tray_unittest.cc index 2f24c9ef..ab30016f 100644 --- a/ash/system/unified/unified_system_tray_unittest.cc +++ b/ash/system/unified/unified_system_tray_unittest.cc
@@ -294,6 +294,7 @@ message_center_view->SetVisible(true); EXPECT_FALSE(message_center_view->Contains(focus_manager->GetFocusedView())); + EXPECT_FALSE(message_center_view->collapsed()); auto did_focus = tray->FocusMessageCenter(false); @@ -316,34 +317,6 @@ EXPECT_FALSE(did_focus); } -TEST_F(UnifiedSystemTrayTest, FocusMessageCenter_CollapseQuickSettings) { - auto* tray = GetPrimaryUnifiedSystemTray(); - tray->ShowBubble(); - - auto* message_center_view = - tray->message_center_bubble()->message_center_view(); - auto* focus_manager = message_center_view->GetFocusManager(); - - AddNotification(); - AddNotification(); - message_center_view->SetVisible(true); - - EXPECT_FALSE(message_center_view->Contains(focus_manager->GetFocusedView())); - - auto* quick_settings_controller = - GetUnifiedSystemTrayBubble()->unified_system_tray_controller(); - quick_settings_controller->EnsureExpanded(); - - auto did_focus = tray->FocusMessageCenter(false); - - EXPECT_TRUE(did_focus); - - EXPECT_FALSE(quick_settings_controller->IsExpanded()); - EXPECT_TRUE(tray->IsMessageCenterBubbleShown()); - EXPECT_FALSE(message_center_view->collapsed()); - EXPECT_TRUE(message_center_view->Contains(focus_manager->GetFocusedView())); -} - TEST_F(UnifiedSystemTrayTest, FocusMessageCenter_VoxEnabled) { auto* tray = GetPrimaryUnifiedSystemTray(); tray->ShowBubble(); @@ -366,7 +339,6 @@ EXPECT_TRUE(tray->IsMessageCenterBubbleShown()); EXPECT_TRUE(message_center_bubble->GetBubbleWidget()->IsActive()); - EXPECT_FALSE(message_center_view->collapsed()); EXPECT_FALSE(message_center_view->Contains(focus_manager->GetFocusedView())); } @@ -484,4 +456,38 @@ "CalendarDateCellView"); } +// Tests that CalendarView switches back to Quick Settings when screen size is +// limited and the bubble requires a collapsed state. +TEST_F(UnifiedSystemTrayTest, CalendarGoesToMainView) { + auto* tray = GetPrimaryUnifiedSystemTray(); + tray->ShowBubble(); + + // Set a limited screen size. + UpdateDisplay("800x600"); + + // Generate a notification, close and open the bubble so we can show the + // collapsed message center. + AddNotification(); + tray->CloseBubble(); + tray->ShowBubble(); + + // Ensure message center is collapsed when Calendar is not being shown. + auto* message_center_view = + tray->message_center_bubble()->message_center_view(); + EXPECT_FALSE(tray->IsShowingCalendarView()); + EXPECT_TRUE(message_center_view->collapsed()); + + // Ensure message center is collapsed when the Calendar is being shown. + ShellTestApi().PressAccelerator( + ui::Accelerator(ui::VKEY_C, ui::EF_COMMAND_DOWN)); + EXPECT_TRUE(tray->IsShowingCalendarView()); + EXPECT_TRUE(message_center_view->collapsed()); + + // Test that Calendar is no longer shown after expanding the collapsed + // message center. + tray->message_center_bubble()->ExpandMessageCenter(); + EXPECT_FALSE(message_center_view->collapsed()); + EXPECT_FALSE(tray->IsShowingCalendarView()); +} + } // namespace ash
diff --git a/ash/webui/diagnostics_ui/backend/input_data_provider.cc b/ash/webui/diagnostics_ui/backend/input_data_provider.cc index 3b929442..680e22d 100644 --- a/ash/webui/diagnostics_ui/backend/input_data_provider.cc +++ b/ash/webui/diagnostics_ui/backend/input_data_provider.cc
@@ -289,18 +289,8 @@ void InputDataProvider::BindInterface( mojo::PendingReceiver<mojom::InputDataProvider> pending_receiver) { - DCHECK(!ReceiverIsBound()); - receiver_.Bind(std::move(pending_receiver)); - receiver_.set_disconnect_handler(base::BindOnce( - &InputDataProvider::OnBoundInterfaceDisconnect, base::Unretained(this))); -} - -bool InputDataProvider::ReceiverIsBound() { - return receiver_.is_bound(); -} - -void InputDataProvider::OnBoundInterfaceDisconnect() { receiver_.reset(); + receiver_.Bind(std::move(pending_receiver)); } void InputDataProvider::GetConnectedDevices(
diff --git a/ash/webui/diagnostics_ui/backend/input_data_provider.h b/ash/webui/diagnostics_ui/backend/input_data_provider.h index b841349..1e97744 100644 --- a/ash/webui/diagnostics_ui/backend/input_data_provider.h +++ b/ash/webui/diagnostics_ui/backend/input_data_provider.h
@@ -106,9 +106,6 @@ void BindInterface( mojo::PendingReceiver<mojom::InputDataProvider> pending_receiver); - // Handler for when remote attached to |receiver_| disconnects. - void OnBoundInterfaceDisconnect(); - bool ReceiverIsBound(); static mojom::ConnectionType ConnectionTypeFromInputDeviceType( ui::InputDeviceType type);
diff --git a/ash/webui/diagnostics_ui/backend/input_data_provider_unittest.cc b/ash/webui/diagnostics_ui/backend/input_data_provider_unittest.cc index a085270..0a141b8 100644 --- a/ash/webui/diagnostics_ui/backend/input_data_provider_unittest.cc +++ b/ash/webui/diagnostics_ui/backend/input_data_provider_unittest.cc
@@ -1253,22 +1253,18 @@ } } -TEST_F(InputDataProviderTest, ResetReceiverOnDisconnect) { - ASSERT_FALSE(provider_->ReceiverIsBound()); +TEST_F(InputDataProviderTest, ResetReceiverOnBindInterface) { + // This test simulates a user refreshing the WebUI page. The receiver should + // be reset before binding the new receiver. Otherwise we would get a DCHECK + // error from mojo::Receiver mojo::Remote<mojom::InputDataProvider> remote; provider_->BindInterface(remote.BindNewPipeAndPassReceiver()); - ASSERT_TRUE(provider_->ReceiverIsBound()); - - // Unbind remote to trigger disconnect and disconnect handler. - remote.reset(); base::RunLoop().RunUntilIdle(); - ASSERT_FALSE(provider_->ReceiverIsBound()); - // Test intent is to ensure interface can be rebound when application is - // reloaded using |CTRL + R|. A disconnect should be signaled in which we - // will reset the receiver to its unbound state. + remote.reset(); + provider_->BindInterface(remote.BindNewPipeAndPassReceiver()); - ASSERT_TRUE(provider_->ReceiverIsBound()); + base::RunLoop().RunUntilIdle(); } TEST_F(InputDataProviderTest, KeyObservationBasic) {
diff --git a/ash/webui/diagnostics_ui/backend/network_health_provider.cc b/ash/webui/diagnostics_ui/backend/network_health_provider.cc index 1697597..9288690 100644 --- a/ash/webui/diagnostics_ui/backend/network_health_provider.cc +++ b/ash/webui/diagnostics_ui/backend/network_health_provider.cc
@@ -612,19 +612,8 @@ void NetworkHealthProvider::BindInterface( mojo::PendingReceiver<mojom::NetworkHealthProvider> pending_receiver) { DCHECK(features::IsNetworkingInDiagnosticsAppEnabled()); - DCHECK(!ReceiverIsBound()); - receiver_.Bind(std::move(pending_receiver)); - receiver_.set_disconnect_handler( - base::BindOnce(&NetworkHealthProvider::OnBoundInterfaceDisconnect, - base::Unretained(this))); -} - -bool NetworkHealthProvider::ReceiverIsBound() { - return receiver_.is_bound(); -} - -void NetworkHealthProvider::OnBoundInterfaceDisconnect() { receiver_.reset(); + receiver_.Bind(std::move(pending_receiver)); } void NetworkHealthProvider::NotifyNetworkListObservers() {
diff --git a/ash/webui/diagnostics_ui/backend/network_health_provider.h b/ash/webui/diagnostics_ui/backend/network_health_provider.h index ffcdf14..c780293 100644 --- a/ash/webui/diagnostics_ui/backend/network_health_provider.h +++ b/ash/webui/diagnostics_ui/backend/network_health_provider.h
@@ -55,9 +55,6 @@ void BindInterface( mojo::PendingReceiver<mojom::NetworkHealthProvider> pending_receiver); - // Handler for when remote attached to |receiver_| disconnects. - void OnBoundInterfaceDisconnect(); - bool ReceiverIsBound(); // CrosNetworkConfigObserver void OnNetworkStateListChanged() override {}
diff --git a/ash/webui/diagnostics_ui/backend/network_health_provider_unittest.cc b/ash/webui/diagnostics_ui/backend/network_health_provider_unittest.cc index 82cba9a..80a100a3 100644 --- a/ash/webui/diagnostics_ui/backend/network_health_provider_unittest.cc +++ b/ash/webui/diagnostics_ui/backend/network_health_provider_unittest.cc
@@ -1387,25 +1387,20 @@ EXPECT_FALSE(log.GetNetworkInfo().empty()); } -TEST_F(NetworkHealthProviderTest, ResetReceiverOnDisconnect) { - // Ensure required features are enabled before binding to avoid DCHECK. +TEST_F(NetworkHealthProviderTest, ResetReceiverOnBindInterface) { + // This test simulates a user refreshing the WebUI page. The receiver should + // be reset before binding the new receiver. Otherwise we would get a DCHECK + // error from mojo::Receiver base::test::ScopedFeatureList features; features.InitAndEnableFeature(features::kEnableNetworkingInDiagnosticsApp); - ASSERT_FALSE(network_health_provider_->ReceiverIsBound()); mojo::Remote<mojom::NetworkHealthProvider> remote; network_health_provider_->BindInterface(remote.BindNewPipeAndPassReceiver()); - ASSERT_TRUE(network_health_provider_->ReceiverIsBound()); - - // Unbind remote to trigger disconnect and disconnect handler. - remote.reset(); base::RunLoop().RunUntilIdle(); - ASSERT_FALSE(network_health_provider_->ReceiverIsBound()); - // Test intent is to ensure interface can be rebound when application is - // reloaded using |CTRL + R|. A disconnect should be signaled in which we - // will reset the receiver to its unbound state. + remote.reset(); + network_health_provider_->BindInterface(remote.BindNewPipeAndPassReceiver()); - ASSERT_TRUE(network_health_provider_->ReceiverIsBound()); + base::RunLoop().RunUntilIdle(); } } // namespace diagnostics
diff --git a/ash/webui/diagnostics_ui/backend/system_data_provider.cc b/ash/webui/diagnostics_ui/backend/system_data_provider.cc index e745a73..fd35c48 100644 --- a/ash/webui/diagnostics_ui/backend/system_data_provider.cc +++ b/ash/webui/diagnostics_ui/backend/system_data_provider.cc
@@ -332,18 +332,8 @@ void SystemDataProvider::BindInterface( mojo::PendingReceiver<mojom::SystemDataProvider> pending_receiver) { - DCHECK(!ReceiverIsBound()); - receiver_.Bind(std::move(pending_receiver)); - receiver_.set_disconnect_handler(base::BindOnce( - &SystemDataProvider::OnBoundInterfaceDisconnect, base::Unretained(this))); -} - -bool SystemDataProvider::ReceiverIsBound() { - return receiver_.is_bound(); -} - -void SystemDataProvider::OnBoundInterfaceDisconnect() { receiver_.reset(); + receiver_.Bind(std::move(pending_receiver)); } void SystemDataProvider::SetBatteryChargeStatusTimerForTesting(
diff --git a/ash/webui/diagnostics_ui/backend/system_data_provider.h b/ash/webui/diagnostics_ui/backend/system_data_provider.h index d6f5093..bd82741 100644 --- a/ash/webui/diagnostics_ui/backend/system_data_provider.h +++ b/ash/webui/diagnostics_ui/backend/system_data_provider.h
@@ -68,10 +68,6 @@ void SetCpuUsageTimerForTesting(std::unique_ptr<base::RepeatingTimer> timer); - // Handler for when remote attached to |receiver_| disconnects. - void OnBoundInterfaceDisconnect(); - bool ReceiverIsBound(); - private: void BindCrosHealthdProbeServiceIfNeccessary();
diff --git a/ash/webui/diagnostics_ui/backend/system_data_provider_unittest.cc b/ash/webui/diagnostics_ui/backend/system_data_provider_unittest.cc index 1d60d5e..298c6881 100644 --- a/ash/webui/diagnostics_ui/backend/system_data_provider_unittest.cc +++ b/ash/webui/diagnostics_ui/backend/system_data_provider_unittest.cc
@@ -1014,22 +1014,18 @@ EXPECT_EQ("Has Battery: true", log_contents[9]); } -TEST_F(SystemDataProviderTest, ResetReceiverOnDisconnect) { - ASSERT_FALSE(system_data_provider_->ReceiverIsBound()); +TEST_F(SystemDataProviderTest, ResetReceiverOnBindInterface) { + // This test simulates a user refreshing the WebUI page. The receiver should + // be reset before binding the new receiver. Otherwise we would get a DCHECK + // error from mojo::Receiver mojo::Remote<mojom::SystemDataProvider> remote; system_data_provider_->BindInterface(remote.BindNewPipeAndPassReceiver()); - ASSERT_TRUE(system_data_provider_->ReceiverIsBound()); - - // Unbind remote to trigger disconnect and disconnect handler. - remote.reset(); base::RunLoop().RunUntilIdle(); - ASSERT_FALSE(system_data_provider_->ReceiverIsBound()); - // Test intent is to ensure interface can be rebound when application is - // reloaded using |CTRL + R|. A disconnect should be signaled in which we - // will reset the receiver to its unbound state. + remote.reset(); + system_data_provider_->BindInterface(remote.BindNewPipeAndPassReceiver()); - ASSERT_TRUE(system_data_provider_->ReceiverIsBound()); + base::RunLoop().RunUntilIdle(); } TEST_F(SystemDataProviderTest, BatteryInfoPtrDataValidation) {
diff --git a/ash/webui/eche_app_ui/resources/browser_proxy.js b/ash/webui/eche_app_ui/resources/browser_proxy.js index 3c5366a..3a62c8f 100644 --- a/ash/webui/eche_app_ui/resources/browser_proxy.js +++ b/ash/webui/eche_app_ui/resources/browser_proxy.js
@@ -199,3 +199,17 @@ } window.onhashchange = locationHashChanged; + +if ('virtualKeyboard' in navigator) { + navigator['virtualKeyboard'].overlaysContent = true; + navigator['virtualKeyboard'].addEventListener('geometrychange', (event) => { + const {x, y, width, height} = event.target['boundingRect']; + console.log('Virtual keyboard geometry:', x, y, width, height); + const isVirtualKeyboardEnabled = width > 0 && height > 0; + guestMessagePipe.sendMessage( + Message.IS_VIRTUAL_KEYBOARD_ENABLED, + {/** @type {boolean} */ isVirtualKeyboardEnabled}); + }); +} else { + console.log('virtual keyboard is not supported!'); +}
diff --git a/ash/webui/eche_app_ui/resources/message_types.js b/ash/webui/eche_app_ui/resources/message_types.js index 5a61fd76..074b5c1 100644 --- a/ash/webui/eche_app_ui/resources/message_types.js +++ b/ash/webui/eche_app_ui/resources/message_types.js
@@ -101,4 +101,6 @@ START_STREAMING: 'start_streaming', // Message for stream action STREAM_ACTION: 'stream_action', + // Message for virtual keyboard state + IS_VIRTUAL_KEYBOARD_ENABLED: 'is_virtual_keyboard_enabled', };
diff --git a/ash/webui/eche_app_ui/resources/receiver.js b/ash/webui/eche_app_ui/resources/receiver.js index 5ab38439..3b702e0 100644 --- a/ash/webui/eche_app_ui/resources/receiver.js +++ b/ash/webui/eche_app_ui/resources/receiver.js
@@ -46,6 +46,17 @@ streamActionCallback(/** @type {!StreamAction} */ (message.action)); }); +let virtualKeyboardCallback = null; +parentMessagePipe.registerHandler( + Message.IS_VIRTUAL_KEYBOARD_ENABLED, async (message) => { + if (!virtualKeyboardCallback || !message.isVirtualKeyboardEnabled) { + return; + } + + virtualKeyboardCallback( + /** @type {boolean} */ (message.isVirtualKeyboardEnabled)); + }); + // The implementation of echeapi.d.ts const EcheApiBindingImpl = new (class { closeWindow() { @@ -127,6 +138,12 @@ console.log('echeapi receiver.js onStreamAction'); streamActionCallback = callback; } + + onReceivedVirtualKeyboardChanged(callback) { + console.log('echeapi receiver.js onReceivedVirtualKeyboardChanged'); + virtualKeyboardCallback = callback; + } + })(); // Declare module echeapi and bind the implementation to echeapi.d.ts @@ -164,5 +181,8 @@ EcheApiBindingImpl.sendEnumHistogram.bind(EcheApiBindingImpl); echeapi.system.registerStreamActionReceiver = EcheApiBindingImpl.onStreamAction.bind(EcheApiBindingImpl); +echeapi.system.registerVirtualKeyboardChangedReceiver = + EcheApiBindingImpl.onReceivedVirtualKeyboardChanged.bind( + EcheApiBindingImpl); window['echeapi'] = echeapi; console.log('echeapi receiver.js finish bind the implementation of echeapi');
diff --git a/ash/webui/os_feedback_ui/resources/file_attachment.html b/ash/webui/os_feedback_ui/resources/file_attachment.html index 50f2b0c..e59c3517 100644 --- a/ash/webui/os_feedback_ui/resources/file_attachment.html +++ b/ash/webui/os_feedback_ui/resources/file_attachment.html
@@ -36,10 +36,10 @@ } </style> <div id="addFileContainer" hidden="[[hasSelectedAFile_]]"> - <label id="addFileLabel" class="file-input" - on-click="handleOpenFileInputClick_" tabindex="0"> + <button id="addFileLabel" class="file-input" + on-click="handleOpenFileInputClick_"> <iron-icon icon="attachment:add-file"></iron-icon>Add file - </label> + </button> </div> <input id="selectFileDialog" type="file" on-change="handleFileSelectChange_" tabindex="-1"> @@ -47,10 +47,10 @@ <input type="checkbox" id="selectFileCheckbox"> <div> <div id="selectedFileName"></div> - <label id="replaceFileLabel" class="file-input" - on-click="handleOpenFileInputClick_" tabindex="0"> + <button id="replaceFileLabel" class="file-input" + on-click="handleOpenFileInputClick_"> [[i18n('replaceFileLabel')]] - </label> + </button> </div> </div> <cr-toast id="fileTooBigErrorMessage" duration="5000">
diff --git a/ash/webui/shimless_rma/resources/base_page.html b/ash/webui/shimless_rma/resources/base_page.html index a115562..362e82a 100644 --- a/ash/webui/shimless_rma/resources/base_page.html +++ b/ash/webui/shimless_rma/resources/base_page.html
@@ -3,6 +3,7 @@ align-items: stretch; display: flex; flex-direction: row; + height: var(--content-container-height); width: 100%; }
diff --git a/ash/webui/shimless_rma/resources/calibration_component_chip.html b/ash/webui/shimless_rma/resources/calibration_component_chip.html index ac59d502f..6a763c7f 100644 --- a/ash/webui/shimless_rma/resources/calibration_component_chip.html +++ b/ash/webui/shimless_rma/resources/calibration_component_chip.html
@@ -18,8 +18,9 @@ #componentButton { --vertical-padding: 24px; + border: none; border-radius: 8px; - box-shadow: var(--cros-elevation-1-shadow); + box-shadow: var(--cros-elevation-2-shadow); font-family: var(--shimless-component-font-family); font-size: var(--shimless-component-font-size); font-weight: var(--shimless-medium-font-weight);
diff --git a/ash/webui/shimless_rma/resources/repair_component_chip.html b/ash/webui/shimless_rma/resources/repair_component_chip.html index 3adbbd7..9f172e37 100644 --- a/ash/webui/shimless_rma/resources/repair_component_chip.html +++ b/ash/webui/shimless_rma/resources/repair_component_chip.html
@@ -25,8 +25,9 @@ #componentButton { --vertical-padding: 24px; + border: none; border-radius: 8px; - box-shadow: var(--cros-elevation-1-shadow); + box-shadow: var(--cros-elevation-2-shadow); height: calc((2 * var(--vertical-padding)) + var(--shimless-component-line-height) + var(--shimless-component-description-line-height));
diff --git a/build/android/pylib/base/test_run.py b/build/android/pylib/base/test_run.py index d62bc741..ca2f39f 100644 --- a/build/android/pylib/base/test_run.py +++ b/build/android/pylib/base/test_run.py
@@ -27,12 +27,13 @@ def SetUp(self): raise NotImplementedError - def RunTests(self, results): + def RunTests(self, results, raw_logs_fh=None): """Runs Tests and populates |results|. Args: results: An array that should be populated with |base_test_result.TestRunResults| objects. + raw_logs_fh: An optional file handle to write raw logs to. """ raise NotImplementedError
diff --git a/build/android/pylib/local/device/local_device_gtest_run.py b/build/android/pylib/local/device/local_device_gtest_run.py index f5cea4c..2a8b59a 100644 --- a/build/android/pylib/local/device/local_device_gtest_run.py +++ b/build/android/pylib/local/device/local_device_gtest_run.py
@@ -763,7 +763,7 @@ if logmon: logmon.Close() if logcat_file and logcat_file.Link(): - logging.info('Logcat saved to %s', logcat_file.Link()) + logging.critical('Logcat saved to %s', logcat_file.Link()) #override def _RunTest(self, device, test):
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py index 46efec2..6b8231f 100644 --- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py +++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -1105,7 +1105,7 @@ if logmon: logmon.Close() if logcat_file and logcat_file.Link(): - logging.info('Logcat saved to %s', logcat_file.Link()) + logging.critical('Logcat saved to %s', logcat_file.Link()) def _SaveTraceData(self, trace_device_file, device, test_class): trace_host_file = self._env.trace_output
diff --git a/build/android/pylib/local/device/local_device_test_run.py b/build/android/pylib/local/device/local_device_test_run.py index 3a27c84..ae31787 100644 --- a/build/android/pylib/local/device/local_device_test_run.py +++ b/build/android/pylib/local/device/local_device_test_run.py
@@ -60,7 +60,7 @@ env.SetPreferredAbis(test_instance.GetPreferredAbis()) #override - def RunTests(self, results): + def RunTests(self, results, raw_logs_fh=None): tests = self._GetTests() exit_now = threading.Event()
diff --git a/build/android/pylib/local/machine/local_machine_junit_test_run.py b/build/android/pylib/local/machine/local_machine_junit_test_run.py index 745cc9f..bfc22a4 100644 --- a/build/android/pylib/local/machine/local_machine_junit_test_run.py +++ b/build/android/pylib/local/machine/local_machine_junit_test_run.py
@@ -7,6 +7,7 @@ import multiprocessing import os import queue +import re import subprocess import sys import tempfile @@ -47,6 +48,9 @@ # Running the largest test suite with a single shard takes about 22 minutes. _SHARD_TIMEOUT = 30 * 60 +# RegExp to detect logcat lines, e.g., 'I/AssetManager: not found'. +_LOGCAT_RE = re.compile(r'[A-Z]/[\w\d_-]+:') + class LocalMachineJunitTestRun(test_run.TestRun): # override @@ -84,9 +88,8 @@ self._test_instance.robolectric_runtime_deps_dir, '-Ddir.source.root=%s' % constants.DIR_SOURCE_ROOT, '-Drobolectric.resourcesMode=binary', + '-Drobolectric.logging=stdout', ] - if logging.getLogger().isEnabledFor(logging.INFO): - jvm_args += ['-Drobolectric.logging=stdout'] if self._test_instance.debug_socket: jvm_args += [ '-agentlib:jdwp=transport=dt_socket' @@ -118,7 +121,7 @@ return jvm_args # override - def RunTests(self, results): + def RunTests(self, results, raw_logs_fh=None): wrapper_path = os.path.join(constants.GetOutDirectory(), 'bin', 'helper', self._test_instance.suite) @@ -154,9 +157,21 @@ AddPropertiesJar(cmd_list, temp_dir, self._test_instance.resource_apk) + show_logcat = logging.getLogger().isEnabledFor(logging.INFO) + num_omitted_lines = 0 for line in _RunCommandsAndSerializeOutput(cmd_list): - sys.stdout.write(line) + if raw_logs_fh: + raw_logs_fh.write(line) + if show_logcat or not _LOGCAT_RE.match(line): + sys.stdout.write(line) + else: + num_omitted_lines += 1 + + if num_omitted_lines > 0: + logging.critical('%d log lines omitted.', num_omitted_lines) sys.stdout.flush() + if raw_logs_fh: + raw_logs_fh.flush() results_list = [] try:
diff --git a/build/android/test_runner.py b/build/android/test_runner.py index 1e9adc3..b8bdaee 100755 --- a/build/android/test_runner.py +++ b/build/android/test_runner.py
@@ -10,6 +10,7 @@ import argparse import collections import contextlib +import io import itertools import logging import os @@ -999,6 +1000,9 @@ upload_logcats_file(), 'upload_logcats_file' in args and args.upload_logcats_file) + save_detailed_results = (args.local_output or not local_utils.IsOnSwarming() + ) and not args.isolated_script_test_output + ### Set up test objects. out_manager = output_manager_factory.CreateOutputManager(args) @@ -1012,6 +1016,9 @@ ### Run. with out_manager, json_finalizer(): + # |raw_logs_fh| is only used by Robolectric tests. + raw_logs_fh = io.StringIO() if save_detailed_results else None + with json_writer(), logcats_uploader, env, test_instance, test_run: repetitions = (range(args.repeat + @@ -1027,7 +1034,7 @@ raw_results = [] all_raw_results.append(raw_results) - test_run.RunTests(raw_results) + test_run.RunTests(raw_results, raw_logs_fh=raw_logs_fh) if not raw_results: all_raw_results.pop() continue @@ -1079,8 +1086,17 @@ str(tot_tests), str(iteration_count)) - if (args.local_output or not local_utils.IsOnSwarming() - ) and not args.isolated_script_test_output: + if save_detailed_results: + assert raw_logs_fh + raw_logs_fh.seek(0) + raw_logs = raw_logs_fh.read() + if raw_logs: + with out_manager.ArchivedTempfile( + 'raw_logs.txt', 'raw_logs', + output_manager.Datatype.TEXT) as raw_logs_file: + raw_logs_file.write(raw_logs) + logging.critical('RAW LOGS: %s', raw_logs_file.Link()) + with out_manager.ArchivedTempfile( 'test_results_presentation.html', 'test_results_presentation',
diff --git a/build/config/chromeos/BUILD.gn b/build/config/chromeos/BUILD.gn index 82d8190..90ef9a9 100644 --- a/build/config/chromeos/BUILD.gn +++ b/build/config/chromeos/BUILD.gn
@@ -27,15 +27,18 @@ # match the target toolchain defaults in these directories. Passing them # redundantly is harmless and prepares for using Chromium's toolchain. # Non-Lacros Chrome OS builds use per-board toolchains, which might use - # differen triples. So don't do this there. + # different triples. So don't do this there. if (is_chromeos_device && is_chromeos_lacros) { if (current_cpu == "x64") { + asmflags = [ "--target=x86_64-cros-linux-gnu" ] cflags = [ "--target=x86_64-cros-linux-gnu" ] ldflags = [ "--target=x86_64-cros-linux-gnu" ] } else if (current_cpu == "arm") { + asmflags = [ "--target=armv7a-cros-linux-gnueabihf" ] cflags = [ "--target=armv7a-cros-linux-gnueabihf" ] ldflags = [ "--target=armv7a-cros-linux-gnueabihf" ] } else if (current_cpu == "arm64") { + asmflags = [ "--target=aarch64-cros-linux-gnu" ] cflags = [ "--target=aarch64-cros-linux-gnu" ] ldflags = [ "--target=aarch64-cros-linux-gnu" ] } else {
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index df86106..52c364d 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -909,7 +909,8 @@ ] } } else if (current_cpu == "arm") { - if (is_clang && !is_android && !is_nacl) { + if (is_clang && !is_android && !is_nacl && + !(is_chromeos_lacros && is_chromeos_device)) { cflags += [ "--target=arm-linux-gnueabihf" ] ldflags += [ "--target=arm-linux-gnueabihf" ] } @@ -923,7 +924,8 @@ cflags += [ "-mtune=$arm_tune" ] } } else if (current_cpu == "arm64") { - if (is_clang && !is_android && !is_nacl && !is_fuchsia) { + if (is_clang && !is_android && !is_nacl && !is_fuchsia && + !(is_chromeos_lacros && is_chromeos_device)) { cflags += [ "--target=aarch64-linux-gnu" ] ldflags += [ "--target=aarch64-linux-gnu" ] }
diff --git a/build/fuchsia/PRESUBMIT.py b/build/fuchsia/PRESUBMIT.py index 1ee26c11..382fced 100644 --- a/build/fuchsia/PRESUBMIT.py +++ b/build/fuchsia/PRESUBMIT.py
@@ -24,6 +24,7 @@ J('binary_sizes_test.py'), J('binary_size_differ_test.py'), J('device_target_test.py'), + J('ermine_ctl_test.py'), ] # TODO(1309977): enable on Windows when fixed. @@ -34,7 +35,8 @@ output_api, unit_tests=unit_tests, run_on_python2=False, - run_on_python3=True)) + run_on_python3=True, + skip_shebang_check=True)) return input_api.RunTests(tests)
diff --git a/build/fuchsia/device_target.py b/build/fuchsia/device_target.py index 967c8e7..2e05cf7 100644 --- a/build/fuchsia/device_target.py +++ b/build/fuchsia/device_target.py
@@ -13,6 +13,7 @@ import target import time +import ermine_ctl import ffx_session from common import ATTACH_RETRY_SECONDS, EnsurePathExists, \ @@ -95,6 +96,7 @@ self._pkg_repo = None self._target_context = None self._ffx_target = None + self._ermine_ctl = ermine_ctl.ErmineCtl(self) if not self._system_image_dir and self._os_check != 'ignore': raise Exception("Image directory must be provided if a repave is needed.") @@ -217,12 +219,23 @@ return True + def _Login(self): + """Attempts to log into device, if possible. + + This method should not be called from anything other than Start, + though calling it multiple times should have no adverse effect. + """ + if self._ermine_ctl.exists: + self._ermine_ctl.TakeToShell() + def Start(self): if self._host: self._ConnectToTarget() + self._Login() elif self._Discover(): self._ConnectToTarget() if self._os_check == 'ignore': + self._Login() return # If accessible, check version. @@ -240,12 +253,14 @@ stdout=subprocess.PIPE, stderr=subprocess.STDOUT) self._ProvisionDevice() + self._Login() else: if self._node_name: logging.info('Could not detect device %s.' % self._node_name) if self._os_check == 'update': logging.info('Assuming it is in zedboot. Continuing with paving...') self._ProvisionDevice() + self._Login() return raise Exception('Could not find device. If the device is connected ' 'to the host remotely, make sure that --host flag '
diff --git a/build/fuchsia/device_target_test.py b/build/fuchsia/device_target_test.py index 9c43034..7590a7a4 100755 --- a/build/fuchsia/device_target_test.py +++ b/build/fuchsia/device_target_test.py
@@ -3,11 +3,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tests scenarios with number of devices and invalid devices""" +import common +import os import subprocess +import time import unittest import unittest.mock as mock from argparse import Namespace from device_target import DeviceTarget +from ermine_ctl import ErmineCtl from ffx_session import FfxRunner, FfxTarget from target import Target, FuchsiaTargetException @@ -33,7 +37,9 @@ mock.patch.object( FfxTarget, 'get_ssh_address') as mock_get_ssh_address, \ mock.patch.object( - DeviceTarget, '_ConnectToTarget') as mock_connecttotarget: + DeviceTarget, '_ConnectToTarget') as mock_connecttotarget, \ + mock.patch.object( + DeviceTarget, '_Login') as mock_login: mock_list_targets.return_value = [{ "nodename": "device_name", "rcs_state": "Y", @@ -55,7 +61,9 @@ mock.patch.object( FfxTarget, 'get_ssh_address') as mock_get_ssh_address, \ mock.patch.object( - DeviceTarget, '_ConnectToTarget') as mock_connecttotarget: + DeviceTarget, '_ConnectToTarget') as mock_connecttotarget, \ + mock.patch.object( + DeviceTarget, '_Login') as mock_login: mock_list_targets.return_value = [{ "nodename": "<unknown>", "rcs_state": "Y", @@ -69,6 +77,7 @@ self.assertIsNone(device_target_instance.Start()) self.assertEqual(device_target_instance._host, 'address') self.assertEqual(device_target_instance._port, 12345) + mock_login.assert_called_once() mock_daemon_stop.assert_called_once() def testUnspecifiedNodeNameTwoDevicesRaiseExceptionAmbiguousTarget( @@ -107,13 +116,16 @@ mock.patch.object( FfxTarget, 'get_ssh_address') as mock_get_ssh_address, \ mock.patch.object( - DeviceTarget, '_ConnectToTarget') as mock_connecttotarget: + DeviceTarget, '_ConnectToTarget') as mock_connecttotarget, \ + mock.patch.object( + DeviceTarget, '_Login') as mock_login: mock_get_ssh_address.return_value = ('address', 12345) mock_connecttotarget.return_value = True self.assertIsNone(device_target_instance.Start()) self.assertEqual(device_target_instance._node_name, 'device_name') self.assertEqual(device_target_instance._host, 'address') self.assertEqual(device_target_instance._port, 12345) + mock_login.assert_called_once() mock_daemon_stop.assert_called_once() def testNodeNameDefinedDeviceNotFoundRaiseExceptionCouldNotFind( @@ -148,12 +160,16 @@ mock.patch.object(DeviceTarget, '_GetSdkHash') as mock_hash, \ mock.patch.object( DeviceTarget, '_GetInstalledSdkVersion') as mock_version, \ - mock.patch.object(DeviceTarget, '_ProvisionDevice') as mock_provision: + mock.patch.object( + DeviceTarget, '_ProvisionDevice') as mock_provision, \ + mock.patch.object( + DeviceTarget, '_Login') as mock_login: mock_discover.return_value = True mock_hash.return_value = '1.0' mock_version.return_value = '1.0' device_target_instance.Start() self.assertEqual(mock_provision.call_count, 0) + mock_login.assert_called_once() mock_daemon_stop.assert_called_once() def testRaiseExceptionIfCheckVersionsNoMatch(self, mock_daemon_stop): @@ -174,6 +190,31 @@ device_target_instance.Start() mock_daemon_stop.assert_called_once() + def testLoginCallsOnlyIfErmineExists(self, mock_daemon_stop): + with DeviceTarget.CreateFromArgs(self.args) as device_target_instance, \ + mock.patch.object( + ErmineCtl, 'exists', + new_callable=mock.PropertyMock) as mock_exists, \ + mock.patch.object(ErmineCtl, 'TakeToShell') as mock_shell: + mock_exists.return_value = True + + device_target_instance._Login() + + mock_exists.assert_called_once() + mock_shell.assert_called_once() + + with DeviceTarget.CreateFromArgs(self.args) as device_target_instance, \ + mock.patch.object( + ErmineCtl, 'exists', + new_callable=mock.PropertyMock) as mock_exists, \ + mock.patch.object(ErmineCtl, 'TakeToShell') as mock_shell: + mock_exists.return_value = False + + device_target_instance._Login() + + mock_exists.assert_called_once() + self.assertEqual(mock_shell.call_count, 0) + def testProvisionIfOneNonDetectableDevice(self, mock_daemon_stop): self.args.os_check = 'update' self.args.node_name = 'mocknode' @@ -181,7 +222,9 @@ with DeviceTarget.CreateFromArgs(self.args) as device_target_instance, \ mock.patch.object( FfxTarget, 'get_ssh_address') as mock_get_ssh_address, \ - mock.patch.object(DeviceTarget, '_ProvisionDevice') as mock_provision: + mock.patch.object(DeviceTarget, + '_ProvisionDevice') as mock_provision, \ + mock.patch.object(DeviceTarget, '_Login') as mock_bypass: mock_get_ssh_address.return_value = None device_target_instance.Start() self.assertEqual(mock_provision.call_count, 1)
diff --git a/build/fuchsia/ermine_ctl.py b/build/fuchsia/ermine_ctl.py new file mode 100644 index 0000000..a4a2c7d --- /dev/null +++ b/build/fuchsia/ermine_ctl.py
@@ -0,0 +1,196 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +"""Adds python interface to erminectl tools on workstation products.""" + +from typing import Any, List, Tuple, Union + +import enum +import logging +import subprocess +import time + + +class ErmineCtl: + """Tool for automating control of Ermine and its OOBE, if available. + + Must be used after checking if the tool exists. + + Usage: + ctl = ermine_ctl.ErmineCtl(some_target) + if ctl.exists: + ctl.WaitUntilReady() + ctl.TakeToShell() + + logging.info('In the shell') + else: + logging.info('Tool does not exist!') + + This is only necessary after a target reboot or provision (IE pave). + """ + + _OOBE_PASSWORD = 'some_test_password' + _TOOL = 'erminectl' + _OOBE_SUBTOOL = 'oobe' + _MAX_STATE_TRANSITIONS = 5 + + # Mapping between the current state and the next command to run + # to move it to the next state. + _STATE_TO_NEXT = { + 'SetPassword': ['set_password', _OOBE_PASSWORD], + 'Unknown': ['skip'], + 'Shell': [], + 'Login': ['login', _OOBE_PASSWORD], + } + _COMPLETE_STATE = 'Shell' + + _READY_TIMEOUT = 10 + _WAIT_ATTEMPTS = 10 + _WAIT_FOR_READY_SLEEP_SEC = 3 + + def __init__(self, target: Any): + self.target = target + self._ermine_exists = False + self._ermine_exists_check = False + + @property + def exists(self) -> bool: + """Returns the existence of the tool. + + Checks whether the tool exists on and caches the result. + + Returns: + True if the tool exists, False if not. + """ + if not self._ermine_exists_check: + self._ermine_exists = self.target.RunCommand([self._TOOL, '--help']) == 0 + self._ermine_exists_check = True + logging.debug('erminectl exists: %s', + ('true' if self._ermine_exists else 'false')) + return self._ermine_exists + + @property + def status(self) -> Tuple[int, str]: + """Returns the status of ermine. + + Note that if the tool times out or does not exist, a non-zero code + is returned. + + Returns: + Tuple of (return code, status as string). -1 for timeout, and + -2 for no tool. + """ + if self.exists: + # Executes base command, which returns status. + proc = self._ExecuteCommandAsync([]) + try: + proc.wait(timeout=self._READY_TIMEOUT) + except subprocess.TimeoutExpired: + logging.warning('Timed out waiting for status') + return -1, 'Timeout' + stdout, _ = proc.communicate() + return proc.returncode, stdout.strip() + return -2, 'InvalidState' + + @property + def ready(self) -> bool: + """Indicates if the tool is ready for regular use. + + Returns: + False if not ready or does not exist, and True if ready. + """ + if self.exists: + rc, _ = self.status + return rc == 0 + + return False + + def _ExecuteCommandAsync(self, command: List[str]) -> subprocess.Popen: + """Executes a sub-command asynchronously. + + Args: + command: list of strings to compose the command. Forwards to the + command runner. + Returns: + Popen of the subprocess. + """ + full_command = [self._TOOL, self._OOBE_SUBTOOL] + full_command.extend(command) + + # Returns immediately with Popen. + return self.target.RunCommandPiped(full_command, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True) + + def _ExecuteCommand(self, command: List[str]): + """Executes a sub-command of the tool synchronously. + Raises exception if non-zero returncode is given. + + Args: + command: list of strings to compose the command. Forwards to the + command runner. + Raises: + RuntimeError: if non-zero returncode is returned. + """ + proc = self._ExecuteCommandAsync(command) + proc.wait() + stdout, stderr = proc.communicate() + if proc.returncode != 0: + raise RuntimeError(f'Command {" ".join(command)} failed.' + f'\nSTDOUT: {stdout}\nSTDERR: {stderr}') + + def WaitUntilReady(self) -> bool: + """Waits until the tool is ready through sleep-poll. + + The tool may not be ready after a pave or restart. + This checks the status and exits after its ready or Timeout. + + Returns: + True if the tool exists and is ready. False if the tool does not exist. + Raises: + TimeoutError: if tool is not ready after certain amount of attempts. + """ + if self.exists: + for _ in range(self._WAIT_ATTEMPTS): + if self.ready: + break + time.sleep(self._WAIT_FOR_READY_SLEEP_SEC) + else: + raise TimeoutError('Timed out waiting for a valid status to return') + + return True + return False + + def TakeToShell(self): + """Takes device to shell after waiting for tool to be ready. + + Examines the current state of the device after waiting for it to be ready. + Once ready, goes through the states of logging in. This is: + - CreatePassword -> Skip screen -> Shell + - Login -> Shell + - Shell + + Regardless of starting state, this will exit once the shell state is + reached. + + Raises: + NotImplementedError: if an unknown state is reached. + RuntimeError: If number of state transitions exceeds the max number that + is expected. + """ + assert self.WaitUntilReady(), 'erminectl does not exist, cannot be ready' + _, state = self.status + max_states = self._MAX_STATE_TRANSITIONS + while state != self._COMPLETE_STATE and max_states: + max_states -= 1 + command = self._STATE_TO_NEXT.get(state) + logging.debug('Ermine state is: %s', state) + if command is None: + raise NotImplementedError('Encountered invalid state: %s' % state) + self._ExecuteCommand(command) + _, state = self.status + + if not max_states: + raise RuntimeError('Did not transition to shell in %d attempts.' + ' Please file a bug.' % self._MAX_STATE_TRANSITIONS)
diff --git a/build/fuchsia/ermine_ctl_test.py b/build/fuchsia/ermine_ctl_test.py new file mode 100755 index 0000000..e64447d --- /dev/null +++ b/build/fuchsia/ermine_ctl_test.py
@@ -0,0 +1,255 @@ +#!/usr/bin/env vpython3 +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +"""Tests scenarios for ermine_ctl""" +import common +import os +import logging +import subprocess +import time +import unittest +import unittest.mock as mock +from target import Target +from ermine_ctl import ErmineCtl + + +class TestDiscoverDeviceTarget(unittest.TestCase): + def setUp(self): + self.mock_target = mock.create_autospec(Target, instance=True) + self.ermine_ctl = ErmineCtl(self.mock_target) + + def testCheckExists(self): + self.mock_target.RunCommand.return_value = 0 + + self.assertFalse(self.ermine_ctl._ermine_exists) + self.assertFalse(self.ermine_ctl._ermine_exists_check) + + self.assertTrue(self.ermine_ctl.exists) + + self.assertTrue(self.ermine_ctl._ermine_exists) + self.assertTrue(self.ermine_ctl._ermine_exists_check) + + # Modifying this will not result in a change in state. + self.mock_target.RunCommand.return_value = 42 + self.assertTrue(self.ermine_ctl.exists) + self.assertTrue(self.ermine_ctl._ermine_exists) + self.assertTrue(self.ermine_ctl._ermine_exists_check) + + def testDoesNotExist(self): + self.mock_target.RunCommand.return_value = 42 + self.assertFalse(self.ermine_ctl._ermine_exists) + self.assertFalse(self.ermine_ctl._ermine_exists_check) + + self.assertFalse(self.ermine_ctl.exists) + self.assertFalse(self.ermine_ctl._ermine_exists) + self.assertTrue(self.ermine_ctl._ermine_exists_check) + + def testReadyReturnsFalseIfNoExist(self): + self.ermine_ctl._ermine_exists = False + self.ermine_ctl._ermine_exists_check = True + + self.assertFalse(self.ermine_ctl.ready) + + def testReadyReturnsFalseIfBadStatus(self): + with mock.patch.object( + ErmineCtl, 'status', new_callable=mock.PropertyMock) as mock_status, \ + mock.patch.object(ErmineCtl, 'exists', + new_callable=mock.PropertyMock) as mock_exists: + mock_exists.return_value = True + mock_status.return_value = (1, 'FakeStatus') + self.assertFalse(self.ermine_ctl.ready) + + def testReadyReturnsTrue(self): + with mock.patch.object( + ErmineCtl, 'status', new_callable=mock.PropertyMock) as mock_status, \ + mock.patch.object(ErmineCtl, 'exists', + new_callable=mock.PropertyMock) as mock_exists: + mock_exists.return_value = True + mock_status.return_value = (0, 'FakeStatus') + self.assertTrue(self.ermine_ctl.ready) + + def testStatusReturnsInvalidStateIfNoExists(self): + with mock.patch.object(ErmineCtl, 'exists', + new_callable=mock.PropertyMock) as mock_exists: + mock_exists.return_value = False + + self.assertEqual(self.ermine_ctl.status, (-2, 'InvalidState')) + + def testStatusReturnsRCAndStdout(self): + with mock.patch.object( + ErmineCtl, 'exists', new_callable=mock.PropertyMock) as mock_exists, \ + mock.patch.object( + ErmineCtl, '_ExecuteCommandAsync') as mock_execute: + mock_proc = mock.create_autospec(subprocess.Popen, instance=True) + mock_proc.communicate.return_value = 'foo', 'stderr' + mock_proc.returncode = 10 + mock_execute.return_value = mock_proc + + self.assertEqual(self.ermine_ctl.status, (10, 'foo')) + + def testStatusReturnsTimeoutState(self): + with mock.patch.object( + ErmineCtl, 'exists', new_callable=mock.PropertyMock) as mock_exists, \ + mock.patch.object( + ErmineCtl, '_ExecuteCommandAsync') as mock_execute, \ + mock.patch.object(logging, 'warning') as _: + mock_proc = mock.create_autospec(subprocess.Popen, instance=True) + mock_proc.wait.side_effect = subprocess.TimeoutExpired( + 'cmd', 'some timeout') + mock_execute.return_value = mock_proc + + self.assertEqual(self.ermine_ctl.status, (-1, 'Timeout')) + + def testExecuteCommandRaisesErrorOnNonZeroReturn(self): + with mock.patch.object(ErmineCtl, '_ExecuteCommandAsync') as mock_execute: + mock_proc = mock.create_autospec(subprocess.Popen, instance=True) + mock_proc.returncode = 42 + mock_proc.communicate.return_value = ('foo', 'bar') + mock_execute.return_value = mock_proc + + self.assertRaises(RuntimeError, self.ermine_ctl._ExecuteCommand, + ['some', 'command', '--args']) + + mock_execute.assert_called_once_with(['some', 'command', '--args']) + + mock_proc = mock.create_autospec(subprocess.Popen, instance=True) + mock_proc.returncode = 0 + mock_proc.communicate.return_value = ('foo', 'bar') + mock_execute.return_value = mock_proc + + self.assertIsNone(self.ermine_ctl._ExecuteCommand(['another', 'command'])) + + def testExecuteCommandAsync(self): + mock_proc = mock.create_autospec(subprocess.Popen, instance=True) + self.mock_target.RunCommandPiped.return_value = mock_proc + self.ermine_ctl._TOOL = 'foo' + self.ermine_ctl._OOBE_SUBTOOL = 'oobe_buzz' + + self.assertEqual( + self.ermine_ctl._ExecuteCommandAsync(['some', 'command', '--args']), + mock_proc) + + self.mock_target.RunCommandPiped.assert_called_once_with( + ['foo', 'oobe_buzz', 'some', 'command', '--args'], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True) + self.assertEqual(self.mock_target.RunCommand.call_count, 0) + + def testWaitUntilReadyIsNotReadyIfDNE(self): + with mock.patch.object(ErmineCtl, 'exists', + new_callable=mock.PropertyMock) as mock_exists: + mock_exists.return_value = False + + self.assertFalse(self.ermine_ctl.WaitUntilReady()) + + def testWaitUntilReadyLoopsUntilReady(self): + with mock.patch.object(ErmineCtl, 'exists', + new_callable=mock.PropertyMock) as mock_exists, \ + mock.patch.object(time, 'sleep') as mock_sleep, \ + mock.patch.object(ErmineCtl, 'ready', + new_callable=mock.PropertyMock) as mock_ready: + mock_exists.return_value = True + mock_ready.side_effect = [False, False, False, True] + + self.assertTrue(self.ermine_ctl.WaitUntilReady()) + + self.assertEqual(mock_ready.call_count, 4) + self.assertEqual(mock_sleep.call_count, 3) + + def testWaitUntilReadyLoopsUntilReady(self): + with mock.patch.object(ErmineCtl, 'exists', + new_callable=mock.PropertyMock) as mock_exists, \ + mock.patch.object(time, 'sleep') as mock_sleep, \ + mock.patch.object(ErmineCtl, 'ready', + new_callable=mock.PropertyMock) as mock_ready: + mock_exists.return_value = True + mock_ready.side_effect = [False, False, False, True] + self.ermine_ctl._WAIT_ATTEMPTS = 3 + + self.assertRaises(TimeoutError, self.ermine_ctl.WaitUntilReady) + + self.assertEqual(mock_ready.call_count, 3) + self.assertEqual(mock_sleep.call_count, 3) + + def testTakeToShellAssertsReady(self): + with mock.patch.object(ErmineCtl, 'WaitUntilReady') as mock_wait_ready: + mock_wait_ready.return_value = False + self.assertRaises(AssertionError, self.ermine_ctl.TakeToShell) + + def testTakeToShellExitsOnCompleteState(self): + with mock.patch.object(ErmineCtl, 'WaitUntilReady') as mock_wait_ready, \ + mock.patch.object( + ErmineCtl, 'status', + new_callable=mock.PropertyMock) as mock_status, \ + mock.patch.object(ErmineCtl, '_ExecuteCommand') as mock_execute: + mock_wait_ready.return_value = True + mock_status.return_value = (0, 'SomeCompleteState') + self.ermine_ctl._COMPLETE_STATE = 'SomeCompleteState' + + self.ermine_ctl.TakeToShell() + + self.assertEqual(mock_execute.call_count, 0) + + def testTakeToShellInvalidStateRaisesException(self): + with mock.patch.object(ErmineCtl, 'WaitUntilReady') as mock_wait_ready, \ + mock.patch.object( + ErmineCtl, 'status', + new_callable=mock.PropertyMock) as mock_status, \ + mock.patch.object(ErmineCtl, '_ExecuteCommand') as mock_execute: + mock_wait_ready.return_value = True + mock_status.return_value = (0, 'SomeUnknownState') + + self.assertNotIn('SomeUnknownState', self.ermine_ctl._STATE_TO_NEXT) + + self.assertRaises(NotImplementedError, self.ermine_ctl.TakeToShell) + + def testTakeToShellWithMaxTransitionsRaisesError(self): + with mock.patch.object(ErmineCtl, 'WaitUntilReady') as mock_wait_ready, \ + mock.patch.object( + ErmineCtl, 'status', + new_callable=mock.PropertyMock) as mock_status, \ + mock.patch.object(ErmineCtl, '_ExecuteCommand') as mock_execute: + mock_wait_ready.return_value = True + self.ermine_ctl._MAX_STATE_TRANSITIONS = 3 + # Returns too many state transitions before CompleteState. + mock_status.side_effect = [(0, 'Unknown'), (0, 'KnownWithPassword'), + (0, 'Unknown'), (0, 'KnownWithPassword'), + (0, 'CompleteState')] + self.ermine_ctl._COMPLETE_STATE = 'CompleteState' + self.ermine_ctl._STATE_TO_NEXT = { + 'Unknown': 'fizz', + 'KnownWithPassword': 'buzz', + 'CompleteState': 'do nothing' + } + + self.assertRaises(RuntimeError, self.ermine_ctl.TakeToShell) + + def testTakeToShellExecutesKnownCommands(self): + with mock.patch.object(ErmineCtl, 'WaitUntilReady') as mock_wait_ready, \ + mock.patch.object( + ErmineCtl, 'status', + new_callable=mock.PropertyMock) as mock_status, \ + mock.patch.object(ErmineCtl, '_ExecuteCommand') as mock_execute: + mock_wait_ready.return_value = True + mock_status.side_effect = [(0, 'Unknown'), (0, 'KnownWithPassword'), + (0, 'CompleteState')] + self.ermine_ctl._COMPLETE_STATE = 'CompleteState' + self.ermine_ctl._STATE_TO_NEXT = { + 'Unknown': ['fizz'], + 'KnownWithPassword': ['buzz', 'super plaintext password'], + 'CompleteState': ['do nothing'] + } + + self.ermine_ctl.TakeToShell() + + self.assertEqual(mock_execute.call_count, 2) + mock_execute.assert_has_calls([ + mock.call(['fizz']), + mock.call(['buzz', 'super plaintext password']) + ]) + + +if __name__ == '__main__': + unittest.main()
diff --git a/build/fuchsia/linux_internal.sdk.sha1 b/build/fuchsia/linux_internal.sdk.sha1 index cdbceb3..53b56db 100644 --- a/build/fuchsia/linux_internal.sdk.sha1 +++ b/build/fuchsia/linux_internal.sdk.sha1
@@ -1 +1 @@ -8.20220614.1.1 +8.20220614.3.1
diff --git a/cc/tiles/image_controller_unittest.cc b/cc/tiles/image_controller_unittest.cc index 0eca1db..6b75dae 100644 --- a/cc/tiles/image_controller_unittest.cc +++ b/cc/tiles/image_controller_unittest.cc
@@ -11,12 +11,11 @@ #include "base/callback_helpers.h" #include "base/run_loop.h" #include "base/synchronization/condition_variable.h" -#include "base/task/thread_pool.h" +#include "base/test/test_simple_task_runner.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/threading/simple_thread.h" #include "base/threading/thread_checker_impl.h" #include "cc/paint/paint_image_builder.h" -#include "cc/test/cc_test_suite.h" #include "cc/test/skia_common.h" #include "cc/test/stub_decode_cache.h" #include "cc/test/test_paint_worklet_input.h" @@ -27,6 +26,78 @@ namespace cc { namespace { +class TestWorkerThread : public base::SimpleThread { + public: + TestWorkerThread() + : base::SimpleThread("test_worker_thread"), condition_(&lock_) {} + + void Run() override { + for (;;) { + base::OnceClosure task; + { + base::AutoLock hold(lock_); + if (shutdown_) + break; + + if (queue_.empty()) { + condition_.Wait(); + continue; + } + + task = std::move(queue_.front()); + queue_.erase(queue_.begin()); + } + std::move(task).Run(); + } + } + + void Shutdown() { + base::AutoLock hold(lock_); + shutdown_ = true; + condition_.Signal(); + } + + void PostTask(base::OnceClosure task) { + base::AutoLock hold(lock_); + queue_.push_back(std::move(task)); + condition_.Signal(); + } + + private: + base::Lock lock_; + base::ConditionVariable condition_; + std::vector<base::OnceClosure> queue_; + bool shutdown_ = false; +}; + +class WorkerTaskRunner : public base::SequencedTaskRunner { + public: + WorkerTaskRunner() { thread_.Start(); } + + bool PostNonNestableDelayedTask(const base::Location& from_here, + base::OnceClosure task, + base::TimeDelta delay) override { + return PostDelayedTask(from_here, std::move(task), delay); + } + + bool PostDelayedTask(const base::Location& from_here, + base::OnceClosure task, + base::TimeDelta delay) override { + thread_.PostTask(std::move(task)); + return true; + } + + bool RunsTasksInCurrentSequence() const override { return false; } + + protected: + ~WorkerTaskRunner() override { + thread_.Shutdown(); + thread_.Join(); + } + + TestWorkerThread thread_; +}; + // Image decode cache with introspection! class TestableCache : public StubDecodeCache { public: @@ -192,16 +263,16 @@ ~ImageControllerTest() override = default; void SetUp() override { - controller_ = std::make_unique<ImageController>( - task_runner_, - base::ThreadPool::CreateSequencedTaskRunner(base::TaskTraits())); + worker_task_runner_ = base::MakeRefCounted<WorkerTaskRunner>(); + controller_ = std::make_unique<ImageController>(task_runner_.get(), + worker_task_runner_); cache_ = TestableCache(); controller_->SetImageDecodeCache(&cache_); } void TearDown() override { controller_.reset(); - CCTestSuite::RunUntilIdle(); + worker_task_runner_ = nullptr; weak_ptr_factory_.InvalidateWeakPtrs(); } @@ -248,6 +319,7 @@ private: scoped_refptr<base::SequencedTaskRunner> task_runner_; + scoped_refptr<WorkerTaskRunner> worker_task_runner_; TestableCache cache_; std::unique_ptr<ImageController> controller_; DrawImage image_;
diff --git a/chrome/VERSION b/chrome/VERSION index 38a23c5..1196aaba 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=105 MINOR=0 -BUILD=5121 +BUILD=5122 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 6f8ab04..102e5dc 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -1312,6 +1312,7 @@ resources_package = "org.chromium.chrome.test" sources = [ "javatests/src/org/chromium/chrome/browser/IntentFilterUnitTest.java", + "javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRowTest.java", "javatests/src/org/chromium/chrome/browser/bookmarks/PowerBookmarkShoppingItemRowTest.java", "javatests/src/org/chromium/chrome/browser/bookmarks/PowerBookmarkUtilsTest.java", "javatests/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulatorTest.java", @@ -1350,9 +1351,11 @@ "//components/browser_ui/notifications/android:java", "//components/browser_ui/settings/android:java", "//components/browser_ui/styles/android:java", + "//components/browser_ui/widget/android:java", "//components/embedder_support/android:context_menu_java", "//components/embedder_support/android:util_java", "//components/externalauth/android:java", + "//components/favicon/android:java", "//components/image_fetcher:java", "//components/offline_items_collection/core:core_java", "//components/payments/content/android:full_java", @@ -1377,6 +1380,7 @@ "//ui/android:ui_java_test_support", "//url:gurl_java", "//url:gurl_java_unit_tests", + "//url:gurl_junit_test_support", ] } @@ -1458,7 +1462,6 @@ "//chrome/browser/language/android:java", "//chrome/browser/language/android:javatests", "//chrome/browser/lens:java", - "//chrome/browser/loading_modal/android:javatests", "//chrome/browser/locale:java", "//chrome/browser/notifications:java", "//chrome/browser/notifications:javatests", @@ -1570,7 +1573,6 @@ "//components/browser_ui/styles/android:java", "//components/browser_ui/util/android:java", "//components/browser_ui/widget/android:java", - "//components/browser_ui/widget/android:javatests", "//components/browser_ui/widget/android:test_support_java", "//components/commerce/core:proto_java", "//components/commerce/core/android:core_java", @@ -3152,12 +3154,15 @@ deps = [ ":chrome_unit_test_java", "//build/config/android/test/resource_overlay:javatests", + "//chrome/android/features/tab_ui:unit_device_javatests", "//chrome/browser/back_press/android:javatests", + "//chrome/browser/loading_modal/android:unit_device_javatests", "//chrome/browser/partnercustomizations:javatests", "//chrome/browser/ui/android/appmenu/internal:unit_device_javatests", "//chrome/browser/ui/messages/android:unit_device_javatests", "//chrome/browser/user_education:javatests", "//chrome/browser/video_tutorials/internal:javatests", + "//components/browser_ui/widget/android:unit_device_javatests", "//components/paint_preview/player/android:javatests", "//components/signin/public/android:javatests", ]
diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni index 13e26c88..d31de985 100644 --- a/chrome/android/chrome_test_java_sources.gni +++ b/chrome/android/chrome_test_java_sources.gni
@@ -326,15 +326,11 @@ "javatests/src/org/chromium/chrome/browser/omnibox/status/StatusViewRenderTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/status/StatusViewTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediatorUnitTest.java", - "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java", - "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilderUnitTest.java", - "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManagerUnitTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalsRenderTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalsTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/SwitchToTabTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessorUnitTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionProcessorTest.java", - "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/clipboard/ClipboardSuggestionProcessorTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/editurl/EditUrlSuggestionUnitTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/entity/EntitySuggestionProcessorUnitTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesTest.java",
diff --git a/chrome/android/features/start_surface/BUILD.gn b/chrome/android/features/start_surface/BUILD.gn index 50a4f040..1b5a605b 100644 --- a/chrome/android/features/start_surface/BUILD.gn +++ b/chrome/android/features/start_surface/BUILD.gn
@@ -59,7 +59,6 @@ "//components/prefs/android:java", "//components/user_prefs/android:java", "//third_party/androidx:androidx_annotation_annotation_java", - "//third_party/metrics_proto:metrics_proto_java", "//ui/android:ui_no_recycler_view_java", "//url:gurl_java", ]
diff --git a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceConfiguration.java b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceConfiguration.java index affc7b67..758c71c 100644 --- a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceConfiguration.java +++ b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceConfiguration.java
@@ -21,7 +21,6 @@ import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.components.metrics.OmniboxEventProtos.OmniboxEventProto.PageClassification; /** * Flag configuration for Start Surface. Source of truth for whether it should be enabled and @@ -50,16 +49,6 @@ new BooleanCachedFieldTrialParameter( ChromeFeatureList.START_SURFACE_ANDROID, "open_ntp_instead_of_start", false); - private static final String OMNIBOX_FOCUSED_ON_NEW_TAB_PARAM = "omnibox_focused_on_new_tab"; - public static final BooleanCachedFieldTrialParameter OMNIBOX_FOCUSED_ON_NEW_TAB = - new BooleanCachedFieldTrialParameter(ChromeFeatureList.START_SURFACE_ANDROID, - OMNIBOX_FOCUSED_ON_NEW_TAB_PARAM, false); - - private static final String SHOW_NTP_TILES_ON_OMNIBOX_PARAM = "show_ntp_tiles_on_omnibox"; - public static final BooleanCachedFieldTrialParameter SHOW_NTP_TILES_ON_OMNIBOX = - new BooleanCachedFieldTrialParameter(ChromeFeatureList.START_SURFACE_ANDROID, - SHOW_NTP_TILES_ON_OMNIBOX_PARAM, false); - private static final String HOME_BUTTON_ON_GRID_TAB_SWITCHER_PARAM = "home_button_on_grid_tab_switcher"; public static final BooleanCachedFieldTrialParameter HOME_BUTTON_ON_GRID_TAB_SWITCHER = @@ -72,11 +61,6 @@ new BooleanCachedFieldTrialParameter(ChromeFeatureList.START_SURFACE_ANDROID, TAB_COUNT_BUTTON_ON_START_SURFACE_PARAM, false); - private static final String NEW_SURFACE_PARAM = "new_home_surface_from_home_button"; - public static final StringCachedFieldTrialParameter NEW_SURFACE_FROM_HOME_BUTTON = - new StringCachedFieldTrialParameter( - ChromeFeatureList.START_SURFACE_ANDROID, NEW_SURFACE_PARAM, ""); - private static final String SHOW_TABS_IN_MRU_ORDER_PARAM = "show_tabs_in_mru_order"; public static final BooleanCachedFieldTrialParameter SHOW_TABS_IN_MRU_ORDER = new BooleanCachedFieldTrialParameter( @@ -181,28 +165,6 @@ } /** - * @return the PageClassification type of the fake Omnibox on the Start surface homepage. - */ - public static int getPageClassificationForHomepage() { - // When NEW_SURFACE_FROM_HOME_BUTTON equals "hide_mv_tiles_and_tab_switcher", the MV (NTP) - // tiles are removed from the Start surface homepage when tapping the home button. Thus, we - // have to show MV (NTP) tiles when the fake omnibox get focusing, and there is no need to - // check SHOW_NTP_TILES_ON_OMNIBOX anymore. - return TextUtils.equals( - NEW_SURFACE_FROM_HOME_BUTTON.getValue(), "hide_mv_tiles_and_tab_switcher") - ? PageClassification.START_SURFACE_HOMEPAGE_VALUE - : PageClassification.NTP_VALUE; - } - - /** - * @return the PageClassification type of the new Tab. - */ - public static int getPageClassificationForNewTab() { - return SHOW_NTP_TILES_ON_OMNIBOX.getValue() ? PageClassification.START_SURFACE_NEW_TAB_VALUE - : PageClassification.NTP_VALUE; - } - - /** * Records histograms of showing the StartSurface. Nothing will be recorded if timeDurationMs * isn't valid. */
diff --git a/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/InstantStartNewTabFromLauncherTest.java b/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/InstantStartNewTabFromLauncherTest.java index 876c3c6..d6521ff 100644 --- a/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/InstantStartNewTabFromLauncherTest.java +++ b/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/InstantStartNewTabFromLauncherTest.java
@@ -4,18 +4,9 @@ package org.chromium.chrome.features.start_surface; -import static androidx.test.espresso.matcher.ViewMatchers.withId; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - import static org.chromium.chrome.features.start_surface.StartSurfaceTestUtils.INSTANT_START_TEST_BASE_PARAMS; -import static org.chromium.ui.test.util.ViewUtils.waitForView; import android.content.Intent; -import android.text.TextUtils; -import android.view.View; -import android.widget.TextView; import androidx.test.filters.MediumTest; @@ -27,9 +18,7 @@ import org.chromium.base.ContextUtils; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.Restriction; -import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.flags.CachedFeatureFlags; @@ -39,13 +28,11 @@ import org.chromium.chrome.browser.layouts.LayoutType; import org.chromium.chrome.browser.tasks.pseudotab.TabAttributeCache; import org.chromium.chrome.browser.tasks.tab_management.TabUiTestHelper; -import org.chromium.chrome.browser.toolbar.ToolbarDataProvider; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.util.ActivityTestUtils; import org.chromium.chrome.test.util.browser.Features.DisableFeatures; import org.chromium.chrome.test.util.browser.Features.EnableFeatures; -import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.components.embedder_support.util.UrlUtilities; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.ui.test.util.UiRestriction; @@ -67,8 +54,6 @@ UiRestriction.RESTRICTION_TYPE_PHONE}) public class InstantStartNewTabFromLauncherTest { // clang-format on - private static final long MAX_TIMEOUT_MS = 30000L; - @Rule public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); @@ -82,7 +67,7 @@ @Test @MediumTest @CommandLineFlags.Add({INSTANT_START_TEST_BASE_PARAMS}) - public void testNewTabFromLauncherWithHomepageDisabled_NoFinale() throws IOException { + public void testNewTabFromLauncherWithHomepageDisabled() throws IOException { Assert.assertTrue(CachedFeatureFlags.isEnabled(ChromeFeatureList.INSTANT_START)); testNewTabFromLauncherWithHomepageDisabledImpl(); } @@ -91,7 +76,7 @@ @MediumTest @DisableFeatures(ChromeFeatureList.INSTANT_START) @CommandLineFlags.Add({INSTANT_START_TEST_BASE_PARAMS}) - public void testNewTabFromLauncherWithHomepageDisabled_NoFinale_NoInstant() throws IOException { + public void testNewTabFromLauncherWithHomepageDisabled_NoInstant() throws IOException { Assert.assertFalse(CachedFeatureFlags.isEnabled(ChromeFeatureList.INSTANT_START)); testNewTabFromLauncherWithHomepageDisabledImpl(); } @@ -112,33 +97,6 @@ testNewIncognitoTabFromLauncherImpl(); } - private void testNewTabFromLauncherImpl() throws IOException { - StartSurfaceTestUtils.createTabStateFile(new int[] {0}); - StartSurfaceTestUtils.createThumbnailBitmapAndWriteToFile(0); - TabAttributeCache.setTitleForTesting(0, "Google"); - - startNewTabFromLauncherIcon(false); - ChromeTabbedActivity cta = mActivityTestRule.getActivity(); - StartSurfaceTestUtils.waitForTabModel(cta); - TabUiTestHelper.verifyTabModelTabCount(cta, 2, 0); - - waitForView(withId(R.id.search_box_text)); - TextView urlBar = cta.findViewById(R.id.url_bar); - CriteriaHelper.pollUiThread( - () - -> StartSurfaceTestUtils.isKeyboardShown(mActivityTestRule) - && urlBar.isFocused(), - MAX_TIMEOUT_MS, CriteriaHelper.DEFAULT_POLLING_INTERVAL); - waitForView(withId(R.id.voice_search_button)); - Assert.assertTrue(TextUtils.isEmpty(urlBar.getText())); - assertEquals(cta.findViewById(R.id.toolbar_buttons).getVisibility(), View.INVISIBLE); - ToolbarDataProvider toolbarDataProvider = - cta.getToolbarManager().getLocationBarModelForTesting(); - TestThreadUtils.runOnUiThreadBlocking(() -> { - assertTrue(TextUtils.equals(toolbarDataProvider.getCurrentUrl(), UrlConstants.NTP_URL)); - }); - } - private void testNewIncognitoTabFromLauncherImpl() throws IOException { StartSurfaceTestUtils.createTabStateFile(new int[] {0}); StartSurfaceTestUtils.createThumbnailBitmapAndWriteToFile(0);
diff --git a/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTabSwitcherTest.java b/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTabSwitcherTest.java index be307697..84815ba 100644 --- a/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTabSwitcherTest.java +++ b/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTabSwitcherTest.java
@@ -72,7 +72,6 @@ import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.tabmodel.TabModelFilter; import org.chromium.chrome.browser.tasks.ReturnToChromeUtil; -import org.chromium.chrome.browser.tasks.pseudotab.PseudoTab; import org.chromium.chrome.browser.tasks.pseudotab.TabAttributeCache; import org.chromium.chrome.browser.tasks.tab_management.TabUiFeatureUtilities; import org.chromium.chrome.browser.tasks.tab_management.TabUiTestHelper; @@ -84,7 +83,6 @@ import org.chromium.chrome.test.util.browser.Features.EnableFeatures; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.ui.test.util.UiRestriction; -import org.chromium.ui.test.util.ViewUtils; import java.io.IOException; import java.util.Arrays; @@ -387,27 +385,6 @@ // clang-format off @CommandLineFlags.Add({ChromeSwitches.DISABLE_NATIVE_INITIALIZATION, INSTANT_START_TEST_BASE_PARAMS}) - public void doNotRestoreEmptyTabs() throws IOException { - // clang-format on - StartSurfaceTestUtils.createTabStateFile( - new int[] {0, 1}, new String[] {"", "about:blank"}); - StartSurfaceTestUtils.createThumbnailBitmapAndWriteToFile(0); - StartSurfaceTestUtils.createThumbnailBitmapAndWriteToFile(1); - TabAttributeCache.setTitleForTesting(0, ""); - TabAttributeCache.setTitleForTesting(0, "Google"); - - StartSurfaceTestUtils.startMainActivityFromLauncher(mActivityTestRule); - StartSurfaceTestUtils.waitForOverviewVisible(mActivityTestRule.getActivity()); - ViewUtils.onViewWaiting(withId(org.chromium.chrome.test.R.id.tab_list_view)); - Assert.assertEquals( - 1, PseudoTab.getAllPseudoTabsFromStateFile(mActivityTestRule.getActivity()).size()); - } - - @Test - @MediumTest - // clang-format off - @CommandLineFlags.Add({ChromeSwitches.DISABLE_NATIVE_INITIALIZATION, - INSTANT_START_TEST_BASE_PARAMS}) public void testSingleAsHomepage_Landscape_TabSize() { // clang-format on StartSurfaceTestUtils.startMainActivityFromLauncher(mActivityTestRule);
diff --git a/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java b/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java index 2c62f8a..adafac3 100644 --- a/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java +++ b/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java
@@ -412,7 +412,7 @@ @Test @MediumTest @Feature({"StartSurface"}) - @CommandLineFlags.Add({START_SURFACE_TEST_BASE_PARAMS + "/omnibox_focused_on_new_tab/false"}) + @CommandLineFlags.Add({START_SURFACE_TEST_BASE_PARAMS}) public void testSearchInSingleSurface() { if (!mImmediateReturn) { StartSurfaceTestUtils.pressHomePageButton(mActivityTestRule.getActivity());
diff --git a/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTestUtils.java b/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTestUtils.java index c7386047..c001b24 100644 --- a/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTestUtils.java +++ b/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTestUtils.java
@@ -226,16 +226,6 @@ * Create all the files so that tab models can be restored. * @param tabIds all the Tab IDs in the normal tab model. * @param urls all of the URLs in the normal tab model. - */ - public static void createTabStateFile(int[] tabIds, @Nullable String[] urls) - throws IOException { - createTabStateFile(tabIds, urls, 0); - } - - /** - * Create all the files so that tab models can be restored. - * @param tabIds all the Tab IDs in the normal tab model. - * @param urls all of the URLs in the normal tab model. * @param selectedIndex the selected index of normal tab model. */ public static void createTabStateFile(int[] tabIds, @Nullable String[] urls, int selectedIndex)
diff --git a/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/TabSwitcherAndStartSurfaceLayoutTest.java b/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/TabSwitcherAndStartSurfaceLayoutTest.java index 751478d..532afe8337 100644 --- a/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/TabSwitcherAndStartSurfaceLayoutTest.java +++ b/chrome/android/features/start_surface/javatests/src/org/chromium/chrome/features/start_surface/TabSwitcherAndStartSurfaceLayoutTest.java
@@ -237,9 +237,9 @@ @Feature({"RenderTest"}) // clang-format off @EnableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study"}) + @DisableAnimationsTestRule.EnsureAnimationsOn @CommandLineFlags.Add({BASE_PARAMS}) - @DisableIf.Build(message = "Flaky on emulators; see https://crbug.com/1313747", - supported_abis_includes = "x86") + @DisabledTest(message = "https://crbug.com/1300962") public void testRenderGrid_3WebTabs() throws IOException { // clang-format on ChromeTabbedActivity cta = mActivityTestRule.getActivity(); @@ -258,9 +258,9 @@ @Feature({"RenderTest"}) // clang-format off @CommandLineFlags.Add({BASE_PARAMS}) + @DisableAnimationsTestRule.EnsureAnimationsOn @EnableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study"}) @DisabledTest(message = "https://crbug.com/1300962") - @DisableIf.Build(sdk_is_greater_than = O_MR1, message = "crbug.com/1077552") public void testRenderGrid_10WebTabs() throws IOException { // clang-format on ChromeTabbedActivity cta = mActivityTestRule.getActivity(); @@ -1017,6 +1017,7 @@ // clang-format on ChromeTabbedActivity cta = mActivityTestRule.getActivity(); prepareTabs(3, 0, null); + View parentView = cta.getCompositorViewHolderForTesting(); CriteriaHelper.pollUiThread(TabSuggestionMessageService::isSuggestionAvailableForTesting); CriteriaHelper.pollUiThread( @@ -1027,13 +1028,19 @@ // Force portrait mode since the device can be wrongly in landscape. See crbug/1063639. ActivityTestUtils.rotateActivityToOrientation(cta, Configuration.ORIENTATION_PORTRAIT); + CriteriaHelper.pollUiThread(() -> parentView.getHeight() > parentView.getWidth()); + // Ensure the message card is visible so we can get its view holder. onView(tabSwitcherViewMatcher()) + .perform(RecyclerViewActions.scrollToPosition(3)) .check(MessageCardWidthAssertion.checkMessageItemSpanSize(3, 2)); ActivityTestUtils.rotateActivityToOrientation(cta, Configuration.ORIENTATION_LANDSCAPE); + CriteriaHelper.pollUiThread(() -> parentView.getHeight() < parentView.getWidth()); + // Ensure the message card is visible so we can get its view holder. onView(tabSwitcherViewMatcher()) + .perform(RecyclerViewActions.scrollToPosition(3)) .check(MessageCardWidthAssertion.checkMessageItemSpanSize(3, 3)); }
diff --git a/chrome/android/features/tab_ui/BUILD.gn b/chrome/android/features/tab_ui/BUILD.gn index 50b3d8c4..b429175 100644 --- a/chrome/android/features/tab_ui/BUILD.gn +++ b/chrome/android/features/tab_ui/BUILD.gn
@@ -235,6 +235,27 @@ resources_package = "org.chromium.chrome.tab_ui" } +android_library("unit_device_javatests") { + testonly = true + sources = [ "javatests/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderTest.java" ] + + deps = [ + ":java", + ":java_resources", + "//base:base_java_test_support", + "//chrome/android/features/tab_ui:java", + "//chrome/browser/tab:java", + "//chrome/test/android:chrome_java_test_support_common", + "//content/public/test/android:content_java_test_support", + "//third_party/androidx:androidx_appcompat_appcompat_resources_java", + "//third_party/androidx:androidx_test_runner_java", + "//third_party/junit:junit", + "//ui/android:ui_java_test_support", + "//ui/android:ui_java_test_support", + "//ui/android:ui_no_recycler_view_java", + ] +} + module_desc_java("module_desc_java") { module_name = "tab_management" }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTab.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTab.java index 70a9739..ec6f39d 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTab.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/pseudotab/PseudoTab.java
@@ -6,7 +6,6 @@ import android.content.Context; import android.os.SystemClock; -import android.text.TextUtils; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -369,9 +368,6 @@ // Skip restoring of non-selected NTP to match the real restoration logic. if (UrlUtilities.isCanonicalizedNTPUrl(url) && !isStandardActiveIndex) { return; - } else if (TextUtils.isEmpty(url)) { - // Skip restoring of empty Tabs. - return; } PseudoTab tab = PseudoTab.fromTabId(id); if (isStandardActiveIndex) {
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java index f70fc5f..69d7e918 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java
@@ -934,7 +934,6 @@ @MediumTest @Features.EnableFeatures({ChromeFeatureList.START_SURFACE_ANDROID + "<Study"}) @CommandLineFlags.Add({"force-fieldtrials=Study/Group", START_SURFACE_BASE_PARAMS + "/single"}) - @DisabledTest(message = "crbug.com/1119899, crbug.com/1131545") public void testUndoClosureInDialog_WithStartSurface() throws Exception { // Create a tab group with 2 tabs. finishActivity(mActivityTestRule.getActivity()); @@ -1086,7 +1085,8 @@ private boolean isDialogShowing(ChromeTabbedActivity cta) { View dialogView = cta.findViewById(R.id.dialog_parent_view); - return dialogView.getVisibility() == View.VISIBLE && dialogView.getAlpha() == 1f; + View dialogContainerView = cta.findViewById(R.id.dialog_container_view); + return dialogView.getVisibility() == View.VISIBLE && dialogContainerView.getAlpha() == 1f; } private boolean isDialogHiding(ChromeTabbedActivity cta) {
diff --git a/chrome/android/features/tab_ui/tab_management_java_sources.gni b/chrome/android/features/tab_ui/tab_management_java_sources.gni index 70e7efc5..8d5046a 100644 --- a/chrome/android/features/tab_ui/tab_management_java_sources.gni +++ b/chrome/android/features/tab_ui/tab_management_java_sources.gni
@@ -28,7 +28,6 @@ tab_management_test_java_sources = [ "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/AssertsTest.java", "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/CloseAllTabsDialogTest.java", - "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/LargeMessageCardViewBinderTest.java", "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardProviderTest.java", "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/MessageCardViewBinderTest.java", "//chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/PriceAlertsMessageCardTest.java",
diff --git a/chrome/android/java/res/layout/bookmark_item_row.xml b/chrome/android/java/res/layout/bookmark_item_row.xml index 73f517e..c34471a 100644 --- a/chrome/android/java/res/layout/bookmark_item_row.xml +++ b/chrome/android/java/res/layout/bookmark_item_row.xml
@@ -7,5 +7,6 @@ <view class="org.chromium.chrome.browser.bookmarks.BookmarkItemRow" xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/bookmark_item_row" android:layout_width="match_parent" android:layout_height="wrap_content" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index ca7ad4b..948af94c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -190,7 +190,6 @@ import org.chromium.chrome.browser.util.ChromeAccessibilityUtil; import org.chromium.chrome.browser.vr.VrModuleProvider; import org.chromium.chrome.features.start_surface.StartSurface; -import org.chromium.chrome.features.start_surface.StartSurfaceConfiguration; import org.chromium.chrome.features.start_surface.StartSurfaceDelegate; import org.chromium.chrome.features.start_surface.StartSurfaceState; import org.chromium.chrome.features.start_surface.StartSurfaceUserData; @@ -2502,9 +2501,7 @@ } /** - * @return Whether opening a new tab is handled by the Start surface. It may show the Start - * surface, or open a new tab with the omnibox get focused, depending on the value of - * {@link StartSurfaceConfiguration.OMNIBOX_FOCUSED_ON_NEW_TAB}. + * @return Whether opening a new tab is handled by the Start surface. */ private boolean showStartSurfaceHomeForNTP(boolean isNTP, boolean incognito, Tab parentTab, @NewTabPageLaunchOrigin int launchOrigin) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java index 34aae3a..fc385f1f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java
@@ -51,7 +51,6 @@ import org.chromium.chrome.browser.tab.TabLaunchType; import org.chromium.chrome.browser.translate.TranslateIntentHandler; import org.chromium.chrome.browser.webapps.WebappActivity; -import org.chromium.chrome.features.start_surface.StartSurfaceConfiguration; import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.components.embedder_support.util.UrlUtilities; import org.chromium.components.external_intents.ExternalNavigationHandler; @@ -1079,44 +1078,6 @@ != 0; } - /** - * @return Whether the {@link Intent} will open a new tab with the omnibox focused. - */ - public static boolean shouldIntentShowNewTabOmniboxFocused(Intent intent) { - final String intentUrl = IntentHandler.getUrlFromIntent(intent); - // If Chrome is launched by tapping the New tab item from the launch icon and - // OMNIBOX_FOCUSED_ON_NEW_TAB is enabled, a new Tab with omnibox focused will be shown on - // Startup. - final boolean isCanonicalizedNTPUrl = UrlUtilities.isCanonicalizedNTPUrl(intentUrl); - - final boolean isFromShortcutOrWidget = IntentHandler.isTabOpenAsNewTabFromLauncher(intent) - || IntentHandler.isTabOpenAsNewTabFromAppWidget(intent); - - return isCanonicalizedNTPUrl && isFromShortcutOrWidget - && StartSurfaceConfiguration.OMNIBOX_FOCUSED_ON_NEW_TAB.getValue() - && IntentHandler.wasIntentSenderChrome(intent); - } - - /** - * @param intent The {@link Intent} to extract the info from. - * @return Whether the Intent specifies to create a new Tab from the launcher shortcut. - */ - public static boolean isTabOpenAsNewTabFromLauncher(Intent intent) { - return IntentUtils.safeGetBooleanExtra(intent, Browser.EXTRA_CREATE_NEW_TAB, false) - && IntentUtils.safeGetBooleanExtra( - intent, IntentHandler.EXTRA_INVOKED_FROM_SHORTCUT, false); - } - - /** - * @param intent The {@link Intent} to extract the info from. - * @return Whether the Intent specifies to create a new Tab from an app widget. - */ - public static boolean isTabOpenAsNewTabFromAppWidget(Intent intent) { - return IntentUtils.safeGetBooleanExtra(intent, Browser.EXTRA_CREATE_NEW_TAB, false) - && IntentUtils.safeGetBooleanExtra( - intent, IntentHandler.EXTRA_INVOKED_FROM_APP_WIDGET, false); - } - /* * The default behavior here is to open in a new tab. If this is changed, ensure * intents with action NDEF_DISCOVERED (links beamed over NFC) are handled properly.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java b/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java index ee1e395..2e976d2a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
@@ -141,11 +141,8 @@ add(StartSurfaceConfiguration.HIDE_START_WHEN_LAST_VISITED_TAB_IS_SRP); add(StartSurfaceConfiguration.HOME_BUTTON_ON_GRID_TAB_SWITCHER); add(StartSurfaceConfiguration.IS_DOODLE_SUPPORTED); - add(StartSurfaceConfiguration.NEW_SURFACE_FROM_HOME_BUTTON); add(StartSurfaceConfiguration.NUM_DAYS_KEEP_SHOW_START_AT_STARTUP); add(StartSurfaceConfiguration.NUM_DAYS_USER_CLICK_BELOW_THRESHOLD); - add(StartSurfaceConfiguration.OMNIBOX_FOCUSED_ON_NEW_TAB); - add(StartSurfaceConfiguration.SHOW_NTP_TILES_ON_OMNIBOX); add(StartSurfaceConfiguration.SHOW_TABS_IN_MRU_ORDER); add(StartSurfaceConfiguration.SIGNIN_PROMO_NTP_COUNT_LIMIT); add(StartSurfaceConfiguration
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java index dce2aaa4..f17274c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java
@@ -103,4 +103,8 @@ protected boolean getFaviconCancelledForTesting() { return mFaviconCancelled; } + + void setRoundedIconGeneratorForTesting(RoundedIconGenerator roundedIconGenerator) { + mIconGenerator = roundedIconGenerator; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java index 5bee253..f378393 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
@@ -744,8 +744,6 @@ String message; boolean doLiteralSearch = false; if (resolvedSearchTerm.isNetworkUnavailable()) { - // TODO(donnd): double-check that the network is really unavailable, maybe using - // NetworkChangeNotifier#isOnline. message = mActivity.getResources().getString( R.string.contextual_search_network_unavailable); } else if (!isHttpFailureCode(resolvedSearchTerm.responseCode()) @@ -905,17 +903,9 @@ } /** - * External entry point to determine if the device is currently online or not. - * Stubbed out when under test. * @return Whether the device is currently online. */ boolean isDeviceOnline() { - return mNetworkCommunicator.isOnline(); - } - - /** Handles this {@link ContextualSearchNetworkCommunicator} vector when not under test. */ - @Override - public boolean isOnline() { return NetworkChangeNotifier.isOnline(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchNetworkCommunicator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchNetworkCommunicator.java index 14d47fc..7fc7f9e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchNetworkCommunicator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchNetworkCommunicator.java
@@ -33,11 +33,6 @@ void handleSearchTermResolutionResponse(ResolvedSearchTerm resolvedSearchTerm); /** - * @return Whether the device is currently online. - */ - boolean isOnline(); - - /** * Stops any navigation in the overlay panel's {@code WebContents}. */ void stopPanelContentsNavigation();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java index 67ff4da3..fe86284 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
@@ -793,11 +793,6 @@ RecordHistogram.recordEnumeratedHistogram("Tabs.TabRestoreMethod", TabRestoreMethod.SKIPPED_NTP, TabRestoreMethod.NUM_ENTRIES); return; - } else if (TextUtils.isEmpty(tabToRestore.url)) { - Log.i(TAG, "Skipping restore of empty Tabs."); - RecordHistogram.recordEnumeratedHistogram("Tabs.TabRestoreMethod", - TabRestoreMethod.SKIPPED_EMPTY_URL, TabRestoreMethod.NUM_ENTRIES); - return; } Log.w(TAG, "Failed to restore TabState; creating Tab with last known URL.");
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java b/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java index 828af9d..b6c4eb96 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tasks/ReturnToChromeUtil.java
@@ -465,10 +465,6 @@ public static boolean shouldShowOverviewPageOnStart(Context context, Intent intent, TabModelSelector tabModelSelector, ChromeInactivityTracker inactivityTracker) { String intentUrl = IntentHandler.getUrlFromIntent(intent); - // If Chrome is launched by tapping the New Tab Item from the launch icon and - // {@link OMNIBOX_FOCUSED_ON_NEW_TAB} is enabled, a new Tab with omnibox focused will be - // shown on Startup. - if (IntentHandler.shouldIntentShowNewTabOmniboxFocused(intent)) return false; // If user launches Chrome by tapping the app icon, the intentUrl is NULL; // If user taps the "New Tab" item from the app icon, the intentUrl will be chrome://newtab,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java index 1e50a08..c92d841 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java
@@ -670,7 +670,7 @@ refreshSelectedTab(tab); onTabOrModelChanged(); - maybeTriggerCacheRefreshForZeroSuggest(tab, tab.getUrl()); + maybeTriggerCacheRefreshForZeroSuggest(tab.getUrl()); } @Override @@ -678,7 +678,7 @@ // Part of scroll jank investigation http://crbug.com/1311003. Will remove // TraceEvent after the investigation is complete. try (TraceEvent te = TraceEvent.scoped("ToolbarManager::onPageLoadFinished")) { - maybeTriggerCacheRefreshForZeroSuggest(tab, url); + maybeTriggerCacheRefreshForZeroSuggest(url); } } @@ -687,7 +687,7 @@ * Avoid issuing multiple concurrent server requests for the same event to * reduce server pressure. */ - private void maybeTriggerCacheRefreshForZeroSuggest(Tab tab, GURL url) { + private void maybeTriggerCacheRefreshForZeroSuggest(GURL url) { if (url != null && UrlUtilities.isNTPUrl(url)) { mLocationBarModel.notifyZeroSuggestRefresh(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/AppLaunchDrawBlocker.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/AppLaunchDrawBlocker.java index 7ab58042..a1f6b14 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/AppLaunchDrawBlocker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/AppLaunchDrawBlocker.java
@@ -190,7 +190,6 @@ tabState, HomepageManager.isHomepageNonNtpPreNative(), singleUrlBarMode); if (shouldBlockDrawForNtpOnColdStartWithIntent(hasValidIntentUrl, isNtpUrl, - IntentHandler.shouldIntentShowNewTabOmniboxFocused(mIntentSupplier.get()), IncognitoTabLauncher.didCreateIntent(mIntentSupplier.get()), shouldBlockWithoutIntent)) { mTimeStartedBlockingDrawForInitialTab = SystemClock.elapsedRealtime(); @@ -218,21 +217,16 @@ /** * @param hasValidIntentUrl Whether there is an intent that isn't ignored with a non-empty Url. * @param isNtpUrl Whether the intent has NTP Url. - * @param shouldShowNewTabOmniboxFocused Whether the intent will open a new tab with omnibox - * focused. * @param shouldLaunchIncognitoTab Whether the intent is launching an incognito tab. * @param shouldBlockDrawForNtpOnColdStartWithoutIntent Result of * {@link #shouldBlockDrawForNtpOnColdStartWithoutIntent}. * @return Whether the View draw should be blocked because the NTP will be shown on cold start. */ private boolean shouldBlockDrawForNtpOnColdStartWithIntent(boolean hasValidIntentUrl, - boolean isNtpUrl, boolean shouldShowNewTabOmniboxFocused, - boolean shouldLaunchIncognitoTab, + boolean isNtpUrl, boolean shouldLaunchIncognitoTab, boolean shouldBlockDrawForNtpOnColdStartWithoutIntent) { if (hasValidIntentUrl && isNtpUrl) { - // TODO(crbug.com/1199374): We should find another solution for focusing on new tab - // rather than special casing it here. - return !shouldShowNewTabOmniboxFocused && !shouldLaunchIncognitoTab; + return !shouldLaunchIncognitoTab; } else if (hasValidIntentUrl && !isNtpUrl) { return false; } else { @@ -250,8 +244,6 @@ */ private void recordBlockDrawForInitialTabHistograms( boolean isTabRegularNtp, boolean isOverviewShownWithoutInstantStart) { - boolean focusedOmnibox = - IntentHandler.shouldIntentShowNewTabOmniboxFocused(mIntentSupplier.get()); long durationDrawBlocked = SystemClock.elapsedRealtime() - mTimeStartedBlockingDrawForInitialTab; @@ -266,8 +258,7 @@ @BlockDrawForInitialTabAccuracy int enumEntry; - boolean shouldBlockDraw = - (singleUrlBarNtp && !focusedOmnibox) || isOverviewShownWithoutInstantStart; + boolean shouldBlockDraw = singleUrlBarNtp || isOverviewShownWithoutInstantStart; if (mBlockDrawForInitialTab || mBlockDrawForOverviewPage) { enumEntry = shouldBlockDraw ? BlockDrawForInitialTabAccuracy.BLOCKED_CORRECTLY
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/app/appmenu/OverviewAppMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/app/appmenu/OverviewAppMenuTest.java index 6d0a65c..e65e117 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/app/appmenu/OverviewAppMenuTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/app/appmenu/OverviewAppMenuTest.java
@@ -112,24 +112,6 @@ @Features.EnableFeatures({ChromeFeatureList.TAB_GROUPS_ANDROID, ChromeFeatureList.START_SURFACE_ANDROID + "<Study"}) @CommandLineFlags.Add({"force-fieldtrials=Study/Group", - "force-fieldtrial-params=Study.Group:omnibox_focused_on_new_tab/true"}) - public void testNewTabIsEnabledWithStartSurfaceFinale() throws Exception { - // clang-format on - TestThreadUtils.runOnUiThreadBlocking(() -> { - AppMenuTestSupport.showAppMenu(mActivityTestRule.getAppMenuCoordinator(), null, false); - }); - - assertNotNull(AppMenuTestSupport.getMenuItemPropertyModel( - mActivityTestRule.getAppMenuCoordinator(), R.id.new_tab_menu_id)); - } - - @Test - @SmallTest - @Feature({"Browser", "Main"}) - // clang-format off - @Features.EnableFeatures({ChromeFeatureList.TAB_GROUPS_ANDROID, - ChromeFeatureList.START_SURFACE_ANDROID + "<Study"}) - @CommandLineFlags.Add({"force-fieldtrials=Study/Group", "force-fieldtrial-params=Study.Group:open_ntp_instead_of_start/true"}) public void testNewTabIsEnabledWithStartSurfaceV2() throws Exception { // clang-format on
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRowTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRowTest.java new file mode 100644 index 0000000..e2351b6 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRowTest.java
@@ -0,0 +1,146 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.bookmarks; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.verify; + +import android.view.ViewGroup; +import android.widget.FrameLayout; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.test.filters.SmallTest; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; + +import org.chromium.chrome.R; +import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; +import org.chromium.chrome.browser.bookmarks.BookmarkRow.Location; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.components.bookmarks.BookmarkId; +import org.chromium.components.bookmarks.BookmarkType; +import org.chromium.components.browser_ui.widget.RoundedIconGenerator; +import org.chromium.components.browser_ui.widget.dragreorder.DragStateDelegate; +import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate; +import org.chromium.components.favicon.IconType; +import org.chromium.components.favicon.LargeIconBridge; +import org.chromium.components.favicon.LargeIconBridge.LargeIconCallback; +import org.chromium.content_public.browser.test.util.TestThreadUtils; +import org.chromium.ui.test.util.BlankUiTestActivityTestCase; +import org.chromium.url.JUnitTestGURLs; + +/** + * Tests for the bookmark item row. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +public class BookmarkItemRowTest extends BlankUiTestActivityTestCase { + private static final String TITLE = "BookmarkItemRow"; + + @Mock + BookmarkModel mModel; + @Mock + BookmarkDelegate mDelegate; + @Mock + SelectionDelegate<BookmarkId> mSelectionDelegate; + @Mock + DragStateDelegate mDragStateDelegate; + @Mock + BookmarkItem mBookmarkItem; + @Mock + LargeIconBridge mLargeIconBridge; + @Mock + RoundedIconGenerator mRoundedIconGenerator; + + private BookmarkId mBookmarkId; + private BookmarkItemRow mBookmarkItemRow; + private ViewGroup mContentView; + + @Override + public void setUpTest() throws Exception { + super.setUpTest(); + MockitoAnnotations.initMocks(this); + + doAnswer((invocation) -> { + ((LargeIconCallback) invocation.getArgument(2)) + .onLargeIconAvailable(null, 0, false, IconType.FAVICON); + return null; + }) + .when(mLargeIconBridge) + .getLargeIconForUrl(any(), anyInt(), any()); + + doReturn(mModel).when(mDelegate).getModel(); + doReturn(mSelectionDelegate).when(mDelegate).getSelectionDelegate(); + doReturn(mDragStateDelegate).when(mDelegate).getDragStateDelegate(); + doReturn(mLargeIconBridge).when(mDelegate).getLargeIconBridge(); + mBookmarkId = new BookmarkId(1, BookmarkType.NORMAL); + doReturn(TITLE).when(mBookmarkItem).getTitle(); + doReturn(JUnitTestGURLs.getGURL(JUnitTestGURLs.EXAMPLE_URL)).when(mBookmarkItem).getUrl(); + doReturn(JUnitTestGURLs.EXAMPLE_URL).when(mBookmarkItem).getUrlForDisplay(); + doReturn(mBookmarkItem).when(mModel).getBookmarkById(mBookmarkId); + + TestThreadUtils.runOnUiThreadBlocking(() -> { + mContentView = new LinearLayout(getActivity()); + + FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); + + getActivity().setContentView(mContentView, params); + mBookmarkItemRow = (BookmarkItemRow) getActivity() + .getLayoutInflater() + .inflate(R.layout.bookmark_item_row, mContentView, true) + .findViewById(R.id.bookmark_item_row); + mBookmarkItemRow.setRoundedIconGeneratorForTesting(mRoundedIconGenerator); + mBookmarkItemRow.onDelegateInitialized(mDelegate); + }); + } + + @Test + @SmallTest + public void testSetBookmarkId() { + doReturn(BookmarkUIState.STATE_FOLDER).when(mDelegate).getCurrentState(); + TestThreadUtils.runOnUiThreadBlocking( + () -> { mBookmarkItemRow.setBookmarkId(mBookmarkId, Location.TOP, false); }); + + Assert.assertFalse(mBookmarkItemRow.getFaviconCancelledForTesting()); + + TextView title = mBookmarkItemRow.findViewById(R.id.title); + TextView desc = mBookmarkItemRow.findViewById(R.id.description); + Assert.assertEquals(title.getText(), TITLE); + Assert.assertEquals(desc.getText(), JUnitTestGURLs.EXAMPLE_URL); + + mBookmarkItemRow.onClick(); + verify(mDelegate).openBookmark(mBookmarkId); + } + + @Test(expected = AssertionError.class) + @SmallTest + public void testSetBookmarkId_LoadingWhileClicked() { + doReturn(BookmarkUIState.STATE_LOADING).when(mDelegate).getCurrentState(); + TestThreadUtils.runOnUiThreadBlocking( + () -> { mBookmarkItemRow.setBookmarkId(mBookmarkId, Location.TOP, false); }); + + mBookmarkItemRow.onClick(); + verify(mDelegate, Mockito.times(0)).openBookmark(mBookmarkId); + } + + @Test(expected = AssertionError.class) + @SmallTest + public void testSetBookmarkId_InvalidStateWhileClicked() { + TestThreadUtils.runOnUiThreadBlocking( + () -> { mBookmarkItemRow.setBookmarkId(mBookmarkId, Location.TOP, false); }); + + mBookmarkItemRow.onClick(); + verify(mDelegate, Mockito.times(0)).openBookmark(mBookmarkId); + } +} \ No newline at end of file
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java index a1670959..7dec640 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
@@ -37,7 +37,6 @@ import org.chromium.base.test.util.Criteria; import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.Feature; -import org.chromium.base.test.util.FlakyTest; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.R; import org.chromium.chrome.browser.compositor.bottombar.ephemeraltab.EphemeralTabCoordinator; @@ -197,13 +196,9 @@ checkOpenImageInNewTab("testImage", "/chrome/test/data/android/contextmenu/test_image.png"); } - /** - * @MediumTest - * @Feature({"Browser"}) - * @CommandLineFlags.Add(ChromeSwitches.DISABLE_DOCUMENT_MODE) - */ @Test - @FlakyTest(message = "http://crbug.com/606939") + @MediumTest + @Feature({"Browser"}) public void testLongPressOnImageLink() throws TimeoutException { checkOpenImageInNewTab( "testImageLink", "/chrome/test/data/android/contextmenu/test_image.png");
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchCriticalTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchCriticalTest.java index afd0a6c..978c8f5 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchCriticalTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchCriticalTest.java
@@ -24,7 +24,6 @@ import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction; -import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.test.ChromeJUnit4RunnerDelegate; import org.chromium.content_public.browser.WebContents; @@ -115,45 +114,6 @@ } /** - * Tests that a live request that fails (for an invalid URL) does a failover to a - * normal priority request once the user triggers the failover by opening the panel. - */ - @Test - @SmallTest - @Feature({"ContextualSearch"}) - @ParameterAnnotations.UseMethodParameter(FeatureParamProvider.class) - @DisabledTest(message = "https://crbug.com/1140413") - public void testLivePrefetchFailoverRequestMadeAfterOpen(@EnabledFeature int enabledFeature) - throws Exception { - // Test fails with out-of-process network service. crbug.com/1071721 - if (!ChromeFeatureList.isEnabled("NetworkServiceInProcess2")) return; - - mFakeServer.reset(); - mFakeServer.setLowPriorityPathInvalid(); - mFakeServer.setActuallyLoadALiveSerp(); - simulateResolveSearch("search"); - assertLoadedLowPriorityInvalidUrl(); - Assert.assertTrue(mFakeServer.didAttemptLoadInvalidUrl()); - - // we should not automatically issue a new request. - Assert.assertEquals(1, mFakeServer.getLoadedUrlCount()); - - // Fake a navigation error if offline. - // When connected to the Internet this error may already have happened due to actually - // trying to load the invalid URL. But on test bots that are not online we need to - // fake that a navigation happened with an error. See crbug.com/682953 for details. - if (!mManager.isOnline()) { - boolean isFailure = true; - fakeContentViewDidNavigate(isFailure); - } - - // Once the bar opens, we make a new request at normal priority. - expandPanelAndAssert(); - waitForNormalPriorityUrlLoaded(); - Assert.assertEquals(2, mFakeServer.getLoadedUrlCount()); - } - - /** * Tests a simple triggering gesture with disable-preload set. */ @Test
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFakeServer.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFakeServer.java index 515dc28..16f8340 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFakeServer.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFakeServer.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.contextualsearch; -import android.net.Uri; import android.support.test.InstrumentationRegistry; import androidx.annotation.Nullable; @@ -32,16 +31,12 @@ /** * Implements a fake Contextual Search server, for testing purposes. - * TODO(donnd): add more functionality to this class once the overall approach has been validated. * TODO(donnd): rename this class when we refactor and rename the interface it implements. Should * be something like ContextualSearchFakeEnvironment. */ @VisibleForTesting class ContextualSearchFakeServer implements ContextualSearchNetworkCommunicator, OverlayPanelContentFactory { - private static final String SIMPLE_SERP_URL = - "/chrome/test/data/android/contextualsearch/simple_serp.html"; - private final ContextualSearchPolicy mPolicy; private final ContextualSearchTestHost mTestHost; @@ -61,11 +56,8 @@ private String mLoadedUrl; private int mLoadedUrlCount; - private boolean mUseInvalidLowPriorityPath; - private boolean mActuallyLoadALiveSerp; private String mSearchTermRequested; - private boolean mIsOnline = true; private boolean mIsExactResolve; private ContextualSearchContext mSearchContext; @@ -426,15 +418,10 @@ @Override public void loadUrl(String url, boolean shouldLoadImmediately) { - if (mUseInvalidLowPriorityPath && isLowPriorityUrl(url)) { - url = makeInvalidUrl(url); - } mLoadedUrl = url; mLoadedUrlCount++; - String urlToLoad = mActuallyLoadALiveSerp ? url : SIMPLE_SERP_URL; - // TODO(donnd): make low priority if needed? - super.loadUrl(urlToLoad, shouldLoadImmediately); + super.loadUrl(url, shouldLoadImmediately); mContentsObserver = new ContentsObserver(getWebContents()); } @@ -443,23 +430,6 @@ // Override to prevent call to native code. mRemovedUrls.add(url); } - - /** - * Creates an invalid version of the given URL. - * @param baseUrl The URL to build upon / modify. - * @return The same URL but with an invalid path. - */ - private String makeInvalidUrl(String baseUrl) { - return Uri.parse(baseUrl).buildUpon().appendPath("invalid").build().toString(); - } - - /** - * @return Whether the given URL is a low-priority URL. - */ - private boolean isLowPriorityUrl(String url) { - // Just check if it's set up to prefetch. - return url.contains("&pf=c"); - } } //============================================================================================ @@ -523,53 +493,18 @@ } /** - * Sets whether the device is currently online or not. - */ - @VisibleForTesting - void setIsOnline(boolean isOnline) { - mIsOnline = isOnline; - } - - /** * Resets the fake server's member data. */ @VisibleForTesting void reset() { mLoadedUrl = null; mSearchTermRequested = null; - mIsOnline = true; mLoadedUrlCount = 0; - mUseInvalidLowPriorityPath = false; - mActuallyLoadALiveSerp = false; mIsExactResolve = false; mSearchContext = null; mExpectedFakeResolveSearch = null; } - /** - * Sets a flag to build low-priority paths that are invalid in order to test failover. - */ - @VisibleForTesting - void setLowPriorityPathInvalid() { - mUseInvalidLowPriorityPath = true; - } - - /** - * Sets a flag to actually load a live Search Result Page in the Panel. - */ - @VisibleForTesting - void setActuallyLoadALiveSerp() { - mActuallyLoadALiveSerp = true; - } - - /** - * @return Whether the most recent loadUrl was on an invalid path. - */ - @VisibleForTesting - boolean didAttemptLoadInvalidUrl() { - return mUseInvalidLowPriorityPath && mLoadedUrl.contains("invalid"); - } - @VisibleForTesting boolean getIsExactResolve() { return mIsExactResolve; @@ -625,11 +560,6 @@ } @Override - public boolean isOnline() { - return mIsOnline; - } - - @Override public void stopPanelContentsNavigation() { // Stub out stop() of the WebContents. // Navigation of the content in the overlay may have been faked in tests,
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java index d296c1a9..e9b3e6a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
@@ -213,45 +213,6 @@ } /** - * Tests that a live request that fails (for an invalid URL) does a failover to a - * normal priority request once the user triggers the failover by opening the panel. - */ - @Test - @SmallTest - @Feature({"ContextualSearch"}) - @ParameterAnnotations.UseMethodParameter(FeatureParamProvider.class) - @DisabledTest(message = "https://crbug.com/1140413") - public void testLivePrefetchFailoverRequestMadeAfterOpen(@EnabledFeature int enabledFeature) - throws Exception { - // Test fails with out-of-process network service. crbug.com/1071721 - if (!ChromeFeatureList.isEnabled("NetworkServiceInProcess2")) return; - - mFakeServer.reset(); - mFakeServer.setLowPriorityPathInvalid(); - mFakeServer.setActuallyLoadALiveSerp(); - simulateResolveSearch("search"); - assertLoadedLowPriorityInvalidUrl(); - Assert.assertTrue(mFakeServer.didAttemptLoadInvalidUrl()); - - // we should not automatically issue a new request. - Assert.assertEquals(1, mFakeServer.getLoadedUrlCount()); - - // Fake a navigation error if offline. - // When connected to the Internet this error may already have happened due to actually - // trying to load the invalid URL. But on test bots that are not online we need to - // fake that a navigation happened with an error. See crbug.com/682953 for details. - if (!mManager.isOnline()) { - boolean isFailure = true; - fakeContentViewDidNavigate(isFailure); - } - - // Once the bar opens, we make a new request at normal priority. - expandPanelAndAssert(); - waitForNormalPriorityUrlLoaded(); - Assert.assertEquals(2, mFakeServer.getLoadedUrlCount()); - } - - /** * Tests that long-press selects text, and a subsequent tap will unselect text. */ @Test
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSystemTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSystemTest.java index 3de909c..daed5c4 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSystemTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSystemTest.java
@@ -26,7 +26,6 @@ import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.DisableIf; import org.chromium.base.test.util.Feature; -import org.chromium.base.test.util.FlakyTest; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState; import org.chromium.chrome.browser.flags.ChromeFeatureList; @@ -104,19 +103,6 @@ }); } - /** - * Sets the online status and reloads the current Tab with our test URL. - * @param isOnline Whether to go online. - */ - private void setOnlineStatusAndReload(boolean isOnline) { - mFakeServer.setIsOnline(isOnline); - final String testUrl = mTestServer.getURL(mTestPage); - final Tab tab = sActivityTestRule.getActivity().getActivityTab(); - TestThreadUtils.runOnUiThreadBlocking(() -> tab.reload()); - // Make sure the page is fully loaded. - ChromeTabUtils.waitForTabPageLoaded(tab, testUrl); - } - //============================================================================================ // Tab Crash //============================================================================================ @@ -231,32 +217,4 @@ closeAppMenu(); } - - /** - * Tests that Contextual Search is fully disabled when offline. - */ - @Test - @ParameterAnnotations.UseMethodParameter(FeatureParamProvider.class) - @FlakyTest(message = "Disabled in 2017. https://crbug.com/761946") - // @SmallTest - // @Feature({"ContextualSearch"}) - // // NOTE: Remove the flag so we will run just this test with onLine detection enabled. - // @CommandLineFlags.Remove(ContextualSearchFieldTrial.ONLINE_DETECTION_DISABLED) - public void testNetworkDisconnectedDeactivatesSearch(@EnabledFeature int enabledFeature) - throws Exception { - setOnlineStatusAndReload(false); - // We use the longpress gesture here because unlike Tap it's never suppressed. - longPressNodeWithoutWaiting(SEARCH_NODE); - waitForSelectActionBarVisible(); - // Verify the panel didn't open. It should open by now if CS has not been disabled. - // TODO(donnd): Consider waiting for some condition to be sure we'll catch all failures, - // e.g. in case the Bar is about to show but has not yet appeared. Currently catches ~90%. - assertPanelClosedOrUndefined(); - - // Similar sequence with network connected should peek for Longpress. - setOnlineStatusAndReload(true); - longPressNodeWithoutWaiting(SEARCH_NODE); - waitForSelectActionBarVisible(); - waitForPanelToPeek(); - } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ui/AppLaunchDrawBlockerUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ui/AppLaunchDrawBlockerUnitTest.java index bc86598..11625af 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ui/AppLaunchDrawBlockerUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ui/AppLaunchDrawBlockerUnitTest.java
@@ -57,11 +57,8 @@ import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactoryJni; import org.chromium.chrome.browser.tabmodel.TabPersistentStore.ActiveTabState; -import org.chromium.chrome.browser.tasks.ReturnToChromeUtil; import org.chromium.chrome.browser.ui.AppLaunchDrawBlocker.BlockDrawForInitialTabAccuracy; -import org.chromium.chrome.features.start_surface.StartSurfaceConfiguration; import org.chromium.chrome.test.util.browser.Features; -import org.chromium.chrome.test.util.browser.Features.EnableFeatures; import org.chromium.components.search_engines.TemplateUrlService; import java.util.List; @@ -349,32 +346,6 @@ } @Test - @EnableFeatures({ChromeFeatureList.TAB_SWITCHER_ON_RETURN + "<Study,", - ChromeFeatureList.START_SURFACE_ANDROID + "<Study"}) - @CommandLineFlags.Add({"force-fieldtrials=Study/Group", - "force-fieldtrial-params=Study.Group:" - + ReturnToChromeUtil.TAB_SWITCHER_ON_RETURN_MS_PARAM + "/0" - + "/start_surface_variation/single/omnibox_focused_on_new_tab/true"}) - public void - testLastTabNtp_phone_searchEngineHasLogo_withIntent_ntpOmniboxFocused() { - SharedPreferencesManager.getInstance().writeInt( - ChromePreferenceKeys.APP_LAUNCH_LAST_KNOWN_ACTIVE_TAB_STATE, ActiveTabState.NTP); - setSearchEngineHasLogo(true); - StartSurfaceConfiguration.OMNIBOX_FOCUSED_ON_NEW_TAB.setForTesting(true); - mIntent = IntentHandler.createTrustedOpenNewTabIntent( - ApplicationProvider.getApplicationContext(), false); - mIntent.putExtra(IntentHandler.EXTRA_INVOKED_FROM_SHORTCUT, true); - - mInflationObserver.onPostInflationStartup(); - verify(mViewTreeObserver, never()) - .addOnPreDrawListener(mOnPreDrawListenerArgumentCaptor.capture()); - mAppLaunchDrawBlocker.onActiveTabAvailable(true); - - assertAccuracyHistogram(false, false); - assertDurationHistogram(false, 0); - } - - @Test public void testBlockedButShouldNotHaveRecorded() { // Same scenario as #testLastTabNtp_phone_searchEngineHasLogo_noIntent, but we assume the // prediction to block was wrong to verify the histogram is recorded correctly.
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index 89317c7..c6c70b4 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -5076,15 +5076,9 @@ <message name="IDS_ECHE_APP_SCREEN_LOCK_SETTINGS_BUTTON" desc="Label for the button in the screen lock notification of EcheApp to open the settings app."> Settings </message> - <message name="IDS_ECHE_APP_SCREEN_LOCK_LEARN_MORE" desc="Learn more link text in screen lock notification of EcheApp."> - Learn more - </message> <message name="IDS_ECHE_APP_NOTIFICATION_TRY_AGAIN_BUTTON" desc="Label for the connection lost button of EcheApp to try again."> Try again </message> - <message name="IDS_ECHE_APP_NOTIFICATION_LEARN_MORE_BUTTON" desc="Learn more link text in connection lost notification of EcheApp."> - Learn more - </message> <message name="IDS_ECHE_APP_SCREEN_LOCK_NOTIFICATION_TITLE" desc="Title for notification shown when screen lock is not enabled while using app stream of EcheApp."> Can't open <ph name="APP_NAME">$1<ex>the app</ex></ph> </message>
diff --git a/chrome/app/chromeos_strings_grdp/IDS_ECHE_APP_NOTIFICATION_LEARN_MORE_BUTTON.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_ECHE_APP_NOTIFICATION_LEARN_MORE_BUTTON.png.sha1 deleted file mode 100644 index b5761d7f..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_ECHE_APP_NOTIFICATION_LEARN_MORE_BUTTON.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -5cf40a36fda59bb035c5b916c1facea2498153db \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_ECHE_APP_SCREEN_LOCK_LEARN_MORE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_ECHE_APP_SCREEN_LOCK_LEARN_MORE.png.sha1 deleted file mode 100644 index f7fc0077..0000000 --- a/chrome/app/chromeos_strings_grdp/IDS_ECHE_APP_SCREEN_LOCK_LEARN_MORE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -bf284f3dc923008482ba763eb9d056f1ab69f8e9 \ No newline at end of file
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 89ad5d4..774928d5 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -5180,6 +5180,10 @@ flag_descriptions::kOmniboxAggregateShortcutsName, flag_descriptions::kOmniboxAggregateShortcutsDescription, kOsDesktop, FEATURE_VALUE_TYPE(omnibox::kAggregateShortcuts)}, + {"omnibox-shortcut-expanding", + flag_descriptions::kOmniboxShortcutExpandingName, + flag_descriptions::kOmniboxShortcutExpandingDescription, kOsDesktop, + FEATURE_VALUE_TYPE(omnibox::kShortcutExpanding)}, {"omnibox-close-popup-with-escape", flag_descriptions::kOmniboxClosePopupWithEscapeName, flag_descriptions::kOmniboxClosePopupWithEscapeDescription, kOsDesktop,
diff --git a/chrome/browser/android/omnibox/autocomplete_controller_android.cc b/chrome/browser/android/omnibox/autocomplete_controller_android.cc index c34c569..acb82768 100644 --- a/chrome/browser/android/omnibox/autocomplete_controller_android.cc +++ b/chrome/browser/android/omnibox/autocomplete_controller_android.cc
@@ -272,8 +272,6 @@ if (!profile_->IsOffTheRecord() && base::FeatureList::IsEnabled(omnibox::kOmniboxSpareRenderer) && page_class != OmniboxEventProto::ANDROID_SEARCH_WIDGET && - page_class != OmniboxEventProto::START_SURFACE_HOMEPAGE && - page_class != OmniboxEventProto::START_SURFACE_NEW_TAB && !BaseSearchProvider::IsNTPPage(page_class)) { auto renderer_delay_ms = base::GetFieldTrialParamByFeatureAsInt( omnibox::kOmniboxSpareRenderer, "omnibox_spare_renderer_delay_ms",
diff --git a/chrome/browser/apps/app_discovery_service/game_fetcher.cc b/chrome/browser/apps/app_discovery_service/game_fetcher.cc index 701b84c..d773eea 100644 --- a/chrome/browser/apps/app_discovery_service/game_fetcher.cc +++ b/chrome/browser/apps/app_discovery_service/game_fetcher.cc
@@ -233,7 +233,7 @@ Profile* profile) { std::string resolved_locale; - if (!test_language_.has_value()) { + if (test_language_.has_value()) { // Use language set for testing. resolved_locale = test_language_.value(); } else {
diff --git a/chrome/browser/apps/app_service/app_service_proxy_base.cc b/chrome/browser/apps/app_service/app_service_proxy_base.cc index 6947310..acb8c19 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_base.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_base.cc
@@ -27,8 +27,6 @@ #include "components/services/app_service/public/cpp/intent_util.h" #include "components/services/app_service/public/cpp/preferred_app.h" #include "components/services/app_service/public/cpp/types_util.h" -#include "components/services/app_service/public/mojom/types.mojom-forward.h" -#include "components/services/app_service/public/mojom/types.mojom.h" #include "content/public/browser/url_data_source.h" #include "extensions/common/constants.h" #include "ui/display/types/display_constants.h" @@ -36,7 +34,6 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) #include "chrome/browser/ash/file_manager/app_id.h" -#include "chrome/common/chrome_features.h" #endif namespace apps { @@ -103,38 +100,6 @@ return nullptr; } -std::unique_ptr<IconLoader::Releaser> -AppServiceProxyBase::InnerIconLoader::LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) { - if (overriding_icon_loader_for_testing_) { - return overriding_icon_loader_for_testing_->LoadIconFromIconKey( - app_type, app_id, std::move(icon_key), icon_type, size_hint_in_dip, - allow_placeholder_icon, std::move(callback)); - } - - if (host_->app_service_.is_connected() && icon_key) { - // TODO(crbug.com/826982): Mojo doesn't guarantee the order of messages, - // so multiple calls to this method might not resolve their callbacks in - // order. As per khmel@, "you may have race here, assume you publish change - // for the app and app requested new icon. But new icon is not delivered - // yet and you resolve old one instead. Now new icon arrives asynchronously - // but you no longer notify the app or do?" - RecordIconLoadMethodMetrics(IconLoadingMethod::kViaMojomCall); - host_->app_service_->LoadIcon(app_type, app_id, std::move(icon_key), - icon_type, size_hint_in_dip, - allow_placeholder_icon, std::move(callback)); - } else { - std::move(callback).Run(apps::mojom::IconValue::New()); - } - return nullptr; -} - AppServiceProxyBase::AppServiceProxyBase(Profile* profile) : inner_icon_loader_(this), icon_coalescer_(&inner_icon_loader_), @@ -299,20 +264,6 @@ allow_placeholder_icon, std::move(callback)); } -std::unique_ptr<apps::IconLoader::Releaser> -AppServiceProxyBase::LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) { - return outer_icon_loader_.LoadIconFromIconKey( - app_type, app_id, std::move(icon_key), icon_type, size_hint_in_dip, - allow_placeholder_icon, std::move(callback)); -} - void AppServiceProxyBase::Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/app_service_proxy_base.h b/chrome/browser/apps/app_service/app_service_proxy_base.h index 28de6a6b..2879e59 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_base.h +++ b/chrome/browser/apps/app_service/app_service_proxy_base.h
@@ -32,6 +32,8 @@ #include "components/services/app_service/public/cpp/preferred_app.h" #include "components/services/app_service/public/cpp/preferred_apps_impl.h" #include "components/services/app_service/public/cpp/preferred_apps_list.h" +#include "components/services/app_service/public/mojom/app_service.mojom.h" +#include "components/services/app_service/public/mojom/types.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote.h" @@ -125,17 +127,6 @@ bool allow_placeholder_icon, apps::LoadIconCallback callback) override; - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - std::unique_ptr<IconLoader::Releaser> LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) override; - // Launches the app for the given |app_id|. |event_flags| provides additional // context about the action which launches the app (e.g. a middle click // indicating opening a background tab). |launch_source| is the possible app @@ -353,16 +344,6 @@ bool allow_placeholder_icon, apps::LoadIconCallback callback) override; - // TODO(crbug.com/1253250): Will be removed soon. - std::unique_ptr<IconLoader::Releaser> LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) override; - // |host_| owns |this|, as the InnerIconLoader is an AppServiceProxyBase // field. raw_ptr<AppServiceProxyBase> host_;
diff --git a/chrome/browser/apps/app_service/app_service_proxy_lacros.cc b/chrome/browser/apps/app_service/app_service_proxy_lacros.cc index d16f1ed1..24477f6 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_lacros.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_lacros.cc
@@ -114,20 +114,6 @@ allow_placeholder_icon, std::move(callback)); } -std::unique_ptr<apps::IconLoader::Releaser> -AppServiceProxyLacros::LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) { - return outer_icon_loader_.LoadIconFromIconKey( - app_type, app_id, std::move(icon_key), icon_type, size_hint_in_dip, - allow_placeholder_icon, std::move(callback)); -} - void AppServiceProxyLacros::Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source, @@ -492,41 +478,6 @@ return nullptr; } -std::unique_ptr<IconLoader::Releaser> -AppServiceProxyLacros::InnerIconLoader::LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) { - if (overriding_icon_loader_for_testing_) { - return overriding_icon_loader_for_testing_->LoadIconFromIconKey( - app_type, app_id, std::move(icon_key), icon_type, size_hint_in_dip, - allow_placeholder_icon, std::move(callback)); - } - - if (!host_->remote_crosapi_app_service_proxy_ || !icon_key) { - std::move(callback).Run(apps::mojom::IconValue::New()); - } else if (host_->crosapi_app_service_proxy_version_ < - int{crosapi::mojom::AppServiceProxy::MethodMinVersions:: - kLoadIconMinVersion}) { - LOG(WARNING) << "Ash AppServiceProxy version " - << host_->crosapi_app_service_proxy_version_ - << " does not support LoadIcon()."; - std::move(callback).Run(apps::mojom::IconValue::New()); - } else { - host_->remote_crosapi_app_service_proxy_->LoadIcon( - app_id, - std::make_unique<IconKey>(icon_key->timeline, icon_key->resource_id, - icon_key->icon_effects), - ConvertMojomIconTypeToIconType(icon_type), size_hint_in_dip, - IconValueToMojomIconValueCallback(std::move(callback))); - } - return nullptr; -} - bool AppServiceProxyLacros::IsValidProfile() { if (!profile_) { return false;
diff --git a/chrome/browser/apps/app_service/app_service_proxy_lacros.h b/chrome/browser/apps/app_service/app_service_proxy_lacros.h index aa2b29f..2d28b2f 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_lacros.h +++ b/chrome/browser/apps/app_service/app_service_proxy_lacros.h
@@ -25,6 +25,8 @@ #include "components/services/app_service/public/cpp/intent.h" #include "components/services/app_service/public/cpp/preferred_app.h" #include "components/services/app_service/public/cpp/preferred_apps_list.h" +#include "components/services/app_service/public/mojom/app_service.mojom.h" +#include "components/services/app_service/public/mojom/types.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote.h" @@ -100,17 +102,6 @@ bool allow_placeholder_icon, apps::LoadIconCallback callback) override; - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - std::unique_ptr<IconLoader::Releaser> LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) override; - // Launches the app for the given |app_id|. |event_flags| provides additional // context about the action which launches the app (e.g. a middle click // indicating opening a background tab). |launch_source| is the possible app @@ -306,16 +297,6 @@ bool allow_placeholder_icon, apps::LoadIconCallback callback) override; - // TODO(crbug.com/1253250): Will be removed soon. - std::unique_ptr<IconLoader::Releaser> LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) override; - // |host_| owns |this|, as the InnerIconLoader is an AppServiceProxyLacros // field. AppServiceProxyLacros* host_;
diff --git a/chrome/browser/apps/app_service/app_service_proxy_unittest.cc b/chrome/browser/apps/app_service/app_service_proxy_unittest.cc index cff73bd9..fd1044f 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_unittest.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_unittest.cc
@@ -632,6 +632,151 @@ EXPECT_FALSE(pub.AppHasSupportedLinksPreference(kAppId3)); } +// Test that app with overlapped supported links works properly. +TEST_F(AppServiceProxyPreferredAppsTest, PreferredAppsOverlapSupportedLink) { + // Test Initialize. + GetPreferredAppsList().Init(); + + const char kAppId1[] = "abcdefg"; + const char kAppId2[] = "hijklmn"; + + GURL filter_url_1 = GURL("https://www.google.com/abc"); + GURL filter_url_2 = GURL("http://www.google.com.au/abc"); + GURL filter_url_3 = GURL("https://www.abc.com/abc"); + + auto intent_filter_1 = apps_util::MakeIntentFilterForUrlScope(filter_url_1); + apps_util::AddConditionValue(ConditionType::kScheme, filter_url_2.scheme(), + PatternMatchType::kNone, intent_filter_1); + apps_util::AddConditionValue(ConditionType::kHost, filter_url_2.host(), + PatternMatchType::kNone, intent_filter_1); + + auto intent_filter_2 = apps_util::MakeIntentFilterForUrlScope(filter_url_3); + apps_util::AddConditionValue(ConditionType::kScheme, filter_url_2.scheme(), + PatternMatchType::kNone, intent_filter_2); + apps_util::AddConditionValue(ConditionType::kHost, filter_url_2.host(), + PatternMatchType::kNone, intent_filter_2); + + auto intent_filter_3 = apps_util::MakeIntentFilterForUrlScope(filter_url_1); + + IntentFilters app_1_filters; + app_1_filters.push_back(std::move(intent_filter_1)); + app_1_filters.push_back(std::move(intent_filter_2)); + IntentFilters app_2_filters; + app_2_filters.push_back(std::move(intent_filter_3)); + + FakePublisherForProxyTest pub(proxy(), AppType::kArc, + std::vector<std::string>{kAppId1, kAppId2}); + + EXPECT_EQ(absl::nullopt, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_1)); + EXPECT_EQ(absl::nullopt, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_2)); + EXPECT_EQ(absl::nullopt, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_3)); + EXPECT_EQ(0U, GetPreferredAppsList().GetEntrySize()); + + // Test that add preferred app with overlapped filters for same app will + // add all entries. + proxy()->SetSupportedLinksPreference(kAppId1, + CloneIntentFilters(app_1_filters)); + + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_1)); + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_2)); + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_3)); + EXPECT_TRUE(pub.AppHasSupportedLinksPreference(kAppId1)); + EXPECT_FALSE(pub.AppHasSupportedLinksPreference(kAppId2)); + EXPECT_EQ(2U, GetPreferredAppsList().GetEntrySize()); + + // Test that add preferred app with another app that has overlapped filter + // will clear all entries from the original app. + proxy()->SetSupportedLinksPreference(kAppId2, + CloneIntentFilters(app_2_filters)); + + EXPECT_EQ(kAppId2, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_1)); + EXPECT_EQ(absl::nullopt, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_2)); + EXPECT_EQ(absl::nullopt, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_3)); + EXPECT_FALSE(pub.AppHasSupportedLinksPreference(kAppId1)); + EXPECT_TRUE(pub.AppHasSupportedLinksPreference(kAppId2)); + EXPECT_EQ(1U, GetPreferredAppsList().GetEntrySize()); + + // Test that setting back to app 1 works. + proxy()->SetSupportedLinksPreference(kAppId1, + CloneIntentFilters(app_1_filters)); + + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_1)); + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_2)); + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_3)); + EXPECT_TRUE(pub.AppHasSupportedLinksPreference(kAppId1)); + EXPECT_FALSE(pub.AppHasSupportedLinksPreference(kAppId2)); + EXPECT_EQ(2U, GetPreferredAppsList().GetEntrySize()); +} + +// Test that duplicated entry will not be added for supported links. +TEST_F(AppServiceProxyPreferredAppsTest, PreferredAppsDuplicatedSupportedLink) { + // Test Initialize. + GetPreferredAppsList().Init(); + + const char kAppId1[] = "abcdefg"; + + GURL filter_url_1 = GURL("https://www.google.com/abc"); + GURL filter_url_2 = GURL("http://www.google.com.au/abc"); + GURL filter_url_3 = GURL("https://www.abc.com/abc"); + + auto intent_filter_1 = apps_util::MakeIntentFilterForUrlScope(filter_url_1); + + auto intent_filter_2 = apps_util::MakeIntentFilterForUrlScope(filter_url_2); + + auto intent_filter_3 = apps_util::MakeIntentFilterForUrlScope(filter_url_3); + + IntentFilters app_1_filters; + app_1_filters.push_back(std::move(intent_filter_1)); + app_1_filters.push_back(std::move(intent_filter_2)); + app_1_filters.push_back(std::move(intent_filter_3)); + + FakePublisherForProxyTest pub(proxy(), AppType::kArc, + std::vector<std::string>{kAppId1}); + + EXPECT_EQ(absl::nullopt, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_1)); + EXPECT_EQ(absl::nullopt, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_2)); + EXPECT_EQ(absl::nullopt, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_3)); + EXPECT_EQ(0U, GetPreferredAppsList().GetEntrySize()); + + proxy()->SetSupportedLinksPreference(kAppId1, + CloneIntentFilters(app_1_filters)); + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_1)); + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_2)); + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_3)); + EXPECT_TRUE(pub.AppHasSupportedLinksPreference(kAppId1)); + + EXPECT_EQ(3U, GetPreferredAppsList().GetEntrySize()); + + proxy()->SetSupportedLinksPreference(kAppId1, + CloneIntentFilters(app_1_filters)); + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_1)); + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_2)); + EXPECT_EQ(kAppId1, + GetPreferredAppsList().FindPreferredAppForUrl(filter_url_3)); + EXPECT_TRUE(pub.AppHasSupportedLinksPreference(kAppId1)); + + EXPECT_EQ(3U, GetPreferredAppsList().GetEntrySize()); +} #endif // !BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/apps/app_service/publishers/arc_apps.cc b/chrome/browser/apps/app_service/publishers/arc_apps.cc index 486cba3..9e65ae7 100644 --- a/chrome/browser/apps/app_service/publishers/arc_apps.cc +++ b/chrome/browser/apps/app_service/publishers/arc_apps.cc
@@ -751,50 +751,6 @@ subscribers_.Add(std::move(subscriber)); } -void ArcApps::LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType mojom_icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - if (!icon_key || mojom_icon_type == apps::mojom::IconType::kUnknown) { - std::move(callback).Run(apps::mojom::IconValue::New()); - return; - } - IconEffects icon_effects = static_cast<IconEffects>(icon_key->icon_effects); - - apps::IconType icon_type = ConvertMojomIconTypeToIconType(mojom_icon_type); - - // Treat the Play Store as a special case, loading an icon defined by a - // resource instead of asking the Android VM (or the cache of previous - // responses from the Android VM). Presumably this is for bootstrapping: - // the Play Store icon (the UI for enabling and installing Android apps) - // should be showable even before the user has installed their first - // Android app and before bringing up an Android VM for the first time. - if (app_id == arc::kPlayStoreAppId) { - LoadPlayStoreIcon(icon_type, size_hint_in_dip, icon_effects, - IconValueToMojomIconValueCallback(std::move(callback))); - } else { - const ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(profile_); - DCHECK(arc_prefs); - - // If the app has been removed, immediately terminate the icon request since - // it can't possibly succeed. - std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = - arc_prefs->GetApp(app_id); - if (!app_info) { - std::move(callback).Run(apps::mojom::IconValue::New()); - return; - } - - arc_icon_once_loader_.LoadIcon( - app_id, size_hint_in_dip, icon_type, - base::BindOnce(&OnArcAppIconCompletelyLoaded, icon_type, - size_hint_in_dip, icon_effects, - IconValueToMojomIconValueCallback(std::move(callback)))); - } -} - void ArcApps::Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/arc_apps.h b/chrome/browser/apps/app_service/publishers/arc_apps.h index 5d97280..14eccd9 100644 --- a/chrome/browser/apps/app_service/publishers/arc_apps.h +++ b/chrome/browser/apps/app_service/publishers/arc_apps.h
@@ -118,12 +118,6 @@ // apps::mojom::Publisher overrides. void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType mojom_icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/borealis_apps.cc b/chrome/browser/apps/app_service/publishers/borealis_apps.cc index 5b58d23d..7754e3b 100644 --- a/chrome/browser/apps/app_service/publishers/borealis_apps.cc +++ b/chrome/browser/apps/app_service/publishers/borealis_apps.cc
@@ -341,25 +341,6 @@ subscribers_.Add(std::move(subscriber)); } -void BorealisApps::LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - if (!icon_key) { - // On failure, we still run the callback, with an empty IconValue. - std::move(callback).Run(apps::mojom::IconValue::New()); - return; - } - - std::unique_ptr<IconKey> key = ConvertMojomIconKeyToIconKey(icon_key); - Registry()->LoadIcon(app_id, *key, ConvertMojomIconTypeToIconType(icon_type), - size_hint_in_dip, allow_placeholder_icon, - apps::mojom::IconKey::kInvalidResourceId, - IconValueToMojomIconValueCallback(std::move(callback))); -} - void BorealisApps::Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/borealis_apps.h b/chrome/browser/apps/app_service/publishers/borealis_apps.h index bde446f..03ee964 100644 --- a/chrome/browser/apps/app_service/publishers/borealis_apps.h +++ b/chrome/browser/apps/app_service/publishers/borealis_apps.h
@@ -81,12 +81,6 @@ // apps::PublisherBase overrides. void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/built_in_chromeos_apps.cc b/chrome/browser/apps/app_service/publishers/built_in_chromeos_apps.cc index 98ad0e6..a677e511 100644 --- a/chrome/browser/apps/app_service/publishers/built_in_chromeos_apps.cc +++ b/chrome/browser/apps/app_service/publishers/built_in_chromeos_apps.cc
@@ -179,26 +179,6 @@ // lifetime of the Chrome OS session. There won't be any further updates. } -void BuiltInChromeOsApps::LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - constexpr bool is_placeholder_icon = false; - if (icon_key && - (icon_key->resource_id != apps::mojom::IconKey::kInvalidResourceId)) { - LoadIconFromResource( - ConvertMojomIconTypeToIconType(icon_type), size_hint_in_dip, - icon_key->resource_id, is_placeholder_icon, - static_cast<IconEffects>(icon_key->icon_effects), - IconValueToMojomIconValueCallback(std::move(callback))); - return; - } - // On failure, we still run the callback, with the zero IconValue. - std::move(callback).Run(apps::mojom::IconValue::New()); -} - void BuiltInChromeOsApps::Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/built_in_chromeos_apps.h b/chrome/browser/apps/app_service/publishers/built_in_chromeos_apps.h index 05b20c0f..d0e178b 100644 --- a/chrome/browser/apps/app_service/publishers/built_in_chromeos_apps.h +++ b/chrome/browser/apps/app_service/publishers/built_in_chromeos_apps.h
@@ -57,12 +57,6 @@ // apps::mojom::Publisher overrides. void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/crostini_apps.cc b/chrome/browser/apps/app_service/publishers/crostini_apps.cc index a696959..e7c532f4 100644 --- a/chrome/browser/apps/app_service/publishers/crostini_apps.cc +++ b/chrome/browser/apps/app_service/publishers/crostini_apps.cc
@@ -146,25 +146,6 @@ subscribers_.Add(std::move(subscriber)); } -void CrostiniApps::LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - if (!icon_key) { - // On failure, we still run the callback, with an empty IconValue. - std::move(callback).Run(apps::mojom::IconValue::New()); - return; - } - - std::unique_ptr<IconKey> key = ConvertMojomIconKeyToIconKey(icon_key); - registry_->LoadIcon(app_id, *key, ConvertMojomIconTypeToIconType(icon_type), - size_hint_in_dip, allow_placeholder_icon, - IDR_LOGO_CROSTINI_DEFAULT, - IconValueToMojomIconValueCallback(std::move(callback))); -} - void CrostiniApps::Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/crostini_apps.h b/chrome/browser/apps/app_service/publishers/crostini_apps.h index a5c44db..fe6a3d3 100644 --- a/chrome/browser/apps/app_service/publishers/crostini_apps.h +++ b/chrome/browser/apps/app_service/publishers/crostini_apps.h
@@ -67,12 +67,6 @@ // apps::mojom::Publisher overrides. void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/extension_apps_base.cc b/chrome/browser/apps/app_service/publishers/extension_apps_base.cc index 473f759..31773061 100644 --- a/chrome/browser/apps/app_service/publishers/extension_apps_base.cc +++ b/chrome/browser/apps/app_service/publishers/extension_apps_base.cc
@@ -470,23 +470,6 @@ subscribers_.Add(std::move(subscriber)); } -void ExtensionAppsBase::LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - if (icon_key) { - LoadIconFromExtension( - ConvertMojomIconTypeToIconType(icon_type), size_hint_in_dip, profile_, - app_id, static_cast<IconEffects>(icon_key->icon_effects), - IconValueToMojomIconValueCallback(std::move(callback))); - return; - } - // On failure, we still run the callback, with the zero IconValue. - std::move(callback).Run(apps::mojom::IconValue::New()); -} - void ExtensionAppsBase::Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/extension_apps_base.h b/chrome/browser/apps/app_service/publishers/extension_apps_base.h index e8b2c83..b9e7054a 100644 --- a/chrome/browser/apps/app_service/publishers/extension_apps_base.h +++ b/chrome/browser/apps/app_service/publishers/extension_apps_base.h
@@ -165,12 +165,6 @@ // apps::mojom::Publisher overrides. void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/plugin_vm_apps.cc b/chrome/browser/apps/app_service/publishers/plugin_vm_apps.cc index 763189c..89d5dde 100644 --- a/chrome/browser/apps/app_service/publishers/plugin_vm_apps.cc +++ b/chrome/browser/apps/app_service/publishers/plugin_vm_apps.cc
@@ -261,25 +261,6 @@ std::move(callback)); } -void PluginVmApps::LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - if (!icon_key) { - // On failure, we still run the callback, with an empty IconValue. - std::move(callback).Run(apps::mojom::IconValue::New()); - return; - } - - std::unique_ptr<IconKey> key = ConvertMojomIconKeyToIconKey(icon_key); - registry_->LoadIcon(app_id, *key, ConvertMojomIconTypeToIconType(icon_type), - size_hint_in_dip, allow_placeholder_icon, - apps::mojom::IconKey::kInvalidResourceId, - IconValueToMojomIconValueCallback(std::move(callback))); -} - void PluginVmApps::LaunchAppWithParams(AppLaunchParams&& params, LaunchCallback callback) { Launch(params.app_id, ui::EF_NONE, apps::mojom::LaunchSource::kUnknown,
diff --git a/chrome/browser/apps/app_service/publishers/plugin_vm_apps.h b/chrome/browser/apps/app_service/publishers/plugin_vm_apps.h index b98b141..2165531 100644 --- a/chrome/browser/apps/app_service/publishers/plugin_vm_apps.h +++ b/chrome/browser/apps/app_service/publishers/plugin_vm_apps.h
@@ -65,12 +65,6 @@ // apps::PublisherBase overrides. void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/remote_apps.cc b/chrome/browser/apps/app_service/publishers/remote_apps.cc index 2730454..5909e9b 100644 --- a/chrome/browser/apps/app_service/publishers/remote_apps.cc +++ b/chrome/browser/apps/app_service/publishers/remote_apps.cc
@@ -152,39 +152,6 @@ subscribers_.Add(std::move(subscriber)); } -void RemoteApps::LoadIcon(const std::string& app_id, - mojom::IconKeyPtr icon_key, - mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - DCHECK(icon_type != mojom::IconType::kCompressed) - << "Remote app should not be shown in management"; - - bool is_placeholder_icon = false; - gfx::ImageSkia icon_image = delegate_->GetIcon(app_id); - if (icon_image.isNull() && allow_placeholder_icon) { - is_placeholder_icon = true; - icon_image = delegate_->GetPlaceholderIcon(app_id, size_hint_in_dip); - } - - if (icon_image.isNull()) { - std::move(callback).Run(mojom::IconValue::New()); - return; - } - - auto icon = std::make_unique<IconValue>(); - icon->icon_type = ConvertMojomIconTypeToIconType(icon_type); - icon->uncompressed = icon_image; - icon->is_placeholder_icon = is_placeholder_icon; - IconEffects icon_effects = (icon_type == mojom::IconType::kStandard) - ? IconEffects::kCrOsStandardIcon - : IconEffects::kMdIconStyle; - apps::ApplyIconEffects( - icon_effects, size_hint_in_dip, std::move(icon), - IconValueToMojomIconValueCallback(std::move(callback))); -} - void RemoteApps::Launch(const std::string& app_id, int32_t event_flags, mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/remote_apps.h b/chrome/browser/apps/app_service/publishers/remote_apps.h index ac6a73b..5285d2d 100644 --- a/chrome/browser/apps/app_service/publishers/remote_apps.h +++ b/chrome/browser/apps/app_service/publishers/remote_apps.h
@@ -94,12 +94,6 @@ // apps::PublisherBase: void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/standalone_browser_apps.cc b/chrome/browser/apps/app_service/publishers/standalone_browser_apps.cc index a34288f..def5cc72a 100644 --- a/chrome/browser/apps/app_service/publishers/standalone_browser_apps.cc +++ b/chrome/browser/apps/app_service/publishers/standalone_browser_apps.cc
@@ -179,26 +179,6 @@ subscribers_.Add(std::move(subscriber)); } -void StandaloneBrowserApps::LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - if (icon_key && - icon_key->resource_id != apps::mojom::IconKey::kInvalidResourceId) { - LoadIconFromResource( - ConvertMojomIconTypeToIconType(icon_type), size_hint_in_dip, - icon_key->resource_id, - /*is_placeholder_icon=*/false, - static_cast<IconEffects>(icon_key->icon_effects), - apps::IconValueToMojomIconValueCallback(std::move(callback))); - return; - } - // On failure, we still run the callback, with the zero IconValue. - std::move(callback).Run(apps::mojom::IconValue::New()); -} - void StandaloneBrowserApps::Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/standalone_browser_apps.h b/chrome/browser/apps/app_service/publishers/standalone_browser_apps.h index e1329099..1016a852 100644 --- a/chrome/browser/apps/app_service/publishers/standalone_browser_apps.h +++ b/chrome/browser/apps/app_service/publishers/standalone_browser_apps.h
@@ -73,12 +73,6 @@ // apps::PublisherBase: void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc b/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc index cab6473..5ca21f27 100644 --- a/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc +++ b/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.cc
@@ -163,25 +163,6 @@ true /* should_notify_initialized */); } -void StandaloneBrowserExtensionApps::LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - // It is possible that Lacros is briefly unavailable, for example if it shuts - // down for an update. - if (!controller_.is_bound()) { - std::move(callback).Run(apps::mojom::IconValue::New()); - return; - } - - controller_->LoadIcon(app_id, ConvertMojomIconKeyToIconKey(icon_key), - ConvertMojomIconTypeToIconType(icon_type), - size_hint_in_dip, - IconValueToMojomIconValueCallback(std::move(callback))); -} - void StandaloneBrowserExtensionApps::Launch( const std::string& app_id, int32_t event_flags,
diff --git a/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.h b/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.h index d3585f2..a9cf818 100644 --- a/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.h +++ b/chrome/browser/apps/app_service/publishers/standalone_browser_extension_apps.h
@@ -89,12 +89,6 @@ // apps::PublisherBase: void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc b/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc index 0e0938a0..e48ed43 100644 --- a/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc +++ b/chrome/browser/apps/app_service/publishers/web_apps_crosapi.cc
@@ -120,33 +120,6 @@ subscribers_.Add(std::move(subscriber)); } -void WebAppsCrosapi::LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType mojom_icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - if (!LogIfNotConnected(FROM_HERE)) { - std::move(callback).Run(apps::mojom::IconValue::New()); - return; - } - - if (!icon_key) { - std::move(callback).Run(apps::mojom::IconValue::New()); - return; - } - - const IconType icon_type = ConvertMojomIconTypeToIconType(mojom_icon_type); - const apps::IconEffects icon_effects = - static_cast<apps::IconEffects>(icon_key->icon_effects); - controller_->LoadIcon( - app_id, ConvertMojomIconKeyToIconKey(icon_key), icon_type, - size_hint_in_dip, - base::BindOnce(&WebAppsCrosapi::OnLoadIcon, weak_factory_.GetWeakPtr(), - icon_type, size_hint_in_dip, icon_effects, - IconValueToMojomIconValueCallback(std::move(callback)))); -} - void WebAppsCrosapi::Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/apps/app_service/publishers/web_apps_crosapi.h b/chrome/browser/apps/app_service/publishers/web_apps_crosapi.h index 8f3c5cd..1ba6a85 100644 --- a/chrome/browser/apps/app_service/publishers/web_apps_crosapi.h +++ b/chrome/browser/apps/app_service/publishers/web_apps_crosapi.h
@@ -83,12 +83,6 @@ // apps::PublisherBase overrides. void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/ash/accessibility/dictation_browsertest.cc b/chrome/browser/ash/accessibility/dictation_browsertest.cc index f799e5a..ebfc53f4 100644 --- a/chrome/browser/ash/accessibility/dictation_browsertest.cc +++ b/chrome/browser/ash/accessibility/dictation_browsertest.cc
@@ -1211,7 +1211,7 @@ RunHiddenMacroWithTwoStringArgs(/* SMART_SELECT_BTWN_INCL */ 24, start_phrase, end_phrase); bounding_box_waiter.Wait(); - std::ignore = selection_waiter.WaitForNotification(); + ASSERT_TRUE(selection_waiter.WaitForNotification()); } private:
diff --git a/chrome/browser/ash/child_accounts/time_limits/app_time_controller_unittest.cc b/chrome/browser/ash/child_accounts/time_limits/app_time_controller_unittest.cc index 44eae8a..37b884d 100644 --- a/chrome/browser/ash/child_accounts/time_limits/app_time_controller_unittest.cc +++ b/chrome/browser/ash/child_accounts/time_limits/app_time_controller_unittest.cc
@@ -106,22 +106,6 @@ std::move(callback).Run(std::move(iv)); return nullptr; } - - std::unique_ptr<apps::IconLoader::Releaser> LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr mojom_icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) override { - auto icon_key = apps::ConvertMojomIconKeyToIconKey(mojom_icon_key); - return LoadIconFromIconKey( - apps::ConvertMojomAppTypToAppType(app_type), app_id, *icon_key, - apps::ConvertMojomIconTypeToIconType(icon_type), size_hint_in_dip, - allow_placeholder_icon, - apps::IconValueToMojomIconValueCallback(std::move(callback))); - } }; AppTimeControllerTest() = default;
diff --git a/chrome/browser/ash/eche_app/eche_app_notification_controller.cc b/chrome/browser/ash/eche_app/eche_app_notification_controller.cc index 1978d740..b1552d7 100644 --- a/chrome/browser/ash/eche_app/eche_app_notification_controller.cc +++ b/chrome/browser/ash/eche_app/eche_app_notification_controller.cc
@@ -53,13 +53,6 @@ profile_, chromeos::settings::mojom::kSecurityAndSignInSubpagePathV2); } -void EcheAppNotificationController::LaunchLearnMore() { - // TODO(crbug.com/1241352): Wait for UX confirm. - NewWindowDelegate::GetPrimary()->OpenUrl( - GURL(kEcheAppLearnMoreUrl), - NewWindowDelegate::OpenUrlFrom::kUserInteraction); -} - void EcheAppNotificationController::LaunchTryAgain() { relaunch_callback_.Run(profile_); } @@ -77,9 +70,6 @@ message_center::RichNotificationData rich_notification_data; rich_notification_data.buttons.push_back( message_center::ButtonInfo(l10n_util::GetStringUTF16( - IDS_ECHE_APP_NOTIFICATION_LEARN_MORE_BUTTON))); - rich_notification_data.buttons.push_back( - message_center::ButtonInfo(l10n_util::GetStringUTF16( IDS_ECHE_APP_NOTIFICATION_TRY_AGAIN_BUTTON))); ShowNotification(CreateNotification( kEcheAppRetryConnectionNotifierId, @@ -118,8 +108,6 @@ const std::u16string& title) { message_center::RichNotificationData rich_notification_data; rich_notification_data.buttons.push_back(message_center::ButtonInfo( - l10n_util::GetStringUTF16(IDS_ECHE_APP_SCREEN_LOCK_LEARN_MORE))); - rich_notification_data.buttons.push_back(message_center::ButtonInfo( l10n_util::GetStringUTF16(IDS_ECHE_APP_SCREEN_LOCK_SETTINGS_BUTTON))); ShowNotification(CreateNotification( kEcheAppScreenLockNotifierId, NotificationCatalogName::kEcheAppScreenLock, @@ -171,16 +159,10 @@ if (notification_id_ == kEcheAppScreenLockNotifierId) { if (*button_index == 0) { - notification_controller_->LaunchLearnMore(); - } else { - DCHECK_EQ(1, *button_index); notification_controller_->LaunchSettings(); } } else if (notification_id_ == kEcheAppRetryConnectionNotifierId) { if (*button_index == 0) { - notification_controller_->LaunchLearnMore(); - } else { - DCHECK_EQ(1, *button_index); notification_controller_->LaunchTryAgain(); } } else if (notification_id_ == kEcheAppInactivityNotifierId) {
diff --git a/chrome/browser/ash/eche_app/eche_app_notification_controller.h b/chrome/browser/ash/eche_app/eche_app_notification_controller.h index d7859d6..2c8fc6b 100644 --- a/chrome/browser/ash/eche_app/eche_app_notification_controller.h +++ b/chrome/browser/ash/eche_app/eche_app_notification_controller.h
@@ -49,7 +49,6 @@ protected: // Exposed for testing. virtual void LaunchSettings(); - virtual void LaunchLearnMore(); virtual void LaunchTryAgain(); private:
diff --git a/chrome/browser/ash/eche_app/eche_app_notification_controller_unittest.cc b/chrome/browser/ash/eche_app/eche_app_notification_controller_unittest.cc index 717a0d9..eb071a0 100644 --- a/chrome/browser/ash/eche_app/eche_app_notification_controller_unittest.cc +++ b/chrome/browser/ash/eche_app/eche_app_notification_controller_unittest.cc
@@ -83,15 +83,9 @@ ASSERT_EQ(2u, notification->buttons().size()); EXPECT_EQ(message_center::SYSTEM_PRIORITY, notification->priority()); - // Clicking the first notification button should launch learn more. - EXPECT_CALL(*new_window_delegate_, - OpenUrl(GURL(kEcheAppLearnMoreUrl), - NewWindowDelegate::OpenUrlFrom::kUserInteraction)); - notification->delegate()->Click(0, absl::nullopt); - - // Clicking the second notification button should launch try again. + // Clicking the notification button should launch try again. EXPECT_CALL(*notification_controller_, LaunchTryAgain()); - notification->delegate()->Click(1, absl::nullopt); + notification->delegate()->Click(0, absl::nullopt); } MockNewWindowDelegate* new_window_delegate_; @@ -108,20 +102,14 @@ absl::optional<message_center::Notification> notification = display_service_->GetNotification(kEcheAppRetryConnectionNotifierId); ASSERT_TRUE(notification); - ASSERT_EQ(2u, notification->buttons().size()); + ASSERT_EQ(1u, notification->buttons().size()); EXPECT_EQ(message_center::SYSTEM_PRIORITY, notification->priority()); EXPECT_EQ(notification->title(), title); EXPECT_EQ(notification->message(), message); - // Clicking the first notification button should launch learn more. - EXPECT_CALL(*new_window_delegate_, - OpenUrl(GURL(kEcheAppLearnMoreUrl), - NewWindowDelegate::OpenUrlFrom::kUserInteraction)); - notification->delegate()->Click(0, absl::nullopt); - - // Clicking the second notification button should relaunch again. + // Clicking the notification button should relaunch again. EXPECT_CALL(*notification_controller_, LaunchTryAgain()); - notification->delegate()->Click(1, absl::nullopt); + notification->delegate()->Click(0, absl::nullopt); title = u"Connection Lost Title"; message = u"Connection Lost Message"; @@ -130,20 +118,14 @@ notification = display_service_->GetNotification(kEcheAppRetryConnectionNotifierId); ASSERT_TRUE(notification.has_value()); - ASSERT_EQ(2u, notification->buttons().size()); + ASSERT_EQ(1u, notification->buttons().size()); EXPECT_EQ(message_center::SYSTEM_PRIORITY, notification->priority()); EXPECT_EQ(notification->title(), title); EXPECT_EQ(notification->message(), message); - // Clicking the first notification button should launch learn more. - EXPECT_CALL(*new_window_delegate_, - OpenUrl(GURL(kEcheAppLearnMoreUrl), - NewWindowDelegate::OpenUrlFrom::kUserInteraction)); - notification->delegate()->Click(0, absl::nullopt); - - // Clicking the second notification button should relaunch again. + // Clicking the notification button should relaunch again. EXPECT_CALL(*notification_controller_, LaunchTryAgain()); - notification->delegate()->Click(1, absl::nullopt); + notification->delegate()->Click(0, absl::nullopt); title = u"Inactivity Title"; message = u"Inactivity Message"; @@ -170,18 +152,12 @@ ASSERT_TRUE(notification.has_value()); ASSERT_TRUE(notification->title().size() > 0); ASSERT_TRUE(notification->message().size() > 0); - ASSERT_EQ(2u, notification->buttons().size()); + ASSERT_EQ(1u, notification->buttons().size()); EXPECT_EQ(message_center::SYSTEM_PRIORITY, notification->priority()); - // Clicking the first notification button should launch learn more. - EXPECT_CALL(*new_window_delegate_, - OpenUrl(GURL(kEcheAppLearnMoreUrl), - NewWindowDelegate::OpenUrlFrom::kUserInteraction)); - notification->delegate()->Click(0, absl::nullopt); - - // Clicking the second notification button should launch settings. + // Clicking the notification button should launch settings. EXPECT_CALL(*notification_controller_, LaunchSettings()); - notification->delegate()->Click(1, absl::nullopt); + notification->delegate()->Click(0, absl::nullopt); } TEST_F(EcheAppNotificationControllerTest, @@ -194,18 +170,12 @@ ASSERT_TRUE(notification.has_value()); ASSERT_TRUE(notification->title().size() > 0); ASSERT_TRUE(notification->message().size() > 0); - ASSERT_EQ(2u, notification->buttons().size()); + ASSERT_EQ(1u, notification->buttons().size()); EXPECT_EQ(message_center::SYSTEM_PRIORITY, notification->priority()); - // Clicking the second notification button should launch learn more. - EXPECT_CALL(*new_window_delegate_, - OpenUrl(GURL(kEcheAppLearnMoreUrl), - NewWindowDelegate::OpenUrlFrom::kUserInteraction)); - notification->delegate()->Click(0, absl::nullopt); - - // Clicking the first notification button should launch settings. + // Clicking the notification button should launch settings. EXPECT_CALL(*notification_controller_, LaunchSettings()); - notification->delegate()->Click(1, absl::nullopt); + notification->delegate()->Click(0, absl::nullopt); } TEST_F(EcheAppNotificationControllerTest, CloseNotification) {
diff --git a/chrome/browser/ash/file_manager/file_manager_string_util.cc b/chrome/browser/ash/file_manager/file_manager_string_util.cc index 3e2a93b..3b1f47c 100644 --- a/chrome/browser/ash/file_manager/file_manager_string_util.cc +++ b/chrome/browser/ash/file_manager/file_manager_string_util.cc
@@ -4,13 +4,19 @@ #include "chrome/browser/ash/file_manager/file_manager_string_util.h" +#include <cmath> +#include <string> + #include "ash/components/arc/arc_features.h" #include "ash/constants/ash_features.h" +#include "ash/system/time/date_helper.h" #include "base/feature_list.h" #include "base/logging.h" #include "base/strings/stringprintf.h" +#include "base/time/time.h" #include "base/values.h" #include "chrome/browser/ash/crostini/crostini_features.h" +#include "chrome/browser/ash/file_manager/fileapi_util.h" #include "chrome/browser/ash/login/demo_mode/demo_session.h" #include "chrome/browser/ash/plugin_vm/plugin_vm_features.h" #include "chrome/browser/browser_process.h" @@ -18,6 +24,7 @@ #include "chrome/common/chrome_features.h" #include "chrome/grit/generated_resources.h" #include "components/strings/grit/components_strings.h" +#include "third_party/icu/source/i18n/unicode/smpdtfmt.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/webui/web_ui_util.h" #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" @@ -64,6 +71,7 @@ void AddStringsForFileTypes(base::Value::Dict* dict) { // TODO(crbug.com/438921): Rename string IDs to something like // FILE_TYPE_WHATEVER. + SET_STRING("ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_ARCHIVE_FILE_TYPE); SET_STRING("AUDIO_FILE_TYPE", IDS_FILE_BROWSER_AUDIO_FILE_TYPE); SET_STRING("CSV_TEXT_FILE_TYPE", IDS_FILE_BROWSER_CSV_TEXT_FILE_TYPE); SET_STRING("EXCEL_FILE_TYPE", IDS_FILE_BROWSER_EXCEL_FILE_TYPE); @@ -95,24 +103,9 @@ SET_STRING("PLAIN_TEXT_FILE_TYPE", IDS_FILE_BROWSER_PLAIN_TEXT_FILE_TYPE); SET_STRING("POWERPOINT_PRESENTATION_FILE_TYPE", IDS_FILE_BROWSER_POWERPOINT_PRESENTATION_FILE_TYPE); - SET_STRING("RAR_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_RAR_ARCHIVE_FILE_TYPE); - SET_STRING("TAR_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_TAR_ARCHIVE_FILE_TYPE); - SET_STRING("ISO_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_ISO_ARCHIVE_FILE_TYPE); - SET_STRING("7Z_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_7Z_ARCHIVE_FILE_TYPE); - SET_STRING("CRX_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_CRX_ARCHIVE_FILE_TYPE); - SET_STRING("BZIP2_ARCHIVE_FILE_TYPE", - IDS_FILE_BROWSER_BZIP2_ARCHIVE_FILE_TYPE); - SET_STRING("GZIP_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_GZIP_ARCHIVE_FILE_TYPE); - SET_STRING("LZMA_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_LZMA_ARCHIVE_FILE_TYPE); - SET_STRING("LZIP_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_LZIP_ARCHIVE_FILE_TYPE); - SET_STRING("LZOP_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_LZOP_ARCHIVE_FILE_TYPE); - SET_STRING("XZ_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_XZ_ARCHIVE_FILE_TYPE); - SET_STRING("Z_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_Z_ARCHIVE_FILE_TYPE); - SET_STRING("ZSTD_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_ZSTD_ARCHIVE_FILE_TYPE); SET_STRING("VIDEO_FILE_TYPE", IDS_FILE_BROWSER_VIDEO_FILE_TYPE); SET_STRING("WORD_DOCUMENT_FILE_TYPE", IDS_FILE_BROWSER_WORD_DOCUMENT_FILE_TYPE); - SET_STRING("ZIP_ARCHIVE_FILE_TYPE", IDS_FILE_BROWSER_ZIP_ARCHIVE_FILE_TYPE); SET_STRING("TINI_FILE_TYPE", IDS_FILE_BROWSER_TINI_FILE_TYPE); } @@ -963,6 +956,28 @@ return dict; } +int GetLocaleBasedWeekStart() { + // Use a fix date here to derive the localized day_of_week. + base::Time fixed_date; + // May 26 2022 12:00pm Thursday Local time. + DCHECK(base::Time::FromLocalExploded({2022, 5, 4, 26, 12, 0, 0, 0}, + &fixed_date)); + // Use day_of_week_formatter built in DateHelper to get the localized day of + // week. + icu::SimpleDateFormat day_of_week_formatter = + ash::DateHelper::GetInstance()->day_of_week_formatter(); + std::u16string localized_day_of_week = + ash::DateHelper::GetInstance()->GetFormattedTime(&day_of_week_formatter, + fixed_date); + int day_of_week_int; + base::StringToInt(localized_day_of_week, &day_of_week_int); + // We know the fixed date is Thursday, day_of_week is between 1 and 7. + // * if day_of_week is 4, then Monday is the start of the week, so return 1; + // * if day_of_week is 5, then Sunday is the start of the week, so return 0; + // * if day_of_week is 6, then Saturday is the start of the week, so return 6; + return fmod(4 - (day_of_week_int - 1) + 7, 7); +} + void AddFileManagerFeatureStrings(const std::string& locale, Profile* profile, base::Value::Dict* dict) { @@ -1007,4 +1022,5 @@ base::FeatureList::IsEnabled(chromeos::features::kGuestOsFiles)); dict->Set("UI_LOCALE", locale); + dict->Set("WEEK_START_FROM", GetLocaleBasedWeekStart()); }
diff --git a/chrome/browser/ash/file_manager/file_manager_string_util.h b/chrome/browser/ash/file_manager/file_manager_string_util.h index 25dca72..42cb0ad 100644 --- a/chrome/browser/ash/file_manager/file_manager_string_util.h +++ b/chrome/browser/ash/file_manager/file_manager_string_util.h
@@ -13,6 +13,10 @@ base::Value::Dict GetFileManagerStrings(); +// This function will return a number between 0 (Sunday) and 6 (Saturday) +// to indicate which day is the start of week based on the current locale. +int GetLocaleBasedWeekStart(); + void AddFileManagerFeatureStrings(const std::string& locale, Profile* profile, base::Value::Dict* dict);
diff --git a/chrome/browser/ash/file_manager/file_manager_string_util_unittest.cc b/chrome/browser/ash/file_manager/file_manager_string_util_unittest.cc new file mode 100644 index 0000000..1200e7b --- /dev/null +++ b/chrome/browser/ash/file_manager/file_manager_string_util_unittest.cc
@@ -0,0 +1,28 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/file_manager/file_manager_string_util.h" + +#include "ash/system/time/date_helper.h" +#include "base/i18n/rtl.h" +#include "testing/gtest/include/gtest/gtest.h" + +TEST(FileManagerStringUtilTest, GetLocaleBasedWeekStart) { + const struct DateTestData { + const char* locale; + int start_of_week; + } kDateTestData[] = { + // Australia uses Monday as the start day of the week. + {"en_AU", 1}, + // United States uses Sunday as the start day of the week. + {"en_US", 0}, + // Afghanistan uses Saturday as the start day of the week. + {"ps-AF", 6}}; + + for (const auto& test : kDateTestData) { + base::i18n::SetICUDefaultLocale(test.locale); + ash::DateHelper::GetInstance()->ResetFormatters(); + EXPECT_EQ(GetLocaleBasedWeekStart(), test.start_of_week); + } +}
diff --git a/chrome/browser/ash/printing/print_management/printing_manager.cc b/chrome/browser/ash/printing/print_management/printing_manager.cc index 0852ae8..d144f432 100644 --- a/chrome/browser/ash/printing/print_management/printing_manager.cc +++ b/chrome/browser/ash/printing/print_management/printing_manager.cc
@@ -202,6 +202,7 @@ void PrintingManager::BindInterface( mojo::PendingReceiver<printing_manager::mojom::PrintingMetadataProvider> pending_receiver) { + receiver_.reset(); receiver_.Bind(std::move(pending_receiver)); }
diff --git a/chrome/browser/ash/printing/print_management/printing_manager_unittest.cc b/chrome/browser/ash/printing/print_management/printing_manager_unittest.cc index 761b342e..b91e45d 100644 --- a/chrome/browser/ash/printing/print_management/printing_manager_unittest.cc +++ b/chrome/browser/ash/printing/print_management/printing_manager_unittest.cc
@@ -302,6 +302,19 @@ EXPECT_EQ(1u, entries_.size()); } +TEST_F(PrintingManagerTest, ResetReceiverOnBindInterface) { + // This test simulates a user refreshing the WebUI page. The receiver should + // be reset before binding the new receiver. Otherwise we would get a DCHECK + // error from mojo::Receiver + mojo::Remote<printing_manager::mojom::PrintingMetadataProvider> remote; + printing_manager_->BindInterface(remote.BindNewPipeAndPassReceiver()); + base::RunLoop().RunUntilIdle(); + + remote.reset(); + + printing_manager_->BindInterface(remote.BindNewPipeAndPassReceiver()); + base::RunLoop().RunUntilIdle(); +} } // namespace print_management } // namespace printing } // namespace ash
diff --git a/chrome/browser/ash/scanning/scan_service.cc b/chrome/browser/ash/scanning/scan_service.cc index a87631d..61a46c53 100644 --- a/chrome/browser/ash/scanning/scan_service.cc +++ b/chrome/browser/ash/scanning/scan_service.cc
@@ -380,6 +380,7 @@ void ScanService::BindInterface( mojo::PendingReceiver<mojo_ipc::ScanService> pending_receiver) { + receiver_.reset(); receiver_.Bind(std::move(pending_receiver)); }
diff --git a/chrome/browser/ash/scanning/scan_service_unittest.cc b/chrome/browser/ash/scanning/scan_service_unittest.cc index 46883b2..3f1e83e 100644 --- a/chrome/browser/ash/scanning/scan_service_unittest.cc +++ b/chrome/browser/ash/scanning/scan_service_unittest.cc
@@ -1145,4 +1145,17 @@ scanning::ScanMultiPageToolbarAction::kRescanPage, 1); } +TEST_F(ScanServiceTest, ResetReceiverOnBindInterface) { + // This test simulates a user refreshing the WebUI page. The receiver should + // be reset before binding the new receiver. Otherwise we would get a DCHECK + // error from mojo::Receiver + mojo::Remote<scanning::mojom::ScanService> remote; + scan_service_->BindInterface(remote.BindNewPipeAndPassReceiver()); + base::RunLoop().RunUntilIdle(); + + remote.reset(); + + scan_service_->BindInterface(remote.BindNewPipeAndPassReceiver()); + base::RunLoop().RunUntilIdle(); +} } // namespace ash
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index 0a7eda3..7bfdf77e 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd
@@ -132,8 +132,6 @@ </if> <include name="IDR_USB_ENUMERATION_OPTIONS_MOJOM_WEBUI_JS" file="${root_gen_dir}\mojom-webui\services\device\public\mojom\usb_enumeration_options.mojom-webui.js" use_base_dir="false" type="BINDATA" /> <include name="IDR_USB_DEVICE_MANAGER_CLIENT_MOJOM_WEBUI_JS" file="${root_gen_dir}\mojom-webui\services\device\public\mojom\usb_manager_client.mojom-webui.js" use_base_dir="false" type="BINDATA" /> - <include name="IDR_USB_DEVICE_MANAGER_MOJOM_WEBUI_JS" file="${root_gen_dir}\mojom-webui\services\device\public\mojom\usb_manager.mojom-webui.js" use_base_dir="false" type="BINDATA" /> - <include name="IDR_USB_DEVICE_MANAGER_TEST_MOJOM_WEBUI_JS" file="${root_gen_dir}\mojom-webui\services\device\public\mojom\usb_manager_test.mojom-webui.js" use_base_dir="false" type="BINDATA" /> <include name="IDR_WEBSTORE_MANIFEST" file="resources\webstore_app\manifest.json" type="BINDATA" /> <include name="IDR_CRYPTOTOKEN_MANIFEST" file="resources\cryptotoken\manifest.json" type="BINDATA" /> <if expr="chromeos_ash or chromeos_lacros">
diff --git a/chrome/browser/chrome_back_forward_cache_browsertest.cc b/chrome/browser/chrome_back_forward_cache_browsertest.cc index 67551c6..96b82acb 100644 --- a/chrome/browser/chrome_back_forward_cache_browsertest.cc +++ b/chrome/browser/chrome_back_forward_cache_browsertest.cc
@@ -7,6 +7,7 @@ #include "base/test/bind.h" #include "base/test/mock_callback.h" #include "base/test/scoped_feature_list.h" +#include "base/test/scoped_logging_settings.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" @@ -130,6 +131,7 @@ scoped_feature_list_.InitWithFeaturesAndParameters(enabled_features, disabled_features_); + vmodule_switches_.InitWithSwitches("back_forward_cache_impl=1"); } void EnableFeatureAndSetParams(base::Feature feature, @@ -146,6 +148,7 @@ private: base::test::ScopedFeatureList scoped_feature_list_; + logging::ScopedVmoduleSwitches vmodule_switches_; std::unordered_map<base::Feature, std::map<std::string, std::string>, FeatureHash,
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 70d04947..78c4f5302 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -3252,6 +3252,7 @@ "../ash/file_manager/copy_or_move_io_task_unittest.cc", "../ash/file_manager/delete_io_task_unittest.cc", "../ash/file_manager/documents_provider_root_manager_unittest.cc", + "../ash/file_manager/file_manager_string_util_unittest.cc", "../ash/file_manager/file_tasks_notifier_unittest.cc", "../ash/file_manager/file_tasks_unittest.cc", "../ash/file_manager/file_watcher_unittest.cc",
diff --git a/chrome/browser/dev_ui/android/dev_ui_loader_throttle.cc b/chrome/browser/dev_ui/android/dev_ui_loader_throttle.cc index a2f0051..8d3abb9 100644 --- a/chrome/browser/dev_ui/android/dev_ui_loader_throttle.cc +++ b/chrome/browser/dev_ui/android/dev_ui_loader_throttle.cc
@@ -36,7 +36,6 @@ host == chrome::kChromeUIComponentsHost || host == chrome::kChromeUICrashesHost || host == chrome::kChromeUIDeviceLogHost || - host == chrome::kChromeUIDomainReliabilityInternalsHost || host == chrome::kChromeUIDownloadInternalsHost || #if BUILDFLAG(ENABLE_SUPERVISED_USERS) host == chrome::kChromeUIFamilyLinkUserInternalsHost ||
diff --git a/chrome/browser/dev_ui_browser_resources.grd b/chrome/browser/dev_ui_browser_resources.grd index 4a4f16da..95ab701 100644 --- a/chrome/browser/dev_ui_browser_resources.grd +++ b/chrome/browser/dev_ui_browser_resources.grd
@@ -29,9 +29,6 @@ <include name="IDR_DEVICE_LOG_UI_HTML" file="resources\device_log_ui\device_log_ui.html" type="BINDATA" /> <include name="IDR_DEVICE_LOG_UI_JS" file="resources\device_log_ui\device_log_ui.js" type="BINDATA" /> <include name="IDR_DEVICE_LOG_UI_CSS" file="resources\device_log_ui\device_log_ui.css" type="BINDATA" /> - <include name="IDR_DOMAIN_RELIABILITY_INTERNALS_HTML" file="resources\domain_reliability_internals\domain_reliability_internals.html" type="BINDATA" /> - <include name="IDR_DOMAIN_RELIABILITY_INTERNALS_CSS" file="resources\domain_reliability_internals\domain_reliability_internals.css" type="BINDATA" /> - <include name="IDR_DOMAIN_RELIABILITY_INTERNALS_JS" file="resources\domain_reliability_internals\domain_reliability_internals.js" type="BINDATA" /> <include name="IDR_MEMORY_INTERNALS_HTML" file="resources\memory_internals\memory_internals.html" type="BINDATA" /> <include name="IDR_MEMORY_INTERNALS_JS" file="${root_gen_dir}\chrome\browser\resources\memory_internals\tsc\memory_internals.js" use_base_dir="false" type="BINDATA" /> <include name="IDR_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_JS" file="${root_gen_dir}\chrome\browser\resources\predictors\autocomplete_action_predictor.js" use_base_dir="false" type="BINDATA" />
diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc index ce031bb..84790e3 100644 --- a/chrome/browser/extensions/chrome_extensions_browser_client.cc +++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc
@@ -704,4 +704,12 @@ tracker, std::move(callback)); } +std::vector<content::BrowserContext*> +ChromeExtensionsBrowserClient::GetRelatedContextsForExtension( + content::BrowserContext* browser_context, + const Extension& extension) const { + return util::GetAllRelatedProfiles( + Profile::FromBrowserContext(browser_context), extension); +} + } // namespace extensions
diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.h b/chrome/browser/extensions/chrome_extensions_browser_client.h index cfbfbd2a..e774232 100644 --- a/chrome/browser/extensions/chrome_extensions_browser_client.h +++ b/chrome/browser/extensions/chrome_extensions_browser_client.h
@@ -190,6 +190,9 @@ base::OnceCallback< void(scoped_refptr<base::RefCountedMemory> bitmap_data)> callback) const override; + std::vector<content::BrowserContext*> GetRelatedContextsForExtension( + content::BrowserContext* browser_context, + const Extension& extension) const override; private: friend struct base::LazyInstanceTraitsBase<ChromeExtensionsBrowserClient>;
diff --git a/chrome/browser/extensions/permissions_updater.cc b/chrome/browser/extensions/permissions_updater.cc index 260c783..25a9021 100644 --- a/chrome/browser/extensions/permissions_updater.cc +++ b/chrome/browser/extensions/permissions_updater.cc
@@ -8,7 +8,6 @@ #include <utility> #include <vector> -#include "base/barrier_closure.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/feature_list.h" @@ -36,6 +35,7 @@ #include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_util.h" +#include "extensions/browser/network_permissions_updater.h" #include "extensions/browser/notification_types.h" #include "extensions/browser/renderer_startup_helper.h" #include "extensions/common/cors_util.h" @@ -128,19 +128,6 @@ ~PermissionsUpdaterShutdownNotifierFactory() override {} }; -void SetCorsOriginAccessListForAllRelatedProfiles( - content::BrowserContext* browser_context, - const Extension& extension, - base::OnceClosure closure) { - // Non-tab-specific extension permissions are shared across profiles (even for - // split-mode extensions), so we update all profiles the extension is enabled - // for. - util::SetCorsOriginAccessListForExtension( - util::GetAllRelatedProfiles(Profile::FromBrowserContext(browser_context), - extension), - extension, std::move(closure)); -} - } // namespace // A helper class to asynchronously dispatch the event to notify policy host @@ -149,6 +136,11 @@ // This class manages its own lifetime and deletes itself when either the // permissions updated event is fired, or the BrowserContext is shut down // (whichever happens first). +// TODO(devlin): After having extracted much of this into +// NetworkPermissionsUpdater, this class is a glorified watcher for the +// profile lifetime (since it depends on things like EventRouter). This might +// be able to be replaced with a simple check if the profile is still valid in +// a free function. class PermissionsUpdater::NetworkPermissionsUpdateHelper { public: NetworkPermissionsUpdateHelper(const NetworkPermissionsUpdateHelper&) = @@ -207,8 +199,8 @@ // After an asynchronous call below, the helper will call // NotifyPermissionsUpdated if the profile is still valid. - SetCorsOriginAccessListForAllRelatedProfiles( - browser_context, *extension, + NetworkPermissionsUpdater::UpdateExtension( + *browser_context, *extension, base::BindOnce(&NetworkPermissionsUpdateHelper::OnOriginAccessUpdated, helper->weak_factory_.GetWeakPtr())); } @@ -226,17 +218,10 @@ browser_context, default_runtime_blocked_hosts.Clone(), default_runtime_allowed_hosts.Clone())); - const ExtensionSet& extensions = - ExtensionRegistry::Get(browser_context)->enabled_extensions(); - base::RepeatingClosure barrier_closure = base::BarrierClosure( - extensions.size(), + NetworkPermissionsUpdater::UpdateAllExtensions( + *browser_context, base::BindOnce(&NetworkPermissionsUpdateHelper::OnOriginAccessUpdated, helper->weak_factory_.GetWeakPtr())); - - for (const auto& extension : extensions) { - SetCorsOriginAccessListForAllRelatedProfiles(browser_context, *extension, - barrier_closure); - } } PermissionsUpdater::NetworkPermissionsUpdateHelper::
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index b4aa473..ce8e511c 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -158,7 +158,7 @@ { "name": "android-force-app-language-prompt", "owners": [ "perrier", "chrome-language@google.com" ], - "expiry_milestone": 104 + "expiry_milestone": 107 }, { "name": "android-picture-in-picture-api", @@ -1934,12 +1934,12 @@ { "name": "enable-desktop-pwas-tab-strip", "owners": [ "desktop-pwas-team@google.com" ], - "expiry_milestone": 104 + "expiry_milestone": 110 }, { "name": "enable-desktop-pwas-tab-strip-settings", "owners": [ "desktop-pwas-team@google.com" ], - "expiry_milestone": 104 + "expiry_milestone": 110 }, { "name": "enable-desktop-pwas-url-handling", @@ -4666,6 +4666,11 @@ "expiry_milestone": 115 }, { + "name": "omnibox-shortcut-expanding", + "owners": [ "manukh", "chrome-omnibox-team@google.com" ], + "expiry_milestone": 115 + }, + { "name": "omnibox-site-search-starter-pack", "owners": [ "yoangela", "chrome-omnibox-team@google.com" ], "expiry_milestone": 107
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index c3dbc99..67dad774 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1870,6 +1870,7 @@ const char kOmniboxRichAutocompletionPromisingDescription[] = "Allow autocompletion for titles and non-prefixes; see Omnibox Rich " "Autocompletion."; + const char kOmniboxSiteSearchStarterPackName[] = "Omnibox Site Search Starter Pack"; const char kOmniboxSiteSearchStarterPackDescription[] = @@ -3945,6 +3946,11 @@ "Match very short input words to beginning of words in bookmark " "suggestions."; +const char kOmniboxShortcutExpandingName[] = "Omnibox shortcut expanding"; +const char kOmniboxShortcutExpandingDescription[] = + "Expand the last word in the shortcut text to be a complete word from the " + "suggestion text."; + const char kScreenAIName[] = "Screen AI"; const char kScreenAIDescription[] = "Enables Screen AI local machine intelligence library to use the screen "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index f33362c..4cf9dcbeb 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1056,6 +1056,9 @@ extern const char kOmniboxShortBookmarkSuggestionsName[]; extern const char kOmniboxShortBookmarkSuggestionsDescription[]; +extern const char kOmniboxShortcutExpandingName[]; +extern const char kOmniboxShortcutExpandingDescription[]; + extern const char kOmniboxSiteSearchStarterPackName[]; extern const char kOmniboxSiteSearchStarterPackDescription[];
diff --git a/chrome/browser/loading_modal/android/BUILD.gn b/chrome/browser/loading_modal/android/BUILD.gn index bd11b6f3..49d4f70 100644 --- a/chrome/browser/loading_modal/android/BUILD.gn +++ b/chrome/browser/loading_modal/android/BUILD.gn
@@ -47,7 +47,7 @@ ] } -android_library("javatests") { +android_library("unit_device_javatests") { testonly = true sources = [ "javatests/src/org/chromium/chrome/browser/loading_modal/LoadingModalDialogIntegrationTest.java" ]
diff --git a/chrome/browser/renderer_context_menu/link_to_text_menu_observer.cc b/chrome/browser/renderer_context_menu/link_to_text_menu_observer.cc index b42f3b9..3c9d31b8 100644 --- a/chrome/browser/renderer_context_menu/link_to_text_menu_observer.cc +++ b/chrome/browser/renderer_context_menu/link_to_text_menu_observer.cc
@@ -95,8 +95,8 @@ RenderViewContextMenuProxy* proxy, content::RenderFrameHost* render_frame_host, CompletionCallback callback) - : content::DocumentUserData<LinkToTextMenuObserver>(render_frame_host), - proxy_(proxy), + : proxy_(proxy), + render_frame_host_(render_frame_host), completion_callback_(std::move(callback)) {} LinkToTextMenuObserver::~LinkToTextMenuObserver() = default; @@ -181,7 +181,7 @@ if (status == LinkGenerationStatus::kSuccess) { DCHECK_EQ(error, LinkGenerationError::kNone); shared_highlighting::LogRequestedSuccessMetrics( - render_frame_host().GetPageUkmSourceId()); + render_frame_host_->GetPageUkmSourceId()); } else { DCHECK_NE(error, LinkGenerationError::kNone); CompleteWithError(error); @@ -284,7 +284,7 @@ void LinkToTextMenuObserver::CompleteWithError(LinkGenerationError error) { is_generation_complete_ = true; shared_highlighting::LogRequestedFailureMetrics( - render_frame_host().GetPageUkmSourceId(), error); + render_frame_host_->GetPageUkmSourceId(), error); execute_command_pending_ = false; NotifyLinkToTextMenuCompleted(); @@ -372,7 +372,7 @@ mojo::Remote<blink::mojom::TextFragmentReceiver>& LinkToTextMenuObserver::GetRemote() { if (!remote_.is_bound()) { - render_frame_host().GetRemoteInterfaces()->GetInterface( + render_frame_host_->GetRemoteInterfaces()->GetInterface( remote_.BindNewPipeAndPassReceiver()); } return remote_; @@ -380,9 +380,9 @@ void LinkToTextMenuObserver::CopyTextToClipboard(const std::string& text) { std::unique_ptr<ui::DataTransferEndpoint> data_transfer_endpoint = - !render_frame_host().GetBrowserContext()->IsOffTheRecord() + !render_frame_host_->GetBrowserContext()->IsOffTheRecord() ? std::make_unique<ui::DataTransferEndpoint>( - render_frame_host().GetMainFrame()->GetLastCommittedURL()) + render_frame_host_->GetMainFrame()->GetLastCommittedURL()) : nullptr; ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste, @@ -398,5 +398,3 @@ std::move(completion_callback_).Run(); } } - -DOCUMENT_USER_DATA_KEY_IMPL(LinkToTextMenuObserver);
diff --git a/chrome/browser/renderer_context_menu/link_to_text_menu_observer.h b/chrome/browser/renderer_context_menu/link_to_text_menu_observer.h index d93bbc5..58d2af6 100644 --- a/chrome/browser/renderer_context_menu/link_to_text_menu_observer.h +++ b/chrome/browser/renderer_context_menu/link_to_text_menu_observer.h
@@ -8,7 +8,6 @@ #include "base/memory/raw_ptr.h" #include "components/renderer_context_menu/render_view_context_menu_observer.h" #include "components/shared_highlighting/core/common/shared_highlighting_metrics.h" -#include "content/public/browser/document_user_data.h" #include "content/public/browser/render_frame_host.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "third_party/blink/public/mojom/link_to_text/link_to_text.mojom.h" @@ -20,9 +19,7 @@ // A class that implements the menu item for copying selected text and a link // to the selected text to the user's clipboard. -class LinkToTextMenuObserver - : public RenderViewContextMenuObserver, - public content::DocumentUserData<LinkToTextMenuObserver> { +class LinkToTextMenuObserver : public RenderViewContextMenuObserver { public: static std::unique_ptr<LinkToTextMenuObserver> Create( RenderViewContextMenuProxy* proxy, @@ -46,7 +43,6 @@ private: friend class MockLinkToTextMenuObserver; - friend class content::DocumentUserData<LinkToTextMenuObserver>; explicit LinkToTextMenuObserver(RenderViewContextMenuProxy* proxy, content::RenderFrameHost* render_frame_host, @@ -140,8 +136,6 @@ CompletionCallback completion_callback_; base::WeakPtrFactory<LinkToTextMenuObserver> weak_ptr_factory_{this}; - - DOCUMENT_USER_DATA_KEY_DECL(); }; #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_LINK_TO_TEXT_MENU_OBSERVER_H_
diff --git a/chrome/browser/resources/BUILD.gn b/chrome/browser/resources/BUILD.gn index 561f3bb..dc6967f 100644 --- a/chrome/browser/resources/BUILD.gn +++ b/chrome/browser/resources/BUILD.gn
@@ -117,7 +117,7 @@ if (enable_js_type_check) { group("closure_compile") { - deps = [ "domain_reliability_internals:closure_compile" ] + deps = [] if (is_linux || is_chromeos || is_win || is_mac) { deps += [ "bluetooth_internals:closure_compile",
diff --git a/chrome/browser/resources/domain_reliability_internals/BUILD.gn b/chrome/browser/resources/domain_reliability_internals/BUILD.gn deleted file mode 100644 index 85ec78d..0000000 --- a/chrome/browser/resources/domain_reliability_internals/BUILD.gn +++ /dev/null
@@ -1,17 +0,0 @@ -# Copyright 2021 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//third_party/closure_compiler/compile_js.gni") - -js_type_check("closure_compile") { - deps = [ ":domain_reliability_internals" ] -} - -js_library("domain_reliability_internals") { - deps = [ - "//third_party/jstemplate:jstemplate", - "//ui/webui/resources/js:cr.m", - "//ui/webui/resources/js:util.m", - ] -}
diff --git a/chrome/browser/resources/domain_reliability_internals/domain_reliability_internals.css b/chrome/browser/resources/domain_reliability_internals/domain_reliability_internals.css deleted file mode 100644 index 94e47c8..0000000 --- a/chrome/browser/resources/domain_reliability_internals/domain_reliability_internals.css +++ /dev/null
@@ -1,3 +0,0 @@ -/* Copyright 2014 The Chromium Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. */
diff --git a/chrome/browser/resources/domain_reliability_internals/domain_reliability_internals.html b/chrome/browser/resources/domain_reliability_internals/domain_reliability_internals.html deleted file mode 100644 index 23c80761..0000000 --- a/chrome/browser/resources/domain_reliability_internals/domain_reliability_internals.html +++ /dev/null
@@ -1,45 +0,0 @@ -<!doctype html> -<html dir="ltr" lang="en"> -<head> - <meta charset="utf-8"> - <link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> - <link rel="stylesheet" href="domain_reliability_internals.css"> - <script type="module" src="domain_reliability_internals.js"></script> -</head> -<body> - <div id="template"> - <div jsdisplay="error"> - Error loading Domain Reliability data: - <span jscontent="error"></span> - </div> - <div jsselect="contexts"> - <h2 jscontent="origin"></h2> - <p> - <span jscontent="beacon_count"></span> beacons queued.</span> - <span jsdisplay="scheduler.upload_pending">Upload pending.</span> - <span jsdisplay="scheduler.upload_scheduled"> - Upload scheduled for between - <span jscontent="scheduler.scheduled_min"></span> and - <span jscontent="scheduler.scheduled_max"></span> seconds from now. - </span> - <span jsdisplay="scheduler.upload_running"> - Upload of <span jscontent="uploading_beacon_count"></span> beacons - to collector <span jscontent="collector_index"></span> running. - </span> - </p> - <p jsselect="scheduler.last_upload" jsdisplay="$this"> - Last upload to collector <span jscontent="collector_index"></span> - started <span jscontent="start_time"></span> seconds ago and - finished <span jsdisplay="success">successfully</span> - <span jsdisplay="!success">unsuccessfully</span> - <span jscontent="end_time"></span> seconds ago. - </p> - <p jsselect="scheduler.collectors"> - Collector <span jscontent="$index"></span>: - <span jscontent="failures"></span> consecutive failures, - next upload in <span jscontent="next_upload"></span> seconds. - </p> - </div> - </div> -</body> -</html>
diff --git a/chrome/browser/resources/domain_reliability_internals/domain_reliability_internals.js b/chrome/browser/resources/domain_reliability_internals/domain_reliability_internals.js deleted file mode 100644 index 10855b1..0000000 --- a/chrome/browser/resources/domain_reliability_internals/domain_reliability_internals.js +++ /dev/null
@@ -1,14 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'chrome://resources/js/jstemplate_compiled.js'; - -import {sendWithPromise} from 'chrome://resources/js/cr.m.js'; -import {$} from 'chrome://resources/js/util.m.js'; - -document.addEventListener('DOMContentLoaded', function() { - sendWithPromise('updateData').then(data => { - jstProcess(new JsEvalContext(data), $('template')); - }); -});
diff --git a/chrome/browser/resources/omnibox/omnibox.html b/chrome/browser/resources/omnibox/omnibox.html index 88db6e7..02206189 100644 --- a/chrome/browser/resources/omnibox/omnibox.html +++ b/chrome/browser/resources/omnibox/omnibox.html
@@ -102,12 +102,6 @@ </option> <option value="15">new tab page realbox</option> <option value="16">search widget (Android)</option> - <option value="17"> - start surface homepage (Android) - </option> - <option value="18"> - start surface's new tab with omnibox focused (Android) - </option> <option value="19">quick action search widget (Android)</option> </select> </div>
diff --git a/chrome/browser/resources/usb_internals/BUILD.gn b/chrome/browser/resources/usb_internals/BUILD.gn index f954150..129dbea 100644 --- a/chrome/browser/resources/usb_internals/BUILD.gn +++ b/chrome/browser/resources/usb_internals/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//tools/grit/grit_rule.gni") -import("//tools/polymer/html_to_js.gni") +import("//tools/polymer/html_to_wrapper.gni") import("//tools/typescript/ts_library.gni") import("//ui/webui/resources/tools/generate_grd.gni") @@ -34,23 +34,28 @@ deps = [ ":build_grd" ] } -web_components_files = [ "app.js" ] -non_web_components_files = [ +html_wrapper_files = [ "app.html.ts" ] +ts_files = [ + "app.ts", "descriptor_panel.ts", - "devices_page.js", + "devices_page.ts", ] -html_to_js("web_components") { - js_files = web_components_files +html_to_wrapper("html_wrapper_files") { + in_files = [ "app.html" ] + template = "native" } copy("copy_files") { deps = [ "//chrome/browser/ui/webui/usb_internals:mojo_bindings_webui_js", + "//services/device/public/mojom:usb_test_js", "//services/device/public/mojom:usb_webui_js", ] - sources = non_web_components_files + [ + sources = ts_files + [ "$root_gen_dir/mojom-webui/services/device/public/mojom/usb_device.mojom-webui.js", + "$root_gen_dir/mojom-webui/services/device/public/mojom/usb_manager.mojom-webui.js", + "$root_gen_dir/mojom-webui/services/device/public/mojom/usb_manager_test.mojom-webui.js", "$root_gen_dir/mojom-webui/chrome/browser/ui/webui/usb_internals/usb_internals.mojom-webui.js", ] outputs = [ "$target_gen_dir/{{source_file_part}}" ] @@ -58,9 +63,11 @@ ts_library("build_ts") { root_dir = target_gen_dir - in_files = web_components_files + non_web_components_files + [ + in_files = ts_files + html_wrapper_files + [ "usb_internals.mojom-webui.js", "usb_device.mojom-webui.js", + "usb_manager.mojom-webui.js", + "usb_manager_test.mojom-webui.js", ] out_dir = "$target_gen_dir/tsc" tsconfig_base = "tsconfig_base.json" @@ -71,6 +78,6 @@ ] extra_deps = [ ":copy_files", - ":web_components", + ":html_wrapper_files", ] }
diff --git a/chrome/browser/resources/usb_internals/app.js b/chrome/browser/resources/usb_internals/app.js deleted file mode 100644 index 7ea72af6..0000000 --- a/chrome/browser/resources/usb_internals/app.js +++ /dev/null
@@ -1,117 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * Javascript for usb_internals.html, served from chrome://usb-internals/. - */ - -import 'chrome://resources/cr_elements/cr_tab_box/cr_tab_box.js'; - -import {assert} from 'chrome://resources/js/assert.m.js'; -import {getTrustedHTML} from 'chrome://resources/js/static_types.js'; - -import {DevicesPage} from './devices_page.js'; -import {UsbInternalsPageHandler} from './usb_internals.mojom-webui.js'; -import {UsbDeviceManagerRemote} from './usb_manager.mojom-webui.js'; -import {UsbDeviceManagerTestRemote} from './usb_manager_test.mojom-webui.js'; - -window.setupFn = window.setupFn || function() { - return Promise.resolve(); -}; - -class UsbInternalsAppElement extends HTMLElement { - static get template() { - return getTrustedHTML`{__html_template__}`; - } - - constructor() { - super(); - - this.attachShadow({mode: 'open'}); - const template = document.createElement('template'); - template.innerHTML = this.constructor.template || trustedTypes.emptyHTML; - this.shadowRoot.appendChild(template.content.cloneNode(true)); - } - - /** - * @param {string} query - * @return {?Element} - */ - $(query) { - return this.shadowRoot.querySelector(query); - } - - async connectedCallback() { - // window.setupFn() provides a hook for the test suite to perform setup - // actions after the page is loaded but before any script is run. - await window.setupFn(); - - const pageHandler = UsbInternalsPageHandler.getRemote(); - - // Connection to the UsbInternalsPageHandler instance running in the - // browser process. - /** @type {UsbDeviceManagerRemote} */ - const usbManager = new UsbDeviceManagerRemote(); - await pageHandler.bindUsbDeviceManagerInterface( - usbManager.$.bindNewPipeAndPassReceiver()); - - /** @private {!DevicesPage} */ - this.devicesPage_ = new DevicesPage(usbManager, assert(this.shadowRoot)); - - /** @private {UsbDeviceManagerTestRemote} */ - this.usbManagerTest_ = new UsbDeviceManagerTestRemote(); - await pageHandler.bindTestInterface( - this.usbManagerTest_.$.bindNewPipeAndPassReceiver()); - - this.$('#add-test-device-form').addEventListener('submit', (event) => { - this.addTestDevice(event); - }); - this.refreshTestDeviceList(); - - const tabbox = this.$('cr-tab-box'); - tabbox.hidden = false; - } - - async refreshTestDeviceList() { - const response = await this.usbManagerTest_.getTestDevices(); - - const tableBody = this.$('#test-device-list'); - tableBody.innerHTML = trustedTypes.emptyHTML; - - const rowTemplate = this.$('#test-device-row'); - const td = rowTemplate.content.querySelectorAll('td'); - - for (const device of response.devices) { - td[0].textContent = device.name; - td[1].textContent = device.serialNumber; - td[2].textContent = device.landingPage.url; - - const clone = document.importNode(rowTemplate.content, true); - - const removeButton = clone.querySelector('button'); - removeButton.addEventListener('click', async () => { - await this.usbManagerTest_.removeDeviceForTesting(device.guid); - this.refreshTestDeviceList(); - }); - - tableBody.appendChild(clone); - } - } - - async addTestDevice(event) { - event.preventDefault(); - - const response = await this.usbManagerTest_.addDeviceForTesting( - this.$('#test-device-name').value, this.$('#test-device-serial').value, - this.$('#test-device-landing-page').value); - if (response.success) { - this.refreshTestDeviceList(); - } - - this.$('#add-test-device-result').textContent = response.message; - this.$('#add-test-device-result').className = - response.success ? 'action-success' : 'action-failure'; - } -} -customElements.define('usb-internals-app', UsbInternalsAppElement);
diff --git a/chrome/browser/resources/usb_internals/app.ts b/chrome/browser/resources/usb_internals/app.ts new file mode 100644 index 0000000..7b27566 --- /dev/null +++ b/chrome/browser/resources/usb_internals/app.ts
@@ -0,0 +1,126 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * Javascript for usb_internals.html, served from chrome://usb-internals/. + */ + +import 'chrome://resources/cr_elements/cr_tab_box/cr_tab_box.js'; + +import {assert} from 'chrome://resources/js/assert_ts.js'; + +import {getTemplate} from './app.html.js'; +import {DevicesPage} from './devices_page.js'; +import {UsbInternalsPageHandler} from './usb_internals.mojom-webui.js'; +import {UsbDeviceManagerRemote} from './usb_manager.mojom-webui.js'; +import {UsbDeviceManagerTestRemote} from './usb_manager_test.mojom-webui.js'; + +let setupFn: () => Promise<void> = () => { + return Promise.resolve(); +}; + +export function setSetupFn(newSetupFn: () => Promise<void>) { + setupFn = newSetupFn; +} + +class UsbInternalsAppElement extends HTMLElement { + private usbManagerTest_: UsbDeviceManagerTestRemote|null = null; + + static get template() { + return getTemplate(); + } + + constructor() { + super(); + + this.attachShadow({mode: 'open'}); + const template = document.createElement('template'); + template.innerHTML = (UsbInternalsAppElement.template || + window.trustedTypes!.emptyHTML) as unknown as string; + this.shadowRoot!.appendChild(template.content.cloneNode(true)); + } + + $<T extends Element>(query: string): T { + const element = this.shadowRoot!.querySelector<T>(query); + assert(element); + return element; + } + + async connectedCallback() { + // setupFn() provides a hook for the test suite to perform setup + // actions after the page is loaded but before any script is run. + await setupFn(); + + const pageHandler = UsbInternalsPageHandler.getRemote(); + + // Connection to the UsbInternalsPageHandler instance running in the + // browser process. + const usbManager = new UsbDeviceManagerRemote(); + await pageHandler.bindUsbDeviceManagerInterface( + usbManager.$.bindNewPipeAndPassReceiver()); + + new DevicesPage(usbManager, this.shadowRoot!); + + this.usbManagerTest_ = new UsbDeviceManagerTestRemote(); + await pageHandler.bindTestInterface( + this.usbManagerTest_.$.bindNewPipeAndPassReceiver()); + + this.$<HTMLElement>('#add-test-device-form') + .addEventListener('submit', (event: Event) => { + this.addTestDevice(event); + }); + this.refreshTestDeviceList(); + + const tabbox = this.$<HTMLElement>('cr-tab-box'); + tabbox.hidden = false; + } + + async refreshTestDeviceList() { + assert(this.usbManagerTest_); + const response = await this.usbManagerTest_.getTestDevices(); + + const tableBody = this.$<HTMLElement>('#test-device-list'); + tableBody.innerHTML = window.trustedTypes!.emptyHTML as unknown as string; + + const rowTemplate = this.$<HTMLTemplateElement>('#test-device-row'); + const td = rowTemplate.content.querySelectorAll('td'); + + for (const device of response.devices) { + td[0]!.textContent = device.name; + td[1]!.textContent = device.serialNumber; + td[2]!.textContent = device.landingPage.url; + + const clone = document.importNode(rowTemplate.content, true); + + const removeButton = clone.querySelector('button'); + assert(removeButton); + removeButton.addEventListener('click', async () => { + assert(this.usbManagerTest_); + await this.usbManagerTest_.removeDeviceForTesting(device.guid); + this.refreshTestDeviceList(); + }); + + tableBody.appendChild(clone); + } + } + + async addTestDevice(event: Event) { + event.preventDefault(); + + assert(this.usbManagerTest_); + const response = await this.usbManagerTest_.addDeviceForTesting( + this.$<HTMLInputElement>('#test-device-name').value, + this.$<HTMLInputElement>('#test-device-serial').value, + this.$<HTMLInputElement>('#test-device-landing-page').value); + if (response.success) { + this.refreshTestDeviceList(); + } + + this.$<HTMLElement>('#add-test-device-result').textContent = + response.message; + this.$<HTMLElement>('#add-test-device-result').className = + response.success ? 'action-success' : 'action-failure'; + } +} +customElements.define('usb-internals-app', UsbInternalsAppElement);
diff --git a/chrome/browser/resources/usb_internals/devices_page.js b/chrome/browser/resources/usb_internals/devices_page.ts similarity index 64% rename from chrome/browser/resources/usb_internals/devices_page.js rename to chrome/browser/resources/usb_internals/devices_page.ts index 5a83aad..ba8514c 100644 --- a/chrome/browser/resources/usb_internals/devices_page.js +++ b/chrome/browser/resources/usb_internals/devices_page.ts
@@ -10,118 +10,92 @@ import 'chrome://resources/cr_elements/cr_tree/cr_tree.js'; import 'chrome://resources/cr_elements/cr_tree/cr_tree_item.js'; -import {assertInstanceof} from 'chrome://resources/js/assert.m.js'; -import {queryRequiredElement} from 'chrome://resources/js/util.m.js'; +import {CrTreeElement} from 'chrome://resources/cr_elements/cr_tree/cr_tree.js'; +import {CrTreeItemElement} from 'chrome://resources/cr_elements/cr_tree/cr_tree_item.js'; +import {assert} from 'chrome://resources/js/assert_ts.js'; import {String16} from 'chrome://resources/mojo/mojo/public/mojom/base/string16.mojom-webui.js'; import {DescriptorPanel, renderClassCodeWithDescription} from './descriptor_panel.js'; import {UsbAlternateInterfaceInfo, UsbConfigurationInfo, UsbDeviceInfo, UsbDeviceRemote, UsbEndpointInfo, UsbInterfaceInfo, UsbTransferDirection, UsbTransferType} from './usb_device.mojom-webui.js'; import {UsbDeviceManagerRemote} from './usb_manager.mojom-webui.js'; -// TODO (rbpotter): Remove these temporary definitions after migrating to TS. -/** - * @typedef {{ - * expanded: boolean, - * add: function(CrTreeItemElement): void, - * labelElement: HTMLElement, - * rowElement: HTMLElement, - * forceHoverStyle: function(boolean): void, - * }} - */ -export let CrTreeItemElement; - -/** - * @typedef {{ - * add: function(CrTreeItemElement): void, - * detail: {payload: Object, children: Object}, - * removeTreeItem: function(CrTreeItemElement): void, - * expanded: boolean, - * items: Array<CrTreeItemElement>, - * selectedItem: CrTreeItemElement, - * }} - */ -export let CrTreeElement; - - - /** * Page that contains a tab header and a tab panel displaying devices table. */ export class DevicesPage { - /** - * @param {!UsbDeviceManagerRemote} usbManager - * @param {!ShadowRoot} root - */ - constructor(usbManager, root) { - /** @private {!UsbDeviceManagerRemote} */ + private usbManager_: UsbDeviceManagerRemote; + private root_: DocumentFragment; + + constructor(usbManager: UsbDeviceManagerRemote, root: DocumentFragment) { this.usbManager_ = usbManager; - this.root = root; + this.root_ = root; this.renderDeviceList_(); } /** * Sets the device collection for the page's device table. - * @private */ - async renderDeviceList_() { + private async renderDeviceList_() { const response = await this.usbManager_.getDevices(null); - /** @type {!Array<!UsbDeviceInfo>} */ - const devices = response.results; + const devices: UsbDeviceInfo[] = response.results; - const tableBody = this.root.querySelector('#device-list'); - tableBody.innerHTML = trustedTypes.emptyHTML; + const tableBody = this.root_.querySelector<HTMLElement>('#device-list'); + assert(tableBody); + tableBody.innerHTML = window.trustedTypes!.emptyHTML as unknown as string; - const rowTemplate = this.root.querySelector('#device-row'); + const rowTemplate = + this.root_.querySelector<HTMLTemplateElement>('#device-row'); + assert(rowTemplate); for (const device of devices) { - /** @type {DocumentFragment|Node} */ - const clone = document.importNode(rowTemplate.content, true); + const clone = + document.importNode(rowTemplate.content, true) as DocumentFragment; const td = clone.querySelectorAll('td'); - td[0].textContent = device.busNumber; - td[1].textContent = device.portNumber; - td[2].textContent = toHex(device.vendorId); - td[3].textContent = toHex(device.productId); + td[0]!.textContent = String(device.busNumber); + td[1]!.textContent = String(device.portNumber); + td[2]!.textContent = toHex(device.vendorId); + td[3]!.textContent = toHex(device.productId); if (device.manufacturerName) { - td[4].textContent = decodeString16(device.manufacturerName); + td[4]!.textContent = decodeString16(device.manufacturerName); } if (device.productName) { - td[5].textContent = decodeString16(device.productName); + td[5]!.textContent = decodeString16(device.productName); } if (device.serialNumber) { - td[6].textContent = decodeString16(device.serialNumber); + td[6]!.textContent = decodeString16(device.serialNumber); } const inspectButton = clone.querySelector('button'); + assert(inspectButton); inspectButton.addEventListener('click', () => { this.switchToTab_(device); }); tableBody.appendChild(clone); } - // window.deviceListCompleteFn() provides a hook for the test suite to - // perform test actions after the devices list is loaded. - window.deviceListCompleteFn(); + + document.body.dispatchEvent(new CustomEvent( + 'device-list-complete-for-test', {bubbles: true, composed: true})); } /** * Switches to the device's tab, creating one if necessary. - * @param {!UsbDeviceInfo} device - * @private */ - switchToTab_(device) { - const tabs = Array.from(this.root.querySelectorAll('div[slot=\'tab\']')); + private switchToTab_(device: UsbDeviceInfo) { + const tabs = Array.from(this.root_.querySelectorAll('div[slot=\'tab\']')); const tabId = device.guid; let index = tabs.findIndex(tab => tab.id === tabId); if (index === -1) { - const devicePage = new DevicePage(this.usbManager_, device, this.root); + new DevicePage(this.usbManager_, device, this.root_); index = tabs.length; } - const tabBox = this.root.querySelector('cr-tab-box'); - tabBox.setAttribute('selected-index', index); + const tabBox = this.root_.querySelector('cr-tab-box'); + assert(tabBox); + tabBox.setAttribute('selected-index', String(index)); } } @@ -130,12 +104,12 @@ * descriptors. */ class DevicePage { - /** - * @param {!UsbDeviceManagerRemote} usbManager - * @param {!UsbDeviceInfo} device - * @param {!ShadowRoot} root - */ - constructor(usbManager, device, root) { + private usbManager_: UsbDeviceManagerRemote; + root: DocumentFragment; + + constructor( + usbManager: UsbDeviceManagerRemote, device: UsbDeviceInfo, + root: DocumentFragment) { this.usbManager_ = usbManager; this.root = root; this.renderTab_(device); @@ -143,17 +117,19 @@ /** * Renders a tab to display a tree view showing device's detail information. - * @param {!UsbDeviceInfo} device - * @private */ - renderTab_(device) { + private renderTab_(device: UsbDeviceInfo) { const tabBox = this.root.querySelector('cr-tab-box'); + assert(tabBox); - const tabTemplate = queryRequiredElement('#tab-template', this.root); - /** @type {DocumentFragment|Node} */ - const tabClone = document.importNode(tabTemplate.content, true); + const tabTemplate = + this.root.querySelector<HTMLTemplateElement>('#tab-template'); + assert(tabTemplate); + const tabClone = + document.importNode(tabTemplate.content, true) as DocumentFragment; - const tab = tabClone.querySelector('div[slot=\'tab\']'); + const tab = tabClone.querySelector<HTMLElement>('div[slot=\'tab\']'); + assert(tab); if (device.productName && device.productName.data.length > 0) { tab.textContent = decodeString16(device.productName); } else { @@ -166,23 +142,26 @@ const firstPanel = tabBox.querySelector('div[slot=\'panel\']'); tabBox.insertBefore(tab, firstPanel); - const tabPanelTemplate = - queryRequiredElement('#device-tabpanel-template', this.root); - /** @type {DocumentFragment|Node} */ - const tabPanelClone = document.importNode(tabPanelTemplate.content, true); + const tabPanelTemplate = this.root.querySelector<HTMLTemplateElement>( + '#device-tabpanel-template'); + assert(tabPanelTemplate); + const tabPanelClone = + document.importNode(tabPanelTemplate.content, true) as DocumentFragment; /** * Root of the WebContents tree of current device. */ - const treeViewRoot = assertInstanceof( - tabPanelClone.querySelector('.tree-view'), HTMLElement); + const treeViewRoot = + tabPanelClone.querySelector<CrTreeElement>('.tree-view'); + assert(treeViewRoot); treeViewRoot.detail = {payload: {}, children: {}}; // Clear the tree first before populating it with the new content. treeViewRoot.innerText = ''; - renderDeviceTree(device, /** @type {CrTreeElement} */ (treeViewRoot)); + renderDeviceTree(device, treeViewRoot); - const tabPanel = assertInstanceof( - tabPanelClone.querySelector('div[slot=\'panel\']'), HTMLElement); + const tabPanel = + tabPanelClone.querySelector<HTMLElement>('div[slot=\'panel\']'); + assert(tabPanel); this.initializeDescriptorPanels_(tabPanel, device.guid); tabBox.appendChild(tabPanel); @@ -190,12 +169,11 @@ /** * Initializes all the descriptor panels. - * @param {!HTMLElement} tabPanel - * @param {string} guid - * @private */ - async initializeDescriptorPanels_(tabPanel, guid) { + private async initializeDescriptorPanels_( + tabPanel: HTMLElement, guid: string) { const usbDevice = new UsbDeviceRemote(); + assert(this.usbManager_); await this.usbManager_.getDevice( guid, /*blocked_interface_classes=*/[], usbDevice.$.bindNewPipeAndPassReceiver(), /*device_client=*/ null); @@ -216,19 +194,15 @@ initialInspectorPanel(tabPanel, 'testing-tool', usbDevice, guid); - // window.deviceTabInitializedFn() provides a hook for the test suite to - // perform test actions after the device tab query descriptors actions are - // initialized. - window.deviceTabInitializedFn(); + document.body.dispatchEvent(new CustomEvent( + 'device-tab-initialized-for-test', {bubbles: true, composed: true})); } } /** * Renders a tree to display the device's detail information. - * @param {!UsbDeviceInfo} device - * @param {!CrTreeElement} root */ -function renderDeviceTree(device, root) { +function renderDeviceTree(device: UsbDeviceInfo, root: CrTreeElement) { root.add(customTreeItem(`USB Version: ${device.usbVersionMajor}.${ device.usbVersionMinor}.${device.usbVersionSubminor}`)); @@ -265,11 +239,11 @@ if (device.webusbLandingPage) { const urlItem = - customTreeItem(`WebUSB Landing Page: ${device.webusbLandingPage.url}`); + customTreeItem(`WebUSB Landing Page: ${device.webusbLandingPage!.url}`); root.add(urlItem); urlItem.labelElement.addEventListener( - 'click', () => window.open(device.webusbLandingPage.url, '_blank')); + 'click', () => window.open(device.webusbLandingPage!.url, '_blank')); } root.add( @@ -281,10 +255,9 @@ /** * Renders a tree item to display the device's configuration information. - * @param {!Array<!UsbConfigurationInfo>} configurationsArray - * @param {!CrTreeElement} root */ -function renderConfigurationTreeItem(configurationsArray, root) { +function renderConfigurationTreeItem( + configurationsArray: UsbConfigurationInfo[], root: CrTreeElement) { for (const configuration of configurationsArray) { const configurationItem = customTreeItem(`Configuration ${configuration.configurationValue}`); @@ -303,10 +276,9 @@ /** * Renders a tree item to display the device's interface information. - * @param {!Array<!UsbInterfaceInfo>} interfacesArray - * @param {!CrTreeItemElement} root */ -function renderInterfacesTreeItem(interfacesArray, root) { +function renderInterfacesTreeItem( + interfacesArray: UsbInterfaceInfo[], root: CrTreeItemElement) { for (const currentInterface of interfacesArray) { const interfaceItem = customTreeItem(`Interface ${currentInterface.interfaceNumber}`); @@ -321,10 +293,9 @@ /** * Renders a tree item to display the device's alternate interfaces * information. - * @param {!Array<!UsbAlternateInterfaceInfo>} alternatesArray - * @param {!CrTreeItemElement} root */ -function renderAlternatesTreeItem(alternatesArray, root) { +function renderAlternatesTreeItem( + alternatesArray: UsbAlternateInterfaceInfo[], root: CrTreeItemElement) { for (const alternate of alternatesArray) { const alternateItem = customTreeItem(`Alternate ${alternate.alternateSetting}`); @@ -352,10 +323,9 @@ /** * Renders a tree item to display the device's endpoints information. - * @param {!Array<!UsbEndpointInfo>} endpointsArray - * @param {!CrTreeItemElement} root */ -function renderEndpointsTreeItem(endpointsArray, root) { +function renderEndpointsTreeItem( + endpointsArray: UsbEndpointInfo[], root: CrTreeItemElement) { for (const endpoint of endpointsArray) { let itemLabel = 'Endpoint '; @@ -398,17 +368,16 @@ /** * Initialize a descriptor panel. - * @param {!HTMLElement} tabPanel - * @param {string} panelType - * @param {!UsbDeviceRemote} usbDevice - * @param {string} guid - * @return {!DescriptorPanel} */ -function initialInspectorPanel(tabPanel, panelType, usbDevice, guid) { - const button = queryRequiredElement(`.${panelType}-button`, tabPanel); - const displayElement = queryRequiredElement(`.${panelType}-panel`, tabPanel); - const descriptorPanel = new DescriptorPanel( - usbDevice, /** @type {!HTMLElement} */ (displayElement)); +function initialInspectorPanel( + tabPanel: HTMLElement, panelType: string, usbDevice: UsbDeviceRemote, + guid: string): DescriptorPanel { + const button = tabPanel.querySelector<HTMLElement>(`.${panelType}-button`); + assert(button); + const displayElement = + tabPanel.querySelector<HTMLElement>(`.${panelType}-panel`); + assert(displayElement); + const descriptorPanel = new DescriptorPanel(usbDevice, displayElement); switch (panelType) { case 'string-descriptor': descriptorPanel.initialStringDescriptorPanel(guid); @@ -445,35 +414,23 @@ /** * Parses utf16 coded string. - * @param {!String16} arr - * @return {string} */ -function decodeString16(arr) { +function decodeString16(arr: String16): string { return arr.data.map(ch => String.fromCodePoint(ch)).join(''); } /** * Parses the decimal number to hex format. - * @param {number} num - * @return {string} */ -function toHex(num) { +function toHex(num: number): string { return `0x${num.toString(16).padStart(4, '0').toUpperCase()}`; } /** * Renders a customized TreeItem with the given content and class name. - * @param {string} itemLabel - * @return {!CrTreeItemElement} - * @private */ -function customTreeItem(itemLabel) { - const item = - /** @type {CrTreeItemElement} */ (document.createElement('cr-tree-item')); +function customTreeItem(itemLabel: string): CrTreeItemElement { + const item = document.createElement('cr-tree-item'); item.label = itemLabel; return item; } - -window.deviceListCompleteFn = window.deviceListCompleteFn || function() {}; - -window.deviceTabInitializedFn = window.deviceTabInitializedFn || function() {};
diff --git a/chrome/browser/resources/usb_internals/tsconfig_base.json b/chrome/browser/resources/usb_internals/tsconfig_base.json index 99a81eca..4ca1e52 100644 --- a/chrome/browser/resources/usb_internals/tsconfig_base.json +++ b/chrome/browser/resources/usb_internals/tsconfig_base.json
@@ -1,6 +1,12 @@ { "extends": "../../../../tools/typescript/tsconfig_base.json", "compilerOptions": { - "allowJs": true + "allowJs": true, + "typeRoots": [ + "../../../../third_party/node/node_modules/@types" + ], + "types": [ + "trusted-types" + ] } }
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/reporter_histogram_recorder.cc b/chrome/browser/safe_browsing/chrome_cleaner/reporter_histogram_recorder.cc index f73df2cf..e4934546 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/reporter_histogram_recorder.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/reporter_histogram_recorder.cc
@@ -7,11 +7,10 @@ #include <vector> #include "base/check.h" -#include "base/metrics/histogram.h" -#include "base/metrics/histogram_base.h" -#include "base/metrics/sparse_histogram.h" +#include "base/metrics/histogram_functions.h" +#include "base/strings/strcat.h" +#include "base/strings/strcat_win.h" #include "base/strings/string_number_conversions_win.h" -#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" #include "base/version.h" @@ -24,14 +23,34 @@ namespace { // Used to send UMA information about missing logs upload result in the registry -// for the reporter. Replicated in the histograms.xml file, so the order -// MUST NOT CHANGE. -enum SwReporterLogsUploadResultRegistryError { - REPORTER_LOGS_UPLOAD_RESULT_ERROR_NO_ERROR = 0, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_REGISTRY_KEY_INVALID = 1, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_VALUE_NOT_FOUND = 2, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_VALUE_OUT_OF_BOUNDS = 3, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_MAX, +// for the reporter. Matches SoftwareReporterLogsUploadResultRegistryError in +// enums.xml. +// +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum class LogsUploadResultRegistryError { + NO_ERROR = 0, + REGISTRY_KEY_INVALID = 1, + VALUE_NOT_FOUND = 2, + VALUE_OUT_OF_BOUNDS = 3, + kMaxValue = VALUE_OUT_OF_BOUNDS, +}; + +// Network errors encountered by the reporter when uploading logs, written by +// the reporter to the registry. Matches SoftwareReporterLogsUploadResult in +// enums.xml. +// +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum class LogsUploadResult { + kSuccess = 0, + kRequestFailed = 1, + kInvalidResponse = 2, + kTimedOut = 3, + kInternalError = 4, + kReportTooLarge = 5, + kNoNetwork = 6, + kMaxValue = kNoNetwork, }; const char kFoundUwsMetricName[] = "SoftwareReporter.FoundUwS"; @@ -46,27 +65,15 @@ const char kExitCodeMetricName[] = "SoftwareReporter.ExitCodeFromRegistry"; const char kEngineErrorCodeMetricName[] = "SoftwareReporter.EngineErrorCode"; -// The max value for histogram SoftwareReporter.LogsUploadResult, which is used -// to send UMA information about the result of Software Reporter's attempt to -// upload logs, when logs are enabled. This value must be consistent with the -// SoftwareReporterLogsUploadResult enum defined in the histograms.xml file. -const int kSwReporterLogsUploadResultMax = 30; - -// TODO(crbug.com/1335637): Should use the UmaHistogram functions instead -// of relying on this histogram implementation detail. -constexpr base::HistogramBase::Flags kUmaHistogramFlag = - base::HistogramBase::kUmaTargetedHistogramFlag; - } // namespace ReporterHistogramRecorder::ReporterHistogramRecorder(const std::string& suffix) : suffix_(suffix), - registry_key_(suffix.empty() - ? chrome_cleaner::kSoftwareRemovalToolRegistryKey - : base::StringPrintf( - L"%ls\\%ls", - chrome_cleaner::kSoftwareRemovalToolRegistryKey, - base::UTF8ToUTF16(suffix).c_str())) {} + registry_key_( + suffix.empty() + ? chrome_cleaner::kSoftwareRemovalToolRegistryKey + : base::StrCat({chrome_cleaner::kSoftwareRemovalToolRegistryKey, + L"\\", base::UTF8ToWide(suffix)})) {} void ReporterHistogramRecorder::RecordVersion( const base::Version& version) const { @@ -78,7 +85,8 @@ minor_version = version.components()[version.components().size() - 2]; else minor_version = version.components()[0]; - RecordSparseHistogram("SoftwareReporter.MinorVersion", minor_version); + base::UmaHistogramSparse(FullName("SoftwareReporter.MinorVersion"), + minor_version); // The major version for X.Y.Z is X*256^3+Y*256+Z. If there are additional // components, only the first three count, and if there are less than 3, the @@ -93,7 +101,8 @@ DCHECK_LT(version.components()[2], 0x100U); major_version += version.components()[2]; } - RecordSparseHistogram("SoftwareReporter.MajorVersion", major_version); + base::UmaHistogramSparse(FullName("SoftwareReporter.MajorVersion"), + major_version); } void ReporterHistogramRecorder::RecordExitCode(int exit_code) const { @@ -107,7 +116,8 @@ return; } - RecordSparseHistogram(kExitCodeMetricName, exit_code_in_registry); + base::UmaHistogramSparse(FullName(kExitCodeMetricName), + exit_code_in_registry); reporter_key.DeleteValue(chrome_cleaner::kExitCodeValueName); } @@ -121,7 +131,8 @@ return; } - RecordSparseHistogram(kEngineErrorCodeMetricName, engine_error_code); + base::UmaHistogramSparse(FullName(kEngineErrorCodeMetricName), + engine_error_code); reporter_key.DeleteValue(chrome_cleaner::kEngineErrorCodeValueName); } @@ -140,7 +151,7 @@ // All UwS ids are expected to be integers. uint32_t uws_id = 0; if (base::StringToUint(uws_string, &uws_id)) { - RecordSparseHistogram(kFoundUwsMetricName, uws_id); + base::UmaHistogramSparse(FullName(kFoundUwsMetricName), uws_id); } else { parse_error = true; } @@ -148,7 +159,8 @@ // Clean up the old value. reporter_key.DeleteValue(chrome_cleaner::kFoundUwsValueName); - RecordBooleanHistogram(kFoundUwsReadErrorMetricName, parse_error); + base::UmaHistogramBoolean(FullName(kFoundUwsReadErrorMetricName), + parse_error); } void ReporterHistogramRecorder::RecordMemoryUsage() const { @@ -160,17 +172,19 @@ &memory_used) != ERROR_SUCCESS) { return; } - RecordMemoryKBHistogram(kMemoryUsedMetricName, memory_used); + base::UmaHistogramMemoryKB(FullName(kMemoryUsedMetricName), memory_used); reporter_key.DeleteValue(chrome_cleaner::kMemoryUsedValueName); } void ReporterHistogramRecorder::RecordRuntime( const base::TimeDelta& reporter_running_time, const base::TimeDelta& running_time_without_sleep) const { - RecordLongTimesHistogram("SoftwareReporter.RunningTimeAccordingToChrome2", - reporter_running_time); - RecordLongTimesHistogram("SoftwareReporter.RunningTimeWithoutSleep2", - running_time_without_sleep); + base::UmaHistogramLongTimes( + FullName("SoftwareReporter.RunningTimeAccordingToChrome2"), + reporter_running_time); + base::UmaHistogramLongTimes( + FullName("SoftwareReporter.RunningTimeWithoutSleep2"), + running_time_without_sleep); // TODO(b/641081): This should only have KEY_QUERY_VALUE and KEY_SET_VALUE. base::win::RegKey reporter_key; @@ -186,8 +200,7 @@ void ReporterHistogramRecorder::RecordLogsUploadEnabled( SwReporterLogsUploadsEnabled value) const { - RecordEnumerationHistogram(kLogsUploadEnabledMetricName, value, - REPORTER_LOGS_UPLOADS_MAX); + base::UmaHistogramEnumeration(FullName(kLogsUploadEnabledMetricName), value); } void ReporterHistogramRecorder::RecordLogsUploadResult() const { @@ -195,94 +208,46 @@ DWORD logs_upload_result = 0; if (reporter_key.Open(HKEY_CURRENT_USER, registry_key_.c_str(), KEY_QUERY_VALUE | KEY_SET_VALUE) != ERROR_SUCCESS) { - RecordEnumerationHistogram( - kLogsUploadResultRegistryErrorMetricName, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_REGISTRY_KEY_INVALID, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_MAX); + base::UmaHistogramEnumeration( + FullName(kLogsUploadResultRegistryErrorMetricName), + LogsUploadResultRegistryError::REGISTRY_KEY_INVALID); return; } if (reporter_key.ReadValueDW(chrome_cleaner::kLogsUploadResultValueName, &logs_upload_result) != ERROR_SUCCESS) { - RecordEnumerationHistogram( - kLogsUploadResultRegistryErrorMetricName, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_VALUE_NOT_FOUND, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_MAX); + base::UmaHistogramEnumeration( + FullName(kLogsUploadResultRegistryErrorMetricName), + LogsUploadResultRegistryError::VALUE_NOT_FOUND); return; } - if (logs_upload_result >= kSwReporterLogsUploadResultMax) { - RecordEnumerationHistogram( - kLogsUploadResultRegistryErrorMetricName, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_VALUE_OUT_OF_BOUNDS, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_MAX); + if (logs_upload_result < 0 || + logs_upload_result >= static_cast<DWORD>(LogsUploadResult::kMaxValue)) { + base::UmaHistogramEnumeration( + FullName(kLogsUploadResultRegistryErrorMetricName), + LogsUploadResultRegistryError::VALUE_OUT_OF_BOUNDS); return; } - RecordEnumerationHistogram(kLogsUploadResultMetricName, - static_cast<Sample>(logs_upload_result), - kSwReporterLogsUploadResultMax); + base::UmaHistogramEnumeration( + FullName(kLogsUploadResultMetricName), + static_cast<LogsUploadResult>(logs_upload_result)); reporter_key.DeleteValue(chrome_cleaner::kLogsUploadResultValueName); - RecordEnumerationHistogram(kLogsUploadResultRegistryErrorMetricName, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_NO_ERROR, - REPORTER_LOGS_UPLOAD_RESULT_ERROR_MAX); + base::UmaHistogramEnumeration( + FullName(kLogsUploadResultRegistryErrorMetricName), + LogsUploadResultRegistryError::NO_ERROR); } void ReporterHistogramRecorder::RecordCreateJobResult(DWORD result) const { - RecordSparseHistogram("SoftwareReporter.CreateJobResult", result); + base::UmaHistogramSparse(FullName("SoftwareReporter.CreateJobResult"), + result); } std::string ReporterHistogramRecorder::FullName(const std::string& name) const { if (suffix_.empty()) return name; - return base::StringPrintf("%s_%s", name.c_str(), suffix_.c_str()); -} - -void ReporterHistogramRecorder::RecordBooleanHistogram(const std::string& name, - bool sample) const { - auto* histogram = - base::BooleanHistogram::FactoryGet(FullName(name), kUmaHistogramFlag); - if (histogram) - histogram->AddBoolean(sample); -} - -void ReporterHistogramRecorder::RecordEnumerationHistogram( - const std::string& name, - Sample sample, - Sample boundary) const { - // See HISTOGRAM_ENUMERATION_WITH_FLAG for the parameters to |FactoryGet|. - auto* histogram = base::LinearHistogram::FactoryGet( - FullName(name), 1, boundary, boundary + 1, kUmaHistogramFlag); - if (histogram) - histogram->Add(sample); -} - -void ReporterHistogramRecorder::RecordLongTimesHistogram( - const std::string& name, - const base::TimeDelta& sample) const { - // See UMA_HISTOGRAM_LONG_TIMES for the parameters to |FactoryTimeGet|. - auto* histogram = - base::Histogram::FactoryTimeGet(FullName(name), base::Milliseconds(1), - base::Hours(1), 100, kUmaHistogramFlag); - if (histogram) - histogram->AddTime(sample); -} - -void ReporterHistogramRecorder::RecordMemoryKBHistogram(const std::string& name, - Sample sample) const { - // See UMA_HISTOGRAM_MEMORY_KB for the parameters to |FactoryGet|. - auto* histogram = base::Histogram::FactoryGet(FullName(name), 1000, 500000, - 50, kUmaHistogramFlag); - if (histogram) - histogram->Add(sample); -} - -void ReporterHistogramRecorder::RecordSparseHistogram(const std::string& name, - Sample sample) const { - auto* histogram = - base::SparseHistogram::FactoryGet(FullName(name), kUmaHistogramFlag); - if (histogram) - histogram->Add(sample); + return base::StrCat({name, "_", suffix_}); } } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/reporter_histogram_recorder.h b/chrome/browser/safe_browsing/chrome_cleaner/reporter_histogram_recorder.h index 71d25341..37e7964 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/reporter_histogram_recorder.h +++ b/chrome/browser/safe_browsing/chrome_cleaner/reporter_histogram_recorder.h
@@ -7,7 +7,6 @@ #include <string> -#include "base/metrics/histogram_base.h" #include "base/time/time.h" #include "base/version.h" #include "base/win/windows_types.h" @@ -15,16 +14,19 @@ namespace safe_browsing { // Used to send UMA information showing whether uploading of Software Reporter -// logs is enabled, or the reason why not. -// Replicated in the histograms.xml file, so the order MUST NOT CHANGE. -enum SwReporterLogsUploadsEnabled { - REPORTER_LOGS_UPLOADS_SBER_ENABLED = 0, - REPORTER_LOGS_UPLOADS_SBER_DISABLED = 1, - REPORTER_LOGS_UPLOADS_RECENTLY_SENT_LOGS = 2, - REPORTER_LOGS_UPLOADS_DISABLED_BY_USER = 3, - REPORTER_LOGS_UPLOADS_ENABLED_BY_USER = 4, - REPORTER_LOGS_UPLOADS_DISABLED_BY_POLICY = 5, - REPORTER_LOGS_UPLOADS_MAX, +// logs is enabled, or the reason why not. Matches +// SoftwareReporterLogsUploadEnabled in enums.xml. +// +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum class SwReporterLogsUploadsEnabled { + SBER_ENABLED = 0, + SBER_DISABLED = 1, + RECENTLY_SENT_LOGS = 2, + DISABLED_BY_USER = 3, + ENABLED_BY_USER = 4, + DISABLED_BY_POLICY = 5, + kMaxValue = DISABLED_BY_POLICY, }; // Records metrics about the software reporter to UMA histograms. @@ -74,29 +76,9 @@ void RecordCreateJobResult(DWORD result) const; private: - // TODO(crbug.com/1335637): Should use the UmaHistogram functions instead - // of relying on this histogram implementation detail. - using Sample = base::HistogramBase::Sample; - - // Helper functions to record histograms with an optional suffix added to the - // histogram name. The UMA_HISTOGRAM macros can't be used because they - // require a constant string. - + // Returns `name` with an optional suffix added. std::string FullName(const std::string& name) const; - void RecordBooleanHistogram(const std::string& name, bool sample) const; - - void RecordEnumerationHistogram(const std::string& name, - Sample sample, - Sample boundary) const; - - void RecordLongTimesHistogram(const std::string& name, - const base::TimeDelta& sample) const; - - void RecordMemoryKBHistogram(const std::string& name, Sample sample) const; - - void RecordSparseHistogram(const std::string& name, Sample sample) const; - const std::string suffix_; const std::wstring registry_key_; };
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/reporter_runner_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/reporter_runner_win.cc index 9925a62..064aa293 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/reporter_runner_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/reporter_runner_win.cc
@@ -410,7 +410,8 @@ // The enterprise policy overrides all other choices. if (!SwReporterReportingIsAllowedByPolicy(profile)) { - uma.RecordLogsUploadEnabled(REPORTER_LOGS_UPLOADS_DISABLED_BY_POLICY); + uma.RecordLogsUploadEnabled( + SwReporterLogsUploadsEnabled::DISABLED_BY_POLICY); return false; } @@ -421,25 +422,29 @@ return false; case SwReporterInvocationType::kUserInitiatedWithLogsDisallowed: - uma.RecordLogsUploadEnabled(REPORTER_LOGS_UPLOADS_DISABLED_BY_USER); + uma.RecordLogsUploadEnabled( + SwReporterLogsUploadsEnabled::DISABLED_BY_USER); return false; case SwReporterInvocationType::kUserInitiatedWithLogsAllowed: - uma.RecordLogsUploadEnabled(REPORTER_LOGS_UPLOADS_ENABLED_BY_USER); + uma.RecordLogsUploadEnabled( + SwReporterLogsUploadsEnabled::ENABLED_BY_USER); return true; case SwReporterInvocationType::kPeriodicRun: if (!SafeBrowsingExtendedReportingEnabled()) { - uma.RecordLogsUploadEnabled(REPORTER_LOGS_UPLOADS_SBER_DISABLED); + uma.RecordLogsUploadEnabled( + SwReporterLogsUploadsEnabled::SBER_DISABLED); return false; } if (!time_info_.InLogsUploadPeriod()) { - uma.RecordLogsUploadEnabled(REPORTER_LOGS_UPLOADS_RECENTLY_SENT_LOGS); + uma.RecordLogsUploadEnabled( + SwReporterLogsUploadsEnabled::RECENTLY_SENT_LOGS); return false; } - uma.RecordLogsUploadEnabled(REPORTER_LOGS_UPLOADS_SBER_ENABLED); + uma.RecordLogsUploadEnabled(SwReporterLogsUploadsEnabled::SBER_ENABLED); return true; }
diff --git a/chrome/browser/themes/theme_service_aura_linux.cc b/chrome/browser/themes/theme_service_aura_linux.cc index e48e0c4..f2f7515 100644 --- a/chrome/browser/themes/theme_service_aura_linux.cc +++ b/chrome/browser/themes/theme_service_aura_linux.cc
@@ -25,7 +25,6 @@ // Overridden from CustomThemeSupplier: void StartUsingTheme() override; void StopUsingTheme() override; - bool GetTint(int id, color_utils::HSL* hsl) const override; bool GetColor(int id, SkColor* color) const override; bool GetDisplayProperty(int id, int* result) const override; gfx::Image GetImageNamed(int id) const override; @@ -57,10 +56,6 @@ linux_ui_->GetNativeTheme(nullptr)->NotifyOnNativeThemeUpdated(); } -bool SystemThemeLinux::GetTint(int id, color_utils::HSL* hsl) const { - return linux_ui_ && linux_ui_->GetTint(id, hsl); -} - bool SystemThemeLinux::GetColor(int id, SkColor* color) const { return linux_ui_ && linux_ui_->GetColor(id, color, pref_service_->GetBoolean( @@ -79,7 +74,7 @@ return false; } -SystemThemeLinux::~SystemThemeLinux() {} +SystemThemeLinux::~SystemThemeLinux() = default; } // namespace
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 48e4deb..3f1321a6 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -250,8 +250,6 @@ "webui/crashes_ui.h", "webui/device_log_ui.cc", "webui/device_log_ui.h", - "webui/domain_reliability_internals_ui.cc", - "webui/domain_reliability_internals_ui.h", "webui/download_internals/download_internals_ui.cc", "webui/download_internals/download_internals_ui.h", "webui/download_internals/download_internals_ui_message_handler.cc",
diff --git a/chrome/browser/ui/android/omnibox/BUILD.gn b/chrome/browser/ui/android/omnibox/BUILD.gn index b0b5cec4..5f1c6af 100644 --- a/chrome/browser/ui/android/omnibox/BUILD.gn +++ b/chrome/browser/ui/android/omnibox/BUILD.gn
@@ -366,6 +366,9 @@ "java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworksTest.java", "java/src/org/chromium/chrome/browser/omnibox/geo/VisibleNetworksTrackerTest.java", "java/src/org/chromium/chrome/browser/omnibox/styles/OmniboxResourceProviderTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilderUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManagerUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionViewBinderUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionViewProcessorUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionViewTest.java", @@ -375,6 +378,7 @@ "java/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessorUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/carousel/BaseCarouselSuggestionSelectionManagerUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/carousel/BaseCarouselSuggestionViewBinderUnitTest.java", + "java/src/org/chromium/chrome/browser/omnibox/suggestions/clipboard/ClipboardSuggestionProcessorUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/header/HeaderViewBinderUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/mostvisited/MostVisitedTilesProcessorUnitTest.java", "java/src/org/chromium/chrome/browser/omnibox/suggestions/tail/AlignmentManagerUnitTest.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java similarity index 95% rename from chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java rename to chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java index 7501d55..c58403db 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java
@@ -10,14 +10,12 @@ import androidx.test.filters.SmallTest; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.Config; import org.chromium.base.ContextUtils; -import org.chromium.base.test.BaseJUnit4ClassRunner; -import org.chromium.base.test.UiThreadTest; -import org.chromium.base.test.util.Batch; +import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.SharedPreferencesManager; @@ -25,8 +23,8 @@ import org.chromium.components.omnibox.AutocompleteMatchBuilder; import org.chromium.components.omnibox.AutocompleteResult; import org.chromium.components.omnibox.AutocompleteResult.GroupDetails; -import org.chromium.content_public.browser.test.NativeLibraryTestUtils; -import org.chromium.url.GURL; +import org.chromium.url.JUnitTestGURLs; +import org.chromium.url.ShadowGURL; import java.util.ArrayList; import java.util.Arrays; @@ -36,14 +34,9 @@ /** * Unit tests for {@link CachedZeroSuggestionsManager}. */ -@RunWith(BaseJUnit4ClassRunner.class) -@Batch(Batch.UNIT_TESTS) +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE, shadows = {ShadowGURL.class}) public class CachedZeroSuggestionsManagerUnitTest { - @Before - public void setUp() { - NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess(); - } - /** * Compare two instances of CachedZeroSuggestionsManager to see if they are same, asserting if * they're not. Note that order is just as relevant as the content for caching. @@ -109,7 +102,6 @@ @Test @SmallTest - @UiThreadTest public void setNewSuggestions_cachedSuggestionsWithPostdataBeforeAndAfterAreSame() { AutocompleteResult dataToCache = AutocompleteResult.fromCache(buildDummySuggestionsList(2, true), null); @@ -120,7 +112,6 @@ @Test @SmallTest - @UiThreadTest public void setNewSuggestions_cachedSuggestionsWithoutPostdataBeforeAndAfterAreSame() { AutocompleteResult dataToCache = AutocompleteResult.fromCache(buildDummySuggestionsList(2, false), null); @@ -131,7 +122,6 @@ @Test @SmallTest - @UiThreadTest public void setNewSuggestions_DoNotcacheClipboardSuggestions() { List<AutocompleteMatch> mix_list = Arrays.asList( createSuggestionBuilder(1, OmniboxSuggestionType.CLIPBOARD_IMAGE).build(), @@ -151,7 +141,6 @@ @Test @SmallTest - @UiThreadTest public void groupsDetails_restoreDetailsFromEmptyCache() { // Note: purge cache explicitly, because tests are run on an actual device // and cache may hold content from other test runs. @@ -163,7 +152,6 @@ @Test @SmallTest - @UiThreadTest public void groupsDetails_cacheAllSaneGroupDetails() { SparseArray<GroupDetails> groupsDetails = new SparseArray<>(); groupsDetails.put(10, new GroupDetails("Header For Group 10", false)); @@ -177,7 +165,6 @@ @Test @SmallTest - @UiThreadTest public void groupsDetails_cachePartiallySaneGroupDetailsDropsInvalidEntries() { SparseArray<GroupDetails> groupsDetails = new SparseArray<>(); groupsDetails.put(10, new GroupDetails("Header For Group 10", false)); @@ -197,7 +184,6 @@ @Test @SmallTest - @UiThreadTest public void groupsDetails_restoreInvalidGroupsDetailsFromCache() { SparseArray<GroupDetails> groupsDetails = new SparseArray<>(); groupsDetails.put( @@ -213,7 +199,6 @@ @Test @SmallTest - @UiThreadTest public void dropSuggestions_suggestionsWithValidGroupsAssociation() { List<AutocompleteMatch> list = buildDummySuggestionsList(2, false); list.add(createSuggestionBuilder(33).setGroupId(1).build()); @@ -228,7 +213,6 @@ @Test @SmallTest - @UiThreadTest public void dropSuggestions_suggestionsWithInvalidGroupsAssociation() { List<AutocompleteMatch> listExpected = buildDummySuggestionsList(2, false); List<AutocompleteMatch> listToCache = buildDummySuggestionsList(2, false); @@ -243,7 +227,6 @@ @Test @SmallTest - @UiThreadTest public void malformedCache_dropsMissingSuggestions() { // Clear cache explicitly, otherwise this test will be flaky until the suite is re-executed. ContextUtils.getAppSharedPreferences().edit().clear().apply(); @@ -279,7 +262,6 @@ @Test @SmallTest - @UiThreadTest public void malformedCache_dropsMissingGroupDetails() { // Clear cache explicitly, otherwise this test will be flaky until the suite is re-executed. ContextUtils.getAppSharedPreferences().edit().clear().apply(); @@ -323,7 +305,6 @@ @Test @SmallTest - @UiThreadTest public void removeInvalidSuggestions_dropsInvalidSuggestionsAndGroupsDetails() { // Write 3 wrong group groupsDetails to the cache SparseArray<GroupDetails> groupsDetailsExpected = new SparseArray<>(); @@ -340,8 +321,10 @@ List<AutocompleteMatch> listWithInvalidItems = buildDummySuggestionsList(2, false); listWithInvalidItems.add(createSuggestionBuilder(72).setGroupId(12).build()); - listWithInvalidItems.add( - createSuggestionBuilder(73).setGroupId(12).setUrl(new GURL("bad URL")).build()); + listWithInvalidItems.add(createSuggestionBuilder(73) + .setGroupId(12) + .setUrl(JUnitTestGURLs.getGURL(JUnitTestGURLs.INVALID_URL)) + .build()); listWithInvalidItems.add(createSuggestionBuilder(74).setGroupId(34).build()); AutocompleteResult dataWithInvalidItems = @@ -356,7 +339,6 @@ @Test @SmallTest - @UiThreadTest public void cacheAndRestoreSuggestionSubtypes() { List<AutocompleteMatch> list = Arrays.asList( createSuggestionBuilder(1, OmniboxSuggestionType.SEARCH_SUGGEST_PERSONALIZED) @@ -381,7 +363,6 @@ @Test @SmallTest - @UiThreadTest public void rejectCacheIfSubtypesAreMalformed() { List<AutocompleteMatch> list = Arrays.asList( createSuggestionBuilder(1, OmniboxSuggestionType.SEARCH_SUGGEST_PERSONALIZED) @@ -409,7 +390,6 @@ @Test @SmallTest - @UiThreadTest public void rejectCacheIfSubtypesIncludeNull() { List<AutocompleteMatch> list = Arrays.asList( createSuggestionBuilder(1, OmniboxSuggestionType.SEARCH_SUGGEST_PERSONALIZED)
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilderUnitTest.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilderUnitTest.java similarity index 95% rename from chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilderUnitTest.java rename to chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilderUnitTest.java index 2d2ba55..d0751d1 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilderUnitTest.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilderUnitTest.java
@@ -28,11 +28,11 @@ import org.junit.runner.RunWith; import org.mockito.InOrder; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.robolectric.annotation.Config; -import org.chromium.base.test.BaseJUnit4ClassRunner; -import org.chromium.base.test.UiThreadTest; -import org.chromium.base.test.util.Batch; +import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; import org.chromium.chrome.browser.omnibox.suggestions.header.HeaderProcessor; import org.chromium.chrome.test.util.browser.Features; @@ -40,8 +40,8 @@ import org.chromium.components.omnibox.AutocompleteMatchBuilder; import org.chromium.components.omnibox.AutocompleteResult; import org.chromium.components.omnibox.AutocompleteResult.GroupDetails; -import org.chromium.content_public.browser.test.NativeLibraryTestUtils; import org.chromium.ui.modelutil.PropertyModel; +import org.chromium.url.ShadowGURL; import java.util.ArrayList; import java.util.Arrays; @@ -50,31 +50,20 @@ /** * Tests for {@link DropdownItemViewInfoListBuilder}. */ -@RunWith(BaseJUnit4ClassRunner.class) -@Batch(Batch.UNIT_TESTS) +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE, shadows = {ShadowGURL.class}) public class DropdownItemViewInfoListBuilderUnitTest { - @Rule - public TestRule mProcessor = new Features.JUnitProcessor(); + public @Rule TestRule mProcessor = new Features.JUnitProcessor(); + public @Rule MockitoRule mockitoRule = MockitoJUnit.rule(); - @Mock - AutocompleteController mAutocompleteController; - - @Mock - SuggestionProcessor mMockSuggestionProcessor; - - @Mock - HeaderProcessor mMockHeaderProcessor; - - @Mock - OmniboxPedalDelegate mMockOmniboxPedalDelegate; - + private @Mock AutocompleteController mAutocompleteController; + private @Mock SuggestionProcessor mMockSuggestionProcessor; + private @Mock HeaderProcessor mMockHeaderProcessor; + private @Mock OmniboxPedalDelegate mMockOmniboxPedalDelegate; DropdownItemViewInfoListBuilder mBuilder; @Before public void setUp() { - MockitoAnnotations.initMocks(this); - NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess(); - when(mMockSuggestionProcessor.createModel()) .thenAnswer((mock) -> new PropertyModel(SuggestionCommonProperties.ALL_KEYS)); when(mMockSuggestionProcessor.getViewTypeId()).thenReturn(OmniboxSuggestionUiType.DEFAULT); @@ -107,7 +96,6 @@ @Test @SmallTest - @UiThreadTest public void headers_buildsHeaderForFirstSuggestion() { final List<AutocompleteMatch> actualList = new ArrayList<>(); final SparseArray<GroupDetails> groupsDetails = new SparseArray<>(); @@ -146,7 +134,6 @@ @Test @SmallTest - @UiThreadTest public void headers_buildsHeadersOnlyWhenGroupChanges() { final List<AutocompleteMatch> actualList = new ArrayList<>(); final SparseArray<GroupDetails> groupsDetails = new SparseArray<>(); @@ -210,7 +197,6 @@ @Test @SmallTest - @UiThreadTest public void builder_propagatesFocusChangeEvents() { mBuilder.onUrlFocusChange(true); verify(mMockHeaderProcessor, times(1)).onUrlFocusChange(eq(true)); @@ -226,7 +212,6 @@ @Test @SmallTest - @UiThreadTest public void builder_propagatesNativeInitializedEvent() { mBuilder.onNativeInitialized(); verify(mMockHeaderProcessor, times(1)).onNativeInitialized(); @@ -238,7 +223,6 @@ @Test @SmallTest - @UiThreadTest public void visibleSuggestions_missingDropdownHeightAssumesDefaultGroupSize() { final AutocompleteMatchBuilder builder = AutocompleteMatchBuilder.searchWithType(OmniboxSuggestionType.SEARCH_SUGGEST); @@ -260,7 +244,6 @@ @Test @SmallTest - @UiThreadTest public void visibleSuggestions_computeNumberOfVisibleSuggestionsFromDropdownHeight() { when(mMockSuggestionProcessor.doesProcessSuggestion(any(AutocompleteMatch.class), anyInt())) .thenReturn(true); @@ -285,7 +268,6 @@ @Test @SmallTest - @UiThreadTest public void visibleSuggestions_partiallyVisibleSuggestionsAreCountedAsVisible() { final AutocompleteMatchBuilder builder = AutocompleteMatchBuilder.searchWithType(OmniboxSuggestionType.SEARCH_SUGGEST); @@ -306,7 +288,6 @@ @Test @SmallTest - @UiThreadTest public void visibleSuggestions_queriesCorrespondingProcessorsToDetermineViewAllocation() { final SuggestionProcessor mockProcessor1 = mock(SuggestionProcessor.class); final SuggestionProcessor mockProcessor2 = mock(SuggestionProcessor.class); @@ -352,7 +333,6 @@ @Test @SmallTest - @UiThreadTest public void visibleSuggestions_calculatesPresenceOfConcealedSuggestionsFromDropdownHeight() { mBuilder.onNativeInitialized(); final AutocompleteMatch suggestion = @@ -385,7 +365,6 @@ @Test @SmallTest - @UiThreadTest public void partialGrouping_matchesWithHeaderAreNotPromotedAboveURLs() { final SuggestionProcessor mockProcessor = mock(SuggestionProcessor.class); mBuilder.registerSuggestionProcessor(mockProcessor);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManagerUnitTest.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManagerUnitTest.java similarity index 95% rename from chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManagerUnitTest.java rename to chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManagerUnitTest.java index 0bf46c7..6b4a3fb 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManagerUnitTest.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManagerUnitTest.java
@@ -13,7 +13,6 @@ import static org.mockito.Mockito.when; import android.content.Context; -import android.support.test.InstrumentationRegistry; import android.util.SparseArray; import android.view.View; @@ -21,18 +20,22 @@ import org.junit.Assert; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.robolectric.annotation.Config; -import org.chromium.base.test.BaseJUnit4ClassRunner; -import org.chromium.base.test.util.Batch; +import org.chromium.base.ContextUtils; +import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.chrome.browser.ui.theme.BrandedColorScheme; import org.chromium.components.omnibox.AutocompleteResult.GroupDetails; import org.chromium.ui.modelutil.ListObservable.ListObserver; import org.chromium.ui.modelutil.MVCListAdapter.ModelList; import org.chromium.ui.modelutil.PropertyModel; +import org.chromium.url.ShadowGURL; import java.util.ArrayList; import java.util.Arrays; @@ -41,24 +44,19 @@ /** * Tests for {@link DropdownItemViewInfoListManager}. */ -@RunWith(BaseJUnit4ClassRunner.class) -@Batch(Batch.UNIT_TESTS) +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE, shadows = {ShadowGURL.class}) public class DropdownItemViewInfoListManagerUnitTest { private static final int MINIMUM_NUMBER_OF_SUGGESTIONS_TO_SHOW = 5; private static final int SUGGESTION_MIN_HEIGHT = 20; private static final int HEADER_MIN_HEIGHT = 15; - @Mock - DropdownItemProcessor mBasicSuggestionProcessor; + public @Rule MockitoRule mockitoRule = MockitoJUnit.rule(); - @Mock - DropdownItemProcessor mHeaderProcessor; - - @Mock - PropertyModel mModel; - - @Mock - ListObserver<Void> mListObserver; + private @Mock DropdownItemProcessor mBasicSuggestionProcessor; + private @Mock DropdownItemProcessor mHeaderProcessor; + private @Mock PropertyModel mModel; + private @Mock ListObserver<Void> mListObserver; private ModelList mSuggestionModels; private Context mContext; @@ -66,15 +64,13 @@ @Before public void setUp() { - MockitoAnnotations.initMocks(this); - when(mBasicSuggestionProcessor.getViewTypeId()).thenReturn(OmniboxSuggestionUiType.DEFAULT); when(mHeaderProcessor.getViewTypeId()).thenReturn(OmniboxSuggestionUiType.HEADER); mSuggestionModels = new ModelList(); mSuggestionModels.addObserver(mListObserver); - mContext = InstrumentationRegistry.getContext(); + mContext = ContextUtils.getApplicationContext(); mManager = new DropdownItemViewInfoListManager(mSuggestionModels, mContext); }
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionsMetrics.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionsMetrics.java index 8b06cc83..a7c7ecf 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionsMetrics.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/SuggestionsMetrics.java
@@ -150,8 +150,6 @@ case PageClassification.NTP_VALUE: case PageClassification.INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS_VALUE: case PageClassification.INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS_VALUE: - case PageClassification.START_SURFACE_NEW_TAB_VALUE: - case PageClassification.START_SURFACE_HOMEPAGE_VALUE: suffix = "NTP"; break;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/clipboard/ClipboardSuggestionProcessorTest.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/clipboard/ClipboardSuggestionProcessorUnitTest.java similarity index 91% rename from chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/clipboard/ClipboardSuggestionProcessorTest.java rename to chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/clipboard/ClipboardSuggestionProcessorUnitTest.java index caa35a8..6b5aa19 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/clipboard/ClipboardSuggestionProcessorTest.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/clipboard/ClipboardSuggestionProcessorUnitTest.java
@@ -11,7 +11,6 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; -import android.graphics.Bitmap.Config; import android.graphics.drawable.BitmapDrawable; import android.view.ContextThemeWrapper; import android.view.ViewGroup; @@ -22,16 +21,17 @@ import org.junit.Assert; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.robolectric.annotation.Config; import org.chromium.base.ContextUtils; -import org.chromium.base.test.BaseJUnit4ClassRunner; -import org.chromium.base.test.UiThreadTest; -import org.chromium.base.test.util.Batch; +import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.chrome.R; import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; import org.chromium.chrome.browser.omnibox.suggestions.SuggestionCommonProperties; @@ -45,27 +45,26 @@ import org.chromium.components.favicon.LargeIconBridge.LargeIconCallback; import org.chromium.components.omnibox.AutocompleteMatch; import org.chromium.components.omnibox.AutocompleteMatchBuilder; -import org.chromium.content_public.browser.test.NativeLibraryTestUtils; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.url.GURL; +import org.chromium.url.JUnitTestGURLs; +import org.chromium.url.ShadowGURL; import java.io.ByteArrayOutputStream; /** * Tests for {@link ClipboardSuggestionProcessor}. */ -@RunWith(BaseJUnit4ClassRunner.class) -@Batch(Batch.UNIT_TESTS) -public class ClipboardSuggestionProcessorTest { - private static final GURL TEST_URL = new GURL("http://url"); - private static final GURL ARABIC_URL = new GURL("http://site.com/Ù…Ø±ØØ¨Ø§/123"); +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE, shadows = {ShadowGURL.class}) +public class ClipboardSuggestionProcessorUnitTest { + private static final GURL TEST_URL = JUnitTestGURLs.getGURL(JUnitTestGURLs.EXAMPLE_URL); - @Mock - SuggestionHost mSuggestionHost; - @Mock - LargeIconBridge mIconBridge; - @Mock - Resources mResources; + public @Rule MockitoRule mMockitoRule = MockitoJUnit.rule(); + + private @Mock SuggestionHost mSuggestionHost; + private @Mock LargeIconBridge mIconBridge; + private @Mock Resources mResources; private Context mContext; private ClipboardSuggestionProcessor mProcessor; @@ -79,11 +78,9 @@ @Before public void setUp() { - MockitoAnnotations.initMocks(this); - NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess(); mContext = new ContextThemeWrapper( ContextUtils.getApplicationContext(), R.style.Theme_BrowserUI_DayNight); - mBitmap = Bitmap.createBitmap(10, 5, Config.ARGB_8888); + mBitmap = Bitmap.createBitmap(10, 5, Bitmap.Config.ARGB_8888); mProcessor = new ClipboardSuggestionProcessor(mContext, mSuggestionHost, () -> mIconBridge); mRootView = new LinearLayout(mContext); mTitleTextView = new TextView(mContext); @@ -140,7 +137,6 @@ @Test @SmallTest - @UiThreadTest public void clipboardSuggestion_identifyUrlSuggestion() { createClipboardSuggestion(OmniboxSuggestionType.CLIPBOARD_URL, GURL.emptyGURL()); Assert.assertFalse(mModel.get(SuggestionViewProperties.IS_SEARCH_SUGGESTION)); @@ -152,7 +148,6 @@ @Test @SmallTest - @UiThreadTest public void clipboardSuggestion_showsFaviconWhenAvailable() { final ArgumentCaptor<LargeIconCallback> callback = ArgumentCaptor.forClass(LargeIconCallback.class); @@ -171,7 +166,6 @@ @Test @SmallTest - @UiThreadTest public void clipboardSuggestion_showsFallbackIconWhenNoFaviconIsAvailable() { final ArgumentCaptor<LargeIconCallback> callback = ArgumentCaptor.forClass(LargeIconCallback.class); @@ -189,14 +183,13 @@ @Test @SmallTest - @UiThreadTest public void clipobardSuggestion_urlAndTextDirection() { final ArgumentCaptor<LargeIconCallback> callback = ArgumentCaptor.forClass(LargeIconCallback.class); // URL - createClipboardSuggestionAndClickReveal(OmniboxSuggestionType.CLIPBOARD_URL, ARABIC_URL); + createClipboardSuggestionAndClickReveal(OmniboxSuggestionType.CLIPBOARD_URL, TEST_URL); Assert.assertFalse(mModel.get(SuggestionViewProperties.IS_SEARCH_SUGGESTION)); - verify(mIconBridge).getLargeIconForUrl(eq(ARABIC_URL), anyInt(), callback.capture()); + verify(mIconBridge).getLargeIconForUrl(eq(TEST_URL), anyInt(), callback.capture()); callback.getValue().onLargeIconAvailable(null, 0, false, 0); Assert.assertEquals(TextView.TEXT_DIRECTION_LTR, mLastSetTextDirection); @@ -208,7 +201,6 @@ @Test @SmallTest - @UiThreadTest public void clipboardSuggestion_showsThumbnailWhenAvailable() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); Assert.assertTrue(mBitmap.compress(Bitmap.CompressFormat.PNG, 100, baos)); @@ -228,12 +220,11 @@ @Test @SmallTest - @UiThreadTest public void clipboardSuggestion_thumbnailShouldResizeIfTooLarge() { int size = mContext.getResources().getDimensionPixelSize( R.dimen.omnibox_suggestion_decoration_image_size); - Bitmap largeBitmap = Bitmap.createBitmap(size * 2, size * 2, Config.ARGB_8888); + Bitmap largeBitmap = Bitmap.createBitmap(size * 2, size * 2, Bitmap.Config.ARGB_8888); ByteArrayOutputStream baos = new ByteArrayOutputStream(); Assert.assertTrue(largeBitmap.compress(Bitmap.CompressFormat.PNG, 100, baos)); byte[] bitmapData = baos.toByteArray(); @@ -248,7 +239,6 @@ @Test @SmallTest - @UiThreadTest public void clipboardSuggestion_revealButton() { createClipboardSuggestion(OmniboxSuggestionType.CLIPBOARD_URL, GURL.emptyGURL()); Assert.assertNotNull(mModel.get(BaseSuggestionViewProperties.ACTIONS)); @@ -268,7 +258,6 @@ @Test @SmallTest - @UiThreadTest public void clipboardSuggestion_noContentByDefault() { createClipboardSuggestion(OmniboxSuggestionType.CLIPBOARD_URL, GURL.emptyGURL()); SuggestionSpannable textLine2 = mModel.get(SuggestionViewProperties.TEXT_LINE_2_TEXT); @@ -285,7 +274,6 @@ @Test @SmallTest - @UiThreadTest public void clipboardSuggestion_revealAndConcealButton() { createClipboardSuggestion(OmniboxSuggestionType.CLIPBOARD_URL, GURL.emptyGURL()); SuggestionSpannable textLine2 = mModel.get(SuggestionViewProperties.TEXT_LINE_2_TEXT);
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java index 03f2263..c8ee3b73 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java
@@ -37,7 +37,6 @@ import org.chromium.chrome.browser.tab.TrustedCdn; import org.chromium.chrome.browser.theme.ThemeUtils; import org.chromium.chrome.browser.ui.theme.BrandedColorScheme; -import org.chromium.chrome.features.start_surface.StartSurfaceConfiguration; import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; import org.chromium.components.embedder_support.util.UrlConstants; @@ -588,12 +587,9 @@ public int getPageClassification(boolean isFocusedFromFakebox) { if (mNativeLocationBarModelAndroid == 0) return PageClassification.INVALID_SPEC_VALUE; - // Provide NTP or START_SURFACE_HOMEPAGE as page class in overview mode (when Start Surface - // is enabled). No call to the backend necessary or possible, since there is no tab or - // navigation entry. - if (isInOverviewAndShowingOmnibox()) { - return StartSurfaceConfiguration.getPageClassificationForHomepage(); - } + // Provide NTP as page class in overview mode (when Start Surface is enabled). No call + // to the backend necessary or possible, since there is no tab or navigation entry. + if (isInOverviewAndShowingOmnibox()) return PageClassification.NTP_VALUE; return LocationBarModelJni.get().getPageClassification( mNativeLocationBarModelAndroid, LocationBarModel.this, isFocusedFromFakebox);
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_ui_browsertest.cc b/chrome/browser/ui/ash/holding_space/holding_space_ui_browsertest.cc index 753fbde..b1bede3f 100644 --- a/chrome/browser/ui/ash/holding_space/holding_space_ui_browsertest.cc +++ b/chrome/browser/ui/ash/holding_space/holding_space_ui_browsertest.cc
@@ -2241,7 +2241,7 @@ EXPECT_TRUE(secondary_label->GetVisible()); WaitForText(secondary_label, u"Confirm download"); EXPECT_EQ(secondary_label->GetEnabledColor(), - is_dark_mode_state ? gfx::kGoogleYellow300 : gfx::kGoogleYellow600); + is_dark_mode_state ? gfx::kGoogleYellow300 : gfx::kGoogleYellow900); // The accessible name should indicate that the download must be confirmed. EXPECT_EQ(GetAccessibleName(download_chips.at(0)),
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc index ab1e336f..ab0054fc 100644 --- a/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc +++ b/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
@@ -20,6 +20,7 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/blocked_content/popup_blocker_tab_helper.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/permissions/permission_request_manager.h" #include "content/public/browser/render_view_host.h" @@ -734,34 +735,33 @@ } // Wait for a JS content fullscreen change with the given script and options. - void RequestContentFullscreenFromScript( + // Returns the script result. + content::EvalJsResult RequestContentFullscreenFromScript( const std::string& eval_js_script, int eval_js_options = content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, - bool expect_content_fullscreen = true, bool expect_window_fullscreen = true) { FullscreenNotificationObserver fullscreen_observer(browser()); auto* tab = browser()->tab_strip_model()->GetActiveWebContents(); - EXPECT_EQ(expect_content_fullscreen, - EvalJs(tab, eval_js_script, eval_js_options)); + content::EvalJsResult result = EvalJs(tab, eval_js_script, eval_js_options); fullscreen_observer.Wait(); EXPECT_EQ(expect_window_fullscreen, browser()->window()->IsFullscreen()); + return result; } // Execute JS to request content fullscreen on the current screen. void RequestContentFullscreen() { - const std::string request_fullscreen_script = R"( + const std::string script = R"( (async () => { await document.body.requestFullscreen(); return !!document.fullscreenElement; })(); )"; - RequestContentFullscreenFromScript(request_fullscreen_script); + EXPECT_EQ(true, RequestContentFullscreenFromScript(script)); } // Execute JS to request content fullscreen on a screen with the given index. void RequestContentFullscreenOnScreen(int screen_index) { - const std::string request_fullscreen_script = - base::StringPrintf(R"( + const std::string script = base::StringPrintf(R"( (async () => { if (!window.screenDetails) window.screenDetails = await window.getScreenDetails(); @@ -770,22 +770,22 @@ return !!document.fullscreenElement; })(); )", - screen_index); - RequestContentFullscreenFromScript(request_fullscreen_script); + screen_index); + EXPECT_EQ(true, RequestContentFullscreenFromScript(script)); } // Execute JS to exit content fullscreen. void ExitContentFullscreen(bool expect_window_fullscreen = false) { - const std::string exit_fullscreen_script = R"( + const std::string script = R"( (async () => { await document.exitFullscreen(); return !!document.fullscreenElement; })(); )"; // Exiting fullscreen does not require a user gesture; do not supply one. - RequestContentFullscreenFromScript( - exit_fullscreen_script, content::EXECUTE_SCRIPT_NO_USER_GESTURE, - /*expect_content_fullscreen=*/false, expect_window_fullscreen); + EXPECT_EQ(false, RequestContentFullscreenFromScript( + script, content::EXECUTE_SCRIPT_NO_USER_GESTURE, + expect_window_fullscreen)); } // Awaits expiry of the navigator.userActivation signal on the active tab. @@ -1086,14 +1086,14 @@ WaitForUserActivationExpiry(); ASSERT_TRUE(permission_request_manager->IsRequestInProgress()); permission_request_manager->Accept(); - const std::string request_fullscreen_from_prompt_script = R"( + const std::string script = R"( (async () => { await document.body.requestFullscreen(); return !!document.fullscreenElement; })(); )"; - RequestContentFullscreenFromScript(request_fullscreen_from_prompt_script, - content::EXECUTE_SCRIPT_NO_USER_GESTURE); + EXPECT_EQ(true, RequestContentFullscreenFromScript( + script, content::EXECUTE_SCRIPT_NO_USER_GESTURE)); } // Tests FullscreenController support for fullscreen companion windows. @@ -1116,40 +1116,81 @@ // where the window server's async handling of the fullscreen window state may // transition the window into fullscreen on the actual (non-mocked) display // bounds before or after the window bounds checks, yielding flaky results. -// TODO(crbug.com/1310416): Disabled on Chrome OS for flakiness. -// +#if !BUILDFLAG(IS_CHROMEOS_ASH) +#define MAYBE_FullscreenCompanionWindow DISABLED_FullscreenCompanionWindow +#else +#define MAYBE_FullscreenCompanionWindow FullscreenCompanionWindow +#endif // Test requesting fullscreen on a specific screen and opening a cross-screen // popup window from one gesture. Check the expected window activation pattern. +// https://w3c.github.io/window-placement/#usage-overview-initiate-multi-screen-experiences IN_PROC_BROWSER_TEST_P( FullscreenCompanionWindowFullscreenControllerInteractiveTest, - DISABLED_FullscreenCompanionWindow) { - SetUpTestScreenAndWindowPlacementTab(); + MAYBE_FullscreenCompanionWindow) { + content::WebContents* tab = SetUpTestScreenAndWindowPlacementTab(); - // Execute JS to request fullscreen and open a popup on separate screens. - const std::string fullscreen_and_popup_script = R"( - (async () => { - if (!window.screenDetails) - window.screenDetails = await window.getScreenDetails(); - const options = { screen: window.screenDetails.screens[0] }; - await document.body.requestFullscreen(options); - if (navigator.userActivation.isActive) - return false; - const s = window.screenDetails.screens[1]; - const f = `left=${s.availLeft},top=${s.availTop},width=300,height=200`; - window.open('.', '', f); - return !!document.fullscreenElement; - })(); - )"; BrowserList* browser_list = BrowserList::GetInstance(); EXPECT_EQ(1u, browser_list->size()); - RequestContentFullscreenFromScript(fullscreen_and_popup_script); + blocked_content::PopupBlockerTabHelper* popup_blocker = + blocked_content::PopupBlockerTabHelper::FromWebContents(tab); + EXPECT_EQ(0u, popup_blocker->GetBlockedPopupsCount()); + + // Execute JS to request fullscreen and open a popup on separate screens. + const std::string script = R"( + (async () => { + // Note: WindowPlacementPermissionContext will send an activation signal. + window.screenDetails = await window.getScreenDetails(); + + const fullscreen_change_promise = new Promise(resolve => { + function waitAndRemove(e) { + document.removeEventListener("fullscreenchange", waitAndRemove); + document.removeEventListener("fullscreenerror", waitAndRemove); + resolve(document.fullscreenElement); + } + document.addEventListener("fullscreenchange", waitAndRemove); + document.addEventListener("fullscreenerror", waitAndRemove); + }); + + // Request fullscreen and ensure that transient activation is consumed. + const options = { screen: window.screenDetails.screens[0] }; + const fullscreen_promise = document.body.requestFullscreen(options); + if (navigator.userActivation.isActive) { + console.error("Transient activation unexpectedly not consumed"); + return false; + } + + // Attempt to open a fullscreen companion window. + const s = window.screenDetails.screens[1]; + const f = `left=${s.availLeft},top=${s.availTop},width=300,height=200`; + const w = window.open('.', '', f); + + // Now await the fullscreen promise and change (or error) event. + await fullscreen_promise; + if (!await fullscreen_change_promise) { + console.error("Unexpected fullscreen change or error"); + return false; + } + + // Return true iff the opener is fullscreen and the popup is open. + return !!document.fullscreenElement && !!w && !w.closed; + })(); + )"; + EXPECT_EQ(GetParam(), RequestContentFullscreenFromScript(script)); EXPECT_EQ(gfx::Rect(0, 0, 800, 800), browser()->window()->GetBounds()); - // The popup opens iff kWindowPlacementFullscreenCompanionWindow is enabled. - EXPECT_EQ(GetParam() ? 2u : 1u, browser_list->size()); - // Popup window activation is delayed until its opener exits fullscreen. - EXPECT_EQ(browser(), browser_list->GetLastActive()); - ToggleTabFullscreen(/*enter_fullscreen=*/false); - EXPECT_EQ(GetParam(), browser() != browser_list->GetLastActive()); + + if (GetParam()) { + // The popup should open with FullscreenCompanionWindow enabled. + EXPECT_EQ(0u, popup_blocker->GetBlockedPopupsCount()); + EXPECT_EQ(2u, browser_list->size()); + // Popup window activation is delayed until its opener exits fullscreen. + EXPECT_EQ(browser(), browser_list->GetLastActive()); + ToggleTabFullscreen(/*enter_fullscreen=*/false); + EXPECT_NE(browser(), browser_list->GetLastActive()); + } else { + // The popup should be blocked with FullscreenCompanionWindow disabled. + EXPECT_EQ(1u, popup_blocker->GetBlockedPopupsCount()); + EXPECT_EQ(1u, browser_list->size()); + } } INSTANTIATE_TEST_SUITE_P(
diff --git a/chrome/browser/ui/quick_answers/lacros/quick_answers_state_lacros.cc b/chrome/browser/ui/quick_answers/lacros/quick_answers_state_lacros.cc index dc396ffe..007cfc6 100644 --- a/chrome/browser/ui/quick_answers/lacros/quick_answers_state_lacros.cc +++ b/chrome/browser/ui/quick_answers/lacros/quick_answers_state_lacros.cc
@@ -204,6 +204,9 @@ void QuickAnswersStateLacros::OnPreferredLanguagesChanged(base::Value value) { DCHECK(value.is_string()); preferred_languages_ = value.GetString(); + + for (auto& observer : observers_) + observer.OnPreferredLanguagesChanged(preferred_languages_); } void QuickAnswersStateLacros::OnImpressionCountChanged(base::Value value) {
diff --git a/chrome/browser/ui/quick_answers/quick_answers_state_ash.cc b/chrome/browser/ui/quick_answers/quick_answers_state_ash.cc index 53e24474..3726ffa 100644 --- a/chrome/browser/ui/quick_answers/quick_answers_state_ash.cc +++ b/chrome/browser/ui/quick_answers/quick_answers_state_ash.cc
@@ -237,6 +237,9 @@ language::prefs::kPreferredLanguages); preferred_languages_ = preferred_languages; + + for (auto& observer : observers_) + observer.OnPreferredLanguagesChanged(preferred_languages); } void QuickAnswersStateAsh::UpdateSpokenFeedbackEnabled() {
diff --git a/chrome/browser/ui/quick_answers/quick_answers_state_ash_unittest.cc b/chrome/browser/ui/quick_answers/quick_answers_state_ash_unittest.cc index 9b4e96cc..411ca0de 100644 --- a/chrome/browser/ui/quick_answers/quick_answers_state_ash_unittest.cc +++ b/chrome/browser/ui/quick_answers/quick_answers_state_ash_unittest.cc
@@ -35,15 +35,23 @@ const std::string& application_locale) override { application_locale_ = application_locale; } + void OnPreferredLanguagesChanged( + const std::string& preferred_languages) override { + preferred_languages_ = preferred_languages; + } void OnEligibilityChanged(bool eligible) override { is_eligible_ = eligible; } bool settings_enabled() const { return settings_enabled_; } const std::string& application_locale() const { return application_locale_; } + const std::string& preferred_languages() const { + return preferred_languages_; + } bool is_eligible() const { return is_eligible_; } private: bool settings_enabled_ = false; std::string application_locale_; + std::string preferred_languages_; bool is_eligible_ = false; }; @@ -174,12 +182,18 @@ } TEST_F(QuickAnswersStateAshTest, UpdatePreferredLanguages) { + QuickAnswersState::Get()->AddObserver(observer()); + EXPECT_TRUE(QuickAnswersState::Get()->preferred_languages().empty()); + EXPECT_TRUE(observer()->preferred_languages().empty()); const std::string preferred_languages = "en-US,zh"; prefs()->SetString(language::prefs::kPreferredLanguages, preferred_languages); EXPECT_EQ(QuickAnswersState::Get()->preferred_languages(), preferred_languages); + EXPECT_EQ(observer()->preferred_languages(), preferred_languages); + + QuickAnswersState::Get()->RemoveObserver(observer()); } TEST_F(QuickAnswersStateAshTest, UpdateSpokenFeedbackEnabled) {
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index ea0cfac1..c34c08e9 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -96,7 +96,6 @@ #include "ui/base/theme_provider.h" #include "ui/base/window_open_disposition.h" #include "ui/color/color_id.h" -#include "ui/color/color_provider.h" #include "ui/compositor/paint_recorder.h" #include "ui/events/event_constants.h" #include "ui/events/types/event_type.h" @@ -939,7 +938,7 @@ // TODO(sky/glen): make me pretty! recorder.canvas()->FillRect( indicator_bounds, - GetColorProvider()->GetColor(kColorBookmarkBarForeground)); + GetThemeProvider()->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT)); } } @@ -1581,11 +1580,11 @@ button->SetText(node->GetTitle()); button->SetAccessibleName(node->GetTitle()); button->SetID(VIEW_ID_BOOKMARK_BAR_ELEMENT); - // We don't always have a color provider (ui tests, for example). + // We don't always have a theme provider (ui tests, for example). SkColor text_color = gfx::kPlaceholderColor; - const ui::ColorProvider* const cp = GetColorProvider(); - if (cp) { - text_color = cp->GetColor(kColorBookmarkBarForeground); + const ui::ThemeProvider* const tp = GetThemeProvider(); + if (tp) { + text_color = tp->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT); button->SetEnabledTextColors(text_color); if (node->is_folder()) { button->SetImageModel( @@ -1603,7 +1602,7 @@ bool themify_icon = node->url().SchemeIs(content::kChromeUIScheme); gfx::ImageSkia favicon = bookmark_model_->GetFavicon(node).AsImageSkia(); if (favicon.isNull()) { - if (ui::TouchUiController::Get()->touch_ui() && cp) { + if (ui::TouchUiController::Get()->touch_ui() && tp) { // This favicon currently does not match the default favicon icon used // elsewhere in the codebase. // See https://crbug/814447 @@ -1620,8 +1619,9 @@ themify_icon = true; } - if (themify_icon && cp) { - SkColor favicon_color = cp->GetColor(kColorBookmarkFavicon); + if (themify_icon && tp) { + SkColor favicon_color = + tp->GetColor(ThemeProperties::COLOR_BOOKMARK_FAVICON); if (favicon_color != SK_ColorTRANSPARENT) { favicon = gfx::ImageSkiaOperations::CreateColorMask(favicon, favicon_color); @@ -1949,16 +1949,17 @@ } void BookmarkBarView::UpdateAppearanceForTheme() { - // We don't always have a color provider (ui tests, for example). - const ui::ColorProvider* color_provider = GetColorProvider(); - if (!color_provider) + // We don't always have a theme provider (ui tests, for example). + const ui::ThemeProvider* theme_provider = GetThemeProvider(); + if (!theme_provider) return; for (size_t i = 0; i < bookmark_buttons_.size(); ++i) { ConfigureButton(bookmark_model_->bookmark_bar_node()->children()[i].get(), bookmark_buttons_[i]); } - const SkColor color = color_provider->GetColor(kColorBookmarkBarForeground); + const SkColor color = + theme_provider->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT); other_bookmarks_button_->SetEnabledTextColors(color); managed_bookmarks_button_->SetEnabledTextColors(color); other_bookmarks_button_->SetImageModel( @@ -1974,7 +1975,7 @@ apps_page_shortcut_->SetEnabledTextColors(color); const SkColor overflow_color = - color_provider->GetColor(kColorBookmarkButtonIcon); + GetColorProvider()->GetColor(kColorBookmarkButtonIcon); const bool touch_ui = ui::TouchUiController::Get()->touch_ui(); overflow_button_->SetImageModel( views::Button::STATE_NORMAL,
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_browsertest.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_browsertest.cc index 29cb136..80bfd374 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_browsertest.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_browsertest.cc
@@ -31,8 +31,7 @@ #include "content/public/test/theme_change_waiter.h" #include "third_party/blink/public/mojom/frame/fullscreen.mojom.h" #include "third_party/blink/public/mojom/manifest/manifest.mojom.h" -#include "ui/color/color_id.h" -#include "ui/color/color_provider.h" +#include "ui/base/theme_provider.h" class BrowserNonClientFrameViewBrowserTest : public extensions::ExtensionBrowserTest { @@ -108,11 +107,11 @@ BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser()); const BrowserNonClientFrameView* frame_view = browser_view->frame()->GetFrameView(); - const ui::ColorProvider* color_provider = frame_view->GetColorProvider(); + const ui::ThemeProvider* theme_provider = frame_view->GetThemeProvider(); const SkColor expected_active_color = - color_provider->GetColor(ui::kColorFrameActive); + theme_provider->GetColor(ThemeProperties::COLOR_FRAME_ACTIVE); const SkColor expected_inactive_color = - color_provider->GetColor(ui::kColorFrameInactive); + theme_provider->GetColor(ThemeProperties::COLOR_FRAME_INACTIVE); EXPECT_EQ(expected_active_color, frame_view->GetFrameColor(BrowserFrameActiveState::kActive)); @@ -178,9 +177,10 @@ // color to the system color (not the app theme color); otherwise the title // and border would clash horribly with the GTK title bar. // (https://crbug.com/878636) - const ui::ColorProvider* color_provider = - GetAppFrameView()->GetColorProvider(); - const SkColor frame_color = color_provider->GetColor(ui::kColorFrameActive); + const ui::ThemeProvider* theme_provider = + GetAppFrameView()->GetThemeProvider(); + const SkColor frame_color = + theme_provider->GetColor(ThemeProperties::COLOR_FRAME_ACTIVE); EXPECT_EQ(frame_color, GetAppFrameView()->GetFrameColor(BrowserFrameActiveState::kActive)); #else
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view_browsertest_win.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view_browsertest_win.cc index c47ef23b..a3f66c1 100644 --- a/chrome/browser/ui/views/frame/glass_browser_frame_view_browsertest_win.cc +++ b/chrome/browser/ui/views/frame/glass_browser_frame_view_browsertest_win.cc
@@ -13,6 +13,7 @@ #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "chrome/app/chrome_command_ids.h" +#include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/views/frame/app_menu_button.h" @@ -33,8 +34,6 @@ #include "content/public/test/browser_test.h" #include "content/public/test/test_navigation_observer.h" #include "third_party/blink/public/mojom/manifest/display_mode.mojom.h" -#include "ui/color/color_id.h" -#include "ui/color/color_provider.h" #include "ui/views/view_utils.h" class WebAppGlassBrowserFrameViewTest : public InProcessBrowserTest { @@ -106,9 +105,9 @@ if (!InstallAndLaunchWebApp()) return; - EXPECT_EQ( - glass_frame_view_->GetTitlebarColor(), - browser()->window()->GetColorProvider()->GetColor(ui::kColorFrameActive)); + EXPECT_EQ(glass_frame_view_->GetTitlebarColor(), + browser()->window()->GetThemeProvider()->GetColor( + ThemeProperties::COLOR_FRAME_ACTIVE)); } IN_PROC_BROWSER_TEST_F(WebAppGlassBrowserFrameViewTest, MaximizedLayout) {
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index 27d318c..8058e39 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -665,7 +665,7 @@ // (&processed_bg_image) to create a local copy, so it's safe for this // to be locally scoped. button->SetBackgroundImage( - frame()->GetColorProvider()->GetColor(kColorCaptionButtonBackground), + tp->GetColor(ThemeProperties::COLOR_CONTROL_BUTTON_BACKGROUND), (processed_bg_image.isNull() ? nullptr : &processed_bg_image), tp->GetImageSkiaNamed(mask_image_id)); }
diff --git a/chrome/browser/ui/views/intent_picker_bubble_view_browsertest_chromeos.cc b/chrome/browser/ui/views/intent_picker_bubble_view_browsertest_chromeos.cc index 0b8df8c..69aebe9 100644 --- a/chrome/browser/ui/views/intent_picker_bubble_view_browsertest_chromeos.cc +++ b/chrome/browser/ui/views/intent_picker_bubble_view_browsertest_chromeos.cc
@@ -105,22 +105,6 @@ std::move(callback).Run(std::move(iv)); return nullptr; } - - std::unique_ptr<apps::IconLoader::Releaser> LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr mojom_icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) override { - auto icon_key = apps::ConvertMojomIconKeyToIconKey(mojom_icon_key); - return LoadIconFromIconKey( - apps::ConvertMojomAppTypToAppType(app_type), app_id, *icon_key, - apps::ConvertMojomIconTypeToIconType(icon_type), size_hint_in_dip, - allow_placeholder_icon, - apps::IconValueToMojomIconValueCallback(std::move(callback))); - } }; // Waits for a particular widget to be destroyed.
diff --git a/chrome/browser/ui/web_applications/lacros_web_app_browsertest.cc b/chrome/browser/ui/web_applications/lacros_web_app_browsertest.cc index 8bfb40c..3f67953 100644 --- a/chrome/browser/ui/web_applications/lacros_web_app_browsertest.cc +++ b/chrome/browser/ui/web_applications/lacros_web_app_browsertest.cc
@@ -18,6 +18,7 @@ #include "chromeos/lacros/lacros_service.h" #include "chromeos/lacros/lacros_test_helper.h" #include "content/public/test/browser_test.h" +#include "content/public/test/test_navigation_observer.h" #include "net/test/embedded_test_server/embedded_test_server.h" namespace web_app { @@ -30,11 +31,12 @@ protected: // If ash is does not contain the relevant test controller functionality, then // there's nothing to do for this test. We require https://crrev.com/c/3688993 - // or later (SelectContextMenuForShelfItem bug fix). + // (SelectContextMenuForShelfItem bug fix) and https://crrev.com/c/3703077 + // (ApplyBackgroundAndMask fix for PWA shortcuts without icons). bool IsServiceAvailable() { DCHECK(IsWebAppsCrosapiEnabled()); return chromeos::IsAshVersionAtLeastForTesting( - base::Version({104, 0, 5102})); + base::Version({105, 0, 5120})); } }; @@ -98,4 +100,71 @@ browser_test_util::WaitForShelfItem(app_id, /*exists=*/false); } +// Regression test for crbug.com/1335266 +IN_PROC_BROWSER_TEST_F(LacrosWebAppBrowserTest, Shortcut) { + if (!IsServiceAvailable()) + GTEST_SKIP() << "Unsupported ash version."; + + // The menu contains 5 items common across running web apps, then a separator + // and label for each of the 6 shortcut entries. + const uint32_t kNumShortcutItems = 17U; + const int kShortcutOneIndex = 6; + const int kShortcutThreeIndex = 10; + const int kShortcutSixIndex = 16; + + crosapi::mojom::TestControllerAsyncWaiter waiter( + chromeos::LacrosService::Get() + ->GetRemote<crosapi::mojom::TestController>() + .get()); + + const GURL app_url = + https_server()->GetURL("/web_app_shortcuts/shortcuts.html"); + const AppId app_id = InstallWebAppFromManifest(browser(), app_url); + EXPECT_EQ(provider().registrar().GetAppShortcutsMenuItemInfos(app_id).size(), + 6U); + + // Wait for item to exist in shelf. + browser_test_util::WaitForShelfItem(app_id, /*exists=*/true); + + auto selectContextMenu = [&](int index) { + bool success = false; + waiter.SelectContextMenuForShelfItem(app_id, index, &success); + return success; + }; + + { + // Get the context menu. + std::vector<std::string> items; + waiter.GetContextMenuForShelfItem(app_id, &items); + EXPECT_EQ(kNumShortcutItems, items.size()); + EXPECT_EQ(items[kShortcutOneIndex], "One"); + EXPECT_EQ(items[kShortcutThreeIndex], "Three"); + EXPECT_EQ(items[kShortcutSixIndex], "Six"); + } + + { + content::TestNavigationObserver navigation_observer( + https_server()->GetURL("/web_app_shortcuts/shortcuts.html#one")); + navigation_observer.StartWatchingNewWebContents(); + ASSERT_TRUE(selectContextMenu(kShortcutOneIndex)); + navigation_observer.Wait(); + } + + { + content::TestNavigationObserver navigation_observer( + https_server()->GetURL("/web_app_shortcuts/shortcuts.html#three")); + navigation_observer.StartWatchingNewWebContents(); + ASSERT_TRUE(selectContextMenu(kShortcutThreeIndex)); + navigation_observer.Wait(); + } + + { + content::TestNavigationObserver navigation_observer( + https_server()->GetURL("/web_app_shortcuts/shortcuts.html#six")); + navigation_observer.StartWatchingNewWebContents(); + ASSERT_TRUE(selectContextMenu(kShortcutSixIndex)); + navigation_observer.Wait(); + } +} + } // namespace web_app
diff --git a/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc b/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc index bc9eed9..93692c9 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc +++ b/chrome/browser/ui/webui/chrome_url_data_manager_browsertest.cc
@@ -220,7 +220,6 @@ "chrome://dino", // TODO(crbug.com/1113446): Test failure due to excessive output. // "chrome://discards", - "chrome://domain-reliability-internals", "chrome://download-internals", "chrome://downloads", "chrome://extensions",
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index b021aad3..1c0bef5 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -38,7 +38,6 @@ #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" #include "chrome/browser/ui/webui/crashes_ui.h" #include "chrome/browser/ui/webui/device_log_ui.h" -#include "chrome/browser/ui/webui/domain_reliability_internals_ui.h" #include "chrome/browser/ui/webui/download_internals/download_internals_ui.h" #include "chrome/browser/ui/webui/engagement/site_engagement_ui.h" #include "chrome/browser/ui/webui/flags/flags_ui.h" @@ -748,8 +747,6 @@ return &NewWebUI<CrashesUI>; if (url.host_piece() == chrome::kChromeUIDeviceLogHost) return &NewWebUI<chromeos::DeviceLogUI>; - if (url.host_piece() == chrome::kChromeUIDomainReliabilityInternalsHost) - return &NewWebUI<DomainReliabilityInternalsUI>; if (url.host_piece() == chrome::kChromeUIDownloadInternalsHost) return &NewWebUI<DownloadInternalsUI>; if (url.host_piece() == chrome::kChromeUIFlagsHost &&
diff --git a/chrome/browser/ui/webui/customize_themes/chrome_customize_themes_handler.cc b/chrome/browser/ui/webui/customize_themes/chrome_customize_themes_handler.cc index 9078d9b4..6003a83 100644 --- a/chrome/browser/ui/webui/customize_themes/chrome_customize_themes_handler.cc +++ b/chrome/browser/ui/webui/customize_themes/chrome_customize_themes_handler.cc
@@ -8,18 +8,16 @@ #include "chrome/browser/new_tab_page/chrome_colors/chrome_colors_service.h" #include "chrome/browser/new_tab_page/chrome_colors/generated_colors_info.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" -#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/common/themes/autogenerated_theme_util.h" #include "content/public/browser/web_contents.h" #include "extensions/browser/extension_registry.h" #include "extensions/common/extension.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/color/color_id.h" -#include "ui/color/color_provider.h" #include "ui/gfx/color_palette.h" #include "ui/webui/resources/cr_components/customize_themes/customize_themes.mojom.h" @@ -143,16 +141,17 @@ // logic that returns a placeholder color. const BrowserWindow* browser_window = BrowserWindow::FindBrowserWindowWithWebContents(web_contents_); - const ui::ColorProvider* color_provider = - browser_window ? browser_window->GetColorProvider() : nullptr; + const ui::ThemeProvider* theme_provider = + browser_window ? browser_window->GetThemeProvider() : nullptr; theme->type = customize_themes::mojom::ThemeType::kAutogenerated; auto theme_colors = customize_themes::mojom::ThemeColors::New(); - if (color_provider) { - theme_colors->frame = color_provider->GetColor(ui::kColorFrameActive); + if (theme_provider) { + theme_colors->frame = + theme_provider->GetColor(ThemeProperties::COLOR_FRAME_ACTIVE); theme_colors->active_tab = - color_provider->GetColor(kColorNewTabPageBackground); + theme_provider->GetColor(ThemeProperties::COLOR_NTP_BACKGROUND); theme_colors->active_tab_text = - color_provider->GetColor(kColorNewTabPageText); + theme_provider->GetColor(ThemeProperties::COLOR_NTP_TEXT); } else { theme_colors->frame = gfx::kPlaceholderColor; theme_colors->active_tab = gfx::kPlaceholderColor;
diff --git a/chrome/browser/ui/webui/domain_reliability_internals_ui.cc b/chrome/browser/ui/webui/domain_reliability_internals_ui.cc deleted file mode 100644 index e8371b1..0000000 --- a/chrome/browser/ui/webui/domain_reliability_internals_ui.cc +++ /dev/null
@@ -1,73 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/webui/domain_reliability_internals_ui.h" - -#include <string> - -#include "base/bind.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/common/url_constants.h" -#include "chrome/grit/dev_ui_browser_resources.h" -#include "content/public/browser/storage_partition.h" -#include "content/public/browser/web_ui.h" -#include "content/public/browser/web_ui_data_source.h" -#include "services/network/public/mojom/content_security_policy.mojom.h" -#include "services/network/public/mojom/network_context.mojom.h" - -DomainReliabilityInternalsUI::DomainReliabilityInternalsUI( - content::WebUI* web_ui) - : content::WebUIController(web_ui) { - content::WebUIDataSource* html_source = content::WebUIDataSource::Create( - chrome::kChromeUIDomainReliabilityInternalsHost); - html_source->OverrideContentSecurityPolicy( - network::mojom::CSPDirectiveName::ScriptSrc, - "script-src chrome://resources 'self' 'unsafe-eval';"); - html_source->OverrideContentSecurityPolicy( - network::mojom::CSPDirectiveName::TrustedTypes, - "trusted-types jstemplate;"); - html_source->AddResourcePath("domain_reliability_internals.css", - IDR_DOMAIN_RELIABILITY_INTERNALS_CSS); - html_source->AddResourcePath("domain_reliability_internals.js", - IDR_DOMAIN_RELIABILITY_INTERNALS_JS); - html_source->SetDefaultResource(IDR_DOMAIN_RELIABILITY_INTERNALS_HTML); - Profile* profile = Profile::FromWebUI(web_ui); - content::WebUIDataSource::Add(profile, html_source); - - web_ui->AddMessageHandler( - std::make_unique<DomainReliabilityInternalsHandler>()); -} - -DomainReliabilityInternalsUI::~DomainReliabilityInternalsUI() = default; - -DomainReliabilityInternalsHandler::DomainReliabilityInternalsHandler() = - default; -DomainReliabilityInternalsHandler::~DomainReliabilityInternalsHandler() = - default; - -void DomainReliabilityInternalsHandler::RegisterMessages() { - web_ui()->RegisterDeprecatedMessageCallback( - "updateData", - base::BindRepeating(&DomainReliabilityInternalsHandler::HandleUpdateData, - base::Unretained(this))); -} - -void DomainReliabilityInternalsHandler::HandleUpdateData( - const base::ListValue* args) { - DCHECK_EQ(1u, args->GetListDeprecated().size()); - AllowJavascript(); - callback_id_ = args->GetListDeprecated()[0].GetString(); - - Profile* profile = Profile::FromWebUI(web_ui()); - network::mojom::NetworkContext* network_context = - profile->GetDefaultStoragePartition()->GetNetworkContext(); - network_context->GetDomainReliabilityJSON( - base::BindOnce(&DomainReliabilityInternalsHandler::OnDataUpdated, - weak_factory_.GetWeakPtr())); -} - -void DomainReliabilityInternalsHandler::OnDataUpdated(base::Value data) { - ResolveJavascriptCallback(base::Value(std::move(callback_id_)), data); - callback_id_.clear(); -}
diff --git a/chrome/browser/ui/webui/domain_reliability_internals_ui.h b/chrome/browser/ui/webui/domain_reliability_internals_ui.h deleted file mode 100644 index c6b5ec5..0000000 --- a/chrome/browser/ui/webui/domain_reliability_internals_ui.h +++ /dev/null
@@ -1,54 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_WEBUI_DOMAIN_RELIABILITY_INTERNALS_UI_H_ -#define CHROME_BROWSER_UI_WEBUI_DOMAIN_RELIABILITY_INTERNALS_UI_H_ - -#include <memory> -#include <string> - -#include "base/memory/weak_ptr.h" -#include "content/public/browser/web_ui_controller.h" -#include "content/public/browser/web_ui_message_handler.h" - -namespace base { -class ListValue; -class Value; -} // namespace base - -// The WebUI for chrome://domain-reliability-internals -class DomainReliabilityInternalsUI : public content::WebUIController { - public: - explicit DomainReliabilityInternalsUI(content::WebUI* web_ui); - - DomainReliabilityInternalsUI(const DomainReliabilityInternalsUI&) = delete; - DomainReliabilityInternalsUI& operator=(const DomainReliabilityInternalsUI&) = - delete; - - ~DomainReliabilityInternalsUI() override; -}; - -class DomainReliabilityInternalsHandler : public content::WebUIMessageHandler { - public: - DomainReliabilityInternalsHandler(); - - DomainReliabilityInternalsHandler(const DomainReliabilityInternalsHandler&) = - delete; - DomainReliabilityInternalsHandler& operator=( - const DomainReliabilityInternalsHandler&) = delete; - - ~DomainReliabilityInternalsHandler() override; - - // content::WebUIMessageHandler: - void RegisterMessages() override; - - private: - void HandleUpdateData(const base::ListValue* args); - void OnDataUpdated(base::Value data); - - std::string callback_id_; - base::WeakPtrFactory<DomainReliabilityInternalsHandler> weak_factory_{this}; -}; - -#endif // CHROME_BROWSER_UI_WEBUI_DOMAIN_RELIABILITY_INTERNALS_UI_H_
diff --git a/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc b/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc index 8bf9ffac..8a1e80b 100644 --- a/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc +++ b/chrome/browser/ui/webui/tab_strip/tab_strip_page_handler.cc
@@ -52,7 +52,6 @@ #include "ui/base/models/simple_menu_model.h" #include "ui/base/theme_provider.h" #include "ui/color/color_id.h" -#include "ui/color/color_provider.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" #include "ui/events/gesture_event_details.h" @@ -601,7 +600,7 @@ // the WebUI can use the CSS variables to color the tab strip base::flat_map<std::string, std::string> colors; colors["--tabstrip-background-color"] = color_utils::SkColorToRgbaString( - embedder_->GetColorProviderColor(ui::kColorFrameActive)); + embedder_->GetColor(ThemeProperties::COLOR_FRAME_ACTIVE)); colors["--tabstrip-tab-background-color"] = color_utils::SkColorToRgbaString( embedder_->GetColor(ThemeProperties::COLOR_TOOLBAR)); colors["--tabstrip-tab-text-color"] = color_utils::SkColorToRgbaString( @@ -636,7 +635,7 @@ #if !BUILDFLAG(IS_CHROMEOS_ASH) colors["--tabstrip-scrollbar-thumb-color-rgb"] = color_utils::SkColorToRgbString(color_utils::GetColorWithMaxContrast( - embedder_->GetColorProviderColor(ui::kColorFrameActive))); + embedder_->GetColor(ThemeProperties::COLOR_FRAME_ACTIVE))); #endif std::move(callback).Run(std::move(colors));
diff --git a/chrome/browser/ui/webui/usb_internals/usb_internals_ui.cc b/chrome/browser/ui/webui/usb_internals/usb_internals_ui.cc index f1d3de0..2e5c101 100644 --- a/chrome/browser/ui/webui/usb_internals/usb_internals_ui.cc +++ b/chrome/browser/ui/webui/usb_internals/usb_internals_ui.cc
@@ -24,11 +24,8 @@ static constexpr webui::ResourcePath kPaths[] = { {"usb_enumeration_options.mojom-webui.js", IDR_USB_ENUMERATION_OPTIONS_MOJOM_WEBUI_JS}, - {"usb_manager.mojom-webui.js", IDR_USB_DEVICE_MANAGER_MOJOM_WEBUI_JS}, {"usb_manager_client.mojom-webui.js", IDR_USB_DEVICE_MANAGER_CLIENT_MOJOM_WEBUI_JS}, - {"usb_manager_test.mojom-webui.js", - IDR_USB_DEVICE_MANAGER_TEST_MOJOM_WEBUI_JS}, }; source->AddResourcePaths(kPaths);
diff --git a/chrome/browser/web_applications/app_service/web_apps.cc b/chrome/browser/web_applications/app_service/web_apps.cc index cff61f3..60ef747 100644 --- a/chrome/browser/web_applications/app_service/web_apps.cc +++ b/chrome/browser/web_applications/app_service/web_apps.cc
@@ -172,24 +172,6 @@ std::move(subscriber_remote))); } -void WebApps::LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - if (!icon_key) { - // On failure, we still run the callback, with an empty IconValue. - std::move(callback).Run(apps::mojom::IconValue::New()); - return; - } - - publisher_helper().LoadIcon( - app_id, apps::ConvertMojomIconTypeToIconType(icon_type), size_hint_in_dip, - static_cast<IconEffects>(icon_key->icon_effects), - apps::IconValueToMojomIconValueCallback(std::move(callback))); -} - void WebApps::Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/web_applications/app_service/web_apps.h b/chrome/browser/web_applications/app_service/web_apps.h index 2f92ef35..ef58c75 100644 --- a/chrome/browser/web_applications/app_service/web_apps.h +++ b/chrome/browser/web_applications/app_service/web_apps.h
@@ -99,12 +99,6 @@ // apps::mojom::Publisher overrides. void Connect(mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source,
diff --git a/chrome/browser/webauthn/authenticator_request_dialog_model.cc b/chrome/browser/webauthn/authenticator_request_dialog_model.cc index 1111225..b88ba88 100644 --- a/chrome/browser/webauthn/authenticator_request_dialog_model.cc +++ b/chrome/browser/webauthn/authenticator_request_dialog_model.cc
@@ -365,6 +365,11 @@ void AuthenticatorRequestDialogModel::Cancel() { if (is_request_complete()) { + if (use_location_bar_bubble_) { + // Conditional UI requests are never cancelled, they restart silently. + StartOver(); + return; + } SetCurrentStep(Step::kClosed); } @@ -447,7 +452,7 @@ void AuthenticatorRequestDialogModel::OnUserConsentDenied() { if (use_location_bar_bubble_) { // Do not show a page-modal retry error sheet if the user cancelled out of - // their platform authenticator while displaying the location bar bubble UI. + // their platform authenticator during a conditional UI request. // Instead, retry silently. StartOver(); return; @@ -457,6 +462,14 @@ bool AuthenticatorRequestDialogModel::OnWinUserCancelled() { #if BUILDFLAG(IS_WIN) + if (use_location_bar_bubble_) { + // Do not show a page-modal retry error sheet if the user cancelled out of + // their platform authenticator during a conditional UI request. + // Instead, retry silently. + StartOver(); + return true; + } + // If the native Windows API was triggered immediately (i.e. before any Chrome // dialog) then start the request over (once) if the user cancels the Windows // UI and there are other options in Chrome's UI.
diff --git a/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc b/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc index 31afa15..83f06443 100644 --- a/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc +++ b/chrome/browser/webauthn/authenticator_request_dialog_model_unittest.cc
@@ -58,6 +58,7 @@ MockDialogModelObserver(const MockDialogModelObserver&) = delete; MockDialogModelObserver& operator=(const MockDialogModelObserver&) = delete; + MOCK_METHOD0(OnStartOver, void()); MOCK_METHOD1(OnModelDestroyed, void(AuthenticatorRequestDialogModel*)); MOCK_METHOD0(OnStepTransition, void()); MOCK_METHOD0(OnCancelRequest, void()); @@ -788,3 +789,64 @@ EXPECT_EQ(preselect_num_called, 1); EXPECT_EQ(request_num_called, 1); } + +// Tests that cancelling a Conditional UI request that has completed restarts +// it. +TEST_F(AuthenticatorRequestDialogModelTest, ConditionalUICancelRequest) { + testing::StrictMock<MockDialogModelObserver> mock_observer; + AuthenticatorRequestDialogModel model(/*web_contents=*/nullptr); + model.AddObserver(&mock_observer); + model.saved_authenticators().AddAuthenticator(AuthenticatorReference( + /*device_id=*/"internal", AuthenticatorTransport::kInternal)); + + EXPECT_CALL(mock_observer, OnStepTransition()); + model.StartFlow(std::move(TransportAvailabilityInfo()), + /*is_location_bar_bubble_ui==*/true, + /*prefer_native_api=*/false); + EXPECT_EQ(model.current_step(), Step::kLocationBarBubble); + testing::Mock::VerifyAndClearExpectations(&mock_observer); + + // Cancel an ongoing request. It should inform the observers to e.g. stop + // discoveries. + EXPECT_CALL(mock_observer, OnCancelRequest()); + model.Cancel(); + EXPECT_NE(model.current_step(), Step::kClosed); + testing::Mock::VerifyAndClearExpectations(&mock_observer); + + // Complete the request and then "cancel" it again (as if e.g. the user + // clicked the accept button). The request should be restarted. + EXPECT_CALL(mock_observer, OnStartOver()); + EXPECT_CALL(mock_observer, OnStepTransition()).Times(2); + model.SetCurrentStepForTesting(Step::kKeyAlreadyRegistered); + model.Cancel(); + EXPECT_EQ(model.current_step(), Step::kLocationBarBubble); + testing::Mock::VerifyAndClearExpectations(&mock_observer); + model.RemoveObserver(&mock_observer); +} + +#if BUILDFLAG(IS_WIN) +// Tests that cancelling the Windows Platform authenticator during a Conditional +// UI request restarts it. +TEST_F(AuthenticatorRequestDialogModelTest, ConditionalUIWindowsCancel) { + testing::StrictMock<MockDialogModelObserver> mock_observer; + AuthenticatorRequestDialogModel model(/*web_contents=*/nullptr); + model.AddObserver(&mock_observer); + model.saved_authenticators().AddAuthenticator(AuthenticatorReference( + /*device_id=*/"internal", AuthenticatorTransport::kInternal)); + + EXPECT_CALL(mock_observer, OnStepTransition()); + model.StartFlow(std::move(TransportAvailabilityInfo()), + /*is_location_bar_bubble_ui==*/true, + /*prefer_native_api=*/false); + EXPECT_EQ(model.current_step(), Step::kLocationBarBubble); + testing::Mock::VerifyAndClearExpectations(&mock_observer); + + // Simulate the Windows authenticator cancelling. + EXPECT_CALL(mock_observer, OnStepTransition()); + EXPECT_CALL(mock_observer, OnStartOver()); + model.OnWinUserCancelled(); + EXPECT_EQ(model.current_step(), Step::kLocationBarBubble); + testing::Mock::VerifyAndClearExpectations(&mock_observer); + model.RemoveObserver(&mock_observer); +} +#endif // BUILDFLAG(IS_WIN)
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 9dab6e3..78bb747 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1655229557-2e41633d7cf2398cd102dfca76172e280ea23daa.profdata +chrome-mac-main-1655250914-1f025f2d0cf31dca0d1885c0e412e79c8f096d4f.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 3a36d5a..4d54d983 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1655229557-734cbdd8045e65c1312bc314b73ee12f3fafdbb4.profdata +chrome-win64-main-1655250914-706926b27021a324e0e16e0d619fb284315f3b44.profdata
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index a1cf86a..4236150 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -66,12 +66,6 @@ base::FEATURE_DISABLED_BY_DEFAULT}; #endif // BUILDFLAG(IS_CHROMEOS_ASH) -#if !BUILDFLAG(IS_ANDROID) -// App Service related flags. See components/services/app_service/README.md. -const base::Feature kAppServiceLoadIconWithoutMojom{ - "AppServiceLoadIconWithoutMojom", base::FEATURE_ENABLED_BY_DEFAULT}; -#endif // !BUILDFLAG(IS_ANDROID) - #if BUILDFLAG(IS_MAC) // Can be used to disable RemoteCocoa (hosting NSWindows for apps in the app // process). For debugging purposes only.
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index e87057d..99db362 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -69,11 +69,6 @@ extern const base::Feature kAppProvisioningStatic; #endif -#if !BUILDFLAG(IS_ANDROID) -COMPONENT_EXPORT(CHROME_FEATURES) -extern const base::Feature kAppServiceLoadIconWithoutMojom; -#endif // !BUILDFLAG(IS_ANDROID) - #if BUILDFLAG(IS_MAC) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kAppShimRemoteCocoa;
diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc index 1ec2dd2a3..0c2164ba 100644 --- a/chrome/common/webui_url_constants.cc +++ b/chrome/common/webui_url_constants.cc
@@ -73,8 +73,6 @@ const char kChromeUIDiceWebSigninInterceptHost[] = "signin-dice-web-intercept"; const char kChromeUIDiceWebSigninInterceptURL[] = "chrome://signin-dice-web-intercept/"; -const char kChromeUIDomainReliabilityInternalsHost[] = - "domain-reliability-internals"; const char kChromeUIDownloadInternalsHost[] = "download-internals"; const char kChromeUIDownloadsHost[] = "downloads"; const char kChromeUIDownloadsURL[] = "chrome://downloads/";
diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_constants.h index af9f0b6..ae88c06 100644 --- a/chrome/common/webui_url_constants.h +++ b/chrome/common/webui_url_constants.h
@@ -74,7 +74,6 @@ extern const char kChromeUIDevUiLoaderURL[]; extern const char kChromeUIDiceWebSigninInterceptHost[]; extern const char kChromeUIDiceWebSigninInterceptURL[]; -extern const char kChromeUIDomainReliabilityInternalsHost[]; extern const char kChromeUIDownloadInternalsHost[]; extern const char kChromeUIDownloadsHost[]; extern const char kChromeUIDownloadsURL[];
diff --git a/chrome/gpu/chrome_content_gpu_client.cc b/chrome/gpu/chrome_content_gpu_client.cc index 63126b1..c3e8759 100644 --- a/chrome/gpu/chrome_content_gpu_client.cc +++ b/chrome/gpu/chrome_content_gpu_client.cc
@@ -16,7 +16,6 @@ #include "chrome/gpu/browser_exposed_gpu_interfaces.h" #include "components/heap_profiling/in_process/heap_profiler_controller.h" #include "components/metrics/call_stack_profile_builder.h" -#include "components/metrics/call_stack_profile_params.h" #include "content/public/child/child_thread.h" #include "content/public/common/content_switches.h" #include "media/media_buildflags.h" @@ -59,18 +58,23 @@ if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kSingleProcess) && !base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kInProcessGPU) && - (ThreadProfiler::ShouldCollectProfilesForChildProcess() || - HeapProfilerController::IsProfilingEnabled( - metrics::CallStackProfileParams::Process::kGpu))) { - ThreadProfiler::SetMainThreadTaskRunner( - base::ThreadTaskRunnerHandle::Get()); + switches::kInProcessGPU)) { + // The HeapProfilerController should have been created in + // ChromeMainDelegate::PostEarlyInitialization. + DCHECK_NE(HeapProfilerController::GetProfilingEnabled(), + HeapProfilerController::ProfilingEnabled::kNoController); + if (ThreadProfiler::ShouldCollectProfilesForChildProcess() || + HeapProfilerController::GetProfilingEnabled() == + HeapProfilerController::ProfilingEnabled::kEnabled) { + ThreadProfiler::SetMainThreadTaskRunner( + base::ThreadTaskRunnerHandle::Get()); - mojo::PendingRemote<metrics::mojom::CallStackProfileCollector> collector; - content::ChildThread::Get()->BindHostReceiver( - collector.InitWithNewPipeAndPassReceiver()); - metrics::CallStackProfileBuilder::SetParentProfileCollectorForChildProcess( - std::move(collector)); + mojo::PendingRemote<metrics::mojom::CallStackProfileCollector> collector; + content::ChildThread::Get()->BindHostReceiver( + collector.InitWithNewPipeAndPassReceiver()); + metrics::CallStackProfileBuilder:: + SetParentProfileCollectorForChildProcess(std::move(collector)); + } } }
diff --git a/chrome/renderer/DEPS b/chrome/renderer/DEPS index f106c6b..cbe667b 100644 --- a/chrome/renderer/DEPS +++ b/chrome/renderer/DEPS
@@ -28,7 +28,6 @@ "+components/history_clusters/core/config.h", "+components/heap_profiling/in_process/heap_profiler_controller.h", "+components/metrics/call_stack_profile_builder.h", - "+components/metrics/call_stack_profile_params.h", "+components/nacl/common", "+components/nacl/renderer", "+components/network_hints/renderer",
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 4f6054a..cbb2975 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -86,7 +86,6 @@ #include "components/heap_profiling/in_process/heap_profiler_controller.h" #include "components/history_clusters/core/config.h" #include "components/metrics/call_stack_profile_builder.h" -#include "components/metrics/call_stack_profile_params.h" #include "components/network_hints/renderer/web_prescient_networking_impl.h" #include "components/no_state_prefetch/common/prerender_url_loader_throttle.h" #include "components/no_state_prefetch/renderer/no_state_prefetch_client.h" @@ -499,12 +498,16 @@ WebString::FromASCII(scheme)); } + // This doesn't work in single-process mode. if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kSingleProcess)) { - // This doesn't work in single-process mode. + // The HeapProfilerController should have been created in + // ChromeMainDelegate::PostEarlyInitialization. + DCHECK_NE(HeapProfilerController::GetProfilingEnabled(), + HeapProfilerController::ProfilingEnabled::kNoController); if (ThreadProfiler::ShouldCollectProfilesForChildProcess() || - HeapProfilerController::IsProfilingEnabled( - metrics::CallStackProfileParams::Process::kRenderer)) { + HeapProfilerController::GetProfilingEnabled() == + HeapProfilerController::ProfilingEnabled::kEnabled) { ThreadProfiler::SetMainThreadTaskRunner( base::ThreadTaskRunnerHandle::Get()); mojo::PendingRemote<metrics::mojom::CallStackProfileCollector> collector;
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 1ee6b75..0442ad7 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -4664,14 +4664,15 @@ data = [ "data/extensions/api_test/login_screen_apis/", - "data/extensions/api_test/vpn_provider/", "data/extensions/api_test/preference/", + "data/extensions/api_test/vpn_provider/", "data/extensions/platform_apps/minimal/", "data/media/", + "data/policy/test_certs/", + "data/web_app_shortcuts/", "data/web_apps/", "data/web_share_target/", "data/webshare/", - "data/policy/test_certs/", ] data_deps = [
diff --git a/chrome/test/android/BUILD.gn b/chrome/test/android/BUILD.gn index e359cec..3521184 100644 --- a/chrome/test/android/BUILD.gn +++ b/chrome/test/android/BUILD.gn
@@ -400,7 +400,10 @@ android_library("chrome_java_test_support_common") { testonly = true - visibility = [ ":*" ] + visibility = [ + ":*", + "//chrome/android/features/tab_ui:unit_device_javatests", + ] sources = [ "javatests/src/org/chromium/chrome/browser/tab/MockTab.java", "javatests/src/org/chromium/chrome/test/ChromeJUnit4ClassRunner.java",
diff --git a/chrome/test/data/webui/BUILD.gn b/chrome/test/data/webui/BUILD.gn index c91b655f..00129822 100644 --- a/chrome/test/data/webui/BUILD.gn +++ b/chrome/test/data/webui/BUILD.gn
@@ -91,7 +91,6 @@ "histograms/histograms_internals_ui_browsertest.js", "history/history_browsertest.js", "invalidations/about_invalidations_browsertest.js", - "js/i18n_process_test.js", "js/webui_resource_module_async_browsertest.js", "js2gtest_browsertest.js", "management/a11y/management_a11y_test.js", @@ -162,6 +161,7 @@ "chromeos/gaia_action_buttons/gaia_action_buttons_browsertest.js", "chromeos/internet_detail_dialog_browsertest.js", "cr_components/chromeos/cr_components_chromeos_v3_browsertest.js", + "js/i18n_process_test.js", "post_message_api/post_message_api_browsertest.js", "set_time_dialog_browsertest.js", "settings/chromeos/a11y/v3_os_a11y_browsertest.js",
diff --git a/chrome/test/data/webui/usb_internals_test.js b/chrome/test/data/webui/usb_internals_test.js index fc6e90d..8a99f79 100644 --- a/chrome/test/data/webui/usb_internals_test.js +++ b/chrome/test/data/webui/usb_internals_test.js
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://usb-internals/app.js'; import 'chrome://test/mojo_webui_test_support.js'; import {PromiseResolver} from 'chrome://resources/js/promise_resolver.m.js'; import {String16} from 'chrome://resources/mojo/mojo/public/mojom/base/string16.mojom-webui.js'; import {TestBrowserProxy} from 'chrome://test/test_browser_proxy.js'; import {eventToPromise} from 'chrome://test/test_util.js'; +import {setSetupFn} from 'chrome://usb-internals/app.js'; import {UsbControlTransferParams, UsbControlTransferRecipient, UsbControlTransferType, UsbDeviceCallbackRouter, UsbDeviceRemote, UsbOpenDeviceError, UsbTransferStatus} from 'chrome://usb-internals/usb_device.mojom-webui.js'; import {UsbInternalsPageHandler, UsbInternalsPageHandlerReceiver, UsbInternalsPageHandlerRemote} from 'chrome://usb-internals/usb_internals.mojom-webui.js'; import {UsbDeviceManagerReceiver, UsbDeviceManagerRemote} from 'chrome://usb-internals/usb_manager.mojom-webui.js'; @@ -233,21 +233,17 @@ } const setupResolver = new PromiseResolver(); -const deviceManagerGetDevicesResolver = new PromiseResolver(); -const deviceTabInitializedResolver = new PromiseResolver(); let deviceDescriptorRenderPromise = eventToPromise('device-descriptor-complete-for-test', document.body); let pageHandler = null; -window.deviceListCompleteFn = () => { - deviceManagerGetDevicesResolver.resolve(); -}; +const deviceTabInitializedPromise = + eventToPromise('device-tab-initialized-for-test', document.body); -window.deviceTabInitializedFn = () => { - deviceTabInitializedResolver.resolve(); -}; +const deviceManagerGetDevicesPromise = + eventToPromise('device-list-complete-for-test', document.body); -window.setupFn = () => { +setSetupFn(() => { const pageHandlerInterceptor = new MojoInterfaceInterceptor(UsbInternalsPageHandler.$interfaceName); pageHandlerInterceptor.oninterfacerequest = (e) => { @@ -257,7 +253,7 @@ pageHandlerInterceptor.start(); return Promise.resolve(); -}; +}); suite('UsbInternalsUITest', function() { @@ -298,7 +294,7 @@ .querySelectorAll('th'); assertEquals(8, columns.length); - await deviceManagerGetDevicesResolver.promise; + await deviceManagerGetDevicesPromise; const devices = devicesTable.querySelectorAll('tbody tr'); assertEquals(EXPECT_DEVICES_NUM, devices.length); }); @@ -360,7 +356,7 @@ // Test the tab opened by clicking inspect button contains a panel that // can manually retrieve device descriptor from device. Check the response // can be rendered correctly. - await deviceTabInitializedResolver.promise; + await deviceTabInitializedPromise; // The tab panel of the first device is opened in previous test as the // third tab panel. This device has correct device descriptor. const deviceTab = app.shadowRoot.querySelectorAll('div[slot=\'panel\']')[2]; @@ -423,14 +419,14 @@ }); test('RenderShortDeviceDescriptor', async function() { - await deviceManagerGetDevicesResolver.promise; + await deviceManagerGetDevicesPromise; const devicesTable = app.$('#device-list'); // Inspect the second device, which has short device descriptor. devicesTable.querySelectorAll('button')[1].click(); // The fourth is the device tab (a third tab was opened in a previous test). const deviceTab = app.shadowRoot.querySelectorAll('div[slot=\'panel\']')[3]; - await deviceTabInitializedResolver.promise; + await deviceTabInitializedPromise; deviceDescriptorRenderPromise = eventToPromise('device-descriptor-complete-for-test', document.body); deviceTab.querySelector('.device-descriptor-button').click();
diff --git a/chrome/updater/win/win_util.cc b/chrome/updater/win/win_util.cc index b0f7a0e9..888c6401 100644 --- a/chrome/updater/win/win_util.cc +++ b/chrome/updater/win/win_util.cc
@@ -187,7 +187,7 @@ // `ERROR_OLD_WIN_VERSION`. We do not handle that case here. // https://msdn.microsoft.com/ms725492. OSVERSIONINFOEX os_in = os; - return !!::VerifyVersionInfo(&os_in, type_mask, cond_mask); + return ::VerifyVersionInfo(&os_in, type_mask, cond_mask); } } // namespace @@ -797,15 +797,14 @@ bool CompareOSVersions(const OSVERSIONINFOEX& os_version, BYTE oper) { DCHECK(oper); - const DWORD os_sp_type_mask = VER_MAJORVERSION | VER_MINORVERSION | + constexpr DWORD kOSTypeMask = VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR; - const DWORD build_number_type_mask = VER_BUILDNUMBER; + constexpr DWORD kBuildTypeMask = VER_BUILDNUMBER; // If the OS and the service pack match, return the build number comparison. - return CompareOSVersionsInternal(os_version, os_sp_type_mask, VER_EQUAL) - ? CompareOSVersionsInternal(os_version, build_number_type_mask, - oper) - : CompareOSVersionsInternal(os_version, os_sp_type_mask, oper); + return CompareOSVersionsInternal(os_version, kOSTypeMask, VER_EQUAL) + ? CompareOSVersionsInternal(os_version, kBuildTypeMask, oper) + : CompareOSVersionsInternal(os_version, kOSTypeMask, oper); } } // namespace updater
diff --git a/chrome/updater/win/win_util_unittest.cc b/chrome/updater/win/win_util_unittest.cc index 00610051..557cd0ed 100644 --- a/chrome/updater/win/win_util_unittest.cc +++ b/chrome/updater/win/win_util_unittest.cc
@@ -19,6 +19,7 @@ #include "chrome/updater/win/test/test_executables.h" #include "chrome/updater/win/win_constants.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace updater { namespace {
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index 4c7fc29..0d7e6405 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc
@@ -14,7 +14,6 @@ #include "base/path_service.h" #include "build/build_config.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/profiler/process_type.h" #include "chrome/common/profiler/thread_profiler.h" #include "chrome/common/profiler/thread_profiler_configuration.h" #include "chrome/utility/browser_exposed_utility_interfaces.h" @@ -69,18 +68,22 @@ base::CommandLine::ForCurrentProcess(); const std::string process_type = command_line->GetSwitchValueASCII(switches::kProcessType); - if (process_type == - switches::kUtilityProcess && // An in-process utility thread may run - // in other processes, only set up - // collector in a utility process. - (ThreadProfiler::ShouldCollectProfilesForChildProcess() || - HeapProfilerController::IsProfilingEnabled( - GetProfileParamsProcess(*command_line)))) { - mojo::PendingRemote<metrics::mojom::CallStackProfileCollector> collector; - content::ChildThread::Get()->BindHostReceiver( - collector.InitWithNewPipeAndPassReceiver()); - metrics::CallStackProfileBuilder::SetParentProfileCollectorForChildProcess( - std::move(collector)); + // An in-process utility thread may run in other processes, only set up + // collector in a utility process. + if (process_type == switches::kUtilityProcess) { + // The HeapProfilerController should have been created in + // ChromeMainDelegate::PostEarlyInitialization. + DCHECK_NE(HeapProfilerController::GetProfilingEnabled(), + HeapProfilerController::ProfilingEnabled::kNoController); + if (ThreadProfiler::ShouldCollectProfilesForChildProcess() || + HeapProfilerController::GetProfilingEnabled() == + HeapProfilerController::ProfilingEnabled::kEnabled) { + mojo::PendingRemote<metrics::mojom::CallStackProfileCollector> collector; + content::ChildThread::Get()->BindHostReceiver( + collector.InitWithNewPipeAndPassReceiver()); + metrics::CallStackProfileBuilder:: + SetParentProfileCollectorForChildProcess(std::move(collector)); + } } }
diff --git a/chromeos/ash/components/oobe_quick_start/connectivity/BUILD.gn b/chromeos/ash/components/oobe_quick_start/connectivity/BUILD.gn index 6050c8b3..6a791b5 100644 --- a/chromeos/ash/components/oobe_quick_start/connectivity/BUILD.gn +++ b/chromeos/ash/components/oobe_quick_start/connectivity/BUILD.gn
@@ -12,6 +12,8 @@ "//device/bluetooth", ] sources = [ + "fast_pair_advertiser.cc", + "fast_pair_advertiser.h", "target_device_connection_broker.cc", "target_device_connection_broker.h", "target_device_connection_broker_factory.cc", @@ -38,5 +40,8 @@ "//base/test:test_support", "//device/bluetooth:mocks", ] - sources = [ "target_device_connection_broker_impl_unittest.cc" ] + sources = [ + "fast_pair_advertiser_unittest.cc", + "target_device_connection_broker_impl_unittest.cc", + ] }
diff --git a/chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser.cc b/chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser.cc new file mode 100644 index 0000000..221701a --- /dev/null +++ b/chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser.cc
@@ -0,0 +1,179 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser.h" + +#include <string> + +#include "base/callback_helpers.h" +#include "base/logging.h" +#include "base/unguessable_token.h" + +namespace { + +constexpr const char kFastPairServiceUuid[] = + "0000fe2c-0000-1000-8000-00805f9b34fb"; +constexpr uint8_t kFastPairModelId[] = {0x41, 0xc0, 0xd9}; +constexpr uint16_t kCompanyId = 0x00e0; + +// TODO(b/207087915): This value comes from Android, but we may need to +// find a more appropriate power setting for Chrome OS devices. +const int8_t kAdjustedTxPower = -66; + +} // namespace + +// static +FastPairAdvertiser::Factory* FastPairAdvertiser::Factory::factory_instance_ = + nullptr; + +// static +std::unique_ptr<FastPairAdvertiser> FastPairAdvertiser::Factory::Create( + scoped_refptr<device::BluetoothAdapter> adapter) { + if (factory_instance_) + return factory_instance_->CreateInstance(adapter); + + return std::make_unique<FastPairAdvertiser>(adapter); +} + +// static +void FastPairAdvertiser::Factory::SetFactoryForTesting( + FastPairAdvertiser::Factory* factory) { + factory_instance_ = factory; +} + +FastPairAdvertiser::FastPairAdvertiser( + scoped_refptr<device::BluetoothAdapter> adapter) { + DCHECK(adapter && adapter->IsPresent() && adapter->IsPowered()); + adapter_ = adapter; +} + +FastPairAdvertiser::~FastPairAdvertiser() { + StopAdvertising(base::DoNothing()); +} + +void FastPairAdvertiser::AdvertisementReleased( + device::BluetoothAdvertisement* advertisement) { + StopAdvertising(base::DoNothing()); +} + +void FastPairAdvertiser::StartAdvertising( + base::OnceCallback<void()> callback, + base::OnceCallback<void()> error_callback) { + DCHECK(adapter_->IsPresent() && adapter_->IsPowered()); + DCHECK(!advertisement_); + RegisterAdvertisement(std::move(callback), std::move(error_callback)); +} + +void FastPairAdvertiser::StopAdvertising(base::OnceCallback<void()> callback) { + if (!advertisement_) { + std::move(callback).Run(); + // |this| might be destroyed here, do not access local fields. + return; + } + + UnregisterAdvertisement(std::move(callback)); +} + +void FastPairAdvertiser::RegisterAdvertisement( + base::OnceClosure callback, + base::OnceClosure error_callback) { + auto advertisement_data = + std::make_unique<device::BluetoothAdvertisement::Data>( + device::BluetoothAdvertisement::ADVERTISEMENT_TYPE_BROADCAST); + + auto list = std::make_unique<device::BluetoothAdvertisement::UUIDList>(); + list->push_back(kFastPairServiceUuid); + advertisement_data->set_service_uuids(std::move(list)); + + auto service_data = + std::make_unique<device::BluetoothAdvertisement::ServiceData>(); + auto payload = std::vector<uint8_t>(std::begin(kFastPairModelId), + std::end(kFastPairModelId)); + auto service_metadata = GenerateServiceMetadata(); + payload.insert(std::end(payload), std::begin(service_metadata), + std::end(service_metadata)); + service_data->insert(std::pair<std::string, std::vector<uint8_t>>( + kFastPairServiceUuid, payload)); + advertisement_data->set_service_data(std::move(service_data)); + + auto manufacturer_data = + std::make_unique<device::BluetoothAdvertisement::ManufacturerData>(); + auto manufacturer_metadata = GenerateManufacturerMetadata(); + manufacturer_data->insert(std::pair<uint16_t, std::vector<uint8_t>>( + kCompanyId, manufacturer_metadata)); + advertisement_data->set_manufacturer_data(std::move(manufacturer_data)); + + advertisement_data->set_include_tx_power(true); + + adapter_->RegisterAdvertisement( + std::move(advertisement_data), + base::BindOnce(&FastPairAdvertiser::OnRegisterAdvertisement, + weak_ptr_factory_.GetWeakPtr(), std::move(callback)), + base::BindOnce(&FastPairAdvertiser::OnRegisterAdvertisementError, + weak_ptr_factory_.GetWeakPtr(), + std::move(error_callback))); +} + +void FastPairAdvertiser::OnRegisterAdvertisement( + base::OnceClosure callback, + scoped_refptr<device::BluetoothAdvertisement> advertisement) { + advertisement_ = advertisement; + advertisement_->AddObserver(this); + std::move(callback).Run(); +} + +void FastPairAdvertiser::OnRegisterAdvertisementError( + base::OnceClosure error_callback, + device::BluetoothAdvertisement::ErrorCode error_code) { + LOG(ERROR) << __func__ << " failed with error code = " << error_code; + std::move(error_callback).Run(); + // |this| might be destroyed here, do not access local fields. +} + +void FastPairAdvertiser::UnregisterAdvertisement(base::OnceClosure callback) { + stop_callback_ = std::move(callback); + advertisement_->RemoveObserver(this); + advertisement_->Unregister( + base::BindOnce(&FastPairAdvertiser::OnUnregisterAdvertisement, + weak_ptr_factory_.GetWeakPtr()), + base::BindOnce(&FastPairAdvertiser::OnUnregisterAdvertisementError, + weak_ptr_factory_.GetWeakPtr())); +} + +void FastPairAdvertiser::OnUnregisterAdvertisement() { + advertisement_.reset(); + std::move(stop_callback_).Run(); + // |this| might be destroyed here, do not access local fields. +} + +void FastPairAdvertiser::OnUnregisterAdvertisementError( + device::BluetoothAdvertisement::ErrorCode error_code) { + LOG(WARNING) << __func__ << " failed with error code = " << error_code; + advertisement_.reset(); + std::move(stop_callback_).Run(); + // |this| might be destroyed here, do not access local fields. +} + +std::vector<uint8_t> FastPairAdvertiser::GenerateServiceMetadata() { + std::vector<uint8_t> metadata; + + // Note: We convert this to a positive value before transport to align with + // Android's behavior. + int8_t powerConverted = -kAdjustedTxPower; + metadata.push_back(powerConverted); + return metadata; +} + +std::vector<uint8_t> FastPairAdvertiser::GenerateManufacturerMetadata() { + // TODO(b/235403498): This code may need to be updated later to be derived + // from the device BT address. It is not required in order for the + // advertisement to trigger the Fast Pair halfsheet. + auto token = base::UnguessableToken::Create(); + base::span<const uint8_t> fast_pair_code = token.AsBytes().first(2); + + std::vector<uint8_t> metadata(std::begin(fast_pair_code), + std::end(fast_pair_code)); + + return metadata; +} \ No newline at end of file
diff --git a/chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser.h b/chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser.h new file mode 100644 index 0000000..0201b6a --- /dev/null +++ b/chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser.h
@@ -0,0 +1,83 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMEOS_ASH_COMPONENTS_OOBE_QUICK_START_CONNECTIVITY_FAST_PAIR_ADVERTISER_H_ +#define CHROMEOS_ASH_COMPONENTS_OOBE_QUICK_START_CONNECTIVITY_FAST_PAIR_ADVERTISER_H_ + +#include <memory> +#include <vector> + +#include "base/callback.h" +#include "base/memory/weak_ptr.h" +#include "device/bluetooth/bluetooth_adapter.h" +#include "device/bluetooth/bluetooth_advertisement.h" + +// FastPairAdvertiser broadcasts advertisements with the service UUID +// 0xFE2C and model ID 0x41C0D9. When the remote device detects this +// advertisement it will trigger a prompt to begin Quick Start. +class FastPairAdvertiser : public device::BluetoothAdvertisement::Observer { + public: + class Factory { + public: + Factory() = default; + Factory(const Factory&) = delete; + Factory& operator=(const Factory&) = delete; + + static std::unique_ptr<FastPairAdvertiser> Create( + scoped_refptr<device::BluetoothAdapter> adapter); + + static void SetFactoryForTesting(Factory* factory); + + protected: + virtual ~Factory() = default; + virtual std::unique_ptr<FastPairAdvertiser> CreateInstance( + scoped_refptr<device::BluetoothAdapter> adapter) = 0; + + private: + static Factory* factory_instance_; + }; + + explicit FastPairAdvertiser(scoped_refptr<device::BluetoothAdapter> adapter); + ~FastPairAdvertiser() override; + FastPairAdvertiser(const FastPairAdvertiser&) = delete; + FastPairAdvertiser& operator=(const FastPairAdvertiser&) = delete; + + // Begin broadcasting Fast Pair advertisement. + virtual void StartAdvertising(base::OnceClosure callback, + base::OnceClosure error_callback); + + // Stop broadcasting Fast Pair advertisement. + virtual void StopAdvertising(base::OnceClosure callback); + + private: + // device::BluetoothAdvertisement::Observer: + void AdvertisementReleased( + device::BluetoothAdvertisement* advertisement) override; + + void RegisterAdvertisement(base::OnceClosure callback, + base::OnceClosure error_callback); + void OnRegisterAdvertisement( + base::OnceClosure callback, + scoped_refptr<device::BluetoothAdvertisement> advertisement); + void OnRegisterAdvertisementError( + base::OnceClosure error_callback, + device::BluetoothAdvertisement::ErrorCode error_code); + void UnregisterAdvertisement(base::OnceClosure callback); + void OnUnregisterAdvertisement(); + void OnUnregisterAdvertisementError( + device::BluetoothAdvertisement::ErrorCode error_code); + + // Returns metadata in format [ adjusted_tx_power (1 byte) ]. + std::vector<uint8_t> GenerateServiceMetadata(); + + // Returns metadata in format [ fast_pair_code (2 bytes) ]. + std::vector<uint8_t> GenerateManufacturerMetadata(); + + scoped_refptr<device::BluetoothAdapter> adapter_; + scoped_refptr<device::BluetoothAdvertisement> advertisement_; + base::OnceClosure stop_callback_; + base::WeakPtrFactory<FastPairAdvertiser> weak_ptr_factory_{this}; +}; + +#endif // CHROMEOS_ASH_COMPONENTS_OOBE_QUICK_START_CONNECTIVITY_FAST_PAIR_ADVERTISER_H_ \ No newline at end of file
diff --git a/chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser_unittest.cc b/chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser_unittest.cc new file mode 100644 index 0000000..bdac6ec --- /dev/null +++ b/chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser_unittest.cc
@@ -0,0 +1,270 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/ash/components/oobe_quick_start/connectivity/fast_pair_advertiser.h" + +#include <memory> +#include <utility> +#include <vector> + +#include "base/callback_helpers.h" +#include "base/memory/ptr_util.h" +#include "base/test/bind.h" +#include "base/time/time.h" +#include "device/bluetooth/test/mock_bluetooth_adapter.h" +#include "device/bluetooth/test/mock_bluetooth_advertisement.h" +#include "testing/gtest/include/gtest/gtest.h" + +using ::testing::_; +using testing::NiceMock; +using testing::Return; + +namespace { +constexpr const char kFastPairServiceUuid[] = + "0000fe2c-0000-1000-8000-00805f9b34fb"; +const uint8_t kFastPairModelId[] = {0x41, 0xc0, 0xd9}; +const int8_t kAdjustedTxPower = -66; + +} // namespace + +struct RegisterAdvertisementArgs { + RegisterAdvertisementArgs( + const device::BluetoothAdvertisement::UUIDList& service_uuids, + const device::BluetoothAdvertisement::ServiceData& service_data, + device::BluetoothAdapter::CreateAdvertisementCallback callback, + device::BluetoothAdapter::AdvertisementErrorCallback error_callback) + : service_uuids(service_uuids), + service_data(service_data), + callback(std::move(callback)), + error_callback(std::move(error_callback)) {} + + device::BluetoothAdvertisement::UUIDList service_uuids; + device::BluetoothAdvertisement::ServiceData service_data; + device::BluetoothAdapter::CreateAdvertisementCallback callback; + device::BluetoothAdapter::AdvertisementErrorCallback error_callback; +}; + +class MockBluetoothAdapterWithAdvertisements + : public device::MockBluetoothAdapter { + public: + MOCK_METHOD1(RegisterAdvertisementWithArgsStruct, + void(RegisterAdvertisementArgs*)); + + void RegisterAdvertisement( + std::unique_ptr<device::BluetoothAdvertisement::Data> advertisement_data, + device::BluetoothAdapter::CreateAdvertisementCallback callback, + device::BluetoothAdapter::AdvertisementErrorCallback error_callback) + override { + RegisterAdvertisementWithArgsStruct(new RegisterAdvertisementArgs( + *advertisement_data->service_uuids(), + *advertisement_data->service_data(), std::move(callback), + std::move(error_callback))); + } + + protected: + ~MockBluetoothAdapterWithAdvertisements() override = default; +}; + +class FakeBluetoothAdvertisement : public device::BluetoothAdvertisement { + public: + // device::BluetoothAdvertisement: + void Unregister(SuccessCallback success_callback, + ErrorCallback error_callback) override { + // Both of these callbacks destroy the BluetoothAdvertisement object, so + // update the |called_unregister_success_callback_| and + // |called_unregister_error_callback_| bools immediately before actually + // invoking their respective callbacks in order to avoid the use of heap + // allocated memory after it has been freed. + if (should_unregister_succeed_) { + called_unregister_success_callback_ = true; + std::move(success_callback).Run(); + return; + } + + called_unregister_error_callback_ = true; + std::move(error_callback) + .Run(device::BluetoothAdvertisement::ErrorCode:: + INVALID_ADVERTISEMENT_ERROR_CODE); + } + + bool HasObserver(Observer* observer) { + return observers_.HasObserver(observer); + } + + void ReleaseAdvertisement() { + for (auto& observer : observers_) + observer.AdvertisementReleased(this); + } + + bool called_unregister_success_callback() { + return called_unregister_success_callback_; + } + + bool called_unregister_error_callback() { + return called_unregister_error_callback_; + } + + void set_should_unregister_succeed(bool should_unregister_succeed) { + should_unregister_succeed_ = should_unregister_succeed; + } + + protected: + ~FakeBluetoothAdvertisement() override = default; + + bool should_unregister_succeed_ = true; + bool called_unregister_success_callback_ = false; + bool called_unregister_error_callback_ = false; +}; + +class FastPairAdvertiserTest : public testing::Test { + public: + FastPairAdvertiserTest(const FastPairAdvertiserTest&) = delete; + FastPairAdvertiserTest& operator=(const FastPairAdvertiserTest&) = delete; + + protected: + FastPairAdvertiserTest() = default; + + void SetUp() override { + mock_adapter_ = base::MakeRefCounted< + NiceMock<MockBluetoothAdapterWithAdvertisements>>(); + ON_CALL(*mock_adapter_, IsPresent()).WillByDefault(Return(true)); + ON_CALL(*mock_adapter_, IsPowered()).WillByDefault(Return(true)); + ON_CALL(*mock_adapter_, RegisterAdvertisementWithArgsStruct(_)) + .WillByDefault(Invoke( + this, &FastPairAdvertiserTest::OnAdapterRegisterAdvertisement)); + + fast_pair_advertiser_ = std::make_unique<FastPairAdvertiser>(mock_adapter_); + } + + void OnAdapterRegisterAdvertisement(RegisterAdvertisementArgs* args) { + register_args_ = base::WrapUnique(args); + } + + void StartAdvertising() { + fast_pair_advertiser_->StartAdvertising( + base::BindOnce(&FastPairAdvertiserTest::OnStartAdvertising, + base::Unretained(this)), + base::BindOnce(&FastPairAdvertiserTest::OnStartAdvertisingError, + base::Unretained(this))); + auto service_uuid_list = + std::make_unique<device::BluetoothAdvertisement::UUIDList>(); + service_uuid_list->push_back(kFastPairServiceUuid); + EXPECT_EQ(*service_uuid_list, register_args_->service_uuids); + + auto expected_payload = std::vector<uint8_t>(std::begin(kFastPairModelId), + std::end(kFastPairModelId)); + std::vector<uint8_t> metadata; + int8_t power_converted = -kAdjustedTxPower; + metadata.push_back(power_converted); + expected_payload.insert(std::end(expected_payload), std::begin(metadata), + std::end(metadata)); + + EXPECT_EQ(expected_payload, + register_args_->service_data[kFastPairServiceUuid]); + } + + void StopAdvertising() { + fast_pair_advertiser_->StopAdvertising(base::BindOnce( + &FastPairAdvertiserTest::OnStopAdvertising, base::Unretained(this))); + } + + void OnStartAdvertising() { called_on_start_advertising_ = true; } + + void OnStartAdvertisingError() { called_on_start_advertising_error_ = true; } + + void OnStopAdvertising() { called_on_stop_advertising_ = true; } + + bool called_on_start_advertising() { return called_on_start_advertising_; } + bool called_on_start_advertising_error() { + return called_on_start_advertising_error_; + } + bool called_on_stop_advertising() { return called_on_stop_advertising_; } + + scoped_refptr<NiceMock<MockBluetoothAdapterWithAdvertisements>> mock_adapter_; + std::unique_ptr<FastPairAdvertiser> fast_pair_advertiser_; + std::unique_ptr<RegisterAdvertisementArgs> register_args_; + bool called_on_start_advertising_ = false; + bool called_on_start_advertising_error_ = false; + bool called_on_stop_advertising_ = false; +}; + +TEST_F(FastPairAdvertiserTest, TestStartAdvertising_Success) { + StartAdvertising(); + auto fake_advertisement = base::MakeRefCounted<FakeBluetoothAdvertisement>(); + std::move(register_args_->callback).Run(fake_advertisement); + + EXPECT_TRUE(called_on_start_advertising()); + EXPECT_FALSE(called_on_start_advertising_error()); + EXPECT_FALSE(called_on_stop_advertising()); + EXPECT_TRUE(fake_advertisement->HasObserver(fast_pair_advertiser_.get())); +} + +TEST_F(FastPairAdvertiserTest, TestStartAdvertising_Error) { + StartAdvertising(); + std::move(register_args_->error_callback) + .Run(device::BluetoothAdvertisement::ErrorCode:: + INVALID_ADVERTISEMENT_ERROR_CODE); + + EXPECT_FALSE(called_on_start_advertising()); + EXPECT_TRUE(called_on_start_advertising_error()); + EXPECT_FALSE(called_on_stop_advertising()); +} + +// Regression test for crbug.com/1109581. +TEST_F(FastPairAdvertiserTest, TestStartAdvertising_DeleteInErrorCallback) { + fast_pair_advertiser_->StartAdvertising( + base::DoNothing(), + base::BindLambdaForTesting([&]() { fast_pair_advertiser_.reset(); })); + + std::move(register_args_->error_callback) + .Run(device::BluetoothAdvertisement::ErrorCode:: + INVALID_ADVERTISEMENT_ERROR_CODE); + + EXPECT_FALSE(fast_pair_advertiser_); +} + +TEST_F(FastPairAdvertiserTest, TestStopAdvertising_Success) { + StartAdvertising(); + auto fake_advertisement = base::MakeRefCounted<FakeBluetoothAdvertisement>(); + std::move(register_args_->callback).Run(fake_advertisement); + + fake_advertisement->set_should_unregister_succeed(true); + StopAdvertising(); + + EXPECT_TRUE(fake_advertisement->called_unregister_success_callback()); + EXPECT_FALSE(fake_advertisement->called_unregister_error_callback()); + EXPECT_TRUE(called_on_start_advertising()); + EXPECT_FALSE(called_on_start_advertising_error()); + EXPECT_TRUE(called_on_stop_advertising()); +} + +TEST_F(FastPairAdvertiserTest, TestStopAdvertising_Error) { + StartAdvertising(); + auto fake_advertisement = base::MakeRefCounted<FakeBluetoothAdvertisement>(); + std::move(register_args_->callback).Run(fake_advertisement); + + fake_advertisement->set_should_unregister_succeed(false); + StopAdvertising(); + + EXPECT_FALSE(fake_advertisement->called_unregister_success_callback()); + EXPECT_TRUE(fake_advertisement->called_unregister_error_callback()); + EXPECT_TRUE(called_on_start_advertising()); + EXPECT_FALSE(called_on_start_advertising_error()); + EXPECT_TRUE(called_on_stop_advertising()); +} + +TEST_F(FastPairAdvertiserTest, TestAdvertisementReleased) { + StartAdvertising(); + auto fake_advertisement = base::MakeRefCounted<FakeBluetoothAdvertisement>(); + std::move(register_args_->callback).Run(fake_advertisement); + + EXPECT_TRUE(fake_advertisement->HasObserver(fast_pair_advertiser_.get())); + + fake_advertisement->ReleaseAdvertisement(); + + EXPECT_TRUE(called_on_start_advertising()); + EXPECT_FALSE(called_on_start_advertising_error()); + EXPECT_FALSE(called_on_stop_advertising()); + EXPECT_FALSE(fake_advertisement->HasObserver(fast_pair_advertiser_.get())); +} \ No newline at end of file
diff --git a/chromeos/components/quick_answers/public/cpp/quick_answers_state.cc b/chromeos/components/quick_answers/public/cpp/quick_answers_state.cc index 822d1271..21f9216a 100644 --- a/chromeos/components/quick_answers/public/cpp/quick_answers_state.cc +++ b/chromeos/components/quick_answers/public/cpp/quick_answers_state.cc
@@ -82,6 +82,7 @@ if (prefs_initialized_) { observer->OnSettingsEnabled(settings_enabled_); observer->OnApplicationLocaleReady(resolved_application_locale_); + observer->OnPreferredLanguagesChanged(preferred_languages_); observer->OnEligibilityChanged(is_eligible_); } }
diff --git a/chromeos/components/quick_answers/public/cpp/quick_answers_state.h b/chromeos/components/quick_answers/public/cpp/quick_answers_state.h index 819109d9..18a1a23 100644 --- a/chromeos/components/quick_answers/public/cpp/quick_answers_state.h +++ b/chromeos/components/quick_answers/public/cpp/quick_answers_state.h
@@ -34,6 +34,8 @@ public: virtual void OnSettingsEnabled(bool enabled) {} virtual void OnApplicationLocaleReady(const std::string& locale) {} + virtual void OnPreferredLanguagesChanged( + const std::string& preferred_languages) {} virtual void OnEligibilityChanged(bool eligible) {} };
diff --git a/components/browser_ui/widget/android/BUILD.gn b/components/browser_ui/widget/android/BUILD.gn index f5779e6..508924cc 100644 --- a/components/browser_ui/widget/android/BUILD.gn +++ b/components/browser_ui/widget/android/BUILD.gn
@@ -303,7 +303,7 @@ ] } -android_library("javatests") { +android_library("unit_device_javatests") { testonly = true sources = [
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/PromoDialogRenderTest.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/PromoDialogRenderTest.java index 04e044b..f65797f 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/PromoDialogRenderTest.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/PromoDialogRenderTest.java
@@ -21,6 +21,7 @@ import org.chromium.base.test.params.ParameterAnnotations.UseRunnerDelegate; import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; import org.chromium.components.browser_ui.widget.PromoDialog.DialogParams; import org.chromium.components.browser_ui.widget.test.R; @@ -36,6 +37,7 @@ */ @RunWith(ParameterizedRunner.class) @UseRunnerDelegate(BaseJUnit4RunnerDelegate.class) +@Batch(Batch.UNIT_TESTS) public class PromoDialogRenderTest extends BlankUiTestActivityTestCase { @ClassParameter private static List<ParameterSet> sClassParams =
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RadioButtonRenderTest.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RadioButtonRenderTest.java index 92d157f1..38a2c9aa 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RadioButtonRenderTest.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RadioButtonRenderTest.java
@@ -21,6 +21,7 @@ import org.chromium.base.test.params.ParameterAnnotations.UseRunnerDelegate; import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; import org.chromium.components.browser_ui.widget.test.R; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -37,6 +38,7 @@ */ @RunWith(ParameterizedRunner.class) @UseRunnerDelegate(BaseJUnit4RunnerDelegate.class) +@Batch(Batch.PER_CLASS) public class RadioButtonRenderTest extends BlankUiTestActivityTestCase { @ClassParameter private static List<ParameterSet> sClassParams =
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RadioButtonWithIconRenderTest.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RadioButtonWithIconRenderTest.java index e870bc6..5d80971 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RadioButtonWithIconRenderTest.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RadioButtonWithIconRenderTest.java
@@ -21,6 +21,7 @@ import org.chromium.base.test.params.ParameterAnnotations.UseRunnerDelegate; import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; import org.chromium.components.browser_ui.widget.test.R; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -35,6 +36,7 @@ */ @RunWith(ParameterizedRunner.class) @UseRunnerDelegate(BaseJUnit4RunnerDelegate.class) +@Batch(Batch.UNIT_TESTS) public class RadioButtonWithIconRenderTest extends BlankUiTestActivityTestCase { @ClassParameter private static List<ParameterSet> sClassParams =
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RoundedIconGeneratorTest.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RoundedIconGeneratorTest.java index 44417790..d4af897 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RoundedIconGeneratorTest.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/RoundedIconGeneratorTest.java
@@ -15,25 +15,23 @@ import org.junit.Test; import org.junit.runner.RunWith; -import org.chromium.base.library_loader.LibraryLoader; -import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; +import org.chromium.content_public.browser.test.NativeLibraryTestUtils; /** * Unit tests for RoundedIconGenerator. */ @RunWith(BaseJUnit4ClassRunner.class) -@Batch(Batch.PER_CLASS) +@Batch(Batch.UNIT_TESTS) public class RoundedIconGeneratorTest { private static Context sContext; @BeforeClass public static void setUp() { sContext = InstrumentationRegistry.getTargetContext(); - LibraryLoader.getInstance().setLibraryProcessType(LibraryProcessType.PROCESS_BROWSER); - LibraryLoader.getInstance().ensureInitialized(); + NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess(); } private String getIconTextForUrl(String url, boolean includePrivateRegistries) {
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/listmenu/ListMenuRenderTest.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/listmenu/ListMenuRenderTest.java index ef3b9f7e..3f14d2bd 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/listmenu/ListMenuRenderTest.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/listmenu/ListMenuRenderTest.java
@@ -22,6 +22,7 @@ import org.chromium.base.test.params.ParameterAnnotations.UseRunnerDelegate; import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; import org.chromium.components.browser_ui.widget.test.R; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -38,6 +39,7 @@ */ @RunWith(ParameterizedRunner.class) @UseRunnerDelegate(BaseJUnit4RunnerDelegate.class) +@Batch(Batch.UNIT_TESTS) public class ListMenuRenderTest extends BlankUiTestActivityTestCase { @ParameterAnnotations.ClassParameter private static List<ParameterSet> sClassParams =
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/promo/PromoCardImpressionTest.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/promo/PromoCardImpressionTest.java index b903303..73f18c1 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/promo/PromoCardImpressionTest.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/promo/PromoCardImpressionTest.java
@@ -23,7 +23,6 @@ import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.CallbackHelper; -import org.chromium.base.test.util.FlakyTest; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.ui.test.util.BlankUiTestActivity; @@ -112,7 +111,6 @@ @Test @SmallTest - @FlakyTest(message = "https://crbug.com/1181859") public void testImpression_Card_Hide() throws TimeoutException { int initCount = mPromoSeenCallback.getCallCount(); setUpPromoCard(false, true);
diff --git a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/promo/PromoCardViewRenderTest.java b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/promo/PromoCardViewRenderTest.java index badcaf9..6ee6e3c 100644 --- a/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/promo/PromoCardViewRenderTest.java +++ b/components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/promo/PromoCardViewRenderTest.java
@@ -24,6 +24,7 @@ import org.chromium.base.test.params.ParameterAnnotations.UseRunnerDelegate; import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; +import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Criteria; import org.chromium.base.test.util.CriteriaHelper; import org.chromium.base.test.util.Feature; @@ -42,6 +43,7 @@ */ @RunWith(ParameterizedRunner.class) @UseRunnerDelegate(BaseJUnit4RunnerDelegate.class) +@Batch(Batch.UNIT_TESTS) public class PromoCardViewRenderTest extends BlankUiTestActivityTestCase { @ClassParameter private static List<ParameterSet> sClassParams =
diff --git a/components/heap_profiling/in_process/heap_profiler_controller.cc b/components/heap_profiling/in_process/heap_profiler_controller.cc index 9f3bcef..b1810b6 100644 --- a/components/heap_profiling/in_process/heap_profiler_controller.cc +++ b/components/heap_profiling/in_process/heap_profiler_controller.cc
@@ -34,6 +34,14 @@ namespace { +using ProfilingEnabled = HeapProfilerController::ProfilingEnabled; + +// Records whether heap profiling is enabled for this process. +// HeapProfilerController will set this on creation, and reset it to +// kNoController on destruction, so that it's always reset to the default +// state after each unit test that creates a HeapProfilerController. +ProfilingEnabled g_profiling_enabled = ProfilingEnabled::kNoController; + using ProcessType = metrics::CallStackProfileParams::Process; // Platform-specific parameter defaults. @@ -61,7 +69,7 @@ // Sets the chance that this client will report heap samples through a metrics // provider if it's on the stable channel. -constexpr base::FeatureParam<double> kStableProbability{ +[[maybe_unused]] constexpr base::FeatureParam<double> kStableProbability { &HeapProfilerController::kHeapProfilerReporting, "stable-probability", #if BUILDFLAG(IS_ANDROID) // With stable-probability 0.01 we get about 4x as many records as before @@ -75,7 +83,7 @@ // Sets the chance that this client will report heap samples through a metrics // provider if it's on a non-stable channel. -constexpr base::FeatureParam<double> kNonStableProbability{ +[[maybe_unused]] constexpr base::FeatureParam<double> kNonStableProbability{ &HeapProfilerController::kHeapProfilerReporting, "nonstable-probability", 0.5}; @@ -122,14 +130,38 @@ } } -bool DecideIfCollectionIsEnabled(version_info::Channel channel, - ProcessType process_type) { - if (!HeapProfilerController::IsProfilingEnabled(process_type)) - return false; +ProfilingEnabled DecideIfCollectionIsEnabled(version_info::Channel channel, + ProcessType process_type) { +#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_ARM64) + // TODO(crbug.com/1297724): The POSIX implementation of + // ModuleCache::CreateModuleForAddress is stubbed out on ARM64, so all samples + // would lack module information (see base/profiler/module_cache_posix.cc). + // Without this the reports cannot be symbolized so no point in collecting + // them. If this is fixed, also re-enable the tests in + // heap_profiler_controller_unittests.cc. + return ProfilingEnabled::kDisabled; +#else + if (!base::FeatureList::IsEnabled( + HeapProfilerController::kHeapProfilerReporting)) { + return ProfilingEnabled::kDisabled; + } + const char* process_string = ProcessParamString(process_type); + if (!process_string) { + // This process type is never supported. + return ProfilingEnabled::kDisabled; + } + const std::vector<std::string> supported_processes = + base::SplitString(kSupportedProcesses.Get(), ";", base::TRIM_WHITESPACE, + base::SPLIT_WANT_NONEMPTY); + if (!base::Contains(supported_processes, process_string)) + return ProfilingEnabled::kDisabled; const double probability = (channel == version_info::Channel::STABLE) ? kStableProbability.Get() : kNonStableProbability.Get(); - return base::RandDouble() < probability; + if (base::RandDouble() >= probability) + return ProfilingEnabled::kDisabled; + return ProfilingEnabled::kEnabled; +#endif } // Records a time histogram for the `interval` between snapshots, using the @@ -181,46 +213,34 @@ default; // static -bool HeapProfilerController::IsProfilingEnabled(ProcessType process_type) { -#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_ARM64) - // TODO(crbug.com/1297724): The POSIX implementation of - // ModuleCache::CreateModuleForAddress is stubbed out on ARM64, so all samples - // would lack module information (see base/profiler/module_cache_posix.cc). - // Without this the reports cannot be symbolized so no point in collecting - // them. If this is fixed, also re-enable the tests in - // heap_profiler_controller_unittests.cc. - return false; -#else - if (!base::FeatureList::IsEnabled( - HeapProfilerController::kHeapProfilerReporting)) { - return false; - } - const char* process_string = ProcessParamString(process_type); - if (!process_string) { - // This process type is never supported. - return false; - } - const std::vector<std::string> supported_processes = - base::SplitString(kSupportedProcesses.Get(), ";", base::TRIM_WHITESPACE, - base::SPLIT_WANT_NONEMPTY); - return base::Contains(supported_processes, process_string); -#endif +ProfilingEnabled HeapProfilerController::GetProfilingEnabled() { + return g_profiling_enabled; } HeapProfilerController::HeapProfilerController(version_info::Channel channel, ProcessType process_type) - : profiling_enabled_(DecideIfCollectionIsEnabled(channel, process_type)), - process_type_(process_type), - stopped_(base::MakeRefCounted<StoppedFlag>()) {} + : process_type_(process_type), + stopped_(base::MakeRefCounted<StoppedFlag>()) { + // Only one HeapProfilerController should exist at a time in each + // process. The class is not a singleton so it can be created and + // destroyed in tests. + DCHECK_EQ(g_profiling_enabled, ProfilingEnabled::kNoController); + g_profiling_enabled = DecideIfCollectionIsEnabled(channel, process_type); +} HeapProfilerController::~HeapProfilerController() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); stopped_->data.Set(); + g_profiling_enabled = ProfilingEnabled::kNoController; } void HeapProfilerController::StartIfEnabled() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + const bool profiling_enabled = + g_profiling_enabled == ProfilingEnabled::kEnabled; base::UmaHistogramBoolean("HeapProfiling.InProcess.Enabled", - profiling_enabled_); - if (!profiling_enabled_) + profiling_enabled); + if (!profiling_enabled) return; int sampling_rate_bytes = kSamplingRateBytes.Get(); if (sampling_rate_bytes > 0)
diff --git a/components/heap_profiling/in_process/heap_profiler_controller.h b/components/heap_profiling/in_process/heap_profiler_controller.h index 72d6c9221..860f1263 100644 --- a/components/heap_profiling/in_process/heap_profiler_controller.h +++ b/components/heap_profiling/in_process/heap_profiler_controller.h
@@ -11,6 +11,7 @@ #include "base/feature_list.h" #include "base/memory/ref_counted.h" #include "base/sampling_heap_profiler/sampling_heap_profiler.h" +#include "base/sequence_checker.h" #include "base/synchronization/atomic_flag.h" #include "base/time/time.h" #include "components/metrics/call_stack_profile_params.h" @@ -20,9 +21,16 @@ // snapshots for the current process. class HeapProfilerController { public: - // Returns true if heap profiling is enabled for the given `process_type`. - static bool IsProfilingEnabled( - metrics::CallStackProfileParams::Process process_type); + enum class ProfilingEnabled { + kNoController, + kDisabled, + kEnabled, + }; + + // Returns kEnabled if heap profiling is enabled, kDisabled if not. If no + // HeapProfilerController exists the profiling state is indeterminate so the + // function returns kNoController. + static ProfilingEnabled GetProfilingEnabled(); // Checks if heap profiling should be enabled for this process. If so, starts // sampling heap allocations immediately but does not schedule snapshots of @@ -123,10 +131,6 @@ static void RetrieveAndSendSnapshot(ProcessType process_type); - // On startup this will be determined randomly based on the current channel - // and the probability parameters of the HeapProfilerReporting feature. - const bool profiling_enabled_; - const ProcessType process_type_; // This flag is set when the HeapProfilerController is torn down, to stop @@ -135,6 +139,8 @@ // HeapProfilerController is deleted on the main thread. scoped_refptr<StoppedFlag> stopped_; bool suppress_randomness_for_testing_ = false; + + SEQUENCE_CHECKER(sequence_checker_); }; #endif // COMPONENTS_HEAP_PROFILING_IN_PROCESS_HEAP_PROFILER_CONTROLLER_H_
diff --git a/components/heap_profiling/in_process/heap_profiler_controller_unittest.cc b/components/heap_profiling/in_process/heap_profiler_controller_unittest.cc index 3f6b220e..c0a57dd 100644 --- a/components/heap_profiling/in_process/heap_profiler_controller_unittest.cc +++ b/components/heap_profiling/in_process/heap_profiler_controller_unittest.cc
@@ -164,6 +164,8 @@ ConnectRemoteProfileCollector(std::move(collector_callback)); } + ASSERT_EQ(HeapProfilerController::GetProfilingEnabled(), + HeapProfilerController::ProfilingEnabled::kNoController); controller_ = std::make_unique<HeapProfilerController>(channel, process_type); controller_->SuppressRandomnessForTesting(); @@ -394,6 +396,10 @@ version_info::Channel::STABLE, ProcessType::kBrowser, base::BindRepeating(&HeapProfilerControllerTest::RecordSampleReceived, base::Unretained(this))); + EXPECT_EQ(HeapProfilerController::GetProfilingEnabled(), + GetParam().stable.expect_browser_sample + ? HeapProfilerController::ProfilingEnabled::kEnabled + : HeapProfilerController::ProfilingEnabled::kDisabled); histogram_tester_.ExpectUniqueSample("HeapProfiling.InProcess.Enabled", GetParam().stable.expect_browser_sample, 1); @@ -412,6 +418,10 @@ version_info::Channel::CANARY, ProcessType::kBrowser, base::BindRepeating(&HeapProfilerControllerTest::RecordSampleReceived, base::Unretained(this))); + EXPECT_EQ(HeapProfilerController::GetProfilingEnabled(), + GetParam().nonstable.expect_browser_sample + ? HeapProfilerController::ProfilingEnabled::kEnabled + : HeapProfilerController::ProfilingEnabled::kDisabled); histogram_tester_.ExpectUniqueSample( "HeapProfiling.InProcess.Enabled", GetParam().nonstable.expect_browser_sample, 1); @@ -424,6 +434,10 @@ version_info::Channel::STABLE, ProcessType::kUtility, base::BindRepeating(&HeapProfilerControllerTest::RecordSampleReceived, base::Unretained(this))); + EXPECT_EQ(HeapProfilerController::GetProfilingEnabled(), + GetParam().stable.expect_child_sample + ? HeapProfilerController::ProfilingEnabled::kEnabled + : HeapProfilerController::ProfilingEnabled::kDisabled); histogram_tester_.ExpectUniqueSample("HeapProfiling.InProcess.Enabled", GetParam().stable.expect_child_sample, 1); @@ -438,6 +452,8 @@ version_info::Channel::STABLE, ProcessType::kUnknown, base::BindRepeating(&HeapProfilerControllerTest::RecordSampleReceived, base::Unretained(this))); + EXPECT_EQ(HeapProfilerController::GetProfilingEnabled(), + HeapProfilerController::ProfilingEnabled::kDisabled); histogram_tester_.ExpectUniqueSample("HeapProfiling.InProcess.Enabled", false, 1); AddOneSampleAndWait();
diff --git a/components/omnibox/browser/base_search_provider.cc b/components/omnibox/browser/base_search_provider.cc index d2f8c0a..ee69fdb0 100644 --- a/components/omnibox/browser/base_search_provider.cc +++ b/components/omnibox/browser/base_search_provider.cc
@@ -230,8 +230,6 @@ (classification == OEP::INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS) || (classification == OEP::INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS) || (classification == OEP::NTP_REALBOX) || - (classification == OEP::START_SURFACE_HOMEPAGE) || - (classification == OEP::START_SURFACE_NEW_TAB) || (classification == OEP::ANDROID_SHORTCUTS_WIDGET) || (classification == OEP::NTP_ZPS_PREFETCH); }
diff --git a/components/omnibox/browser/most_visited_sites_provider.cc b/components/omnibox/browser/most_visited_sites_provider.cc index 538ad77..4c3bc35 100644 --- a/components/omnibox/browser/most_visited_sites_provider.cc +++ b/components/omnibox/browser/most_visited_sites_provider.cc
@@ -148,9 +148,7 @@ // Any context other than those listed below will be rejected. if (page_class != metrics::OmniboxEventProto::OTHER && page_class != metrics::OmniboxEventProto::ANDROID_SEARCH_WIDGET && - page_class != metrics::OmniboxEventProto::ANDROID_SHORTCUTS_WIDGET && - page_class != metrics::OmniboxEventProto::START_SURFACE_HOMEPAGE && - page_class != metrics::OmniboxEventProto::START_SURFACE_NEW_TAB) { + page_class != metrics::OmniboxEventProto::ANDROID_SHORTCUTS_WIDGET) { return false; }
diff --git a/components/omnibox/browser/most_visited_sites_provider_unittest.cc b/components/omnibox/browser/most_visited_sites_provider_unittest.cc index 875c662..94f34ceb 100644 --- a/components/omnibox/browser/most_visited_sites_provider_unittest.cc +++ b/components/omnibox/browser/most_visited_sites_provider_unittest.cc
@@ -82,7 +82,6 @@ }; constexpr const auto* WEB_URL = u"https://example.com/"; -constexpr const auto* NTP_URL = u"chrome://newtab"; constexpr const auto* SRP_URL = u"https://www.google.com/?q=flowers"; constexpr const auto* FTP_URL = u"ftp://just.for.filtering.com"; } // namespace @@ -335,18 +334,6 @@ EXPECT_TRUE( provider_->AllowMostVisitedSitesSuggestions(BuildAutocompleteInput( WEB_URL, WEB_URL, OEP::OTHER, OFT::DELETED_PERMANENT_TEXT))); - - // Verifies that metrics::OmniboxEventProto::START_SURFACE_HOMEPAGE is allowed - // for MostVisited. - EXPECT_TRUE( - provider_->AllowMostVisitedSitesSuggestions(BuildAutocompleteInput( - {}, NTP_URL, OEP::START_SURFACE_HOMEPAGE, OFT::ON_FOCUS))); - - // Verifies that metrics::OmniboxEventProto::START_SURFACE_NEW_TAB is allowed - // for MostVisited. - EXPECT_TRUE( - provider_->AllowMostVisitedSitesSuggestions(BuildAutocompleteInput( - {}, NTP_URL, OEP::START_SURFACE_NEW_TAB, OFT::ON_FOCUS))); } TEST_P(ParameterizedMostVisitedSitesProviderTest, TestCreateMostVisitedMatch) {
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc index 73d981b1..9c1cd23 100644 --- a/components/omnibox/browser/omnibox_field_trial.cc +++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -53,8 +53,7 @@ base::StringToInt(it->second, &bucket.second); score_buckets->buckets().push_back(bucket); } - std::sort(score_buckets->buckets().begin(), - score_buckets->buckets().end(), + std::sort(score_buckets->buckets().begin(), score_buckets->buckets().end(), std::greater<ScoreBuckets::CountMaxRelevance>()); } } @@ -159,16 +158,12 @@ } // namespace HUPScoringParams::ScoreBuckets::ScoreBuckets() - : relevance_cap_(-1), - half_life_days_(-1), - use_decay_factor_(false) { -} + : relevance_cap_(-1), half_life_days_(-1), use_decay_factor_(false) {} HUPScoringParams::ScoreBuckets::ScoreBuckets(const ScoreBuckets& other) = default; -HUPScoringParams::ScoreBuckets::~ScoreBuckets() { -} +HUPScoringParams::ScoreBuckets::~ScoreBuckets() {} size_t HUPScoringParams::ScoreBuckets::EstimateMemoryUsage() const { return base::trace_event::EstimateMemoryUsage(buckets_); @@ -197,8 +192,7 @@ int OmniboxFieldTrial::GetDisabledProviderTypes() { const std::string& types_string = variations::GetVariationParamValue( - kBundledExperimentFieldTrialName, - kDisableProvidersRule); + kBundledExperimentFieldTrialName, kDisableProvidersRule); int types = 0; if (types_string.empty() || !base::StringToInt(types_string, &types)) { return 0; @@ -300,8 +294,8 @@ // score above 850 ( 1400 * 0.61 > 850). 850 is the maximum score for // queries when the input has been detected as URL-seeking. #if BUILDFLAG(IS_ANDROID) - if (current_page_classification == OmniboxEventProto:: - SEARCH_RESULT_PAGE_NO_SEARCH_TERM_REPLACEMENT) + if (current_page_classification == + OmniboxEventProto::SEARCH_RESULT_PAGE_NO_SEARCH_TERM_REPLACEMENT) demotion_rule = "1:61,2:61,3:61,4:61,16:61,24:61"; #endif if (current_page_classification == @@ -425,9 +419,8 @@ } float OmniboxFieldTrial::HQPBookmarkValue() { - std::string bookmark_value_str = - variations::GetVariationParamValue(kBundledExperimentFieldTrialName, - kHQPBookmarkValueRule); + std::string bookmark_value_str = variations::GetVariationParamValue( + kBundledExperimentFieldTrialName, kHQPBookmarkValueRule); if (bookmark_value_str.empty()) return 10; // This is a best-effort conversion; we trust the hand-crafted parameters @@ -439,26 +432,25 @@ } bool OmniboxFieldTrial::HQPAllowMatchInTLDValue() { - return variations::GetVariationParamValue( - kBundledExperimentFieldTrialName, - kHQPAllowMatchInTLDRule) == "true"; + return variations::GetVariationParamValue(kBundledExperimentFieldTrialName, + kHQPAllowMatchInTLDRule) == "true"; } bool OmniboxFieldTrial::HQPAllowMatchInSchemeValue() { - return variations::GetVariationParamValue( - kBundledExperimentFieldTrialName, - kHQPAllowMatchInSchemeRule) == "true"; + return variations::GetVariationParamValue(kBundledExperimentFieldTrialName, + kHQPAllowMatchInSchemeRule) == + "true"; } void OmniboxFieldTrial::GetSuggestPollingStrategy(bool* from_last_keystroke, int* polling_delay_ms) { - *from_last_keystroke = variations::GetVariationParamValue( - kBundledExperimentFieldTrialName, - kMeasureSuggestPollingDelayFromLastKeystrokeRule) == "true"; + *from_last_keystroke = + variations::GetVariationParamValue( + kBundledExperimentFieldTrialName, + kMeasureSuggestPollingDelayFromLastKeystrokeRule) == "true"; const std::string& polling_delay_string = variations::GetVariationParamValue( - kBundledExperimentFieldTrialName, - kSuggestPollingDelayMsRule); + kBundledExperimentFieldTrialName, kSuggestPollingDelayMsRule); if (polling_delay_string.empty() || !base::StringToInt(polling_delay_string, polling_delay_ms) || (*polling_delay_ms <= 0)) { @@ -468,8 +460,7 @@ std::string OmniboxFieldTrial::HQPExperimentalScoringBuckets() { return variations::GetVariationParamValue( - kBundledExperimentFieldTrialName, - kHQPExperimentalScoringBucketsParam); + kBundledExperimentFieldTrialName, kHQPExperimentalScoringBucketsParam); } float OmniboxFieldTrial::HQPExperimentalTopicalityThreshold() { @@ -580,15 +571,14 @@ } bool OmniboxFieldTrial::HQPAlsoDoHUPLikeScoring() { - return variations::GetVariationParamValue( - kBundledExperimentFieldTrialName, - kHQPAlsoDoHUPLikeScoringRule) == "true"; + return variations::GetVariationParamValue(kBundledExperimentFieldTrialName, + kHQPAlsoDoHUPLikeScoringRule) == + "true"; } bool OmniboxFieldTrial::HUPSearchDatabase() { const std::string& value = variations::GetVariationParamValue( - kBundledExperimentFieldTrialName, - kHUPSearchDatabaseRule); + kBundledExperimentFieldTrialName, kHUPSearchDatabaseRule); return value.empty() || (value == "true"); } @@ -910,6 +900,12 @@ "ShortBookmarkSuggestionsByTotalInputLengthThreshold", 3); +// Shortcut Expanding + +bool IsShortcutExpandingEnabled() { + return base::FeatureList::IsEnabled(omnibox::kShortcutExpanding); +} + // Local history zero-prefix (aka zero-suggest) and prefix suggestions. const base::FeatureParam<bool> kZeroSuggestCacheCounterfactual( &omnibox::kZeroSuggestPrefetching,
diff --git a/components/omnibox/browser/omnibox_field_trial.h b/components/omnibox/browser/omnibox_field_trial.h index e57303c7..a1c7412b 100644 --- a/components/omnibox/browser/omnibox_field_trial.h +++ b/components/omnibox/browser/omnibox_field_trial.h
@@ -528,6 +528,9 @@ extern const base::FeatureParam<int> kShortBookmarkSuggestionsByTotalInputLengthThreshold; +// Shortcut Expanding. +bool IsShortcutExpandingEnabled(); + // Local history zero-prefix (aka zero-suggest) and prefix suggestions. // Indicates whether the user is in the counterfactual group in the experiment // for prefetching zero prefix suggestions on the NTP. Users in the
diff --git a/components/omnibox/browser/shortcuts_backend.cc b/components/omnibox/browser/shortcuts_backend.cc index 6cde29c..d9e829d 100644 --- a/components/omnibox/browser/shortcuts_backend.cc +++ b/components/omnibox/browser/shortcuts_backend.cc
@@ -14,11 +14,10 @@ #include <vector> #include "base/bind.h" -#include "base/feature_list.h" #include "base/guid.h" #include "base/i18n/case_conversion.h" #include "base/metrics/histogram_macros.h" -#include "base/observer_list.h" +#include "base/strings/strcat.h" #include "base/strings/string_util.h" #include "base/task/thread_pool.h" #include "base/threading/thread_task_runner_handle.h" @@ -27,8 +26,9 @@ #include "components/omnibox/browser/autocomplete_match_type.h" #include "components/omnibox/browser/autocomplete_result.h" #include "components/omnibox/browser/base_search_provider.h" +#include "components/omnibox/browser/in_memory_url_index_types.h" +#include "components/omnibox/browser/omnibox_field_trial.h" #include "components/omnibox/browser/shortcuts_database.h" -#include "components/omnibox/common/omnibox_features.h" namespace { @@ -62,8 +62,72 @@ } } -} // namespace +// Get either `description_for_shortcuts` if non-empty or fallback to +// `description`. +std::u16string GetDescription(const AutocompleteMatch& match) { + return match.description_for_shortcuts.empty() + ? match.description + : match.description_for_shortcuts; +} +// Get either `description_class_for_shortcuts` if non-empty or fallback to +// `description_class`. +ACMatchClassifications GetDescriptionClass(const AutocompleteMatch& match) { + return match.description_class_for_shortcuts.empty() + ? match.description_class + : match.description_class_for_shortcuts; +} + +// Expand the last word in `text` to a full word in `match`'s description. +// E.g., if `text` is 'Cha Aznav' and the match description is +// 'Charles Aznavour', will return 'Ch Aznavour'. +std::u16string ExpandToFullWord(const std::u16string& text, + const AutocompleteMatch& match) { + // Look at the description (i.e. title) only. Contents (i.e. URLs) and + // destination URLs both contain garble often; e.g., + // 'docs.google.com/d/3SyB0Y83dG_WuxX'. + const auto description_words = + String16VectorFromString16(GetDescription(match), nullptr); + // Lower case `text` for case-insensitive matching with `description_words`. + const auto text_last_word = + base::i18n::ToLower(String16VectorFromString16(text, nullptr).back()); + + // Prioritize the 1st match that's at least 3 chars long. If none are found, + // fallback to the 1st match of any length. Don't simply find the 1st match of + // any length, as that could end up matching 'a', 'at', 'the', etc when a more + // likely candidate exists. Alternative approaches, e.g., longest match, + // shortest match, or the match closest to the previous word all have + // undesirable edge cases. E.g. if using longest match, the `text` 'singer C', + // with match description 'Singer Charles Aznavour Performs Les Comediens', + // would expand to 'singer Comédiens'. + std::u16string best_word; + // Iterate up to 100 `description_words` for performance. + for (size_t i = 0; + i < description_words.size() && i < 100 && best_word.length() < 3u; + ++i) { + if (description_words[i].length() < 3u && !best_word.empty()) + continue; + if (!base::StartsWith(base::i18n::ToLower(description_words[i]), + text_last_word, base::CompareCase::SENSITIVE)) + continue; + best_word = description_words[i]; + } + + // Trim the `text` to 1) avoid expanding, e.g., the `text` 'Cha Aznav ' to + // 'Cha Aznav ur'; and 2) avoid truncating the shortcut e.g., 'Cha Aznavour' + // to 'Cha ' for the `text` 'C' when `AddOrUpdateShortcut()` appends 3 chars + // to `text`. + const auto trimmed_text = + base::TrimWhitespace(text, base::TrimPositions::TRIM_TRAILING); + // Add on the missing letters of `text_last_word`, rather than replace it with + // `best_word` to preserve capitalization. + return best_word.empty() + ? std::u16string(trimmed_text) + : base::StrCat( + {trimmed_text, best_word.substr(text_last_word.length())}); +} + +} // namespace // ShortcutsBackend ----------------------------------------------------------- @@ -123,7 +187,15 @@ #if DCHECK_IS_ON() match.Validate(); #endif // DCHECK_IS_ON() - const std::u16string text_lowercase(base::i18n::ToLower(text)); + // Trim `text` since `ExpandToFullWord()` trims the shortcut text; otherwise, + // inputs with trailing whitespace wouldn't match a shortcut even if the user + // previously used the input with a trailing whitespace. + const auto text_trimmed = + OmniboxFieldTrial::IsShortcutExpandingEnabled() + ? base::TrimWhitespace(text, base::TrimPositions::TRIM_TRAILING) + : text; + const std::u16string text_trimmed_lowercase( + base::i18n::ToLower(text_trimmed)); const base::Time now(base::Time::Now()); // Look for an existing shortcut to `match` prefixed by `text`. If there is @@ -135,9 +207,9 @@ // arbitrary but seems to be fine. Deduping these shortcuts would stop the // input 'wil' from finding the 2nd shortcut. for (ShortcutMap::const_iterator it( - shortcuts_map_.lower_bound(text_lowercase)); + shortcuts_map_.lower_bound(text_trimmed_lowercase)); it != shortcuts_map_.end() && - base::StartsWith(it->first, text_lowercase, + base::StartsWith(it->first, text_trimmed_lowercase, base::CompareCase::SENSITIVE); ++it) { if (match.destination_url == it->second.match_core.destination_url) { @@ -146,9 +218,13 @@ // plus an additional 3 chars to avoid unstable shortcuts. E.g. if the // user creates a shortcut with text 'google.com', then navigates // typing 'go', the shortcut text should be updated to 'googl'. - auto updated_shortcut_text = it->second.text.substr(0, text.length() + 3); + const auto text_and_3_chars = base::StrCat( + {text_trimmed, it->second.text.substr(text_trimmed.length(), 3)}); + const auto expanded_text = OmniboxFieldTrial::IsShortcutExpandingEnabled() + ? ExpandToFullWord(text_and_3_chars, match) + : text_and_3_chars; UpdateShortcut(ShortcutsDatabase::Shortcut( - it->second.id, updated_shortcut_text, + it->second.id, expanded_text, MatchToMatchCore(match, template_url_service_, search_terms_data_.get()), now, it->second.number_of_hits + 1)); @@ -157,8 +233,11 @@ } // If no shortcuts to `match` prefixed by `text` were found, create one. + const auto expanded_text = OmniboxFieldTrial::IsShortcutExpandingEnabled() + ? ExpandToFullWord(text, match) + : text; AddShortcut(ShortcutsDatabase::Shortcut( - base::GenerateGUID(), text, + base::GenerateGUID(), expanded_text, MatchToMatchCore(match, template_url_service_, search_terms_data_.get()), now, 1)); } @@ -187,20 +266,13 @@ normalized_match = &temp; } - auto description = normalized_match->description_for_shortcuts.empty() - ? normalized_match->description - : normalized_match->description_for_shortcuts; - auto description_class = - normalized_match->description_class_for_shortcuts.empty() - ? normalized_match->description_class - : normalized_match->description_class_for_shortcuts; - return ShortcutsDatabase::Shortcut::MatchCore( normalized_match->fill_into_edit, normalized_match->destination_url, normalized_match->document_type, normalized_match->contents, - StripMatchMarkers(normalized_match->contents_class), description, - StripMatchMarkers(description_class), normalized_match->transition, - match_type, normalized_match->keyword); + StripMatchMarkers(normalized_match->contents_class), + GetDescription(*normalized_match), + StripMatchMarkers(GetDescriptionClass(*normalized_match)), + normalized_match->transition, match_type, normalized_match->keyword); } void ShortcutsBackend::ShutdownOnUIThread() {
diff --git a/components/omnibox/browser/shortcuts_backend_unittest.cc b/components/omnibox/browser/shortcuts_backend_unittest.cc index 5ac31338e..ef4584d 100644 --- a/components/omnibox/browser/shortcuts_backend_unittest.cc +++ b/components/omnibox/browser/shortcuts_backend_unittest.cc
@@ -21,6 +21,7 @@ #include "components/search_engines/search_terms_data.h" #include "components/search_engines/template_url_service.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" // ShortcutsBackendTest ------------------------------------------------------- @@ -58,7 +59,9 @@ bool DeleteShortcutsWithURL(const GURL& url); bool DeleteShortcutsWithIDs( const ShortcutsDatabase::ShortcutIDs& deleted_ids); - bool ShortcutExists(const std::u16string& terms); + bool ShortcutExists(const std::u16string& terms) const; + const ShortcutsDatabase::Shortcut FindShortcut( + const std::u16string& terms) const; TemplateURLService* GetTemplateURLService(); @@ -185,10 +188,17 @@ return backend_->DeleteShortcutsWithIDs(deleted_ids); } -bool ShortcutsBackendTest::ShortcutExists(const std::u16string& terms) { +bool ShortcutsBackendTest::ShortcutExists(const std::u16string& terms) const { return shortcuts_map().find(terms) != shortcuts_map().end(); } +const ShortcutsDatabase::Shortcut ShortcutsBackendTest::FindShortcut( + const std::u16string& terms) const { + const auto iter = shortcuts_map().find(terms); + return iter == shortcuts_map().end() ? ShortcutsDatabase::Shortcut{} + : iter->second; +} + TemplateURLService* ShortcutsBackendTest::GetTemplateURLService() { return template_url_service_.get(); } @@ -383,7 +393,7 @@ ASSERT_EQ(0U, shortcuts_map().size()); } -TEST_F(ShortcutsBackendTest, AddOrUpdateShortcut) { +TEST_F(ShortcutsBackendTest, AddOrUpdateShortcut_3CharShortening) { InitBackend(); AutocompleteMatch match; @@ -435,3 +445,92 @@ EXPECT_FALSE(ShortcutExists(u"we need very long te")); EXPECT_TRUE(ShortcutExists(u"we need very long text fo")); } + +TEST_F(ShortcutsBackendTest, AddOrUpdateShortcut_Expanding) { + scoped_feature_list().InitAndEnableFeature(omnibox::kShortcutExpanding); + InitBackend(); + + AutocompleteMatch match; + match.destination_url = GURL("https://www.google.com"); + match.contents = u"https://www.google.com"; + match.description = u"a an app apple i it word ZaZaaZZ"; + match.contents_class.emplace_back(0, 0); + match.description_class.emplace_back(0, 0); + + // Should not have a shortcut initially. + EXPECT_EQ(shortcuts_map().size(), 0u); + + // Should expand last word when creating shortcuts. + backend()->AddOrUpdateShortcut(u"w w", match); + EXPECT_EQ(shortcuts_map().size(), 1u); + EXPECT_TRUE(ShortcutExists(u"w word")); + + // Should expand last word when updating shortcuts. + backend()->AddOrUpdateShortcut(u"w w", match); + EXPECT_EQ(shortcuts_map().size(), 1u); + EXPECT_TRUE(ShortcutExists(u"w word")); + + // Should not expand other words when the last word is already expanded. + backend()->AddOrUpdateShortcut(u"w word", match); + EXPECT_EQ(shortcuts_map().size(), 1u); + EXPECT_TRUE(ShortcutExists(u"w word")); + + // Should prefer to expand to words at least 3 chars long. Should pick words + // that come first, if there are multiple matches at least 3 chars long. + backend()->AddOrUpdateShortcut(u"a", match); + EXPECT_EQ(shortcuts_map().size(), 2u); + EXPECT_TRUE(ShortcutExists(u"app")); + + // Should prefer to expand to words that come first if all matches are shorter + // than 3 chars long. + backend()->AddOrUpdateShortcut(u"i", match); + EXPECT_EQ(shortcuts_map().size(), 3u); + EXPECT_TRUE(ShortcutExists(u"i")); + + // Should not expand to words in the URL or contents. + backend()->AddOrUpdateShortcut(u"g", match); + EXPECT_EQ(shortcuts_map().size(), 4u); + EXPECT_TRUE(ShortcutExists(u"g")); + + // When updating, should expand the last word after appending up to 3 chars. + backend()->AddOrUpdateShortcut(u"an apple a", match); + EXPECT_EQ(shortcuts_map().size(), 5u); + EXPECT_TRUE(ShortcutExists(u"an apple app")); + // 'an appl[e a]' should be expanded to 'an apple app'. + backend()->AddOrUpdateShortcut(u"an appl", match); + EXPECT_EQ(shortcuts_map().size(), 5u); + EXPECT_TRUE(ShortcutExists(u"an apple app")); + // But 'an app[le ]' should be expanded to 'an apple', removing the word 'app' + // and trailing whitespace. + backend()->AddOrUpdateShortcut(u"an app", match); + EXPECT_EQ(shortcuts_map().size(), 5u); + EXPECT_TRUE(ShortcutExists(u"an apple")); + + // Should be case-insensitive when matching, but preserve case when creating + // shortcut text. The match word is 'ZaZaaZZ'. + // '[zAz][aaZZ]': the matched shortcut text should preserve the case of the + // input, while the expanded shortcut text should preserve the case of the + // match title. + backend()->AddOrUpdateShortcut(u"zAz", match); + EXPECT_EQ(shortcuts_map().size(), 6u); + EXPECT_TRUE(ShortcutExists(u"zazaazz")); + EXPECT_EQ(FindShortcut(u"zazaazz").text, u"zAzaaZZ"); + + // When updating, '[Z][Az][aaZZ]': the matched shortcut text should preserve + // the case of the input, while the expanded shortcut text should preserve the + // case of the previous shortcut text rather than the match title. + backend()->AddOrUpdateShortcut(u"Z", match); + EXPECT_EQ(shortcuts_map().size(), 6u); + EXPECT_TRUE(ShortcutExists(u"zazaazz")); + EXPECT_EQ(FindShortcut(u"zazaazz").text, u"ZAzaaZZ"); + + // Should match inconsistent trailing whitespace and expand the last word + // correctly. + backend()->AddOrUpdateShortcut(u"appl ", match); + EXPECT_EQ(shortcuts_map().size(), 7u); + EXPECT_TRUE(ShortcutExists(u"apple")); + // Likewise for updating shortcuts. + backend()->AddOrUpdateShortcut(u"appl ", match); + EXPECT_EQ(shortcuts_map().size(), 7u); + EXPECT_TRUE(ShortcutExists(u"apple")); +}
diff --git a/components/omnibox/browser/shortcuts_provider.cc b/components/omnibox/browser/shortcuts_provider.cc index 47774c3..ecb2451 100644 --- a/components/omnibox/browser/shortcuts_provider.cc +++ b/components/omnibox/browser/shortcuts_provider.cc
@@ -145,10 +145,17 @@ DCHECK_GT(typed_length, 0u); DCHECK_LE(typed_length, shortcut_text_length); // The initial score is based on how much of the shortcut the user has typed. - // `shortcut.text` may be up to 3 chars longer than previous inputs navigating - // to the shortcut (see `ShortcutsBackend::AddOrUpdateShortcut`). + // Due to appending 3 chars when updating shortcuts, and expanding the last + // word when updating or creating shortcuts, the shortcut text can be longer + // than the user's previous inputs (see + // `ShortcutsBackend::AddOrUpdateShortcut()`). As an approximation, ignore the + // 10 chars in the shortcut text, though this can overestimate or + // underestimate the actual previous inputs. Shortcuts are often deduped with + // higher scoring history suggestions anyway. + const size_t adjustment = + OmniboxFieldTrial::IsShortcutExpandingEnabled() ? 10 : 3; const size_t adjusted_text_length = - std::max(shortcut_text_length, typed_length + 3) - 3; + std::max(shortcut_text_length, typed_length + adjustment) - adjustment; const double typed_fraction = static_cast<double>(typed_length) / adjusted_text_length;
diff --git a/components/omnibox/browser/shortcuts_provider_unittest.cc b/components/omnibox/browser/shortcuts_provider_unittest.cc index 525ddae..f867041 100644 --- a/components/omnibox/browser/shortcuts_provider_unittest.cc +++ b/components/omnibox/browser/shortcuts_provider_unittest.cc
@@ -263,7 +263,12 @@ scoped_refptr<ShortcutsProvider> provider_; }; -ShortcutsProviderTest::ShortcutsProviderTest() = default; +ShortcutsProviderTest::ShortcutsProviderTest() { + // `scoped_feature_list_` needs to be initialized as early as possible, to + // avoid data races caused by tasks on other threads accessing it. + scoped_feature_list_.Reset(); + scoped_feature_list_.InitAndEnableFeature(omnibox::kShortcutExpanding); +}; void ShortcutsProviderTest::SetUp() { client_ = std::make_unique<FakeAutocompleteProviderClient>(); @@ -622,39 +627,39 @@ } TEST_F(ShortcutsProviderTest, CalculateScore) { - auto shortcut = MakeShortcut(u"test123"); + auto shortcut = MakeShortcut(u"test56789012345"); // Maximal score. - const int kMaxScore = CalculateScore("test123", shortcut); + const int kMaxScore = CalculateScore("test56789012345", shortcut); - // Score does not decrease when the input is at most 3 chars shorter than the - // shortcut text. - EXPECT_EQ(CalculateScore("test12", shortcut), kMaxScore); - EXPECT_EQ(CalculateScore("test1", shortcut), kMaxScore); - EXPECT_EQ(CalculateScore("test", shortcut), kMaxScore); + // When creating or updating shortcuts, their text is set longer than the user + // input (see `ShortcutBackend::AddOrUpdateShortcut()`). So `CalculateScore()` + // permits up to 10 missing chars before beginning to decrease scores. + EXPECT_EQ(CalculateScore("test5678901234", shortcut), kMaxScore); + EXPECT_EQ(CalculateScore("test5", shortcut), kMaxScore); // Score decreases as percent of the match is decreased. - int score_three_quarters = CalculateScore("tes", shortcut); - EXPECT_LT(score_three_quarters, kMaxScore); - int score_one_half = CalculateScore("te", shortcut); - EXPECT_LT(score_one_half, score_three_quarters); - int score_one_quarter = CalculateScore("t", shortcut); - EXPECT_LT(score_one_quarter, score_one_half); + int score_4_chars = CalculateScore("test", shortcut); + EXPECT_LT(score_4_chars, kMaxScore); + int score_2_chars = CalculateScore("te", shortcut); + EXPECT_LT(score_2_chars, score_4_chars); + int score_1_char = CalculateScore("t", shortcut); + EXPECT_LT(score_1_char, score_2_chars); // Should decay with time - one week. shortcut.last_access_time = base::Time::Now() - base::Days(7); - int score_week_old = CalculateScore("test", shortcut); + int score_week_old = CalculateScore("test56789012345", shortcut); EXPECT_LT(score_week_old, kMaxScore); // Should decay more in two weeks. shortcut.last_access_time = base::Time::Now() - base::Days(14); - int score_two_weeks_old = CalculateScore("test", shortcut); + int score_two_weeks_old = CalculateScore("test56789012345", shortcut); EXPECT_LT(score_two_weeks_old, score_week_old); // But not if it was actively clicked on. 2 hits slow decaying power. shortcut.number_of_hits = 2; shortcut.last_access_time = base::Time::Now() - base::Days(14); - int score_popular_two_weeks_old = CalculateScore("test", shortcut); + int score_popular_two_weeks_old = CalculateScore("test56789012345", shortcut); EXPECT_LT(score_two_weeks_old, score_popular_two_weeks_old); // But still decayed. EXPECT_LT(score_popular_two_weeks_old, kMaxScore); @@ -662,7 +667,8 @@ // 3 hits slow decaying power even more. shortcut.number_of_hits = 3; shortcut.last_access_time = base::Time::Now() - base::Days(14); - int score_more_popular_two_weeks_old = CalculateScore("test", shortcut); + int score_more_popular_two_weeks_old = + CalculateScore("test56789012345", shortcut); EXPECT_LT(score_two_weeks_old, score_more_popular_two_weeks_old); EXPECT_LT(score_popular_two_weeks_old, score_more_popular_two_weeks_old); // But still decayed. @@ -826,12 +832,12 @@ // Aggregate score should consider the shortest text length, most recent visit // time, and sum of visit counts. - auto shortcut_a_short = MakeShortcut(u"size5", days_ago(3), 1); - auto shortcut_a_frequent = MakeShortcut(u"size____10", days_ago(3), 10); - auto shortcut_a_recent = MakeShortcut(u"size____10", days_ago(1), 1); + auto shortcut_a_short = MakeShortcut(u"size______12", days_ago(3), 1); + auto shortcut_a_frequent = MakeShortcut(u"size__________16", days_ago(3), 10); + auto shortcut_a_recent = MakeShortcut(u"size__________16", days_ago(1), 1); auto score_a = CalculateAggregateScore( "a", {&shortcut_a_short, &shortcut_a_frequent, &shortcut_a_recent}); - auto shortcut_b = MakeShortcut(u"size5", days_ago(1), 12); + auto shortcut_b = MakeShortcut(u"size______12", days_ago(1), 12); auto score_b = CalculateAggregateScore("a", {&shortcut_b}); EXPECT_EQ(score_a, score_b); EXPECT_GT(score_a, 0); @@ -846,12 +852,12 @@ EXPECT_GT(score_b_long_query, score_b); // More recent shortcuts should be scored higher. - auto shortcut_b_old = MakeShortcut(u"size5", days_ago(2), 12); + auto shortcut_b_old = MakeShortcut(u"size______12", days_ago(2), 12); auto score_b_old = CalculateAggregateScore("a", {&shortcut_b_old}); EXPECT_LT(score_b_old, score_b); // Shortcuts with higher visit counts should be scored higher. - auto shortcut_b_frequent = MakeShortcut(u"size5", days_ago(1), 13); + auto shortcut_b_frequent = MakeShortcut(u"size______12", days_ago(1), 13); auto score_b_frequent = CalculateAggregateScore("a", {&shortcut_b_frequent}); EXPECT_GT(score_b_frequent, score_b); }
diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc index 10f7a92..c4fd7c9 100644 --- a/components/omnibox/common/omnibox_features.cc +++ b/components/omnibox/common/omnibox_features.cc
@@ -209,6 +209,11 @@ const base::Feature kAggregateShortcuts{"OmniboxAggregateShortcuts", base::FEATURE_DISABLED_BY_DEFAULT}; +// If enabled, when updating or creating a shortcut, the last word of the input +// is expanded, if possible, to a complete word in the suggestion description. +const base::Feature kShortcutExpanding{"OmniboxShortcutExpanding", + base::FEATURE_DISABLED_BY_DEFAULT}; + // If enabled, inputs may match bookmark paths. These path matches won't // contribute to scoring. E.g. 'planets jupiter' can suggest a bookmark titled // 'Jupiter' with URL 'en.wikipedia.org/wiki/Jupiter' located in a path
diff --git a/components/omnibox/common/omnibox_features.h b/components/omnibox/common/omnibox_features.h index aa7009c..bfa6d0e 100644 --- a/components/omnibox/common/omnibox_features.h +++ b/components/omnibox/common/omnibox_features.h
@@ -60,6 +60,7 @@ extern const base::Feature kShortBookmarkSuggestions; extern const base::Feature kShortBookmarkSuggestionsByTotalInputLength; extern const base::Feature kAggregateShortcuts; +extern const base::Feature kShortcutExpanding; extern const base::Feature kBookmarkPaths; // Document provider
diff --git a/components/reporting/resources/resource_interface.cc b/components/reporting/resources/resource_interface.cc index 727eb00..b2cd998 100644 --- a/components/reporting/resources/resource_interface.cc +++ b/components/reporting/resources/resource_interface.cc
@@ -8,6 +8,7 @@ #include <cstdint> +#include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -16,7 +17,7 @@ ScopedReservation::ScopedReservation( uint64_t size, - scoped_refptr<ResourceInterface> resource_interface) + scoped_refptr<ResourceInterface> resource_interface) noexcept : resource_interface_(resource_interface) { if (!resource_interface->Reserve(size)) { return; @@ -24,7 +25,7 @@ size_ = size; } -ScopedReservation::ScopedReservation(ScopedReservation&& other) +ScopedReservation::ScopedReservation(ScopedReservation&& other) noexcept : resource_interface_(other.resource_interface_), size_(std::exchange(other.size_, absl::nullopt)) {} @@ -36,14 +37,28 @@ if (!reserved()) { return false; } - if (new_size <= 0 || size_.value() < new_size) { + if (new_size < 0 || size_.value() < new_size) { return false; } resource_interface_->Discard(size_.value() - new_size); - size_ = new_size; + if (new_size > 0) { + size_ = new_size; + } else { + size_ = absl::nullopt; + } return true; } +void ScopedReservation::HandOver(ScopedReservation& other) { + DCHECK_EQ(resource_interface_.get(), other.resource_interface_.get()) + << "Reservations are not related"; + if (!other.reserved()) { + return; // Nothing changes. + } + const uint64_t old_size = (reserved() ? size_.value() : 0uL); + size_ = old_size + std::exchange(other.size_, absl::nullopt).value(); +} + ScopedReservation::~ScopedReservation() { if (reserved()) { resource_interface_->Discard(size_.value());
diff --git a/components/reporting/resources/resource_interface.h b/components/reporting/resources/resource_interface.h index 235f42f..56fd3bce 100644 --- a/components/reporting/resources/resource_interface.h +++ b/components/reporting/resources/resource_interface.h
@@ -60,16 +60,26 @@ // Can be handed over to another owner. class ScopedReservation { public: - ScopedReservation(uint64_t size, - scoped_refptr<ResourceInterface> resource_interface); - ScopedReservation(ScopedReservation&& other); + ScopedReservation( + uint64_t size, + scoped_refptr<ResourceInterface> resource_interface) noexcept; + ScopedReservation(ScopedReservation&& other) noexcept; ScopedReservation(const ScopedReservation& other) = delete; + ScopedReservation& operator=(ScopedReservation&& other) = delete; ScopedReservation& operator=(const ScopedReservation& other) = delete; ~ScopedReservation(); bool reserved() const; + + // Reduces reservation to |new_size|. bool Reduce(uint64_t new_size); + // Adds |other| to |this| without assigning or releasing any reservation. + // Used for seamless transition from one reservation to another (more generic + // than std::move). Resets |other| to non-reserved state upon return from this + // method. + void HandOver(ScopedReservation& other); + private: const scoped_refptr<ResourceInterface> resource_interface_; absl::optional<uint64_t> size_;
diff --git a/components/reporting/resources/resource_interface_unittest.cc b/components/reporting/resources/resource_interface_unittest.cc index 63bcbae..304800af 100644 --- a/components/reporting/resources/resource_interface_unittest.cc +++ b/components/reporting/resources/resource_interface_unittest.cc
@@ -25,6 +25,11 @@ class ResourceInterfaceTest : public ::testing::TestWithParam<scoped_refptr<ResourceInterface>> { protected: + void SetUp() override { + // Make sure parameters define reasonably large total resource size. + ASSERT_GE(resource_interface()->GetTotal(), 1u * 1024LLu * 1024LLu); + } + scoped_refptr<ResourceInterface> resource_interface() const { return GetParam(); } @@ -146,7 +151,65 @@ for (; size >= 2; size /= 2) { EXPECT_TRUE(scoped_reservation.Reduce(size / 2)); } - EXPECT_FALSE(scoped_reservation.Reduce(size / 2)); + EXPECT_TRUE(scoped_reservation.Reduce(size / 2)); + EXPECT_FALSE(scoped_reservation.reserved()); +} + +TEST_P(ResourceInterfaceTest, ScopedReservationBasicHandOver) { + uint64_t size = resource_interface()->GetTotal() / 2; + ScopedReservation scoped_reservation(size, resource_interface()); + ASSERT_TRUE(scoped_reservation.reserved()); + { + ScopedReservation another_reservation(size - 1, resource_interface()); + ASSERT_TRUE(another_reservation.reserved()); + EXPECT_THAT(resource_interface()->GetUsed(), + Eq(resource_interface()->GetTotal() - 1)); + EXPECT_TRUE(scoped_reservation.reserved()); + EXPECT_TRUE(another_reservation.reserved()); + scoped_reservation.HandOver(another_reservation); + EXPECT_THAT(resource_interface()->GetUsed(), + Eq(resource_interface()->GetTotal() - 1)); + } + // Destruction of |anoter_reservation| does not change the amount used. + EXPECT_THAT(resource_interface()->GetUsed(), + Eq(resource_interface()->GetTotal() - 1)); +} + +TEST_P(ResourceInterfaceTest, ScopedReservationRepeatingHandOvers) { + uint64_t size = resource_interface()->GetTotal() / 2; + ScopedReservation scoped_reservation(size, resource_interface()); + EXPECT_TRUE(scoped_reservation.reserved()); + + for (; size >= 2; size /= 2) { + ScopedReservation another_reservation(size / 2, resource_interface()); + scoped_reservation.HandOver(another_reservation); + } + EXPECT_THAT(resource_interface()->GetUsed(), + Eq(resource_interface()->GetTotal() - 1)); +} + +TEST_P(ResourceInterfaceTest, ScopedReservationEmptyHandOver) { + uint64_t size = resource_interface()->GetTotal() / 2; + ScopedReservation scoped_reservation(size, resource_interface()); + + ASSERT_TRUE(scoped_reservation.reserved()); + { + ScopedReservation another_reservation(size - 1, resource_interface()); + ASSERT_TRUE(another_reservation.reserved()); + + EXPECT_THAT(resource_interface()->GetUsed(), + Eq(resource_interface()->GetTotal() - 1)); + EXPECT_TRUE(scoped_reservation.reserved()); + EXPECT_TRUE(another_reservation.reserved()); + + another_reservation.Reduce(0); + ASSERT_FALSE(another_reservation.reserved()); + + scoped_reservation.HandOver(another_reservation); + EXPECT_THAT(resource_interface()->GetUsed(), Eq(size)); + } + // Destruction of |anoter_reservation| does not change the amount used. + EXPECT_THAT(resource_interface()->GetUsed(), Eq(size)); } TEST_P(ResourceInterfaceTest, ReservationOverMaxTest) {
diff --git a/components/services/app_service/app_service_mojom_impl.cc b/components/services/app_service/app_service_mojom_impl.cc index 4bb1f86b..e9449ac 100644 --- a/components/services/app_service/app_service_mojom_impl.cc +++ b/components/services/app_service/app_service_mojom_impl.cc
@@ -95,23 +95,6 @@ subscribers_.Add(std::move(subscriber)); } -void AppServiceMojomImpl::LoadIcon(apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) { - auto iter = publishers_.find(app_type); - if (iter == publishers_.end()) { - std::move(callback).Run(apps::mojom::IconValue::New()); - return; - } - iter->second->LoadIcon(app_id, std::move(icon_key), icon_type, - size_hint_in_dip, allow_placeholder_icon, - std::move(callback)); -} - void AppServiceMojomImpl::Launch(apps::mojom::AppType app_type, const std::string& app_id, int32_t event_flags,
diff --git a/components/services/app_service/app_service_mojom_impl.h b/components/services/app_service/app_service_mojom_impl.h index 162bef0..13219174 100644 --- a/components/services/app_service/app_service_mojom_impl.h +++ b/components/services/app_service/app_service_mojom_impl.h
@@ -52,13 +52,6 @@ void RegisterSubscriber( mojo::PendingRemote<apps::mojom::Subscriber> subscriber_remote, apps::mojom::ConnectOptionsPtr opts) override; - void LoadIcon(apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override; void Launch(apps::mojom::AppType app_type, const std::string& app_id, int32_t event_flags,
diff --git a/components/services/app_service/app_service_mojom_impl_unittest.cc b/components/services/app_service/app_service_mojom_impl_unittest.cc index d0f3308..61196aa 100644 --- a/components/services/app_service/app_service_mojom_impl_unittest.cc +++ b/components/services/app_service/app_service_mojom_impl_unittest.cc
@@ -105,16 +105,6 @@ subscribers_.Add(std::move(subscriber)); } - void LoadIcon(const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - LoadIconCallback callback) override { - load_icon_app_id = app_id; - std::move(callback).Run(apps::mojom::IconValue::New()); - } - void Launch(const std::string& app_id, int32_t event_flags, apps::mojom::LaunchSource launch_source, @@ -259,8 +249,6 @@ }; TEST_F(AppServiceMojomImplTest, PubSub) { - const int size_hint_in_dip = 64; - ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); AppServiceMojomImpl impl(temp_dir_.GetPath()); @@ -357,37 +345,6 @@ EXPECT_EQ("", sub0.AppIdsAccessingMicrophone()); EXPECT_EQ("&", sub1.AppIdsAccessingCamera()); EXPECT_EQ("", sub1.AppIdsAccessingMicrophone()); - - // Call LoadIcon on the impl twice. - // - // The first time (i == 0), it should be forwarded onto the AppType::kBuiltIn - // publisher (which is pub1) and no other publisher. - // - // The second time (i == 1), passing AppType::kUnknown, none of the - // publishers' LoadIcon's should fire, but the callback should still be run. - for (int i = 0; i < 2; i++) { - auto app_type = i == 0 ? apps::mojom::AppType::kBuiltIn - : apps::mojom::AppType::kUnknown; - - bool callback_ran = false; - pub0.load_icon_app_id = "-"; - pub1.load_icon_app_id = "-"; - pub2.load_icon_app_id = "-"; - auto icon_key = apps::mojom::IconKey::New(0, 0, 0); - constexpr bool allow_placeholder_icon = false; - impl.LoadIcon( - app_type, "o", std::move(icon_key), - apps::mojom::IconType::kUncompressed, size_hint_in_dip, - allow_placeholder_icon, - base::BindOnce( - [](bool* ran, apps::mojom::IconValuePtr iv) { *ran = true; }, - &callback_ran)); - impl.FlushMojoCallsForTesting(); - EXPECT_TRUE(callback_ran); - EXPECT_EQ("-", pub0.load_icon_app_id); - EXPECT_EQ(i == 0 ? "o" : "-", pub1.load_icon_app_id); - EXPECT_EQ("-", pub2.load_icon_app_id); - } } TEST_F(AppServiceMojomImplTest, PreferredApps) {
diff --git a/components/services/app_service/public/cpp/icon_cache.cc b/components/services/app_service/public/cpp/icon_cache.cc index f4705bf..9f7629cd 100644 --- a/components/services/app_service/public/cpp/icon_cache.cc +++ b/components/services/app_service/public/cpp/icon_cache.cc
@@ -27,15 +27,6 @@ return icon_value; } -apps::mojom::IconValuePtr IconCache::Value::AsIconValue( - apps::mojom::IconType icon_type) { - auto icon_value = apps::mojom::IconValue::New(); - icon_value->icon_type = icon_type; - icon_value->uncompressed = image_; - icon_value->is_placeholder_icon = is_placeholder_icon_; - return icon_value; -} - IconCache::IconCache(IconLoader* wrapped_loader, GarbageCollectionPolicy gc_policy) : wrapped_loader_(wrapped_loader), gc_policy_(gc_policy) {} @@ -106,73 +97,6 @@ : std::move(releaser); } -std::unique_ptr<IconLoader::Releaser> IconCache::LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr mojom_icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!mojom_icon_key) { - std::move(callback).Run(apps::mojom::IconValue::New()); - return nullptr; - } - - auto icon_key = ConvertMojomIconKeyToIconKey(mojom_icon_key); - IconLoader::Key key( - ConvertMojomAppTypToAppType(app_type), app_id, *icon_key, - ConvertMojomIconTypeToIconType(icon_type), size_hint_in_dip, - // We pass false instead of allow_placeholder_icon, as the Value - // already records placeholder-ness. If the allow_placeholder_icon - // arg to this function is true, we can re-use a cache hit regardless - // of whether the previous call to the underlying wrapped_loader_ - // returned the placeholder icon or the real icon, so we don't want - // to restrict our map lookup to only one flavor. - false); - Value* cache_hit = nullptr; - bool ref_count_incremented = false; - - if (icon_type == apps::mojom::IconType::kUncompressed || - icon_type == apps::mojom::IconType::kStandard) { - auto iter = map_.find(key); - if (iter == map_.end()) { - iter = map_.insert(std::make_pair(key, Value())).first; - } else if (!iter->second.image_.isNull() && - (allow_placeholder_icon || !iter->second.is_placeholder_icon_)) { - cache_hit = &iter->second; - } - - auto new_ref_count = ++iter->second.ref_count_; - CHECK(new_ref_count != std::numeric_limits<decltype(new_ref_count)>::max()); - ref_count_incremented = true; - } - - std::unique_ptr<IconLoader::Releaser> releaser(nullptr); - if (cache_hit) { - RecordIconLoadMethodMetrics(IconLoadingMethod::kFromCache); - std::move(callback).Run(cache_hit->AsIconValue(icon_type)); - } else if (wrapped_loader_) { - releaser = wrapped_loader_->LoadIconFromIconKey( - app_type, app_id, std::move(mojom_icon_key), icon_type, - size_hint_in_dip, allow_placeholder_icon, - base::BindOnce(&IconCache::OnLoadMojomIcon, - weak_ptr_factory_.GetWeakPtr(), key, - std::move(callback))); - } else { - std::move(callback).Run(apps::mojom::IconValue::New()); - } - - return ref_count_incremented - ? std::make_unique<IconLoader::Releaser>( - std::move(releaser), - base::BindOnce(&IconCache::OnRelease, - weak_ptr_factory_.GetWeakPtr(), - std::move(key))) - : std::move(releaser); -} - void IconCache::SweepReleasedIcons() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -234,17 +158,6 @@ std::move(callback).Run(std::move(icon_value)); } -void IconCache::OnLoadMojomIcon( - IconLoader::Key key, - apps::mojom::Publisher::LoadIconCallback wrapped_callback, - apps::mojom::IconValuePtr mojom_icon_value) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - IconValuePtr icon_value = - ConvertMojomIconValueToIconValue(mojom_icon_value.Clone()); - Update(key, *icon_value); - std::move(wrapped_callback).Run(std::move(mojom_icon_value)); -} - void IconCache::OnRelease(IconLoader::Key key) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/components/services/app_service/public/cpp/icon_cache.h b/components/services/app_service/public/cpp/icon_cache.h index bbd96592..d304438 100644 --- a/components/services/app_service/public/cpp/icon_cache.h +++ b/components/services/app_service/public/cpp/icon_cache.h
@@ -15,8 +15,6 @@ #include "base/sequence_checker.h" #include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/icon_loader.h" -#include "components/services/app_service/public/mojom/app_service.mojom.h" -#include "components/services/app_service/public/mojom/types.mojom.h" #include "ui/gfx/image/image_skia.h" namespace apps { @@ -99,16 +97,6 @@ bool allow_placeholder_icon, apps::LoadIconCallback callback) override; - // TODO(crbug.com/1253250): Will be removed soon. - std::unique_ptr<IconLoader::Releaser> LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) override; - // A hint that now is a good time to garbage-collect any icons that are not // actively held. void SweepReleasedIcons(); @@ -125,7 +113,6 @@ Value(); IconValuePtr AsIconValue(IconType icon_type); - apps::mojom::IconValuePtr AsIconValue(apps::mojom::IconType icon_type); }; void Update(const IconLoader::Key& key, const IconValue& icon_value); @@ -133,10 +120,6 @@ apps::LoadIconCallback callback, IconValuePtr icon_value); - // TODO(crbug.com/1253250): Will be removed soon. - void OnLoadMojomIcon(IconLoader::Key, - apps::mojom::Publisher::LoadIconCallback, - apps::mojom::IconValuePtr); void OnRelease(IconLoader::Key); std::map<IconLoader::Key, Value> map_;
diff --git a/components/services/app_service/public/cpp/icon_coalescer.cc b/components/services/app_service/public/cpp/icon_coalescer.cc index a018745..eafeacc 100644 --- a/components/services/app_service/public/cpp/icon_coalescer.cc +++ b/components/services/app_service/public/cpp/icon_coalescer.cc
@@ -147,110 +147,6 @@ std::move(shared_releaser))); } -std::unique_ptr<IconLoader::Releaser> IconCoalescer::LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr mojom_icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!wrapped_loader_ || !mojom_icon_key) { - std::move(callback).Run(apps::mojom::IconValue::New()); - return nullptr; - } - - if (icon_type != apps::mojom::IconType::kUncompressed && - icon_type != apps::mojom::IconType::kStandard) { - return wrapped_loader_->LoadIconFromIconKey( - app_type, app_id, std::move(mojom_icon_key), icon_type, - size_hint_in_dip, allow_placeholder_icon, std::move(callback)); - } - - scoped_refptr<RefCountedReleaser> shared_releaser; - auto icon_key = ConvertMojomIconKeyToIconKey(mojom_icon_key); - IconLoader::Key key(ConvertMojomAppTypToAppType(app_type), app_id, *icon_key, - ConvertMojomIconTypeToIconType(icon_type), - size_hint_in_dip, allow_placeholder_icon); - - auto iter = non_immediate_requests_.find(key); - if (iter != non_immediate_requests_.end()) { - // Coalesce this request with an in-flight one. - // - // |iter->second| is a CallbackAndReleaser. |iter->second.second| is a - // scoped_refptr<RefCountedReleaser>. - shared_releaser = iter->second.second; - } else { - // There is no in-flight request to coalesce with. Instead, forward on the - // request to the wrapped IconLoader. - // - // Calling the |wrapped_loader_|'s LoadIconFromIconKey implementation might - // invoke the passed OnceCallback (binding this class' OnLoadIcon method) - // immediately (now), or at a later time. In both cases, we have to invoke - // (now or later) the |callback| that was passed to this function. - // - // If it's later, then we stash |callback| in |non_immediate_requests_|, - // and look up that same |non_immediate_requests_| during OnLoadIcon. - // - // If it's now, then inserting into the |non_immediate_requests_| would be - // tricky, as we'd have to then unstash the |callback| out of the - // |non_immediate_requests_| (recall that a OnceCallback can be std::move'd - // but not copied), but there are potentially multiple entries with the - // same key, and any multimap iterator might be invalidated if calling into - // the |wrapped_loader_| caused other code to call back into this - // IconCoalescer and mutate that multimap. - // - // Instead, |possibly_immediate_requests_| and |immediate_responses_| keeps - // track of now vs later. - // - // If it's now (if OnLoadIcon is called when the current |seq_num| is in - // |possibly_immediate_requests_|), then OnLoadIcon will populate - // |immediate_responses_| with that |seq_num|. We then run |callback| now, - // right after |wrapped_loader_->LoadIconFromIconKey| returns. - // - // Otherwise we have asynchronously dispatched the underlying icon loading - // request, so store |callback| in |non_immediate_requests_| to be run - // later, when the asynchronous request resolves. - uint64_t seq_num = next_sequence_number_++; - possibly_immediate_requests_.insert(seq_num); - - std::unique_ptr<IconLoader::Releaser> unique_releaser = - wrapped_loader_->LoadIconFromIconKey( - app_type, app_id, std::move(mojom_icon_key), icon_type, - size_hint_in_dip, allow_placeholder_icon, - base::BindOnce(&IconCoalescer::OnLoadMojomIcon, - weak_ptr_factory_.GetWeakPtr(), key, seq_num)); - - possibly_immediate_requests_.erase(seq_num); - - auto iv_iter = immediate_responses_.find(seq_num); - if (iv_iter != immediate_responses_.end()) { - apps::mojom::IconValuePtr iv = - ConvertIconValueToMojomIconValue(std::move(iv_iter->second)); - immediate_responses_.erase(iv_iter); - std::move(callback).Run(std::move(iv)); - return unique_releaser; - } - - shared_releaser = - base::MakeRefCounted<RefCountedReleaser>(std::move(unique_releaser)); - } - - non_immediate_requests_.insert(std::make_pair( - key, - std::make_pair(IconValueToMojomIconValueCallback(std::move(callback)), - shared_releaser))); - - return std::make_unique<IconLoader::Releaser>( - nullptr, - // The callback does nothing explicitly, but after it runs, it implicitly - // decrements the scoped_refptr's shared reference count, and therefore - // possibly deletes the underlying IconLoader::Releaser. - base::BindOnce([](scoped_refptr<RefCountedReleaser>) {}, - std::move(shared_releaser))); -} - void IconCoalescer::OnLoadIcon(IconLoader::Key key, uint64_t sequence_number, IconValuePtr icon_value) { @@ -315,12 +211,4 @@ } } -void IconCoalescer::OnLoadMojomIcon( - IconLoader::Key key, - uint64_t sequence_number, - apps::mojom::IconValuePtr mojom_icon_value) { - OnLoadIcon(key, sequence_number, - ConvertMojomIconValueToIconValue(std::move(mojom_icon_value))); -} - } // namespace apps
diff --git a/components/services/app_service/public/cpp/icon_coalescer.h b/components/services/app_service/public/cpp/icon_coalescer.h index 5a78156..586da4a 100644 --- a/components/services/app_service/public/cpp/icon_coalescer.h +++ b/components/services/app_service/public/cpp/icon_coalescer.h
@@ -63,16 +63,6 @@ bool allow_placeholder_icon, apps::LoadIconCallback callback) override; - // TODO(crbug.com/1253250): Will be removed soon. - std::unique_ptr<IconLoader::Releaser> LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) override; - private: class RefCountedReleaser; @@ -83,10 +73,6 @@ uint64_t sequence_number, IconValuePtr icon_value); - void OnLoadMojomIcon(IconLoader::Key key, - uint64_t sequence_number, - apps::mojom::IconValuePtr mojom_icon_value); - raw_ptr<IconLoader> wrapped_loader_; // Every incoming LoadIconFromIconKey call gets its own sequence number.
diff --git a/components/services/app_service/public/cpp/icon_loader.cc b/components/services/app_service/public/cpp/icon_loader.cc index c234643..0322a15 100644 --- a/components/services/app_service/public/cpp/icon_loader.cc +++ b/components/services/app_service/public/cpp/icon_loader.cc
@@ -86,33 +86,4 @@ std::move(callback)); } -std::unique_ptr<IconLoader::Releaser> IconLoader::LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) { - return nullptr; -} - -std::unique_ptr<IconLoader::Releaser> IconLoader::LoadIcon( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) { - auto icon_key = GetIconKey(app_id); - if (!icon_key.has_value()) { - std::move(callback).Run(apps::mojom::IconValue::New()); - return nullptr; - } - - return LoadIconFromIconKey( - app_type, app_id, ConvertIconKeyToMojomIconKey(icon_key.value()), - icon_type, size_hint_in_dip, allow_placeholder_icon, std::move(callback)); -} - } // namespace apps
diff --git a/components/services/app_service/public/cpp/icon_loader.h b/components/services/app_service/public/cpp/icon_loader.h index a8659c2f..7e426bf 100644 --- a/components/services/app_service/public/cpp/icon_loader.h +++ b/components/services/app_service/public/cpp/icon_loader.h
@@ -11,8 +11,6 @@ #include "base/callback_forward.h" #include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/icon_types.h" -#include "components/services/app_service/public/mojom/app_service.mojom.h" -#include "components/services/app_service/public/mojom/types.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace apps { @@ -79,31 +77,6 @@ bool allow_placeholder_icon, apps::LoadIconCallback callback); - // This can return nullptr, meaning that the IconLoader does not track when - // the icon is no longer actively used by the caller. - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - virtual std::unique_ptr<Releaser> LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback); - - // Convenience method that calls "LoadIconFromIconKey(app_type, app_id, - // GetIconKey(app_id), etc)". - // TODO(crbug.com/1253250): Will be removed soon. Please use the non mojom - // interface. - std::unique_ptr<Releaser> LoadIcon( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback); - protected: // A struct containing the arguments (other than the callback) to // Loader::LoadIconFromIconKey, including a flattened apps::mojom::IconKey.
diff --git a/components/services/app_service/public/cpp/stub_icon_loader.cc b/components/services/app_service/public/cpp/stub_icon_loader.cc index 3ee3805..57f7e8e 100644 --- a/components/services/app_service/public/cpp/stub_icon_loader.cc +++ b/components/services/app_service/public/cpp/stub_icon_loader.cc
@@ -46,28 +46,6 @@ return nullptr; } -std::unique_ptr<IconLoader::Releaser> StubIconLoader::LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) { - num_load_calls_++; - auto iter = timelines_by_app_id_.find(app_id); - if (iter != timelines_by_app_id_.end()) { - auto icon_value = apps::mojom::IconValue::New(); - icon_value->icon_type = icon_type; - icon_value->uncompressed = - gfx::ImageSkia(gfx::ImageSkiaRep(gfx::Size(1, 1), 1.0f)); - std::move(callback).Run(std::move(icon_value)); - } else { - std::move(callback).Run(apps::mojom::IconValue::New()); - } - return nullptr; -} - int StubIconLoader::NumLoadIconFromIconKeyCalls() { return num_load_calls_; }
diff --git a/components/services/app_service/public/cpp/stub_icon_loader.h b/components/services/app_service/public/cpp/stub_icon_loader.h index 94d3ea96..cd03f38 100644 --- a/components/services/app_service/public/cpp/stub_icon_loader.h +++ b/components/services/app_service/public/cpp/stub_icon_loader.h
@@ -34,16 +34,6 @@ bool allow_placeholder_icon, apps::LoadIconCallback callback) override; - // TODO(crbug.com/1253250): Will be removed soon. - std::unique_ptr<IconLoader::Releaser> LoadIconFromIconKey( - apps::mojom::AppType app_type, - const std::string& app_id, - apps::mojom::IconKeyPtr icon_key, - apps::mojom::IconType icon_type, - int32_t size_hint_in_dip, - bool allow_placeholder_icon, - apps::mojom::Publisher::LoadIconCallback callback) override; - int NumLoadIconFromIconKeyCalls(); std::map<std::string, uint64_t> timelines_by_app_id_;
diff --git a/components/services/app_service/public/mojom/app_service.mojom b/components/services/app_service/public/mojom/app_service.mojom index c29f9e4..ca4a0ab 100644 --- a/components/services/app_service/public/mojom/app_service.mojom +++ b/components/services/app_service/public/mojom/app_service.mojom
@@ -25,15 +25,6 @@ // itself with the App Service. RegisterSubscriber(pending_remote<Subscriber> subscriber, ConnectOptions? opts); - // App Icon Factory methods. - LoadIcon( - AppType app_type, - string app_id, - IconKey icon_key, - IconType icon_type, - int32 size_hint_in_dip, - bool allow_placeholder_icon) => (IconValue icon_value); - // Launches an app identified by |app_id|. |event_flags| contains launch // options (e.g. window disposition). |launch_source| contains the source // of the launch. When provided, |window_info| contains the expected window @@ -175,28 +166,6 @@ // App Registry methods. Connect(pending_remote<Subscriber> subscriber, ConnectOptions? opts); - // Requests an icon for an app identified by |app_id|. The icon is identified - // by |icon_key| and parameterised by |icon_type| and |size_hint_in_dp|. If - // |allow_placeholder_icon| is true, a default placeholder icon can be - // returned if no other icon is available. - // - // Publishers implementing this method should: - // - provide an icon as closely sized to |size_hint_in_dp| as possible - // - load from the specific resource ID if |icon_key.resource_id| is set - // - may optionally use |icon_key|'s timeline property as a "version number" - // for an icon. Alternatively, this may be ignored if there will only ever - // be one version of an icon at any time. - // - optionally return a placeholder default icon if |allow_placeholder_icon| - // is true and when no icon is available for the app (or an icon for the - // app cannot be efficiently provided). Otherwise, a null icon should be - // returned. - LoadIcon( - string app_id, - IconKey icon_key, - IconType icon_type, - int32 size_hint_in_dip, - bool allow_placeholder_icon) => (IconValue icon_value); - // Launches an app identified by |app_id|. |event_flags| contains launch // options (e.g. window disposition). |launch_source| contains the source // of the launch. When provided, |window_info| contains the expected window
diff --git a/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.cc b/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.cc index d4924b12..411603d4 100644 --- a/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.cc +++ b/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.cc
@@ -971,17 +971,7 @@ return; } - // If the target is in a different renderer than the root renderer (indicated - // by having a different frame sink ID), we currently cannot provide - // reasonable metadata about the region capture rect. For more context, see - // https://crbug.com/1327560. - // - // TODO(https://crbug.com/1335175): Provide accurate bounds for elements - // embedded in different renderers. - const bool is_same_frame_sink_as_requested = - resolved_target_->GetFrameSinkId() == target_->frame_sink_id; - if (absl::holds_alternative<RegionCaptureCropId>(target_->sub_target) && - is_same_frame_sink_as_requested) { + if (absl::holds_alternative<RegionCaptureCropId>(target_->sub_target)) { const float scale_factor = frame_metadata.device_scale_factor; metadata.region_capture_rect = scale_factor ? ScaleToEnclosingRect(capture_region, 1.0f / scale_factor)
diff --git a/content/browser/android/synchronous_compositor_host.cc b/content/browser/android/synchronous_compositor_host.cc index 3fe0dec..e164d3d3 100644 --- a/content/browser/android/synchronous_compositor_host.cc +++ b/content/browser/android/synchronous_compositor_host.cc
@@ -506,6 +506,16 @@ std::move(resources)); } +void SynchronousCompositorHost::OnCompositorFrameTransitionDirectiveProcessed( + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) { + if (blink::mojom::SynchronousCompositor* compositor = + GetSynchronousCompositor()) { + compositor->OnCompositorFrameTransitionDirectiveProcessed( + layer_tree_frame_sink_id, sequence_id); + } +} + void SynchronousCompositorHost::DidPresentCompositorFrames( viz::FrameTimingDetailsMap timing_details, uint32_t frame_token) {
diff --git a/content/browser/android/synchronous_compositor_host.h b/content/browser/android/synchronous_compositor_host.h index 1e88f1c..547f6885 100644 --- a/content/browser/android/synchronous_compositor_host.h +++ b/content/browser/android/synchronous_compositor_host.h
@@ -67,6 +67,9 @@ bool DemandDrawSw(SkCanvas* canvas, bool software_canvas) override; void ReturnResources(uint32_t layer_tree_frame_sink_id, std::vector<viz::ReturnedResource> resources) override; + void OnCompositorFrameTransitionDirectiveProcessed( + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) override; void DidPresentCompositorFrames(viz::FrameTimingDetailsMap timing_details, uint32_t frame_token) override; void SetMemoryPolicy(size_t bytes_limit) override;
diff --git a/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java b/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java index 53683b5..d30f87b 100644 --- a/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java +++ b/content/public/android/java/src/org/chromium/content/browser/framehost/NavigationControllerImpl.java
@@ -172,7 +172,7 @@ ? params.getIntentReceivedTimestamp() : params.getInputStartTimestamp(); RecordHistogram.recordTimesHistogram("Android.Omnibox.InputToNavigationControllerStart", - SystemClock.elapsedRealtime() - inputStart); + SystemClock.uptimeMillis() - inputStart); NavigationControllerImplJni.get().loadUrl(mNativeNavigationControllerAndroid, NavigationControllerImpl.this, params.getUrl(), params.getLoadUrlType(), params.getTransitionType(),
diff --git a/content/public/browser/android/synchronous_compositor.h b/content/public/browser/android/synchronous_compositor.h index a2cefef..c574f85 100644 --- a/content/public/browser/android/synchronous_compositor.h +++ b/content/public/browser/android/synchronous_compositor.h
@@ -99,6 +99,12 @@ uint32_t layer_tree_frame_sink_id, std::vector<viz::ReturnedResource> resources) = 0; + // Notifies the client when a directive for DocumentTransition, submitted in + // a previous CompositorFrame, has finished executing. + virtual void OnCompositorFrameTransitionDirectiveProcessed( + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) = 0; + virtual void DidPresentCompositorFrames( viz::FrameTimingDetailsMap timing_details, uint32_t frame_token) = 0;
diff --git a/content/public/test/test_synchronous_compositor_android.h b/content/public/test/test_synchronous_compositor_android.h index 83cc6ff..9e25658 100644 --- a/content/public/test/test_synchronous_compositor_android.h +++ b/content/public/test/test_synchronous_compositor_android.h
@@ -36,6 +36,9 @@ const gfx::Transform& transform_for_tile_priority) override; void ReturnResources(uint32_t layer_tree_frame_sink_id, std::vector<viz::ReturnedResource> resources) override; + void OnCompositorFrameTransitionDirectiveProcessed( + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) override {} void DidPresentCompositorFrames(viz::FrameTimingDetailsMap timing_details, uint32_t frame_token) override {} bool DemandDrawSw(SkCanvas* canvas, bool software_canvas) override;
diff --git a/content/test/data/gpu/webcodecs/gpu-device-destroy-expire-active-external-texture.html b/content/test/data/gpu/webcodecs/gpu-device-destroy-expire-active-external-texture.html new file mode 100644 index 0000000..da6d810 --- /dev/null +++ b/content/test/data/gpu/webcodecs/gpu-device-destroy-expire-active-external-texture.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<!-- +Take frames coming from various sources and render them to a canvas with +WebGLRenderingContext.texImage2D(). +--> +<html> + +<head> + <title>GPUDevice.destroy() expires GPUExternalTexture test</title> + <script src="webcodecs_common.js"></script> + <script type="text/javascript"> + 'use strict'; + async function main(arg) { + const device_destroyed_before_import = arg.device_destroyed_before_import; + let source_type = arg.source_type; + let canvas = document.getElementById('display'); + let source = + await createFrameSource(source_type, canvas.width, canvas.height); + if (!source) { + TEST.skip('Unsupported source: ' + source_type); + return; + } + + const adapter = navigator.gpu && await navigator.gpu.requestAdapter(); + if (!adapter) { + TEST.skip('navigator.gpu && navigator.gpu.requestAdapter failed'); + return; + } + + const device = await adapter.requestDevice(); + if (!device) { + TEST.skip('adapter.requestDevice() failed'); + return; + } + + let frame = await source.getNextFrame(); + if (device_destroyed_before_import) { + device.destroy(); + const gpu_external_texture = device.importExternalTexture({source: frame}); + TEST.assert(gpu_external_texture.expired == true, "GPUExternalTexture should be expired"); + } else { + const gpu_external_texture = device.importExternalTexture({source: frame}); + TEST.assert(gpu_external_texture.expired == false, "GPUExternalTexture should be active"); + device.destroy(); + TEST.assert(gpu_external_texture.expired == true, "GPUExternalTexture should be expired"); + } + + frame.close(); + source.close(); + } + </script> +</head> + +<body> + <div> + <canvas id='display' width="640" height="480"></canvas> + </div> +</body> + +</html> \ No newline at end of file
diff --git a/content/test/data/gpu/webcodecs/gpu-external-texture-expired.html b/content/test/data/gpu/webcodecs/gpu-external-texture-expired.html new file mode 100644 index 0000000..c7e39a2 --- /dev/null +++ b/content/test/data/gpu/webcodecs/gpu-external-texture-expired.html
@@ -0,0 +1,72 @@ +<!DOCTYPE html> +<!-- +Take frames coming from various sources and render them to a canvas with +WebGLRenderingContext.texImage2D(). +--> +<html> + +<head> + <title>GPUExternalTexture.expired test</title> + <script src="webcodecs_common.js"></script> + <script id="myWorker" type="text/worker"> + self.onmessage = function(e) { + self.postMessage(""); + } + </script> + <script type="text/javascript"> + 'use strict'; + function makeWorker(script) { + var blob = new Blob([script]); + return new Worker(URL.createObjectURL(blob)); + } + + async function main(arg) { + const use_worker = arg.use_worker; + let source_type = arg.source_type; + let canvas = document.getElementById('display'); + let source = + await createFrameSource(source_type, canvas.width, canvas.height); + if (!source) { + TEST.skip('Unsupported source: ' + source_type); + return; + } + + const adapter = navigator.gpu && await navigator.gpu.requestAdapter(); + if (!adapter) { + TEST.skip('navigator.gpu && navigator.gpu.requestAdapter failed'); + return; + } + + const device = await adapter.requestDevice(); + if (!device) { + TEST.skip('adapter.requestDevice() failed'); + return; + } + + let frame = await source.getNextFrame(); + const gpu_external_texture = device.importExternalTexture({ source: frame }); + TEST.assert(gpu_external_texture.expired == false, "GPUExternalTexture should be active"); + + if (use_worker) { + let worker = makeWorker(document.getElementById("myWorker").textContent); + worker.onmessage = function (e) { + TEST.assert(gpu_external_texture.expired == true, "GPUExternalTexture should be expired"); + } + // GPUExternalTexture should be expired when the frame in the same thread has been transferred. + worker.postMessage({ videoFrame: frame }, [frame]); + } else { + frame.close(); + TEST.assert(gpu_external_texture.expired == true, "GPUExternalTexture should be expired"); + } + source.close(); + } + </script> +</head> + +<body> + <div> + <canvas id='display' width="640" height="480"></canvas> + </div> +</body> + +</html> \ No newline at end of file
diff --git a/content/test/data/gpu/webgl-overly-large-uniform.html b/content/test/data/gpu/webgl-overly-large-uniform.html new file mode 100644 index 0000000..9b28fa5e --- /dev/null +++ b/content/test/data/gpu/webgl-overly-large-uniform.html
@@ -0,0 +1,137 @@ +<html> +<head> +<script type="x-shader/x-vertex" id="vertex"> +#version 100 +uniform mat4 overflow; + +void main() { + gl_Position = overflow * vec4(0.11, 0.22, 0.33, 1.0); +} +</script> +<script type="x-shader/x-fragment" id="fragment"> +#version 100 +void main() { + gl_FragColor = vec4(0.11, 0.22, 0.33, 1.0); +} +</script> +<script type="text/javascript"> +let canvas; +let w, h; +let gl; +let timeout; + +function send(result, message) { + if (window.domAutomationController) + window.domAutomationController.send(result); + if (message) + console.log(message); +} + +function onContextLost(e) { + e.preventDefault(); + clearTimeout(timeout); + // This is the last test in this file. + send("SUCCESS"); +} + +function onContextRestored() { + // Could extend this test to cover context restoration, but ignore + // this for now. +} + +function timedOut() { + send("FAILURE", "Timed out waiting for context lost event"); +} + +function onLoad() { + send("LOADED"); + + canvas = document.getElementById("canvas1"); + w = canvas.width; + h = canvas.height; + if (!canvas) + return; + canvas.addEventListener("webglcontextlost", onContextLost, false); + canvas.addEventListener("webglcontextrestored", onContextRestored, false); + + gl = canvas.getContext("webgl"); + if (!gl) { + send("FAILURE", "Couldn't get WebGL context"); + return; + } + + let vertexShader = gl.createShader(gl.VERTEX_SHADER); + gl.shaderSource(vertexShader, document.querySelector("#vertex").innerHTML); + gl.compileShader(vertexShader); + + let fragmentShader = gl.createShader(gl.FRAGMENT_SHADER); + gl.shaderSource(fragmentShader, document.querySelector("#fragment").innerHTML); + gl.compileShader(fragmentShader); + + program = gl.createProgram(); + gl.attachShader(program, vertexShader); + gl.attachShader(program, fragmentShader); + gl.linkProgram(program); + + overflow = gl.getUniformLocation(program, "overflow"); + + gl.useProgram(program); + + // 2 GB memory pool, if possible. (64KB Wasm page size) + // + // If allocation fails (for example, on 32-bit Android), fall back + // to 128 MB, and skip the portion of the test which tests the + // generation of INVALID_VALUE. + let gotLargeAllocation = false; + let memory; + + try { + memory = new WebAssembly.Memory({initial: 32768}); + gotLargeAllocation = true; + } catch (e) { + // Must be on a system that can't allocate that much memory. Try + // again with a smaller reservation. + try { + memory = new WebAssembly.Memory({initial: 2048}); + } catch (e) { + // Unexpected. Fail verbosely. + send("FAILURE", "Failed to allocate even the smaller Wasm memory"); + return; + } + } + + if (gotLargeAllocation) { + // Feeding in all but a few bytes of that memory pool should cause + // GL_INVALID_VALUE to be generated as an implementation detail; this can not + // be guaranteed by the WebGL conformance tests. Note: this behavior could be + // changed to instead force a lost context if desired, per below. + const fewBytes = 8; + let array = new Int32Array(memory.buffer, fewBytes); + gl.uniform1iv(overflow, array); + let err = gl.getError(); + console.log("GL error after very large uniform1iv call: " + err); + if (err != gl.INVALID_VALUE) { + send("FAILURE", "Expected gl.INVALID_VALUE, got " + err); + return; + } + } + + // Feeding in significantly less of that memory pool (in this case, 64K less) + // should cause a lost context as an implementation detail; this can not be + // guaranteed by the WebGL conformance tests. + const moreBytes = 64 * 1024; + array = new Int32Array(memory.buffer, moreBytes); + gl.uniform1iv(overflow, array); + err = gl.getError(); + console.log("GL error after slightly less large uniform1iv call: " + err); + // Delivery of context loss will race with execution here. + // If it hasn't been delivered within 5 seconds, fail the test. + timeout = setTimeout(timedOut, 5000); +} +</script> +</head> +<body onload="onLoad()"> +<canvas id="canvas1" width="64px" height="64px"> +</canvas> +</body> +</html>
diff --git a/content/test/gpu/gpu_tests/context_lost_integration_test.py b/content/test/gpu/gpu_tests/context_lost_integration_test.py index 0271328..4258cb3 100644 --- a/content/test/gpu/gpu_tests/context_lost_integration_test.py +++ b/content/test/gpu/gpu_tests/context_lost_integration_test.py
@@ -160,6 +160,8 @@ 'webgl_with_select_element.html'), ('ContextLost_WebGLContextLostInHiddenTab', 'webgl.html?query=kill_after_notification'), + ('ContextLost_WebGLContextLostOverlyLargeUniform', + 'webgl-overly-large-uniform.html'), ('ContextLost_WebGLBlockedAfterJSNavigation', 'webgl-domain-blocking-page1.html'), ('ContextLost_WebGLUnblockedAfterUserInitiatedReload', @@ -403,6 +405,16 @@ tab.Activate() self._WaitForTabAndCheckCompletion() + def _ContextLost_WebGLContextLostOverlyLargeUniform(self, + test_path: str) -> None: + self.RestartBrowserIfNecessaryWithArgs([ + cba.DISABLE_DOMAIN_BLOCKING_FOR_3D_APIS, + '--enable-features=DisableArrayBufferSizeLimitsForTesting' + ]) + self._NavigateAndWaitForLoad(test_path) + # No reason to wait more than 10 seconds for this test to complete. + self._WaitForTabAndCheckCompletion(timeout=10) + def _ContextLost_WebGLBlockedAfterJSNavigation(self, test_path: str) -> None: self.RestartBrowserIfNecessaryWithArgs([]) self._NavigateAndWaitForLoad(test_path)
diff --git a/content/test/gpu/gpu_tests/webcodecs_integration_test.py b/content/test/gpu/gpu_tests/webcodecs_integration_test.py index ae3bd64d..ba2e81d2 100644 --- a/content/test/gpu/gpu_tests/webcodecs_integration_test.py +++ b/content/test/gpu/gpu_tests/webcodecs_integration_test.py
@@ -55,6 +55,30 @@ 'source_type': source_type }]) + yield ('WebCodecs_GPUExternalTexture_expired_' + source_type, + 'gpu-external-texture-expired.html', [{ + 'source_type': source_type, + 'use_worker': False + }]) + yield ('WebCodecs_GPUExternalTexture_expired_worker_' + source_type, + 'gpu-external-texture-expired.html', [{ + 'source_type': source_type, + 'use_worker': True + }]) + yield ('WebCodecs_device_destroy_expired_texture_' + source_type, + 'gpu-device-destroy-expire-active-external-texture.html', [{ + 'source_type': + source_type, + 'device_destroyed_before_import': + False + }]) + yield ('WebCodecs_texture_expired_from_destroyed_device_' + source_type, + 'gpu-device-destroy-expire-active-external-texture.html', [{ + 'source_type': + source_type, + 'device_destroyed_before_import': + True + }]) @classmethod def GenerateAudioTests(cls) -> ct.TestGenerator: @@ -156,8 +180,8 @@ def SetUpProcess(cls) -> None: super(WebCodecsIntegrationTest, cls).SetUpProcess() args = [ - '--use-fake-device-for-media-stream', - '--use-fake-ui-for-media-stream', + '--use-fake-device-for-media-stream', '--use-fake-ui-for-media-stream', + '--enable-unsafe-webgpu' ] # If we don't call CustomizeBrowserArgs cls.platform is None
diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn index e18568a..0018199 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn
@@ -454,6 +454,8 @@ "media_capture_util.h", "mojo/keep_alive_impl.cc", "mojo/keep_alive_impl.h", + "network_permissions_updater.cc", + "network_permissions_updater.h", "notification_types.h", "null_app_sorting.cc", "null_app_sorting.h",
diff --git a/extensions/browser/extensions_browser_client.cc b/extensions/browser/extensions_browser_client.cc index df739c2..22a1098 100644 --- a/extensions/browser/extensions_browser_client.cc +++ b/extensions/browser/extensions_browser_client.cc
@@ -167,4 +167,11 @@ base::OnceCallback<void(scoped_refptr<base::RefCountedMemory> bitmap_data)> callback) const {} +std::vector<content::BrowserContext*> +ExtensionsBrowserClient::GetRelatedContextsForExtension( + content::BrowserContext* browser_context, + const Extension& extension) const { + return {browser_context}; +} + } // namespace extensions
diff --git a/extensions/browser/extensions_browser_client.h b/extensions/browser/extensions_browser_client.h index f87cf6d3..aa4e3cc 100644 --- a/extensions/browser/extensions_browser_client.h +++ b/extensions/browser/extensions_browser_client.h
@@ -433,6 +433,16 @@ base::OnceCallback<void( scoped_refptr<base::RefCountedMemory> bitmap_data)> callback) const; + // Returns all BrowserContexts related to the given extension. For an + // extension limited to a signal context, this will be a vector of the single + // passed-in context. For extensions allowed to run in incognito contexts + // associated with `browser_context`, this will include all those contexts. + // Note: It may not be appropriate to treat these the same depending on + // whether the extension runs in "split" or "spanning" mode. + virtual std::vector<content::BrowserContext*> GetRelatedContextsForExtension( + content::BrowserContext* browser_context, + const Extension& extension) const; + private: std::vector<std::unique_ptr<ExtensionsBrowserAPIProvider>> providers_; };
diff --git a/extensions/browser/network_permissions_updater.cc b/extensions/browser/network_permissions_updater.cc new file mode 100644 index 0000000..257e91f --- /dev/null +++ b/extensions/browser/network_permissions_updater.cc
@@ -0,0 +1,83 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "extensions/browser/network_permissions_updater.h" + +#include "base/barrier_closure.h" +#include "content/public/browser/browser_context.h" +#include "extensions/browser/extension_registry.h" +#include "extensions/browser/extension_util.h" +#include "extensions/browser/extensions_browser_client.h" +#include "extensions/common/extension.h" +#include "extensions/common/extension_set.h" + +namespace extensions { + +NetworkPermissionsUpdater::NetworkPermissionsUpdater( + PassKey pass_key, + content::BrowserContext& browser_context, + base::OnceClosure completion_callback) + : browser_context_(&browser_context), + completion_callback_(std::move(completion_callback)) {} + +NetworkPermissionsUpdater::~NetworkPermissionsUpdater() = default; + +// static +void NetworkPermissionsUpdater::UpdateExtension( + content::BrowserContext& browser_context, + const Extension& extension, + base::OnceClosure completion_callback) { + auto updater = std::make_unique<NetworkPermissionsUpdater>( + PassKey(), browser_context, std::move(completion_callback)); + auto* updater_raw = updater.get(); + + // The callback takes ownership of `updater`, ensuring it's deleted when + // the update completes. + updater_raw->UpdateExtension( + extension, + base::BindOnce(&NetworkPermissionsUpdater::OnOriginAccessUpdated, + std::move(updater))); +} + +// static +void NetworkPermissionsUpdater::UpdateAllExtensions( + content::BrowserContext& browser_context, + base::OnceClosure completion_callback) { + auto updater = std::make_unique<NetworkPermissionsUpdater>( + PassKey(), browser_context, std::move(completion_callback)); + auto* updater_raw = updater.get(); + + const ExtensionSet& extensions = + ExtensionRegistry::Get(&browser_context)->enabled_extensions(); + + // The `barrier_closure` takes ownership of `updater`, ensuring it's deleted + // when the update completes. + base::RepeatingClosure barrier_closure = base::BarrierClosure( + extensions.size(), + base::BindOnce(&NetworkPermissionsUpdater::OnOriginAccessUpdated, + std::move(updater))); + + for (const auto& extension : extensions) + updater_raw->UpdateExtension(*extension, barrier_closure); +} + +void NetworkPermissionsUpdater::UpdateExtension( + const Extension& extension, + base::OnceClosure completion_callback) { + // Non-tab-specific extension permissions are shared across profiles (even for + // split-mode extensions), so we update all profiles the extension is enabled + // for. + util::SetCorsOriginAccessListForExtension( + ExtensionsBrowserClient::Get()->GetRelatedContextsForExtension( + browser_context_, extension), + extension, std::move(completion_callback)); +} + +// static +void NetworkPermissionsUpdater::OnOriginAccessUpdated( + std::unique_ptr<NetworkPermissionsUpdater> updater) { + std::move(updater->completion_callback_).Run(); +} + +} // namespace extensions
diff --git a/extensions/browser/network_permissions_updater.h b/extensions/browser/network_permissions_updater.h new file mode 100644 index 0000000..d7a95888 --- /dev/null +++ b/extensions/browser/network_permissions_updater.h
@@ -0,0 +1,71 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EXTENSIONS_BROWSER_NETWORK_PERMISSIONS_UPDATER_H_ +#define EXTENSIONS_BROWSER_NETWORK_PERMISSIONS_UPDATER_H_ + +#include "base/callback.h" +#include "base/memory/raw_ptr.h" +#include "base/types/pass_key.h" + +namespace content { +class BrowserContext; +} // namespace content + +namespace extensions { +class Extension; + +// A helper class to update the network service's records of extension +// permissions. +// This class effectively manages its own lifetime (via a unique_ptr). +// TODO(devlin): With a bit more finagling, we can bring most of the CORS- +// updating logic from extension_util into this file (the main piece missing +// is to add in a toggle to control whether related contexts are included). We +// should do that to centralize this logic and reduce the number of ambiguous +// "util"-style functions we have. +class NetworkPermissionsUpdater { + public: + using PassKey = base::PassKey<NetworkPermissionsUpdater>; + + // Pseudo-private ctor. This is public so that it can be used with + // std::make_unique<>, but guarded via the PassKey. Consumers should only use + // the static methods below. + NetworkPermissionsUpdater(PassKey pass_key, + content::BrowserContext& browser_context, + base::OnceClosure completion_callback); + ~NetworkPermissionsUpdater(); + + // Updates a single `extension`'s permissions in the network layer. Invokes + // `completion_callback` when the operation is complete. + static void UpdateExtension(content::BrowserContext& browser_context, + const Extension& extension, + base::OnceClosure completion_callback); + + // Updates the permissions of all extensions related to the (original) + // `browser_context`. Invokes `completion_callback` when the operation is + // complete. + static void UpdateAllExtensions(content::BrowserContext& browser_context, + base::OnceClosure completion_callback); + + private: + // Updates a single extension in the network layer, invoking + // `completion_callback` when the operation is complete. + void UpdateExtension(const Extension& extension, + base::OnceClosure completion_callback); + + // Invoked when all updates are complete in order to dispatch + // `completion_callback_`. + static void OnOriginAccessUpdated( + std::unique_ptr<NetworkPermissionsUpdater> updater); + + // The associated BrowserContext. + raw_ptr<content::BrowserContext> const browser_context_; + + // A callback to invoke upon completion. + base::OnceClosure completion_callback_; +}; + +} // namespace extensions + +#endif // EXTENSIONS_BROWSER_NETWORK_PERMISSIONS_UPDATER_H_
diff --git a/fuchsia/base/BUILD.gn b/fuchsia/base/BUILD.gn index f72504c..0ecc715 100644 --- a/fuchsia/base/BUILD.gn +++ b/fuchsia/base/BUILD.gn
@@ -4,39 +4,8 @@ assert(is_fuchsia) -import("//build/config/fuchsia/generate_runner_scripts.gni") import("//testing/test.gni") -# Integration helpers for commonly used fuchsia.* APIs. -source_set("base") { - # Only for use by Fuchsia Components. - visibility = [ - "./test/*", - "//chromecast/internal/*", - "//fuchsia_web/runners/*", - "//fuchsia_web/webengine/*", - "//fuchsia_web/webinstance_host/*", - ] - sources = [ - "fuchsia_dir_scheme.cc", - "init_logging.cc", - "string_util.cc", - ] - public = [ - "fuchsia_dir_scheme.h", - "init_logging.h", - "string_util.h", - ] - deps = [ - "//base", - "//build:branding_buildflags", - "//components/version_info", - "//third_party/fuchsia-sdk/sdk/pkg/fdio", - "//third_party/fuchsia-sdk/sdk/pkg/sys_cpp", - "//url", - ] -} - # Integration helpers for fuchsia.modular. source_set("modular") { # Only for use by Fuchsia Components. @@ -100,7 +69,6 @@ "//base:testfidl", "//base/test:run_all_unittests", "//base/test:test_support", - "//components/version_info", "//fuchsia/base/test:test_support", "//testing/gmock", "//testing/gtest",
diff --git a/fuchsia/base/DEPS b/fuchsia/base/DEPS index 5ded5f1b..02fe90e 100644 --- a/fuchsia/base/DEPS +++ b/fuchsia/base/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+components/version_info", + "+fuchsia_web/common", "+mojo/public", "+third_party/blink/public/common/messaging", "+third_party/blink/public/mojom/messaging",
diff --git a/fuchsia/base/test/BUILD.gn b/fuchsia/base/test/BUILD.gn index 6d67774..b988c2b9 100644 --- a/fuchsia/base/test/BUILD.gn +++ b/fuchsia/base/test/BUILD.gn
@@ -24,8 +24,8 @@ ] public_deps = [ "//base", - "//fuchsia/base:base", "//fuchsia/base:modular", + "//fuchsia_web/common", "//net", "//net:test_support", "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.mem",
diff --git a/fuchsia/base/test/url_request_rewrite_test_util.cc b/fuchsia/base/test/url_request_rewrite_test_util.cc index 985705c..45da5a55 100644 --- a/fuchsia/base/test/url_request_rewrite_test_util.cc +++ b/fuchsia/base/test/url_request_rewrite_test_util.cc
@@ -5,7 +5,7 @@ #include "fuchsia/base/test/url_request_rewrite_test_util.h" #include "base/strings/string_piece.h" -#include "fuchsia/base/string_util.h" +#include "fuchsia_web/common/string_util.h" namespace cr_fuchsia {
diff --git a/fuchsia/engine/web_instance_host/DEPS b/fuchsia/engine/web_instance_host/DEPS deleted file mode 100644 index 27bcad86..0000000 --- a/fuchsia/engine/web_instance_host/DEPS +++ /dev/null
@@ -1,6 +0,0 @@ -include_rules = [ - "+components/fuchsia_component_support", - "+services/network/public/cpp/features.h", - "+services/network/public/cpp/network_switches.h", - "+third_party/blink/public/common/switches.h", -]
diff --git a/fuchsia_web/DEPS b/fuchsia_web/DEPS index e64f359..1aa5004 100644 --- a/fuchsia_web/DEPS +++ b/fuchsia_web/DEPS
@@ -1,4 +1,7 @@ include_rules = [ # Require explicit include rules for sub-directories. "-fuchsia_web", + + # Everything can access the common directory. + "+fuchsia_web/common", ] \ No newline at end of file
diff --git a/fuchsia_web/common/BUILD.gn b/fuchsia_web/common/BUILD.gn new file mode 100644 index 0000000..26dd70b --- /dev/null +++ b/fuchsia_web/common/BUILD.gn
@@ -0,0 +1,27 @@ +# Copyright 2022 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_fuchsia) + +# Only allow use by WebEngine-related Fuchsia targets. +visibility = [ "//fuchsia_web/*" ] + +source_set("common") { + # TODO(crbug.com/1081525): Remove once directory is deleted. + visibility += [ "//fuchsia/base/test/*" ] + sources = [ + "fuchsia_dir_scheme.cc", + "init_logging.cc", + "string_util.cc", + ] + public = [ + "fuchsia_dir_scheme.h", + "init_logging.h", + "string_util.h", + ] + deps = [ + "//components/version_info", + "//url", + ] +}
diff --git a/fuchsia_web/common/DEPS b/fuchsia_web/common/DEPS new file mode 100644 index 0000000..82b446c --- /dev/null +++ b/fuchsia_web/common/DEPS
@@ -0,0 +1,8 @@ +specific_include_rules = { + "fuchsia_dir_scheme\.cc": [ + "+url", + ], + "init_logging\.cc": [ + "+components/version_info", + ], +}
diff --git a/fuchsia/base/fuchsia_dir_scheme.cc b/fuchsia_web/common/fuchsia_dir_scheme.cc similarity index 89% rename from fuchsia/base/fuchsia_dir_scheme.cc rename to fuchsia_web/common/fuchsia_dir_scheme.cc index 00c1e0b..207fc572 100644 --- a/fuchsia/base/fuchsia_dir_scheme.cc +++ b/fuchsia_web/common/fuchsia_dir_scheme.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "fuchsia/base/fuchsia_dir_scheme.h" +#include "fuchsia_web/common/fuchsia_dir_scheme.h" #include "url/url_util.h"
diff --git a/fuchsia/base/fuchsia_dir_scheme.h b/fuchsia_web/common/fuchsia_dir_scheme.h similarity index 72% rename from fuchsia/base/fuchsia_dir_scheme.h rename to fuchsia_web/common/fuchsia_dir_scheme.h index b9fd9a8..9dc69cb1 100644 --- a/fuchsia/base/fuchsia_dir_scheme.h +++ b/fuchsia_web/common/fuchsia_dir_scheme.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FUCHSIA_BASE_FUCHSIA_DIR_SCHEME_H_ -#define FUCHSIA_BASE_FUCHSIA_DIR_SCHEME_H_ +#ifndef FUCHSIA_WEB_COMMON_FUCHSIA_DIR_SCHEME_H_ +#define FUCHSIA_WEB_COMMON_FUCHSIA_DIR_SCHEME_H_ namespace cr_fuchsia { @@ -15,4 +15,4 @@ } // namespace cr_fuchsia -#endif // FUCHSIA_BASE_FUCHSIA_DIR_SCHEME_H_ +#endif // FUCHSIA_WEB_COMMON_FUCHSIA_DIR_SCHEME_H_
diff --git a/fuchsia/base/init_logging.cc b/fuchsia_web/common/init_logging.cc similarity index 97% rename from fuchsia/base/init_logging.cc rename to fuchsia_web/common/init_logging.cc index 0fb5f502..7894d2f 100644 --- a/fuchsia/base/init_logging.cc +++ b/fuchsia_web/common/init_logging.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "fuchsia/base/init_logging.h" +#include "fuchsia_web/common/init_logging.h" #include "base/command_line.h" #include "base/logging.h"
diff --git a/fuchsia/base/init_logging.h b/fuchsia_web/common/init_logging.h similarity index 82% rename from fuchsia/base/init_logging.h rename to fuchsia_web/common/init_logging.h index 5b1f381..6082498 100644 --- a/fuchsia/base/init_logging.h +++ b/fuchsia_web/common/init_logging.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FUCHSIA_BASE_INIT_LOGGING_H_ -#define FUCHSIA_BASE_INIT_LOGGING_H_ +#ifndef FUCHSIA_WEB_COMMON_INIT_LOGGING_H_ +#define FUCHSIA_WEB_COMMON_INIT_LOGGING_H_ #include "base/strings/string_piece_forward.h" @@ -11,6 +11,7 @@ class CommandLine; } +// TODO(crbug/1081525): Remove the cr_fuchsia namespace from all files. namespace cr_fuchsia { // Configures logging for the current process based on the supplied @@ -30,4 +31,4 @@ } // namespace cr_fuchsia -#endif // FUCHSIA_BASE_INIT_LOGGING_H_ +#endif // FUCHSIA_WEB_COMMON_INIT_LOGGING_H_
diff --git a/fuchsia/base/string_util.cc b/fuchsia_web/common/string_util.cc similarity index 92% rename from fuchsia/base/string_util.cc rename to fuchsia_web/common/string_util.cc index 7b1b242b..4296cbd 100644 --- a/fuchsia/base/string_util.cc +++ b/fuchsia_web/common/string_util.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "fuchsia/base/string_util.h" +#include "fuchsia_web/common/string_util.h" namespace cr_fuchsia {
diff --git a/fuchsia/base/string_util.h b/fuchsia_web/common/string_util.h similarity index 79% rename from fuchsia/base/string_util.h rename to fuchsia_web/common/string_util.h index f538e51..b3087bb 100644 --- a/fuchsia/base/string_util.h +++ b/fuchsia_web/common/string_util.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FUCHSIA_BASE_STRING_UTIL_H_ -#define FUCHSIA_BASE_STRING_UTIL_H_ +#ifndef FUCHSIA_WEB_COMMON_STRING_UTIL_H_ +#define FUCHSIA_WEB_COMMON_STRING_UTIL_H_ #include <cstdint> #include <vector> @@ -20,4 +20,4 @@ } // namespace cr_fuchsia -#endif // FUCHSIA_BASE_STRING_UTIL_H_ +#endif // FUCHSIA_WEB_COMMON_STRING_UTIL_H_
diff --git a/fuchsia_web/runners/BUILD.gn b/fuchsia_web/runners/BUILD.gn index dd6f298..9c2a423 100644 --- a/fuchsia_web/runners/BUILD.gn +++ b/fuchsia_web/runners/BUILD.gn
@@ -34,7 +34,6 @@ deps = [ ":buildflags", "//base", - "//fuchsia/base", "//fuchsia/base:modular", "//fuchsia_web/webinstance_host", "//third_party/fuchsia-sdk/sdk/pkg/scenic_cpp", @@ -84,7 +83,6 @@ "//components/cast/message_port", "//components/cast/named_message_port_connector:named_message_port_connector", "//components/fuchsia_component_support", - "//fuchsia/base", "//fuchsia/base:modular", # TODO(crbug.com/852834): Remove this dependency when @@ -125,7 +123,7 @@ ":common", "//base", "//components/fuchsia_component_support", - "//fuchsia/base", + "//fuchsia_web/common", "//fuchsia_web/webinstance_host", "//third_party/fuchsia-sdk/sdk/pkg/sys_inspect_cpp", ] @@ -276,7 +274,6 @@ "//components/cast/message_port:test_message_port_receiver", "//content/public/browser", "//content/test:test_support", - "//fuchsia/base", "//fuchsia/base/test:test_support", "//fuchsia_web/webengine:browsertest_core", "//testing/gmock", @@ -298,7 +295,7 @@ ":common", "//base", "//components/fuchsia_component_support", - "//fuchsia/base", + "//fuchsia_web/common", "//fuchsia_web/webinstance_host", "//third_party/fuchsia-sdk/sdk/pkg/sys_inspect_cpp", ]
diff --git a/fuchsia_web/runners/cast/cast_runner_integration_test.cc b/fuchsia_web/runners/cast/cast_runner_integration_test.cc index f68582ce5..bfcf102 100644 --- a/fuchsia_web/runners/cast/cast_runner_integration_test.cc +++ b/fuchsia_web/runners/cast/cast_runner_integration_test.cc
@@ -42,13 +42,13 @@ #include "base/threading/sequenced_task_runner_handle.h" #include "build/build_config.h" #include "fuchsia/base/agent_impl.h" -#include "fuchsia/base/string_util.h" #include "fuchsia/base/test/context_provider_test_connector.h" #include "fuchsia/base/test/fake_component_context.h" #include "fuchsia/base/test/fit_adapter.h" #include "fuchsia/base/test/frame_test_util.h" #include "fuchsia/base/test/test_devtools_list_fetcher.h" #include "fuchsia/base/test/url_request_rewrite_test_util.h" +#include "fuchsia_web/common/string_util.h" #include "fuchsia_web/runners/cast/cast_runner.h" #include "fuchsia_web/runners/cast/cast_runner_switches.h" #include "fuchsia_web/runners/cast/fake_api_bindings.h"
diff --git a/fuchsia_web/runners/cast/main.cc b/fuchsia_web/runners/cast/main.cc index 442392a..7fe3be3 100644 --- a/fuchsia_web/runners/cast/main.cc +++ b/fuchsia_web/runners/cast/main.cc
@@ -23,8 +23,8 @@ #include "components/fuchsia_component_support/config_reader.h" #include "components/fuchsia_component_support/feedback_registration.h" #include "components/fuchsia_component_support/inspect.h" -#include "fuchsia/base/fuchsia_dir_scheme.h" -#include "fuchsia/base/init_logging.h" +#include "fuchsia_web/common/fuchsia_dir_scheme.h" +#include "fuchsia_web/common/init_logging.h" #include "fuchsia_web/runners/cast/cast_runner.h" #include "fuchsia_web/runners/cast/cast_runner_switches.h" #include "fuchsia_web/webinstance_host/web_instance_host.h"
diff --git a/fuchsia_web/runners/web/main.cc b/fuchsia_web/runners/web/main.cc index e87a162..b52e9275 100644 --- a/fuchsia_web/runners/web/main.cc +++ b/fuchsia_web/runners/web/main.cc
@@ -14,8 +14,7 @@ #include "base/run_loop.h" #include "base/task/single_thread_task_executor.h" #include "components/fuchsia_component_support/inspect.h" -#include "fuchsia/base/fuchsia_dir_scheme.h" -#include "fuchsia/base/init_logging.h" +#include "fuchsia_web/common/init_logging.h" #include "fuchsia_web/runners/buildflags.h" #include "fuchsia_web/runners/common/web_content_runner.h" #include "fuchsia_web/webinstance_host/web_instance_host.h" @@ -70,8 +69,6 @@ cr_fuchsia::LogComponentStartWithVersion("web_runner"); - cr_fuchsia::RegisterFuchsiaDirScheme(); - cr_fuchsia::WebInstanceHost web_instance_host; WebContentRunner runner(&web_instance_host, base::BindRepeating(&GetWebInstanceConfig));
diff --git a/fuchsia_web/webengine/BUILD.gn b/fuchsia_web/webengine/BUILD.gn index a91f455..2e50cb6 100644 --- a/fuchsia_web/webengine/BUILD.gn +++ b/fuchsia_web/webengine/BUILD.gn
@@ -119,9 +119,9 @@ "//content/public/child", "//content/public/common", "//content/public/renderer", - "//fuchsia/base", "//fuchsia/base:message_port", "//fuchsia/base:modular", + "//fuchsia_web/common", "//fuchsia_web/webengine/mojom", # TODO(crbug.com/1081525): Move context_provider to its own target and move @@ -493,8 +493,8 @@ "//components/version_info", "//content/public/browser", "//content/test:test_support", - "//fuchsia/base", "//fuchsia/base/test:test_support", + "//fuchsia_web/common", "//net:test_support", "//testing/gmock", "//testing/gtest", @@ -612,7 +612,6 @@ "//base", "//base:test_log_listener_safe", "//components/version_info", - "//fuchsia/base", "//fuchsia/base:run_all_integration_tests", "//fuchsia/base/test:test_support", "//fuchsia_web/webinstance_host", @@ -675,7 +674,7 @@ deps = [ "//base", - "//fuchsia/base", + "//fuchsia_web/common", "//fuchsia_web/webinstance_host", "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.policy", "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.web",
diff --git a/fuchsia_web/webengine/browser/content_directory_loader_factory.cc b/fuchsia_web/webengine/browser/content_directory_loader_factory.cc index 7426d74..fa72139 100644 --- a/fuchsia_web/webengine/browser/content_directory_loader_factory.cc +++ b/fuchsia_web/webengine/browser/content_directory_loader_factory.cc
@@ -23,7 +23,7 @@ #include "base/strings/string_util.h" #include "base/task/task_traits.h" #include "base/task/thread_pool.h" -#include "fuchsia/base/fuchsia_dir_scheme.h" +#include "fuchsia_web/common/fuchsia_dir_scheme.h" #include "fuchsia_web/webengine/common/web_engine_content_client.h" #include "fuchsia_web/webengine/switches.h" #include "mojo/public/cpp/bindings/remote.h"
diff --git a/fuchsia_web/webengine/browser/frame_impl_browsertest.cc b/fuchsia_web/webengine/browser/frame_impl_browsertest.cc index d1d00fc4..f043bdc 100644 --- a/fuchsia_web/webengine/browser/frame_impl_browsertest.cc +++ b/fuchsia_web/webengine/browser/frame_impl_browsertest.cc
@@ -11,10 +11,10 @@ #include "content/public/browser/navigation_handle.h" #include "content/public/test/browser_test.h" #include "content/public/test/test_utils.h" -#include "fuchsia/base/string_util.h" #include "fuchsia/base/test/fit_adapter.h" #include "fuchsia/base/test/frame_test_util.h" #include "fuchsia/base/test/test_navigation_listener.h" +#include "fuchsia_web/common/string_util.h" #include "fuchsia_web/webengine/browser/context_impl.h" #include "fuchsia_web/webengine/browser/fake_semantics_manager.h" #include "fuchsia_web/webengine/browser/frame_impl.h"
diff --git a/fuchsia_web/webengine/browser/navigation_controller_impl.cc b/fuchsia_web/webengine/browser/navigation_controller_impl.cc index ed192e45..40f5da4 100644 --- a/fuchsia_web/webengine/browser/navigation_controller_impl.cc +++ b/fuchsia_web/webengine/browser/navigation_controller_impl.cc
@@ -18,7 +18,7 @@ #include "content/public/browser/navigation_entry.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" -#include "fuchsia/base/string_util.h" +#include "fuchsia_web/common/string_util.h" #include "net/base/net_errors.h" #include "net/http/http_util.h" #include "third_party/blink/public/mojom/navigation/was_activated_option.mojom.h"
diff --git a/fuchsia_web/webengine/browser/request_monitoring_browsertest.cc b/fuchsia_web/webengine/browser/request_monitoring_browsertest.cc index d6bb047..9f3f1c0 100644 --- a/fuchsia_web/webengine/browser/request_monitoring_browsertest.cc +++ b/fuchsia_web/webengine/browser/request_monitoring_browsertest.cc
@@ -3,10 +3,10 @@ // found in the LICENSE file. #include "content/public/test/browser_test.h" -#include "fuchsia/base/string_util.h" #include "fuchsia/base/test/frame_test_util.h" #include "fuchsia/base/test/test_navigation_listener.h" #include "fuchsia/base/test/url_request_rewrite_test_util.h" +#include "fuchsia_web/common/string_util.h" #include "fuchsia_web/webengine/browser/frame_impl_browser_test_base.h" #include "fuchsia_web/webengine/switches.h" #include "fuchsia_web/webengine/test/frame_for_test.h"
diff --git a/fuchsia_web/webengine/browser/url_request_rewrite_type_converters.cc b/fuchsia_web/webengine/browser/url_request_rewrite_type_converters.cc index d2161fc..04e2c5e9 100644 --- a/fuchsia_web/webengine/browser/url_request_rewrite_type_converters.cc +++ b/fuchsia_web/webengine/browser/url_request_rewrite_type_converters.cc
@@ -7,7 +7,7 @@ #include "base/strings/strcat.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" -#include "fuchsia/base/string_util.h" +#include "fuchsia_web/common/string_util.h" #include "net/base/url_util.h" namespace {
diff --git a/fuchsia_web/webengine/browser/web_engine_content_browser_client.cc b/fuchsia_web/webengine/browser/web_engine_content_browser_client.cc index e055614..afbfe35 100644 --- a/fuchsia_web/webengine/browser/web_engine_content_browser_client.cc +++ b/fuchsia_web/webengine/browser/web_engine_content_browser_client.cc
@@ -24,8 +24,8 @@ #include "content/public/browser/navigation_handle.h" #include "content/public/browser/network_service_instance.h" #include "content/public/common/content_switches.h" -#include "fuchsia/base/fuchsia_dir_scheme.h" -#include "fuchsia/base/init_logging.h" +#include "fuchsia_web/common/fuchsia_dir_scheme.h" +#include "fuchsia_web/common/init_logging.h" #include "fuchsia_web/webengine/browser/frame_impl.h" #include "fuchsia_web/webengine/browser/navigation_policy_throttle.h" #include "fuchsia_web/webengine/browser/web_engine_browser_context.h"
diff --git a/fuchsia_web/webengine/common/web_engine_content_client.cc b/fuchsia_web/webengine/common/web_engine_content_client.cc index 16313aef..7bf2554 100644 --- a/fuchsia_web/webengine/common/web_engine_content_client.cc +++ b/fuchsia_web/webengine/common/web_engine_content_client.cc
@@ -8,7 +8,7 @@ #include "base/feature_list.h" #include "base/notreached.h" #include "components/embedder_support/origin_trials/origin_trial_policy_impl.h" -#include "fuchsia/base/fuchsia_dir_scheme.h" +#include "fuchsia_web/common/fuchsia_dir_scheme.h" #include "fuchsia_web/webengine/features.h" #include "fuchsia_web/webengine/switches.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/fuchsia_web/webengine/context_provider_main.cc b/fuchsia_web/webengine/context_provider_main.cc index eafe283..311c07a 100644 --- a/fuchsia_web/webengine/context_provider_main.cc +++ b/fuchsia_web/webengine/context_provider_main.cc
@@ -17,7 +17,7 @@ #include "base/task/single_thread_task_executor.h" #include "components/fuchsia_component_support/feedback_registration.h" #include "components/fuchsia_component_support/inspect.h" -#include "fuchsia/base/init_logging.h" +#include "fuchsia_web/common/init_logging.h" #include "fuchsia_web/webengine/context_provider_impl.h" namespace {
diff --git a/fuchsia_web/webengine/test/web_engine_shell.cc b/fuchsia_web/webengine/test/web_engine_shell.cc index 9a2a47b6..aed3f85 100644 --- a/fuchsia_web/webengine/test/web_engine_shell.cc +++ b/fuchsia_web/webengine/test/web_engine_shell.cc
@@ -28,7 +28,7 @@ #include "base/task/single_thread_task_executor.h" #include "base/values.h" #include "build/build_config.h" -#include "fuchsia/base/init_logging.h" +#include "fuchsia_web/common/init_logging.h" #include "fuchsia_web/webinstance_host/web_instance_host.h" #include "url/gurl.h"
diff --git a/fuchsia_web/webengine/web_engine_main_delegate.cc b/fuchsia_web/webengine/web_engine_main_delegate.cc index 785fe51..f560b578 100644 --- a/fuchsia_web/webengine/web_engine_main_delegate.cc +++ b/fuchsia_web/webengine/web_engine_main_delegate.cc
@@ -15,7 +15,7 @@ #include "base/strings/string_split.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" -#include "fuchsia/base/init_logging.h" +#include "fuchsia_web/common/init_logging.h" #include "fuchsia_web/webengine/browser/web_engine_browser_main.h" #include "fuchsia_web/webengine/browser/web_engine_content_browser_client.h" #include "fuchsia_web/webengine/common/cors_exempt_headers.h"
diff --git a/fuchsia_web/webinstance_host/BUILD.gn b/fuchsia_web/webinstance_host/BUILD.gn index f9322bc..ff5a9b8 100644 --- a/fuchsia_web/webinstance_host/BUILD.gn +++ b/fuchsia_web/webinstance_host/BUILD.gn
@@ -27,7 +27,7 @@ "//base:base_static", "//components/fuchsia_component_support", "//content/public/common", - "//fuchsia/base", + "//fuchsia_web/common", "//fuchsia_web/webengine:switches", "//gpu/command_buffer/service", "//media",
diff --git a/fuchsia_web/webinstance_host/web_instance_host.cc b/fuchsia_web/webinstance_host/web_instance_host.cc index e5df747d..b291b1e 100644 --- a/fuchsia_web/webinstance_host/web_instance_host.cc +++ b/fuchsia_web/webinstance_host/web_instance_host.cc
@@ -39,7 +39,7 @@ #include "components/fuchsia_component_support/config_reader.h" #include "components/fuchsia_component_support/feedback_registration.h" #include "content/public/common/content_switches.h" -#include "fuchsia/base/string_util.h" +#include "fuchsia_web/common/string_util.h" #include "fuchsia_web/webengine/features.h" #include "fuchsia_web/webengine/switches.h" #include "gpu/command_buffer/service/gpu_switches.h"
diff --git a/gpu/command_buffer/client/client_discardable_manager_unittest.cc b/gpu/command_buffer/client/client_discardable_manager_unittest.cc index 4b86fca..026ee81 100644 --- a/gpu/command_buffer/client/client_discardable_manager_unittest.cc +++ b/gpu/command_buffer/client/client_discardable_manager_unittest.cc
@@ -45,6 +45,9 @@ EXPECT_TRUE(found != active_ids_.end()); active_ids_.erase(found); } + void ForceLostContext(error::ContextLostReason reason) override { + // No-op; doesn't need to be exercised here. + } private: int32_t next_id_ = 1;
diff --git a/gpu/command_buffer/client/client_test_helper.cc b/gpu/command_buffer/client/client_test_helper.cc index 8512d4f..aa3dc69 100644 --- a/gpu/command_buffer/client/client_test_helper.cc +++ b/gpu/command_buffer/client/client_test_helper.cc
@@ -155,6 +155,13 @@ this, &FakeCommandBufferServiceBase::DestroyTransferBufferHelper)); } +void MockClientCommandBuffer::ForceLostContext( + error::ContextLostReason reason) { + // TODO(kbr): add a test for a call to this method. + SetParseError(error::kLostContext); + SetContextLostReason(reason); +} + MockClientCommandBufferMockFlush::MockClientCommandBufferMockFlush() { DelegateToFake(); }
diff --git a/gpu/command_buffer/client/client_test_helper.h b/gpu/command_buffer/client/client_test_helper.h index ea876fbdf..3ad1c65 100644 --- a/gpu/command_buffer/client/client_test_helper.h +++ b/gpu/command_buffer/client/client_test_helper.h
@@ -85,6 +85,8 @@ void SetTokenForSetGetBuffer(int32_t token) { token_ = token; } + void ForceLostContext(error::ContextLostReason reason) override; + private: int32_t put_offset_ = 0; int32_t token_ = 10000; // All token checks in the tests should pass.
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc index 8813dac..d86b8b4 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -157,7 +157,8 @@ (state.set_get_buffer_count != set_get_buffer_count_); cached_get_offset_ = service_on_old_buffer_ ? 0 : state.get_offset; cached_last_token_read_ = state.token; - context_lost_ = error::IsError(state.error); + // Don't transition from a lost context to a working context. + context_lost_ |= error::IsError(state.error); } bool CommandBufferHelper::WaitForGetOffsetInRange(int32_t start, int32_t end) { @@ -296,7 +297,6 @@ if (!AllocateRingBuffer()) return; DCHECK(HaveRingBuffer()); - DCHECK(count < total_entry_count_); if (put_ + count > total_entry_count_) { // There's not enough room between the current put and the end of the // buffer, so we need to wrap. We will add noops all the way to the end, @@ -344,7 +344,16 @@ put_)) return; CalcImmediateEntries(count); - DCHECK_GE(immediate_entry_count_, count); + if (immediate_entry_count_ < count) { + // Tell the underlying command buffer to signal a lost context to higher + // levels. + command_buffer_->ForceLostContext(error::kGuilty); + // Free the ring buffer and lose context. + FreeRingBuffer(); + usable_ = false; + context_lost_ = true; + return; + } } } }
diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h index 3b4b6a7..008ee8d 100644 --- a/gpu/command_buffer/common/command_buffer.h +++ b/gpu/command_buffer/common/command_buffer.h
@@ -126,6 +126,10 @@ // An ordering barrier must be placed after any commands that use the buffer // before it is safe to call this function to destroy it. virtual void DestroyTransferBuffer(int32_t id) = 0; + + // Forcibly lose this context. Used by higher-level code when it determines + // the necessity to do so. Has no effect if the context has already been lost. + virtual void ForceLostContext(error::ContextLostReason reason) = 0; }; } // namespace gpu
diff --git a/gpu/command_buffer/service/command_buffer_direct.cc b/gpu/command_buffer/service/command_buffer_direct.cc index e32139b6..6a7f7e5 100644 --- a/gpu/command_buffer/service/command_buffer_direct.cc +++ b/gpu/command_buffer/service/command_buffer_direct.cc
@@ -63,6 +63,11 @@ service_.DestroyTransferBuffer(id); } +void CommandBufferDirect::ForceLostContext(error::ContextLostReason reason) { + service_.SetContextLostReason(reason); + service_.SetParseError(error::kLostContext); +} + CommandBufferServiceClient::CommandBatchProcessedResult CommandBufferDirect::OnCommandBatchProcessed() { return kContinueExecution;
diff --git a/gpu/command_buffer/service/command_buffer_direct.h b/gpu/command_buffer/service/command_buffer_direct.h index 1ff6ca5..77505101a 100644 --- a/gpu/command_buffer/service/command_buffer_direct.h +++ b/gpu/command_buffer/service/command_buffer_direct.h
@@ -41,6 +41,7 @@ TransferBufferAllocationOption option = TransferBufferAllocationOption::kLoseContextOnOOM) override; void DestroyTransferBuffer(int32_t id) override; + void ForceLostContext(error::ContextLostReason reason) override; // CommandBufferServiceClient implementation: CommandBatchProcessedResult OnCommandBatchProcessed() override;
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.cc b/gpu/ipc/client/command_buffer_proxy_impl.cc index 29cce3f..a66bc55 100644 --- a/gpu/ipc/client/command_buffer_proxy_impl.cc +++ b/gpu/ipc/client/command_buffer_proxy_impl.cc
@@ -390,6 +390,22 @@ NewDestroyTransferBuffer(id)))); } +void CommandBufferProxyImpl::ForceLostContext(error::ContextLostReason reason) { + CheckLock(); + base::AutoLock lock(last_state_lock_); + if (last_state_.error == gpu::error::kLostContext) { + // Per specification, do nothing if the context is already lost. + return; + } + last_state_.error = gpu::error::kLostContext; + // The caller determines the context lost reason. + last_state_.context_lost_reason = reason; + // Calling code may be in an indeterminate state (possibly including + // being in a GpuControlClient callback), so avoid re-entering the + // GpuControlClient here. + DisconnectChannelInFreshCallStack(); +} + void CommandBufferProxyImpl::SetGpuControlClient(GpuControlClient* client) { CheckLock(); gpu_control_client_ = client;
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.h b/gpu/ipc/client/command_buffer_proxy_impl.h index 2c425bd..cf84f6e 100644 --- a/gpu/ipc/client/command_buffer_proxy_impl.h +++ b/gpu/ipc/client/command_buffer_proxy_impl.h
@@ -119,6 +119,7 @@ TransferBufferAllocationOption option = TransferBufferAllocationOption::kLoseContextOnOOM) override; void DestroyTransferBuffer(int32_t id) override; + void ForceLostContext(error::ContextLostReason reason) override; // gpu::GpuControl implementation: void SetGpuControlClient(GpuControlClient* client) override;
diff --git a/gpu/ipc/in_process_command_buffer.cc b/gpu/ipc/in_process_command_buffer.cc index ba9dc967..79ab4c9c 100644 --- a/gpu/ipc/in_process_command_buffer.cc +++ b/gpu/ipc/in_process_command_buffer.cc
@@ -792,6 +792,21 @@ gpu_thread_weak_ptr_factory_.GetWeakPtr(), id)); } +void InProcessCommandBuffer::ForceLostContext(error::ContextLostReason reason) { + ScheduleGpuTask( + base::BindOnce(&InProcessCommandBuffer::ForceLostContextOnGpuThread, + gpu_thread_weak_ptr_factory_.GetWeakPtr(), reason)); +} + +void InProcessCommandBuffer::ForceLostContextOnGpuThread( + error::ContextLostReason reason) { + DCHECK_CALLED_ON_VALID_SEQUENCE(gpu_sequence_checker_); + + // Similar implementation to CommandBufferDirect. + command_buffer_->SetContextLostReason(reason); + command_buffer_->SetParseError(error::kLostContext); +} + void InProcessCommandBuffer::DestroyTransferBufferOnGpuThread(int32_t id) { DCHECK_CALLED_ON_VALID_SEQUENCE(gpu_sequence_checker_); command_buffer_->DestroyTransferBuffer(id);
diff --git a/gpu/ipc/in_process_command_buffer.h b/gpu/ipc/in_process_command_buffer.h index 23ef660ba..8d2583a3 100644 --- a/gpu/ipc/in_process_command_buffer.h +++ b/gpu/ipc/in_process_command_buffer.h
@@ -122,6 +122,7 @@ TransferBufferAllocationOption option = TransferBufferAllocationOption::kLoseContextOnOOM) override; void DestroyTransferBuffer(int32_t id) override; + void ForceLostContext(error::ContextLostReason reason) override; // GpuControl implementation (called on client thread): void SetGpuControlClient(GpuControlClient*) override; @@ -252,6 +253,7 @@ void RegisterTransferBufferOnGpuThread(int32_t id, scoped_refptr<Buffer> buffer); void DestroyTransferBufferOnGpuThread(int32_t id); + void ForceLostContextOnGpuThread(error::ContextLostReason reason); void SetGetBufferOnGpuThread(int32_t shm_id, base::WaitableEvent* completion);
diff --git a/media/base/video_frame_metadata.h b/media/base/video_frame_metadata.h index 3f92d91..26dbe8a 100644 --- a/media/base/video_frame_metadata.h +++ b/media/base/video_frame_metadata.h
@@ -57,10 +57,6 @@ // If cropping was applied due to Region Capture to produce this frame, // then this reflects where the frame's contents originate from in the // original uncropped frame. - // - // NOTE: May also be nullopt if region capture is enabled but the capture rect - // is in a different coordinate space. For more info, see - // https://crbug.com/1327560. absl::optional<gfx::Rect> region_capture_rect; // Whenever cropTo() is called, Blink increments the crop_version and records
diff --git a/media/gpu/gpu_video_encode_accelerator_helpers.h b/media/gpu/gpu_video_encode_accelerator_helpers.h index 66d1b95..cc454d7 100644 --- a/media/gpu/gpu_video_encode_accelerator_helpers.h +++ b/media/gpu/gpu_video_encode_accelerator_helpers.h
@@ -53,6 +53,8 @@ // layers in the spatial layer based on the same bitrate division ratio as a // software encoder. If a variable bitrate is requested, the peak will be set // equal to the target. +// TODO(crbug.com/1335250): merge |bitrate| and |uses_vbr| into a single Bitrate +// field. MEDIA_GPU_EXPORT VideoBitrateAllocation AllocateDefaultBitrateForTesting(const size_t num_spatial_layers, const size_t num_temporal_layers,
diff --git a/media/gpu/test/video_encoder/video_encoder_test_environment.cc b/media/gpu/test/video_encoder/video_encoder_test_environment.cc index 41e1a625..a3c6b906 100644 --- a/media/gpu/test/video_encoder/video_encoder_test_environment.cc +++ b/media/gpu/test/video_encoder/video_encoder_test_environment.cc
@@ -97,6 +97,7 @@ size_t num_spatial_layers, bool save_output_bitstream, absl::optional<uint32_t> encode_bitrate, + Bitrate::Mode bitrate_mode, bool reverse, const FrameOutputConfig& frame_output_config, const std::vector<base::Feature>& enabled_features, @@ -173,13 +174,18 @@ combined_enabled_features.push_back(media::kVaapiVideoEncodeLinux); #endif + const bool use_vbr = bitrate_mode == Bitrate::Mode::kVariable; const uint32_t bitrate = encode_bitrate.value_or( GetDefaultTargetBitrate(video->Resolution(), video->FrameRate())); + if (use_vbr && VideoCodecProfileToVideoCodec(profile) != VideoCodec::kH264) { + LOG(ERROR) << "VBR is only supported for H264 encoding"; + return nullptr; + } return new VideoEncoderTestEnvironment( std::move(video), enable_bitstream_validator, output_folder, profile, - num_temporal_layers, num_spatial_layers, bitrate, save_output_bitstream, - reverse, frame_output_config, combined_enabled_features, - combined_disabled_features); + num_temporal_layers, num_spatial_layers, bitrate, use_vbr, + save_output_bitstream, reverse, frame_output_config, + combined_enabled_features, combined_disabled_features); } VideoEncoderTestEnvironment::VideoEncoderTestEnvironment( @@ -190,6 +196,7 @@ size_t num_temporal_layers, size_t num_spatial_layers, uint32_t bitrate, + bool use_vbr, bool save_output_bitstream, bool reverse, const FrameOutputConfig& frame_output_config, @@ -205,7 +212,7 @@ bitrate_(AllocateDefaultBitrateForTesting(num_spatial_layers_, num_temporal_layers_, bitrate, - false)), + use_vbr)), spatial_layers_(GetDefaultSpatialLayers(bitrate_, video_.get(), num_spatial_layers_,
diff --git a/media/gpu/test/video_encoder/video_encoder_test_environment.h b/media/gpu/test/video_encoder/video_encoder_test_environment.h index 279339c..77ed7c63 100644 --- a/media/gpu/test/video_encoder/video_encoder_test_environment.h +++ b/media/gpu/test/video_encoder/video_encoder_test_environment.h
@@ -45,6 +45,7 @@ size_t num_spatial_layers, bool save_output_bitstream, absl::optional<uint32_t> output_bitrate, + Bitrate::Mode bitrate_mode, bool reverse, const FrameOutputConfig& frame_output_config = FrameOutputConfig(), const std::vector<base::Feature>& enabled_features = {}, @@ -86,6 +87,8 @@ bool IsKeplerUsed() const; private: + // TODO(crbug.com/1335251): merge |use_vbr| and |bitrate| into a single + // Bitrate-typed field. VideoEncoderTestEnvironment( std::unique_ptr<media::test::Video> video, bool enable_bitstream_validator, @@ -94,6 +97,7 @@ size_t num_temporal_layers, size_t num_spatial_layers, uint32_t bitrate, + bool use_vbr, bool save_output_bitstream, bool reverse, const FrameOutputConfig& frame_output_config,
diff --git a/media/gpu/v4l2/test/v4l2_stateless_decoder.cc b/media/gpu/v4l2/test/v4l2_stateless_decoder.cc index 2b444e5..ae6af3f7 100644 --- a/media/gpu/v4l2/test/v4l2_stateless_decoder.cc +++ b/media/gpu/v4l2/test/v4l2_stateless_decoder.cc
@@ -151,7 +151,7 @@ break; } else if (res == VideoDecoder::kError) { LOG(ERROR) << "Unable to decode next frame."; - break; + return EXIT_FAILURE; } if (cmd->HasSwitch("visible") && !dec->LastDecodedFrameVisible())
diff --git a/media/gpu/vaapi/vaapi_image_decoder.cc b/media/gpu/vaapi/vaapi_image_decoder.cc index 1c92c7b..91b26f9 100644 --- a/media/gpu/vaapi/vaapi_image_decoder.cc +++ b/media/gpu/vaapi/vaapi_image_decoder.cc
@@ -74,13 +74,11 @@ DCHECK_NE(gpu::ImageDecodeAcceleratorType::kUnknown, profile.image_type); // Note that since |vaapi_wrapper_| was created successfully, we expect the - // following calls to be successful. Hence the DCHECKs. - const bool got_min_resolution = VaapiWrapper::GetDecodeMinResolution( - va_profile_, &profile.min_encoded_dimensions); - DCHECK(got_min_resolution); - const bool got_max_resolution = VaapiWrapper::GetDecodeMaxResolution( - va_profile_, &profile.max_encoded_dimensions); - DCHECK(got_max_resolution); + // following call to be successful. Hence the DCHECK. + const bool got_supported_resolutions = VaapiWrapper::GetSupportedResolutions( + va_profile_, VaapiWrapper::CodecMode::kDecode, + profile.min_encoded_dimensions, profile.max_encoded_dimensions); + DCHECK(got_supported_resolutions); // TODO(andrescj): Ideally, we would advertise support for all the formats // supported by the driver. However, for now, we will only support exposing
diff --git a/media/gpu/vaapi/vaapi_jpeg_decoder.cc b/media/gpu/vaapi/vaapi_jpeg_decoder.cc index 4ea2b6c..7c3e8e8b 100644 --- a/media/gpu/vaapi/vaapi_jpeg_decoder.cc +++ b/media/gpu/vaapi/vaapi_jpeg_decoder.cc
@@ -154,15 +154,11 @@ // Validate the coded size. gfx::Size min_jpeg_resolution; - if (!VaapiWrapper::GetDecodeMinResolution(VAProfileJPEGBaseline, - &min_jpeg_resolution)) { - DLOG(ERROR) << "Could not get the minimum resolution"; - return false; - } gfx::Size max_jpeg_resolution; - if (!VaapiWrapper::GetDecodeMaxResolution(VAProfileJPEGBaseline, - &max_jpeg_resolution)) { - DLOG(ERROR) << "Could not get the maximum resolution"; + if (!VaapiWrapper::GetSupportedResolutions( + VAProfileJPEGBaseline, VaapiWrapper::CodecMode::kDecode, + min_jpeg_resolution, max_jpeg_resolution)) { + DLOG(ERROR) << "Could not get the minimum and maximum resolutions"; return false; } const int actual_jpeg_coded_width =
diff --git a/media/gpu/vaapi/vaapi_jpeg_decoder_unittest.cc b/media/gpu/vaapi/vaapi_jpeg_decoder_unittest.cc index 2130b6a6..730dcb9 100644 --- a/media/gpu/vaapi/vaapi_jpeg_decoder_unittest.cc +++ b/media/gpu/vaapi/vaapi_jpeg_decoder_unittest.cc
@@ -409,11 +409,10 @@ // state is retained. TEST_F(VaapiJpegDecoderTest, DecodeSucceedsForSupportedSizes) { gfx::Size min_supported_size; - ASSERT_TRUE(VaapiWrapper::GetDecodeMinResolution(VAProfileJPEGBaseline, - &min_supported_size)); gfx::Size max_supported_size; - ASSERT_TRUE(VaapiWrapper::GetDecodeMaxResolution(VAProfileJPEGBaseline, - &max_supported_size)); + ASSERT_TRUE(VaapiWrapper::GetSupportedResolutions( + VAProfileJPEGBaseline, VaapiWrapper::CodecMode::kDecode, + min_supported_size, max_supported_size)); // Ensure the maximum supported size is reasonable. ASSERT_GE(max_supported_size.width(), min_supported_size.width()); @@ -597,11 +596,10 @@ // TODO(andrescj): for now, this assumes 4:2:0. Handle other formats. TEST_F(VaapiJpegDecoderTest, DecodeFailsForBelowMinSize) { gfx::Size min_supported_size; - ASSERT_TRUE(VaapiWrapper::GetDecodeMinResolution(VAProfileJPEGBaseline, - &min_supported_size)); gfx::Size max_supported_size; - ASSERT_TRUE(VaapiWrapper::GetDecodeMaxResolution(VAProfileJPEGBaseline, - &max_supported_size)); + ASSERT_TRUE(VaapiWrapper::GetSupportedResolutions( + VAProfileJPEGBaseline, VaapiWrapper::CodecMode::kDecode, + min_supported_size, max_supported_size)); // Ensure the maximum supported size is reasonable. ASSERT_GE(max_supported_size.width(), min_supported_size.width()); @@ -648,11 +646,10 @@ // TODO(andrescj): for now, this assumes 4:2:0. Handle other formats. TEST_F(VaapiJpegDecoderTest, DecodeFailsForAboveMaxSize) { gfx::Size min_supported_size; - ASSERT_TRUE(VaapiWrapper::GetDecodeMinResolution(VAProfileJPEGBaseline, - &min_supported_size)); gfx::Size max_supported_size; - ASSERT_TRUE(VaapiWrapper::GetDecodeMaxResolution(VAProfileJPEGBaseline, - &max_supported_size)); + ASSERT_TRUE(VaapiWrapper::GetSupportedResolutions( + VAProfileJPEGBaseline, VaapiWrapper::CodecMode::kDecode, + min_supported_size, max_supported_size)); // Ensure the maximum supported size is reasonable. ASSERT_GE(max_supported_size.width(), min_supported_size.width());
diff --git a/media/gpu/vaapi/vaapi_unittest.cc b/media/gpu/vaapi/vaapi_unittest.cc index eed260b..226be8f 100644 --- a/media/gpu/vaapi/vaapi_unittest.cc +++ b/media/gpu/vaapi/vaapi_unittest.cc
@@ -779,12 +779,10 @@ } gfx::Size minimum_supported_size; - ASSERT_TRUE(VaapiWrapper::GetDecodeMinResolution(va_profile, - &minimum_supported_size)); gfx::Size maximum_supported_size; - ASSERT_TRUE(VaapiWrapper::GetDecodeMaxResolution(va_profile, - &maximum_supported_size)); - + ASSERT_TRUE(VaapiWrapper::GetSupportedResolutions( + va_profile, VaapiWrapper::CodecMode::kDecode, minimum_supported_size, + maximum_supported_size)); if (resolution.width() < minimum_supported_size.width() || resolution.height() < minimum_supported_size.height() || resolution.width() > maximum_supported_size.width() ||
diff --git a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc index 86464354..e0e98c1 100644 --- a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
@@ -249,25 +249,18 @@ return false; } - if (codec != VideoCodec::kH264) { - switch (config.bitrate.mode()) { - case Bitrate::Mode::kConstant: - break; - case Bitrate::Mode::kVariable: - MEDIA_LOG(ERROR, media_log.get()) - << "Variable bitrate is only supported with H264 encoding."; - return false; - } + if (codec != VideoCodec::kH264 && + config.bitrate.mode() == Bitrate::Mode::kVariable) { + MEDIA_LOG(ERROR, media_log.get()) + << "Variable bitrate is only supported with H264 encoding."; + return false; } - switch (config.input_format) { - case PIXEL_FORMAT_I420: - case PIXEL_FORMAT_NV12: - break; - default: - MEDIA_LOG(ERROR, media_log.get()) - << "Unsupported input format: " << config.input_format; - return false; + if (config.input_format != PIXEL_FORMAT_I420 && + config.input_format != PIXEL_FORMAT_NV12) { + MEDIA_LOG(ERROR, media_log.get()) + << "Unsupported input format: " << config.input_format; + return false; } if (config.storage_type.value_or(Config::StorageType::kShmem) == @@ -329,10 +322,23 @@ output_codec_ = VideoCodecProfileToVideoCodec(config.output_profile); DCHECK_EQ(IsConfiguredForTesting(), !!vaapi_wrapper_); if (!IsConfiguredForTesting()) { - const auto mode = - (output_codec_ == VideoCodec::kVP9 || output_codec_ == VideoCodec::kVP8) - ? VaapiWrapper::kEncodeConstantQuantizationParameter - : VaapiWrapper::kEncodeConstantBitrate; + VaapiWrapper::CodecMode mode; + switch (output_codec_) { + case VideoCodec::kH264: + mode = config.bitrate.mode() == Bitrate::Mode::kConstant + ? VaapiWrapper::kEncodeConstantBitrate + : VaapiWrapper::kEncodeVariableBitrate; + break; + case VideoCodec::kVP8: + case VideoCodec::kVP9: + mode = VaapiWrapper::kEncodeConstantQuantizationParameter; + break; + default: + NOTIFY_ERROR(kInvalidArgumentError, + "Unsupported codec: " + GetCodecName(output_codec_)); + return; + } + vaapi_wrapper_ = VaapiWrapper::CreateForVideoCodec( mode, config.output_profile, EncryptionScheme::kUnencrypted, base::BindRepeating(&ReportVaapiErrorToUMA,
diff --git a/media/gpu/vaapi/vaapi_webp_decoder.cc b/media/gpu/vaapi/vaapi_webp_decoder.cc index 3e8dfab1..afb71b35d 100644 --- a/media/gpu/vaapi/vaapi_webp_decoder.cc +++ b/media/gpu/vaapi/vaapi_webp_decoder.cc
@@ -45,9 +45,11 @@ } gfx::Size min_webp_resolution; - if (!VaapiWrapper::GetDecodeMinResolution(kWebPVAProfile, - &min_webp_resolution)) { - DLOG(ERROR) << "Could not get the minimum resolution"; + gfx::Size max_webp_resolution; + if (!VaapiWrapper::GetSupportedResolutions( + kWebPVAProfile, VaapiWrapper::CodecMode::kDecode, min_webp_resolution, + max_webp_resolution)) { + DLOG(ERROR) << "Could not get the minimum and maximum resolutions"; return false; } if (webp_size.width() < min_webp_resolution.width() || @@ -57,13 +59,6 @@ << min_webp_resolution.ToString(); return false; } - - gfx::Size max_webp_resolution; - if (!VaapiWrapper::GetDecodeMaxResolution(kWebPVAProfile, - &max_webp_resolution)) { - DLOG(ERROR) << "Could not get the maximum resolution"; - return false; - } if (webp_size.width() > max_webp_resolution.width() || webp_size.height() > max_webp_resolution.height()) { DLOG(ERROR) << "VAAPI doesn't support size " << webp_size.ToString()
diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc index 0822e263..d833c2c 100644 --- a/media/gpu/vaapi/vaapi_wrapper.cc +++ b/media/gpu/vaapi/vaapi_wrapper.cc
@@ -975,6 +975,10 @@ // Determines if |mode| supports |va_profile| (and |va_entrypoint| if defined // and valid). If so, returns a const pointer to its ProfileInfo, otherwise // returns nullptr. + // TODO(hiroh): If VAEntrypoint is kVAEntrypointInvalid, the default entry + // point acquired by GetDefaultVaEntryPoint() is used. If the default entry + // point is not supported, the earlier supported entrypoint in + // |kAllowedEntryPopints| is used. const ProfileInfo* IsProfileSupported( VaapiWrapper::CodecMode mode, VAProfile va_profile, @@ -1635,26 +1639,18 @@ } // static -bool VaapiWrapper::GetDecodeMinResolution(VAProfile va_profile, - gfx::Size* min_size) { +bool VaapiWrapper::GetSupportedResolutions(VAProfile va_profile, + CodecMode codec_mode, + gfx::Size& min_size, + gfx::Size& max_size) { const VASupportedProfiles::ProfileInfo* profile_info = - VASupportedProfiles::Get().IsProfileSupported(kDecode, va_profile); - if (!profile_info) - return false; - *min_size = gfx::Size(std::max(1, profile_info->min_resolution.width()), - std::max(1, profile_info->min_resolution.height())); - return true; -} - -// static -bool VaapiWrapper::GetDecodeMaxResolution(VAProfile va_profile, - gfx::Size* max_size) { - const VASupportedProfiles::ProfileInfo* profile_info = - VASupportedProfiles::Get().IsProfileSupported(kDecode, va_profile); - if (!profile_info) + VASupportedProfiles::Get().IsProfileSupported(codec_mode, va_profile); + if (!profile_info || profile_info->max_resolution.IsEmpty()) return false; - *max_size = profile_info->max_resolution; + min_size = gfx::Size(std::max(1, profile_info->min_resolution.width()), + std::max(1, profile_info->min_resolution.height())); + max_size = profile_info->max_resolution; return true; }
diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h index d6feb85..89dd057 100644 --- a/media/gpu/vaapi/vaapi_wrapper.h +++ b/media/gpu/vaapi/vaapi_wrapper.h
@@ -208,18 +208,16 @@ // Returns false if |rt_format| or |va_profile| is not supported for decoding. static bool IsDecodingSupportedForInternalFormat(VAProfile va_profile, unsigned int rt_format); - - // Gets the minimum surface size allowed for decoding using |va_profile|. - // Returns true if the size can be obtained, false otherwise. The minimum - // dimension (width or height) returned is 1. Particularly, if a dimension is - // not reported by the driver, the dimension is returned as 1. - static bool GetDecodeMinResolution(VAProfile va_profile, gfx::Size* min_size); - - // Gets the maximum surface size allowed for decoding using |va_profile|. - // Returns true if the size can be obtained, false otherwise. Because of the - // initialization in VASupportedProfiles::FillProfileInfo_Locked(), the size - // is guaranteed to not be empty (as long as this method returns true). - static bool GetDecodeMaxResolution(VAProfile va_profile, gfx::Size* max_size); + // Gets the minimum and maximum surface sizes allowed for |va_profile| in + // |codec_mode|. Returns true if both sizes can be obtained, false otherwise. + // Each dimension in |min_size| will be at least 1 (as long as this method + // returns true). Additionally, because of the initialization in + // VASupportedProfiles::FillProfileInfo_Locked(), the |max_size| is guaranteed + // to not be empty (as long as this method returns true). + static bool GetSupportedResolutions(VAProfile va_profile, + CodecMode codec_mode, + gfx::Size& min_size, + gfx::Size& max_size); // Obtains a suitable FOURCC that can be used in vaCreateImage() + // vaGetImage(). |rt_format| corresponds to the JPEG's subsampling format.
diff --git a/media/gpu/video_encode_accelerator_perf_tests.cc b/media/gpu/video_encode_accelerator_perf_tests.cc index 5d3a8ca..8095496 100644 --- a/media/gpu/video_encode_accelerator_perf_tests.cc +++ b/media/gpu/video_encode_accelerator_perf_tests.cc
@@ -41,8 +41,8 @@ constexpr const char* usage_msg = R"(usage: video_encode_accelerator_perf_tests [--codec=<codec>] [--num_spatial_layers=<number>] - [--num_temporal_layers=<number>] [--reverse] - [--bitrate=<bitrate>] + [--num_temporal_layers=<number>] [--bitrate_mode=(cbr|vbr)] + [--reverse] [--bitrate=<bitrate>] [-v=<level>] [--vmodule=<config>] [--output_folder] [--disable_vaapi_lock] [--gtest_help] [--help] @@ -70,6 +70,8 @@ if --codec=vp9 currently. --num_temporal_layers the number of temporal layers of the encoded bitstream. A default value is 1. + --bitrate_mode The rate control mode for encoding, one of "cbr" + (default) or "vbr". --reverse the stream plays backwards if the stream reaches end of stream. So the input stream to be encoded is consecutive. By default this is false. @@ -784,6 +786,7 @@ std::string codec = "h264"; size_t num_spatial_layers = 1u; size_t num_temporal_layers = 1u; + media::Bitrate::Mode bitrate_mode = media::Bitrate::Mode::kConstant; bool reverse = false; absl::optional<uint32_t> encode_bitrate; std::vector<base::Feature> disabled_features; @@ -823,6 +826,14 @@ << "\n"; return EXIT_FAILURE; } + } else if (it->first == "bitrate_mode") { + if (it->second == "vbr") { + bitrate_mode = media::Bitrate::Mode::kVariable; + } else if (it->second != "cbr") { + std::cout << "unknown bitrate mode \"" << it->second + << "\", possible values are \"cbr|vbr\"\n"; + return EXIT_FAILURE; + } } else if (it->first == "reverse") { reverse = true; } else if (it->first == "bitrate") { @@ -849,7 +860,7 @@ media::test::VideoEncoderTestEnvironment::Create( video_path, video_metadata_path, false, base::FilePath(output_folder), codec, num_temporal_layers, num_spatial_layers, - false /* output_bitstream */, encode_bitrate, reverse, + false /* output_bitstream */, encode_bitrate, bitrate_mode, reverse, media::test::FrameOutputConfig(), /*enabled_features=*/{}, disabled_features); if (!test_environment)
diff --git a/media/gpu/video_encode_accelerator_tests.cc b/media/gpu/video_encode_accelerator_tests.cc index d4c87a91..c8c21cb9 100644 --- a/media/gpu/video_encode_accelerator_tests.cc +++ b/media/gpu/video_encode_accelerator_tests.cc
@@ -42,8 +42,8 @@ constexpr const char* usage_msg = R"(usage: video_encode_accelerator_tests [--codec=<codec>] [--num_temporal_layers=<number>] - [--num_spatial_layers=<number>] [--reverse] - [--disable_validator] [--output_bitstream] + [--num_spatial_layers=<number>] [--bitrate_mode=(cbr|vbr)] + [--reverse] [--disable_validator] [--output_bitstream] [--output_images=(all|corrupt)] [--output_format=(png|yuv)] [--output_folder=<filepath>] [--output_limit=<number>] [--disable_vaapi_lock] @@ -76,6 +76,8 @@ bitstream. Only used in --codec=vp9 currently. Spatial SVC encoding is applied only in NV12Dmabuf test cases. + --bitrate_mode The rate control mode for encoding, one of "cbr" + (default) or "vbr". --reverse the stream plays backwards if the stream reaches end of stream. So the input stream to be encoded is consecutive. By default this is false. @@ -113,6 +115,7 @@ constexpr size_t kNumFramesToEncodeForBitrateCheck = 300; // Tolerance factor for how encoded bitrate can differ from requested bitrate. constexpr double kBitrateTolerance = 0.1; +constexpr double kVariableBitrateTolerance = 0.3; // The event timeout used in bitrate check tests because encoding 2160p and // validating |kNumFramesToEncodeBitrateCheck| frames take much time. constexpr base::TimeDelta kBitrateCheckEventTimeout = base::Seconds(180); @@ -495,6 +498,11 @@ GTEST_SKIP() << "Skip SHMEM input test cases in spatial SVC encoding"; auto config = GetDefaultConfig(); + const Bitrate::Mode bitrate_mode = config.bitrate_allocation.GetMode(); + if (bitrate_mode == Bitrate::Mode::kVariable) { + config.bitrate_allocation.SetPeakBps(config.bitrate_allocation.GetSumBps() * + 2); + } config.num_frames_to_encode = kNumFramesToEncodeForBitrateCheck; auto encoder = CreateVideoEncoder(g_env->Video(), config); // Set longer event timeout than the default (30 sec) because encoding 2160p @@ -507,14 +515,23 @@ EXPECT_EQ(encoder->GetFlushDoneCount(), 1u); EXPECT_EQ(encoder->GetFrameReleasedCount(), config.num_frames_to_encode); EXPECT_TRUE(encoder->WaitForBitstreamProcessors()); + // TODO(b/181797390): Reconsider bitrate check for VBR encoding if this fails + // on some boards. + const double tolerance = bitrate_mode == Bitrate::Mode::kConstant + ? kBitrateTolerance + : kVariableBitrateTolerance; EXPECT_NEAR(encoder->GetStats().Bitrate(), config.bitrate_allocation.GetSumBps(), - kBitrateTolerance * config.bitrate_allocation.GetSumBps()); + tolerance * config.bitrate_allocation.GetSumBps()); } TEST_F(VideoEncoderTest, BitrateCheck_DynamicBitrate) { if (g_env->SpatialLayers().size() > 1) GTEST_SKIP() << "Skip SHMEM input test cases in spatial SVC encoding"; + if (g_env->Bitrate().GetMode() != Bitrate::Mode::kConstant) { + GTEST_SKIP() + << "Skip Dynamic bitrate change checks for non-CBR bitrate mode"; + } auto config = GetDefaultConfig(); config.num_frames_to_encode = kNumFramesToEncodeForBitrateCheck * 2; @@ -534,10 +551,11 @@ // Encode the video with the second bitrate. const uint32_t second_bitrate = first_bitrate * 3 / 2; encoder->ResetStats(); - encoder->UpdateBitrate(AllocateDefaultBitrateForTesting( - config.num_spatial_layers, - config.num_temporal_layers, second_bitrate, false), - config.framerate); + encoder->UpdateBitrate( + AllocateDefaultBitrateForTesting(config.num_spatial_layers, + config.num_temporal_layers, + second_bitrate, /*uses_vbr=*/false), + config.framerate); encoder->Encode(); EXPECT_TRUE(encoder->WaitForFlushDone()); EXPECT_NEAR(encoder->GetStats().Bitrate(), second_bitrate, @@ -551,6 +569,10 @@ TEST_F(VideoEncoderTest, BitrateCheck_DynamicFramerate) { if (g_env->SpatialLayers().size() > 1) GTEST_SKIP() << "Skip SHMEM input test cases in spatial SVC encoding"; + if (g_env->Bitrate().GetMode() != Bitrate::Mode::kConstant) { + GTEST_SKIP() + << "Skip dynamic framerate change checks for non-CBR bitrate mode"; + } if (auto skip_reason = SupportsDynamicFramerate()) GTEST_SKIP() << *skip_reason; @@ -640,10 +662,12 @@ spatial_layers[0].bitrate_bps /= 4; num_temporal_layers = spatial_layers[0].num_of_temporal_layers; } + bool uses_vbr = g_env->Bitrate().GetMode() == Bitrate::Mode::kVariable; VideoEncoderClientConfig config( nv12_video, g_env->Profile(), spatial_layers, AllocateDefaultBitrateForTesting(/*num_spatial_layers=*/1u, - num_temporal_layers, new_bitrate, false), + num_temporal_layers, new_bitrate, + uses_vbr), g_env->Reverse()); config.output_resolution = output_resolution; config.input_storage_type = @@ -842,6 +866,7 @@ size_t num_spatial_layers = 1u; bool output_bitstream = false; bool reverse = false; + media::Bitrate::Mode bitrate_mode = media::Bitrate::Mode::kConstant; media::test::FrameOutputConfig frame_output_config; base::FilePath output_folder = base::FilePath(base::FilePath::kCurrentDirectory); @@ -870,6 +895,14 @@ std::cout << "invalid number of spatial layers: " << it->second << "\n"; return EXIT_FAILURE; } + } else if (it->first == "bitrate_mode") { + if (it->second == "vbr") { + bitrate_mode = media::Bitrate::Mode::kVariable; + } else if (it->second != "cbr") { + std::cout << "unknown bitrate mode \"" << it->second + << "\", possible values are \"cbr|vbr\"\n"; + return EXIT_FAILURE; + } } else if (it->first == "disable_validator") { enable_bitstream_validator = false; } else if (it->first == "output_bitstream") { @@ -924,7 +957,8 @@ video_path, video_metadata_path, enable_bitstream_validator, output_folder, codec, num_temporal_layers, num_spatial_layers, output_bitstream, - /*output_bitrate=*/absl::nullopt, reverse, frame_output_config, + /*output_bitrate=*/absl::nullopt, bitrate_mode, reverse, + frame_output_config, /*enabled_features=*/{}, disabled_features); if (!test_environment)
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc index e8877d4..925a9f7 100644 --- a/net/http/http_cache_transaction.cc +++ b/net/http/http_cache_transaction.cc
@@ -4,7 +4,7 @@ #include "net/http/http_cache_transaction.h" -#include "build/build_config.h" // For OS_POSIX +#include "build/build_config.h" // For IS_POSIX #if BUILDFLAG(IS_POSIX) #include <unistd.h> @@ -70,6 +70,13 @@ constexpr base::TimeDelta kStaleRevalidateTimeout = base::Seconds(60); +uint64_t GetNextTraceId(HttpCache* cache) { + static uint32_t sNextTraceId = 0; + + DCHECK(cache); + return (reinterpret_cast<uint64_t>(cache) << 32) | sNextTraceId++; +} + // From http://tools.ietf.org/html/draft-ietf-httpbis-p6-cache-21#section-6 // a "non-error response" is one with a 2xx (Successful) or 3xx // (Redirection) status code. @@ -161,7 +168,9 @@ //----------------------------------------------------------------------------- HttpCache::Transaction::Transaction(RequestPriority priority, HttpCache* cache) - : priority_(priority), cache_(cache->GetWeakPtr()) { + : trace_id_(GetNextTraceId(cache)), + priority_(priority), + cache_(cache->GetWeakPtr()) { TRACE_EVENT1("net", "HttpCacheTransaction::Transaction", "priority", RequestPriorityToString(priority)); static_assert(HttpCache::Transaction::kNumValidationHeaders == @@ -212,8 +221,8 @@ DCHECK(request); DCHECK(!callback.is_null()); TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::Start", - net_log.source().id, TRACE_EVENT_FLAG_FLOW_OUT, "url", - request->url.spec()); + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_OUT, + "url", request->url.spec()); // Ensure that we only have one asynchronous call at a time. DCHECK(callback_.is_null()); @@ -311,7 +320,7 @@ int buf_len, CompletionOnceCallback callback) { TRACE_EVENT_WITH_FLOW1( - "net", "HttpCacheTransaction::Read", net_log().source().id, + "net", "HttpCacheTransaction::Read", TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "buf_len", buf_len); DCHECK_EQ(next_state_, STATE_NONE); @@ -616,7 +625,7 @@ void HttpCache::Transaction::WriterAboutToBeRemovedFromEntry(int result) { TRACE_EVENT_WITH_FLOW1( "net", "HttpCacheTransaction::WriterAboutToBeRemovedFromEntry", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); // Since the transaction can no longer access the network transaction, save // all network related info now. @@ -638,7 +647,7 @@ void HttpCache::Transaction::WriteModeTransactionAboutToBecomeReader() { TRACE_EVENT_WITH_FLOW0( "net", "HttpCacheTransaction::WriteModeTransactionAboutToBecomeReader", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); mode_ = READ; if (moved_network_transaction_to_writers_ && @@ -1099,7 +1108,7 @@ int HttpCache::Transaction::DoInitEntry() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoInitEntry", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(!new_entry_); @@ -1119,7 +1128,7 @@ int HttpCache::Transaction::DoOpenOrCreateEntry() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoOpenOrCreateEntry", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(!new_entry_); TransitionToState(STATE_OPEN_OR_CREATE_ENTRY_COMPLETE); @@ -1180,7 +1189,7 @@ int HttpCache::Transaction::DoOpenOrCreateEntryComplete(int result) { TRACE_EVENT_WITH_FLOW1( "net", "HttpCacheTransaction::DoOpenOrCreateEntryComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", (result == OK ? (new_entry_->opened ? "opened" : "created") : "failed")); @@ -1270,7 +1279,7 @@ int HttpCache::Transaction::DoDoomEntry() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoDoomEntry", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); TransitionToState(STATE_DOOM_ENTRY_COMPLETE); cache_pending_ = true; @@ -1281,9 +1290,10 @@ } int HttpCache::Transaction::DoDoomEntryComplete(int result) { - TRACE_EVENT_WITH_FLOW1( - "net", "HttpCacheTransaction::DoDoomEntryComplete", net_log().source().id, - TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); + TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoDoomEntryComplete", + TRACE_ID_LOCAL(trace_id_), + TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, + "result", result); net_log_.EndEventWithNetErrorCode(NetLogEventType::HTTP_CACHE_DOOM_ENTRY, result); cache_pending_ = false; @@ -1295,7 +1305,7 @@ int HttpCache::Transaction::DoCreateEntry() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoCreateEntry", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(!new_entry_); TransitionToState(STATE_CREATE_ENTRY_COMPLETE); @@ -1306,7 +1316,7 @@ int HttpCache::Transaction::DoCreateEntryComplete(int result) { TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoCreateEntryComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); // It is important that we go to STATE_ADD_TO_ENTRY whenever the result is @@ -1349,7 +1359,7 @@ int HttpCache::Transaction::DoAddToEntry() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoAddToEntry", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(new_entry_); cache_pending_ = true; @@ -1425,7 +1435,7 @@ int HttpCache::Transaction::DoAddToEntryComplete(int result) { TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoAddToEntryComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); net_log_.EndEventWithNetErrorCode(NetLogEventType::HTTP_CACHE_ADD_TO_ENTRY, @@ -1496,7 +1506,7 @@ int HttpCache::Transaction::DoDoneHeadersAddToEntryComplete(int result) { TRACE_EVENT_WITH_FLOW1( "net", "HttpCacheTransaction::DoDoneHeadersAddToEntryComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); // This transaction's response headers did not match its ActiveEntry so it // created a new ActiveEntry (new_entry_) to write to (and doomed the old @@ -1527,7 +1537,7 @@ int HttpCache::Transaction::DoCacheReadResponse() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoCacheReadResponse", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(entry_); TransitionToState(STATE_CACHE_READ_RESPONSE_COMPLETE); @@ -1543,7 +1553,7 @@ int HttpCache::Transaction::DoCacheReadResponseComplete(int result) { TRACE_EVENT_WITH_FLOW2("net", "HttpCacheTransaction::DoCacheReadResponseComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result, "io_buf_len", io_buf_len_); net_log_.EndEventWithNetErrorCode(NetLogEventType::HTTP_CACHE_READ_INFO, @@ -1645,7 +1655,7 @@ int HttpCache::Transaction::DoCacheWriteUpdatedPrefetchResponse(int result) { TRACE_EVENT_WITH_FLOW0( "net", "HttpCacheTransaction::DoCacheWriteUpdatedPrefetchResponse", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(updated_prefetch_response_); // TODO(jkarlin): If DoUpdateCachedResponse is also called for this @@ -1660,7 +1670,7 @@ TRACE_EVENT_WITH_FLOW0( "net", "HttpCacheTransaction::DoCacheWriteUpdatedPrefetchResponseComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); updated_prefetch_response_.reset(); TransitionToState(STATE_CACHE_DISPATCH_VALIDATION); @@ -1670,7 +1680,7 @@ int HttpCache::Transaction::DoCacheDispatchValidation() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoCacheDispatchValidation", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); if (!entry_) { // Entry got destroyed when twiddling unused-since-prefetch bit. @@ -1765,7 +1775,7 @@ int HttpCache::Transaction::DoCacheUpdateStaleWhileRevalidateTimeout() { TRACE_EVENT_WITH_FLOW0( "net", "HttpCacheTransaction::DoCacheUpdateStaleWhileRevalidateTimeout", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); response_.stale_revalidate_timeout = cache_->clock_->Now() + kStaleRevalidateTimeout; @@ -1778,7 +1788,7 @@ TRACE_EVENT_WITH_FLOW0( "net", "HttpCacheTransaction::DoCacheUpdateStaleWhileRevalidateTimeoutComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(!reading_); TransitionToState(STATE_CONNECTED_CALLBACK); @@ -1787,7 +1797,7 @@ int HttpCache::Transaction::DoSendRequest() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoSendRequest", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(mode_ & WRITE || mode_ == NONE); DCHECK(!network_trans_.get()); @@ -1826,7 +1836,7 @@ int HttpCache::Transaction::DoSendRequestComplete(int result) { TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoSendRequestComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); if (!cache_.get()) { @@ -1874,7 +1884,7 @@ // We received the response headers and there is no error. int HttpCache::Transaction::DoSuccessfulSendRequest() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoSuccessfulSendRequest", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(!new_response_); const HttpResponseInfo* new_response = network_trans_->GetResponseInfo(); @@ -2001,7 +2011,7 @@ // We received 304 or 206 and we want to update the cached response headers. int HttpCache::Transaction::DoUpdateCachedResponse() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoUpdateCachedResponse", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); int rv = OK; // Update the cached response based on the headers and properties of @@ -2059,7 +2069,7 @@ int HttpCache::Transaction::DoCacheWriteUpdatedResponse() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoCacheWriteUpdatedResponse", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); TransitionToState(STATE_CACHE_WRITE_UPDATED_RESPONSE_COMPLETE); return WriteResponseInfoToEntry(response_, false); @@ -2068,7 +2078,7 @@ int HttpCache::Transaction::DoCacheWriteUpdatedResponseComplete(int result) { TRACE_EVENT_WITH_FLOW0( "net", "HttpCacheTransaction::DoCacheWriteUpdatedResponseComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); TransitionToState(STATE_UPDATE_CACHED_RESPONSE_COMPLETE); return OnWriteResponseInfoToEntryComplete(result); @@ -2077,7 +2087,7 @@ int HttpCache::Transaction::DoUpdateCachedResponseComplete(int result) { TRACE_EVENT_WITH_FLOW1( "net", "HttpCacheTransaction::DoUpdateCachedResponseComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); if (mode_ == UPDATE) { DCHECK(!handling_206_); @@ -2116,7 +2126,7 @@ int HttpCache::Transaction::DoOverwriteCachedResponse() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoOverwriteCachedResponse", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); if (mode_ & READ) { TransitionToState(STATE_PARTIAL_HEADERS_RECEIVED); @@ -2158,7 +2168,7 @@ int HttpCache::Transaction::DoCacheWriteResponse() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoCacheWriteResponse", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); DCHECK(response_.headers); // Invalidate any current entry with a successful response if this transaction @@ -2194,7 +2204,7 @@ int HttpCache::Transaction::DoCacheWriteResponseComplete(int result) { TRACE_EVENT_WITH_FLOW1( "net", "HttpCacheTransaction::DoCacheWriteResponseComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); TransitionToState(STATE_TRUNCATE_CACHED_DATA); return OnWriteResponseInfoToEntryComplete(result); @@ -2202,7 +2212,7 @@ int HttpCache::Transaction::DoTruncateCachedData() { TRACE_EVENT_WITH_FLOW0("net", "HttpCacheTransaction::DoTruncateCachedData", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT); TransitionToState(STATE_TRUNCATE_CACHED_DATA_COMPLETE); if (!entry_) @@ -2217,7 +2227,7 @@ int HttpCache::Transaction::DoTruncateCachedDataComplete(int result) { TRACE_EVENT_WITH_FLOW1( "net", "HttpCacheTransaction::DoTruncateCachedDataComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); if (entry_) { net_log_.EndEventWithNetErrorCode(NetLogEventType::HTTP_CACHE_WRITE_DATA, @@ -2270,7 +2280,7 @@ int HttpCache::Transaction::DoFinishHeaders(int result) { TRACE_EVENT_WITH_FLOW1( - "net", "HttpCacheTransaction::DoFinishHeaders", net_log().source().id, + "net", "HttpCacheTransaction::DoFinishHeaders", TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); if (!cache_.get() || !entry_ || result != OK) { TransitionToState(STATE_NONE); @@ -2303,7 +2313,7 @@ int HttpCache::Transaction::DoFinishHeadersComplete(int rv) { TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoFinishHeadersComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", rv); entry_lock_waiting_since_ = TimeTicks(); @@ -2332,7 +2342,7 @@ int HttpCache::Transaction::DoNetworkReadCacheWrite() { TRACE_EVENT_WITH_FLOW2("net", "HttpCacheTransaction::DoNetworkReadCacheWrite", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "read_offset", read_offset_, "read_buf_len", read_buf_len_); @@ -2344,7 +2354,7 @@ int HttpCache::Transaction::DoNetworkReadCacheWriteComplete(int result) { TRACE_EVENT_WITH_FLOW1( "net", "HttpCacheTransaction::DoNetworkReadCacheWriteComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); if (!cache_.get()) { TransitionToState(STATE_NONE); @@ -2415,7 +2425,7 @@ int HttpCache::Transaction::DoNetworkRead() { TRACE_EVENT_WITH_FLOW2( - "net", "HttpCacheTransaction::DoNetworkRead", net_log().source().id, + "net", "HttpCacheTransaction::DoNetworkRead", TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "read_offset", read_offset_, "read_buf_len", read_buf_len_); TransitionToState(STATE_NETWORK_READ_COMPLETE); @@ -2424,7 +2434,7 @@ int HttpCache::Transaction::DoNetworkReadComplete(int result) { TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoNetworkReadComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); @@ -2442,7 +2452,7 @@ int HttpCache::Transaction::DoCacheReadData() { TRACE_EVENT_WITH_FLOW2( - "net", "HttpCacheTransaction::DoCacheReadData", net_log().source().id, + "net", "HttpCacheTransaction::DoCacheReadData", TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "read_offset", read_offset_, "read_buf_len", read_buf_len_); @@ -2467,7 +2477,7 @@ int HttpCache::Transaction::DoCacheReadDataComplete(int result) { TRACE_EVENT_WITH_FLOW1("net", "HttpCacheTransaction::DoCacheReadDataComplete", - net_log().source().id, + TRACE_ID_LOCAL(trace_id_), TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "result", result); net_log_.EndEventWithNetErrorCode(NetLogEventType::HTTP_CACHE_READ_DATA,
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h index 60829fc..bc5ace70 100644 --- a/net/http/http_cache_transaction.h +++ b/net/http/http_cache_transaction.h
@@ -610,6 +610,9 @@ State next_state_{STATE_NONE}; + // Used for tracing. + const uint64_t trace_id_; + // Initial request with which Start() was invoked. raw_ptr<const HttpRequestInfo> initial_request_ = nullptr;
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc index 27ab29f7..31ba1f7 100644 --- a/ppapi/proxy/ppapi_command_buffer_proxy.cc +++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc
@@ -171,6 +171,12 @@ ppapi::API_ID_PPB_GRAPHICS_3D, resource_, id)); } +void PpapiCommandBufferProxy::ForceLostContext(gpu::error::ContextLostReason) { + // This entry point was added to CommandBuffer well after PPAPI's + // deprecation. No current clients determined its necessity, so it + // will not be implemented. +} + void PpapiCommandBufferProxy::SetLock(base::Lock*) { NOTREACHED(); }
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.h b/ppapi/proxy/ppapi_command_buffer_proxy.h index f1294dda..9dea99e 100644 --- a/ppapi/proxy/ppapi_command_buffer_proxy.h +++ b/ppapi/proxy/ppapi_command_buffer_proxy.h
@@ -58,6 +58,7 @@ gpu::TransferBufferAllocationOption option = gpu::TransferBufferAllocationOption::kLoseContextOnOOM) override; void DestroyTransferBuffer(int32_t id) override; + void ForceLostContext(gpu::error::ContextLostReason reason) override; // gpu::GpuControl implementation: void SetGpuControlClient(gpu::GpuControlClient*) override;
diff --git a/testing/buildbot/chrome.json b/testing/buildbot/chrome.json index 216f751..a81855c 100644 --- a/testing/buildbot/chrome.json +++ b/testing/buildbot/chrome.json
@@ -1789,7 +1789,7 @@ { "args": [], "cros_board": "atlas", - "cros_img": "atlas-release/R103-14816.17.0", + "cros_img": "atlas-release/R104-14909.7.0", "name": "lacros_all_tast_tests ATLAS_RELEASE_DEV", "resultdb": { "enable": true, @@ -1853,7 +1853,7 @@ { "args": [], "cros_board": "eve", - "cros_img": "eve-release/R103-14794.0.0", + "cros_img": "eve-release/R104-14909.7.0", "name": "lacros_all_tast_tests EVE_RELEASE_DEV", "resultdb": { "enable": true, @@ -1962,7 +1962,7 @@ { "args": [], "cros_board": "hana", - "cros_img": "hana-release/R103-14816.17.0", + "cros_img": "hana-release/R104-14909.7.0", "name": "lacros_all_tast_tests HANA_RELEASE_DEV", "resultdb": { "enable": true, @@ -2026,7 +2026,7 @@ { "args": [], "cros_board": "jacuzzi", - "cros_img": "jacuzzi-release/R103-14816.17.0", + "cros_img": "jacuzzi-release/R104-14909.7.0", "name": "lacros_all_tast_tests JACUZZI_RELEASE_DEV", "resultdb": { "enable": true, @@ -2073,7 +2073,7 @@ "--test-launcher-filter-file=../../testing/buildbot/filters/lacros-arm.ozone_unittests.filter" ], "cros_board": "hana", - "cros_img": "hana-release/R103-14816.17.0", + "cros_img": "hana-release/R104-14909.7.0", "name": "ozone_unittests HANA_RELEASE_DEV", "swarming": {}, "test": "ozone_unittests", @@ -2125,7 +2125,7 @@ "--test-launcher-filter-file=../../testing/buildbot/filters/lacros-arm.ozone_unittests.filter" ], "cros_board": "jacuzzi", - "cros_img": "jacuzzi-release/R103-14816.17.0", + "cros_img": "jacuzzi-release/R104-14909.7.0", "name": "ozone_unittests JACUZZI_RELEASE_DEV", "swarming": {}, "test": "ozone_unittests", @@ -2164,7 +2164,7 @@ "--test-launcher-filter-file=../../testing/buildbot/filters/lacros-arm.viz_unittests.filter" ], "cros_board": "hana", - "cros_img": "hana-release/R103-14816.17.0", + "cros_img": "hana-release/R104-14909.7.0", "name": "viz_unittests HANA_RELEASE_DEV", "swarming": {}, "test": "viz_unittests", @@ -2216,7 +2216,7 @@ "--test-launcher-filter-file=../../testing/buildbot/filters/lacros-arm.viz_unittests.filter" ], "cros_board": "jacuzzi", - "cros_img": "jacuzzi-release/R103-14816.17.0", + "cros_img": "jacuzzi-release/R104-14909.7.0", "name": "viz_unittests JACUZZI_RELEASE_DEV", "swarming": {}, "test": "viz_unittests",
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index 29a78a78..7317259 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -8325,15 +8325,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", + "--client-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", - "--client-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--client-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -8359,7 +8359,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.50" + "revision": "version:103.0.5060.52" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -8410,15 +8410,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", + "--client-outdir", + "../../weblayer_instrumentation_test_M104/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", - "--client-outdir", - "../../weblayer_instrumentation_test_M104/out/Release", "--client-version=104", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -8444,7 +8444,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.7" + "revision": "version:104.0.5112.8" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -8835,15 +8835,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--test-expectations", - "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--implementation-outdir", "../../weblayer_instrumentation_test_M103/out/Release", + "--test-expectations", + "../../weblayer/browser/android/javatests/skew/expectations.txt", "--impl-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -8869,7 +8869,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.50" + "revision": "version:103.0.5060.52" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -8920,15 +8920,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--test-expectations", - "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--implementation-outdir", "../../weblayer_instrumentation_test_M104/out/Release", + "--test-expectations", + "../../weblayer/browser/android/javatests/skew/expectations.txt", "--impl-version=104", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -8954,7 +8954,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.7" + "revision": "version:104.0.5112.8" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 0fc8cbb..ac73252 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -46297,15 +46297,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", + "--client-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", - "--client-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--client-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -46331,7 +46331,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.50" + "revision": "version:103.0.5060.52" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -46382,15 +46382,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", + "--client-outdir", + "../../weblayer_instrumentation_test_M104/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", - "--client-outdir", - "../../weblayer_instrumentation_test_M104/out/Release", "--client-version=104", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -46416,7 +46416,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.7" + "revision": "version:104.0.5112.8" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -46807,15 +46807,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--test-expectations", - "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--implementation-outdir", "../../weblayer_instrumentation_test_M103/out/Release", + "--test-expectations", + "../../weblayer/browser/android/javatests/skew/expectations.txt", "--impl-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -46841,7 +46841,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.50" + "revision": "version:103.0.5060.52" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -46892,15 +46892,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--test-expectations", - "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--implementation-outdir", "../../weblayer_instrumentation_test_M104/out/Release", + "--test-expectations", + "../../weblayer/browser/android/javatests/skew/expectations.txt", "--impl-version=104", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -46926,7 +46926,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.7" + "revision": "version:104.0.5112.8" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47321,15 +47321,15 @@ { "args": [ "--additional-apk=apks/ChromePublic.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", + "--client-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", - "--client-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--client-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -47355,7 +47355,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.50" + "revision": "version:103.0.5060.52" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47406,15 +47406,15 @@ { "args": [ "--additional-apk=apks/ChromePublic.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", + "--client-outdir", + "../../weblayer_instrumentation_test_M104/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", - "--client-outdir", - "../../weblayer_instrumentation_test_M104/out/Release", "--client-version=104", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -47440,7 +47440,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.7" + "revision": "version:104.0.5112.8" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47831,15 +47831,15 @@ { "args": [ "--additional-apk=apks/ChromePublic.apk", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--test-expectations", - "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--implementation-outdir", "../../weblayer_instrumentation_test_M103/out/Release", + "--test-expectations", + "../../weblayer/browser/android/javatests/skew/expectations.txt", "--impl-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -47865,7 +47865,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.50" + "revision": "version:103.0.5060.52" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47916,15 +47916,15 @@ { "args": [ "--additional-apk=apks/ChromePublic.apk", + "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--test-expectations", - "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/AOSP_SystemWebView.apk", "--implementation-outdir", "../../weblayer_instrumentation_test_M104/out/Release", + "--test-expectations", + "../../weblayer/browser/android/javatests/skew/expectations.txt", "--impl-version=104", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -47950,7 +47950,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.7" + "revision": "version:104.0.5112.8" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48413,15 +48413,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", + "--client-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", - "--client-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--client-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -48447,7 +48447,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.50" + "revision": "version:103.0.5060.52" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48498,15 +48498,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", + "--client-outdir", + "../../weblayer_instrumentation_test_M104/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", - "--client-outdir", - "../../weblayer_instrumentation_test_M104/out/Release", "--client-version=104", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -48532,7 +48532,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.7" + "revision": "version:104.0.5112.8" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48923,15 +48923,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--test-expectations", - "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", "--implementation-outdir", "../../weblayer_instrumentation_test_M103/out/Release", + "--test-expectations", + "../../weblayer/browser/android/javatests/skew/expectations.txt", "--impl-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -48957,7 +48957,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.50" + "revision": "version:103.0.5060.52" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -49008,15 +49008,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--test-expectations", - "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", "--implementation-outdir", "../../weblayer_instrumentation_test_M104/out/Release", + "--test-expectations", + "../../weblayer/browser/android/javatests/skew/expectations.txt", "--impl-version=104", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -49042,7 +49042,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.7" + "revision": "version:104.0.5112.8" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -49505,15 +49505,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", + "--client-outdir", + "../../weblayer_instrumentation_test_M103/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", - "--client-outdir", - "../../weblayer_instrumentation_test_M103/out/Release", "--client-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -49539,7 +49539,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.50" + "revision": "version:103.0.5060.52" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -49590,15 +49590,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", + "--client-outdir", + "../../weblayer_instrumentation_test_M104/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", - "--client-outdir", - "../../weblayer_instrumentation_test_M104/out/Release", "--client-version=104", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -49624,7 +49624,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.7" + "revision": "version:104.0.5112.8" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -50015,15 +50015,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--test-expectations", - "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", "--implementation-outdir", "../../weblayer_instrumentation_test_M103/out/Release", + "--test-expectations", + "../../weblayer/browser/android/javatests/skew/expectations.txt", "--impl-version=103", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -50049,7 +50049,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M103", - "revision": "version:103.0.5060.50" + "revision": "version:103.0.5060.52" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -50100,15 +50100,15 @@ { "args": [ "--additional-apk=apks/WebLayerShellSystemWebView.apk", + "--webview-apk-path=apks/SystemWebView.apk", "--test-runner-outdir", ".", "--client-outdir", ".", - "--test-expectations", - "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--webview-apk-path=apks/SystemWebView.apk", "--implementation-outdir", "../../weblayer_instrumentation_test_M104/out/Release", + "--test-expectations", + "../../weblayer/browser/android/javatests/skew/expectations.txt", "--impl-version=104", "--gs-results-bucket=chromium-result-details", "--recover-devices", @@ -50134,7 +50134,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M104", - "revision": "version:104.0.5112.7" + "revision": "version:104.0.5112.8" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/internal.chromeos.fyi.json b/testing/buildbot/internal.chromeos.fyi.json index 732bf4d..fcc4ec3 100644 --- a/testing/buildbot/internal.chromeos.fyi.json +++ b/testing/buildbot/internal.chromeos.fyi.json
@@ -1050,7 +1050,7 @@ { "args": [], "cros_board": "octopus", - "cros_img": "octopus-release/R103-14816.17.0", + "cros_img": "octopus-release/R104-14909.7.0", "name": "lacros_fyi_tast_tests OCTOPUS_RELEASE_DEV", "swarming": {}, "tast_expr": "(\"group:mainline\" && \"dep:lacros\" && !informational || \"name:lacros.VariationSmoke\")", @@ -1097,7 +1097,7 @@ { "args": [], "cros_board": "octopus", - "cros_img": "octopus-release/R103-14816.17.0", + "cros_img": "octopus-release/R104-14909.7.0", "name": "ozone_unittests OCTOPUS_RELEASE_DEV", "swarming": {}, "test": "ozone_unittests", @@ -1150,7 +1150,7 @@ { "args": [], "cros_board": "strongbad", - "cros_img": "strongbad-release/R103-14816.17.0", + "cros_img": "strongbad-release/R104-14909.7.0", "name": "lacros_all_tast_tests strongbad_RELEASE_DEV", "swarming": {}, "tast_expr": "(\"group:mainline\" && \"dep:lacros\" && !informational)", @@ -1197,7 +1197,7 @@ { "args": [], "cros_board": "strongbad", - "cros_img": "strongbad-release/R103-14816.17.0", + "cros_img": "strongbad-release/R104-14909.7.0", "name": "ozone_unittests strongbad_RELEASE_DEV", "swarming": {}, "test": "ozone_unittests", @@ -1241,7 +1241,7 @@ { "args": [], "cros_board": "strongbad", - "cros_img": "strongbad-release/R103-14816.17.0", + "cros_img": "strongbad-release/R104-14909.7.0", "name": "viz_unittests strongbad_RELEASE_DEV", "swarming": {}, "test": "viz_unittests",
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 886c49c..8497fbe 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -462,16 +462,16 @@ }, 'WEBLAYER_10_AND_M_IMPL_SKEW_TESTS_NTH_MILESTONE': { 'args': [ + '--webview-apk-path=apks/AOSP_SystemWebView.apk', '--test-runner-outdir', '.', '--client-outdir', '.', - '--test-expectations', - '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--webview-apk-path=apks/AOSP_SystemWebView.apk', '--implementation-outdir', '../../weblayer_instrumentation_test_M104/out/Release', - '--impl-version=104' + '--test-expectations', + '../../weblayer/browser/android/javatests/skew/expectations.txt', + '--impl-version=104', ], 'identifier': 'with_impl_from_104', 'swarming': { @@ -479,23 +479,23 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M104', - 'revision': 'version:104.0.5112.7' + 'revision': 'version:104.0.5112.8', } - ] - } + ], + }, }, 'WEBLAYER_10_AND_M_IMPL_SKEW_TESTS_NTH_MINUS_ONE_MILESTONE': { 'args': [ + '--webview-apk-path=apks/AOSP_SystemWebView.apk', '--test-runner-outdir', '.', '--client-outdir', '.', - '--test-expectations', - '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--webview-apk-path=apks/AOSP_SystemWebView.apk', '--implementation-outdir', '../../weblayer_instrumentation_test_M103/out/Release', - '--impl-version=103' + '--test-expectations', + '../../weblayer/browser/android/javatests/skew/expectations.txt', + '--impl-version=103', ], 'identifier': 'with_impl_from_103', 'swarming': { @@ -503,10 +503,10 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M103', - 'revision': 'version:103.0.5060.50' + 'revision': 'version:103.0.5060.52', } - ] - } + ], + }, }, 'WEBLAYER_10_AND_M_IMPL_SKEW_TESTS_NTH_MINUS_TWO_MILESTONE': { 'args': [ @@ -606,16 +606,16 @@ }, 'WEBLAYER_IMPL_SKEW_TESTS_NTH_MILESTONE': { 'args': [ + '--webview-apk-path=apks/SystemWebView.apk', '--test-runner-outdir', '.', '--client-outdir', '.', - '--test-expectations', - '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--webview-apk-path=apks/SystemWebView.apk', '--implementation-outdir', '../../weblayer_instrumentation_test_M104/out/Release', - '--impl-version=104' + '--test-expectations', + '../../weblayer/browser/android/javatests/skew/expectations.txt', + '--impl-version=104', ], 'identifier': 'with_impl_from_104', 'swarming': { @@ -623,23 +623,23 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M104', - 'revision': 'version:104.0.5112.7' + 'revision': 'version:104.0.5112.8', } - ] - } + ], + }, }, 'WEBLAYER_IMPL_SKEW_TESTS_NTH_MINUS_ONE_MILESTONE': { 'args': [ + '--webview-apk-path=apks/SystemWebView.apk', '--test-runner-outdir', '.', '--client-outdir', '.', - '--test-expectations', - '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--webview-apk-path=apks/SystemWebView.apk', '--implementation-outdir', '../../weblayer_instrumentation_test_M103/out/Release', - '--impl-version=103' + '--test-expectations', + '../../weblayer/browser/android/javatests/skew/expectations.txt', + '--impl-version=103', ], 'identifier': 'with_impl_from_103', 'swarming': { @@ -647,10 +647,10 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M103', - 'revision': 'version:103.0.5060.50' + 'revision': 'version:103.0.5060.52', } - ] - } + ], + }, }, 'WEBLAYER_IMPL_SKEW_TESTS_NTH_MINUS_TWO_MILESTONE': { 'args': [ @@ -750,16 +750,16 @@ }, 'WEBLAYER_CLIENT_SKEW_TESTS_NTH_MILESTONE': { 'args': [ + '--webview-apk-path=apks/SystemWebView.apk', '--test-runner-outdir', '.', + '--client-outdir', + '../../weblayer_instrumentation_test_M104/out/Release', '--implementation-outdir', '.', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--webview-apk-path=apks/SystemWebView.apk', - '--client-outdir', - '../../weblayer_instrumentation_test_M104/out/Release', - '--client-version=104' + '--client-version=104', ], 'identifier': 'with_client_from_104', 'swarming': { @@ -767,23 +767,23 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M104', - 'revision': 'version:104.0.5112.7' + 'revision': 'version:104.0.5112.8', } - ] - } + ], + }, }, 'WEBLAYER_CLIENT_SKEW_TESTS_NTH_MINUS_ONE_MILESTONE': { 'args': [ + '--webview-apk-path=apks/SystemWebView.apk', '--test-runner-outdir', '.', + '--client-outdir', + '../../weblayer_instrumentation_test_M103/out/Release', '--implementation-outdir', '.', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--webview-apk-path=apks/SystemWebView.apk', - '--client-outdir', - '../../weblayer_instrumentation_test_M103/out/Release', - '--client-version=103' + '--client-version=103', ], 'identifier': 'with_client_from_103', 'swarming': { @@ -791,10 +791,10 @@ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M103', - 'revision': 'version:103.0.5060.50' + 'revision': 'version:103.0.5060.52', } - ] - } + ], + }, }, 'WEBLAYER_CLIENT_SKEW_TESTS_NTH_MINUS_TWO_MILESTONE': { 'args': [ @@ -904,8 +904,8 @@ 'CROS_ATLAS_RELEASE_DEV': { 'skylab': { 'cros_board': 'atlas', - 'cros_chrome_version': '103.0.5060.15', - 'cros_img': 'atlas-release/R103-14816.17.0', + 'cros_chrome_version': '104.0.5112.6', + 'cros_img': 'atlas-release/R104-14909.7.0', }, 'enabled': True, 'identifier': 'ATLAS_RELEASE_DEV', @@ -940,8 +940,8 @@ 'CROS_EVE_RELEASE_DEV': { 'skylab': { 'cros_board': 'eve', - 'cros_chrome_version': '103.0.5045.0', - 'cros_img': 'eve-release/R103-14794.0.0', + 'cros_chrome_version': '104.0.5112.6', + 'cros_img': 'eve-release/R104-14909.7.0', }, 'enabled': True, 'identifier': 'EVE_RELEASE_DEV', @@ -985,8 +985,8 @@ 'CROS_HANA_RELEASE_DEV': { 'skylab': { 'cros_board': 'hana', - 'cros_chrome_version': '103.0.5060.15', - 'cros_img': 'hana-release/R103-14816.17.0', + 'cros_chrome_version': '104.0.5112.6', + 'cros_img': 'hana-release/R104-14909.7.0', }, 'enabled': True, 'identifier': 'HANA_RELEASE_DEV', @@ -1021,8 +1021,8 @@ 'CROS_JACUZZI_RELEASE_DEV': { 'skylab': { 'cros_board': 'jacuzzi', - 'cros_chrome_version': '103.0.5060.15', - 'cros_img': 'jacuzzi-release/R103-14816.17.0', + 'cros_chrome_version': '104.0.5112.6', + 'cros_img': 'jacuzzi-release/R104-14909.7.0', }, 'enabled': True, 'identifier': 'JACUZZI_RELEASE_DEV', @@ -1057,8 +1057,8 @@ 'CROS_OCTOPUS_RELEASE_DEV': { 'skylab': { 'cros_board': 'octopus', - 'cros_chrome_version': '103.0.5060.15', - 'cros_img': 'octopus-release/R103-14816.17.0', + 'cros_chrome_version': '104.0.5112.6', + 'cros_img': 'octopus-release/R104-14909.7.0', }, 'enabled': True, 'identifier': 'OCTOPUS_RELEASE_DEV', @@ -1093,8 +1093,8 @@ 'CROS_STRONGBAD_RELEASE_DEV': { 'skylab': { 'cros_board': 'strongbad', - 'cros_chrome_version': '103.0.5060.15', - 'cros_img': 'strongbad-release/R103-14816.17.0', + 'cros_chrome_version': '104.0.5112.6', + 'cros_img': 'strongbad-release/R104-14909.7.0', }, 'enabled': True, 'identifier': 'strongbad_RELEASE_DEV',
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 6b5b62d9..dc82916 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -4948,6 +4948,22 @@ ] } ], + "KeyPinningAndroid": [ + { + "platforms": [ + "android" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "KeyPinningComponentUpdater", + "StaticKeyPinningEnforcement" + ] + } + ] + } + ], "KeyPinningComponentUpdater": [ { "platforms": [
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc index 3cdf088..2400422 100644 --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc
@@ -1529,5 +1529,9 @@ const base::Feature kEarlyExitOnNoopClassOrStyleChange{ "EarlyExitOnNoopClassOrStyleChange", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kDisableArrayBufferSizeLimitsForTesting{ + "DisableArrayBufferSizeLimitsForTesting", + base::FEATURE_DISABLED_BY_DEFAULT}; + } // namespace features } // namespace blink
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h index ddfdbdf..6c009c90 100644 --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h
@@ -775,6 +775,12 @@ BLINK_COMMON_EXPORT extern const base::Feature kEarlyExitOnNoopClassOrStyleChange; +// TODO(https://crbug.com/1201109): temporary flag to disable new ArrayBuffer +// size limits, so that tests can be written against code receiving these +// buffers. Remove when the bindings code instituting these limits is removed. +BLINK_COMMON_EXPORT extern const base::Feature + kDisableArrayBufferSizeLimitsForTesting; + } // namespace features } // namespace blink
diff --git a/third_party/blink/public/mojom/input/synchronous_compositor.mojom b/third_party/blink/public/mojom/input/synchronous_compositor.mojom index 0e4caa0..feaae919 100644 --- a/third_party/blink/public/mojom/input/synchronous_compositor.mojom +++ b/third_party/blink/public/mojom/input/synchronous_compositor.mojom
@@ -101,6 +101,11 @@ ReclaimResources(uint32 layer_tree_frame_sink_id, array<viz.mojom.ReturnedResource> resources); + // Notifies the client when a directive for DocumentTransition, submitted in + // a previous CompositorFrame, has finished executing. + OnCompositorFrameTransitionDirectiveProcessed(uint32 layer_tree_frame_sink_id, + uint32 sequence_id); + // Adjust the scroll to the given offset. SetScroll(gfx.mojom.PointF offset);
diff --git a/third_party/blink/renderer/bindings/core/v8/native_value_traits_buffer_sources.cc b/third_party/blink/renderer/bindings/core/v8/native_value_traits_buffer_sources.cc index e300ef1..5bdaffd 100644 --- a/third_party/blink/renderer/bindings/core/v8/native_value_traits_buffer_sources.cc +++ b/third_party/blink/renderer/bindings/core/v8/native_value_traits_buffer_sources.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "third_party/blink/public/common/features.h" #include "third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" @@ -218,7 +219,9 @@ if (LIKELY(array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -242,7 +245,9 @@ if (LIKELY(array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -267,7 +272,9 @@ if (LIKELY(array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -294,7 +301,9 @@ if (LIKELY(array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -323,7 +332,9 @@ if (LIKELY(shared_array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(shared_array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -348,7 +359,9 @@ if (LIKELY(shared_array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(shared_array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -375,7 +388,9 @@ if (LIKELY(shared_array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(shared_array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -404,7 +419,9 @@ if (LIKELY(shared_array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(shared_array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -432,7 +449,9 @@ if (LIKELY(array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -447,7 +466,9 @@ if (LIKELY(shared_array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(shared_array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -471,7 +492,9 @@ if (LIKELY(array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -486,7 +509,9 @@ if (LIKELY(shared_array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(shared_array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -512,7 +537,9 @@ if (LIKELY(array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -527,7 +554,9 @@ if (LIKELY(shared_array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(shared_array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -555,7 +584,9 @@ if (LIKELY(array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -570,7 +601,9 @@ if (LIKELY(shared_array_buffer)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(shared_array_buffer->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -601,7 +634,9 @@ if (LIKELY(blink_view)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(blink_view->byteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -635,7 +670,9 @@ if (LIKELY(blink_view)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(blink_view->byteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -670,7 +707,9 @@ if (LIKELY(blink_view)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(blink_view->byteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -697,7 +736,9 @@ if (LIKELY(blink_view)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(blink_view->byteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -725,7 +766,9 @@ if (LIKELY(blink_view)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(blink_view->byteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -762,7 +805,9 @@ if (LIKELY(blink_view)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(blink_view->byteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -800,7 +845,9 @@ if (LIKELY(blink_view)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(blink_view->byteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -830,7 +877,9 @@ if (LIKELY(blink_view)) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(blink_view->byteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -861,7 +910,9 @@ if (LIKELY(ABVTrait<T>::IsV8ViewType(value))) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(value.As<typename ABVTrait<T>::V8ViewType>()->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError( @@ -890,7 +941,9 @@ if (LIKELY(ABVTrait<T>::IsV8ViewType(value))) { // TODO(chromium:1201109): Remove check once Blink can handle bigger sizes. if (UNLIKELY(value.As<typename ABVTrait<T>::V8ViewType>()->ByteLength() > - ::partition_alloc::internal::MaxDirectMapped())) { + ::partition_alloc::internal::MaxDirectMapped()) && + !base::FeatureList::IsEnabled( + features::kDisableArrayBufferSizeLimitsForTesting)) { UseCounter::Count(ExecutionContext::From(isolate->GetCurrentContext()), WebFeature::kArrayBufferTooBigForWebAPI); exception_state.ThrowRangeError(
diff --git a/third_party/blink/renderer/bindings/generated_in_modules.gni b/third_party/blink/renderer/bindings/generated_in_modules.gni index 35d870a..64b31e70 100644 --- a/third_party/blink/renderer/bindings/generated_in_modules.gni +++ b/third_party/blink/renderer/bindings/generated_in_modules.gni
@@ -1050,8 +1050,6 @@ "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_app_banner_prompt_outcome.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_append_mode.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_append_mode.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_attestation_conveyance_preference.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_attestation_conveyance_preference.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_audio_context_latency_category.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_audio_context_latency_category.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_audio_context_state.cc",
diff --git a/third_party/blink/renderer/build/scripts/core/css/parser/templates/css.proto.tmpl b/third_party/blink/renderer/build/scripts/core/css/parser/templates/css.proto.tmpl index f19ea1f2..4570abf 100644 --- a/third_party/blink/renderer/build/scripts/core/css/parser/templates/css.proto.tmpl +++ b/third_party/blink/renderer/build/scripts/core/css/parser/templates/css.proto.tmpl
@@ -951,7 +951,7 @@ _INTERNAL_LIST_BOX = 4; _INTERNAL_MEDIA_CONTROLS_OVERLAY_CAST_BUTTON = 5; _INTERNAL_MULTI_SELECT_FOCUS = 6; - _INTERNAL_POPUP_OPEN = 7; + _INTERNAL_POPUP_HIDDEN = 7; _INTERNAL_SHADOW_HOST_HAS_APPEARANCE = 8; _INTERNAL_SPATIAL_NAVIGATION_FOCUS = 9; _INTERNAL_VIDEO_PERSISTENT = 10; @@ -1023,21 +1023,22 @@ SINGLE_BUTTON = 76; START = 77; TARGET = 78; - VALID = 79; - VERTICAL = 80; - VISITED = 81; - WINDOW_INACTIVE = 82; - _WEBKIT_ANY = 83; - HOST_CONTEXT = 84; - LANG = 85; - NOT = 86; - NTH_CHILD = 87; - NTH_LAST_CHILD = 88; - NTH_LAST_OF_TYPE = 89; - NTH_OF_TYPE = 90; - SLOTTED = 91; - XR_OVERLAY = 92; - INVALID_PSEUDO_VALUE = 93; + TOP_LAYER = 79; + VALID = 80; + VERTICAL = 81; + VISITED = 82; + WINDOW_INACTIVE = 83; + _WEBKIT_ANY = 84; + HOST_CONTEXT = 85; + LANG = 86; + NOT = 87; + NTH_CHILD = 88; + NTH_LAST_CHILD = 89; + NTH_LAST_OF_TYPE = 90; + NTH_OF_TYPE = 91; + SLOTTED = 92; + XR_OVERLAY = 93; + INVALID_PSEUDO_VALUE = 94; } optional PseudoValueId pseudo_value_id = 4; required Combinator combinator = 5;
diff --git a/third_party/blink/renderer/core/animation/BUILD.gn b/third_party/blink/renderer/core/animation/BUILD.gn index 02fbe1789..ae3d568e 100644 --- a/third_party/blink/renderer/core/animation/BUILD.gn +++ b/third_party/blink/renderer/core/animation/BUILD.gn
@@ -96,8 +96,6 @@ "css_font_variation_settings_interpolation_type.h", "css_font_weight_interpolation_type.cc", "css_font_weight_interpolation_type.h", - "css_grid_template_property_interpolation_type.cc", - "css_grid_template_property_interpolation_type.h", "css_image_interpolation_type.cc", "css_image_interpolation_type.h", "css_image_list_interpolation_type.cc", @@ -176,14 +174,6 @@ "interpolable_aspect_ratio.h", "interpolable_filter.cc", "interpolable_filter.h", - "interpolable_grid_length.cc", - "interpolable_grid_length.h", - "interpolable_grid_track_list.cc", - "interpolable_grid_track_list.h", - "interpolable_grid_track_repeater.cc", - "interpolable_grid_track_repeater.h", - "interpolable_grid_track_size.cc", - "interpolable_grid_track_size.h", "interpolable_length.cc", "interpolable_length.h", "interpolable_shadow.cc",
diff --git a/third_party/blink/renderer/core/animation/animatable.cc b/third_party/blink/renderer/core/animation/animatable.cc index fe3ef660..7a92c788 100644 --- a/third_party/blink/renderer/core/animation/animatable.cc +++ b/third_party/blink/renderer/core/animation/animatable.cc
@@ -138,14 +138,20 @@ HeapVector<Member<Animation>> Animatable::getAnimations( GetAnimationsOptions* options) { bool use_subtree = options && options->subtree(); + return GetAnimationsInternal( + GetAnimationsOptionsResolved{.use_subtree = use_subtree}); +} + +HeapVector<Member<Animation>> Animatable::GetAnimationsInternal( + GetAnimationsOptionsResolved options) { Element* element = GetAnimationTarget(); - if (use_subtree) + if (options.use_subtree) element->GetDocument().UpdateStyleAndLayoutTreeForSubtree(element); else element->GetDocument().UpdateStyleAndLayoutTreeForNode(element); HeapVector<Member<Animation>> animations; - if (!use_subtree && !element->HasAnimations()) + if (!options.use_subtree && !element->HasAnimations()) return animations; for (const auto& animation : @@ -154,7 +160,8 @@ DCHECK(animation->effect()); // TODO(gtsteel) make this use the idl properties Element* target = To<KeyframeEffect>(animation->effect())->EffectTarget(); - if (element == target || (use_subtree && element->contains(target))) { + if (element == target || + (options.use_subtree && element->contains(target))) { // DocumentAnimations::getAnimations should only give us animations that // are either current or in effect. DCHECK(animation->effect()->IsCurrent() ||
diff --git a/third_party/blink/renderer/core/animation/animatable.h b/third_party/blink/renderer/core/animation/animatable.h index 568af80..bb4c89d9 100644 --- a/third_party/blink/renderer/core/animation/animatable.h +++ b/third_party/blink/renderer/core/animation/animatable.h
@@ -45,6 +45,10 @@ class ScriptValue; class V8UnionKeyframeAnimationOptionsOrUnrestrictedDouble; +struct GetAnimationsOptionsResolved { + bool use_subtree; +}; + // https://drafts.csswg.org/web-animations-1/#the-animatable-interface-mixin class CORE_EXPORT Animatable { public: @@ -62,6 +66,9 @@ HeapVector<Member<Animation>> getAnimations( GetAnimationsOptions* options = nullptr); + + HeapVector<Member<Animation>> GetAnimationsInternal( + GetAnimationsOptionsResolved options); }; } // namespace blink
diff --git a/third_party/blink/renderer/core/animation/css_grid_template_property_interpolation_type.cc b/third_party/blink/renderer/core/animation/css_grid_template_property_interpolation_type.cc deleted file mode 100644 index 1891f96..0000000 --- a/third_party/blink/renderer/core/animation/css_grid_template_property_interpolation_type.cc +++ /dev/null
@@ -1,312 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "third_party/blink/renderer/core/animation/css_grid_template_property_interpolation_type.h" - -#include <memory> -#include <utility> - -#include "base/memory/ptr_util.h" -#include "third_party/blink/renderer/core/animation/interpolable_grid_track_list.h" -#include "third_party/blink/renderer/core/css/resolver/style_builder_converter.h" -#include "third_party/blink/renderer/core/css/resolver/style_resolver.h" -#include "third_party/blink/renderer/core/css/resolver/style_resolver_state.h" -#include "third_party/blink/renderer/core/style/computed_grid_track_list.h" -#include "third_party/blink/renderer/core/style/computed_style.h" - -namespace blink { - -class CSSGridTrackListNonInterpolableValue final : public NonInterpolableValue { - public: - ~CSSGridTrackListNonInterpolableValue() final = default; - - static scoped_refptr<CSSGridTrackListNonInterpolableValue> Create( - NamedGridLinesMap named_grid_lines, - OrderedNamedGridLines ordered_named_grid_lines) { - return base::AdoptRef(new CSSGridTrackListNonInterpolableValue( - std::move(named_grid_lines), std::move(ordered_named_grid_lines), - NamedGridLinesMap(), OrderedNamedGridLines())); - } - - static scoped_refptr<CSSGridTrackListNonInterpolableValue> Create( - const CSSGridTrackListNonInterpolableValue& start, - const CSSGridTrackListNonInterpolableValue& end) { - return base::AdoptRef(new CSSGridTrackListNonInterpolableValue( - start.GetNamedGridLines(), start.GetOrderedNamedGridLines(), - end.GetNamedGridLines(), end.GetOrderedNamedGridLines())); - } - - bool Equals(const CSSGridTrackListNonInterpolableValue& other) const { - return named_grid_lines_from_ == other.named_grid_lines_from_ && - ordered_named_grid_lines_from_ == - other.ordered_named_grid_lines_from_ && - named_grid_lines_to_ == other.named_grid_lines_to_ && - ordered_named_grid_lines_to_ == other.ordered_named_grid_lines_to_; - } - - const NamedGridLinesMap& GetNamedGridLines() const { - return named_grid_lines_from_; - } - const OrderedNamedGridLines& GetOrderedNamedGridLines() const { - return ordered_named_grid_lines_from_; - } - - const NamedGridLinesMap& GetCurrentNamedGridLines(double progress) const { - return (progress < 0.5) ? named_grid_lines_from_ : named_grid_lines_to_; - } - const OrderedNamedGridLines& GetCurrentOrderedNamedGridLines( - double progress) const { - return (progress < 0.5) ? ordered_named_grid_lines_from_ - : ordered_named_grid_lines_to_; - } - - DECLARE_NON_INTERPOLABLE_VALUE_TYPE(); - - private: - explicit CSSGridTrackListNonInterpolableValue( - NamedGridLinesMap named_grid_lines_from, - OrderedNamedGridLines ordered_named_grid_lines_from, - NamedGridLinesMap named_grid_lines_to, - OrderedNamedGridLines ordered_named_grid_lines_to) - : named_grid_lines_from_(std::move(named_grid_lines_from)), - ordered_named_grid_lines_from_( - std::move(ordered_named_grid_lines_from)), - named_grid_lines_to_(std::move(named_grid_lines_to)), - ordered_named_grid_lines_to_(std::move(ordered_named_grid_lines_to)) {} - - // For the first half of the interpolation, we return the 'from' values for - // named grid lines. For the second half, we return the 'to' values. As the - // named grid lines 'from' and 'to' values and its size may be different, we - // have to cache both and return the appropriate value given the - // interpolation's progress. - NamedGridLinesMap named_grid_lines_from_; - OrderedNamedGridLines ordered_named_grid_lines_from_; - NamedGridLinesMap named_grid_lines_to_; - OrderedNamedGridLines ordered_named_grid_lines_to_; -}; - -DEFINE_NON_INTERPOLABLE_VALUE_TYPE(CSSGridTrackListNonInterpolableValue); - -template <> -struct DowncastTraits<CSSGridTrackListNonInterpolableValue> { - static bool AllowFrom(const NonInterpolableValue* value) { - return value && AllowFrom(*value); - } - static bool AllowFrom(const NonInterpolableValue& value) { - return value.GetType() == - CSSGridTrackListNonInterpolableValue::static_type_; - } -}; - -class UnderlyingGridTrackListChecker final - : public CSSInterpolationType::CSSConversionChecker { - public: - explicit UnderlyingGridTrackListChecker(const InterpolationValue& underlying) - : underlying_(underlying.Clone()) {} - ~UnderlyingGridTrackListChecker() final = default; - - private: - bool IsValid(const StyleResolverState&, - const InterpolationValue& underlying) const final { - return To<InterpolableGridTrackList>(*underlying_.interpolable_value) - .Equals(To<InterpolableGridTrackList>( - *underlying.interpolable_value)) && - To<CSSGridTrackListNonInterpolableValue>( - *underlying_.non_interpolable_value) - .Equals(To<CSSGridTrackListNonInterpolableValue>( - *underlying.non_interpolable_value)); - } - - const InterpolationValue underlying_; -}; - -class InheritedGridTrackListChecker - : public CSSInterpolationType::CSSConversionChecker { - public: - explicit InheritedGridTrackListChecker(const NGGridTrackList& track_list, - const CSSPropertyID& property_id) - : track_list_(track_list), property_id_(property_id) {} - - private: - bool IsValid(const StyleResolverState& state, - const InterpolationValue&) const final { - const ComputedStyle& style = *state.ParentStyle(); - const NGGridTrackList& state_track_list = - (property_id_ == CSSPropertyID::kGridTemplateColumns) - ? style.GridTemplateColumns().track_sizes.NGTrackList() - : style.GridTemplateRows().track_sizes.NGTrackList(); - - if (track_list_.HasAutoRepeater() || state_track_list.HasAutoRepeater() || - track_list_.RepeaterCount() != state_track_list.RepeaterCount() || - track_list_.TrackCountWithoutAutoRepeat() != - state_track_list.TrackCountWithoutAutoRepeat()) { - return false; - } - - for (wtf_size_t i = 0; i < track_list_.RepeaterCount(); ++i) { - if (!(track_list_.RepeatType(i) == state_track_list.RepeatType(i) && - track_list_.RepeatCount(i, 0) == - state_track_list.RepeatCount(i, 0) && - track_list_.RepeatSize(i) == state_track_list.RepeatSize(i))) { - return false; - } - } - return true; - } - - const NGGridTrackList track_list_; - const CSSPropertyID property_id_; -}; - -// static -std::unique_ptr<InterpolableValue> -CSSGridTemplatePropertyInterpolationType::CreateInterpolableGridTrackList( - const NGGridTrackList& track_list) { - return InterpolableGridTrackList::MaybeCreate(track_list); -} - -PairwiseInterpolationValue -CSSGridTemplatePropertyInterpolationType::MaybeMergeSingles( - InterpolationValue&& start, - InterpolationValue&& end) const { - if (!To<InterpolableGridTrackList>(*start.interpolable_value) - .IsCompatibleWith( - To<InterpolableGridTrackList>(*end.interpolable_value))) { - return nullptr; - } - return PairwiseInterpolationValue( - std::move(start.interpolable_value), std::move(end.interpolable_value), - CSSGridTrackListNonInterpolableValue::Create( - To<CSSGridTrackListNonInterpolableValue>( - *start.non_interpolable_value), - To<CSSGridTrackListNonInterpolableValue>( - *end.non_interpolable_value))); -} - -InterpolationValue -CSSGridTemplatePropertyInterpolationType::MaybeConvertNeutral( - const InterpolationValue& underlying, - ConversionCheckers& conversion_checkers) const { - conversion_checkers.push_back( - std::make_unique<UnderlyingGridTrackListChecker>(underlying)); - return InterpolationValue(underlying.interpolable_value->CloneAndZero(), - underlying.non_interpolable_value); -} - -InterpolationValue -CSSGridTemplatePropertyInterpolationType::MaybeConvertInitial( - const StyleResolverState& state, - ConversionCheckers&) const { - // 'none' cannot be interpolated. - return nullptr; -} - -InterpolationValue -CSSGridTemplatePropertyInterpolationType::MaybeConvertInherit( - const StyleResolverState& state, - ConversionCheckers& conversion_checkers) const { - const ComputedStyle* parent_style = state.ParentStyle(); - if (!parent_style) - return nullptr; - - const ComputedGridTrackList& parent_computed_grid_track_list = - (property_id_ == CSSPropertyID::kGridTemplateColumns) - ? parent_style->GridTemplateColumns() - : parent_style->GridTemplateRows(); - const NGGridTrackList& parent_track_list = - parent_computed_grid_track_list.track_sizes.NGTrackList(); - - conversion_checkers.push_back(std::make_unique<InheritedGridTrackListChecker>( - parent_track_list, property_id_)); - return InterpolationValue( - CreateInterpolableGridTrackList(parent_track_list), - CSSGridTrackListNonInterpolableValue::Create( - parent_computed_grid_track_list.named_grid_lines, - parent_computed_grid_track_list.ordered_named_grid_lines)); -} - -InterpolationValue CSSGridTemplatePropertyInterpolationType:: - MaybeConvertStandardPropertyUnderlyingValue( - const ComputedStyle& style) const { - const ComputedGridTrackList& computed_grid_track_list = - (property_id_ == CSSPropertyID::kGridTemplateColumns) - ? style.GridTemplateColumns() - : style.GridTemplateRows(); - return InterpolationValue( - CreateInterpolableGridTrackList( - computed_grid_track_list.track_sizes.NGTrackList()), - CSSGridTrackListNonInterpolableValue::Create( - computed_grid_track_list.named_grid_lines, - computed_grid_track_list.ordered_named_grid_lines)); -} - -InterpolationValue CSSGridTemplatePropertyInterpolationType::MaybeConvertValue( - const CSSValue& value, - const StyleResolverState* state, - ConversionCheckers&) const { - if (auto* identifier_value = DynamicTo<CSSIdentifierValue>(value)) { - DCHECK_EQ(identifier_value->GetValueID(), CSSValueID::kNone); - return InterpolationValue(nullptr); - } - - ComputedGridTrackList computed_grid_track_list; - StyleBuilderConverter::ConvertGridTrackList( - value, computed_grid_track_list, *const_cast<StyleResolverState*>(state)); - return InterpolationValue( - CreateInterpolableGridTrackList( - computed_grid_track_list.track_sizes.NGTrackList()), - CSSGridTrackListNonInterpolableValue::Create( - computed_grid_track_list.named_grid_lines, - computed_grid_track_list.ordered_named_grid_lines)); -} - -void CSSGridTemplatePropertyInterpolationType::ApplyStandardPropertyValue( - const InterpolableValue& interpolable_value, - const NonInterpolableValue* non_interpolable_value, - StyleResolverState& state) const { - const InterpolableGridTrackList& interpolable_grid_track_list = - To<InterpolableGridTrackList>(interpolable_value); - const CSSGridTrackListNonInterpolableValue* non_interoplable_grid_track_list = - To<CSSGridTrackListNonInterpolableValue>(non_interpolable_value); - - double progress = interpolable_grid_track_list.GetProgress(); - bool is_for_columns = property_id_ == CSSPropertyID::kGridTemplateColumns; - ComputedStyle* style = state.Style(); - CSSToLengthConversionData conversion_data = state.CssToLengthConversionData(); - ComputedGridTrackList computed_grid_track_list( - is_for_columns ? style->GridTemplateColumns() - : style->GridTemplateRows()); - - computed_grid_track_list.track_sizes.SetNGGridTrackList( - interpolable_grid_track_list.CreateNGGridTrackList(conversion_data)); - computed_grid_track_list.named_grid_lines = - non_interoplable_grid_track_list->GetCurrentNamedGridLines(progress); - computed_grid_track_list.ordered_named_grid_lines = - non_interoplable_grid_track_list->GetCurrentOrderedNamedGridLines( - progress); - - if (is_for_columns) - style->SetGridTemplateColumns(computed_grid_track_list); - else - style->SetGridTemplateRows(computed_grid_track_list); -} - -void CSSGridTemplatePropertyInterpolationType::Composite( - UnderlyingValueOwner& underlying_value_owner, - double underlying_fraction, - const InterpolationValue& value, - double interpolation_fraction) const { - if (!To<InterpolableGridTrackList>( - *underlying_value_owner.Value().interpolable_value) - .IsCompatibleWith( - To<InterpolableGridTrackList>(*value.interpolable_value))) { - underlying_value_owner.Set(*this, value); - return; - } - underlying_value_owner.SetNonInterpolableValue(value.non_interpolable_value); - underlying_value_owner.MutableValue().interpolable_value->ScaleAndAdd( - underlying_fraction, *value.interpolable_value); -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/animation/css_grid_template_property_interpolation_type.h b/third_party/blink/renderer/core/animation/css_grid_template_property_interpolation_type.h deleted file mode 100644 index 8f4f73c..0000000 --- a/third_party/blink/renderer/core/animation/css_grid_template_property_interpolation_type.h +++ /dev/null
@@ -1,53 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_CSS_GRID_TEMPLATE_PROPERTY_INTERPOLATION_TYPE_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_CSS_GRID_TEMPLATE_PROPERTY_INTERPOLATION_TYPE_H_ - -#include "third_party/blink/renderer/core/animation/css_interpolation_type.h" - -namespace blink { - -class CSSGridTemplatePropertyInterpolationType : public CSSInterpolationType { - public: - explicit CSSGridTemplatePropertyInterpolationType(PropertyHandle property) - : CSSInterpolationType(property) { - property_id_ = property.GetCSSProperty().PropertyID(); - DCHECK(property_id_ == CSSPropertyID::kGridTemplateColumns || - property_id_ == CSSPropertyID::kGridTemplateRows); - } - - InterpolationValue MaybeConvertStandardPropertyUnderlyingValue( - const ComputedStyle&) const final; - PairwiseInterpolationValue MaybeMergeSingles( - InterpolationValue&& start, - InterpolationValue&& end) const final; - void ApplyStandardPropertyValue(const InterpolableValue&, - const NonInterpolableValue*, - StyleResolverState&) const final; - void Composite(UnderlyingValueOwner& underlying_value_owner, - double underlying_fraction, - const InterpolationValue& value, - double interpolation_fraction) const final; - - static std::unique_ptr<InterpolableValue> CreateInterpolableGridTrackList( - const NGGridTrackList& track_list); - - private: - InterpolationValue MaybeConvertNeutral(const InterpolationValue& underlying, - ConversionCheckers&) const final; - InterpolationValue MaybeConvertInitial(const StyleResolverState&, - ConversionCheckers&) const final; - InterpolationValue MaybeConvertInherit(const StyleResolverState&, - ConversionCheckers&) const final; - InterpolationValue MaybeConvertValue(const CSSValue&, - const StyleResolverState*, - ConversionCheckers&) const final; - - CSSPropertyID property_id_; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_CSS_GRID_TRACK_LIST_INTERPOLATION_TYPE_H_
diff --git a/third_party/blink/renderer/core/animation/css_interpolation_types_map.cc b/third_party/blink/renderer/core/animation/css_interpolation_types_map.cc index 43cae1d..f3f2c0d1 100644 --- a/third_party/blink/renderer/core/animation/css_interpolation_types_map.cc +++ b/third_party/blink/renderer/core/animation/css_interpolation_types_map.cc
@@ -22,7 +22,6 @@ #include "third_party/blink/renderer/core/animation/css_font_stretch_interpolation_type.h" #include "third_party/blink/renderer/core/animation/css_font_variation_settings_interpolation_type.h" #include "third_party/blink/renderer/core/animation/css_font_weight_interpolation_type.h" -#include "third_party/blink/renderer/core/animation/css_grid_template_property_interpolation_type.h" #include "third_party/blink/renderer/core/animation/css_image_interpolation_type.h" #include "third_party/blink/renderer/core/animation/css_image_list_interpolation_type.h" #include "third_party/blink/renderer/core/animation/css_image_slice_interpolation_type.h" @@ -57,7 +56,6 @@ #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/permissions_policy/layout_animations_policy.h" -#include "third_party/blink/renderer/platform/runtime_enabled_features.h" namespace blink { @@ -190,15 +188,6 @@ applicable_types->push_back( std::make_unique<CSSAspectRatioInterpolationType>(used_property)); break; - case CSSPropertyID::kGridTemplateColumns: - case CSSPropertyID::kGridTemplateRows: - if (RuntimeEnabledFeatures:: - CSSGridTemplatePropertyInterpolationEnabled()) { - applicable_types->push_back( - std::make_unique<CSSGridTemplatePropertyInterpolationType>( - used_property)); - } - break; case CSSPropertyID::kContainIntrinsicWidth: case CSSPropertyID::kContainIntrinsicHeight: applicable_types->push_back(
diff --git a/third_party/blink/renderer/core/animation/interpolable_grid_length.cc b/third_party/blink/renderer/core/animation/interpolable_grid_length.cc deleted file mode 100644 index 114d085..0000000 --- a/third_party/blink/renderer/core/animation/interpolable_grid_length.cc +++ /dev/null
@@ -1,172 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "third_party/blink/renderer/core/animation/interpolable_grid_length.h" - -#include <memory> -#include "third_party/blink/renderer/core/animation/interpolable_length.h" - -namespace blink { - -namespace { - -InterpolableGridLength::InterpolableGridLengthType -GetInterpolableGridLengthType(const Length& length) { - switch (length.GetType()) { - case Length::kAuto: - return InterpolableGridLength::kAuto; - case Length::kMinContent: - return InterpolableGridLength::kMinContent; - case Length::kMaxContent: - return InterpolableGridLength::kMaxContent; - default: - return InterpolableGridLength::kLength; - } -} - -Length CreateContentSizedLength( - const InterpolableGridLength::InterpolableGridLengthType& type) { - switch (type) { - case InterpolableGridLength::kAuto: - return Length(Length::kAuto); - case InterpolableGridLength::kMinContent: - return Length(Length::kMinContent); - case InterpolableGridLength::kMaxContent: - return Length(Length::kMaxContent); - default: - NOTREACHED(); - return Length(Length::kFixed); - } -} -} // namespace - -InterpolableGridLength::InterpolableGridLength( - std::unique_ptr<InterpolableValue> value, - InterpolableGridLengthType type) - : value_(std::move(value)), type_(type) { - DCHECK(value_ || IsContentSized()); -} - -// static -std::unique_ptr<InterpolableGridLength> InterpolableGridLength::Create( - const GridLength& grid_length) { - std::unique_ptr<InterpolableValue> value; - InterpolableGridLengthType type; - Length length(Length::kAuto); - if (grid_length.IsLength()) { - length = grid_length.length(); - value = grid_length.IsContentSized() - ? nullptr - : InterpolableLength::MaybeConvertLength(length, 1); - type = GetInterpolableGridLengthType(length); - } else { - value = std::make_unique<InterpolableNumber>(grid_length.Flex()); - type = kFlex; - } - return std::make_unique<InterpolableGridLength>(std::move(value), type); -} - -GridLength InterpolableGridLength::CreateGridLength( - const CSSToLengthConversionData& conversion_data) const { - if (IsContentSized()) - return GridLength(CreateContentSizedLength(type_)); - - DCHECK(value_); - if (type_ == kFlex) - return GridLength(To<InterpolableNumber>(*value_).Value()); - Length length = To<InterpolableLength>(*value_).CreateLength( - conversion_data, Length::ValueRange::kNonNegative); - return GridLength(length); -} - -bool InterpolableGridLength::IsContentSized() const { - return type_ == kAuto || type_ == kMinContent || type_ == kMaxContent; -} - -bool InterpolableGridLength::IsCompatibleWith( - const InterpolableGridLength& other) const { - return !IsContentSized() && !other.IsContentSized() && (type_ == other.type_); -} - -InterpolableGridLength* InterpolableGridLength::RawClone() const { - return new InterpolableGridLength(value_ ? value_->Clone() : nullptr, type_); -} - -InterpolableGridLength* InterpolableGridLength::RawCloneAndZero() const { - return new InterpolableGridLength(value_ ? value_->CloneAndZero() : nullptr, - type_); -} - -bool InterpolableGridLength::Equals(const InterpolableValue& other) const { - // TODO (ansollan): Check for the equality of |value_| when Equals() is - // implemented in |InterpolableLength|. - return type_ == To<InterpolableGridLength>(other).type_; -} - -void InterpolableGridLength::Scale(double scale) { - // We can scale a value only if this is either an |InterpolableNumber| or - // |InterpolableLength|. - if (!IsContentSized()) { - DCHECK(value_); - value_->Scale(scale); - } -} - -void InterpolableGridLength::Add(const InterpolableValue& other) { - const InterpolableGridLength& other_interpolable_grid_length = - To<InterpolableGridLength>(other); - - // We can add two values only if their types match and they aren't content - // sized. Otherwise, the value and type are replaced. - if (IsCompatibleWith(other_interpolable_grid_length)) { - DCHECK(value_ && other_interpolable_grid_length.value_); - value_->Add(*other_interpolable_grid_length.value_); - } else { - type_ = other_interpolable_grid_length.type_; - value_ = other_interpolable_grid_length.value_ - ? other_interpolable_grid_length.value_->Clone() - : nullptr; - } -} - -void InterpolableGridLength::AssertCanInterpolateWith( - const InterpolableValue& other) const { - const InterpolableGridLength& other_interpolable_grid_length = - To<InterpolableGridLength>(other); - - // If the types for both interpolable values are equal and are either length - // or flex, we can directly call |AssertCanInterpolateWith| on |value_|, as - // it should either be |InterpolableLength| or |InterpolableNumber|. - // Otherwise, at least one of the types is content sized or they aren't equal. - if ((type_ == kLength && other_interpolable_grid_length.type_ == kLength) || - (type_ == kFlex && other_interpolable_grid_length.type_ == kFlex)) { - DCHECK(value_ && other_interpolable_grid_length.value_); - value_->AssertCanInterpolateWith(*other_interpolable_grid_length.value_); - } else { - DCHECK(!IsCompatibleWith(other_interpolable_grid_length)); - } -} - -void InterpolableGridLength::Interpolate(const InterpolableValue& to, - const double progress, - InterpolableValue& result) const { - const InterpolableGridLength& grid_length_to = To<InterpolableGridLength>(to); - InterpolableGridLength& grid_length_result = - To<InterpolableGridLength>(result); - if (!IsCompatibleWith(grid_length_to)) { - if (progress < 0.5) { - grid_length_result.type_ = type_; - grid_length_result.value_ = value_ ? value_->Clone() : nullptr; - } else { - grid_length_result.type_ = grid_length_to.type_; - grid_length_result.value_ = - grid_length_to.value_ ? grid_length_to.value_->Clone() : nullptr; - } - return; - } - value_->Interpolate(*grid_length_to.value_, progress, - *grid_length_result.value_); -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/animation/interpolable_grid_length.h b/third_party/blink/renderer/core/animation/interpolable_grid_length.h deleted file mode 100644 index 50102d7e..0000000 --- a/third_party/blink/renderer/core/animation/interpolable_grid_length.h +++ /dev/null
@@ -1,77 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_LENGTH_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_LENGTH_H_ - -#include <memory> -#include "third_party/blink/renderer/core/animation/interpolable_value.h" -#include "third_party/blink/renderer/core/css/css_to_length_conversion_data.h" -#include "third_party/blink/renderer/core/style/grid_length.h" - -namespace blink { - -// Represents a blink::GridLength, converted into a form that can be -// interpolated from/to. -// This class is a representation of the <track-breadth> values: -// <length-percentage> | <flex> | min-content | max-content | auto. -class CORE_EXPORT InterpolableGridLength final : public InterpolableValue { - public: - // |kLength| and |kFlex| are the only types that indicate interpolation may be - // possible. - enum InterpolableGridLengthType { - kLength, - kFlex, - kAuto, - kMinContent, - kMaxContent, - }; - - InterpolableGridLength(std::unique_ptr<InterpolableValue> value, - InterpolableGridLengthType type); - static std::unique_ptr<InterpolableGridLength> Create( - const GridLength& grid_length); - - GridLength CreateGridLength( - const CSSToLengthConversionData& conversion_data) const; - - // InterpolableValue implementation: - void Interpolate(const InterpolableValue& to, - const double progress, - InterpolableValue& result) const final; - bool IsGridLength() const final { return true; } - bool Equals(const InterpolableValue& other) const final; - void Scale(double scale) final; - void Add(const InterpolableValue& other) final; - void AssertCanInterpolateWith(const InterpolableValue& other) const final; - - private: - // An |InterpolableGridLength| is content sized when it's 'auto', - // 'max-content' or 'min-content'. - bool IsContentSized() const; - // Two |InterpolableGridLength| variables are compatible when they aren't - // content sized and their type is the same. - bool IsCompatibleWith(const InterpolableGridLength& other) const; - - InterpolableGridLength* RawClone() const final; - InterpolableGridLength* RawCloneAndZero() const final; - - // The form of the interpolable value varies depending on the |type_|: - // If the type is flex, form is |InterpolableNumber|. - // If the type is length, form is |InterpolableLength|. - // Everything else, |value_| is nulllptr. - std::unique_ptr<InterpolableValue> value_; - InterpolableGridLengthType type_; -}; - -template <> -struct DowncastTraits<InterpolableGridLength> { - static bool AllowFrom(const InterpolableValue& interpolable_value) { - return interpolable_value.IsGridLength(); - } -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_LENGTH_H_
diff --git a/third_party/blink/renderer/core/animation/interpolable_grid_track_list.cc b/third_party/blink/renderer/core/animation/interpolable_grid_track_list.cc deleted file mode 100644 index 3c40191f..0000000 --- a/third_party/blink/renderer/core/animation/interpolable_grid_track_list.cc +++ /dev/null
@@ -1,126 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "third_party/blink/renderer/core/animation/interpolable_grid_track_list.h" - -#include <memory> -#include "third_party/blink/renderer/core/animation/interpolable_grid_track_repeater.h" -#include "third_party/blink/renderer/platform/runtime_enabled_features.h" - -namespace blink { - -InterpolableGridTrackList::InterpolableGridTrackList( - std::unique_ptr<InterpolableList> values) - : values_(std::move(values)) { - DCHECK(values_); -} - -// static -std::unique_ptr<InterpolableGridTrackList> -InterpolableGridTrackList::MaybeCreate(const NGGridTrackList& track_list) { - if (track_list.HasAutoRepeater()) - return nullptr; - - wtf_size_t repeater_count = track_list.RepeaterCount(); - std::unique_ptr<InterpolableList> values = - std::make_unique<InterpolableList>(repeater_count); - - for (wtf_size_t i = 0; i < repeater_count; ++i) { - Vector<GridTrackSize, 1> repeater_track_sizes; - for (wtf_size_t j = 0; j < track_list.RepeatSize(i); ++j) - repeater_track_sizes.push_back(track_list.RepeatTrackSize(i, j)); - - const NGGridTrackRepeater repeater( - track_list.RepeatIndex(i), track_list.RepeatSize(i), - track_list.RepeatCount(i, 0), track_list.RepeatType(i)); - std::unique_ptr<InterpolableGridTrackRepeater> result = - InterpolableGridTrackRepeater::Create(repeater, repeater_track_sizes); - DCHECK(result); - values->Set(i, std::move(result)); - } - - return std::make_unique<InterpolableGridTrackList>(std::move(values)); -} - -NGGridTrackList InterpolableGridTrackList::CreateNGGridTrackList( - const CSSToLengthConversionData& conversion_data) const { - NGGridTrackList new_track_list; - for (wtf_size_t i = 0; i < values_->length(); ++i) { - const InterpolableGridTrackRepeater& repeater = - To<InterpolableGridTrackRepeater>(*values_->Get(i)); - new_track_list.AddRepeater(repeater.CreateTrackSizes(conversion_data), - repeater.RepeatType(), repeater.RepeatCount()); - } - return new_track_list; -} - -InterpolableGridTrackList* InterpolableGridTrackList::RawClone() const { - std::unique_ptr<InterpolableList> values( - DynamicTo<InterpolableList>(values_->Clone().release())); - return new InterpolableGridTrackList(std::move(values)); -} - -InterpolableGridTrackList* InterpolableGridTrackList::RawCloneAndZero() const { - std::unique_ptr<InterpolableList> values( - DynamicTo<InterpolableList>(values_->CloneAndZero().release())); - return new InterpolableGridTrackList(std::move(values)); -} - -bool InterpolableGridTrackList::Equals(const InterpolableValue& other) const { - return IsCompatibleWith(other) && - values_->Equals(*(To<InterpolableGridTrackList>(other).values_)); -} - -void InterpolableGridTrackList::Scale(double scale) { - values_->Scale(scale); -} - -void InterpolableGridTrackList::Add(const InterpolableValue& other) { - // We can only add interpolable lists that have equal length and have - // compatible repeaters. - DCHECK(IsCompatibleWith(other)); - const InterpolableGridTrackList& other_track_list = - To<InterpolableGridTrackList>(other); - values_->Add(*other_track_list.values_); - progress_ = other_track_list.progress_; -} - -bool InterpolableGridTrackList::IsCompatibleWith( - const InterpolableValue& other) const { - const InterpolableGridTrackList& other_track_list = - To<InterpolableGridTrackList>(other); - if (values_->length() != other_track_list.values_->length()) - return false; - - for (wtf_size_t i = 0; i < values_->length(); ++i) { - const InterpolableGridTrackRepeater& repeater = - To<InterpolableGridTrackRepeater>(*values_->Get(i)); - if (!repeater.IsCompatibleWith(*other_track_list.values_->Get(i))) - return false; - } - return true; -} - -void InterpolableGridTrackList::AssertCanInterpolateWith( - const InterpolableValue& other) const { - const InterpolableGridTrackList& other_track_list = - To<InterpolableGridTrackList>(other); - - DCHECK_EQ(values_->length(), other_track_list.values_->length()); - values_->AssertCanInterpolateWith(*other_track_list.values_); -} - -void InterpolableGridTrackList::Interpolate(const InterpolableValue& to, - const double progress, - InterpolableValue& result) const { - const InterpolableGridTrackList& grid_track_list_to = - To<InterpolableGridTrackList>(to); - InterpolableGridTrackList& grid_track_list_result = - To<InterpolableGridTrackList>(result); - values_->Interpolate(*grid_track_list_to.values_, progress, - *grid_track_list_result.values_); - grid_track_list_result.progress_ = progress; -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/animation/interpolable_grid_track_list.h b/third_party/blink/renderer/core/animation/interpolable_grid_track_list.h deleted file mode 100644 index 4e5218d..0000000 --- a/third_party/blink/renderer/core/animation/interpolable_grid_track_list.h +++ /dev/null
@@ -1,62 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_TRACK_LIST_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_TRACK_LIST_H_ - -#include <memory> -#include "third_party/blink/renderer/core/animation/interpolable_value.h" -#include "third_party/blink/renderer/core/css/css_to_length_conversion_data.h" -#include "third_party/blink/renderer/core/style/grid_track_list.h" - -namespace blink { - -// Represents a blink::NGGridTrackList, converted into a form that can be -// interpolated from/to. -class CORE_EXPORT InterpolableGridTrackList : public InterpolableValue { - public: - explicit InterpolableGridTrackList(std::unique_ptr<InterpolableList> values); - static std::unique_ptr<InterpolableGridTrackList> MaybeCreate( - const NGGridTrackList& track_list); - - NGGridTrackList CreateNGGridTrackList( - const CSSToLengthConversionData& conversion_data) const; - - // InterpolableValue implementation: - void Interpolate(const InterpolableValue& to, - const double progress, - InterpolableValue& result) const final; - bool IsGridTrackList() const final { return true; } - bool Equals(const InterpolableValue& other) const final; - void Scale(double scale) final; - void Add(const InterpolableValue& other) final; - void AssertCanInterpolateWith(const InterpolableValue& other) const final; - - // Two grid track lists are compatible when they have the same number of - // tracks and each of the |InterpolableGridTrackRepeater| values are equal. If - // two grid track lists are not compatible, then they combine discretely. - bool IsCompatibleWith(const InterpolableValue& other) const; - double GetProgress() const { return progress_; } - - private: - InterpolableGridTrackList* RawClone() const final; - InterpolableGridTrackList* RawCloneAndZero() const final; - - // Represents a list of repeaters. - std::unique_ptr<InterpolableList> values_; - // Represents the progress of the interpolation, this is needed to flip - // |CSSGridTrackListNonInterpolableValue|. - double progress_; -}; - -template <> -struct DowncastTraits<InterpolableGridTrackList> { - static bool AllowFrom(const InterpolableValue& interpolable_value) { - return interpolable_value.IsGridTrackList(); - } -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_TRACK_LIST_H_
diff --git a/third_party/blink/renderer/core/animation/interpolable_grid_track_repeater.cc b/third_party/blink/renderer/core/animation/interpolable_grid_track_repeater.cc deleted file mode 100644 index 7bf8d74..0000000 --- a/third_party/blink/renderer/core/animation/interpolable_grid_track_repeater.cc +++ /dev/null
@@ -1,113 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "third_party/blink/renderer/core/animation/interpolable_grid_track_repeater.h" - -#include <memory> -#include "third_party/blink/renderer/core/animation/interpolable_grid_track_size.h" -#include "third_party/blink/renderer/platform/runtime_enabled_features.h" - -namespace blink { - -InterpolableGridTrackRepeater::InterpolableGridTrackRepeater( - std::unique_ptr<InterpolableList> values, - const NGGridTrackRepeater& repeater) - : values_(std::move(values)), repeater_(repeater) { - DCHECK(values_); -} - -// static -std::unique_ptr<InterpolableGridTrackRepeater> -InterpolableGridTrackRepeater::Create( - const NGGridTrackRepeater& repeater, - const Vector<GridTrackSize, 1>& repeater_track_sizes) { - DCHECK_EQ(repeater_track_sizes.size(), repeater.repeat_size); - - std::unique_ptr<InterpolableList> values = - std::make_unique<InterpolableList>(repeater_track_sizes.size()); - for (wtf_size_t i = 0; i < repeater_track_sizes.size(); ++i) { - std::unique_ptr<InterpolableGridTrackSize> result = - InterpolableGridTrackSize::Create(repeater_track_sizes[i]); - DCHECK(result); - values->Set(i, std::move(result)); - } - return std::make_unique<InterpolableGridTrackRepeater>(std::move(values), - repeater); -} - -Vector<GridTrackSize, 1> InterpolableGridTrackRepeater::CreateTrackSizes( - const CSSToLengthConversionData& conversion_data) const { - DCHECK_EQ(values_->length(), repeater_.repeat_size); - - Vector<GridTrackSize, 1> track_sizes; - track_sizes.ReserveInitialCapacity(values_->length()); - for (wtf_size_t i = 0; i < values_->length(); ++i) { - const InterpolableGridTrackSize& interpolable_track_size = - To<InterpolableGridTrackSize>(*values_->Get(i)); - track_sizes.push_back( - interpolable_track_size.CreateTrackSize(conversion_data)); - } - return track_sizes; -} - -InterpolableGridTrackRepeater* InterpolableGridTrackRepeater::RawClone() const { - std::unique_ptr<InterpolableList> values( - DynamicTo<InterpolableList>(values_->Clone().release())); - return new InterpolableGridTrackRepeater(std::move(values), repeater_); -} - -InterpolableGridTrackRepeater* InterpolableGridTrackRepeater::RawCloneAndZero() - const { - std::unique_ptr<InterpolableList> values( - DynamicTo<InterpolableList>(values_->CloneAndZero().release())); - return new InterpolableGridTrackRepeater(std::move(values), repeater_); -} - -bool InterpolableGridTrackRepeater::Equals( - const InterpolableValue& other) const { - return values_->Equals(*(To<InterpolableGridTrackRepeater>(other).values_)); -} - -void InterpolableGridTrackRepeater::Scale(double scale) { - values_->Scale(scale); -} - -void InterpolableGridTrackRepeater::Add(const InterpolableValue& other) { - DCHECK(IsCompatibleWith(other)); - values_->Add(*(To<InterpolableGridTrackRepeater>(other).values_)); -} - -bool InterpolableGridTrackRepeater::IsCompatibleWith( - const InterpolableValue& other) const { - const InterpolableGridTrackRepeater& other_interpolable_grid_track_repeater = - To<InterpolableGridTrackRepeater>(other); - return values_->length() == - other_interpolable_grid_track_repeater.values_->length() && - repeater_ == other_interpolable_grid_track_repeater.repeater_; -} - -void InterpolableGridTrackRepeater::AssertCanInterpolateWith( - const InterpolableValue& other) const { - const InterpolableGridTrackRepeater& other_interpolable_grid_track_repeater = - To<InterpolableGridTrackRepeater>(other); - DCHECK_EQ(values_->length(), - other_interpolable_grid_track_repeater.values_->length()); - DCHECK_EQ(repeater_, other_interpolable_grid_track_repeater.repeater_); - values_->AssertCanInterpolateWith( - *other_interpolable_grid_track_repeater.values_); -} - -void InterpolableGridTrackRepeater::Interpolate( - const InterpolableValue& to, - const double progress, - InterpolableValue& result) const { - const InterpolableGridTrackRepeater& grid_track_repeater_to = - To<InterpolableGridTrackRepeater>(to); - InterpolableGridTrackRepeater& grid_track_repeater_result = - To<InterpolableGridTrackRepeater>(result); - values_->Interpolate(*grid_track_repeater_to.values_, progress, - *grid_track_repeater_result.values_); -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/animation/interpolable_grid_track_repeater.h b/third_party/blink/renderer/core/animation/interpolable_grid_track_repeater.h deleted file mode 100644 index c5cb5cb..0000000 --- a/third_party/blink/renderer/core/animation/interpolable_grid_track_repeater.h +++ /dev/null
@@ -1,70 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_TRACK_REPEATER_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_TRACK_REPEATER_H_ - -#include <memory> -#include "third_party/blink/renderer/core/animation/interpolable_value.h" -#include "third_party/blink/renderer/core/css/css_to_length_conversion_data.h" -#include "third_party/blink/renderer/core/style/grid_track_list.h" - -namespace blink { - -// Represents a blink::NGGridTrackRepeater, converted into a form that can be -// interpolated from/to. -class CORE_EXPORT InterpolableGridTrackRepeater final - : public InterpolableValue { - public: - InterpolableGridTrackRepeater(std::unique_ptr<InterpolableList> values, - const NGGridTrackRepeater& repeater); - static std::unique_ptr<InterpolableGridTrackRepeater> Create( - const NGGridTrackRepeater& repeater, - const Vector<GridTrackSize, 1>& repeater_track_sizes); - - Vector<GridTrackSize, 1> CreateTrackSizes( - const CSSToLengthConversionData& conversion_data) const; - - wtf_size_t RepeatSize() const { return repeater_.repeat_size; } - wtf_size_t RepeatCount() const { return repeater_.repeat_count; } - NGGridTrackRepeater::RepeatType RepeatType() const { - return repeater_.repeat_type; - } - - // InterpolableValue implementation: - void Interpolate(const InterpolableValue& to, - const double progress, - InterpolableValue& result) const final; - bool IsGridTrackRepeater() const final { return true; } - bool Equals(const InterpolableValue& other) const final; - void Scale(double scale) final; - void Add(const InterpolableValue& other) final; - void AssertCanInterpolateWith(const InterpolableValue& other) const final; - - // Interpolable grid track repeaters are compatible when the lengths of the - // values and their |NGGridTrackRepeater| variable are equal. Two - // |NGGridTrackRepeater| variables are equal when their index, size, count and - // type are the same. If two grid track repeaters are not compatible, then - // they combine discretely. - bool IsCompatibleWith(const InterpolableValue& other) const; - - private: - InterpolableGridTrackRepeater* RawClone() const final; - InterpolableGridTrackRepeater* RawCloneAndZero() const final; - - // Stores the track sizes of a repeater. - std::unique_ptr<InterpolableList> values_; - NGGridTrackRepeater repeater_; -}; - -template <> -struct DowncastTraits<InterpolableGridTrackRepeater> { - static bool AllowFrom(const InterpolableValue& interpolable_value) { - return interpolable_value.IsGridTrackRepeater(); - } -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_TRACK_REPEATER_H_
diff --git a/third_party/blink/renderer/core/animation/interpolable_grid_track_size.cc b/third_party/blink/renderer/core/animation/interpolable_grid_track_size.cc deleted file mode 100644 index c9387bc9..0000000 --- a/third_party/blink/renderer/core/animation/interpolable_grid_track_size.cc +++ /dev/null
@@ -1,134 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "third_party/blink/renderer/core/animation/interpolable_grid_track_size.h" - -#include <memory> -#include "third_party/blink/renderer/core/animation/interpolable_grid_length.h" - -namespace blink { - -InterpolableGridTrackSize::InterpolableGridTrackSize( - std::unique_ptr<InterpolableValue> min_value, - std::unique_ptr<InterpolableValue> max_value, - const GridTrackSizeType type) - : min_value_(std::move(min_value)), - max_value_(std::move(max_value)), - type_(type) { - DCHECK(min_value_); - DCHECK(max_value_); -} - -// static -std::unique_ptr<InterpolableGridTrackSize> InterpolableGridTrackSize::Create( - const GridTrackSize& grid_track_size) { - std::unique_ptr<InterpolableValue> min_value; - std::unique_ptr<InterpolableValue> max_value; - - min_value = InterpolableGridLength::Create( - grid_track_size.MinOrFitContentTrackBreadth()); - max_value = InterpolableGridLength::Create( - grid_track_size.MaxOrFitContentTrackBreadth()); - DCHECK(min_value); - DCHECK(max_value); - - return std::make_unique<InterpolableGridTrackSize>( - std::move(min_value), std::move(max_value), grid_track_size.GetType()); -} - -GridTrackSize InterpolableGridTrackSize::CreateTrackSize( - const CSSToLengthConversionData& conversion_data) const { - const InterpolableGridLength& interpolable_grid_length_min = - To<InterpolableGridLength>(*min_value_); - const InterpolableGridLength& interpolable_grid_length_max = - To<InterpolableGridLength>(*max_value_); - GridTrackSize track_size = - (type_ == kMinMaxTrackSizing) - ? GridTrackSize( - interpolable_grid_length_min.CreateGridLength(conversion_data), - interpolable_grid_length_max.CreateGridLength(conversion_data)) - : GridTrackSize( - interpolable_grid_length_min.CreateGridLength(conversion_data), - type_); - return track_size; -} - -InterpolableGridTrackSize* InterpolableGridTrackSize::RawClone() const { - return new InterpolableGridTrackSize(min_value_->Clone(), max_value_->Clone(), - type_); -} - -InterpolableGridTrackSize* InterpolableGridTrackSize::RawCloneAndZero() const { - return new InterpolableGridTrackSize(min_value_->CloneAndZero(), - max_value_->CloneAndZero(), type_); -} - -bool InterpolableGridTrackSize::Equals(const InterpolableValue& other) const { - const InterpolableGridTrackSize& other_grid_track_size = - To<InterpolableGridTrackSize>(other); - return type_ == other_grid_track_size.type_ && - min_value_->Equals(*other_grid_track_size.min_value_) && - max_value_->Equals(*other_grid_track_size.max_value_); -} - -void InterpolableGridTrackSize::Scale(double scale) { - min_value_->Scale(scale); - max_value_->Scale(scale); -} - -void InterpolableGridTrackSize::Add(const InterpolableValue& other) { - const InterpolableGridTrackSize& other_interpolable_grid_track_size = - To<InterpolableGridTrackSize>(other); - // Similarly to Interpolate(), we add two track sizes only when their types - // are equal. Otherwise, the values and type are replaced. - if (type_ == other_interpolable_grid_track_size.type_) { - min_value_->Add(*other_interpolable_grid_track_size.min_value_); - max_value_->Add(*other_interpolable_grid_track_size.max_value_); - } else { - type_ = other_interpolable_grid_track_size.type_; - min_value_ = other_interpolable_grid_track_size.min_value_->Clone(); - max_value_ = other_interpolable_grid_track_size.max_value_->Clone(); - } -} - -void InterpolableGridTrackSize::AssertCanInterpolateWith( - const InterpolableValue& other) const { - const InterpolableGridTrackSize& other_interpolable_grid_track_size = - To<InterpolableGridTrackSize>(other); - min_value_->AssertCanInterpolateWith( - *other_interpolable_grid_track_size.min_value_); - max_value_->AssertCanInterpolateWith( - *other_interpolable_grid_track_size.max_value_); -} - -void InterpolableGridTrackSize::Interpolate(const InterpolableValue& to, - const double progress, - InterpolableValue& result) const { - const InterpolableGridTrackSize& grid_track_size_to = - To<InterpolableGridTrackSize>(to); - InterpolableGridTrackSize& grid_track_size_result = - To<InterpolableGridTrackSize>(result); - // If the type is different (e.g. going from fit-content to minmax, minmax to - // length, etc.), we just flip at 50%. - if (type_ != grid_track_size_to.type_) { - if (progress < 0.5) { - grid_track_size_result.type_ = type_; - grid_track_size_result.min_value_ = min_value_->Clone(); - grid_track_size_result.max_value_ = max_value_->Clone(); - } else { - grid_track_size_result.type_ = grid_track_size_to.type_; - grid_track_size_result.min_value_ = - grid_track_size_to.min_value_->Clone(); - grid_track_size_result.max_value_ = - grid_track_size_to.max_value_->Clone(); - } - return; - } - min_value_->Interpolate(*grid_track_size_to.min_value_, progress, - *grid_track_size_result.min_value_); - max_value_->Interpolate(*grid_track_size_to.max_value_, progress, - *grid_track_size_result.max_value_); -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/animation/interpolable_grid_track_size.h b/third_party/blink/renderer/core/animation/interpolable_grid_track_size.h deleted file mode 100644 index fa6b67e..0000000 --- a/third_party/blink/renderer/core/animation/interpolable_grid_track_size.h +++ /dev/null
@@ -1,61 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_TRACK_SIZE_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_TRACK_SIZE_H_ - -#include <memory> -#include "third_party/blink/renderer/core/animation/interpolable_value.h" -#include "third_party/blink/renderer/core/css/css_to_length_conversion_data.h" -#include "third_party/blink/renderer/core/style/grid_track_size.h" - -namespace blink { - -// Represents a blink::GridTrackSize, converted into a form that can be -// interpolated from/to. -// This class is a representation of <track-size> values: -// <track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | -// fit-content( <length-percentage> ) -class CORE_EXPORT InterpolableGridTrackSize final : public InterpolableValue { - public: - InterpolableGridTrackSize(std::unique_ptr<InterpolableValue> min_value, - std::unique_ptr<InterpolableValue> max_value, - const GridTrackSizeType type); - static std::unique_ptr<InterpolableGridTrackSize> Create( - const GridTrackSize& grid_track_size); - - GridTrackSize CreateTrackSize( - const CSSToLengthConversionData& conversion_data) const; - - // InterpolableValue implementation: - void Interpolate(const InterpolableValue& to, - const double progress, - InterpolableValue& result) const final; - bool IsGridTrackSize() const final { return true; } - bool Equals(const InterpolableValue& other) const final; - void Scale(double scale) final; - void Add(const InterpolableValue& other) final; - void AssertCanInterpolateWith(const InterpolableValue& other) const final; - - private: - InterpolableGridTrackSize* RawClone() const final; - InterpolableGridTrackSize* RawCloneAndZero() const final; - - // We have a min and max representation as a generalization of the three - // different <track-size> types. - std::unique_ptr<InterpolableValue> min_value_; - std::unique_ptr<InterpolableValue> max_value_; - GridTrackSizeType type_; -}; - -template <> -struct DowncastTraits<InterpolableGridTrackSize> { - static bool AllowFrom(const InterpolableValue& interpolable_value) { - return interpolable_value.IsGridTrackSize(); - } -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_INTERPOLABLE_GRID_TRACK_SIZE_H_
diff --git a/third_party/blink/renderer/core/animation/interpolable_value.h b/third_party/blink/renderer/core/animation/interpolable_value.h index 5bed030a..54cb5f2 100644 --- a/third_party/blink/renderer/core/animation/interpolable_value.h +++ b/third_party/blink/renderer/core/animation/interpolable_value.h
@@ -42,10 +42,6 @@ virtual bool IsShadow() const { return false; } virtual bool IsFilter() const { return false; } virtual bool IsTransformList() const { return false; } - virtual bool IsGridLength() const { return false; } - virtual bool IsGridTrackList() const { return false; } - virtual bool IsGridTrackRepeater() const { return false; } - virtual bool IsGridTrackSize() const { return false; } // TODO(alancutter): Remove Equals(). virtual bool Equals(const InterpolableValue&) const = 0;
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5 index 4d2104f..cc5c9f5 100644 --- a/third_party/blink/renderer/core/css/css_properties.json5 +++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -2759,7 +2759,6 @@ field_group: "*->grid", field_template: "external", include_paths: ["third_party/blink/renderer/core/style/computed_grid_track_list.h"], - interpolable: true, default_value: "ComputedGridTrackList()", type_name: "ComputedGridTrackList", style_builder_template: "grid", @@ -2776,7 +2775,6 @@ field_group: "*->grid", field_template: "external", include_paths: ["third_party/blink/renderer/core/style/computed_grid_track_list.h"], - interpolable: true, default_value: "ComputedGridTrackList()", type_name: "ComputedGridTrackList", style_builder_template: "grid",
diff --git a/third_party/blink/renderer/core/css/css_property_equality.cc b/third_party/blink/renderer/core/css/css_property_equality.cc index 36ccb08..92c7563 100644 --- a/third_party/blink/renderer/core/css/css_property_equality.cc +++ b/third_party/blink/renderer/core/css/css_property_equality.cc
@@ -173,10 +173,6 @@ b.GetFontDescription().VariationSettings()); case CSSPropertyID::kFontWeight: return a.GetFontWeight() == b.GetFontWeight(); - case CSSPropertyID::kGridTemplateColumns: - return a.GridTemplateColumns() == b.GridTemplateColumns(); - case CSSPropertyID::kGridTemplateRows: - return a.GridTemplateRows() == b.GridTemplateRows(); case CSSPropertyID::kHeight: return a.Height() == b.Height(); case CSSPropertyID::kLeft:
diff --git a/third_party/blink/renderer/core/css/css_selector.cc b/third_party/blink/renderer/core/css/css_selector.cc index 8e8e9dd..c7b54af1 100644 --- a/third_party/blink/renderer/core/css/css_selector.cc +++ b/third_party/blink/renderer/core/css/css_selector.cc
@@ -341,6 +341,7 @@ case kPseudoHostHasAppearance: case kPseudoSlotted: case kPseudoTopLayer: + case kPseudoPopupHidden: case kPseudoVideoPersistent: case kPseudoVideoPersistentAncestor: case kPseudoXrOverlay: @@ -374,6 +375,7 @@ CSSSelector::kPseudoWebKitCustomElement}, {"-internal-modal", CSSSelector::kPseudoModal}, {"-internal-multi-select-focus", CSSSelector::kPseudoMultiSelectFocus}, + {"-internal-popup-hidden", CSSSelector::kPseudoPopupHidden}, {"-internal-relative-anchor", CSSSelector::kPseudoRelativeAnchor}, {"-internal-selector-fragment-anchor", CSSSelector::kPseudoSelectorFragmentAnchor}, @@ -557,6 +559,10 @@ !RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()) return CSSSelector::kPseudoUnknown; + if (match->type == CSSSelector::kPseudoPopupHidden && + !RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()) + return CSSSelector::kPseudoUnknown; + if (match->type == CSSSelector::kPseudoHighlight && !RuntimeEnabledFeatures::HighlightAPIEnabled()) { return CSSSelector::kPseudoUnknown; @@ -749,6 +755,7 @@ case kPseudoPictureInPicture: case kPseudoPlaceholderShown: case kPseudoPlaying: + case kPseudoPopupHidden: case kPseudoReadOnly: case kPseudoReadWrite: case kPseudoRelativeAnchor:
diff --git a/third_party/blink/renderer/core/css/css_selector.h b/third_party/blink/renderer/core/css/css_selector.h index 580fd76..646bf8a 100644 --- a/third_party/blink/renderer/core/css/css_selector.h +++ b/third_party/blink/renderer/core/css/css_selector.h
@@ -281,6 +281,7 @@ kPseudoMultiSelectFocus, kPseudoHostHasAppearance, kPseudoTopLayer, + kPseudoPopupHidden, kPseudoSlotted, kPseudoVideoPersistent, kPseudoVideoPersistentAncestor,
diff --git a/third_party/blink/renderer/core/css/parser/css_proto_converter.cc b/third_party/blink/renderer/core/css/parser/css_proto_converter.cc index 0da5a8e..64aadd4 100644 --- a/third_party/blink/renderer/core/css/parser/css_proto_converter.cc +++ b/third_party/blink/renderer/core/css/parser/css_proto_converter.cc
@@ -43,6 +43,7 @@ "-internal-list-box", "-internal-media-controls-overlay-cast-button", "-internal-multi-select-focus", + "-internal-popup-hidden", "-internal-shadow-host-has-appearance", "-internal-spatial-navigation-focus", "-internal-video-persistent",
diff --git a/third_party/blink/renderer/core/css/popup.css b/third_party/blink/renderer/core/css/popup.css index 3bfd879..3f1e541 100644 --- a/third_party/blink/renderer/core/css/popup.css +++ b/third_party/blink/renderer/core/css/popup.css
@@ -9,10 +9,7 @@ @namespace "http://www.w3.org/1999/xhtml"; -[popup="" i]:not(:top-layer), -[popup=auto i]:not(:top-layer), -[popup=hint i]:not(:top-layer), -[popup=async i]:not(:top-layer) { +[popup]:-internal-popup-hidden { display: none; }
diff --git a/third_party/blink/renderer/core/css/rule_feature_set.cc b/third_party/blink/renderer/core/css/rule_feature_set.cc index 0d95962d..de27af2 100644 --- a/third_party/blink/renderer/core/css/rule_feature_set.cc +++ b/third_party/blink/renderer/core/css/rule_feature_set.cc
@@ -177,6 +177,7 @@ case CSSSelector::kPseudoMultiSelectFocus: case CSSSelector::kPseudoHostHasAppearance: case CSSSelector::kPseudoTopLayer: + case CSSSelector::kPseudoPopupHidden: case CSSSelector::kPseudoSlotted: case CSSSelector::kPseudoVideoPersistent: case CSSSelector::kPseudoVideoPersistentAncestor: @@ -651,6 +652,7 @@ case CSSSelector::kPseudoOutOfRange: case CSSSelector::kPseudoDefined: case CSSSelector::kPseudoTopLayer: + case CSSSelector::kPseudoPopupHidden: case CSSSelector::kPseudoVideoPersistent: case CSSSelector::kPseudoVideoPersistentAncestor: case CSSSelector::kPseudoXrOverlay:
diff --git a/third_party/blink/renderer/core/css/selector_checker.cc b/third_party/blink/renderer/core/css/selector_checker.cc index 95963384..d744c1310 100644 --- a/third_party/blink/renderer/core/css/selector_checker.cc +++ b/third_party/blink/renderer/core/css/selector_checker.cc
@@ -42,6 +42,7 @@ #include "third_party/blink/renderer/core/dom/flat_tree_traversal.h" #include "third_party/blink/renderer/core/dom/node_computed_style.h" #include "third_party/blink/renderer/core/dom/nth_index_cache.h" +#include "third_party/blink/renderer/core/dom/popup_data.h" #include "third_party/blink/renderer/core/dom/shadow_root.h" #include "third_party/blink/renderer/core/dom/text.h" #include "third_party/blink/renderer/core/editing/frame_selection.h" @@ -1394,6 +1395,12 @@ return element.popupOpen(); } return false; + case CSSSelector::kPseudoPopupHidden: + if (element.HasValidPopupAttribute()) { + return element.GetPopupData()->visibilityState() == + PopupVisibilityState::kHidden; + } + return false; case CSSSelector::kPseudoFullscreen: // fall through case CSSSelector::kPseudoFullScreen:
diff --git a/third_party/blink/renderer/core/dom/build.gni b/third_party/blink/renderer/core/dom/build.gni index 87667d7c..eae374f 100644 --- a/third_party/blink/renderer/core/dom/build.gni +++ b/third_party/blink/renderer/core/dom/build.gni
@@ -210,6 +210,8 @@ "nth_index_cache.h", "parent_node.h", "parser_content_policy.h", + "popup_animation_finished_event_listener.cc", + "popup_animation_finished_event_listener.h", "popup_data.h", "presentation_attribute_style.cc", "presentation_attribute_style.h",
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index 17850e0..d8fed35e 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -7225,38 +7225,6 @@ (popup_and_hint_stack_.back()->PopupType() == PopupValueType::kHint); } -void Document::HideTopmostPopupOrHint(HidePopupFocusBehavior focus_behavior) { - DCHECK(RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()); - if (popup_and_hint_stack_.IsEmpty()) - return; - popup_and_hint_stack_.back()->hidePopupInternal(focus_behavior); -} - -void Document::HideAllPopupsUntil(const Element* endpoint, - HidePopupFocusBehavior focus_behavior) { - DCHECK(RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()); - while (!popup_and_hint_stack_.IsEmpty() && - popup_and_hint_stack_.back() != endpoint) { - popup_and_hint_stack_.back()->hidePopupInternal(focus_behavior); - } -} - -void Document::HidePopupIfShowing(Element* popup, - HidePopupFocusBehavior focus_behavior) { - DCHECK(RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()); - DCHECK(popup->HasValidPopupAttribute()); - if (!popup->popupOpen()) - return; - if (popup->PopupType() == PopupValueType::kAsync) { - popup->hidePopupInternal(focus_behavior); - } else { - HideAllPopupsUntil(popup, focus_behavior); - DCHECK(!popup_and_hint_stack_.IsEmpty() && - popup_and_hint_stack_.back() == popup); - HideTopmostPopupOrHint(focus_behavior); - } -} - void Document::exitPointerLock() { if (!GetPage()) return; @@ -8009,6 +7977,7 @@ visitor->Trace(node_lists_); visitor->Trace(top_layer_elements_); visitor->Trace(popup_and_hint_stack_); + visitor->Trace(popups_waiting_to_hide_); visitor->Trace(load_event_delay_timer_); visitor->Trace(plugin_loading_timer_); visitor->Trace(elem_sheet_);
diff --git a/third_party/blink/renderer/core/dom/document.h b/third_party/blink/renderer/core/dom/document.h index 44555f76..27f42ac 100644 --- a/third_party/blink/renderer/core/dom/document.h +++ b/third_party/blink/renderer/core/dom/document.h
@@ -242,7 +242,6 @@ class WebMouseEvent; class WorkletAnimationController; enum class CSSPropertyID; -enum class HidePopupFocusBehavior; struct AnnotatedRegionValue; struct FocusParams; struct IconURL; @@ -1511,17 +1510,11 @@ HeapVector<Member<Element>>& PopupAndHintStack() { return popup_and_hint_stack_; } + HeapHashSet<Member<Element>>& PopupsWaitingToHide() { + return popups_waiting_to_hide_; + } bool PopupOrHintShowing() const; bool HintShowing() const; - void HideTopmostPopupOrHint(HidePopupFocusBehavior focus_behavior); - // This hides all visible popups up to, but not including, - // |endpoint|. If |endpoint| is nullptr, all popups are hidden. - void HideAllPopupsUntil(const Element* endpoint, - HidePopupFocusBehavior focus_behavior); - // This hides the provided popup, if it is showing. This will also - // hide all popups above |popup| in the popup stack. - void HidePopupIfShowing(Element* popup, - HidePopupFocusBehavior focus_behavior); // A non-null template_document_host_ implies that |this| was created by // EnsureTemplateDocument(). @@ -2321,6 +2314,10 @@ // hint in the stack, it is at the top. HeapVector<Member<Element>> popup_and_hint_stack_; + // A set of popups for which hidePopup() has been called, but animations are + // still running. + HeapHashSet<Member<Element>> popups_waiting_to_hide_; + int load_event_delay_count_; // Objects and embeds depend on "being rendered" for delaying the load event.
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index 0e35808..3d9f574c 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -95,6 +95,7 @@ #include "third_party/blink/renderer/core/dom/mutation_record.h" #include "third_party/blink/renderer/core/dom/named_node_map.h" #include "third_party/blink/renderer/core/dom/node_computed_style.h" +#include "third_party/blink/renderer/core/dom/popup_data.h" #include "third_party/blink/renderer/core/dom/presentation_attribute_style.h" #include "third_party/blink/renderer/core/dom/pseudo_element.h" #include "third_party/blink/renderer/core/dom/scriptable_document_parser.h" @@ -2446,8 +2447,10 @@ if (PopupType() == type) return; // If the popup type is changing, hide it. - if (popupOpen()) - hidePopupInternal(HidePopupFocusBehavior::kFocusPreviousElement); + if (popupOpen()) { + hidePopupInternal(HidePopupFocusBehavior::kFocusPreviousElement, + HidePopupForcingLevel::kHideAfterAnimations); + } } if (type == PopupValueType::kNone) { if (HasValidPopupAttribute()) { @@ -2479,10 +2482,11 @@ return GetPopupData() ? GetPopupData()->type() : PopupValueType::kNone; } +// This should be true when :top-layer should match. bool Element::popupOpen() const { DCHECK(RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()); if (auto* popup_data = GetPopupData()) - return popup_data->open(); + return popup_data->visibilityState() == PopupVisibilityState::kShowing; return false; } @@ -2502,14 +2506,17 @@ if (PopupType() == PopupValueType::kAuto || PopupType() == PopupValueType::kHint) { if (GetDocument().HintShowing()) { - GetDocument().HideTopmostPopupOrHint(HidePopupFocusBehavior::kNone); + GetDocument().PopupAndHintStack().back()->hidePopupInternal( + HidePopupFocusBehavior::kNone, + HidePopupForcingLevel::kHideAfterAnimations); } if (PopupType() == PopupValueType::kAuto) { // Only hide other popups up to this popup's ancestral popup. - GetDocument().HideAllPopupsUntil(NearestOpenAncestralPopup(this), - HidePopupFocusBehavior::kNone); + HideAllPopupsUntil(NearestOpenAncestralPopup(this), GetDocument(), + HidePopupFocusBehavior::kNone, + HidePopupForcingLevel::kHideAfterAnimations); } - // Add this popup to the stack. + // Add this popup to the popup stack. auto& stack = GetDocument().PopupAndHintStack(); DCHECK(!stack.Contains(this)); // We only restore focus for popup/hint, and only for the first popup in @@ -2517,11 +2524,23 @@ should_restore_focus = stack.IsEmpty(); stack.push_back(this); } - GetPopupData()->setOpen(true); - GetDocument().AddToTopLayer(this); - PseudoStateChanged(CSSSelector::kPseudoTopLayer); GetPopupData()->setPreviouslyFocusedElement( should_restore_focus ? GetDocument().FocusedElement() : nullptr); + GetDocument().AddToTopLayer(this); + // Remove display:none styling: + GetPopupData()->setVisibilityState(PopupVisibilityState::kTransitioning); + PseudoStateChanged(CSSSelector::kPseudoPopupHidden); + + // Force a style update. This ensures that base property values are set prior + // to `:top-layer` matching, so that transitions can start on the change to + // top layer. + GetDocument().UpdateStyleAndLayoutTreeForNode(this); + EnsureComputedStyle(); + + // Make the popup match :top-layer: + GetPopupData()->setVisibilityState(PopupVisibilityState::kShowing); + PseudoStateChanged(CSSSelector::kPseudoTopLayer); + SetPopupFocusOnShow(); // Queue the show event. Event* event = Event::CreateBubble(event_type_names::kShow); @@ -2529,6 +2548,26 @@ GetDocument().EnqueueAnimationFrameEvent(event); } +// static +void Element::HideAllPopupsUntil(const Element* endpoint, + Document& document, + HidePopupFocusBehavior focus_behavior, + HidePopupForcingLevel forcing_level) { + DCHECK(RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()); + // If we're forcing a popup to hide immediately, first hide any other popups + // that have already started the hide process. + if (forcing_level == HidePopupForcingLevel::kHideImmediately) { + auto popups_to_hide = document.PopupsWaitingToHide(); + for (auto popup : popups_to_hide) + popup->FinishPopupHideIfNeeded(forcing_level); + } + while (!document.PopupAndHintStack().IsEmpty() && + document.PopupAndHintStack().back() != endpoint) { + document.PopupAndHintStack().back()->hidePopupInternal(focus_behavior, + forcing_level); + } +} + void Element::hidePopup(ExceptionState& exception_state) { DCHECK(RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()); if (!HasValidPopupAttribute()) { @@ -2541,40 +2580,96 @@ DOMExceptionCode::kInvalidStateError, "Invalid on already-hidden popup elements"); } - hidePopupInternal(HidePopupFocusBehavior::kFocusPreviousElement); + hidePopupInternal(HidePopupFocusBehavior::kFocusPreviousElement, + HidePopupForcingLevel::kHideAfterAnimations); } -void Element::hidePopupInternal(HidePopupFocusBehavior focus_behavior) { - DCHECK(isConnected()); +void Element::hidePopupInternal(HidePopupFocusBehavior focus_behavior, + HidePopupForcingLevel forcing_level) { DCHECK(HasValidPopupAttribute()); - DCHECK(popupOpen()); + if (!isConnected() || !popupOpen()) + return; if (PopupType() == PopupValueType::kAuto || PopupType() == PopupValueType::kHint) { // Hide any popups/hints above us in the stack. - GetDocument().HideAllPopupsUntil(this, focus_behavior); + HideAllPopupsUntil(this, GetDocument(), focus_behavior, forcing_level); // Then remove this popup/hint from the stack. auto& stack = GetDocument().PopupAndHintStack(); DCHECK(stack.back() == this); stack.pop_back(); } - GetPopupData()->setOpen(false); + GetDocument().PopupsWaitingToHide().insert(this); + + // Grab already-running animations first, before removing :top-layer, so we + // know to ignore those. Make sure to get animations on descendant elements. + HeapVector<Member<Animation>> previous_animations; + auto animation_options = GetAnimationsOptionsResolved{.use_subtree = true}; + if (forcing_level != HidePopupForcingLevel::kHideImmediately) + previous_animations = GetAnimationsInternal(animation_options); + GetPopupData()->setInvoker(nullptr); GetPopupData()->setNeedsRepositioningForSelectMenu(false); - GetDocument().RemoveFromTopLayer(this); + GetPopupData()->setFocusBehavior(focus_behavior); + // Stop matching :top-layer: + GetPopupData()->setVisibilityState(PopupVisibilityState::kTransitioning); PseudoStateChanged(CSSSelector::kPseudoTopLayer); - // Queue the hide event. - Event* event = Event::CreateBubble(event_type_names::kHide); - event->SetTarget(this); - GetDocument().EnqueueAnimationFrameEvent(event); - if (Element* previously_focused_element = - GetPopupData()->previouslyFocusedElement()) { + + if (forcing_level == HidePopupForcingLevel::kHideImmediately || + !HasAnimations()) { + // If we don't have hide animations, or we need to hide immediately, finish + // the hiding process now. Otherwise, this will get finished when animations + // complete. + FinishPopupHideIfNeeded(forcing_level); + } else { + // Grab all animations, so that we can "finish" the hide operation once + // they complete. This will *also* force a style update, ensuring property + // values are set after `:top-layer` stops matching, so that transitions + // can start. + HeapHashSet<Member<EventTarget>> animations; + for (const auto& animation : GetAnimationsInternal(animation_options)) { + animations.insert(animation); + } + animations.RemoveAll(previous_animations); + GetPopupData()->setAnimationFinishedListener( + MakeGarbageCollected<PopupAnimationFinishedEventListener>( + this, std::move(animations))); + } +} + +void Element::FinishPopupHideIfNeeded(HidePopupForcingLevel forcing_level) { + if (!GetPopupData() || GetPopupData()->visibilityState() != + PopupVisibilityState::kTransitioning) { + return; + } + DCHECK(GetDocument().PopupsWaitingToHide().Contains(this)); + GetDocument().PopupsWaitingToHide().erase(this); + GetDocument().RemoveFromTopLayer(this); + // Re-apply display:none. + GetPopupData()->setVisibilityState(PopupVisibilityState::kHidden); + GetPopupData()->setAnimationFinishedListener(nullptr); + PseudoStateChanged(CSSSelector::kPseudoPopupHidden); + if (forcing_level == HidePopupForcingLevel::kHideImmediately) { + // If we're hiding immediately, we do not fire the "hide" event, and we do + // not focus the previously-focused element. Either of these could cause + // more popups to be shown. GetPopupData()->setPreviouslyFocusedElement(nullptr); - if (focus_behavior == HidePopupFocusBehavior::kFocusPreviousElement) { - FocusOptions* focus_options = FocusOptions::Create(); - focus_options->setPreventScroll(true); - // Call Focus() last, since it will fire a focus event which could modify - // this element. Focusing this element may also hide other popups. - previously_focused_element->Focus(focus_options); + } else { + // Queue the hide event. + Event* event = Event::CreateBubble(event_type_names::kHide); + event->SetTarget(this); + GetDocument().EnqueueAnimationFrameEvent(event); + if (Element* previously_focused_element = + GetPopupData()->previouslyFocusedElement()) { + GetPopupData()->setPreviouslyFocusedElement(nullptr); + if (GetPopupData()->focusBehavior() == + HidePopupFocusBehavior::kFocusPreviousElement) { + FocusOptions* focus_options = FocusOptions::Create(); + focus_options->setPreventScroll(true); + // Call Focus() last, since it will fire a focus event which could + // modify this element. Focusing this element may also hide other + // popups. + previously_focused_element->Focus(focus_options); + } } } } @@ -2702,7 +2797,7 @@ if (!current_element) continue; if (current_element->HasValidPopupAttribute() && - current_element->GetPopupData()->open() && + current_element->popupOpen() && (current_element->PopupType() == PopupValueType::kAuto || current_element->PopupType() == PopupValueType::kHint)) { // Case #1: a showing popup. @@ -2765,19 +2860,22 @@ // 1. This mirrors typical platform popups, which dismiss on mousedown. // 2. This allows a mouse-drag that starts on a popup and finishes off // the popup, without light-dismissing the popup. - document.HideAllPopupsUntil(NearestOpenAncestralPopup(target_node), - HidePopupFocusBehavior::kNone); + HideAllPopupsUntil(NearestOpenAncestralPopup(target_node), document, + HidePopupFocusBehavior::kNone, + HidePopupForcingLevel::kHideAfterAnimations); } else if (event_type == event_type_names::kKeydown) { const KeyboardEvent* key_event = DynamicTo<KeyboardEvent>(event); if (key_event && key_event->key() == "Escape") { // Escape key just pops the topmost popup or hint off the stack. - document.HideTopmostPopupOrHint( - HidePopupFocusBehavior::kFocusPreviousElement); + document.PopupAndHintStack().back()->hidePopupInternal( + HidePopupFocusBehavior::kFocusPreviousElement, + HidePopupForcingLevel::kHideAfterAnimations); } } else if (event_type == event_type_names::kFocusin) { // If we focus an element, hide all popups that don't contain that element. - document.HideAllPopupsUntil(NearestOpenAncestralPopup(target_node), - HidePopupFocusBehavior::kNone); + HideAllPopupsUntil(NearestOpenAncestralPopup(target_node), document, + HidePopupFocusBehavior::kNone, + HidePopupForcingLevel::kHideAfterAnimations); } } @@ -3183,8 +3281,8 @@ // removed from the popup element stack and the top layer. if (was_in_document && HasValidPopupAttribute()) { // We can't run focus event handlers while removing elements. - insertion_point.GetDocument().HidePopupIfShowing( - this, HidePopupFocusBehavior::kNone); + hidePopupInternal(HidePopupFocusBehavior::kNone, + HidePopupForcingLevel::kHideImmediately); } if (GetDocument().GetPage()) @@ -6270,7 +6368,7 @@ // elements in display:none subtrees on otherwise style-clean documents. If // you hit this DCHECK, consider if you really need ComputedStyle for // display:none elements. If not, use GetComputedStyle() instead. - // Regardlessly, you need to UpdateStyleAndLayoutTree() before calling + // Regardless, you need to UpdateStyleAndLayoutTree() before calling // EnsureComputedStyle. In some cases you might be fine using GetComputedStyle // without updating the style, but in most cases you want a clean tree for // that as well.
diff --git a/third_party/blink/renderer/core/dom/element.h b/third_party/blink/renderer/core/dom/element.h index c1a8048..34ebe4d 100644 --- a/third_party/blink/renderer/core/dom/element.h +++ b/third_party/blink/renderer/core/dom/element.h
@@ -181,6 +181,11 @@ kFocusPreviousElement, }; +enum class HidePopupForcingLevel { + kHideAfterAnimations, + kHideImmediately, +}; + typedef HeapVector<Member<Attr>> AttrNodeList; typedef HashMap<AtomicString, SpecificTrustedType> AttrNameToTrustedType; @@ -566,11 +571,19 @@ bool popupOpen() const; void showPopup(ExceptionState& exception_state); void hidePopup(ExceptionState& exception_state); - void hidePopupInternal(HidePopupFocusBehavior focus_behavior); + void hidePopupInternal(HidePopupFocusBehavior focus_behavior, + HidePopupForcingLevel forcing_level); + void FinishPopupHideIfNeeded(HidePopupForcingLevel); static const Element* NearestOpenAncestralPopup(Node* start_node); static void HandlePopupLightDismiss(const Event& event); void InvokePopup(Element* invoker); void SetPopupFocusOnShow(); + // This hides all visible popups up to, but not including, + // |endpoint|. If |endpoint| is nullptr, all popups are hidden. + static void HideAllPopupsUntil(const Element*, + Document&, + HidePopupFocusBehavior, + HidePopupForcingLevel); // TODO(crbug.com/1197720): The popup position should be provided by the new // anchored positioning scheme.
diff --git a/third_party/blink/renderer/core/dom/popup_animation_finished_event_listener.cc b/third_party/blink/renderer/core/dom/popup_animation_finished_event_listener.cc new file mode 100644 index 0000000..9874b29 --- /dev/null +++ b/third_party/blink/renderer/core/dom/popup_animation_finished_event_listener.cc
@@ -0,0 +1,76 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/core/dom/popup_animation_finished_event_listener.h" + +#include "third_party/blink/renderer/core/animation/animation.h" +#include "third_party/blink/renderer/core/dom/document.h" +#include "third_party/blink/renderer/core/dom/element.h" +#include "third_party/blink/renderer/core/dom/events/event_target.h" +#include "third_party/blink/renderer/core/event_type_names.h" +#include "third_party/blink/renderer/core/events/before_unload_event.h" + +namespace blink { + +PopupAnimationFinishedEventListener::PopupAnimationFinishedEventListener( + Member<Element> popup_element, + HeapHashSet<Member<EventTarget>>&& animations) + : popup_element_(popup_element), animations_(std::move(animations)) { + for (auto animation : animations_) { + animation->addEventListener(event_type_names::kFinish, this, + /*use_capture*/ false); + animation->addEventListener(event_type_names::kCancel, this, + /*use_capture*/ false); + } +} + +PopupAnimationFinishedEventListener::~PopupAnimationFinishedEventListener() = + default; + +void PopupAnimationFinishedEventListener::Dispose() { + // Event listeners may already have been cleaned up by + // LocalDOMWindow::RemoveAllEventListeners(). + if (!popup_element_->GetDocument().GetFrame()) + return; + for (const auto& animation : animations_) { + RemoveEventListeners(animation); + } + animations_.clear(); +} + +void PopupAnimationFinishedEventListener::RemoveEventListeners( + EventTarget* animation) const { + animation->removeEventListener(event_type_names::kFinish, this, + /*use_capture*/ false); + animation->removeEventListener(event_type_names::kCancel, this, + /*use_capture*/ false); +} + +void PopupAnimationFinishedEventListener::Invoke(ExecutionContext*, + Event* event) { + DCHECK(!animations_.IsEmpty()); + DCHECK(event->type() == event_type_names::kFinish || + event->type() == event_type_names::kCancel); + auto* animation = event->target(); + RemoveEventListeners(animation); + animations_.erase(animation); + + // Finish hiding the popup once all animations complete. + if (animations_.IsEmpty()) { + popup_element_->FinishPopupHideIfNeeded( + HidePopupForcingLevel::kHideAfterAnimations); + } +} + +bool PopupAnimationFinishedEventListener::IsFinished() const { + return animations_.IsEmpty(); +} + +void PopupAnimationFinishedEventListener::Trace(Visitor* visitor) const { + visitor->Trace(popup_element_); + visitor->Trace(animations_); + NativeEventListener::Trace(visitor); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/dom/popup_animation_finished_event_listener.h b/third_party/blink/renderer/core/dom/popup_animation_finished_event_listener.h new file mode 100644 index 0000000..74bd1fd --- /dev/null +++ b/third_party/blink/renderer/core/dom/popup_animation_finished_event_listener.h
@@ -0,0 +1,47 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_DOM_POPUP_ANIMATION_FINISHED_EVENT_LISTENER_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_POPUP_ANIMATION_FINISHED_EVENT_LISTENER_H_ + +#include "third_party/blink/renderer/core/dom/events/native_event_listener.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" +#include "third_party/blink/renderer/platform/heap/garbage_collected.h" +#include "third_party/blink/renderer/platform/heap/member.h" +#include "third_party/blink/renderer/platform/heap/prefinalizer.h" +#include "third_party/blink/renderer/platform/heap/visitor.h" + +namespace blink { + +class Element; +class EventTarget; + +// Helper class used to manage popup hide animations. +class PopupAnimationFinishedEventListener : public NativeEventListener { + USING_PRE_FINALIZER(PopupAnimationFinishedEventListener, Dispose); + + public: + explicit PopupAnimationFinishedEventListener( + Member<Element>, + HeapHashSet<Member<EventTarget>>&&); + ~PopupAnimationFinishedEventListener() override; + + void Invoke(ExecutionContext*, Event*) override; + + bool IsFinished() const; + void Dispose(); + + void Trace(Visitor* visitor) const override; + + private: + void RemoveEventListeners(EventTarget* animation) const; + + Member<Element> popup_element_; + HeapHashSet<Member<EventTarget>> animations_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_DOM_POPUP_ANIMATION_FINISHED_EVENT_LISTENER_H_
diff --git a/third_party/blink/renderer/core/dom/popup_data.h b/third_party/blink/renderer/core/dom/popup_data.h index 4a84e668..beee90d7 100644 --- a/third_party/blink/renderer/core/dom/popup_data.h +++ b/third_party/blink/renderer/core/dom/popup_data.h
@@ -7,26 +7,35 @@ #include "base/check_op.h" #include "third_party/blink/renderer/core/dom/element.h" +#include "third_party/blink/renderer/core/dom/popup_animation_finished_event_listener.h" #include "third_party/blink/renderer/core/html/forms/html_select_menu_element.h" #include "third_party/blink/renderer/core/html_element_type_helpers.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" namespace blink { +enum class PopupVisibilityState { + kHidden, + kTransitioning, + kShowing, +}; + class PopupData final : public GarbageCollected<PopupData> { public: PopupData() = default; PopupData(const PopupData&) = delete; PopupData& operator=(const PopupData&) = delete; - bool open() const { return open_; } - void setOpen(bool open) { open_ = open; } - bool hadDefaultOpenWhenParsed() const { return had_defaultopen_when_parsed_; } void setHadDefaultOpenWhenParsed(bool value) { had_defaultopen_when_parsed_ = value; } + PopupVisibilityState visibilityState() const { return visibility_state_; } + void setVisibilityState(PopupVisibilityState visibility_state) { + visibility_state_ = visibility_state; + } + PopupValueType type() const { return type_; } void setType(PopupValueType type) { type_ = type; @@ -34,6 +43,11 @@ << "Remove PopupData rather than setting kNone type"; } + HidePopupFocusBehavior focusBehavior() const { return focus_behavior_; } + void setFocusBehavior(HidePopupFocusBehavior focus_behavior) { + focus_behavior_ = focus_behavior; + } + Element* invoker() const { return invoker_; } void setInvoker(Element* element) { invoker_ = element; } @@ -51,6 +65,22 @@ previously_focused_element_ = element; } + PopupAnimationFinishedEventListener* animationFinishedListener() const { + return animation_finished_listener_; + } + void setAnimationFinishedListener( + PopupAnimationFinishedEventListener* listener) { + if (animation_finished_listener_ && + !animation_finished_listener_->IsFinished()) { + // If we're clearing the listener, dispose it, to prevent listeners from + // firing later. + animation_finished_listener_->Dispose(); + } + DCHECK(!animation_finished_listener_ || + animation_finished_listener_->IsFinished()); + animation_finished_listener_ = listener; + } + HTMLSelectMenuElement* ownerSelectMenuElement() const { return owner_select_menu_element_; } @@ -61,15 +91,20 @@ void Trace(Visitor* visitor) const { visitor->Trace(invoker_); visitor->Trace(previously_focused_element_); + visitor->Trace(animation_finished_listener_); visitor->Trace(owner_select_menu_element_); } private: - bool open_ = false; bool had_defaultopen_when_parsed_ = false; + PopupVisibilityState visibility_state_ = PopupVisibilityState::kHidden; PopupValueType type_ = PopupValueType::kNone; + HidePopupFocusBehavior focus_behavior_ = HidePopupFocusBehavior::kNone; WeakMember<Element> invoker_; WeakMember<Element> previously_focused_element_; + // We hold a strong reference to the animation finished listener, so that we + // can confirm that the listeners get removed before cleanup. + Member<PopupAnimationFinishedEventListener> animation_finished_listener_; // TODO(crbug.com/1197720): The popup position should be provided by the new // anchored positioning scheme.
diff --git a/third_party/blink/renderer/core/fullscreen/fullscreen.cc b/third_party/blink/renderer/core/fullscreen/fullscreen.cc index b098fbd..9c54c52 100644 --- a/third_party/blink/renderer/core/fullscreen/fullscreen.cc +++ b/third_party/blink/renderer/core/fullscreen/fullscreen.cc
@@ -200,10 +200,13 @@ else DCHECK(!HasFullscreenFlag(element)); - // If there are any open popups, close them, unless this fullscreen - // element is a descendant of an open popup. - if (RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()) - document.HideAllPopupsUntil(&element, HidePopupFocusBehavior::kNone); + // If there are any open popups, close them immediately, unless this + // fullscreen element is a descendant of an open popup. + if (RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()) { + Element::HideAllPopupsUntil(&element, document, + HidePopupFocusBehavior::kNone, + HidePopupForcingLevel::kHideImmediately); + } // To fullscreen an |element| within a |document|, set the |element|'s // fullscreen flag and add it to |document|'s top layer.
diff --git a/third_party/blink/renderer/core/html/forms/html_form_control_element.cc b/third_party/blink/renderer/core/html/forms/html_form_control_element.cc index f4f439d..092444de 100644 --- a/third_party/blink/renderer/core/html/forms/html_form_control_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_form_control_element.cc
@@ -387,7 +387,8 @@ (!Form() || !IsSuccessfulSubmitButton())) { if (can_hide) { popup.element->hidePopupInternal( - HidePopupFocusBehavior::kFocusPreviousElement); + HidePopupFocusBehavior::kFocusPreviousElement, + HidePopupForcingLevel::kHideAfterAnimations); } else if (can_show) { popup.element->InvokePopup(this); }
diff --git a/third_party/blink/renderer/core/html/forms/html_select_menu_element.cc b/third_party/blink/renderer/core/html/forms/html_select_menu_element.cc index fc618e6b..7843272b 100644 --- a/third_party/blink/renderer/core/html/forms/html_select_menu_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_select_menu_element.cc
@@ -354,7 +354,9 @@ if (listbox_part_ && open()) { if (listbox_part_->HasValidPopupAttribute()) { // We will handle focus directly. - listbox_part_->hidePopupInternal(HidePopupFocusBehavior::kNone); + listbox_part_->hidePopupInternal( + HidePopupFocusBehavior::kNone, + HidePopupForcingLevel::kHideAfterAnimations); } if (button_part_) { button_part_->Focus();
diff --git a/third_party/blink/renderer/core/html/html_dialog_element.cc b/third_party/blink/renderer/core/html/html_dialog_element.cc index b7f2666..d10168b 100644 --- a/third_party/blink/renderer/core/html/html_dialog_element.cc +++ b/third_party/blink/renderer/core/html/html_dialog_element.cc
@@ -183,9 +183,11 @@ return; SetBooleanAttribute(html_names::kOpenAttr, true); - // Showing a <dialog> should hide all open popups. + // Showing a <dialog> should hide all open popups, immediately. if (RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()) { - GetDocument().HideAllPopupsUntil(nullptr, HidePopupFocusBehavior::kNone); + Element::HideAllPopupsUntil(nullptr, GetDocument(), + HidePopupFocusBehavior::kNone, + HidePopupForcingLevel::kHideImmediately); } // The layout must be updated here because setFocusForDialog calls @@ -241,9 +243,11 @@ WebFeature::kShowModalForElementInFullscreenStack); } - // Showing a <dialog> should hide all open popups. + // Showing a <dialog> should hide all open popups, immediately. if (RuntimeEnabledFeatures::HTMLPopupAttributeEnabled()) { - document.HideAllPopupsUntil(nullptr, HidePopupFocusBehavior::kNone); + Element::HideAllPopupsUntil(nullptr, document, + HidePopupFocusBehavior::kNone, + HidePopupForcingLevel::kHideImmediately); } document.AddToTopLayer(this);
diff --git a/third_party/blink/renderer/core/inspector/inspector_trace_events.cc b/third_party/blink/renderer/core/inspector/inspector_trace_events.cc index a1e1fa7..3ec9426 100644 --- a/third_party/blink/renderer/core/inspector/inspector_trace_events.cc +++ b/third_party/blink/renderer/core/inspector/inspector_trace_events.cc
@@ -381,6 +381,7 @@ DEFINE_STRING_MAPPING(PseudoListBox) DEFINE_STRING_MAPPING(PseudoMultiSelectFocus) DEFINE_STRING_MAPPING(PseudoTopLayer) + DEFINE_STRING_MAPPING(PseudoPopupHidden) DEFINE_STRING_MAPPING(PseudoHostHasAppearance) DEFINE_STRING_MAPPING(PseudoVideoPersistent) DEFINE_STRING_MAPPING(PseudoVideoPersistentAncestor)
diff --git a/third_party/blink/renderer/core/layout/layout_object.cc b/third_party/blink/renderer/core/layout/layout_object.cc index ad613c20..77fb783b 100644 --- a/third_party/blink/renderer/core/layout/layout_object.cc +++ b/third_party/blink/renderer/core/layout/layout_object.cc
@@ -1270,7 +1270,7 @@ return; if (UNLIKELY(IsSVGChild() && !IsNGSVGText() && !IsSVGInline() && - !IsSVGInlineText())) + !IsSVGInlineText() && !IsNGSVGForeignObject())) return; // Don't mark |LayoutFlowThread| because |CollectInlines()| skips them.
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object_test.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object_test.cc index 5c159a2..518881d 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object_test.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object_test.cc
@@ -395,4 +395,16 @@ EXPECT_EQ(parent_g.StrokeBoundingBox(), gfx::RectF(6, 5, 100, 50)); } +// crbug.com/1335655 +TEST_F(LayoutSVGForeignObjectTest, SetNeedsCollectInlines) { + SetBodyInnerHTML(R"HTML( + <svg><foreignObject id="target">abc</foreignObject></svg>)HTML"); + UpdateAllLifecyclePhasesForTest(); + + auto* target = GetElementById("target"); + target->setAttribute("unicode-bidi", "bidi-override"); + GetDocument().body()->innerText(); + // Pass if no crash. +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/style/grid_track_list.cc b/third_party/blink/renderer/core/style/grid_track_list.cc index ffa276a..6474a0d4 100644 --- a/third_party/blink/renderer/core/style/grid_track_list.cc +++ b/third_party/blink/renderer/core/style/grid_track_list.cc
@@ -53,11 +53,6 @@ return repeaters_[index].repeat_count; } -wtf_size_t NGGridTrackList::RepeatIndex(const wtf_size_t index) const { - DCHECK_LT(index, RepeaterCount()); - return repeaters_[index].repeat_index; -} - wtf_size_t NGGridTrackList::RepeatSize(const wtf_size_t index) const { DCHECK_LT(index, RepeaterCount()); return repeaters_[index].repeat_size; @@ -99,9 +94,9 @@ if (repeat_count == 0u || repeater_track_sizes.IsEmpty()) return false; - // If the repeater is auto or there isn't a repeater, the repeat_count should - // be 1. - DCHECK(repeat_type == NGGridTrackRepeater::RepeatType::kInteger || + // If the repeater is auto, the repeat_count should be 1. + DCHECK(repeat_type == NGGridTrackRepeater::RepeatType::kNoRepeat || + repeat_type == NGGridTrackRepeater::RepeatType::kInteger || repeat_count == 1u); // Ensure adding tracks will not overflow the total in this track list and @@ -199,11 +194,6 @@ return ng_track_list_; } -void GridTrackList::SetNGGridTrackList(const NGGridTrackList& other) { - DCHECK(RuntimeEnabledFeatures::LayoutNGEnabled()); - ng_track_list_ = other; -} - void GridTrackList::operator=(const GridTrackList& other) { AssignFrom(other); }
diff --git a/third_party/blink/renderer/core/style/grid_track_list.h b/third_party/blink/renderer/core/style/grid_track_list.h index 50a6f06..42ce0420 100644 --- a/third_party/blink/renderer/core/style/grid_track_list.h +++ b/third_party/blink/renderer/core/style/grid_track_list.h
@@ -49,8 +49,6 @@ // if the repeater is auto. wtf_size_t RepeatCount(const wtf_size_t index, const wtf_size_t auto_value) const; - // Returns the position of the first track size in the repeater at |index|. - wtf_size_t RepeatIndex(const wtf_size_t index) const; // Returns the number of tracks in the repeater at |index|. wtf_size_t RepeatSize(const wtf_size_t index) const; // Returns the repeat type of the repeater at |index|. @@ -118,8 +116,6 @@ NGGridTrackList& NGTrackList(); const NGGridTrackList& NGTrackList() const; - void SetNGGridTrackList(const NGGridTrackList& other); - void operator=(const GridTrackList& other); bool operator==(const GridTrackList& other) const; bool operator!=(const GridTrackList& other) const;
diff --git a/third_party/blink/renderer/core/style/grid_track_size.h b/third_party/blink/renderer/core/style/grid_track_size.h index e9a885f..8a77ff2e 100644 --- a/third_party/blink/renderer/core/style/grid_track_size.h +++ b/third_party/blink/renderer/core/style/grid_track_size.h
@@ -94,19 +94,6 @@ const GridLength& MinTrackBreadth() const { return min_track_breadth_; } const GridLength& MaxTrackBreadth() const { return max_track_breadth_; } - const GridLength& MinOrFitContentTrackBreadth() const { - if (IsFitContent()) - return fit_content_track_breadth_; - - return min_track_breadth_; - } - const GridLength& MaxOrFitContentTrackBreadth() const { - if (IsFitContent()) - return fit_content_track_breadth_; - - return max_track_breadth_; - } - GridTrackSizeType GetType() const { return type_; } bool IsContentSized() const {
diff --git a/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.cc b/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.cc index 9a204cf..aa06d43 100644 --- a/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.cc +++ b/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.cc
@@ -232,8 +232,8 @@ } // static -AttestationConveyancePreference -TypeConverter<AttestationConveyancePreference, String>::Convert( +absl::optional<AttestationConveyancePreference> +TypeConverter<absl::optional<AttestationConveyancePreference>, String>::Convert( const String& preference) { if (preference == "none") return AttestationConveyancePreference::NONE; @@ -243,8 +243,7 @@ return AttestationConveyancePreference::DIRECT; if (preference == "enterprise") return AttestationConveyancePreference::ENTERPRISE; - NOTREACHED(); - return AttestationConveyancePreference::NONE; + return absl::nullopt; } // static @@ -470,23 +469,13 @@ AuthenticatorSelectionCriteria::From(*options.authenticatorSelection()); } - mojo_options->attestation = - blink::mojom::AttestationConveyancePreference::NONE; + mojo_options->attestation = AttestationConveyancePreference::NONE; if (options.hasAttestation()) { - const auto& attestation = options.attestation(); - if (attestation == "none") { - // Default value. - } else if (attestation == "indirect") { - mojo_options->attestation = - blink::mojom::AttestationConveyancePreference::INDIRECT; - } else if (attestation == "direct") { - mojo_options->attestation = - blink::mojom::AttestationConveyancePreference::DIRECT; - } else if (attestation == "enterprise") { - mojo_options->attestation = - blink::mojom::AttestationConveyancePreference::ENTERPRISE; - } else { - return nullptr; + absl::optional<AttestationConveyancePreference> attestation = + ConvertTo<absl::optional<AttestationConveyancePreference>>( + options.attestation()); + if (attestation) { + mojo_options->attestation = *attestation; } }
diff --git a/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.h b/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.h index 03685449..21d4cb8 100644 --- a/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.h +++ b/third_party/blink/renderer/modules/credentialmanagement/credential_manager_type_converters.h
@@ -91,10 +91,11 @@ }; template <> -struct TypeConverter<blink::mojom::blink::AttestationConveyancePreference, - String> { - static blink::mojom::blink::AttestationConveyancePreference Convert( - const String&); +struct TypeConverter< + absl::optional<blink::mojom::blink::AttestationConveyancePreference>, + String> { + static absl::optional<blink::mojom::blink::AttestationConveyancePreference> + Convert(const String&); }; template <>
diff --git a/third_party/blink/renderer/modules/credentialmanagement/credentials_container.cc b/third_party/blink/renderer/modules/credentialmanagement/credentials_container.cc index 72b6829b..006bf33 100644 --- a/third_party/blink/renderer/modules/credentialmanagement/credentials_container.cc +++ b/third_party/blink/renderer/modules/credentialmanagement/credentials_container.cc
@@ -85,6 +85,7 @@ namespace { +using mojom::blink::AttestationConveyancePreference; using mojom::blink::AuthenticatorAttachment; using mojom::blink::AuthenticatorStatus; using mojom::blink::CredentialInfo; @@ -1447,6 +1448,16 @@ WTF::Bind(&AbortPublicKeyRequest, WrapPersistent(script_state))); } + if (options->publicKey()->hasAttestation() && + !mojo::ConvertTo<absl::optional<AttestationConveyancePreference>>( + options->publicKey()->attestation())) { + resolver->DomWindow()->AddConsoleMessage( + MakeGarbageCollected<ConsoleMessage>( + mojom::blink::ConsoleMessageSource::kJavaScript, + mojom::blink::ConsoleMessageLevel::kWarning, + "Ignoring unknown publicKey.attestation value")); + } + if (options->publicKey()->hasAuthenticatorSelection() && options->publicKey() ->authenticatorSelection()
diff --git a/third_party/blink/renderer/modules/credentialmanagement/public_key_credential_creation_options.idl b/third_party/blink/renderer/modules/credentialmanagement/public_key_credential_creation_options.idl index 3cf8af1..ef711ae9 100644 --- a/third_party/blink/renderer/modules/credentialmanagement/public_key_credential_creation_options.idl +++ b/third_party/blink/renderer/modules/credentialmanagement/public_key_credential_creation_options.idl
@@ -2,17 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// https://w3c.github.io/webauthn/#enumdef-attestationconveyancepreference - -enum AttestationConveyancePreference { - "none", - "indirect", - "direct", - "enterprise", -}; - // https://w3c.github.io/webauthn/#dictdef-PublicKeyCredentialCreationOptions - dictionary PublicKeyCredentialCreationOptions { required PublicKeyCredentialRpEntity rp; required PublicKeyCredentialUserEntity user; @@ -21,6 +11,7 @@ unsigned long timeout; sequence<PublicKeyCredentialDescriptor> excludeCredentials = []; AuthenticatorSelectionCriteria authenticatorSelection; - AttestationConveyancePreference attestation; + // https://w3c.github.io/webauthn/#enumdef-attestationconveyancepreference + DOMString attestation; AuthenticationExtensionsClientInputs extensions; };
diff --git a/third_party/blink/renderer/modules/webcodecs/video_frame_handle.cc b/third_party/blink/renderer/modules/webcodecs/video_frame_handle.cc index 437cfae..1508153 100644 --- a/third_party/blink/renderer/modules/webcodecs/video_frame_handle.cc +++ b/third_party/blink/renderer/modules/webcodecs/video_frame_handle.cc
@@ -115,6 +115,7 @@ frame_.reset(); sk_image_.reset(); close_auditor_.reset(); + NotifyExpiredLocked(); } void VideoFrameHandle::MaybeMonitorOpenFrame() { @@ -131,4 +132,26 @@ } } +bool VideoFrameHandle::WebGPURegisterExternalTextureExpireCallback( + WebGPUExternalTextureExpireCallback + webgpu_external_texture_expire_callback) { + WTF::MutexLocker locker(mutex_); + if (!frame_) + return false; + webgpu_external_texture_expire_callbacks_.push_back( + std::move(webgpu_external_texture_expire_callback)); + return true; +} + +void VideoFrameHandle::NotifyExpiredLocked() { + mutex_.AssertAcquired(); + DCHECK(!frame_); + Vector<WebGPUExternalTextureExpireCallback> + webgpu_external_texture_expire_callbacks = + std::move(webgpu_external_texture_expire_callbacks_); + for (auto& callback : webgpu_external_texture_expire_callbacks) { + std::move(callback).Run(); + } +} + } // namespace blink
diff --git a/third_party/blink/renderer/modules/webcodecs/video_frame_handle.h b/third_party/blink/renderer/modules/webcodecs/video_frame_handle.h index 0663e9e..253e2be0 100644 --- a/third_party/blink/renderer/modules/webcodecs/video_frame_handle.h +++ b/third_party/blink/renderer/modules/webcodecs/video_frame_handle.h
@@ -8,6 +8,7 @@ #include "base/memory/scoped_refptr.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/modules/webcodecs/webcodecs_logger.h" +#include "third_party/blink/renderer/platform/wtf/functional.h" #include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" #include "third_party/blink/renderer/platform/wtf/threading_primitives.h" #include "third_party/skia/include/core/SkRefCnt.h" @@ -54,6 +55,11 @@ VideoFrameHandle(const VideoFrameHandle&) = delete; VideoFrameHandle& operator=(const VideoFrameHandle&) = delete; + // Expire all GPUExternalTextures which are generated from + // importExternalTexture and using VideoFrame as source. This callback should + // be called when VideoFrameHandle is destroyed/Invalidate. + using WebGPUExternalTextureExpireCallback = CrossThreadOnceFunction<void()>; + // Returns a copy of |frame_|, which should be re-used throughout the scope // of a function call, instead of calling frame() multiple times. Otherwise // the frame could be destroyed between calls. @@ -80,6 +86,13 @@ // close auditor so warning messages aren't created for unclosed frames. scoped_refptr<VideoFrameHandle> CloneForInternalUse(); + // GPUExternalTexture generated with VideoFrame source needs to listen to + // the VideoFrameHandle to expire themselves. Return false if the + // VideoFrameHandle has been destroyed. + bool WebGPURegisterExternalTextureExpireCallback( + WebGPUExternalTextureExpireCallback + webgpu_external_texture_expire_callback); + private: friend class WTF::ThreadSafeRefCounted<VideoFrameHandle>; ~VideoFrameHandle(); @@ -87,6 +100,10 @@ // |mutex_| must be held before calling into this. void InvalidateLocked(); + // Inform the GPUExternalTexture that VideoFrame is closed and expire the + // external texture. |mutex_| must be held before calling into this. + void NotifyExpiredLocked(); + void MaybeMonitorOpenFrame(); void MaybeMonitorCloseFrame(); @@ -98,6 +115,8 @@ sk_sp<SkImage> sk_image_; scoped_refptr<media::VideoFrame> frame_; scoped_refptr<WebCodecsLogger::VideoFrameCloseAuditor> close_auditor_; + Vector<WebGPUExternalTextureExpireCallback> + webgpu_external_texture_expire_callbacks_; std::string monitoring_source_id_; };
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc index 39a6246..9524dc5 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
@@ -8201,6 +8201,22 @@ SynthesizeGLError(GL_INVALID_VALUE, function_name, "invalid size"); return false; } + // By design the command buffer has an internal (signed) 32-bit + // limit, so ensure that the amount of data passed down to it + // doesn't exceed what it can handle. Only integer or float typed + // arrays can be passed into the uniform*v or uniformMatrix*v + // functions; each has 4-byte elements. + base::CheckedNumeric<int32_t> total_size(actual_size); + total_size *= 4; + // Add on a fixed constant to account for internal metadata in the + // command buffer. + constexpr int32_t kExtraCommandSize = 1024; + total_size += kExtraCommandSize; + if (!total_size.IsValid()) { + SynthesizeGLError(GL_INVALID_VALUE, function_name, + "size * elementSize, plus a constant, is too large"); + return false; + } return true; }
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_device.cc b/third_party/blink/renderer/modules/webgpu/gpu_device.cc index c21250bf..58ef1ba 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_device.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_device.cc
@@ -571,53 +571,15 @@ visitor->Trace(queue_); visitor->Trace(lost_property_); visitor->Trace(active_external_textures_); - visitor->Trace(external_textures_pending_destroy_); ExecutionContextClient::Trace(visitor); EventTargetWithInlineData::Trace(visitor); } -void GPUDevice::EnsureExternalTextureDestroyed( - GPUExternalTexture* externalTexture) { - DCHECK(externalTexture); - external_textures_pending_destroy_.push_back(externalTexture); - - if (has_destroy_external_texture_microtask_) - return; - - Microtask::EnqueueMicrotask(WTF::Bind( - &GPUDevice::DestroyExternalTexturesMicrotask, WrapWeakPersistent(this))); - has_destroy_external_texture_microtask_ = true; -} - -void GPUDevice::DestroyExternalTexturesMicrotask() { - // GPUDevice.destroy() call has destroyed all pending external textures. - if (!has_destroy_external_texture_microtask_) - return; - - has_destroy_external_texture_microtask_ = false; - - auto externalTextures = std::move(external_textures_pending_destroy_); - for (Member<GPUExternalTexture> externalTexture : externalTextures) { - externalTexture->Destroy(); - } -} - void GPUDevice::DestroyAllExternalTextures() { - has_destroy_external_texture_microtask_ = false; - - // TODO(crbug.com/1318345): u-nit: fix casing issues in all GPUExternalTexture - // related codes. Using a_b instead of aB. - for (auto& externalTexture : active_external_textures_) { - externalTexture->Destroy(); + for (auto& external_texture : active_external_textures_) { + external_texture->Destroy(); } active_external_textures_.clear(); - - auto externalTexturesPendingDestroy = - std::move(external_textures_pending_destroy_); - for (Member<GPUExternalTexture> externalTexture : - externalTexturesPendingDestroy) { - externalTexture->Destroy(); - } } void GPUDevice::AddActiveExternalTexture(GPUExternalTexture* external_texture) {
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_device.h b/third_party/blink/renderer/modules/webgpu/gpu_device.h index f1bf53d..1917c29 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_device.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_device.h
@@ -140,8 +140,6 @@ void InjectError(WGPUErrorType type, const char* message); void AddConsoleWarning(const char* message); - void EnsureExternalTextureDestroyed(GPUExternalTexture* externalTexture); - void AddActiveExternalTexture(GPUExternalTexture* external_texture); void RemoveActiveExternalTexture(GPUExternalTexture* external_texture); @@ -152,8 +150,6 @@ using LostProperty = ScriptPromiseProperty<Member<GPUDeviceLostInfo>, ToV8UndefinedGenerator>; - void DestroyExternalTexturesMicrotask(); - void DestroyAllExternalTextures(); void OnUncapturedError(WGPUErrorType errorType, const char* message); @@ -199,9 +195,6 @@ static constexpr int kMaxAllowedConsoleWarnings = 500; int allowed_console_warnings_remaining_ = kMaxAllowedConsoleWarnings; - bool has_destroy_external_texture_microtask_ = false; - HeapVector<Member<GPUExternalTexture>> external_textures_pending_destroy_; - // Keep a list of all active GPUExternalTexture. Eagerly destroy them // when the device is destroyed (via .destroy) to free the memory. HeapHashSet<WeakMember<GPUExternalTexture>> active_external_textures_;
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc b/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc index 5ca8acb9..7b0bbca 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_external_texture.cc
@@ -24,6 +24,7 @@ #include "third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.h" #include "third_party/blink/renderer/platform/graphics/gpu/webgpu_mailbox_texture.h" #include "third_party/blink/renderer/platform/graphics/video_frame_image_util.h" +#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" #include "third_party/skia/include/effects/SkColorMatrix.h" #include "third_party/skia/include/third_party/skcms/skcms.h" @@ -438,10 +439,18 @@ device, webgpu_desc, source.media_video_frame, source.video_renderer, absl::nullopt, exception_state); - // Enqueue a microtask to destroy the GPUExternalTexture so that it is - // destroyed immediately after current microtask. + // If the webcodec video frame has been closed or destroyed, set expired to + // true, releasing ownership of the underlying resource and remove the texture + // from active list. Listen to the VideoFrame and insert the texture into + // active list for management. if (external_texture) { - device->EnsureExternalTextureDestroyed(external_texture); + external_texture->ListenToVideoFrame(frame); + + // VideoFrame maybe closed when GPUExternalTexture trying to listen to. + // In that case GPUExternalTexture should be expired and GPUDevice + // doesn't need to manage it. + if (!external_texture->expired()) + device->AddActiveExternalTexture(external_texture); } return external_texture; @@ -475,13 +484,20 @@ absl::optional<int> media_video_frame_unique_id) : DawnObject<WGPUExternalTexture>(device, external_texture), mailbox_texture_(mailbox_texture), - media_video_frame_unique_id_(media_video_frame_unique_id) {} + media_video_frame_unique_id_(media_video_frame_unique_id) { + // Mark GPUExternalTexture without back resources as destroyed because no need + // to do real resource releasing. + if (!mailbox_texture_) + status_ = Status::Destroyed; +} void GPUExternalTexture::Destroy() { - expired_ = true; - if (!mailbox_texture_) + if (status_ == Status::Destroyed) return; + status_ = Status::Destroyed; + + DCHECK(mailbox_texture_); mailbox_texture_.reset(); } @@ -494,6 +510,8 @@ .WebGPURegisterVideoFrameStateCallback(WTF::BindRepeating( &GPUExternalTexture::ContinueCheckingCurrentVideoFrame, WrapPersistent(this))); + + status_ = Status::ListenToHTMLVideoElement; } bool GPUExternalTexture::ContinueCheckingCurrentVideoFrame() { @@ -507,7 +525,7 @@ // HTMLVideoElement transition from having a WMP to not having one. if (!media_player) { - DestroyActiveExternalTexture(); + ExpireExternalTextureFromHTMLVideoElement(); return false; } @@ -515,7 +533,7 @@ // with current video frame from compositor to detect a new presented // video frame and expire the GPUExternalTexture. if (media_video_frame_unique_id_ != media_player->CurrentFrameId()) { - DestroyActiveExternalTexture(); + ExpireExternalTextureFromHTMLVideoElement(); return false; } @@ -527,7 +545,17 @@ DawnObject<WGPUExternalTexture>::Trace(visitor); } -void GPUExternalTexture::DestroyActiveExternalTexture() { +void GPUExternalTexture::ExpireExternalTextureFromHTMLVideoElement() { + DCHECK(status_ != Status::ListenToVideoFrame); + ExpireExternalTexture(); +} + +void GPUExternalTexture::ExpireExternalTextureFromVideoFrame() { + DCHECK(status_ != Status::ListenToHTMLVideoElement); + ExpireExternalTexture(); +} + +void GPUExternalTexture::ExpireExternalTexture() { if (expired()) return; @@ -535,4 +563,41 @@ Destroy(); } +void GPUExternalTexture::ListenToVideoFrame(VideoFrame* frame) { + bool success = frame->handle()->WebGPURegisterExternalTextureExpireCallback( + CrossThreadBindOnce(&GPUExternalTexture::OnVideoFrameClosed, + WrapCrossThreadWeakPersistent(this))); + if (!success) { + Destroy(); + return; + } + + task_runner_ = + device()->GetExecutionContext()->GetTaskRunner(TaskType::kWebGPU); + + status_ = Status::ListenToVideoFrame; +} + +void GPUExternalTexture::OnVideoFrameClosed() { + DCHECK(task_runner_); + + if (task_runner_->BelongsToCurrentThread()) { + ExpireExternalTextureFromVideoFrame(); + } + + // Expire GPUExternalTexture immediately before post task. + status_ = Status::Expired; + + // If current thread is not the one that creates GPUExternalTexture. Post task + // to that thread to destroy the GPUExternalTexture. + task_runner_->PostTask(FROM_HERE, + ConvertToBaseOnceCallback(CrossThreadBindOnce( + &GPUExternalTexture::OnVideoFrameClosed, + WrapCrossThreadWeakPersistent(this)))); +} + +bool GPUExternalTexture::expired() const { + return status_ == Status::Expired || status_ == Status::Destroyed; +} + } // namespace blink
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_external_texture.h b/third_party/blink/renderer/modules/webgpu/gpu_external_texture.h index 2f0535f..9f35f2a 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_external_texture.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_external_texture.h
@@ -5,6 +5,8 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_EXTERNAL_TEXTURE_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGPU_GPU_EXTERNAL_TEXTURE_H_ +#include <atomic> + #include "third_party/blink/renderer/modules/webgpu/dawn_object.h" #include "third_party/blink/renderer/platform/wtf/ref_counted.h" @@ -39,9 +41,10 @@ void Destroy(); - bool expired() const { return expired_; } + bool expired() const; void ListenToHTMLVideoElement(HTMLVideoElement* video); + void ListenToVideoFrame(VideoFrame* frame); // Check whether current VideoFrame is outdated informs // ScriptAnimationController. @@ -51,9 +54,26 @@ // future checks. bool ContinueCheckingCurrentVideoFrame(); + // GPUExternalTexture from VideoFrame expires when VideoFrame is closed. Note + // that all back resources destroyed needs to happen on the thread that + // GPUExternalTexture is created. + // In multithread situation, the callback should change the state of external + // texture to State::Expired and post a task to issue the destroy. + void OnVideoFrameClosed(); + void Trace(Visitor* visitor) const override; private: + // The initial state of GPUExternalTexture is Expired. After listening to the + // imported HTMLVE/VideoFrame, the state should be set to + // ListenToHTMLVideoElement/VideoFrame, and then should only be changed in the + // order: ListenToHTMLVideoElement/VideoFrame(->Expired)->Destroyed. + enum class Status { + ListenToHTMLVideoElement, + ListenToVideoFrame, + Expired, + Destroyed + }; static GPUExternalTexture* FromHTMLVideoElement( GPUDevice* device, HTMLVideoElement* video, @@ -77,15 +97,25 @@ GetProcs().externalTextureSetLabel(GetHandle(), utf8_label.c_str()); } - void DestroyActiveExternalTexture(); + // This is the function to expire the external texture when the imported + // Blink::VideoFrame has been closed. The function is used as callback + // function and be registered to the imported Blink::VideoFrame. + void ExpireExternalTextureFromVideoFrame(); + + // This is the function to expire the external texture when the imported + // HTMLVideoElement it imported from has been closed. The function is used + // as callback function and be registered to the imported HTMLVideoElement. + void ExpireExternalTextureFromHTMLVideoElement(); + + void ExpireExternalTexture(); scoped_refptr<WebGPUMailboxTexture> mailbox_texture_; absl::optional<int> media_video_frame_unique_id_; WeakMember<HTMLVideoElement> video_; + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - // This attribute marks whether GPUExternalTexture will be destroyed. - bool expired_ = false; + std::atomic<Status> status_ = Status::Expired; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index c9be0c2..9d0ce2d6 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -607,11 +607,6 @@ status: "test", }, { - name: "CSSGridTemplatePropertyInterpolation", - depends_on: ["LayoutNGGridFragmentation"], - status: "experimental", - }, - { // This needs to be kept as a runtime flag as long as we need to forcibly // disable it for WebView on Android versions older than P. See // https://crrev.com/f311a84728272e30979432e8474089b3db3c67df @@ -2287,8 +2282,6 @@ }, { name: "SubresourceWebBundles", - origin_trial_feature_name: "SubresourceWebBundles", - origin_trial_allows_third_party: true, status: "experimental" }, {
diff --git a/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.cc b/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.cc index 2b2f5b7..7f5e94f 100644 --- a/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.cc +++ b/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.cc
@@ -532,6 +532,15 @@ std::make_move_iterator(resources.end()))); } +void SynchronousLayerTreeFrameSink:: + OnCompositorFrameTransitionDirectiveProcessed( + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) { + if (layer_tree_frame_sink_id != layer_tree_frame_sink_id_) + return; + client_->OnCompositorFrameTransitionDirectiveProcessed(sequence_id); +} + void SynchronousLayerTreeFrameSink::SetMemoryPolicy(size_t bytes_limit) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); bool became_zero = memory_policy_.bytes_limit_when_visible && !bytes_limit;
diff --git a/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.h b/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.h index 58a3477..5bd28d5 100644 --- a/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.h +++ b/third_party/blink/renderer/platform/widget/compositing/android_webview/synchronous_layer_tree_frame_sink.h
@@ -133,6 +133,9 @@ void SetMemoryPolicy(size_t bytes_limit); void ReclaimResources(uint32_t layer_tree_frame_sink_id, Vector<viz::ReturnedResource> resources); + void OnCompositorFrameTransitionDirectiveProcessed( + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id); void DemandDrawHw(const gfx::Size& viewport_size, const gfx::Rect& viewport_rect_for_tile_priority, const gfx::Transform& transform_for_tile_priority,
diff --git a/third_party/blink/renderer/platform/widget/input/synchronous_compositor_proxy.cc b/third_party/blink/renderer/platform/widget/input/synchronous_compositor_proxy.cc index 559b06f..e18d125 100644 --- a/third_party/blink/renderer/platform/widget/input/synchronous_compositor_proxy.cc +++ b/third_party/blink/renderer/platform/widget/input/synchronous_compositor_proxy.cc
@@ -315,6 +315,15 @@ std::move(resources)); } +void SynchronousCompositorProxy::OnCompositorFrameTransitionDirectiveProcessed( + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) { + if (!layer_tree_frame_sink_) + return; + layer_tree_frame_sink_->OnCompositorFrameTransitionDirectiveProcessed( + layer_tree_frame_sink_id, sequence_id); +} + void SynchronousCompositorProxy::SetSharedMemory( base::WritableSharedMemoryRegion shm_region, SetSharedMemoryCallback callback) {
diff --git a/third_party/blink/renderer/platform/widget/input/synchronous_compositor_proxy.h b/third_party/blink/renderer/platform/widget/input/synchronous_compositor_proxy.h index fc6b555..c2d89c8 100644 --- a/third_party/blink/renderer/platform/widget/input/synchronous_compositor_proxy.h +++ b/third_party/blink/renderer/platform/widget/input/synchronous_compositor_proxy.h
@@ -91,6 +91,9 @@ void SetMemoryPolicy(uint32_t bytes_limit) final; void ReclaimResources(uint32_t layer_tree_frame_sink_id, Vector<viz::ReturnedResource> resources) final; + void OnCompositorFrameTransitionDirectiveProcessed( + uint32_t layer_tree_frame_sink_id, + uint32_t sequence_id) final; void SetScroll(const gfx::PointF& total_scroll_offset) final; void BeginFrame(const viz::BeginFrameArgs& args, const WTF::HashMap<uint32_t, viz::FrameTimingDetails>&
diff --git a/third_party/blink/tools/blinkpy/style/checker.py b/third_party/blink/tools/blinkpy/style/checker.py index 8d1d82c..1b25a305 100644 --- a/third_party/blink/tools/blinkpy/style/checker.py +++ b/third_party/blink/tools/blinkpy/style/checker.py
@@ -82,16 +82,6 @@ '-runtime/virtual', # virtual dtor '-runtime/printf', '-runtime/threadsafe_fn', - # List Python pep8 categories last. - # - # Because much of WebKit's Python code base does not abide by the - # PEP8 79 character limit, we ignore the 79-character-limit category - # pep8/E501 for now. - # - # FIXME: Consider bringing WebKit's Python code base into conformance - # with the 79 character limit, or some higher limit that is - # agreeable to the WebKit project. - '-pep8/E501', # FIXME: Move the pylint rules from the pylintrc to here. This will # also require us to re-work lint_blinkpy.py to produce the equivalent @@ -111,16 +101,12 @@ _PATH_RULES_SPECIFIER = [ # For third-party Python code, keep only the following checks-- # - # No tabs: to avoid having to set the SVN allow-tabs property. - # No trailing white space: since this is easy to correct. # No carriage-return line endings: since this is easy to correct. # ( ['blinkpy/third_party/'], [ '-', - '+pep8/W191', # Tabs - '+pep8/W291', # Trailing white space '+whitespace/carriage_return' ]), ( @@ -212,14 +198,6 @@ categories = categories.union(JSONChecker.categories) categories = categories.union(TestExpectationsChecker.categories) categories = categories.union(PNGChecker.categories) - - # FIXME: Consider adding all of the pep8 categories. Since they - # are not too meaningful for documentation purposes, for - # now we add only the categories needed for the unit tests - # (which validate the consistency of the configuration - # settings against the known categories, etc). - categories = categories.union(['pep8/W191', 'pep8/W291', 'pep8/E501']) - return categories @@ -612,8 +590,6 @@ dispatcher = mock_dispatcher if mock_increment_error_count is None: - # The following blank line is present to avoid flagging by pep8.py. - def increment_error_count(): """Increment the total count of reported errors.""" self.error_count += 1
diff --git a/third_party/blink/tools/blinkpy/style/checker_unittest.py b/third_party/blink/tools/blinkpy/style/checker_unittest.py index 616f77c..ef55ac3 100644 --- a/third_party/blink/tools/blinkpy/style/checker_unittest.py +++ b/third_party/blink/tools/blinkpy/style/checker_unittest.py
@@ -207,9 +207,6 @@ # Third-party Python code: blinkpy/third_party path = "tools/blinkpy/third_party/mock.py" assert_no_check(path, "build/include") - assert_no_check(path, "pep8/E401") # A random pep8 category. - assert_check(path, "pep8/W191") - assert_check(path, "pep8/W291") assert_check(path, "whitespace/carriage_return") def test_max_reports_per_category(self):
diff --git a/third_party/blink/tools/blinkpy/style/checkers/python.py b/third_party/blink/tools/blinkpy/style/checkers/python.py index 92d6b627..cbefb1b 100644 --- a/third_party/blink/tools/blinkpy/style/checkers/python.py +++ b/third_party/blink/tools/blinkpy/style/checkers/python.py
@@ -30,7 +30,6 @@ from blinkpy.common.path_finder import get_blinkpy_thirdparty_dir from blinkpy.common.system.filesystem import FileSystem from blinkpy.common.system.executive import Executive -from blinkpy.third_party import pep8 class PythonChecker(object): @@ -41,30 +40,8 @@ self._handle_style_error = handle_style_error def check(self, lines_unused=None): - self._check_pep8() self._check_pylint() - def _check_pep8(self): - # Initialize pep8.options, which is necessary for - # Checker.check_all() to execute. - pep8.process_options(arglist=[self._file_path]) - - pep8_checker = pep8.Checker(self._file_path) - - def _pep8_handle_error(line_number, offset, text, check): - # FIXME: Incorporate the character offset into the error output. - # This will require updating the error handler __call__ - # signature to include an optional "offset" parameter. - pep8_code = text[:4] - pep8_message = text[5:] - - category = 'pep8/' + pep8_code - - self._handle_style_error(line_number, category, 5, pep8_message) - - pep8_checker.report_error = _pep8_handle_error - pep8_checker.check_all() - def _check_pylint(self): output = self.run_pylint(self._file_path) errors = self._parse_pylint_output(output)
diff --git a/third_party/blink/tools/blinkpy/style/checkers/python_unittest.py b/third_party/blink/tools/blinkpy/style/checkers/python_unittest.py index 106b8190..ebb4ec2 100644 --- a/third_party/blink/tools/blinkpy/style/checkers/python_unittest.py +++ b/third_party/blink/tools/blinkpy/style/checkers/python_unittest.py
@@ -57,9 +57,6 @@ checker.check() self.assertEqual([ - (2, 'pep8/W291', 5, 'trailing whitespace'), - (3, 'pep8/E261', 5, 'at least two spaces before inline comment'), - (3, 'pep8/E262', 5, "inline comment should start with '# '"), (2, 'pylint/C0303(trailing-whitespace)', 5, '[] Trailing whitespace'), (2, 'pylint/E0602(undefined-variable)', 5,
diff --git a/third_party/blink/tools/blinkpy/third_party/README.chromium b/third_party/blink/tools/blinkpy/third_party/README.chromium deleted file mode 100644 index c0d3232..0000000 --- a/third_party/blink/tools/blinkpy/third_party/README.chromium +++ /dev/null
@@ -1,20 +0,0 @@ -This directory contains sources from other projects. - -Code in this directory must document the license under which the source is being -used. If the source itself does not include a license header or file, create -an entry in this file that refers to reliable documentation of the project's -license terms on the web (and add a note pointing here in the README file in -that directory). - -Name: pep8 - A Python style guide checker -Short Name: pep8 -URL: https://pypi.python.org/packages/source/p/pep8/pep8-1.5.7.tar.gz#md5=f6adbdd69365ecca20513c709f9b7c93 -Version: 1.5.7 -License: MIT -License File: NOT_SHIPPED -Security Critical: no -Description: Used during presubmit checks and via lint_blinkpy.py. - There is overlap between pep8 and pylint, but pep8 catches a bunch of - stylistic issues that pylint doesn't (e.g., warning about blank lines, - various whitespace issues, etc.). -Local Modifications: None
diff --git a/third_party/blink/tools/blinkpy/third_party/__init__.py b/third_party/blink/tools/blinkpy/third_party/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/third_party/blink/tools/blinkpy/third_party/__init__.py +++ /dev/null
@@ -1 +0,0 @@ -
diff --git a/third_party/blink/tools/blinkpy/third_party/pep8.py b/third_party/blink/tools/blinkpy/third_party/pep8.py deleted file mode 100755 index f605f18..0000000 --- a/third_party/blink/tools/blinkpy/third_party/pep8.py +++ /dev/null
@@ -1,1942 +0,0 @@ -#!/usr/bin/env python -# pep8.py - Check Python source code formatting, according to PEP 8 -# Copyright (C) 2006-2009 Johann C. Rocholl <johann@rocholl.net> -# Copyright (C) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com> -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation files -# (the "Software"), to deal in the Software without restriction, -# including without limitation the rights to use, copy, modify, merge, -# publish, distribute, sublicense, and/or sell copies of the Software, -# and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -r""" -Check Python source code formatting, according to PEP 8. - -For usage and a list of options, try this: -$ python pep8.py -h - -This program and its regression test suite live here: -http://github.com/jcrocholl/pep8 - -Groups of errors and warnings: -E errors -W warnings -100 indentation -200 whitespace -300 blank lines -400 imports -500 line length -600 deprecation -700 statements -900 syntax error -""" -from __future__ import with_statement - -__version__ = '1.5.7' - -import os -import sys -import re -import time -import inspect -import keyword -import tokenize -from optparse import OptionParser -from fnmatch import fnmatch -try: - from configparser import RawConfigParser - from io import TextIOWrapper -except ImportError: - from ConfigParser import RawConfigParser - -DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__' -DEFAULT_IGNORE = 'E123,E226,E24' -if sys.platform == 'win32': - DEFAULT_CONFIG = os.path.expanduser(r'~\.pep8') -else: - DEFAULT_CONFIG = os.path.join(os.getenv('XDG_CONFIG_HOME') or - os.path.expanduser('~/.config'), 'pep8') -PROJECT_CONFIG = ('setup.cfg', 'tox.ini', '.pep8') -TESTSUITE_PATH = os.path.join(os.path.dirname(__file__), 'testsuite') -MAX_LINE_LENGTH = 79 -REPORT_FORMAT = { - 'default': '%(path)s:%(row)d:%(col)d: %(code)s %(text)s', - 'pylint': '%(path)s:%(row)d: [%(code)s] %(text)s', -} - -PyCF_ONLY_AST = 1024 -SINGLETONS = frozenset(['False', 'None', 'True']) -KEYWORDS = frozenset(keyword.kwlist + ['print']) - SINGLETONS -UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-']) -ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-']) -WS_OPTIONAL_OPERATORS = ARITHMETIC_OP.union(['^', '&', '|', '<<', '>>', '%']) -WS_NEEDED_OPERATORS = frozenset([ - '**=', '*=', '/=', '//=', '+=', '-=', '!=', '<>', '<', '>', - '%=', '^=', '&=', '|=', '==', '<=', '>=', '<<=', '>>=', '=']) -WHITESPACE = frozenset(' \t') -NEWLINE = frozenset([tokenize.NL, tokenize.NEWLINE]) -SKIP_TOKENS = NEWLINE.union([tokenize.INDENT, tokenize.DEDENT]) -# ERRORTOKEN is triggered by backticks in Python 3 -SKIP_COMMENTS = SKIP_TOKENS.union([tokenize.COMMENT, tokenize.ERRORTOKEN]) -BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines'] - -INDENT_REGEX = re.compile(r'([ \t]*)') -RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,') -RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,.*,\s*\w+\s*$') -ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b') -DOCSTRING_REGEX = re.compile(r'u?r?["\']') -EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]') -WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)') -COMPARE_SINGLETON_REGEX = re.compile(r'([=!]=)\s*(None|False|True)') -COMPARE_NEGATIVE_REGEX = re.compile(r'\b(not)\s+[^[({ ]+\s+(in|is)\s') -COMPARE_TYPE_REGEX = re.compile(r'(?:[=!]=|is(?:\s+not)?)\s*type(?:s.\w+Type' - r'|\s*\(\s*([^)]*[^ )])\s*\))') -KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS)) -OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)') -LAMBDA_REGEX = re.compile(r'\blambda\b') -HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$') - -# Work around Python < 2.6 behaviour, which does not generate NL after -# a comment which is on a line by itself. -COMMENT_WITH_NL = tokenize.generate_tokens(['#\n'].pop).send(None)[1] == '#\n' - - -############################################################################## -# Plugins (check functions) for physical lines -############################################################################## - - -def tabs_or_spaces(physical_line, indent_char): - r"""Never mix tabs and spaces. - - The most popular way of indenting Python is with spaces only. The - second-most popular way is with tabs only. Code indented with a mixture - of tabs and spaces should be converted to using spaces exclusively. When - invoking the Python command line interpreter with the -t option, it issues - warnings about code that illegally mixes tabs and spaces. When using -tt - these warnings become errors. These options are highly recommended! - - Okay: if a == 0:\n a = 1\n b = 1 - E101: if a == 0:\n a = 1\n\tb = 1 - """ - indent = INDENT_REGEX.match(physical_line).group(1) - for offset, char in enumerate(indent): - if char != indent_char: - return offset, "E101 indentation contains mixed spaces and tabs" - - -def tabs_obsolete(physical_line): - r"""For new projects, spaces-only are strongly recommended over tabs. - - Okay: if True:\n return - W191: if True:\n\treturn - """ - indent = INDENT_REGEX.match(physical_line).group(1) - if '\t' in indent: - return indent.index('\t'), "W191 indentation contains tabs" - - -def trailing_whitespace(physical_line): - r"""Trailing whitespace is superfluous. - - The warning returned varies on whether the line itself is blank, for easier - filtering for those who want to indent their blank lines. - - Okay: spam(1)\n# - W291: spam(1) \n# - W293: class Foo(object):\n \n bang = 12 - """ - physical_line = physical_line.rstrip('\n') # chr(10), newline - physical_line = physical_line.rstrip('\r') # chr(13), carriage return - physical_line = physical_line.rstrip('\x0c') # chr(12), form feed, ^L - stripped = physical_line.rstrip(' \t\v') - if physical_line != stripped: - if stripped: - return len(stripped), "W291 trailing whitespace" - else: - return 0, "W293 blank line contains whitespace" - - -def trailing_blank_lines(physical_line, lines, line_number, total_lines): - r"""Trailing blank lines are superfluous. - - Okay: spam(1) - W391: spam(1)\n - - However the last line should end with a new line (warning W292). - """ - if line_number == total_lines: - stripped_last_line = physical_line.rstrip() - if not stripped_last_line: - return 0, "W391 blank line at end of file" - if stripped_last_line == physical_line: - return len(physical_line), "W292 no newline at end of file" - - -def maximum_line_length(physical_line, max_line_length, multiline): - r"""Limit all lines to a maximum of 79 characters. - - There are still many devices around that are limited to 80 character - lines; plus, limiting windows to 80 characters makes it possible to have - several windows side-by-side. The default wrapping on such devices looks - ugly. Therefore, please limit all lines to a maximum of 79 characters. - For flowing long blocks of text (docstrings or comments), limiting the - length to 72 characters is recommended. - - Reports error E501. - """ - line = physical_line.rstrip() - length = len(line) - if length > max_line_length and not noqa(line): - # Special case for long URLs in multi-line docstrings or comments, - # but still report the error when the 72 first chars are whitespaces. - chunks = line.split() - if ((len(chunks) == 1 and multiline) or - (len(chunks) == 2 and chunks[0] == '#')) and \ - len(line) - len(chunks[-1]) < max_line_length - 7: - return - if hasattr(line, 'decode'): # Python 2 - # The line could contain multi-byte characters - try: - length = len(line.decode('utf-8')) - except UnicodeError: - pass - if length > max_line_length: - return (max_line_length, "E501 line too long " - "(%d > %d characters)" % (length, max_line_length)) - - -############################################################################## -# Plugins (check functions) for logical lines -############################################################################## - - -def blank_lines(logical_line, blank_lines, indent_level, line_number, - blank_before, previous_logical, previous_indent_level): - r"""Separate top-level function and class definitions with two blank lines. - - Method definitions inside a class are separated by a single blank line. - - Extra blank lines may be used (sparingly) to separate groups of related - functions. Blank lines may be omitted between a bunch of related - one-liners (e.g. a set of dummy implementations). - - Use blank lines in functions, sparingly, to indicate logical sections. - - Okay: def a():\n pass\n\n\ndef b():\n pass - Okay: def a():\n pass\n\n\n# Foo\n# Bar\n\ndef b():\n pass - - E301: class Foo:\n b = 0\n def bar():\n pass - E302: def a():\n pass\n\ndef b(n):\n pass - E303: def a():\n pass\n\n\n\ndef b(n):\n pass - E303: def a():\n\n\n\n pass - E304: @decorator\n\ndef a():\n pass - """ - if line_number < 3 and not previous_logical: - return # Don't expect blank lines before the first line - if previous_logical.startswith('@'): - if blank_lines: - yield 0, "E304 blank lines found after function decorator" - elif blank_lines > 2 or (indent_level and blank_lines == 2): - yield 0, "E303 too many blank lines (%d)" % blank_lines - elif logical_line.startswith(('def ', 'class ', '@')): - if indent_level: - if not (blank_before or previous_indent_level < indent_level or - DOCSTRING_REGEX.match(previous_logical)): - yield 0, "E301 expected 1 blank line, found 0" - elif blank_before != 2: - yield 0, "E302 expected 2 blank lines, found %d" % blank_before - - -def extraneous_whitespace(logical_line): - r"""Avoid extraneous whitespace. - - Avoid extraneous whitespace in these situations: - - Immediately inside parentheses, brackets or braces. - - Immediately before a comma, semicolon, or colon. - - Okay: spam(ham[1], {eggs: 2}) - E201: spam( ham[1], {eggs: 2}) - E201: spam(ham[ 1], {eggs: 2}) - E201: spam(ham[1], { eggs: 2}) - E202: spam(ham[1], {eggs: 2} ) - E202: spam(ham[1 ], {eggs: 2}) - E202: spam(ham[1], {eggs: 2 }) - - E203: if x == 4: print x, y; x, y = y , x - E203: if x == 4: print x, y ; x, y = y, x - E203: if x == 4 : print x, y; x, y = y, x - """ - line = logical_line - for match in EXTRANEOUS_WHITESPACE_REGEX.finditer(line): - text = match.group() - char = text.strip() - found = match.start() - if text == char + ' ': - # assert char in '([{' - yield found + 1, "E201 whitespace after '%s'" % char - elif line[found - 1] != ',': - code = ('E202' if char in '}])' else 'E203') # if char in ',;:' - yield found, "%s whitespace before '%s'" % (code, char) - - -def whitespace_around_keywords(logical_line): - r"""Avoid extraneous whitespace around keywords. - - Okay: True and False - E271: True and False - E272: True and False - E273: True and\tFalse - E274: True\tand False - """ - for match in KEYWORD_REGEX.finditer(logical_line): - before, after = match.groups() - - if '\t' in before: - yield match.start(1), "E274 tab before keyword" - elif len(before) > 1: - yield match.start(1), "E272 multiple spaces before keyword" - - if '\t' in after: - yield match.start(2), "E273 tab after keyword" - elif len(after) > 1: - yield match.start(2), "E271 multiple spaces after keyword" - - -def missing_whitespace(logical_line): - r"""Each comma, semicolon or colon should be followed by whitespace. - - Okay: [a, b] - Okay: (3,) - Okay: a[1:4] - Okay: a[:4] - Okay: a[1:] - Okay: a[1:4:2] - E231: ['a','b'] - E231: foo(bar,baz) - E231: [{'a':'b'}] - """ - line = logical_line - for index in range(len(line) - 1): - char = line[index] - if char in ',;:' and line[index + 1] not in WHITESPACE: - before = line[:index] - if char == ':' and before.count('[') > before.count(']') and \ - before.rfind('{') < before.rfind('['): - continue # Slice syntax, no space required - if char == ',' and line[index + 1] == ')': - continue # Allow tuple with only one element: (3,) - yield index, "E231 missing whitespace after '%s'" % char - - -def indentation(logical_line, previous_logical, indent_char, - indent_level, previous_indent_level): - r"""Use 4 spaces per indentation level. - - For really old code that you don't want to mess up, you can continue to - use 8-space tabs. - - Okay: a = 1 - Okay: if a == 0:\n a = 1 - E111: a = 1 - - Okay: for item in items:\n pass - E112: for item in items:\npass - - Okay: a = 1\nb = 2 - E113: a = 1\n b = 2 - """ - if indent_char == ' ' and indent_level % 4: - yield 0, "E111 indentation is not a multiple of four" - indent_expect = previous_logical.endswith(':') - if indent_expect and indent_level <= previous_indent_level: - yield 0, "E112 expected an indented block" - if indent_level > previous_indent_level and not indent_expect: - yield 0, "E113 unexpected indentation" - - -def continued_indentation(logical_line, tokens, indent_level, hang_closing, - indent_char, noqa, verbose): - r"""Continuation lines indentation. - - Continuation lines should align wrapped elements either vertically - using Python's implicit line joining inside parentheses, brackets - and braces, or using a hanging indent. - - When using a hanging indent these considerations should be applied: - - there should be no arguments on the first line, and - - further indentation should be used to clearly distinguish itself as a - continuation line. - - Okay: a = (\n) - E123: a = (\n ) - - Okay: a = (\n 42) - E121: a = (\n 42) - E122: a = (\n42) - E123: a = (\n 42\n ) - E124: a = (24,\n 42\n) - E125: if (\n b):\n pass - E126: a = (\n 42) - E127: a = (24,\n 42) - E128: a = (24,\n 42) - E129: if (a or\n b):\n pass - E131: a = (\n 42\n 24) - """ - first_row = tokens[0][2][0] - nrows = 1 + tokens[-1][2][0] - first_row - if noqa or nrows == 1: - return - - # indent_next tells us whether the next block is indented; assuming - # that it is indented by 4 spaces, then we should not allow 4-space - # indents on the final continuation line; in turn, some other - # indents are allowed to have an extra 4 spaces. - indent_next = logical_line.endswith(':') - - row = depth = 0 - valid_hangs = (4,) if indent_char != '\t' else (4, 8) - # remember how many brackets were opened on each line - parens = [0] * nrows - # relative indents of physical lines - rel_indent = [0] * nrows - # for each depth, collect a list of opening rows - open_rows = [[0]] - # for each depth, memorize the hanging indentation - hangs = [None] - # visual indents - indent_chances = {} - last_indent = tokens[0][2] - visual_indent = None - # for each depth, memorize the visual indent column - indent = [last_indent[1]] - if verbose >= 3: - print(">>> " + tokens[0][4].rstrip()) - - for token_type, text, start, end, line in tokens: - - newline = row < start[0] - first_row - if newline: - row = start[0] - first_row - newline = not last_token_multiline and token_type not in NEWLINE - - if newline: - # this is the beginning of a continuation line. - last_indent = start - if verbose >= 3: - print("... " + line.rstrip()) - - # record the initial indent. - rel_indent[row] = expand_indent(line) - indent_level - - # identify closing bracket - close_bracket = (token_type == tokenize.OP and text in ']})') - - # is the indent relative to an opening bracket line? - for open_row in reversed(open_rows[depth]): - hang = rel_indent[row] - rel_indent[open_row] - hanging_indent = hang in valid_hangs - if hanging_indent: - break - if hangs[depth]: - hanging_indent = (hang == hangs[depth]) - # is there any chance of visual indent? - visual_indent = (not close_bracket and hang > 0 and - indent_chances.get(start[1])) - - if close_bracket and indent[depth]: - # closing bracket for visual indent - if start[1] != indent[depth]: - yield (start, "E124 closing bracket does not match " - "visual indentation") - elif close_bracket and not hang: - # closing bracket matches indentation of opening bracket's line - if hang_closing: - yield start, "E133 closing bracket is missing indentation" - elif indent[depth] and start[1] < indent[depth]: - if visual_indent is not True: - # visual indent is broken - yield (start, "E128 continuation line " - "under-indented for visual indent") - elif hanging_indent or (indent_next and rel_indent[row] == 8): - # hanging indent is verified - if close_bracket and not hang_closing: - yield (start, "E123 closing bracket does not match " - "indentation of opening bracket's line") - hangs[depth] = hang - elif visual_indent is True: - # visual indent is verified - indent[depth] = start[1] - elif visual_indent in (text, str): - # ignore token lined up with matching one from a previous line - pass - else: - # indent is broken - if hang <= 0: - error = "E122", "missing indentation or outdented" - elif indent[depth]: - error = "E127", "over-indented for visual indent" - elif not close_bracket and hangs[depth]: - error = "E131", "unaligned for hanging indent" - else: - hangs[depth] = hang - if hang > 4: - error = "E126", "over-indented for hanging indent" - else: - error = "E121", "under-indented for hanging indent" - yield start, "%s continuation line %s" % error - - # look for visual indenting - if (parens[row] and token_type not in (tokenize.NL, tokenize.COMMENT) - and not indent[depth]): - indent[depth] = start[1] - indent_chances[start[1]] = True - if verbose >= 4: - print("bracket depth %s indent to %s" % (depth, start[1])) - # deal with implicit string concatenation - elif (token_type in (tokenize.STRING, tokenize.COMMENT) or - text in ('u', 'ur', 'b', 'br')): - indent_chances[start[1]] = str - # special case for the "if" statement because len("if (") == 4 - elif not indent_chances and not row and not depth and text == 'if': - indent_chances[end[1] + 1] = True - elif text == ':' and line[end[1]:].isspace(): - open_rows[depth].append(row) - - # keep track of bracket depth - if token_type == tokenize.OP: - if text in '([{': - depth += 1 - indent.append(0) - hangs.append(None) - if len(open_rows) == depth: - open_rows.append([]) - open_rows[depth].append(row) - parens[row] += 1 - if verbose >= 4: - print("bracket depth %s seen, col %s, visual min = %s" % - (depth, start[1], indent[depth])) - elif text in ')]}' and depth > 0: - # parent indents should not be more than this one - prev_indent = indent.pop() or last_indent[1] - hangs.pop() - for d in range(depth): - if indent[d] > prev_indent: - indent[d] = 0 - for ind in list(indent_chances): - if ind >= prev_indent: - del indent_chances[ind] - del open_rows[depth + 1:] - depth -= 1 - if depth: - indent_chances[indent[depth]] = True - for idx in range(row, -1, -1): - if parens[idx]: - parens[idx] -= 1 - break - assert len(indent) == depth + 1 - if start[1] not in indent_chances: - # allow to line up tokens - indent_chances[start[1]] = text - - last_token_multiline = (start[0] != end[0]) - if last_token_multiline: - rel_indent[end[0] - first_row] = rel_indent[row] - - if indent_next and expand_indent(line) == indent_level + 4: - pos = (start[0], indent[0] + 4) - if visual_indent: - code = "E129 visually indented line" - else: - code = "E125 continuation line" - yield pos, "%s with same indent as next logical line" % code - - -def whitespace_before_parameters(logical_line, tokens): - r"""Avoid extraneous whitespace. - - Avoid extraneous whitespace in the following situations: - - before the open parenthesis that starts the argument list of a - function call. - - before the open parenthesis that starts an indexing or slicing. - - Okay: spam(1) - E211: spam (1) - - Okay: dict['key'] = list[index] - E211: dict ['key'] = list[index] - E211: dict['key'] = list [index] - """ - prev_type, prev_text, __, prev_end, __ = tokens[0] - for index in range(1, len(tokens)): - token_type, text, start, end, __ = tokens[index] - if (token_type == tokenize.OP and - text in '([' and - start != prev_end and - (prev_type == tokenize.NAME or prev_text in '}])') and - # Syntax "class A (B):" is allowed, but avoid it - (index < 2 or tokens[index - 2][1] != 'class') and - # Allow "return (a.foo for a in range(5))" - not keyword.iskeyword(prev_text)): - yield prev_end, "E211 whitespace before '%s'" % text - prev_type = token_type - prev_text = text - prev_end = end - - -def whitespace_around_operator(logical_line): - r"""Avoid extraneous whitespace around an operator. - - Okay: a = 12 + 3 - E221: a = 4 + 5 - E222: a = 4 + 5 - E223: a = 4\t+ 5 - E224: a = 4 +\t5 - """ - for match in OPERATOR_REGEX.finditer(logical_line): - before, after = match.groups() - - if '\t' in before: - yield match.start(1), "E223 tab before operator" - elif len(before) > 1: - yield match.start(1), "E221 multiple spaces before operator" - - if '\t' in after: - yield match.start(2), "E224 tab after operator" - elif len(after) > 1: - yield match.start(2), "E222 multiple spaces after operator" - - -def missing_whitespace_around_operator(logical_line, tokens): - r"""Surround operators with a single space on either side. - - - Always surround these binary operators with a single space on - either side: assignment (=), augmented assignment (+=, -= etc.), - comparisons (==, <, >, !=, <=, >=, in, not in, is, is not), - Booleans (and, or, not). - - - If operators with different priorities are used, consider adding - whitespace around the operators with the lowest priorities. - - Okay: i = i + 1 - Okay: submitted += 1 - Okay: x = x * 2 - 1 - Okay: hypot2 = x * x + y * y - Okay: c = (a + b) * (a - b) - Okay: foo(bar, key='word', *args, **kwargs) - Okay: alpha[:-i] - - E225: i=i+1 - E225: submitted +=1 - E225: x = x /2 - 1 - E225: z = x **y - E226: c = (a+b) * (a-b) - E226: hypot2 = x*x + y*y - E227: c = a|b - E228: msg = fmt%(errno, errmsg) - """ - parens = 0 - need_space = False - prev_type = tokenize.OP - prev_text = prev_end = None - for token_type, text, start, end, line in tokens: - if token_type in SKIP_COMMENTS: - continue - if text in ('(', 'lambda'): - parens += 1 - elif text == ')': - parens -= 1 - if need_space: - if start != prev_end: - # Found a (probably) needed space - if need_space is not True and not need_space[1]: - yield (need_space[0], - "E225 missing whitespace around operator") - need_space = False - elif text == '>' and prev_text in ('<', '-'): - # Tolerate the "<>" operator, even if running Python 3 - # Deal with Python 3's annotated return value "->" - pass - else: - if need_space is True or need_space[1]: - # A needed trailing space was not found - yield prev_end, "E225 missing whitespace around operator" - else: - code, optype = 'E226', 'arithmetic' - if prev_text == '%': - code, optype = 'E228', 'modulo' - elif prev_text not in ARITHMETIC_OP: - code, optype = 'E227', 'bitwise or shift' - yield (need_space[0], "%s missing whitespace " - "around %s operator" % (code, optype)) - need_space = False - elif token_type == tokenize.OP and prev_end is not None: - if text == '=' and parens: - # Allow keyword args or defaults: foo(bar=None). - pass - elif text in WS_NEEDED_OPERATORS: - need_space = True - elif text in UNARY_OPERATORS: - # Check if the operator is being used as a binary operator - # Allow unary operators: -123, -x, +1. - # Allow argument unpacking: foo(*args, **kwargs). - if (prev_text in '}])' if prev_type == tokenize.OP - else prev_text not in KEYWORDS): - need_space = None - elif text in WS_OPTIONAL_OPERATORS: - need_space = None - - if need_space is None: - # Surrounding space is optional, but ensure that - # trailing space matches opening space - need_space = (prev_end, start != prev_end) - elif need_space and start == prev_end: - # A needed opening space was not found - yield prev_end, "E225 missing whitespace around operator" - need_space = False - prev_type = token_type - prev_text = text - prev_end = end - - -def whitespace_around_comma(logical_line): - r"""Avoid extraneous whitespace after a comma or a colon. - - Note: these checks are disabled by default - - Okay: a = (1, 2) - E241: a = (1, 2) - E242: a = (1,\t2) - """ - line = logical_line - for m in WHITESPACE_AFTER_COMMA_REGEX.finditer(line): - found = m.start() + 1 - if '\t' in m.group(): - yield found, "E242 tab after '%s'" % m.group()[0] - else: - yield found, "E241 multiple spaces after '%s'" % m.group()[0] - - -def whitespace_around_named_parameter_equals(logical_line, tokens): - r"""Don't use spaces around the '=' sign in function arguments. - - Don't use spaces around the '=' sign when used to indicate a - keyword argument or a default parameter value. - - Okay: def complex(real, imag=0.0): - Okay: return magic(r=real, i=imag) - Okay: boolean(a == b) - Okay: boolean(a != b) - Okay: boolean(a <= b) - Okay: boolean(a >= b) - - E251: def complex(real, imag = 0.0): - E251: return magic(r = real, i = imag) - """ - parens = 0 - no_space = False - prev_end = None - message = "E251 unexpected spaces around keyword / parameter equals" - for token_type, text, start, end, line in tokens: - if token_type == tokenize.NL: - continue - if no_space: - no_space = False - if start != prev_end: - yield (prev_end, message) - elif token_type == tokenize.OP: - if text == '(': - parens += 1 - elif text == ')': - parens -= 1 - elif parens and text == '=': - no_space = True - if start != prev_end: - yield (prev_end, message) - prev_end = end - - -def whitespace_before_comment(logical_line, tokens): - r"""Separate inline comments by at least two spaces. - - An inline comment is a comment on the same line as a statement. Inline - comments should be separated by at least two spaces from the statement. - They should start with a # and a single space. - - Each line of a block comment starts with a # and a single space - (unless it is indented text inside the comment). - - Okay: x = x + 1 # Increment x - Okay: x = x + 1 # Increment x - Okay: # Block comment - E261: x = x + 1 # Increment x - E262: x = x + 1 #Increment x - E262: x = x + 1 # Increment x - E265: #Block comment - """ - prev_end = (0, 0) - for token_type, text, start, end, line in tokens: - if token_type == tokenize.COMMENT: - inline_comment = line[:start[1]].strip() - if inline_comment: - if prev_end[0] == start[0] and start[1] < prev_end[1] + 2: - yield (prev_end, - "E261 at least two spaces before inline comment") - symbol, sp, comment = text.partition(' ') - bad_prefix = symbol not in ('#', '#:') - if inline_comment: - if bad_prefix or comment[:1].isspace(): - yield start, "E262 inline comment should start with '# '" - elif bad_prefix: - if text.rstrip('#') and (start[0] > 1 or symbol[1] != '!'): - yield start, "E265 block comment should start with '# '" - elif token_type != tokenize.NL: - prev_end = end - - -def imports_on_separate_lines(logical_line): - r"""Imports should usually be on separate lines. - - Okay: import os\nimport sys - E401: import sys, os - - Okay: from subprocess import Popen, PIPE - Okay: from myclas import MyClass - Okay: from foo.bar.yourclass import YourClass - Okay: import myclass - Okay: import foo.bar.yourclass - """ - line = logical_line - if line.startswith('import '): - found = line.find(',') - if -1 < found and ';' not in line[:found]: - yield found, "E401 multiple imports on one line" - - -def compound_statements(logical_line): - r"""Compound statements (on the same line) are generally discouraged. - - While sometimes it's okay to put an if/for/while with a small body - on the same line, never do this for multi-clause statements. - Also avoid folding such long lines! - - Okay: if foo == 'blah':\n do_blah_thing() - Okay: do_one() - Okay: do_two() - Okay: do_three() - - E701: if foo == 'blah': do_blah_thing() - E701: for x in lst: total += x - E701: while t < 10: t = delay() - E701: if foo == 'blah': do_blah_thing() - E701: else: do_non_blah_thing() - E701: try: something() - E701: finally: cleanup() - E701: if foo == 'blah': one(); two(); three() - - E702: do_one(); do_two(); do_three() - E703: do_four(); # useless semicolon - """ - line = logical_line - last_char = len(line) - 1 - found = line.find(':') - while -1 < found < last_char: - before = line[:found] - if (before.count('{') <= before.count('}') and # {'a': 1} (dict) - before.count('[') <= before.count(']') and # [1:2] (slice) - before.count('(') <= before.count(')') and # (Python 3 annotation) - not LAMBDA_REGEX.search(before)): # lambda x: x - yield found, "E701 multiple statements on one line (colon)" - found = line.find(':', found + 1) - found = line.find(';') - while -1 < found: - if found < last_char: - yield found, "E702 multiple statements on one line (semicolon)" - else: - yield found, "E703 statement ends with a semicolon" - found = line.find(';', found + 1) - - -def explicit_line_join(logical_line, tokens): - r"""Avoid explicit line join between brackets. - - The preferred way of wrapping long lines is by using Python's implied line - continuation inside parentheses, brackets and braces. Long lines can be - broken over multiple lines by wrapping expressions in parentheses. These - should be used in preference to using a backslash for line continuation. - - E502: aaa = [123, \\n 123] - E502: aaa = ("bbb " \\n "ccc") - - Okay: aaa = [123,\n 123] - Okay: aaa = ("bbb "\n "ccc") - Okay: aaa = "bbb " \\n "ccc" - """ - prev_start = prev_end = parens = 0 - for token_type, text, start, end, line in tokens: - if start[0] != prev_start and parens and backslash: - yield backslash, "E502 the backslash is redundant between brackets" - if end[0] != prev_end: - if line.rstrip('\r\n').endswith('\\'): - backslash = (end[0], len(line.splitlines()[-1]) - 1) - else: - backslash = None - prev_start = prev_end = end[0] - else: - prev_start = start[0] - if token_type == tokenize.OP: - if text in '([{': - parens += 1 - elif text in ')]}': - parens -= 1 - - -def comparison_to_singleton(logical_line, noqa): - r"""Comparison to singletons should use "is" or "is not". - - Comparisons to singletons like None should always be done - with "is" or "is not", never the equality operators. - - Okay: if arg is not None: - E711: if arg != None: - E712: if arg == True: - - Also, beware of writing if x when you really mean if x is not None -- - e.g. when testing whether a variable or argument that defaults to None was - set to some other value. The other value might have a type (such as a - container) that could be false in a boolean context! - """ - match = not noqa and COMPARE_SINGLETON_REGEX.search(logical_line) - if match: - same = (match.group(1) == '==') - singleton = match.group(2) - msg = "'if cond is %s:'" % (('' if same else 'not ') + singleton) - if singleton in ('None',): - code = 'E711' - else: - code = 'E712' - nonzero = ((singleton == 'True' and same) or - (singleton == 'False' and not same)) - msg += " or 'if %scond:'" % ('' if nonzero else 'not ') - yield match.start(1), ("%s comparison to %s should be %s" % - (code, singleton, msg)) - - -def comparison_negative(logical_line): - r"""Negative comparison should be done using "not in" and "is not". - - Okay: if x not in y:\n pass - Okay: assert (X in Y or X is Z) - Okay: if not (X in Y):\n pass - Okay: zz = x is not y - E713: Z = not X in Y - E713: if not X.B in Y:\n pass - E714: if not X is Y:\n pass - E714: Z = not X.B is Y - """ - match = COMPARE_NEGATIVE_REGEX.search(logical_line) - if match: - pos = match.start(1) - if match.group(2) == 'in': - yield pos, "E713 test for membership should be 'not in'" - else: - yield pos, "E714 test for object identity should be 'is not'" - - -def comparison_type(logical_line): - r"""Object type comparisons should always use isinstance(). - - Do not compare types directly. - - Okay: if isinstance(obj, int): - E721: if type(obj) is type(1): - - When checking if an object is a string, keep in mind that it might be a - unicode string too! In Python 2.3, str and unicode have a common base - class, basestring, so you can do: - - Okay: if isinstance(obj, basestring): - Okay: if type(a1) is type(b1): - """ - match = COMPARE_TYPE_REGEX.search(logical_line) - if match: - inst = match.group(1) - if inst and isidentifier(inst) and inst not in SINGLETONS: - return # Allow comparison for types which are not obvious - yield match.start(), "E721 do not compare types, use 'isinstance()'" - - -def python_3000_has_key(logical_line, noqa): - r"""The {}.has_key() method is removed in Python 3: use the 'in' operator. - - Okay: if "alph" in d:\n print d["alph"] - W601: assert d.has_key('alph') - """ - pos = logical_line.find('.has_key(') - if pos > -1 and not noqa: - yield pos, "W601 .has_key() is deprecated, use 'in'" - - -def python_3000_raise_comma(logical_line): - r"""When raising an exception, use "raise ValueError('message')". - - The older form is removed in Python 3. - - Okay: raise DummyError("Message") - W602: raise DummyError, "Message" - """ - match = RAISE_COMMA_REGEX.match(logical_line) - if match and not RERAISE_COMMA_REGEX.match(logical_line): - yield match.end() - 1, "W602 deprecated form of raising exception" - - -def python_3000_not_equal(logical_line): - r"""New code should always use != instead of <>. - - The older syntax is removed in Python 3. - - Okay: if a != 'no': - W603: if a <> 'no': - """ - pos = logical_line.find('<>') - if pos > -1: - yield pos, "W603 '<>' is deprecated, use '!='" - - -def python_3000_backticks(logical_line): - r"""Backticks are removed in Python 3: use repr() instead. - - Okay: val = repr(1 + 2) - W604: val = `1 + 2` - """ - pos = logical_line.find('`') - if pos > -1: - yield pos, "W604 backticks are deprecated, use 'repr()'" - - -############################################################################## -# Helper functions -############################################################################## - - -if '' == ''.encode(): - # Python 2: implicit encoding. - def readlines(filename): - """Read the source code.""" - with open(filename, 'rU') as f: - return f.readlines() - isidentifier = re.compile(r'[a-zA-Z_]\w*').match - stdin_get_value = sys.stdin.read -else: - # Python 3 - def readlines(filename): - """Read the source code.""" - try: - with open(filename, 'rb') as f: - (coding, lines) = tokenize.detect_encoding(f.readline) - f = TextIOWrapper(f, coding, line_buffering=True) - return [l.decode(coding) for l in lines] + f.readlines() - except (LookupError, SyntaxError, UnicodeError): - # Fall back if file encoding is improperly declared - with open(filename, encoding='latin-1') as f: - return f.readlines() - isidentifier = str.isidentifier - - def stdin_get_value(): - return TextIOWrapper(sys.stdin.buffer, errors='ignore').read() -noqa = re.compile(r'# no(?:qa|pep8)\b', re.I).search - - -def expand_indent(line): - r"""Return the amount of indentation. - - Tabs are expanded to the next multiple of 8. - - >>> expand_indent(' ') - 4 - >>> expand_indent('\t') - 8 - >>> expand_indent(' \t') - 8 - >>> expand_indent(' \t') - 16 - """ - if '\t' not in line: - return len(line) - len(line.lstrip()) - result = 0 - for char in line: - if char == '\t': - result = result // 8 * 8 + 8 - elif char == ' ': - result += 1 - else: - break - return result - - -def mute_string(text): - """Replace contents with 'xxx' to prevent syntax matching. - - >>> mute_string('"abc"') - '"xxx"' - >>> mute_string("'''abc'''") - "'''xxx'''" - >>> mute_string("r'abc'") - "r'xxx'" - """ - # String modifiers (e.g. u or r) - start = text.index(text[-1]) + 1 - end = len(text) - 1 - # Triple quotes - if text[-3:] in ('"""', "'''"): - start += 2 - end -= 2 - return text[:start] + 'x' * (end - start) + text[end:] - - -def parse_udiff(diff, patterns=None, parent='.'): - """Return a dictionary of matching lines.""" - # For each file of the diff, the entry key is the filename, - # and the value is a set of row numbers to consider. - rv = {} - path = nrows = None - for line in diff.splitlines(): - if nrows: - if line[:1] != '-': - nrows -= 1 - continue - if line[:3] == '@@ ': - hunk_match = HUNK_REGEX.match(line) - (row, nrows) = [int(g or '1') for g in hunk_match.groups()] - rv[path].update(range(row, row + nrows)) - elif line[:3] == '+++': - path = line[4:].split('\t', 1)[0] - if path[:2] == 'b/': - path = path[2:] - rv[path] = set() - return dict([(os.path.join(parent, path), rows) - for (path, rows) in rv.items() - if rows and filename_match(path, patterns)]) - - -def normalize_paths(value, parent=os.curdir): - """Parse a comma-separated list of paths. - - Return a list of absolute paths. - """ - if not value or isinstance(value, list): - return value - paths = [] - for path in value.split(','): - if '/' in path: - path = os.path.abspath(os.path.join(parent, path)) - paths.append(path.rstrip('/')) - return paths - - -def filename_match(filename, patterns, default=True): - """Check if patterns contains a pattern that matches filename. - - If patterns is unspecified, this always returns True. - """ - if not patterns: - return default - return any(fnmatch(filename, pattern) for pattern in patterns) - - -if COMMENT_WITH_NL: - def _is_eol_token(token): - return (token[0] in NEWLINE or - (token[0] == tokenize.COMMENT and token[1] == token[4])) -else: - def _is_eol_token(token): - return token[0] in NEWLINE - - -############################################################################## -# Framework to run all checks -############################################################################## - - -_checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}} - - -def register_check(check, codes=None): - """Register a new check object.""" - def _add_check(check, kind, codes, args): - if check in _checks[kind]: - _checks[kind][check][0].extend(codes or []) - else: - _checks[kind][check] = (codes or [''], args) - if inspect.isfunction(check): - args = inspect.getargspec(check)[0] - if args and args[0] in ('physical_line', 'logical_line'): - if codes is None: - codes = ERRORCODE_REGEX.findall(check.__doc__ or '') - _add_check(check, args[0], codes, args) - elif inspect.isclass(check): - if inspect.getargspec(check.__init__)[0][:2] == ['self', 'tree']: - _add_check(check, 'tree', codes, None) - - -def init_checks_registry(): - """Register all globally visible functions. - - The first argument name is either 'physical_line' or 'logical_line'. - """ - mod = inspect.getmodule(register_check) - for (name, function) in inspect.getmembers(mod, inspect.isfunction): - register_check(function) -init_checks_registry() - - -class Checker(object): - """Load a Python source file, tokenize it, check coding style.""" - - def __init__(self, filename=None, lines=None, - options=None, report=None, **kwargs): - if options is None: - options = StyleGuide(kwargs).options - else: - assert not kwargs - self._io_error = None - self._physical_checks = options.physical_checks - self._logical_checks = options.logical_checks - self._ast_checks = options.ast_checks - self.max_line_length = options.max_line_length - self.multiline = False # in a multiline string? - self.hang_closing = options.hang_closing - self.verbose = options.verbose - self.filename = filename - if filename is None: - self.filename = 'stdin' - self.lines = lines or [] - elif filename == '-': - self.filename = 'stdin' - self.lines = stdin_get_value().splitlines(True) - elif lines is None: - try: - self.lines = readlines(filename) - except IOError: - (exc_type, exc) = sys.exc_info()[:2] - self._io_error = '%s: %s' % (exc_type.__name__, exc) - self.lines = [] - else: - self.lines = lines - if self.lines: - ord0 = ord(self.lines[0][0]) - if ord0 in (0xef, 0xfeff): # Strip the UTF-8 BOM - if ord0 == 0xfeff: - self.lines[0] = self.lines[0][1:] - elif self.lines[0][:3] == '\xef\xbb\xbf': - self.lines[0] = self.lines[0][3:] - self.report = report or options.report - self.report_error = self.report.error - - def report_invalid_syntax(self): - """Check if the syntax is valid.""" - (exc_type, exc) = sys.exc_info()[:2] - if len(exc.args) > 1: - offset = exc.args[1] - if len(offset) > 2: - offset = offset[1:3] - else: - offset = (1, 0) - self.report_error(offset[0], offset[1] or 0, - 'E901 %s: %s' % (exc_type.__name__, exc.args[0]), - self.report_invalid_syntax) - - def readline(self): - """Get the next line from the input buffer.""" - if self.line_number >= self.total_lines: - return '' - line = self.lines[self.line_number] - self.line_number += 1 - if self.indent_char is None and line[:1] in WHITESPACE: - self.indent_char = line[0] - return line - - def run_check(self, check, argument_names): - """Run a check plugin.""" - arguments = [] - for name in argument_names: - arguments.append(getattr(self, name)) - return check(*arguments) - - def check_physical(self, line): - """Run all physical checks on a raw input line.""" - self.physical_line = line - for name, check, argument_names in self._physical_checks: - result = self.run_check(check, argument_names) - if result is not None: - (offset, text) = result - self.report_error(self.line_number, offset, text, check) - if text[:4] == 'E101': - self.indent_char = line[0] - - def build_tokens_line(self): - """Build a logical line from tokens.""" - logical = [] - comments = [] - length = 0 - prev_row = prev_col = mapping = None - for token_type, text, start, end, line in self.tokens: - if token_type in SKIP_TOKENS: - continue - if not mapping: - mapping = [(0, start)] - if token_type == tokenize.COMMENT: - comments.append(text) - continue - if token_type == tokenize.STRING: - text = mute_string(text) - if prev_row: - (start_row, start_col) = start - if prev_row != start_row: # different row - prev_text = self.lines[prev_row - 1][prev_col - 1] - if prev_text == ',' or (prev_text not in '{[(' - and text not in '}])'): - text = ' ' + text - elif prev_col != start_col: # different column - text = line[prev_col:start_col] + text - logical.append(text) - length += len(text) - mapping.append((length, end)) - (prev_row, prev_col) = end - self.logical_line = ''.join(logical) - self.noqa = comments and noqa(''.join(comments)) - return mapping - - def check_logical(self): - """Build a line from tokens and run all logical checks on it.""" - self.report.increment_logical_line() - mapping = self.build_tokens_line() - (start_row, start_col) = mapping[0][1] - start_line = self.lines[start_row - 1] - self.indent_level = expand_indent(start_line[:start_col]) - if self.blank_before < self.blank_lines: - self.blank_before = self.blank_lines - if self.verbose >= 2: - print(self.logical_line[:80].rstrip()) - for name, check, argument_names in self._logical_checks: - if self.verbose >= 4: - print(' ' + name) - for offset, text in self.run_check(check, argument_names) or (): - if not isinstance(offset, tuple): - for token_offset, pos in mapping: - if offset <= token_offset: - break - offset = (pos[0], pos[1] + offset - token_offset) - self.report_error(offset[0], offset[1], text, check) - if self.logical_line: - self.previous_indent_level = self.indent_level - self.previous_logical = self.logical_line - self.blank_lines = 0 - self.tokens = [] - - def check_ast(self): - """Build the file's AST and run all AST checks.""" - try: - tree = compile(''.join(self.lines), '', 'exec', PyCF_ONLY_AST) - except (SyntaxError, TypeError): - return self.report_invalid_syntax() - for name, cls, __ in self._ast_checks: - checker = cls(tree, self.filename) - for lineno, offset, text, check in checker.run(): - if not self.lines or not noqa(self.lines[lineno - 1]): - self.report_error(lineno, offset, text, check) - - def generate_tokens(self): - """Tokenize the file, run physical line checks and yield tokens.""" - if self._io_error: - self.report_error(1, 0, 'E902 %s' % self._io_error, readlines) - tokengen = tokenize.generate_tokens(self.readline) - try: - for token in tokengen: - if token[2][0] > self.total_lines: - return - self.maybe_check_physical(token) - yield token - except (SyntaxError, tokenize.TokenError): - self.report_invalid_syntax() - - def maybe_check_physical(self, token): - """If appropriate (based on token), check current physical line(s).""" - # Called after every token, but act only on end of line. - if _is_eol_token(token): - # Obviously, a newline token ends a single physical line. - self.check_physical(token[4]) - elif token[0] == tokenize.STRING and '\n' in token[1]: - # Less obviously, a string that contains newlines is a - # multiline string, either triple-quoted or with internal - # newlines backslash-escaped. Check every physical line in the - # string *except* for the last one: its newline is outside of - # the multiline string, so we consider it a regular physical - # line, and will check it like any other physical line. - # - # Subtleties: - # - we don't *completely* ignore the last line; if it contains - # the magical "# noqa" comment, we disable all physical - # checks for the entire multiline string - # - have to wind self.line_number back because initially it - # points to the last line of the string, and we want - # check_physical() to give accurate feedback - if noqa(token[4]): - return - self.multiline = True - self.line_number = token[2][0] - for line in token[1].split('\n')[:-1]: - self.check_physical(line + '\n') - self.line_number += 1 - self.multiline = False - - def check_all(self, expected=None, line_offset=0): - """Run all checks on the input file.""" - self.report.init_file(self.filename, self.lines, expected, line_offset) - self.total_lines = len(self.lines) - if self._ast_checks: - self.check_ast() - self.line_number = 0 - self.indent_char = None - self.indent_level = self.previous_indent_level = 0 - self.previous_logical = '' - self.tokens = [] - self.blank_lines = self.blank_before = 0 - parens = 0 - for token in self.generate_tokens(): - self.tokens.append(token) - token_type, text = token[0:2] - if self.verbose >= 3: - if token[2][0] == token[3][0]: - pos = '[%s:%s]' % (token[2][1] or '', token[3][1]) - else: - pos = 'l.%s' % token[3][0] - print('l.%s\t%s\t%s\t%r' % - (token[2][0], pos, tokenize.tok_name[token[0]], text)) - if token_type == tokenize.OP: - if text in '([{': - parens += 1 - elif text in '}])': - parens -= 1 - elif not parens: - if token_type in NEWLINE: - if token_type == tokenize.NEWLINE: - self.check_logical() - self.blank_before = 0 - elif len(self.tokens) == 1: - # The physical line contains only this token. - self.blank_lines += 1 - del self.tokens[0] - else: - self.check_logical() - elif COMMENT_WITH_NL and token_type == tokenize.COMMENT: - if len(self.tokens) == 1: - # The comment also ends a physical line - token = list(token) - token[1] = text.rstrip('\r\n') - token[3] = (token[2][0], token[2][1] + len(token[1])) - self.tokens = [tuple(token)] - self.check_logical() - if self.tokens: - self.check_physical(self.lines[-1]) - self.check_logical() - return self.report.get_file_results() - - -class BaseReport(object): - """Collect the results of the checks.""" - - print_filename = False - - def __init__(self, options): - self._benchmark_keys = options.benchmark_keys - self._ignore_code = options.ignore_code - # Results - self.elapsed = 0 - self.total_errors = 0 - self.counters = dict.fromkeys(self._benchmark_keys, 0) - self.messages = {} - - def start(self): - """Start the timer.""" - self._start_time = time.time() - - def stop(self): - """Stop the timer.""" - self.elapsed = time.time() - self._start_time - - def init_file(self, filename, lines, expected, line_offset): - """Signal a new file.""" - self.filename = filename - self.lines = lines - self.expected = expected or () - self.line_offset = line_offset - self.file_errors = 0 - self.counters['files'] += 1 - self.counters['physical lines'] += len(lines) - - def increment_logical_line(self): - """Signal a new logical line.""" - self.counters['logical lines'] += 1 - - def error(self, line_number, offset, text, check): - """Report an error, according to options.""" - code = text[:4] - if self._ignore_code(code): - return - if code in self.counters: - self.counters[code] += 1 - else: - self.counters[code] = 1 - self.messages[code] = text[5:] - # Don't care about expected errors or warnings - if code in self.expected: - return - if self.print_filename and not self.file_errors: - print(self.filename) - self.file_errors += 1 - self.total_errors += 1 - return code - - def get_file_results(self): - """Return the count of errors and warnings for this file.""" - return self.file_errors - - def get_count(self, prefix=''): - """Return the total count of errors and warnings.""" - return sum([self.counters[key] - for key in self.messages if key.startswith(prefix)]) - - def get_statistics(self, prefix=''): - """Get statistics for message codes that start with the prefix. - - prefix='' matches all errors and warnings - prefix='E' matches all errors - prefix='W' matches all warnings - prefix='E4' matches all errors that have to do with imports - """ - return ['%-7s %s %s' % (self.counters[key], key, self.messages[key]) - for key in sorted(self.messages) if key.startswith(prefix)] - - def print_statistics(self, prefix=''): - """Print overall statistics (number of errors and warnings).""" - for line in self.get_statistics(prefix): - print(line) - - def print_benchmark(self): - """Print benchmark numbers.""" - print('%-7.2f %s' % (self.elapsed, 'seconds elapsed')) - if self.elapsed: - for key in self._benchmark_keys: - print('%-7d %s per second (%d total)' % - (self.counters[key] / self.elapsed, key, - self.counters[key])) - - -class FileReport(BaseReport): - """Collect the results of the checks and print only the filenames.""" - print_filename = True - - -class StandardReport(BaseReport): - """Collect and print the results of the checks.""" - - def __init__(self, options): - super(StandardReport, self).__init__(options) - self._fmt = REPORT_FORMAT.get(options.format.lower(), - options.format) - self._repeat = options.repeat - self._show_source = options.show_source - self._show_pep8 = options.show_pep8 - - def init_file(self, filename, lines, expected, line_offset): - """Signal a new file.""" - self._deferred_print = [] - return super(StandardReport, self).init_file( - filename, lines, expected, line_offset) - - def error(self, line_number, offset, text, check): - """Report an error, according to options.""" - code = super(StandardReport, self).error(line_number, offset, - text, check) - if code and (self.counters[code] == 1 or self._repeat): - self._deferred_print.append( - (line_number, offset, code, text[5:], check.__doc__)) - return code - - def get_file_results(self): - """Print the result and return the overall count for this file.""" - self._deferred_print.sort() - for line_number, offset, code, text, doc in self._deferred_print: - print(self._fmt % { - 'path': self.filename, - 'row': self.line_offset + line_number, 'col': offset + 1, - 'code': code, 'text': text, - }) - if self._show_source: - if line_number > len(self.lines): - line = '' - else: - line = self.lines[line_number - 1] - print(line.rstrip()) - print(re.sub(r'\S', ' ', line[:offset]) + '^') - if self._show_pep8 and doc: - print(' ' + doc.strip()) - return self.file_errors - - -class DiffReport(StandardReport): - """Collect and print the results for the changed lines only.""" - - def __init__(self, options): - super(DiffReport, self).__init__(options) - self._selected = options.selected_lines - - def error(self, line_number, offset, text, check): - if line_number not in self._selected[self.filename]: - return - return super(DiffReport, self).error(line_number, offset, text, check) - - -class StyleGuide(object): - """Initialize a PEP-8 instance with few options.""" - - def __init__(self, *args, **kwargs): - # build options from the command line - self.checker_class = kwargs.pop('checker_class', Checker) - parse_argv = kwargs.pop('parse_argv', False) - config_file = kwargs.pop('config_file', None) - parser = kwargs.pop('parser', None) - # build options from dict - options_dict = dict(*args, **kwargs) - arglist = None if parse_argv else options_dict.get('paths', None) - options, self.paths = process_options( - arglist, parse_argv, config_file, parser) - if options_dict: - options.__dict__.update(options_dict) - if 'paths' in options_dict: - self.paths = options_dict['paths'] - - self.runner = self.input_file - self.options = options - - if not options.reporter: - options.reporter = BaseReport if options.quiet else StandardReport - - options.select = tuple(options.select or ()) - if not (options.select or options.ignore or - options.testsuite or options.doctest) and DEFAULT_IGNORE: - # The default choice: ignore controversial checks - options.ignore = tuple(DEFAULT_IGNORE.split(',')) - else: - # Ignore all checks which are not explicitly selected - options.ignore = ('',) if options.select else tuple(options.ignore) - options.benchmark_keys = BENCHMARK_KEYS[:] - options.ignore_code = self.ignore_code - options.physical_checks = self.get_checks('physical_line') - options.logical_checks = self.get_checks('logical_line') - options.ast_checks = self.get_checks('tree') - self.init_report() - - def init_report(self, reporter=None): - """Initialize the report instance.""" - self.options.report = (reporter or self.options.reporter)(self.options) - return self.options.report - - def check_files(self, paths=None): - """Run all checks on the paths.""" - if paths is None: - paths = self.paths - report = self.options.report - runner = self.runner - report.start() - try: - for path in paths: - if os.path.isdir(path): - self.input_dir(path) - elif not self.excluded(path): - runner(path) - except KeyboardInterrupt: - print('... stopped') - report.stop() - return report - - def input_file(self, filename, lines=None, expected=None, line_offset=0): - """Run all checks on a Python source file.""" - if self.options.verbose: - print('checking %s' % filename) - fchecker = self.checker_class( - filename, lines=lines, options=self.options) - return fchecker.check_all(expected=expected, line_offset=line_offset) - - def input_dir(self, dirname): - """Check all files in this directory and all subdirectories.""" - dirname = dirname.rstrip('/') - if self.excluded(dirname): - return 0 - counters = self.options.report.counters - verbose = self.options.verbose - filepatterns = self.options.filename - runner = self.runner - for root, dirs, files in os.walk(dirname): - if verbose: - print('directory ' + root) - counters['directories'] += 1 - for subdir in sorted(dirs): - if self.excluded(subdir, root): - dirs.remove(subdir) - for filename in sorted(files): - # contain a pattern that matches? - if ((filename_match(filename, filepatterns) and - not self.excluded(filename, root))): - runner(os.path.join(root, filename)) - - def excluded(self, filename, parent=None): - """Check if the file should be excluded. - - Check if 'options.exclude' contains a pattern that matches filename. - """ - if not self.options.exclude: - return False - basename = os.path.basename(filename) - if filename_match(basename, self.options.exclude): - return True - if parent: - filename = os.path.join(parent, filename) - filename = os.path.abspath(filename) - return filename_match(filename, self.options.exclude) - - def ignore_code(self, code): - """Check if the error code should be ignored. - - If 'options.select' contains a prefix of the error code, - return False. Else, if 'options.ignore' contains a prefix of - the error code, return True. - """ - if len(code) < 4 and any(s.startswith(code) - for s in self.options.select): - return False - return (code.startswith(self.options.ignore) and - not code.startswith(self.options.select)) - - def get_checks(self, argument_name): - """Get all the checks for this category. - - Find all globally visible functions where the first argument name - starts with argument_name and which contain selected tests. - """ - checks = [] - for check, attrs in _checks[argument_name].items(): - (codes, args) = attrs - if any(not (code and self.ignore_code(code)) for code in codes): - checks.append((check.__name__, check, args)) - return sorted(checks) - - -def get_parser(prog='pep8', version=__version__): - parser = OptionParser(prog=prog, version=version, - usage="%prog [options] input ...") - parser.config_options = [ - 'exclude', 'filename', 'select', 'ignore', 'max-line-length', - 'hang-closing', 'count', 'format', 'quiet', 'show-pep8', - 'show-source', 'statistics', 'verbose'] - parser.add_option('-v', '--verbose', default=0, action='count', - help="print status messages, or debug with -vv") - parser.add_option('-q', '--quiet', default=0, action='count', - help="report only file names, or nothing with -qq") - parser.add_option('-r', '--repeat', default=True, action='store_true', - help="(obsolete) show all occurrences of the same error") - parser.add_option('--first', action='store_false', dest='repeat', - help="show first occurrence of each error") - parser.add_option('--exclude', metavar='patterns', default=DEFAULT_EXCLUDE, - help="exclude files or directories which match these " - "comma separated patterns (default: %default)") - parser.add_option('--filename', metavar='patterns', default='*.py', - help="when parsing directories, only check filenames " - "matching these comma separated patterns " - "(default: %default)") - parser.add_option('--select', metavar='errors', default='', - help="select errors and warnings (e.g. E,W6)") - parser.add_option('--ignore', metavar='errors', default='', - help="skip errors and warnings (e.g. E4,W)") - parser.add_option('--show-source', action='store_true', - help="show source code for each error") - parser.add_option('--show-pep8', action='store_true', - help="show text of PEP 8 for each error " - "(implies --first)") - parser.add_option('--statistics', action='store_true', - help="count errors and warnings") - parser.add_option('--count', action='store_true', - help="print total number of errors and warnings " - "to standard error and set exit code to 1 if " - "total is not null") - parser.add_option('--max-line-length', type='int', metavar='n', - default=MAX_LINE_LENGTH, - help="set maximum allowed line length " - "(default: %default)") - parser.add_option('--hang-closing', action='store_true', - help="hang closing bracket instead of matching " - "indentation of opening bracket's line") - parser.add_option('--format', metavar='format', default='default', - help="set the error format [default|pylint|<custom>]") - parser.add_option('--diff', action='store_true', - help="report only lines changed according to the " - "unified diff received on STDIN") - group = parser.add_option_group("Testing Options") - if os.path.exists(TESTSUITE_PATH): - group.add_option('--testsuite', metavar='dir', - help="run regression tests from dir") - group.add_option('--doctest', action='store_true', - help="run doctest on myself") - group.add_option('--benchmark', action='store_true', - help="measure processing speed") - return parser - - -def read_config(options, args, arglist, parser): - """Read both user configuration and local configuration.""" - config = RawConfigParser() - - user_conf = options.config - if user_conf and os.path.isfile(user_conf): - if options.verbose: - print('user configuration: %s' % user_conf) - config.read(user_conf) - - local_dir = os.curdir - parent = tail = args and os.path.abspath(os.path.commonprefix(args)) - while tail: - if config.read([os.path.join(parent, fn) for fn in PROJECT_CONFIG]): - local_dir = parent - if options.verbose: - print('local configuration: in %s' % parent) - break - (parent, tail) = os.path.split(parent) - - pep8_section = parser.prog - if config.has_section(pep8_section): - option_list = dict([(o.dest, o.type or o.action) - for o in parser.option_list]) - - # First, read the default values - (new_options, __) = parser.parse_args([]) - - # Second, parse the configuration - for opt in config.options(pep8_section): - if opt.replace('_', '-') not in parser.config_options: - print(" unknown option '%s' ignored" % opt) - continue - if options.verbose > 1: - print(" %s = %s" % (opt, config.get(pep8_section, opt))) - normalized_opt = opt.replace('-', '_') - opt_type = option_list[normalized_opt] - if opt_type in ('int', 'count'): - value = config.getint(pep8_section, opt) - elif opt_type == 'string': - value = config.get(pep8_section, opt) - if normalized_opt == 'exclude': - value = normalize_paths(value, local_dir) - else: - assert opt_type in ('store_true', 'store_false') - value = config.getboolean(pep8_section, opt) - setattr(new_options, normalized_opt, value) - - # Third, overwrite with the command-line options - (options, __) = parser.parse_args(arglist, values=new_options) - options.doctest = options.testsuite = False - return options - - -def process_options(arglist=None, parse_argv=False, config_file=None, - parser=None): - """Process options passed either via arglist or via command line args.""" - if not parser: - parser = get_parser() - if not parser.has_option('--config'): - if config_file is True: - config_file = DEFAULT_CONFIG - group = parser.add_option_group("Configuration", description=( - "The project options are read from the [%s] section of the " - "tox.ini file or the setup.cfg file located in any parent folder " - "of the path(s) being processed. Allowed options are: %s." % - (parser.prog, ', '.join(parser.config_options)))) - group.add_option('--config', metavar='path', default=config_file, - help="user config file location (default: %default)") - # Don't read the command line if the module is used as a library. - if not arglist and not parse_argv: - arglist = [] - # If parse_argv is True and arglist is None, arguments are - # parsed from the command line (sys.argv) - (options, args) = parser.parse_args(arglist) - options.reporter = None - - if options.ensure_value('testsuite', False): - args.append(options.testsuite) - elif not options.ensure_value('doctest', False): - if parse_argv and not args: - if options.diff or any(os.path.exists(name) - for name in PROJECT_CONFIG): - args = ['.'] - else: - parser.error('input not specified') - options = read_config(options, args, arglist, parser) - options.reporter = parse_argv and options.quiet == 1 and FileReport - - options.filename = options.filename and options.filename.split(',') - options.exclude = normalize_paths(options.exclude) - options.select = options.select and options.select.split(',') - options.ignore = options.ignore and options.ignore.split(',') - - if options.diff: - options.reporter = DiffReport - stdin = stdin_get_value() - options.selected_lines = parse_udiff(stdin, options.filename, args[0]) - args = sorted(options.selected_lines) - - return options, args - - -def _main(): - """Parse options and run checks on Python source.""" - import signal - - # Handle "Broken pipe" gracefully - try: - signal.signal(signal.SIGPIPE, lambda signum, frame: sys.exit(1)) - except AttributeError: - pass # not supported on Windows - - pep8style = StyleGuide(parse_argv=True, config_file=True) - options = pep8style.options - if options.doctest or options.testsuite: - from testsuite.support import run_tests - report = run_tests(pep8style) - else: - report = pep8style.check_files() - if options.statistics: - report.print_statistics() - if options.benchmark: - report.print_benchmark() - if options.testsuite and not options.quiet: - report.print_results() - if report.total_errors: - if options.count: - sys.stderr.write(str(report.total_errors) + '\n') - sys.exit(1) - -if __name__ == '__main__': - _main()
diff --git a/third_party/blink/web_tests/FlagExpectations/disable-layout-ng b/third_party/blink/web_tests/FlagExpectations/disable-layout-ng index 5e410c6..6436ba4b 100644 --- a/third_party/blink/web_tests/FlagExpectations/disable-layout-ng +++ b/third_party/blink/web_tests/FlagExpectations/disable-layout-ng
@@ -437,20 +437,6 @@ crbug.com/1045599 external/wpt/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-007.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-008.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/alignment/replaced-alignment-with-aspect-ratio-009.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-columns-001.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-columns-composition.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-columns-interpolation.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-001.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-002.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-003.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-004.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-rows-001.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-rows-composition.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-rows-interpolation.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-001.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-002.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-003.html [ Failure ] -crbug.com/1045599 external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-004.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/grid-definition/grid-auto-fill-columns-001.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/grid-definition/grid-auto-fill-rows-001.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/grid-definition/grid-auto-fit-columns-001.html [ Failure ]
diff --git a/third_party/blink/web_tests/NeverFixTests b/third_party/blink/web_tests/NeverFixTests index 25f897d5..ce4087d 100644 --- a/third_party/blink/web_tests/NeverFixTests +++ b/third_party/blink/web_tests/NeverFixTests
@@ -1768,8 +1768,6 @@ crbug.com/1119600 wpt_internal/direct-sockets/* [ Skip ] virtual/direct-sockets/external/wpt/direct-sockets/* [ Pass ] virtual/direct-sockets/wpt_internal/direct-sockets/* [ Pass ] -crbug.com/1082020 http/tests/loading/wbn/origin-trial/* [ Skip ] -virtual/subresource-web-bundles-disabled/http/tests/loading/wbn/origin-trial/* [ Pass ] # No good way to automate this test yet external/wpt/file-system-access/showSaveFilePicker-manual.https.html [ Skip ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 93fab66c..f566f22 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -3352,6 +3352,7 @@ crbug.com/626703 [ Win ] virtual/partitioned-cookies/http/tests/inspector-protocol/network/disabled-cache-navigation.js [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 [ Mac11 ] virtual/conversions-debug-mode/wpt_internal/attribution-reporting/simple-event-level-report-test.sub.https.html [ Timeout ] crbug.com/626703 [ Mac11 ] virtual/conversions-debug-mode/wpt_internal/attribution-reporting/simple-aggregatable-report-test.sub.https.html [ Timeout ] crbug.com/626703 [ Linux ] external/wpt/WebCryptoAPI/derive_bits_keys/cfrg_curves_bits.https.any.worker.html [ Crash Failure ] crbug.com/626703 [ Linux ] external/wpt/css/css-color/lch-009.html [ Failure ] @@ -4090,6 +4091,12 @@ crbug.com/1045599 external/wpt/css/css-grid/abspos/grid-abspos-staticpos-align-self-safe-001.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-row-axis-self-baseline-synthesized-004.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/alignment/grid-self-baseline-not-applied-if-sizing-cyclic-dependency-003.html [ Failure ] +crbug.com/759665 external/wpt/css/css-grid/animation/grid-template-columns-001.html [ Failure ] +crbug.com/759665 external/wpt/css/css-grid/animation/grid-template-columns-composition.html [ Failure ] +crbug.com/759665 external/wpt/css/css-grid/animation/grid-template-columns-interpolation.html [ Failure ] +crbug.com/759665 external/wpt/css/css-grid/animation/grid-template-rows-001.html [ Failure ] +crbug.com/759665 external/wpt/css/css-grid/animation/grid-template-rows-composition.html [ Failure ] +crbug.com/759665 external/wpt/css/css-grid/animation/grid-template-rows-interpolation.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/grid-definition/grid-repeat-max-width-001.html [ Failure ] crbug.com/1335889 external/wpt/css/css-grid/grid-model/grid-areas-overflowing-grid-container-009.html [ Failure ]
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 2928f9f..9fc8bb0 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -780,12 +780,6 @@ "args": [ "--enable-features=DisableDocumentDomainByDefault" ] }, { - "prefix": "subresource-web-bundles-disabled", - "platforms": ["Linux", "Mac", "Win"], - "bases": [ "http/tests/loading/wbn/origin-trial/" ], - "args": [ "--disable-blink-features=SubresourceWebBundles" ] - }, - { "prefix": "backface-visibility-interop", "platforms": ["Linux", "Mac", "Win"], "bases": [ "external/wpt/css/css-transforms",
diff --git a/third_party/blink/web_tests/WPTOverrideExpectations b/third_party/blink/web_tests/WPTOverrideExpectations index ba97904..7bec3cf 100644 --- a/third_party/blink/web_tests/WPTOverrideExpectations +++ b/third_party/blink/web_tests/WPTOverrideExpectations
@@ -182,7 +182,6 @@ external/wpt/uievents/order-of-events/mouse-events/wheel-basic.html [ Pass ] # wpt_use_checked_in_metadata external/wpt/uievents/order-of-events/mouse-events/wheel-scrolling.html [ Pass ] # wpt_use_checked_in_metadata -external/wpt/webauthn/createcredential-badargs-attestation.https.html [ Pass ] # wpt_use_checked_in_metadata external/wpt/webauthn/createcredential-badargs-authnrselection.https.html [ Pass ] # wpt_use_checked_in_metadata external/wpt/webauthn/createcredential-badargs-challenge.https.html [ Pass ] # wpt_use_checked_in_metadata external/wpt/webauthn/createcredential-badargs-rp.https.html [ Pass ] # wpt_use_checked_in_metadata
diff --git a/third_party/blink/web_tests/android/WebviewWPTExpectations b/third_party/blink/web_tests/android/WebviewWPTExpectations index 69178771..e56f0c79 100644 --- a/third_party/blink/web_tests/android/WebviewWPTExpectations +++ b/third_party/blink/web_tests/android/WebviewWPTExpectations
@@ -4978,7 +4978,6 @@ crbug.com/1050754 external/wpt/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/cors-check.https.html [ Failure ] crbug.com/1050754 external/wpt/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html [ Failure ] crbug.com/1050754 external/wpt/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/no-cors.https.html [ Failure ] -crbug.com/1050754 external/wpt/webauthn/createcredential-badargs-attestation.https.html [ Crash Failure ] crbug.com/1050754 external/wpt/webauthn/createcredential-badargs-authnrselection.https.html [ Crash Failure ] crbug.com/1050754 external/wpt/webauthn/createcredential-badargs-challenge.https.html [ Crash Failure ] crbug.com/1050754 external/wpt/webauthn/createcredential-badargs-rp.https.html [ Crash Failure ]
diff --git a/third_party/blink/web_tests/external/Version b/third_party/blink/web_tests/external/Version index 04ddc420..432e7f12 100644 --- a/third_party/blink/web_tests/external/Version +++ b/third_party/blink/web_tests/external/Version
@@ -1 +1 @@ -Version: a8393d01f484ff9446568c9d25d986221107c9ec +Version: edca84af42bd7e84da94e63b322fe343191842d2
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index 61cb587f..a349398 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -248080,11 +248080,11 @@ }, "generateKey": { "failures.js": [ - "23fb280182a040c9c42756c1eeedb6af25b1acd5", + "c39e4d211cbdf466efd59a2cf822b4aa8a50f896", [] ], "successes.js": [ - "b99e44d66d40f882fdcd217ddba8b41cba457ea6", + "4a047aa0609d7a6ac6e778f267dfef18d7a0d80a", [] ] }, @@ -248128,13 +248128,13 @@ }, "tools": { "generate.py": [ - "728f914bdb27c2bdd214b10fab5c43cee7b85da6", + "35ba0f0031555faa013c60b5fd6b7efb77569254", [] ] }, "util": { "helpers.js": [ - "fecd8733c0b26a37d6622c2f60405265ebb719cd", + "b6aa6ed0c10cfd74e4e307de38e194636fb8bf22", [] ], "worker-report-crypto-subtle-presence.js": [ @@ -249020,7 +249020,7 @@ [] ], "reports.py": [ - "49305354caf8fa07acabb6cf95d749014d57157c", + "4af2b6a808ec84a964ba57c38db08da6b753c292", [] ] } @@ -252775,6 +252775,14 @@ "1017427c5c28f582c92ba356af2153e4f9851a84", [] ], + "fedcm-iframe-level2.html": [ + "0437f60e483c98b796635daa55b473f0ab4ca40b", + [] + ], + "fedcm-iframe.html": [ + "0601971aeec13c8f81cd7647f449fb74c637aae9", + [] + ], "fedcm-manifest-not-in-list": { "fedcm.json": [ "9d919790050b4c0aaf8bd5a666ccf8a0ab40a40c", @@ -345716,6 +345724,108 @@ } ] ], + "failures_Ed25519.https.any.js": [ + "8f18fb1efe09500697c976a62afef1ca219948a3", + [ + "WebCryptoAPI/generateKey/failures_Ed25519.https.any.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() for Failures" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "failures.js" + ] + ], + "timeout": "long" + } + ], + [ + "WebCryptoAPI/generateKey/failures_Ed25519.https.any.worker.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() for Failures" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "failures.js" + ] + ], + "timeout": "long" + } + ] + ], + "failures_Ed448.https.any.js": [ + "b25dcd14909410125fe147a883e98f41ab281b96", + [ + "WebCryptoAPI/generateKey/failures_Ed448.https.any.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() for Failures" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "failures.js" + ] + ], + "timeout": "long" + } + ], + [ + "WebCryptoAPI/generateKey/failures_Ed448.https.any.worker.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() for Failures" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "failures.js" + ] + ], + "timeout": "long" + } + ] + ], "failures_HMAC.https.any.js": [ "43ce1c026fc74e618bdff87a242858519b2dfb86", [ @@ -345920,6 +346030,108 @@ } ] ], + "failures_X25519.https.any.js": [ + "2662d8697a9a6f41809386f83b9af2fc2460109a", + [ + "WebCryptoAPI/generateKey/failures_X25519.https.any.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() for Failures" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "failures.js" + ] + ], + "timeout": "long" + } + ], + [ + "WebCryptoAPI/generateKey/failures_X25519.https.any.worker.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() for Failures" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "failures.js" + ] + ], + "timeout": "long" + } + ] + ], + "failures_X448.https.any.js": [ + "455e260d1fe920b9d7982f1a91abd56bf842ecee", + [ + "WebCryptoAPI/generateKey/failures_X448.https.any.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() for Failures" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "failures.js" + ] + ], + "timeout": "long" + } + ], + [ + "WebCryptoAPI/generateKey/failures_X448.https.any.worker.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() for Failures" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "failures.js" + ] + ], + "timeout": "long" + } + ] + ], "successes_AES-CBC.https.any.js": [ "80f92c2cb7d7a6bf5e47649ce9b13042f53fd54d", [ @@ -346274,6 +346486,124 @@ } ] ], + "successes_Ed25519.https.any.js": [ + "6b3bc460f60f2f7e9ce2b3070b10d825a69b4268", + [ + "WebCryptoAPI/generateKey/successes_Ed25519.https.any.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() Successful Calls" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "/common/subset-tests.js" + ], + [ + "script", + "successes.js" + ] + ], + "timeout": "long" + } + ], + [ + "WebCryptoAPI/generateKey/successes_Ed25519.https.any.worker.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() Successful Calls" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "/common/subset-tests.js" + ], + [ + "script", + "successes.js" + ] + ], + "timeout": "long" + } + ] + ], + "successes_Ed448.https.any.js": [ + "8e37f57b244b582149261003109e0c2c199d6936", + [ + "WebCryptoAPI/generateKey/successes_Ed448.https.any.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() Successful Calls" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "/common/subset-tests.js" + ], + [ + "script", + "successes.js" + ] + ], + "timeout": "long" + } + ], + [ + "WebCryptoAPI/generateKey/successes_Ed448.https.any.worker.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() Successful Calls" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "/common/subset-tests.js" + ], + [ + "script", + "successes.js" + ] + ], + "timeout": "long" + } + ] + ], "successes_HMAC.https.any.js": [ "18e0b271226ff64969ce6986845774fdf896a6fc", [ @@ -349989,6 +350319,124 @@ "timeout": "long" } ] + ], + "successes_X25519.https.any.js": [ + "0e87cf50108e69608c2ec76cfb424b093316a0e8", + [ + "WebCryptoAPI/generateKey/successes_X25519.https.any.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() Successful Calls" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "/common/subset-tests.js" + ], + [ + "script", + "successes.js" + ] + ], + "timeout": "long" + } + ], + [ + "WebCryptoAPI/generateKey/successes_X25519.https.any.worker.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() Successful Calls" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "/common/subset-tests.js" + ], + [ + "script", + "successes.js" + ] + ], + "timeout": "long" + } + ] + ], + "successes_X448.https.any.js": [ + "e7dbe32696d8fe4dc47445f6f0fa10f756f958aa", + [ + "WebCryptoAPI/generateKey/successes_X448.https.any.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() Successful Calls" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "/common/subset-tests.js" + ], + [ + "script", + "successes.js" + ] + ], + "timeout": "long" + } + ], + [ + "WebCryptoAPI/generateKey/successes_X448.https.any.worker.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: generateKey() Successful Calls" + ], + [ + "timeout", + "long" + ], + [ + "script", + "../util/helpers.js" + ], + [ + "script", + "/common/subset-tests.js" + ], + [ + "script", + "successes.js" + ] + ], + "timeout": "long" + } + ] ] }, "getRandomValues.any.js": [ @@ -350117,6 +350565,41 @@ } ] ], + "okp_importKey.https.any.js": [ + "836d6eaa30571082e50a7fc2ee9bced4e3a5f137", + [ + "WebCryptoAPI/import_export/okp_importKey.https.any.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: importKey() for OKP keys" + ], + [ + "timeout", + "long" + ] + ], + "timeout": "long" + } + ], + [ + "WebCryptoAPI/import_export/okp_importKey.https.any.worker.html", + { + "script_metadata": [ + [ + "title", + "WebCryptoAPI: importKey() for OKP keys" + ], + [ + "timeout", + "long" + ] + ], + "timeout": "long" + } + ] + ], "rsa_importKey.https.any.js": [ "9f9d38a9554be98f256e6f6d30642242185e29b8", [ @@ -368694,6 +369177,13 @@ {} ] ], + "fedcm-iframe.https.html": [ + "ea61c55486635347eeb0db42fec49bffed91f6b9", + [ + null, + {} + ] + ], "fedcm-logout-rps.https.html": [ "9e41d973dd3b078b4716a4a273229a0debc1dc37", [ @@ -378834,6 +379324,34 @@ {} ] ], + "grid-template-columns-neutral-keyframe-001.html": [ + "070539e2c0eda9cbc8585f8bd1fc4217485d97e4", + [ + null, + {} + ] + ], + "grid-template-columns-neutral-keyframe-002.html": [ + "6cd163711ee599366280b352dcb808e83ea2899f", + [ + null, + {} + ] + ], + "grid-template-columns-neutral-keyframe-003.html": [ + "80187cf68487bf3af4d39a0799b30886600e61f3", + [ + null, + {} + ] + ], + "grid-template-columns-neutral-keyframe-004.html": [ + "a207aa713c971cda94052dc8abf810f1e1cb29fd", + [ + null, + {} + ] + ], "grid-template-rows-composition.html": [ "42f9c92e9ad6d2042553e7e4b440adeeddf09bab", [ @@ -378847,6 +379365,34 @@ null, {} ] + ], + "grid-template-rows-neutral-keyframe-001.html": [ + "ecbe0481eded5ede38ab482b9175555258f82861", + [ + null, + {} + ] + ], + "grid-template-rows-neutral-keyframe-002.html": [ + "f63d45b4a71929ae703bd1dc51b875c0c843b12e", + [ + null, + {} + ] + ], + "grid-template-rows-neutral-keyframe-003.html": [ + "5ffd67528ca91f27ae801fe8930745a27c61df0b", + [ + null, + {} + ] + ], + "grid-template-rows-neutral-keyframe-004.html": [ + "941e843624837b16506b9900cc0736f3ca8a5a5f", + [ + null, + {} + ] ] }, "chrome-crash-001.html": [
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures.js index 23fb280..c39e4d21 100644 --- a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures.js +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures.js
@@ -31,7 +31,11 @@ {name: "RSA-PSS", resultType: "CryptoKeyPair", usages: ["sign", "verify"], mandatoryUsages: ["sign"]}, {name: "RSA-OAEP", resultType: "CryptoKeyPair", usages: ["encrypt", "decrypt", "wrapKey", "unwrapKey"], mandatoryUsages: ["decrypt", "unwrapKey"]}, {name: "ECDSA", resultType: "CryptoKeyPair", usages: ["sign", "verify"], mandatoryUsages: ["sign"]}, - {name: "ECDH", resultType: "CryptoKeyPair", usages: ["deriveKey", "deriveBits"], mandatoryUsages: ["deriveKey", "deriveBits"]} + {name: "ECDH", resultType: "CryptoKeyPair", usages: ["deriveKey", "deriveBits"], mandatoryUsages: ["deriveKey", "deriveBits"]}, + {name: "Ed25519", resultType: "CryptoKeyPair", usages: ["sign", "verify"], mandatoryUsages: ["sign"]}, + {name: "Ed448", resultType: "CryptoKeyPair", usages: ["sign", "verify"], mandatoryUsages: ["sign"]}, + {name: "X25519", resultType: "CryptoKeyPair", usages: ["deriveKey", "deriveBits"], mandatoryUsages: ["deriveKey", "deriveBits"]}, + {name: "X448", resultType: "CryptoKeyPair", usages: ["deriveKey", "deriveBits"], mandatoryUsages: ["deriveKey", "deriveBits"]}, ]; var testVectors = [];
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_Ed25519.https.any.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_Ed25519.https.any.js new file mode 100644 index 0000000..8f18fb1 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_Ed25519.https.any.js
@@ -0,0 +1,5 @@ +// META: title=WebCryptoAPI: generateKey() for Failures +// META: timeout=long +// META: script=../util/helpers.js +// META: script=failures.js +run_test(["Ed25519"]);
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any.js new file mode 100644 index 0000000..b25dcd1 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any.js
@@ -0,0 +1,5 @@ +// META: title=WebCryptoAPI: generateKey() for Failures +// META: timeout=long +// META: script=../util/helpers.js +// META: script=failures.js +run_test(["Ed448"]);
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_X25519.https.any.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_X25519.https.any.js new file mode 100644 index 0000000..2662d86 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_X25519.https.any.js
@@ -0,0 +1,5 @@ +// META: title=WebCryptoAPI: generateKey() for Failures +// META: timeout=long +// META: script=../util/helpers.js +// META: script=failures.js +run_test(["X25519"]);
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_X448.https.any.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_X448.https.any.js new file mode 100644 index 0000000..455e260 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/failures_X448.https.any.js
@@ -0,0 +1,5 @@ +// META: title=WebCryptoAPI: generateKey() for Failures +// META: timeout=long +// META: script=../util/helpers.js +// META: script=failures.js +run_test(["X448"]);
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes.js index b99e44d6..4a047aa 100644 --- a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes.js +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes.js
@@ -26,7 +26,11 @@ {name: "RSA-PSS", resultType: "CryptoKeyPair", usages: ["sign", "verify"], mandatoryUsages: ["sign"]}, {name: "RSA-OAEP", resultType: "CryptoKeyPair", usages: ["encrypt", "decrypt", "wrapKey", "unwrapKey"], mandatoryUsages: ["decrypt", "unwrapKey"]}, {name: "ECDSA", resultType: "CryptoKeyPair", usages: ["sign", "verify"], mandatoryUsages: ["sign"]}, - {name: "ECDH", resultType: "CryptoKeyPair", usages: ["deriveKey", "deriveBits"], mandatoryUsages: ["deriveKey", "deriveBits"]} + {name: "ECDH", resultType: "CryptoKeyPair", usages: ["deriveKey", "deriveBits"], mandatoryUsages: ["deriveKey", "deriveBits"]}, + {name: "Ed25519", resultType: "CryptoKeyPair", usages: ["sign", "verify"], mandatoryUsages: ["sign"]}, + {name: "Ed448", resultType: "CryptoKeyPair", usages: ["sign", "verify"], mandatoryUsages: ["sign"]}, + {name: "X25519", resultType: "CryptoKeyPair", usages: ["deriveKey", "deriveBits"], mandatoryUsages: ["deriveKey", "deriveBits"]}, + {name: "X448", resultType: "CryptoKeyPair", usages: ["deriveKey", "deriveBits"], mandatoryUsages: ["deriveKey", "deriveBits"]}, ]; var testVectors = [];
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any.js new file mode 100644 index 0000000..6b3bc46 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any.js
@@ -0,0 +1,6 @@ +// META: title=WebCryptoAPI: generateKey() Successful Calls +// META: timeout=long +// META: script=../util/helpers.js +// META: script=/common/subset-tests.js +// META: script=successes.js +run_test(["Ed25519"]);
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_Ed448.https.any.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_Ed448.https.any.js new file mode 100644 index 0000000..8e37f57 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_Ed448.https.any.js
@@ -0,0 +1,6 @@ +// META: title=WebCryptoAPI: generateKey() Successful Calls +// META: timeout=long +// META: script=../util/helpers.js +// META: script=/common/subset-tests.js +// META: script=successes.js +run_test(["Ed448"]);
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_X25519.https.any.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_X25519.https.any.js new file mode 100644 index 0000000..0e87cf5 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_X25519.https.any.js
@@ -0,0 +1,6 @@ +// META: title=WebCryptoAPI: generateKey() Successful Calls +// META: timeout=long +// META: script=../util/helpers.js +// META: script=/common/subset-tests.js +// META: script=successes.js +run_test(["X25519"]);
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any.js new file mode 100644 index 0000000..e7dbe32 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any.js
@@ -0,0 +1,6 @@ +// META: title=WebCryptoAPI: generateKey() Successful Calls +// META: timeout=long +// META: script=../util/helpers.js +// META: script=/common/subset-tests.js +// META: script=successes.js +run_test(["X448"]);
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/import_export/okp_importKey.https.any.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/import_export/okp_importKey.https.any.js new file mode 100644 index 0000000..836d6ea --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/import_export/okp_importKey.https.any.js
@@ -0,0 +1,282 @@ +// META: title=WebCryptoAPI: importKey() for OKP keys +// META: timeout=long + +// Test importKey and exportKey for OKP algorithms. Only "happy paths" are +// currently tested - those where the operation should succeed. + + var subtle = crypto.subtle; + + var keyData = { + "Ed25519": { + spki: new Uint8Array([48, 42, 48, 5, 6, 3, 43, 101, 112, 3, 33, 0, 216, 225, 137, 99, 216, 9, 212, 135, 217, 84, 154, 204, 174, 198, 116, 46, 126, 235, 162, 77, 138, 13, 59, 20, 183, 227, 202, 234, 6, 137, 61, 204]), + pkcs8: new Uint8Array([48, 46, 2, 1, 0, 48, 5, 6, 3, 43, 101, 112, 4, 34, 4, 32, 243, 200, 244, 196, 141, 248, 120, 20, 110, 140, 211, 191, 109, 244, 229, 14, 56, 155, 167, 7, 78, 21, 194, 53, 45, 205, 93, 48, 141, 76, 168, 31]), + jwk: { + crv: "Ed25519", + d: "88j0xI34eBRujNO_bfTlDjibpwdOFcI1Lc1dMI1MqB8", + x: "2OGJY9gJ1IfZVJrMrsZ0Ln7rok2KDTsUt-PK6gaJPcw", + kty: "OKP" + } + }, + + "Ed448": { + spki: new Uint8Array([48, 67, 48, 5, 6, 3, 43, 101, 113, 3, 58, 0, 171, 75, 184, 133, 253, 125, 44, 90, 242, 78, 131, 113, 12, 255, 160, 199, 74, 87, 226, 116, 128, 29, 178, 5, 123, 11, 220, 94, 160, 50, 182, 254, 107, 199, 139, 128, 69, 54, 90, 235, 38, 232, 110, 31, 20, 253, 52, 157, 7, 196, 132, 149, 245, 164, 106, 90, 128]), + pkcs8: new Uint8Array([48, 71, 2, 1, 0, 48, 5, 6, 3, 43, 101, 113, 4, 59, 4, 57, 14, 255, 3, 69, 140, 40, 224, 23, 156, 82, 29, 227, 18, 201, 105, 183, 131, 67, 72, 236, 171, 153, 26, 96, 227, 178, 233, 167, 158, 76, 217, 228, 128, 239, 41, 23, 18, 210, 200, 61, 4, 114, 114, 213, 201, 244, 40, 102, 79, 105, 109, 38, 112, 69, 143, 29, 46]), + jwk: { + crv: "Ed448", + d: "Dv8DRYwo4BecUh3jEslpt4NDSOyrmRpg47Lpp55M2eSA7ykXEtLIPQRyctXJ9ChmT2ltJnBFjx0u", + x: "q0u4hf19LFryToNxDP-gx0pX4nSAHbIFewvcXqAytv5rx4uARTZa6ybobh8U_TSdB8SElfWkalqA", + kty: "OKP" + } + }, + + "X25519": { + spki: new Uint8Array([48, 42, 48, 5, 6, 3, 43, 101, 110, 3, 33, 0, 28, 242, 177, 230, 2, 46, 197, 55, 55, 30, 215, 245, 62, 84, 250, 17, 84, 216, 62, 152, 235, 100, 234, 81, 250, 229, 179, 48, 124, 254, 151, 6]), + pkcs8: new Uint8Array([48, 46, 2, 1, 0, 48, 5, 6, 3, 43, 101, 110, 4, 34, 4, 32, 200, 131, 142, 118, 208, 87, 223, 183, 216, 201, 90, 105, 225, 56, 22, 10, 221, 99, 115, 253, 113, 164, 210, 118, 187, 86, 227, 168, 27, 100, 255, 97]), + jwk: { + crv: "X25519", + d: "yIOOdtBX37fYyVpp4TgWCt1jc_1xpNJ2u1bjqBtk_2E", + x: "HPKx5gIuxTc3Htf1PlT6EVTYPpjrZOpR-uWzMHz-lwY", + kty: "OKP" + } + }, + + "X448": { + spki: new Uint8Array([48, 66, 48, 5, 6, 3, 43, 101, 111, 3, 57, 0, 182, 4, 161, 209, 165, 205, 29, 148, 38, 213, 97, 239, 99, 10, 158, 177, 108, 190, 105, 213, 185, 202, 97, 94, 220, 83, 99, 62, 251, 82, 234, 49, 230, 230, 160, 161, 219, 172, 198, 231, 108, 188, 230, 72, 45, 126, 75, 163, 213, 93, 158, 128, 39, 101, 206, 111]), + pkcs8: new Uint8Array([48, 70, 2, 1, 0, 48, 5, 6, 3, 43, 101, 111, 4, 58, 4, 56, 88, 199, 210, 154, 62, 181, 25, 178, 157, 0, 207, 177, 145, 187, 100, 252, 109, 138, 66, 216, 241, 113, 118, 39, 43, 137, 242, 39, 45, 24, 25, 41, 92, 101, 37, 192, 130, 150, 113, 176, 82, 239, 7, 39, 83, 15, 24, 142, 49, 208, 204, 83, 191, 38, 146, 158]), + jwk: { + crv: "X448", + d: "WMfSmj61GbKdAM-xkbtk_G2KQtjxcXYnK4nyJy0YGSlcZSXAgpZxsFLvBydTDxiOMdDMU78mkp4", + x: "tgSh0aXNHZQm1WHvYwqesWy-adW5ymFe3FNjPvtS6jHm5qCh26zG52y85kgtfkuj1V2egCdlzm8", + kty: "OKP" + } + }, + + }; + + // combinations to test + var testVectors = [ + {name: "Ed25519", privateUsages: ["sign"], publicUsages: ["verify"]}, + {name: "Ed448", privateUsages: ["sign"], publicUsages: ["verify"]}, + {name: "X25519", privateUsages: ["deriveKey", "deriveBits"], publicUsages: []}, + {name: "X448", privateUsages: ["deriveKey", "deriveBits"], publicUsages: []}, + ]; + + // TESTS ARE HERE: + // Test every test vector, along with all available key data + testVectors.forEach(function(vector) { + [true, false].forEach(function(extractable) { + + // Test public keys first + [[]].forEach(function(usages) { // Only valid usages argument is empty array + ['spki', 'jwk'].forEach(function(format) { + var algorithm = {name: vector.name}; + var data = keyData[vector.name]; + if (format === "jwk") { // Not all fields used for public keys + data = {jwk: {kty: keyData[vector.name].jwk.kty, crv: keyData[vector.name].jwk.crv, x: keyData[vector.name].jwk.x}}; + } + + testFormat(format, algorithm, data, vector.name, usages, extractable); + }); + + }); + + // Next, test private keys + allValidUsages(vector.privateUsages, []).forEach(function(usages) { + ['pkcs8', 'jwk'].forEach(function(format) { + var algorithm = {name: vector.name}; + var data = keyData[vector.name]; + + testFormat(format, algorithm, data, vector.name, usages, extractable); + }); + }); + }); + }); + + + // Test importKey with a given key format and other parameters. If + // extrable is true, export the key and verify that it matches the input. + function testFormat(format, algorithm, keyData, keySize, usages, extractable) { + promise_test(function(test) { + return subtle.importKey(format, keyData[format], algorithm, extractable, usages). + then(function(key) { + assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object"); + if (!extractable) { + return; + } + + return subtle.exportKey(format, key). + then(function(result) { + if (format !== "jwk") { + assert_true(equalBuffers(keyData[format], result), "Round trip works"); + } else { + assert_true(equalJwk(keyData[format], result), "Round trip works"); + } + }, function(err) { + assert_unreached("Threw an unexpected error: " + err.toString()); + }); + }, function(err) { + assert_unreached("Threw an unexpected error: " + err.toString()); + }); + }, "Good parameters: " + keySize.toString() + " bits " + parameterString(format, keyData[format], algorithm, extractable, usages)); + } + + + + // Helper methods follow: + + // Are two array buffers the same? + function equalBuffers(a, b) { + if (a.byteLength !== b.byteLength) { + return false; + } + + var aBytes = new Uint8Array(a); + var bBytes = new Uint8Array(b); + + for (var i=0; i<a.byteLength; i++) { + if (aBytes[i] !== bBytes[i]) { + return false; + } + } + + return true; + } + + // Are two Jwk objects "the same"? That is, does the object returned include + // matching values for each property that was expected? It's okay if the + // returned object has extra methods; they aren't checked. + function equalJwk(expected, got) { + var fields = Object.keys(expected); + var fieldName; + + for(var i=0; i<fields.length; i++) { + fieldName = fields[i]; + if (!(fieldName in got)) { + return false; + } + if (expected[fieldName] !== got[fieldName]) { + return false; + } + } + + return true; + } + + // Build minimal Jwk objects from raw key data and algorithm specifications + function jwkData(keyData, algorithm) { + var result = { + kty: "oct", + k: byteArrayToUnpaddedBase64(keyData) + }; + + if (algorithm.name.substring(0, 3) === "AES") { + result.alg = "A" + (8 * keyData.byteLength).toString() + algorithm.name.substring(4); + } else if (algorithm.name === "HMAC") { + result.alg = "HS" + algorithm.hash.substring(4); + } + return result; + } + + // Jwk format wants Base 64 without the typical padding at the end. + function byteArrayToUnpaddedBase64(byteArray){ + var binaryString = ""; + for (var i=0; i<byteArray.byteLength; i++){ + binaryString += String.fromCharCode(byteArray[i]); + } + var base64String = btoa(binaryString); + + return base64String.replace(/=/g, ""); + } + + // Want to test every valid combination of usages. Start by creating a list + // of all non-empty subsets to possible usages. + function allNonemptySubsetsOf(arr) { + var results = []; + var firstElement; + var remainingElements; + + for(var i=0; i<arr.length; i++) { + firstElement = arr[i]; + remainingElements = arr.slice(i+1); + results.push([firstElement]); + + if (remainingElements.length > 0) { + allNonemptySubsetsOf(remainingElements).forEach(function(combination) { + combination.push(firstElement); + results.push(combination); + }); + } + } + + return results; + } + + // Return a list of all valid usage combinations, given the possible ones + // and the ones that are required for a particular operation. + function allValidUsages(possibleUsages, requiredUsages) { + var allUsages = []; + + allNonemptySubsetsOf(possibleUsages).forEach(function(usage) { + for (var i=0; i<requiredUsages.length; i++) { + if (!usage.includes(requiredUsages[i])) { + return; + } + } + allUsages.push(usage); + }); + + return allUsages; + } + + // Convert method parameters to a string to uniquely name each test + function parameterString(format, data, algorithm, extractable, usages) { + if ("byteLength" in data) { + data = "buffer(" + data.byteLength.toString() + ")"; + } else { + data = "object(" + Object.keys(data).join(", ") + ")"; + } + var result = "(" + + objectToString(format) + ", " + + objectToString(data) + ", " + + objectToString(algorithm) + ", " + + objectToString(extractable) + ", " + + objectToString(usages) + + ")"; + + return result; + } + + // Character representation of any object we may use as a parameter. + function objectToString(obj) { + var keyValuePairs = []; + + if (Array.isArray(obj)) { + return "[" + obj.map(function(elem){return objectToString(elem);}).join(", ") + "]"; + } else if (typeof obj === "object") { + Object.keys(obj).sort().forEach(function(keyName) { + keyValuePairs.push(keyName + ": " + objectToString(obj[keyName])); + }); + return "{" + keyValuePairs.join(", ") + "}"; + } else if (typeof obj === "undefined") { + return "undefined"; + } else { + return obj.toString(); + } + + var keyValuePairs = []; + + Object.keys(obj).sort().forEach(function(keyName) { + var value = obj[keyName]; + if (typeof value === "object") { + value = objectToString(value); + } else if (typeof value === "array") { + value = "[" + value.map(function(elem){return objectToString(elem);}).join(", ") + "]"; + } else { + value = value.toString(); + } + + keyValuePairs.push(keyName + ": " + value); + }); + + return "{" + keyValuePairs.join(", ") + "}"; + }
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/tools/generate.py b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/tools/generate.py index 728f914b..35ba0f0 100644 --- a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/tools/generate.py +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/tools/generate.py
@@ -64,7 +64,8 @@ done();""" names = ["AES-CTR", "AES-CBC", "AES-GCM", "AES-KW", "HMAC", "RSASSA-PKCS1-v1_5", - "RSA-PSS", "RSA-OAEP", "ECDSA", "ECDH"] + "RSA-PSS", "RSA-OAEP", "ECDSA", "ECDH", "Ed25519", "Ed448", "X25519", + "X448"] for filename_pattern, template in [("test_successes_%s.https.html", successes_html), ("test_failures_%s.https.html", failures_html),
diff --git a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/util/helpers.js b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/util/helpers.js index fecd873..b6aa6ed0 100644 --- a/third_party/blink/web_tests/external/wpt/WebCryptoAPI/util/helpers.js +++ b/third_party/blink/web_tests/external/wpt/WebCryptoAPI/util/helpers.js
@@ -20,7 +20,11 @@ "SHA-384", "SHA-512", "HKDF-CTR", - "PBKDF2" + "PBKDF2", + "Ed25519", + "Ed448", + "X25519", + "X448" ]; @@ -177,6 +181,8 @@ curves.forEach(function(curveName) { results.push({name: algorithmName, namedCurve: curveName}); }); + } else if (algorithmName.toUpperCase().substring(0, 1) === "X" || algorithmName.toUpperCase().substring(0, 2) === "ED") { + results.push({ name: algorithmName }); } return results; @@ -216,6 +222,9 @@ return okaySubsets; } +function unique(names) { + return [...new Set(names)]; +} // Algorithm name specifiers are case-insensitive. Generate several // case variations of a given name. @@ -227,5 +236,5 @@ // for slow tests effectively cut the amount of work in third by only // returning one variation if (slowTest) return [mixedCaseName]; - return [upCaseName, lowCaseName, mixedCaseName]; + return unique([upCaseName, lowCaseName, mixedCaseName]); }
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-001.html b/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-001.html deleted file mode 100644 index 070539e..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-001.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <title>grid-template-columns neutral keyframe</title> - <link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing"> - <meta name="assert" content="grid-template-columns supports neutral keyframe."> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - <script src="/css/support/interpolation-testcommon.js"></script> - </head> - <body> - <div id="target"></div> - <script> - test(() => { - target.style.gridTemplateColumns = '1fr 200px'; - var animation = target.animate([{}, {gridTemplateColumns: '30px 300px'}], 1000); - animation.pause(); - animation.currentTime = 500; - assert_equals(getComputedStyle(target).gridTemplateColumns, '30px 250px'); - target.style.gridTemplateColumns = '20px 200px'; - assert_equals(getComputedStyle(target).gridTemplateColumns, '25px 250px'); - }, 'Invalidate the result for the neutral keyframe if the value of the <track-breadth> changes.'); - </script> - </body> -</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-002.html b/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-002.html deleted file mode 100644 index 6cd16371..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-002.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <title>grid-template-columns neutral keyframe</title> - <link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing"> - <meta name="assert" content="grid-template-columns supports neutral keyframe."> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - <script src="/css/support/interpolation-testcommon.js"></script> - </head> - <body> - <div id="target"></div> - <script> - test(() => { - target.style.gridTemplateColumns = '10px minmax(10px, 1fr)'; - var animation = target.animate([{}, {gridTemplateColumns: '30px minmax(30px, 3fr)'}], 1000); - animation.pause(); - animation.currentTime = 500; - assert_equals(getComputedStyle(target).gridTemplateColumns, '20px minmax(20px, 2fr)'); - target.style.gridTemplateColumns = '10px fit-content(10px)'; - assert_equals(getComputedStyle(target).gridTemplateColumns, '20px minmax(30px, 3fr)'); - }, 'Invalidate the result for the neutral keyframe if the type of <track-size> changes.'); - </script> - </body> -</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-003.html b/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-003.html deleted file mode 100644 index 80187cf..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-003.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <title>grid-template-columns neutral keyframe</title> - <link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing"> - <meta name="assert" content="grid-template-columns supports neutral keyframe."> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - <script src="/css/support/interpolation-testcommon.js"></script> - </head> - <body> - <div id="target"></div> - <script> - test(() => { - target.style.gridTemplateColumns = '200px'; - var animation = target.animate([{}, {gridTemplateColumns: '30px 300px'}], 1000); - animation.pause(); - animation.currentTime = 500; - assert_equals(getComputedStyle(target).gridTemplateColumns, '30px 300px'); - target.style.gridTemplateColumns = '20px 200px'; - assert_equals(getComputedStyle(target).gridTemplateColumns, '25px 250px'); - target.style.gridTemplateColumns = '200px'; - assert_equals(getComputedStyle(target).gridTemplateColumns, '30px 300px'); - }, 'Invalidate the result for the neutral keyframe if the size of the list changes.'); - </script> - </body> -</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-004.html b/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-004.html deleted file mode 100644 index a207aa7..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-columns-neutral-keyframe-004.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <title>grid-template-columns neutral keyframe</title> - <link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing"> - <meta name="assert" content="grid-template-columns supports neutral keyframe."> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - <script src="/css/support/interpolation-testcommon.js"></script> - </head> - <body> - <div id="target"></div> - <script> - test(() => { - target.style.gridTemplateColumns = '10px [a] 20px [b]'; - var animation = target.animate([{}, {gridTemplateColumns: '30px 40px [c]'}], 1000); - animation.pause(); - animation.currentTime = 250; - assert_equals(getComputedStyle(target).gridTemplateColumns, '15px [a] 25px [b]'); - target.style.gridTemplateColumns = '10px 20px [d]'; - assert_equals(getComputedStyle(target).gridTemplateColumns, '15px 25px [d]'); - }, 'Invalidate the result for the neutral keyframe if the named lines change.'); - </script> - </body> -</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-001.html b/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-001.html deleted file mode 100644 index ecbe0481..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-001.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <title>grid-template-rows neutral keyframe</title> - <link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing"> - <meta name="assert" content="grid-template-rows supports neutral keyframe."> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - <script src="/css/support/interpolation-testcommon.js"></script> - </head> - <body> - <div id="target"></div> - <script> - test(() => { - target.style.gridTemplateRows = '1fr 200px'; - var animation = target.animate([{}, {gridTemplateRows: '30px 300px'}], 1000); - animation.pause(); - animation.currentTime = 500; - assert_equals(getComputedStyle(target).gridTemplateRows, '30px 250px'); - target.style.gridTemplateRows = '20px 200px'; - assert_equals(getComputedStyle(target).gridTemplateRows, '25px 250px'); - }, 'Invalidate the result for the neutral keyframe if the value of the <track-breadth> changes.'); - </script> - </body> -</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-002.html b/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-002.html deleted file mode 100644 index f63d45b4..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-002.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <title>grid-template-rows neutral keyframe</title> - <link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing"> - <meta name="assert" content="grid-template-rows supports neutral keyframe."> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - <script src="/css/support/interpolation-testcommon.js"></script> - </head> - <body> - <div id="target"></div> - <script> - test(() => { - target.style.gridTemplateRows = '10px minmax(10px, 1fr)'; - var animation = target.animate([{}, {gridTemplateRows: '30px minmax(30px, 3fr)'}], 1000); - animation.pause(); - animation.currentTime = 500; - assert_equals(getComputedStyle(target).gridTemplateRows, '20px minmax(20px, 2fr)'); - target.style.gridTemplateRows = '10px fit-content(10px)'; - assert_equals(getComputedStyle(target).gridTemplateRows, '20px minmax(30px, 3fr)'); - }, 'Invalidate the result for the neutral keyframe if the type of <track-size> changes.'); - </script> - </body> -</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-003.html b/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-003.html deleted file mode 100644 index 5ffd675..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-003.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <title>grid-template-rows neutral keyframe</title> - <link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing"> - <meta name="assert" content="grid-template-rows supports neutral keyframe."> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - <script src="/css/support/interpolation-testcommon.js"></script> - </head> - <body> - <div id="target"></div> - <script> - test(() => { - target.style.gridTemplateRows = '200px'; - var animation = target.animate([{}, {gridTemplateRows: '30px 300px'}], 1000); - animation.pause(); - animation.currentTime = 500; - assert_equals(getComputedStyle(target).gridTemplateRows, '30px 300px'); - target.style.gridTemplateRows = '20px 200px'; - assert_equals(getComputedStyle(target).gridTemplateRows, '25px 250px'); - target.style.gridTemplateRows = '200px'; - assert_equals(getComputedStyle(target).gridTemplateRows, '30px 300px'); - }, 'Invalidate the result for the neutral keyframe if the size of the list changes.'); - </script> - </body> -</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-004.html b/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-004.html deleted file mode 100644 index 941e8436..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-grid/animation/grid-template-rows-neutral-keyframe-004.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <title>grid-template-rows neutral keyframe</title> - <link rel="help" href="https://drafts.csswg.org/css-grid/#track-sizing"> - <meta name="assert" content="grid-template-rows supports neutral keyframe."> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - <script src="/css/support/interpolation-testcommon.js"></script> - </head> - <body> - <div id="target"></div> - <script> - test(() => { - target.style.gridTemplateRows = '10px [a] 20px [b]'; - var animation = target.animate([{}, {gridTemplateRows: '30px 40px [c]'}], 1000); - animation.pause(); - animation.currentTime = 250; - assert_equals(getComputedStyle(target).gridTemplateRows, '15px [a] 25px [b]'); - target.style.gridTemplateRows = '10px 20px [d]'; - assert_equals(getComputedStyle(target).gridTemplateRows, '15px 25px [d]'); - }, 'Invalidate the result for the neutral keyframe if the named lines change.'); - </script> - </body> -</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-display-ref.tentative.html b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-display-ref.tentative.html new file mode 100644 index 0000000..77f1544 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-display-ref.tentative.html
@@ -0,0 +1,34 @@ +<!DOCTYPE html> + +<div class=topmost></div> +<div class=fakepopup>This is a popup</div> + + +<style> + .fakepopup { + /* Per spec: */ + display: block; + position: fixed; + top: 0; + /* Per settings in test file: */ + width: 100px; + height: 100px; + border: 1px solid; + padding: 1em; + margin: 1em; + background: white; + color: black; + /* The animated property */ + left: 100px; + } + .topmost { + position:fixed; + top:0; + left:0; + width:1000px; + height:1000px; + background:green; + margin:0; + padding:0; + } +</style>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-cleanup.tentative.html b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-cleanup.tentative.html new file mode 100644 index 0000000..762458e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-cleanup.tentative.html
@@ -0,0 +1,98 @@ + +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel=author href="mailto:masonf@chromium.org"> +<link rel=help href="https://open-ui.org/components/popup.research.explainer"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="resources/popup-utils.js"></script> +<script src="/streams/resources/test-utils.js"></script> + +<dialog>I am a dialog</dialog> + +<style> +[popup].animation { + left: 0px; +} +[popup].animation:top-layer { + animation: move 1000s; +} +@keyframes move { + from { left: 0px; } + to { left: 200px; } +} + +[popup].transition { + opacity: 0; + transition: opacity 5s; +} +[popup].transition:top-layer { + opacity: 1; +} + +[popup] { + top: 200px; +} +[popup]::backdrop { + background-color: rgba(255,0,0,0.2); +} +</style> + +<script> +function rAF() { + return new Promise(resolve => requestAnimationFrame(resolve)); +} +function addPopup(classname) { + const popup = document.createElement('div'); + popup.popup = 'auto'; + popup.classList = classname; + popup.textContent = 'This is a popup'; + document.body.appendChild(popup); + return popup; +} +promise_test(async () => { + let popup = addPopup("animation"); + let dialog = document.querySelector('dialog'); + popup.showPopup(); // No animations here + await rAF(); + popup.hidePopup(); // Start animations + await rAF(); + popup.remove(); + garbageCollect(); + await rAF(); + // This test passes if it does not crash. +},'Ensure no crashes if running animations are immediately cancelled (document removal)'); + +promise_test(async (t) => { + let popup = addPopup("animation"); + let dialog = document.querySelector('dialog'); + popup.showPopup(); // No animations here + await rAF(); + popup.hidePopup(); // Start animations + await rAF(); + dialog.showModal(); // Immediately hide popup + t.add_cleanup(() => dialog.close()); + await rAF(); + popup.remove(); + garbageCollect(); + await rAF(); + // This test passes if it does not crash. +},'Ensure no crashes if running animations are immediately cancelled (dialog showModal)'); + +promise_test(async (t) => { + let popup = addPopup("transition"); + let dialog = document.querySelector('dialog'); + let button = document.createElement('button'); + t.add_cleanup(() => {popup.remove();button.remove();}); + document.body.appendChild(button); + button.addEventListener('click',() => dialog.show()); + popup.showPopup(); // No animations here + await rAF(); + await clickOn(button); + await rAF(); + // This test passes if it does not crash. +},'Ensure no crashes if running transitions are immediately cancelled (button click)'); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-display.tentative.html b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-display.tentative.html new file mode 100644 index 0000000..410639e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-display.tentative.html
@@ -0,0 +1,61 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<meta charset="utf-8"> +<link rel=author href="mailto:masonf@chromium.org"> +<link rel=help href="https://open-ui.org/components/popup.research.explainer"> +<link rel=match href="popup-animated-display-ref.tentative.html"> + +<div popup>This is a popup</div> +<div class=topmost></div> + +<style> + [popup] { + width: 100px; + height: 100px; + border: 1px solid; + padding: 1em; + margin: 1em; + background: white; + color: black; + left: 0; + transition: left 20s steps(2, jump-end) -10s; + } + [popup]:top-layer { + left: 200px; + } + .topmost { + position:fixed; + z-index: 999999; + top:0; + left:0; + width:1000px; + height:1000px; + background:green; + margin:0; + padding:0; + } +</style> + +<script> +window.onload = () => { + requestAnimationFrame(() => { + requestAnimationFrame(() => { + // This will show the popup, hide the popup, and start the transition. + const popup = document.querySelector('[popup]'); + popup.showPopup(); + popup.getAnimations()[0].finish(); + if (getComputedStyle(popup).left != "200px") + popup.remove(); + popup.hidePopup(); + document.getAnimations()[0].ready.then(() => { + requestAnimationFrame(() => { + requestAnimationFrame(() => { + // Take a screenshot now. + document.documentElement.classList.remove('reftest-wait'); + }); + }); + }); + }); + }); +} +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-finishes-ref.tentative.html b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-finishes-ref.tentative.html new file mode 100644 index 0000000..d8334f9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-finishes-ref.tentative.html
@@ -0,0 +1,16 @@ +<!DOCTYPE html> + +<div class=topmost></div> + +<style> + .topmost { + position:fixed; + top:0; + left:0; + width:1000px; + height:1000px; + background:green; + margin:0; + padding:0; + } +</style>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-finishes.tentative.html b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-finishes.tentative.html new file mode 100644 index 0000000..88e37cb --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-hide-finishes.tentative.html
@@ -0,0 +1,60 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<meta charset="utf-8"> +<link rel=author href="mailto:masonf@chromium.org"> +<link rel=help href="https://open-ui.org/components/popup.research.explainer"> +<link rel=match href="popup-animated-hide-finishes-ref.tentative.html"> + +<div popup>This is a popup</div> +<div class=topmost></div> + +<style> + [popup] { + width: 100px; + height: 100px; + border: 1px solid; + padding: 1em; + margin: 1em; + background: white; + color: black; + left: 0px; + /* Immediate transition: */ + transition: left 1s -1s; + } + [popup]:top-layer { + left: 200px; + } + [popup]::backdrop { + background-color: red; + } + .topmost { + position:fixed; + z-index: 999999; + top:0; + left:0; + width:1000px; + height:1000px; + background:green; + margin:0; + padding:0; + } +</style> + +<script> +window.onload = () => { + requestAnimationFrame(() => { + requestAnimationFrame(() => { + // This will show the popup, hide the popup, and start the hide transition, + // which should immediately finish. + document.querySelector('[popup]').showPopup(); + document.querySelector('[popup]').hidePopup(); + requestAnimationFrame(() => { + requestAnimationFrame(() => { + // Take a screenshot now. + document.documentElement.classList.remove('reftest-wait'); + }); + }); + }); + }); +} +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-show-display.tentative.html b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-show-display.tentative.html new file mode 100644 index 0000000..deb7550 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/popups/popup-animated-show-display.tentative.html
@@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<meta charset="utf-8"> +<link rel=author href="mailto:masonf@chromium.org"> +<link rel=help href="https://open-ui.org/components/popup.research.explainer"> +<link rel=match href="popup-animated-display-ref.tentative.html"> + +<div popup>This is a popup</div> +<div class=topmost></div> + +<style> + [popup] { + width: 100px; + height: 100px; + border: 1px solid; + padding: 1em; + margin: 1em; + background: white; + color: black; + left: 0; + transition: left 20s steps(2, jump-end) -10s; + } + [popup]:top-layer { + left: 200px; + } + .topmost { + position:fixed; + z-index: 999999; + top:0; + left:0; + width:1000px; + height:1000px; + background:green; + margin:0; + padding:0; + } +</style> + +<script> +window.onload = () => { + requestAnimationFrame(() => { + requestAnimationFrame(() => { + // This will show the popup, and start the transition. + document.querySelector('[popup]').showPopup(); + document.getAnimations()[0].ready.then(() => { + requestAnimationFrame(() => { + requestAnimationFrame(() => { + // Take a screenshot now. + document.documentElement.classList.remove('reftest-wait'); + }); + }); + }); + }); + }); +} +</script>
diff --git a/third_party/blink/web_tests/external/wpt/webauthn/createcredential-badargs-attestation.https.html b/third_party/blink/web_tests/external/wpt/webauthn/createcredential-badargs-attestation.https.html deleted file mode 100644 index 1bdebbb..0000000 --- a/third_party/blink/web_tests/external/wpt/webauthn/createcredential-badargs-attestation.https.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>WebAuthn navigator.credentials.create() attestation parameter Tests</title> -<link rel="author" title="Adam Powers" href="mailto:adam@fidoalliance.org"> -<link rel="help" href="https://w3c.github.io/webauthn/#iface-credential"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/testdriver.js"></script> -<script src="/resources/testdriver-vendor.js"></script> -<script src=helpers.js></script> -<body></body> -<script> -standardSetup(function() { - "use strict"; - - // attestation bad values - new CreateCredentialsTest("options.publicKey.attestation", {}).runTest("Bad attestation parameter: attestation is empty object", TypeError); - new CreateCredentialsTest("options.publicKey.attestation", []).runTest("Bad attestation parameter: attestation is empty array", TypeError); - new CreateCredentialsTest("options.publicKey.attestation", null).runTest("Bad attestation parameter: attestation is null", TypeError); - new CreateCredentialsTest("options.publicKey.attestation", "noneofyourbusiness").runTest("Bad attestation parameter: attestation is \"noneofyourbusiness\"", TypeError); - new CreateCredentialsTest("options.publicKey.attestation", "").runTest("Bad attestation parameter: attestation is empty string", TypeError); -}); - -/* JSHINT */ -/* globals standardSetup, CreateCredentialsTest */ -</script>
diff --git a/third_party/blink/web_tests/external/wpt/webauthn/createcredential-passing.https.html b/third_party/blink/web_tests/external/wpt/webauthn/createcredential-passing.https.html index 2d8fb14..2c744b2 100644 --- a/third_party/blink/web_tests/external/wpt/webauthn/createcredential-passing.https.html +++ b/third_party/blink/web_tests/external/wpt/webauthn/createcredential-passing.https.html
@@ -128,6 +128,12 @@ new CreateCredentialsTest("options.publicKey.attestation", "indirect").runTest("attestation parameter: attestation is \"indirect\""); new CreateCredentialsTest("options.publicKey.attestation", "direct").runTest("attestation parameter: attestation is \"direct\""); new CreateCredentialsTest({path: "options.publicKey.attestation", value: undefined}).runTest("attestation parameter: attestation is undefined"); + // attestation unknown values + new CreateCredentialsTest("options.publicKey.attestation", {}).runTest("attestation parameter: attestation is empty object"); + new CreateCredentialsTest("options.publicKey.attestation", []).runTest("attestation parameter: attestation is empty array"); + new CreateCredentialsTest("options.publicKey.attestation", null).runTest("attestation parameter: attestation is null"); + new CreateCredentialsTest("options.publicKey.attestation", "noneofyourbusiness").runTest("attestation parameter: attestation is \"noneofyourbusiness\""); + new CreateCredentialsTest("options.publicKey.attestation", "").runTest("attestation parameter: attestation is empty string"); // TODO: test this with multiple mock authenticators to make sure that the right options are chosen when available? // good extension values
diff --git a/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any-expected.txt b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any-expected.txt new file mode 100644 index 0000000..a986708 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any-expected.txt
@@ -0,0 +1,354 @@ +This is a testharness.js-based test. +Found 350 tests; 324 PASS, 26 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Bad algorithm: generateKey(AES, false, [decrypt]) +PASS Bad algorithm: generateKey(AES, true, [decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign]) +PASS Bad algorithm: generateKey(AES, true, [sign]) +PASS Bad algorithm: generateKey(AES, RED, [sign]) +PASS Bad algorithm: generateKey(AES, 7, [sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits]) +PASS Bad algorithm: generateKey(AES, false, []) +PASS Bad algorithm: generateKey(AES, true, []) +PASS Bad algorithm: generateKey(AES, RED, []) +PASS Bad algorithm: generateKey(AES, 7, []) +PASS Bad algorithm: generateKey(AES, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, []) +PASS Bad algorithm: generateKey({name: AES}, true, []) +PASS Bad algorithm: generateKey({name: AES}, RED, []) +PASS Bad algorithm: generateKey({name: AES}, 7, []) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +FAIL Bad usages: generateKey({name: Ed448}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed448}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed448}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any.worker-expected.txt b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any.worker-expected.txt new file mode 100644 index 0000000..a986708 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any.worker-expected.txt
@@ -0,0 +1,354 @@ +This is a testharness.js-based test. +Found 350 tests; 324 PASS, 26 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Bad algorithm: generateKey(AES, false, [decrypt]) +PASS Bad algorithm: generateKey(AES, true, [decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign]) +PASS Bad algorithm: generateKey(AES, true, [sign]) +PASS Bad algorithm: generateKey(AES, RED, [sign]) +PASS Bad algorithm: generateKey(AES, 7, [sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits]) +PASS Bad algorithm: generateKey(AES, false, []) +PASS Bad algorithm: generateKey(AES, true, []) +PASS Bad algorithm: generateKey(AES, RED, []) +PASS Bad algorithm: generateKey(AES, 7, []) +PASS Bad algorithm: generateKey(AES, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, []) +PASS Bad algorithm: generateKey({name: AES}, true, []) +PASS Bad algorithm: generateKey({name: AES}, RED, []) +PASS Bad algorithm: generateKey({name: AES}, 7, []) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +FAIL Bad usages: generateKey({name: Ed448}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed448}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed448}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any.worker-expected.txt b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any.worker-expected.txt new file mode 100644 index 0000000..af5786b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any.worker-expected.txt
@@ -0,0 +1,21 @@ +This is a testharness.js-based test. +FAIL Success: generateKey({name: ED25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any.worker-expected.txt b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any.worker-expected.txt new file mode 100644 index 0000000..e4aa004 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any.worker-expected.txt
@@ -0,0 +1,19 @@ +This is a testharness.js-based test. +FAIL Success: generateKey({name: X448}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/http/tests/loading/wbn/origin-trial/script-webbundle-origin-trial.https.html b/third_party/blink/web_tests/http/tests/loading/wbn/origin-trial/script-webbundle-origin-trial.https.html deleted file mode 100644 index aa2bd798..0000000 --- a/third_party/blink/web_tests/http/tests/loading/wbn/origin-trial/script-webbundle-origin-trial.https.html +++ /dev/null
@@ -1,67 +0,0 @@ -<!DOCTYPE html> -<head><title>Subresource Web Bundles Origin Trial</title></head> -<body> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script> -promise_test(async (t) => { - assert_false( - HTMLScriptElement.supports('webbundle'), - 'Subresource Web Bundles should not be supported by default.'); - - const meta = document.createElement('meta'); - meta.httpEquiv = "origin-trial"; - // This Origin Trial token is generated with the command: - // tools/origin_trials/generate_token.py \ - // --expire-timestamp=2000000000 \ - // --version=3 \ - // https://127.0.0.1:8443 SubresourceWebBundles - meta.content = "A1nOn5e148yGA6ExfhqzlxQFFC71b03gYEAJEZ1XpUw+Lv8uUA4rpeyhCme0z3bBaRtIy8XkDK8twDUuhVXOegEAAABeeyJvcmlnaW4iOiAiaHR0cHM6Ly8xMjcuMC4wLjE6ODQ0MyIsICJmZWF0dXJlIjogIlN1YnJlc291cmNlV2ViQnVuZGxlcyIsICJleHBpcnkiOiAyMDAwMDAwMDAwfQ=="; - document.head.appendChild(meta); - - assert_true( - HTMLScriptElement.supports('webbundle'), - 'Subresource Web Bundles should be supported.'); - - const wbn_url = 'https://localhost:8443/loading/wbn/resources/wbn/wbn-subresource-origin-trial.wbn'; - const script_url = 'https://localhost:8443/loading/wbn/resources/wbn/server/wbn-subresource-origin-trial/script.js'; - - const ScriptWebBundle = 4074; // From web_feature.mojom - assert_false(window.internals.isUseCounted(document, ScriptWebBundle)); - - const bundle = document.createElement('script'); - bundle.type = 'webbundle'; - bundle.textContent = JSON.stringify({ - source: wbn_url, - resources: [script_url] - }); - document.body.appendChild(bundle); - - assert_true(window.internals.isUseCounted(document, ScriptWebBundle)); - - async function loadScriptAndWaitReport(script_url) { - const result_promise = new Promise((resolve) => { - // This function will be called from script.js - window.report_result = resolve; - }); - - const script = document.createElement('script'); - script.src = script_url; - document.body.appendChild(script); - return result_promise; - } - - assert_equals( - await loadScriptAndWaitReport(script_url), - 'from web bundle', - 'Script should be loaded from the web bundle.'); - document.body.removeChild(bundle); - - assert_equals( - await loadScriptAndWaitReport(script_url), - 'from server', - 'Script should be loaded from the server after removing the script ' + - 'type=webbundle.'); -}, 'Subresource Web Bundles Origin Trial'); -</script> -</body>
diff --git a/third_party/blink/web_tests/http/tests/loading/wbn/origin-trial/script-webbundle-third-party-origin-trial.https.html b/third_party/blink/web_tests/http/tests/loading/wbn/origin-trial/script-webbundle-third-party-origin-trial.https.html deleted file mode 100644 index 8d3e565..0000000 --- a/third_party/blink/web_tests/http/tests/loading/wbn/origin-trial/script-webbundle-third-party-origin-trial.https.html +++ /dev/null
@@ -1,59 +0,0 @@ -<!DOCTYPE html> -<head><title>Subresource Web Bundles Third Party Origin Trial</title></head> -<body> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script> -promise_test(async (t) => { - assert_false( - HTMLScriptElement.supports('webbundle'), - 'Subresource Web Bundles should not be supported by default.'); - - let resolve_third_party_script_loaded; - const third_party_script_loaded = new Promise((resolve) => { - resolve_third_party_script_loaded = resolve; - }); - const third_party_script = document.createElement('script'); - third_party_script.src = 'https://localhost:8443/loading/wbn/resources/wbn-subresource-third-party-origin-trial-script.js'; - third_party_script.addEventListener('load', () => { - resolve_third_party_script_loaded(); - }); - document.body.appendChild(third_party_script); - await third_party_script_loaded; - - assert_true( - HTMLScriptElement.supports('webbundle'), - 'Subresource Web Bundles should be supported.'); - - const wbn_url = 'https://localhost:8443/loading/wbn/resources/wbn/wbn-subresource-third-party-origin-trial.wbn'; - const script_url = 'https://localhost:8443/loading/wbn/resources/wbn/server/wbn-subresource-third-party-origin-trial/script.js'; - - const ScriptWebBundle = 4074; // From web_feature.mojom - assert_false(window.internals.isUseCounted(document, ScriptWebBundle)); - - const bundle = document.createElement('script'); - bundle.type = 'webbundle'; - bundle.textContent = JSON.stringify({ - source: wbn_url, - resources: [script_url] - }); - document.body.appendChild(bundle); - - assert_true(window.internals.isUseCounted(document, ScriptWebBundle)); - - const result_promise = new Promise((resolve) => { - // This function will be called from script.js - window.report_result = resolve; - }); - - const script = document.createElement('script'); - script.src = script_url; - document.body.appendChild(script); - - assert_equals( - await result_promise, - 'from web bundle', - 'Script should be loaded from the web bundle.'); -}, 'Subresource Web Bundles Third Party Origin Trial'); -</script> -</body>
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed25519.https.any-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed25519.https.any-expected.txt new file mode 100644 index 0000000..8eb4972 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed25519.https.any-expected.txt
@@ -0,0 +1,354 @@ +This is a testharness.js-based test. +Found 350 tests; 324 PASS, 26 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Bad algorithm: generateKey(AES, false, [decrypt]) +PASS Bad algorithm: generateKey(AES, true, [decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign]) +PASS Bad algorithm: generateKey(AES, true, [sign]) +PASS Bad algorithm: generateKey(AES, RED, [sign]) +PASS Bad algorithm: generateKey(AES, 7, [sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits]) +PASS Bad algorithm: generateKey(AES, false, []) +PASS Bad algorithm: generateKey(AES, true, []) +PASS Bad algorithm: generateKey(AES, RED, []) +PASS Bad algorithm: generateKey(AES, 7, []) +PASS Bad algorithm: generateKey(AES, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, []) +PASS Bad algorithm: generateKey({name: AES}, true, []) +PASS Bad algorithm: generateKey({name: AES}, RED, []) +PASS Bad algorithm: generateKey({name: AES}, 7, []) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +FAIL Bad usages: generateKey({name: Ed25519}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed25519}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed25519}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed25519.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed25519.https.any.worker-expected.txt new file mode 100644 index 0000000..8eb4972 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed25519.https.any.worker-expected.txt
@@ -0,0 +1,354 @@ +This is a testharness.js-based test. +Found 350 tests; 324 PASS, 26 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Bad algorithm: generateKey(AES, false, [decrypt]) +PASS Bad algorithm: generateKey(AES, true, [decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign]) +PASS Bad algorithm: generateKey(AES, true, [sign]) +PASS Bad algorithm: generateKey(AES, RED, [sign]) +PASS Bad algorithm: generateKey(AES, 7, [sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits]) +PASS Bad algorithm: generateKey(AES, false, []) +PASS Bad algorithm: generateKey(AES, true, []) +PASS Bad algorithm: generateKey(AES, RED, []) +PASS Bad algorithm: generateKey(AES, 7, []) +PASS Bad algorithm: generateKey(AES, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, []) +PASS Bad algorithm: generateKey({name: AES}, true, []) +PASS Bad algorithm: generateKey({name: AES}, RED, []) +PASS Bad algorithm: generateKey({name: AES}, 7, []) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +FAIL Bad usages: generateKey({name: Ed25519}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [verify, sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed25519}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed25519}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any-expected.txt new file mode 100644 index 0000000..a986708 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any-expected.txt
@@ -0,0 +1,354 @@ +This is a testharness.js-based test. +Found 350 tests; 324 PASS, 26 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Bad algorithm: generateKey(AES, false, [decrypt]) +PASS Bad algorithm: generateKey(AES, true, [decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign]) +PASS Bad algorithm: generateKey(AES, true, [sign]) +PASS Bad algorithm: generateKey(AES, RED, [sign]) +PASS Bad algorithm: generateKey(AES, 7, [sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits]) +PASS Bad algorithm: generateKey(AES, false, []) +PASS Bad algorithm: generateKey(AES, true, []) +PASS Bad algorithm: generateKey(AES, RED, []) +PASS Bad algorithm: generateKey(AES, 7, []) +PASS Bad algorithm: generateKey(AES, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, []) +PASS Bad algorithm: generateKey({name: AES}, true, []) +PASS Bad algorithm: generateKey({name: AES}, RED, []) +PASS Bad algorithm: generateKey({name: AES}, 7, []) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +FAIL Bad usages: generateKey({name: Ed448}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed448}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed448}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any.worker-expected.txt new file mode 100644 index 0000000..a986708 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_Ed448.https.any.worker-expected.txt
@@ -0,0 +1,354 @@ +This is a testharness.js-based test. +Found 350 tests; 324 PASS, 26 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Bad algorithm: generateKey(AES, false, [decrypt]) +PASS Bad algorithm: generateKey(AES, true, [decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign]) +PASS Bad algorithm: generateKey(AES, true, [sign]) +PASS Bad algorithm: generateKey(AES, RED, [sign]) +PASS Bad algorithm: generateKey(AES, 7, [sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits]) +PASS Bad algorithm: generateKey(AES, false, []) +PASS Bad algorithm: generateKey(AES, true, []) +PASS Bad algorithm: generateKey(AES, RED, []) +PASS Bad algorithm: generateKey(AES, 7, []) +PASS Bad algorithm: generateKey(AES, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, []) +PASS Bad algorithm: generateKey({name: AES}, true, []) +PASS Bad algorithm: generateKey({name: AES}, RED, []) +PASS Bad algorithm: generateKey({name: AES}, 7, []) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +FAIL Bad usages: generateKey({name: Ed448}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, deriveKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [verify, sign, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify, deriveBits]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed448}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: Ed448}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X25519.https.any-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X25519.https.any-expected.txt new file mode 100644 index 0000000..83880312 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X25519.https.any-expected.txt
@@ -0,0 +1,360 @@ +This is a testharness.js-based test. +Found 356 tests; 324 PASS, 32 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Bad algorithm: generateKey(AES, false, [decrypt]) +PASS Bad algorithm: generateKey(AES, true, [decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign]) +PASS Bad algorithm: generateKey(AES, true, [sign]) +PASS Bad algorithm: generateKey(AES, RED, [sign]) +PASS Bad algorithm: generateKey(AES, 7, [sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits]) +PASS Bad algorithm: generateKey(AES, false, []) +PASS Bad algorithm: generateKey(AES, true, []) +PASS Bad algorithm: generateKey(AES, RED, []) +PASS Bad algorithm: generateKey(AES, 7, []) +PASS Bad algorithm: generateKey(AES, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, []) +PASS Bad algorithm: generateKey({name: AES}, true, []) +PASS Bad algorithm: generateKey({name: AES}, RED, []) +PASS Bad algorithm: generateKey({name: AES}, 7, []) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +FAIL Bad usages: generateKey({name: X25519}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: X25519}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: X25519}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X25519.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X25519.https.any.worker-expected.txt new file mode 100644 index 0000000..83880312 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X25519.https.any.worker-expected.txt
@@ -0,0 +1,360 @@ +This is a testharness.js-based test. +Found 356 tests; 324 PASS, 32 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Bad algorithm: generateKey(AES, false, [decrypt]) +PASS Bad algorithm: generateKey(AES, true, [decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign]) +PASS Bad algorithm: generateKey(AES, true, [sign]) +PASS Bad algorithm: generateKey(AES, RED, [sign]) +PASS Bad algorithm: generateKey(AES, 7, [sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits]) +PASS Bad algorithm: generateKey(AES, false, []) +PASS Bad algorithm: generateKey(AES, true, []) +PASS Bad algorithm: generateKey(AES, RED, []) +PASS Bad algorithm: generateKey(AES, 7, []) +PASS Bad algorithm: generateKey(AES, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, []) +PASS Bad algorithm: generateKey({name: AES}, true, []) +PASS Bad algorithm: generateKey({name: AES}, RED, []) +PASS Bad algorithm: generateKey({name: AES}, 7, []) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +FAIL Bad usages: generateKey({name: X25519}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: X25519}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: X25519}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X448.https.any-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X448.https.any-expected.txt new file mode 100644 index 0000000..918eb6b --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X448.https.any-expected.txt
@@ -0,0 +1,360 @@ +This is a testharness.js-based test. +Found 356 tests; 324 PASS, 32 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Bad algorithm: generateKey(AES, false, [decrypt]) +PASS Bad algorithm: generateKey(AES, true, [decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign]) +PASS Bad algorithm: generateKey(AES, true, [sign]) +PASS Bad algorithm: generateKey(AES, RED, [sign]) +PASS Bad algorithm: generateKey(AES, 7, [sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits]) +PASS Bad algorithm: generateKey(AES, false, []) +PASS Bad algorithm: generateKey(AES, true, []) +PASS Bad algorithm: generateKey(AES, RED, []) +PASS Bad algorithm: generateKey(AES, 7, []) +PASS Bad algorithm: generateKey(AES, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, []) +PASS Bad algorithm: generateKey({name: AES}, true, []) +PASS Bad algorithm: generateKey({name: AES}, RED, []) +PASS Bad algorithm: generateKey({name: AES}, 7, []) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +FAIL Bad usages: generateKey({name: X448}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: X448}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: X448}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X448.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X448.https.any.worker-expected.txt new file mode 100644 index 0000000..918eb6b --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/failures_X448.https.any.worker-expected.txt
@@ -0,0 +1,360 @@ +This is a testharness.js-based test. +Found 356 tests; 324 PASS, 32 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Bad algorithm: generateKey(AES, false, [decrypt]) +PASS Bad algorithm: generateKey(AES, true, [decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey(AES, false, [sign]) +PASS Bad algorithm: generateKey(AES, true, [sign]) +PASS Bad algorithm: generateKey(AES, RED, [sign]) +PASS Bad algorithm: generateKey(AES, 7, [sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey(AES, false, [deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [deriveBits]) +PASS Bad algorithm: generateKey(AES, false, []) +PASS Bad algorithm: generateKey(AES, true, []) +PASS Bad algorithm: generateKey(AES, RED, []) +PASS Bad algorithm: generateKey(AES, 7, []) +PASS Bad algorithm: generateKey(AES, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey(AES, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, false, []) +PASS Bad algorithm: generateKey({name: AES}, true, []) +PASS Bad algorithm: generateKey({name: AES}, RED, []) +PASS Bad algorithm: generateKey({name: AES}, 7, []) +PASS Bad algorithm: generateKey({name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, []) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({length: 128, name: AES-CFB}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, []) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: MD5, name: HMAC}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA-256, modulusLength: 2048, name: RSA, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, []) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({hash: SHA, modulusLength: 2048, name: RSA-PSS, publicExponent: {0: 1, 1: 0, 2: 1}}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, decrypt]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits, sign]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, []) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, false, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, true, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, RED, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +PASS Bad algorithm: generateKey({name: EC, namedCurve: P521}, 7, [decrypt, sign, deriveBits, decrypt, sign, deriveBits]) +FAIL Bad usages: generateKey({name: X448}, true, [encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, encrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, decrypt]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, sign]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, verify]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, wrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, deriveKey, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Bad usages: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits, unwrapKey]) assert_equals: Bad usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: X448}, false, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +FAIL Empty usages: generateKey({name: X448}, true, []) assert_equals: Empty usages not supported expected "SyntaxError" but got "NotSupportedError" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any-expected.txt new file mode 100644 index 0000000..af5786b --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any-expected.txt
@@ -0,0 +1,21 @@ +This is a testharness.js-based test. +FAIL Success: generateKey({name: ED25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any.worker-expected.txt new file mode 100644 index 0000000..af5786b --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed25519.https.any.worker-expected.txt
@@ -0,0 +1,21 @@ +This is a testharness.js-based test. +FAIL Success: generateKey({name: ED25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED25519}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed25519}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed25519}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed448.https.any-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed448.https.any-expected.txt new file mode 100644 index 0000000..e7966ba4 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed448.https.any-expected.txt
@@ -0,0 +1,21 @@ +This is a testharness.js-based test. +FAIL Success: generateKey({name: ED448}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED448}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED448}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED448}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED448}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED448}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed448.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed448.https.any.worker-expected.txt new file mode 100644 index 0000000..e7966ba4 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_Ed448.https.any.worker-expected.txt
@@ -0,0 +1,21 @@ +This is a testharness.js-based test. +FAIL Success: generateKey({name: ED448}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED448}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED448}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED448}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED448}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ED448}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: ed448}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, false, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, true, [verify, sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, false, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: Ed448}, true, [sign, verify, sign, sign, verify]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X25519.https.any-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X25519.https.any-expected.txt new file mode 100644 index 0000000..dc9c3b1 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X25519.https.any-expected.txt
@@ -0,0 +1,19 @@ +This is a testharness.js-based test. +FAIL Success: generateKey({name: X25519}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X25519.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X25519.https.any.worker-expected.txt new file mode 100644 index 0000000..dc9c3b1 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X25519.https.any.worker-expected.txt
@@ -0,0 +1,19 @@ +This is a testharness.js-based test. +FAIL Success: generateKey({name: X25519}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x25519}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any-expected.txt new file mode 100644 index 0000000..e4aa004 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any-expected.txt
@@ -0,0 +1,19 @@ +This is a testharness.js-based test. +FAIL Success: generateKey({name: X448}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any.worker-expected.txt new file mode 100644 index 0000000..e4aa004 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/generateKey/successes_X448.https.any.worker-expected.txt
@@ -0,0 +1,19 @@ +This is a testharness.js-based test. +FAIL Success: generateKey({name: X448}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: X448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, false, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Success: generateKey({name: x448}, true, [deriveKey, deriveBits, deriveKey, deriveBits, deriveKey, deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'generateKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/import_export/okp_importKey.https.any-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/import_export/okp_importKey.https.any-expected.txt new file mode 100644 index 0000000..b93c922 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/import_export/okp_importKey.https.any-expected.txt
@@ -0,0 +1,51 @@ +This is a testharness.js-based test. +FAIL Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (spki, buffer(69), {name: Ed448}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (jwk, object(kty, crv, x), {name: Ed448}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (pkcs8, buffer(73), {name: Ed448}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (jwk, object(crv, d, x, kty), {name: Ed448}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (spki, buffer(69), {name: Ed448}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (jwk, object(kty, crv, x), {name: Ed448}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (pkcs8, buffer(73), {name: Ed448}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (jwk, object(crv, d, x, kty), {name: Ed448}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (spki, buffer(44), {name: X25519}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(kty, crv, x), {name: X25519}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (spki, buffer(44), {name: X25519}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(kty, crv, x), {name: X25519}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (spki, buffer(68), {name: X448}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(kty, crv, x), {name: X448}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (spki, buffer(68), {name: X448}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(kty, crv, x), {name: X448}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/import_export/okp_importKey.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/import_export/okp_importKey.https.any.worker-expected.txt new file mode 100644 index 0000000..b93c922 --- /dev/null +++ b/third_party/blink/web_tests/platform/generic/external/wpt/WebCryptoAPI/import_export/okp_importKey.https.any.worker-expected.txt
@@ -0,0 +1,51 @@ +This is a testharness.js-based test. +FAIL Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (spki, buffer(44), {name: Ed25519}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (jwk, object(kty, crv, x), {name: Ed25519}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (pkcs8, buffer(48), {name: Ed25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed25519 bits (jwk, object(crv, d, x, kty), {name: Ed25519}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (spki, buffer(69), {name: Ed448}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (jwk, object(kty, crv, x), {name: Ed448}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (pkcs8, buffer(73), {name: Ed448}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (jwk, object(crv, d, x, kty), {name: Ed448}, true, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (spki, buffer(69), {name: Ed448}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (jwk, object(kty, crv, x), {name: Ed448}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (pkcs8, buffer(73), {name: Ed448}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: Ed448 bits (jwk, object(crv, d, x, kty), {name: Ed448}, false, [sign]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (spki, buffer(44), {name: X25519}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(kty, crv, x), {name: X25519}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (spki, buffer(44), {name: X25519}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(kty, crv, x), {name: X25519}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (pkcs8, buffer(48), {name: X25519}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X25519 bits (jwk, object(crv, d, x, kty), {name: X25519}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (spki, buffer(68), {name: X448}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(kty, crv, x), {name: X448}, true, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, true, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, true, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, true, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (spki, buffer(68), {name: X448}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(kty, crv, x), {name: X448}, false, []) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, false, [deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, false, [deriveBits, deriveKey]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (pkcs8, buffer(72), {name: X448}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +FAIL Good parameters: X448 bits (jwk, object(crv, d, x, kty), {name: X448}, false, [deriveBits]) assert_unreached: Threw an unexpected error: NotSupportedError: Failed to execute 'importKey' on 'SubtleCrypto': Algorithm: Unrecognized name Reached unreachable code +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/virtual/subresource-web-bundles-disabled/README.md b/third_party/blink/web_tests/virtual/subresource-web-bundles-disabled/README.md deleted file mode 100644 index 213fe33..0000000 --- a/third_party/blink/web_tests/virtual/subresource-web-bundles-disabled/README.md +++ /dev/null
@@ -1 +0,0 @@ -In this virtual test suite subresource web bundles are disabled.
diff --git a/third_party/webgpu-cts/ts_sources.txt b/third_party/webgpu-cts/ts_sources.txt index 0f7064df..4367030 100644 --- a/third_party/webgpu-cts/ts_sources.txt +++ b/third_party/webgpu-cts/ts_sources.txt
@@ -156,7 +156,6 @@ src/webgpu/api/operation/render_pass/storeop2.spec.ts src/webgpu/api/operation/render_pipeline/alpha_to_coverage.spec.ts src/webgpu/api/operation/render_pipeline/culling_tests.spec.ts -src/webgpu/api/operation/render_pipeline/entry_point_name.spec.ts src/webgpu/util/shader.ts src/webgpu/util/texture/texture_ok.ts src/webgpu/api/operation/render_pipeline/pipeline_output_targets.spec.ts @@ -186,25 +185,19 @@ src/webgpu/api/operation/vertex_state/correctness.spec.ts src/webgpu/api/operation/vertex_state/index_format.spec.ts src/webgpu/api/validation/validation_test.ts -src/webgpu/api/validation/attachment_compatibility.spec.ts src/webgpu/api/validation/createBindGroup.spec.ts src/webgpu/api/validation/createBindGroupLayout.spec.ts src/webgpu/api/validation/createComputePipeline.spec.ts src/webgpu/api/validation/createPipelineLayout.spec.ts -src/webgpu/api/validation/createRenderPipeline.spec.ts src/webgpu/api/validation/createSampler.spec.ts src/webgpu/api/validation/createTexture.spec.ts src/webgpu/api/validation/createView.spec.ts -src/webgpu/api/validation/create_pipeline.spec.ts src/webgpu/api/validation/error_scope.spec.ts src/webgpu/api/validation/layout_shader_compat.spec.ts -src/webgpu/api/validation/render_pass_descriptor.spec.ts -src/webgpu/api/validation/vertex_state.spec.ts src/webgpu/api/validation/buffer/create.spec.ts src/webgpu/api/validation/buffer/destroy.spec.ts src/webgpu/api/validation/buffer/mapping.spec.ts src/webgpu/api/validation/buffer/threading.spec.ts -src/webgpu/api/validation/capability_checks/features/depth_clip_control.spec.ts src/webgpu/api/validation/capability_checks/features/query_types.spec.ts src/webgpu/api/validation/capability_checks/features/texture_formats.spec.ts src/webgpu/api/validation/encoding/beginRenderPass.spec.ts @@ -247,13 +240,25 @@ src/webgpu/util/create_elements.ts src/webgpu/api/validation/queue/copyToTexture/CopyExternalImageToTexture.spec.ts src/webgpu/api/validation/queue/destroyed/query_set.spec.ts +src/webgpu/api/validation/render_pass/attachment_compatibility.spec.ts +src/webgpu/api/validation/render_pass/render_pass_descriptor.spec.ts src/webgpu/api/validation/render_pass/resolve.spec.ts src/webgpu/api/validation/render_pass/storeOp.spec.ts +src/webgpu/api/validation/render_pipeline/common.ts +src/webgpu/api/validation/render_pipeline/depth_stencil_state.spec.ts +src/webgpu/api/validation/render_pipeline/fragment_state.spec.ts +src/webgpu/api/validation/render_pipeline/inter_stage.spec.ts +src/webgpu/api/validation/render_pipeline/misc.spec.ts +src/webgpu/api/validation/render_pipeline/multisample_state.spec.ts +src/webgpu/api/validation/render_pipeline/primitive_state.spec.ts +src/webgpu/api/validation/render_pipeline/shader_module.spec.ts +src/webgpu/api/validation/render_pipeline/vertex_state.spec.ts src/webgpu/api/validation/resource_usages/buffer/in_pass_encoder.spec.ts src/webgpu/api/validation/resource_usages/buffer/in_pass_misc.spec.ts src/webgpu/api/validation/resource_usages/texture/in_pass_encoder.spec.ts src/webgpu/api/validation/resource_usages/texture/in_render_common.spec.ts src/webgpu/api/validation/resource_usages/texture/in_render_misc.spec.ts +src/webgpu/api/validation/shader_module/entry_point.spec.ts src/webgpu/api/validation/state/device_lost/destroy.spec.ts src/webgpu/api/validation/texture/destroy.spec.ts src/webgpu/idl/exposed.html.ts
diff --git a/tools/clang/scripts/build.py b/tools/clang/scripts/build.py index 58ea9ed..01a884c 100755 --- a/tools/clang/scripts/build.py +++ b/tools/clang/scripts/build.py
@@ -414,8 +414,8 @@ if args.gcc_toolchain: return gcc_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'gcc-10.2.0-bionic') - if os.path.isdir(gcc_dir): # TODO(thakis): Remove this branch after a few weeks. - RmTree(gcc_dir) + if os.path.isdir(gcc_dir): + RmTree(gcc_dir) # TODO(thakis): Remove this branch after a few weeks. if not os.path.exists(gcc_dir): DownloadAndUnpack(CDS_URL + '/tools/gcc-10.2.0-bionic.tgz', gcc_dir) args.gcc_toolchain = gcc_dir @@ -771,6 +771,22 @@ sysroot_i386 = os.path.join(LLVM_BUILD_TOOLS_DIR, toolchain_name) DownloadAndUnpack(U, sysroot_i386) + # arm + # hash from https://chromium-review.googlesource.com/c/chromium/src/+/3684954/1/build/linux/sysroot_scripts/sysroots.json#8 + toolchain_hash = '0b9a3c54d2d5f6b1a428369aaa8d7ba7b227f701' + toolchain_name = 'debian_bullseye_arm_sysroot' + U = toolchain_bucket + toolchain_hash + '/' + toolchain_name + '.tar.xz' + sysroot_arm = os.path.join(LLVM_BUILD_TOOLS_DIR, toolchain_name) + DownloadAndUnpack(U, sysroot_arm) + + # arm64 + # hash from https://chromium-review.googlesource.com/c/chromium/src/+/3684954/1/build/linux/sysroot_scripts/sysroots.json#12 + toolchain_hash = '0e28d9832614729bb5b731161ff96cb4d516f345' + toolchain_name = 'debian_bullseye_arm64_sysroot' + U = toolchain_bucket + toolchain_hash + '/' + toolchain_name + '.tar.xz' + sysroot_arm64 = os.path.join(LLVM_BUILD_TOOLS_DIR, toolchain_name) + DownloadAndUnpack(U, sysroot_arm64) + if sys.platform == 'win32': base_cmake_args.append('-DLLVM_USE_CRT_RELEASE=MT') @@ -1043,6 +1059,23 @@ compiler_rt_cmake_flags(sanitizers=True, profile=True) + [ 'CMAKE_SYSROOT=%s' % sysroot, ])) + runtimes_triples_args.append( + # Using "armv7a-unknown-linux-gnueabhihf" confuses the compiler-rt + # builtins build, since compiler-rt/cmake/builtin-config-ix.cmake + # doesn't include "armv7a" in its `ARM32` list. + # TODO(thakis): It seems to work for everything else though, see try + # results on + # https://chromium-review.googlesource.com/c/chromium/src/+/3702739/4 + # Maybe it should work for builtins too? + ('armv7-unknown-linux-gnueabihf', + compiler_rt_cmake_flags(sanitizers=True, profile=True) + [ + 'CMAKE_SYSROOT=%s' % sysroot_arm, + ])) + runtimes_triples_args.append( + ('aarch64-unknown-linux-gnu', + compiler_rt_cmake_flags(sanitizers=True, profile=True) + [ + 'CMAKE_SYSROOT=%s' % sysroot_arm64, + ])) elif sys.platform == 'win32': runtimes_triples_args.append( ('i386-pc-windows-msvc', @@ -1199,9 +1232,11 @@ env = os.environ.copy() # See SANITIZER_OVERRIDE_INTERCEPTORS above: We disable crypt_r() # interception, so its tests can't pass. - env['LIT_FILTER_OUT'] = ('^SanitizerCommon-(a|l|m|ub|t)san-x86_64-Linux ' + - ':: Linux/crypt_r.cpp$') - RunCommand(['ninja', '-C', LLVM_BUILD_DIR] + test_targets, env=env, msvc_arch='x64') + env['LIT_FILTER_OUT'] = ('^SanitizerCommon-(a|l|m|ub|t)san-x86_64-Linux' + + ' :: Linux/crypt_r.cpp$') + RunCommand(['ninja', '-C', LLVM_BUILD_DIR] + test_targets, + env=env, + msvc_arch='x64') WriteStampFile(PACKAGE_VERSION, STAMP_FILE) WriteStampFile(PACKAGE_VERSION, FORCE_HEAD_REVISION_FILE)
diff --git a/tools/clang/scripts/package.py b/tools/clang/scripts/package.py index 32a79a5..ca8c583 100755 --- a/tools/clang/scripts/package.py +++ b/tools/clang/scripts/package.py
@@ -343,9 +343,15 @@ 'lib/clang/$V/lib/linux/libclang_rt.builtins-x86_64-android.a', # Builtins for Lacros (and potentially Linux, but not used there atm). + 'lib/clang/$V/lib/aarch64-unknown-linux-gnu/libclang_rt.builtins.a', + 'lib/clang/$V/lib/armv7-unknown-linux-gnueabihf/libclang_rt.builtins.a', 'lib/clang/$V/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a', # crtstart/crtend for Linux and Lacros. + 'lib/clang/$V/lib/aarch64-unknown-linux-gnu/clang_rt.crtbegin.o', + 'lib/clang/$V/lib/aarch64-unknown-linux-gnu/clang_rt.crtend.o', + 'lib/clang/$V/lib/armv7-unknown-linux-gnueabihf/clang_rt.crtbegin.o', + 'lib/clang/$V/lib/armv7-unknown-linux-gnueabihf/clang_rt.crtend.o', 'lib/clang/$V/lib/x86_64-unknown-linux-gnu/clang_rt.crtbegin.o', 'lib/clang/$V/lib/x86_64-unknown-linux-gnu/clang_rt.crtend.o', @@ -361,9 +367,11 @@ 'lib/clang/$V/lib/x86_64-unknown-linux-gnu/libclang_rt.msan_cxx.a.syms', # Profile runtime (used by profiler and code coverage). + 'lib/clang/$V/lib/aarch64-unknown-linux-gnu/libclang_rt.profile.a', + 'lib/clang/$V/lib/armv7-unknown-linux-gnueabihf/libclang_rt.profile.a', 'lib/clang/$V/lib/i386-unknown-linux-gnu/libclang_rt.profile.a', - 'lib/clang/$V/lib/linux/libclang_rt.profile-i686-android.a', 'lib/clang/$V/lib/x86_64-unknown-linux-gnu/libclang_rt.profile.a', + 'lib/clang/$V/lib/linux/libclang_rt.profile-i686-android.a', 'lib/clang/$V/lib/linux/libclang_rt.profile-aarch64-android.a', 'lib/clang/$V/lib/linux/libclang_rt.profile-arm-android.a', @@ -516,10 +524,12 @@ # Make `--target=*-cros-linux-gnu` work with # LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON. - os.symlink( - 'x86_64-unknown-linux-gnu', - os.path.join(pdir, 'lib', 'clang', RELEASE_VERSION, 'lib', - 'x86_64-cros-linux-gnu')) + for arch, abi in [('armv7', 'gnueabihf'), ('aarch64', 'gnu'), + ('x86_64', 'gnu')]: + old = '%s-unknown-linux-%s' % (arch, abi) + new = old.replace('unknown', 'cros').replace('armv7', 'armv7a') + os.symlink( + old, os.path.join(pdir, 'lib', 'clang', RELEASE_VERSION, 'lib', new)) # Copy libc++ headers. if sys.platform == 'darwin':
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py index 6fdc0171..dd4c7c65 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py
@@ -36,7 +36,7 @@ # Reverting problematic clang rolls is safe, though. # This is the output of `git describe` and is usable as a commit-ish. CLANG_REVISION = 'llvmorg-15-init-11722-g3f3a235a' -CLANG_SUB_REVISION = 7 +CLANG_SUB_REVISION = 8 PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION) RELEASE_VERSION = '15.0.0'
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index f10b0dc..a866f7c 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -60895,6 +60895,7 @@ <int value="1835523483" label="OmniboxUIExperimentSwapTitleAndUrl:enabled"/> <int value="1835931933" label="ShareUsageRankingFixedMore:enabled"/> <int value="1836557489" label="EnableDangerousDownloadDialog:disabled"/> + <int value="1836916996" label="OmniboxShortcutExpanding:disabled"/> <int value="1837330563" label="WebPaymentsMinimalUI:disabled"/> <int value="1837847580" label="MutingCompromisedCredentials:disabled"/> <int value="1838110766" label="PrivateNetworkAccessSendPreflights:disabled"/> @@ -61029,6 +61030,7 @@ <int value="1927254377" label="MediaAppHandlesAudio:enabled"/> <int value="1927259098" label="TranslateLanguageByULP:enabled"/> <int value="1927374573" label="EnterpriseRealtimeExtensionRequest:enabled"/> + <int value="1927572319" label="OmniboxShortcutExpanding:enabled"/> <int value="1928944156" label="ReadLaterNewBadgePromo:disabled"/> <int value="1929174284" label="ChromeManagementPageAndroid:disabled"/> <int value="1929535031" label="LanguageSettingsUpdate2:enabled"/> @@ -75662,6 +75664,7 @@ <int value="2" label="Launcher search"/> <int value="3" label="Settings"/> <int value="4" label="Settings search"/> + <int value="5" label="Keyboard brightness slider"/> </enum> <enum name="PersonalizationPath">
diff --git a/tools/metrics/histograms/metadata/android/histograms.xml b/tools/metrics/histograms/metadata/android/histograms.xml index 12a255f7..d941585 100644 --- a/tools/metrics/histograms/metadata/android/histograms.xml +++ b/tools/metrics/histograms/metadata/android/histograms.xml
@@ -4049,7 +4049,7 @@ </histogram> <histogram name="Android.WebView.NonEmbeddedMetrics.HistogramRecordAge" - units="minutes" expires_after="2022-10-09"> + units="minutes" expires_after="2022-12-11"> <owner>hazems@chromium.org</owner> <owner>ntfschr@chromium.org</owner> <owner>src/android_webview/OWNERS</owner> @@ -4063,7 +4063,7 @@ </histogram> <histogram name="Android.WebView.NonEmbeddedMetrics.NumHistograms" - units="histograms" expires_after="2022-10-09"> + units="histograms" expires_after="2022-12-11"> <owner>ntfschr@chromium.org</owner> <owner>hazems@chromium.org</owner> <owner>src/android_webview/OWNERS</owner> @@ -4076,7 +4076,7 @@ <histogram name="Android.WebView.NonEmbeddedMetrics.ParsingLogResult" enum="AndroidWebViewNonEmbeddedMetricsParsingLogResult" - expires_after="2022-10-09"> + expires_after="2022-12-11"> <owner>hazems@chromium.org</owner> <owner>ntfschr@chromium.org</owner> <owner>src/android_webview/OWNERS</owner> @@ -4102,7 +4102,7 @@ </histogram> <histogram name="Android.WebView.NonEmbeddedMetrics.TransmissionResult" - enum="AndroidWebViewDevUiMetricsTransmission" expires_after="2022-10-09"> + enum="AndroidWebViewDevUiMetricsTransmission" expires_after="2022-12-11"> <owner>ntfschr@chromium.org</owner> <owner>hazems@chromium.org</owner> <owner>src/android_webview/OWNERS</owner> @@ -4300,7 +4300,7 @@ </histogram> <histogram name="Android.WebView.SafeMode.SafeModeEnabled" - enum="BooleanEnabled" expires_after="2022-10-09"> + enum="BooleanEnabled" expires_after="2022-12-11"> <owner>ntfschr@chromium.org</owner> <owner>src/android_webview/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/browser/histograms.xml b/tools/metrics/histograms/metadata/browser/histograms.xml index 13d24f8a..b3f5556 100644 --- a/tools/metrics/histograms/metadata/browser/histograms.xml +++ b/tools/metrics/histograms/metadata/browser/histograms.xml
@@ -172,7 +172,7 @@ </histogram> <histogram name="Browser.PaintPreview.Player.CompositorProcessStartupTime" - units="ms" expires_after="2022-10-09"> + units="ms" expires_after="2022-12-11"> <owner>ckitagawa@chromium.org</owner> <owner>fredmello@chromium.org</owner> <owner>chrome-fdt@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/cros_ml/histograms.xml b/tools/metrics/histograms/metadata/cros_ml/histograms.xml index f4d0ef2..1cd3c6f 100644 --- a/tools/metrics/histograms/metadata/cros_ml/histograms.xml +++ b/tools/metrics/histograms/metadata/cros_ml/histograms.xml
@@ -315,7 +315,7 @@ </histogram> <histogram name="MachineLearningService.WorkerProcessCleanUpTime" - units="microseconds" expires_after="2022-10-10"> + units="microseconds" expires_after="2022-12-11"> <owner>alanlxl@chromium.org</owner> <owner>amoylan@chromium.org</owner> <owner>honglinyu@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/download/histograms.xml b/tools/metrics/histograms/metadata/download/histograms.xml index 1d30414..ee203fa6 100644 --- a/tools/metrics/histograms/metadata/download/histograms.xml +++ b/tools/metrics/histograms/metadata/download/histograms.xml
@@ -1124,7 +1124,7 @@ </histogram> <histogram name="Download.Shelf.VisibleTime" units="ms" - expires_after="2022-10-10"> + expires_after="2022-12-11"> <owner>xinghuilu@chromium.org</owner> <owner>chrome-safebrowsing-alerts@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml index 98bc1bb6..d8af1aa4 100644 --- a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml +++ b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml
@@ -9978,21 +9978,6 @@ <affected-histogram name="Net.SSLProtocolErrorReason"/> </histogram_suffixes> -<histogram_suffixes name="SoftwareReporterEngine" separator="_"> - <suffix name="ESET" label=""/> - <suffix name="URZA" label=""/> - <affected-histogram name="SoftwareReporter.CreateJobResult"/> - <affected-histogram name="SoftwareReporter.FoundUwSReadError"/> - <affected-histogram name="SoftwareReporter.LogsUploadEnabled"/> - <affected-histogram name="SoftwareReporter.LogsUploadResult"/> - <affected-histogram name="SoftwareReporter.LogsUploadResultRegistryError"/> - <affected-histogram name="SoftwareReporter.MajorVersion"/> - <affected-histogram name="SoftwareReporter.MemoryUsed"/> - <affected-histogram name="SoftwareReporter.MinorVersion"/> - <affected-histogram name="SoftwareReporter.RunningTimeAccordingToChrome2"/> - <affected-histogram name="SoftwareReporter.RunningTimeWithoutSleep2"/> -</histogram_suffixes> - <histogram_suffixes name="SpdyImpact" separator="_"> <suffix name="npn_with_http" label="with NPN negotiated but using HTTP instead of SPDY"/>
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index fd651cb..304d5c81 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -6986,7 +6986,7 @@ </histogram> <histogram name="Kiosk.Launch.CryptohomeFailure" enum="LoginFailureReason" - expires_after="2022-10-09"> + expires_after="2022-12-11"> <owner>xiyuan@chromium.org</owner> <owner>apotapchuk@chromium.org</owner> <summary>Tracks cryptohome failure during kiosk launch.</summary> @@ -14394,7 +14394,7 @@ </histogram> <histogram name="WebFont.CacheHit" enum="WebFontCacheHit" - expires_after="2022-10-09"> + expires_after="2022-12-11"> <owner>hajimehoshi@chromium.org</owner> <owner>kenjibaheux@chromium.org</owner> <owner>kouhei@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/printing/histograms.xml b/tools/metrics/histograms/metadata/printing/histograms.xml index 6001db5..b691166 100644 --- a/tools/metrics/histograms/metadata/printing/histograms.xml +++ b/tools/metrics/histograms/metadata/printing/histograms.xml
@@ -105,7 +105,7 @@ </histogram> <histogram name="Printing.CUPS.IppAttributesSuccess" enum="BooleanSuccess" - expires_after="2022-10-09"> + expires_after="2022-12-11"> <owner>bmgordon@chromium.org</owner> <owner>cros-printing-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/search/histograms.xml b/tools/metrics/histograms/metadata/search/histograms.xml index 7d595de..524de10 100644 --- a/tools/metrics/histograms/metadata/search/histograms.xml +++ b/tools/metrics/histograms/metadata/search/histograms.xml
@@ -1555,7 +1555,7 @@ </histogram> <histogram name="Search.RelatedSearches.CarouselLastVisibleItemPosition" - units="position" expires_after="2022-10-09"> + units="position" expires_after="2022-12-11"> <owner>donnd@chromium.org</owner> <owner>gangwu@chromium.org</owner> <owner>related-searches-vteam@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/software/histograms.xml b/tools/metrics/histograms/metadata/software/histograms.xml index ac47ff3..ab06cac2 100644 --- a/tools/metrics/histograms/metadata/software/histograms.xml +++ b/tools/metrics/histograms/metadata/software/histograms.xml
@@ -22,6 +22,17 @@ <histograms> +<!-- +The SoftwareReporterEngine variants used to be defined as suffixes with a _ +separator. The leading _ keeps the generated histogram names the same. +--> + +<variants name="SoftwareReporterEngine"> + <variant name=""/> + <variant name="_ESET" summary="the ESET engine"/> + <variant name="_URZA" summary="the discontinued legacy engine"/> +</variants> + <histogram name="SoftwareReporter.Cleaner.ChromePromptChannelError" enum="SoftwareReporterChromePromptChannelError" expires_after="2022-10-30"> <owner>drubery@chromium.org</owner> @@ -128,27 +139,29 @@ </summary> </histogram> -<histogram name="SoftwareReporter.CreateJobResult" enum="WinGetLastError" - expires_after="2022-08-21"> +<histogram name="SoftwareReporter.CreateJobResult{Engine}" + enum="WinGetLastError" expires_after="2022-08-21"> <owner>joenotcharles@google.com</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> The Windows error code from CreateJobObject, which is called just before - launching the Software Reporter. If this is not ERROR_SUCCESS, the reporter - process is not attached to a job and may outlive the browser. Not logged on - Windows 7, where CreateJobObject is not called because nested job objects - aren't supported. + launching the Software Reporter using {Engine}. If this is not + ERROR_SUCCESS, the reporter process is not attached to a job and may outlive + the browser. Not logged on Windows 7, where CreateJobObject is not called + because nested job objects aren't supported. </summary> + <token key="Engine" variants="SoftwareReporterEngine"/> </histogram> -<histogram name="SoftwareReporter.FoundUwSReadError" enum="BooleanError" - expires_after="2023-05-25"> +<histogram name="SoftwareReporter.FoundUwSReadError{Engine}" + enum="BooleanError" expires_after="2023-05-25"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> Whether there was an error reading the registry key containing UwS found by - the Software Removal Tool. + the Software Removal Tool when using {Engine}. </summary> + <token key="Engine" variants="SoftwareReporterEngine"/> </histogram> <histogram name="SoftwareReporter.IPCDisconnected" @@ -174,43 +187,48 @@ <summary>The result of the most recent SRT log upload.</summary> </histogram> -<histogram name="SoftwareReporter.LogsUploadEnabled" +<histogram name="SoftwareReporter.LogsUploadEnabled{Engine}" enum="SoftwareReporterLogsUploadEnabled" expires_after="2022-08-25"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> If logs uploads are enabled in the Software Reporter or the reason why it is - disabled. Recorded before each run of the Software Reporter. Warning: this - histogram was expired in M91 and extended in M92; data may be missing in - M91. + disabled. Recorded before each run of the Software Reporter using {Engine}. + Warning: this histogram was expired in M91 and extended in M92; data may be + missing in M91. </summary> + <token key="Engine" variants="SoftwareReporterEngine"/> </histogram> -<histogram name="SoftwareReporter.LogsUploadResult" +<histogram name="SoftwareReporter.LogsUploadResultRegistryError{Engine}" + enum="SoftwareReporterLogsUploadResultRegistryError" + expires_after="2022-10-30"> + <owner>drubery@chromium.org</owner> + <owner>chrome-safebrowsing-alerts@google.com</owner> + <summary> + Error encountered when reading the Software Reporter logs upload result from + the registry for. Recorded at the same time as + SoftwareReporter.LogsUploadResult after the SoftwareReporter finishes when + using {Engine}. Warning: this histogram was expired in M91 and extended in + M92; data may be missing in M91. + </summary> + <token key="Engine" variants="SoftwareReporterEngine"/> +</histogram> + +<histogram name="SoftwareReporter.LogsUploadResult{Engine}" enum="SoftwareReporterLogsUploadResult" expires_after="2022-10-30"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> The result of the most recent Software Reporter logs upload. Written by the Software Reporter in the registry and sent by Chrome after the reporter - finishes. Warning: this histogram was expired in M91 and extended in M92; - data may be missing in M91. + finishes when using {Engine}. Warning: this histogram was expired in M91 and + extended in M92; data may be missing in M91. </summary> + <token key="Engine" variants="SoftwareReporterEngine"/> </histogram> -<histogram name="SoftwareReporter.LogsUploadResultRegistryError" - enum="SoftwareReporterLogsUploadResultRegistryError" - expires_after="2022-10-30"> - <owner>drubery@chromium.org</owner> - <owner>chrome-safebrowsing-alerts@google.com</owner> - <summary> - Error encountered when reading the software reporter logs upload result from - the registry. Warning: this histogram was expired in M91 and extended in - M92; data may be missing in M91. - </summary> -</histogram> - -<histogram name="SoftwareReporter.MajorVersion" units="units" +<histogram name="SoftwareReporter.MajorVersion{Engine}" units="units" expires_after="2022-10-23"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> @@ -219,28 +237,34 @@ components of the version of the software reporter. The high word is the first component when there are more than one, and the low word is either the second or third one, depending if there are at least 3, or 4 components. + Recorded after the reporter finishes when using {Engine}. </summary> + <token key="Engine" variants="SoftwareReporterEngine"/> </histogram> -<histogram name="SoftwareReporter.MemoryUsed" units="KB" +<histogram name="SoftwareReporter.MemoryUsed{Engine}" units="KB" expires_after="2022-12-04"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> The memory used by the software reporter tool as reported by the tool itself - via the registry. Logged just after the software reporter tool has finished. + via the registry. Logged just after the software reporter tool has finished + when using {Engine}. </summary> + <token key="Engine" variants="SoftwareReporterEngine"/> </histogram> -<histogram name="SoftwareReporter.MinorVersion" units="units" +<histogram name="SoftwareReporter.MinorVersion{Engine}" units="units" expires_after="2022-08-25"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> The last component of the version of the software reporter that was executed so we can identify when users are not getting their component updated as - quickly as we expect it. + quickly as we expect it. Recorded after the reporter finishes when using + {Engine}. </summary> + <token key="Engine" variants="SoftwareReporterEngine"/> </histogram> <histogram name="SoftwareReporter.NoPromptReason" @@ -299,8 +323,8 @@ </summary> </histogram> -<histogram name="SoftwareReporter.RunningTimeAccordingToChrome2" units="ms" - expires_after="2022-08-21"> +<histogram name="SoftwareReporter.RunningTimeAccordingToChrome2{Engine}" + units="ms" expires_after="2022-08-21"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -308,11 +332,13 @@ exits, in milliseconds. This includes time the computer was asleep or hibernating. SoftwareReporter.RunningTimeWithoutSleep2 excludes those periods. This replaces SoftwareReporter.RunningTimeAccordingToChrome which - also included queuing time of tasks before and after launch. + also included queuing time of tasks before and after launch. Recorded after + the reporter finishes when using {Engine}. </summary> + <token key="Engine" variants="SoftwareReporterEngine"/> </histogram> -<histogram name="SoftwareReporter.RunningTimeWithoutSleep2" units="ms" +<histogram name="SoftwareReporter.RunningTimeWithoutSleep2{Engine}" units="ms" expires_after="2022-08-21"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> @@ -321,8 +347,10 @@ exits, in milliseconds. This does not include time the computer was asleep or hibernating. SoftwareReporter.RunningTimeAccordingToChrome2 includes those periods. This replaces SoftwareReporter.RunningTimeWithoutSleep which - also included queuing time of tasks before and after launch. + also included queuing time of tasks before and after launch. Recorded after + the reporter finishes when using {Engine}. </summary> + <token key="Engine" variants="SoftwareReporterEngine"/> </histogram> </histograms>
diff --git a/tools/metrics/histograms/metadata/v8/histograms.xml b/tools/metrics/histograms/metadata/v8/histograms.xml index b4c4fd29..cadae8aa 100644 --- a/tools/metrics/histograms/metadata/v8/histograms.xml +++ b/tools/metrics/histograms/metadata/v8/histograms.xml
@@ -1515,7 +1515,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeExecute" units="microseconds" - expires_after="2022-10-09"> + expires_after="2022-12-11"> <owner>neis@chromium.org</owner> <owner>mvstanton@chromium.org</owner> <summary> @@ -1527,7 +1527,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeFinalize" units="microseconds" - expires_after="2022-10-09"> + expires_after="2022-12-11"> <owner>neis@chromium.org</owner> <owner>mvstanton@chromium.org</owner> <summary> @@ -1539,7 +1539,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeForOnStackReplacementExecute" - units="microseconds" expires_after="2022-10-09"> + units="microseconds" expires_after="2022-12-11"> <owner>neis@chromium.org</owner> <owner>mvstanton@chromium.org</owner> <summary> @@ -1552,7 +1552,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeForOnStackReplacementFinalize" - units="microseconds" expires_after="2022-10-09"> + units="microseconds" expires_after="2022-12-11"> <owner>neis@chromium.org</owner> <owner>mvstanton@chromium.org</owner> <summary> @@ -1565,7 +1565,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeForOnStackReplacementPrepare" - units="microseconds" expires_after="2022-10-09"> + units="microseconds" expires_after="2022-12-11"> <owner>neis@chromium.org</owner> <owner>mvstanton@chromium.org</owner> <summary> @@ -1578,7 +1578,7 @@ </histogram> <histogram name="V8.TurboFanOptimizeForOnStackReplacementTotalTime" - units="microseconds" expires_after="2022-10-09"> + units="microseconds" expires_after="2022-12-11"> <owner>neis@chromium.org</owner> <owner>mvstanton@chromium.org</owner> <summary> @@ -1604,7 +1604,7 @@ </histogram> <histogram name="V8.TurboFanOptimizePrepare" units="microseconds" - expires_after="2022-10-09"> + expires_after="2022-12-11"> <owner>neis@chromium.org</owner> <owner>mvstanton@chromium.org</owner> <summary>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index a0d6c2a..17f81de4 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -5,16 +5,16 @@ "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux_arm64/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "win": { - "hash": "3df88cdecaaaad7bc0b58d8f90a813352b11f024", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/f533ef185cb9157bf0046a50b7b23bea3382e5e0/trace_processor_shell.exe" + "hash": "9c03bc914458eff778dc222763c10570b342fb97", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/aee702e883cb0fd9a087a71b467746f54d68ca53/trace_processor_shell.exe" }, "linux_arm": { "hash": "58893933be305d3bfe0a72ebebcacde2ac3ca893", "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux_arm/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "mac": { - "hash": "65bc04438e1fb682690df5932651441dccb60ad2", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/942cc2da4b087a89e3fe3ba58c8582be955e1247/trace_processor_shell" + "hash": "1c9ca8c85a340fdd3998ac85a68cfdbb78aa07d3", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/aee702e883cb0fd9a087a71b467746f54d68ca53/trace_processor_shell" }, "mac_arm64": { "hash": "e1ad4861384b06d911a65f035317914b8cc975c6",
diff --git a/ui/chromeos/file_manager_strings.grdp b/ui/chromeos/file_manager_strings.grdp index 4b319db..f9b7890 100644 --- a/ui/chromeos/file_manager_strings.grdp +++ b/ui/chromeos/file_manager_strings.grdp
@@ -1294,51 +1294,12 @@ <message name="IDS_FILE_BROWSER_AUDIO_FILE_TYPE" desc="Audio file type"> <ph name="AUDIO_TYPE">$1<ex>mp3</ex></ph> audio </message> + <message name="IDS_FILE_BROWSER_ARCHIVE_FILE_TYPE" desc="Archive file type"> + <ph name="ARCHIVE_TYPE">$1<ex>ZIP</ex></ph> archive + </message> <message name="IDS_FILE_BROWSER_HTML_DOCUMENT_FILE_TYPE" desc="HTML document file type"> HTML document </message> - <message name="IDS_FILE_BROWSER_ZIP_ARCHIVE_FILE_TYPE" desc="ZIP archive file type"> - ZIP archive - </message> - <message name="IDS_FILE_BROWSER_RAR_ARCHIVE_FILE_TYPE" desc="RAR archive file type"> - RAR archive - </message> - <message name="IDS_FILE_BROWSER_ISO_ARCHIVE_FILE_TYPE" desc="ISO archive file type"> - ISO image - </message> - <message name="IDS_FILE_BROWSER_7Z_ARCHIVE_FILE_TYPE" desc="7-Zip archive file type"> - 7-Zip archive - </message> - <message name="IDS_FILE_BROWSER_CRX_ARCHIVE_FILE_TYPE" desc="CRX archive file type"> - Chrome extension - </message> - <message name="IDS_FILE_BROWSER_TAR_ARCHIVE_FILE_TYPE" desc="TAR archive file type"> - TAR archive - </message> - <message name="IDS_FILE_BROWSER_BZIP2_ARCHIVE_FILE_TYPE" desc="BZIP2 compressed archive file type"> - BZIP2 compressed archive - </message> - <message name="IDS_FILE_BROWSER_GZIP_ARCHIVE_FILE_TYPE" desc="GZIP compressed archive file type"> - GZIP compressed archive - </message> - <message name="IDS_FILE_BROWSER_LZMA_ARCHIVE_FILE_TYPE" desc="LZMA compressed archive file type"> - LZMA compressed archive - </message> - <message name="IDS_FILE_BROWSER_LZIP_ARCHIVE_FILE_TYPE" desc="LZIP compressed archive file type"> - LZIP compressed archive - </message> - <message name="IDS_FILE_BROWSER_LZOP_ARCHIVE_FILE_TYPE" desc="LZOP compressed archive file type"> - LZOP compressed archive - </message> - <message name="IDS_FILE_BROWSER_XZ_ARCHIVE_FILE_TYPE" desc="XZ compressed archive file type"> - XZ compressed archive - </message> - <message name="IDS_FILE_BROWSER_Z_ARCHIVE_FILE_TYPE" desc="Z compressed archive file type"> - Z compressed archive - </message> - <message name="IDS_FILE_BROWSER_ZSTD_ARCHIVE_FILE_TYPE" desc="ZSTD compressed archive file type"> - Zstandard compressed archive - </message> <message name="IDS_FILE_BROWSER_PLAIN_TEXT_FILE_TYPE" desc="Plain text file type"> Plain text </message>
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_7Z_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_7Z_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index 41ceb09a..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_7Z_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -0ff9af612be21043a0ebd7539c930d2e627e4a9d \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ARCHIVE_FILE_TYPE.png.sha1 new file mode 100644 index 0000000..61f053e --- /dev/null +++ b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ARCHIVE_FILE_TYPE.png.sha1
@@ -0,0 +1 @@ +e7d6599812b2275d221faa53c904996f7cc24d7f \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_BZIP2_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_BZIP2_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index 9398fac..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_BZIP2_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -423b1856516f930142a5e545ea250854fb192c26 \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_CRX_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_CRX_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index 9c6a2e3..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_CRX_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -4000906aa4c53562a0add25c4057cad140eaa2e1 \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_GZIP_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_GZIP_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index 07b0fd5..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_GZIP_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -c18a09d2a1490574dac0cf258c0f9961b215363c \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ISO_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ISO_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index 9c6a2e3..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ISO_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -4000906aa4c53562a0add25c4057cad140eaa2e1 \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_LZIP_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_LZIP_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index e037cba..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_LZIP_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -c5392520ba52bca8fb920a368bd87ae49ad8848f \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_LZMA_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_LZMA_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index 38cfe9f..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_LZMA_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -83980970231fa6a0dc5e33da518ff7735d5ff977 \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_LZOP_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_LZOP_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index 1e4eb49..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_LZOP_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -272f690b6ceb19ff8964445f59d19f3299bd9710 \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_TAR_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_TAR_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index 0d61ba8..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_TAR_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -132b007757b1e7f2829c10e223decae2133daf62 \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_XZ_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_XZ_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index 96752b2..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_XZ_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -5b446f40c9a003e80b55d67e72f01c377146d592 \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ZIP_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ZIP_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index c43c7c38..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ZIP_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -bc0b37618a1cfb748b1d0409a6d698f2c5c97429 \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ZSTD_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ZSTD_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index c6c2106..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_ZSTD_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -5255d4e5b26204ec29da3486a1debc786dc17283 \ No newline at end of file
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_Z_ARCHIVE_FILE_TYPE.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_Z_ARCHIVE_FILE_TYPE.png.sha1 deleted file mode 100644 index c6c2106..0000000 --- a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_Z_ARCHIVE_FILE_TYPE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -5255d4e5b26204ec29da3486a1debc786dc17283 \ No newline at end of file
diff --git a/ui/chromeos/styles/cros_colors.json5 b/ui/chromeos/styles/cros_colors.json5 index f6b6ae19..da0bda7 100644 --- a/ui/chromeos/styles/cros_colors.json5 +++ b/ui/chromeos/styles/cros_colors.json5
@@ -50,7 +50,7 @@ generate_inverted: true, }, color_warning: { - light: "$google_yellow_600", + light: "$google_yellow_900", dark: "$google_yellow_300", generate_per_mode: true, generate_inverted: true, @@ -106,8 +106,10 @@ * Text colors. */ text_color_primary: { - default: "$color_primary", + light: "$color_primary_light", + dark: "$color_primary_dark", debug: "$google_green_400", + generate_inverted: true, }, text_color_secondary: { light: "$color_secondary_light", @@ -130,8 +132,10 @@ * Icon colors. */ icon_color_primary: { - default: "$color_primary", + light: "$color_primary_light", + dark: "$color_primary_dark", debug: "#ff00ff", + generate_inverted: true, }, icon_color_secondary: { light: "$color_secondary_light", @@ -374,6 +378,11 @@ }, menu_item_background_hover: "$ripple_color", + /* nudge */ + nudge_label_color: "$text_color_primary_inverted", + nudge_icon_color: "$icon_color_primary_inverted", + nudge_background_color: "$color_prominent", + /* scroll bar */ app_scrollbar_color_hover: { light: "$google_grey_600",
diff --git a/ui/file_manager/base/gn/file_types.json5 b/ui/file_manager/base/gn/file_types.json5 index d832dbaa..50f9d85 100644 --- a/ui/file_manager/base/gn/file_types.json5 +++ b/ui/file_manager/base/gn/file_types.json5
@@ -6,17 +6,19 @@ * Known file extension and mime type mapping. * * 1. Fields "type/translationKey/subtype/extensions" are mandatory, "mime/icon" - * are optional, if "mime" is missing, we won't generate a mapping for that type - * in backend. + * are optional, if "mime" is missing, we won't generate a mapping for that + * type in backend. * 2. The extensions must be an array where each extension starts with a dot. * 3. One extension can be mapped to multiple mime types, this is mainly used - * for scenarios when two mime types are equivalent. E.g. "video/ogg" and - * "application/ogg", so when we use mime type to find the corresponding - * extensions, both mime types can return the correct extensions. - * 4. Order matters! If one extension includes another extension, the longer - * extension should come first in the array. E.g. ".gz" and ".tar.gz", the - * definition of ".tar.gz" should come first because we use extension to find - * the corresponding mime type, ".tar.gz" should match the more specific one. + * for scenarios when two mime types are equivalent. E.g. "video/ogg" and + * "application/ogg", so when we use mime type to find the corresponding + * extensions, both mime types can return the correct extensions. + * 4. The "subtype" field represents the subtype of archive, image, audio or + * video file type. + * 5. Order matters! If one extension includes another extension, the longer + * extension should come first in the array. E.g. ".gz" and ".tar.gz", the + * definition of ".tar.gz" should come first because we use extension to find + * the corresponding mime type, ".tar.gz" should match the more specific one. * * Note: the above rules are being validated in PRESUBMIT.py, remember to update * the validation logic there if any of the rules above change. @@ -302,100 +304,100 @@ // Archive { "type": "archive", - "translationKey": "ZIP_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "ZIP", "extensions": [".zip"], "mime": "application/zip" }, { "type": "archive", - "translationKey": "RAR_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "RAR", "extensions": [".rar"], "mime": "application/x-rar-compressed" }, { "type": "archive", - "translationKey": "ISO_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "ISO", "extensions": [".iso"], "mime": "application/x-iso9660-image" }, { "type": "archive", - "translationKey": "7Z_ARCHIVE_FILE_TYPE", - "subtype": "7ZIP", + "translationKey": "ARCHIVE_FILE_TYPE", + "subtype": "7-Zip", "extensions": [".7z"], "mime": "application/x-7z-compressed" }, { "type": "archive", - "translationKey": "CRX_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "CRX", "extensions": [".crx"], "mime": "application/x-chrome-extension" }, { "type": "archive", - "translationKey": "TAR_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "TAR", "extensions": [".tar"], "mime": "application/x-tar" }, { "type": "archive", - "translationKey": "BZIP2_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "BZIP2", "extensions": [".bz2", ".bz", ".tbz", ".tbz2", ".tz2", ".tb2"], "mime": "application/x-bzip2" }, { "type": "archive", - "translationKey": "GZIP_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "GZIP", "extensions": [".gz", ".tgz"], "mime": "application/x-gzip" }, { "type": "archive", - "translationKey": "LZIP_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "LZIP", "extensions": [".lz"], "mime": "application/x-lzip" }, { "type": "archive", - "translationKey": "LZOP_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "LZOP", "extensions": [".lzo"], "mime": "application/x-lzop" }, { "type": "archive", - "translationKey": "LZMA_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "LZMA", "extensions": [".lzma", ".tlzma", ".tlz"], "mime": "application/x-lzma" }, { "type": "archive", - "translationKey": "XZ_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "XZ", "extensions": [".xz", ".txz"], "mime": "application/x-xz" }, { "type": "archive", - "translationKey": "Z_ARCHIVE_FILE_TYPE", + "translationKey": "ARCHIVE_FILE_TYPE", "subtype": "Z", "extensions": [".z", ".taz", ".tz"], "mime": "application/x-compress" }, { "type": "archive", - "translationKey": "ZSTD_ARCHIVE_FILE_TYPE", - "subtype": "ZSTD", - "extensions": [".tar.zst", ".tzst", ".zst"], + "translationKey": "ARCHIVE_FILE_TYPE", + "subtype": "Zstandard", + "extensions": [".zst", ".tzst"], "mime": "application/zstd" },
diff --git a/ui/file_manager/file_manager/common/js/file_type_unittest.m.js b/ui/file_manager/file_manager/common/js/file_type_unittest.m.js index 06ebebaf..12e890a 100644 --- a/ui/file_manager/file_manager/common/js/file_type_unittest.m.js +++ b/ui/file_manager/file_manager/common/js/file_type_unittest.m.js
@@ -62,7 +62,7 @@ {name: '/wav/dir/foo.ogg', want: {type: 'audio', subtype: 'OGG'}}, {name: '/mp3/amr/foo.opus', want: {type: 'audio', subtype: 'OGG'}}, // Archive types. - {name: '/dir/foo.7z', want: {type: 'archive', subtype: '7ZIP'}}, + {name: '/dir/foo.7z', want: {type: 'archive', subtype: '7-Zip'}}, {name: '/dir/foo.crx', want: {type: 'archive', subtype: 'CRX'}}, {name: '/dir/foo.iso', want: {type: 'archive', subtype: 'ISO'}}, {name: '/dir/foo.rar', want: {type: 'archive', subtype: 'RAR'}}, @@ -94,9 +94,9 @@ {name: '/dir/foo.tar.Z', want: {type: 'archive', subtype: 'Z'}}, {name: '/dir/foo.taZ', want: {type: 'archive', subtype: 'Z'}}, {name: '/dir/foo.tZ', want: {type: 'archive', subtype: 'Z'}}, - {name: '/dir/foo.zst', want: {type: 'archive', subtype: 'ZSTD'}}, - {name: '/dir/foo.tar.zst', want: {type: 'archive', subtype: 'ZSTD'}}, - {name: '/dir/foo.tzst', want: {type: 'archive', subtype: 'ZSTD'}}, + {name: '/dir/foo.zst', want: {type: 'archive', subtype: 'Zstandard'}}, + {name: '/dir/foo.tar.zst', want: {type: 'archive', subtype: 'Zstandard'}}, + {name: '/dir/foo.tzst', want: {type: 'archive', subtype: 'Zstandard'}}, // Support upper case file name. {name: '/dir/foo.JPG', want: {type: 'image', subtype: 'JPEG'}}, // Unknown files.
diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc index 12193ad..1f69abd 100644 --- a/ui/gtk/gtk_ui.cc +++ b/ui/gtk/gtk_ui.cc
@@ -325,24 +325,6 @@ return true; } -bool GtkUi::GetTint(int id, color_utils::HSL* tint) const { - switch (id) { - // Tints for which the cross-platform default is fine. Before adding new - // values here, specifically verify they work well on Linux. - case ThemeProperties::TINT_BACKGROUND_TAB: - // TODO(estade): Return something useful for TINT_BUTTONS so that chrome:// - // page icons are colored appropriately. - case ThemeProperties::TINT_BUTTONS: - break; - default: - // Assume any tints not specifically verified on Linux aren't usable. - // TODO(pkasting): Try to remove values from |colors_| that could just be - // added to the group above instead. - NOTREACHED(); - } - return false; -} - bool GtkUi::GetColor(int id, SkColor* color, bool use_custom_frame) const { for (const ColorMap& color_map : {colors_,
diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h index 65f9d6c..91a93f88 100644 --- a/ui/gtk/gtk_ui.h +++ b/ui/gtk/gtk_ui.h
@@ -71,7 +71,6 @@ // views::LinuxUI: bool Initialize() override; - bool GetTint(int id, color_utils::HSL* tint) const override; bool GetColor(int id, SkColor* color, bool use_custom_frame) const override; bool GetDisplayProperty(int id, int* result) const override; SkColor GetFocusRingColor() const override;
diff --git a/ui/qt/qt_interface.h b/ui/qt/qt_interface.h index 9a21806..9fe904e 100644 --- a/ui/qt/qt_interface.h +++ b/ui/qt/qt_interface.h
@@ -130,6 +130,8 @@ SkColor default_color, bool is_active, bool use_custom_frame) const = 0; + virtual int GetCursorBlinkIntervalMs() const = 0; + virtual int GetAnimationDurationMs() const = 0; }; } // namespace qt
diff --git a/ui/qt/qt_shim.cc b/ui/qt/qt_shim.cc index ff3956a..fe891af 100644 --- a/ui/qt/qt_shim.cc +++ b/ui/qt/qt_shim.cc
@@ -254,6 +254,14 @@ ColorTypeToColorRole(role))); } +int QtShim::GetCursorBlinkIntervalMs() const { + return app_.cursorFlashTime(); +} + +int QtShim::GetAnimationDurationMs() const { + return app_.style()->styleHint(QStyle::SH_Widget_Animation_Duration); +} + void QtShim::FontChanged(const QFont& font) { delegate_->FontChanged(); }
diff --git a/ui/qt/qt_shim.h b/ui/qt/qt_shim.h index b1bcd687..c7351a9 100644 --- a/ui/qt/qt_shim.h +++ b/ui/qt/qt_shim.h
@@ -34,6 +34,8 @@ SkColor default_color, bool is_active, bool use_custom_frame) const override; + int GetCursorBlinkIntervalMs() const override; + int GetAnimationDurationMs() const override; private slots: void FontChanged(const QFont& font);
diff --git a/ui/qt/qt_ui.cc b/ui/qt/qt_ui.cc index 8eac5db..b0f06921 100644 --- a/ui/qt/qt_ui.cc +++ b/ui/qt/qt_ui.cc
@@ -12,6 +12,7 @@ #include "base/memory/raw_ptr.h" #include "base/notreached.h" #include "base/path_service.h" +#include "base/time/time.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/color/color_mixer.h" #include "ui/color/color_provider.h" @@ -170,11 +171,6 @@ return true; } -bool QtUi::GetTint(int id, color_utils::HSL* tint) const { - NOTIMPLEMENTED_LOG_ONCE(); - return false; -} - bool QtUi::GetColor(int id, SkColor* color, bool use_custom_frame) const { NOTIMPLEMENTED_LOG_ONCE(); return false; @@ -186,33 +182,27 @@ } SkColor QtUi::GetFocusRingColor() const { - NOTIMPLEMENTED_LOG_ONCE(); - return gfx::kPlaceholderColor; + return shim_->GetColor(ColorType::kHighlightBg, ColorState::kNormal); } SkColor QtUi::GetActiveSelectionBgColor() const { - NOTIMPLEMENTED_LOG_ONCE(); - return gfx::kPlaceholderColor; + return shim_->GetColor(ColorType::kHighlightBg, ColorState::kNormal); } SkColor QtUi::GetActiveSelectionFgColor() const { - NOTIMPLEMENTED_LOG_ONCE(); - return gfx::kPlaceholderColor; + return shim_->GetColor(ColorType::kHighlightFg, ColorState::kNormal); } SkColor QtUi::GetInactiveSelectionBgColor() const { - NOTIMPLEMENTED_LOG_ONCE(); - return gfx::kPlaceholderColor; + return shim_->GetColor(ColorType::kHighlightBg, ColorState::kInactive); } SkColor QtUi::GetInactiveSelectionFgColor() const { - NOTIMPLEMENTED_LOG_ONCE(); - return gfx::kPlaceholderColor; + return shim_->GetColor(ColorType::kHighlightFg, ColorState::kInactive); } base::TimeDelta QtUi::GetCursorBlinkInterval() const { - NOTIMPLEMENTED_LOG_ONCE(); - return base::TimeDelta(); + return base::Milliseconds(shim_->GetCursorBlinkIntervalMs()); } gfx::Image QtUi::GetIconForContentType(const std::string& content_type, @@ -260,8 +250,7 @@ } bool QtUi::AnimationsEnabled() const { - NOTIMPLEMENTED_LOG_ONCE(); - return true; + return shim_->GetAnimationDurationMs() > 0; } std::unique_ptr<views::NavButtonProvider> QtUi::CreateNavButtonProvider() {
diff --git a/ui/qt/qt_ui.h b/ui/qt/qt_ui.h index cdd3bc8..03de193 100644 --- a/ui/qt/qt_ui.h +++ b/ui/qt/qt_ui.h
@@ -46,7 +46,6 @@ // views::LinuxUI: bool Initialize() override; - bool GetTint(int id, color_utils::HSL* tint) const override; bool GetColor(int id, SkColor* color, bool use_custom_frame) const override; bool GetDisplayProperty(int id, int* result) const override; SkColor GetFocusRingColor() const override;
diff --git a/ui/views/linux_ui/linux_ui.h b/ui/views/linux_ui/linux_ui.h index cc31ac77..966289d3b 100644 --- a/ui/views/linux_ui/linux_ui.h +++ b/ui/views/linux_ui/linux_ui.h
@@ -38,10 +38,6 @@ class TimeDelta; } -namespace color_utils { -struct HSL; -} - namespace gfx { class Image; } @@ -128,7 +124,6 @@ // Returns true on success. If false is returned, this instance shouldn't // be used and the behavior of all functions is undefined. [[nodiscard]] virtual bool Initialize() = 0; - virtual bool GetTint(int id, color_utils::HSL* tint) const = 0; virtual bool GetColor(int id, SkColor* color, bool use_custom_frame) const = 0;
diff --git a/ui/views/test/widget_test.cc b/ui/views/test/widget_test.cc index 459e046..b1dd4a9 100644 --- a/ui/views/test/widget_test.cc +++ b/ui/views/test/widget_test.cc
@@ -217,7 +217,7 @@ observed_ = true; return; } - widget->AddObserver(this); + widget_observation_.Observe(widget); } WidgetActivationWaiter::~WidgetActivationWaiter() = default; @@ -233,27 +233,23 @@ return; observed_ = true; - widget->RemoveObserver(this); + widget_observation_.Reset(); if (run_loop_.running()) run_loop_.Quit(); } -WidgetDestroyedWaiter::WidgetDestroyedWaiter(Widget* widget) : widget_(widget) { - widget->AddObserver(this); +WidgetDestroyedWaiter::WidgetDestroyedWaiter(Widget* widget) { + widget_observation_.Observe(widget); } -WidgetDestroyedWaiter::~WidgetDestroyedWaiter() { - if (widget_) - widget_->RemoveObserver(this); -} +WidgetDestroyedWaiter::~WidgetDestroyedWaiter() = default; void WidgetDestroyedWaiter::Wait() { run_loop_.Run(); } void WidgetDestroyedWaiter::OnWidgetDestroyed(Widget* widget) { - widget->RemoveObserver(this); - widget_ = nullptr; + widget_observation_.Reset(); run_loop_.Quit(); }
diff --git a/ui/views/test/widget_test.h b/ui/views/test/widget_test.h index 1ba22f67..549704e 100644 --- a/ui/views/test/widget_test.h +++ b/ui/views/test/widget_test.h
@@ -263,9 +263,11 @@ // views::WidgetObserver override: void OnWidgetActivationChanged(Widget* widget, bool active) override; - base::RunLoop run_loop_; bool observed_; bool active_; + + base::RunLoop run_loop_; + base::ScopedObservation<Widget, WidgetObserver> widget_observation_{this}; }; // Use in tests to wait for a widget to be destroyed. @@ -286,8 +288,8 @@ // views::WidgetObserver void OnWidgetDestroyed(Widget* widget) override; - raw_ptr<Widget> widget_; base::RunLoop run_loop_; + base::ScopedObservation<Widget, WidgetObserver> widget_observation_{this}; }; // Helper class to wait for a Widget to become visible. This will add a failure
diff --git a/ui/webui/resources/html/BUILD.gn b/ui/webui/resources/html/BUILD.gn index b4b8153..51d2e8d 100644 --- a/ui/webui/resources/html/BUILD.gn +++ b/ui/webui/resources/html/BUILD.gn
@@ -2,6 +2,7 @@ # 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") import("//ui/webui/resources/tools/generate_grd.gni") include_polymer = !is_android && !is_ios @@ -15,22 +16,8 @@ "assert.html", "cr/event_target.html", "cr.html", - "cr/ui/array_data_model.html", - "cr/ui/command.html", - "cr/ui/context_menu_handler.html", - "cr/ui/focus_manager.html", "cr/ui/focus_outline_manager.html", - "cr/ui/focus_row.html", "cr/ui.html", - "cr/ui/keyboard_shortcut_list.html", - "cr/ui/list.html", - "cr/ui/list_item.html", - "cr/ui/list_selection_controller.html", - "cr/ui/list_selection_model.html", - "cr/ui/menu_button.html", - "cr/ui/menu.html", - "cr/ui/menu_item.html", - "cr/ui/position_util.html", "event_tracker.html", "load_time_data.html", "parse_html_subset.html", @@ -39,15 +26,39 @@ "util.html", ] + if (is_chromeos_ash) { + input_files += [ + "cr/ui/array_data_model.html", + "cr/ui/command.html", + "cr/ui/context_menu_handler.html", + "cr/ui/focus_manager.html", + "cr/ui/focus_row.html", + "cr/ui/keyboard_shortcut_list.html", + "cr/ui/list.html", + "cr/ui/list_item.html", + "cr/ui/list_selection_controller.html", + "cr/ui/list_selection_model.html", + "cr/ui/menu_button.html", + "cr/ui/menu.html", + "cr/ui/menu_item.html", + "cr/ui/position_util.html", + ] + } + if (include_polymer) { input_files += [ - "cr/ui/focus_row_behavior.html", "cr/ui/focus_without_ink.html", - "i18n_behavior.html", - "list_property_update_behavior.html", "polymer.html", - "web_ui_listener_behavior.html", ] + + if (is_chromeos_ash) { + input_files += [ + "cr/ui/focus_row_behavior.html", + "i18n_behavior.html", + "list_property_update_behavior.html", + "web_ui_listener_behavior.html", + ] + } } input_files_base_dir = rebase_path(".", "//") }
diff --git a/ui/webui/resources/js/BUILD.gn b/ui/webui/resources/js/BUILD.gn index 40229e5..6a96181 100644 --- a/ui/webui/resources/js/BUILD.gn +++ b/ui/webui/resources/js/BUILD.gn
@@ -64,7 +64,6 @@ "assert.js", "color_utils.js", "cr.m.js", - "i18n_template_no_process.js", "icon.js", "load_time_data.m.js", "plural_string_proxy.js", @@ -96,6 +95,7 @@ "cr.js", "event_tracker.js", "i18n_behavior.js", + "i18n_template_no_process.js", "list_property_update_behavior.js", "parse_html_subset.js", "polymer_config.js", @@ -164,19 +164,24 @@ ":assert", ":cr", ":event_tracker", - ":i18n_behavior", ":i18n_template_no_process", - ":list_property_update_behavior", ":load_time_data", ":parse_html_subset", ":promise_resolver", ":util", - ":web_ui_listener_behavior", ":webui_resource_test", ] if (is_ios) { deps += [ "ios:web_ui" ] } + + if (is_chromeos_ash) { + deps += [ + ":i18n_behavior", + ":list_property_update_behavior", + ":web_ui_listener_behavior", + ] + } } js_library("action_link") { @@ -201,14 +206,16 @@ deps = [ ":load_time_data" ] } -js_library("i18n_behavior") { - deps = [ - ":load_time_data", - ":parse_html_subset", - ] -} +if (is_chromeos_ash) { + js_library("i18n_behavior") { + deps = [ + ":load_time_data", + ":parse_html_subset", + ] + } -js_library("list_property_update_behavior") { + js_library("list_property_update_behavior") { + } } js_library("load_time_data") { @@ -231,8 +238,10 @@ js_library("webview_manager") { } -js_library("web_ui_listener_behavior") { - deps = [ ":cr" ] +if (is_chromeos_ash) { + js_library("web_ui_listener_behavior") { + deps = [ ":cr" ] + } } js_library("webui_resource_test") {
diff --git a/ui/webui/resources/js/cr/ui/BUILD.gn b/ui/webui/resources/js/cr/ui/BUILD.gn index 2743543..4114d43 100644 --- a/ui/webui/resources/js/cr/ui/BUILD.gn +++ b/ui/webui/resources/js/cr/ui/BUILD.gn
@@ -125,7 +125,6 @@ ":focus_manager", ":focus_outline_manager", ":focus_row", - ":focus_row_behavior", ":focus_without_ink", ":keyboard_shortcut_list", ":list", @@ -140,7 +139,10 @@ ] if (is_chromeos_ash) { - deps += [ ":grid" ] + deps += [ + ":focus_row_behavior", + ":grid", + ] } } @@ -185,11 +187,13 @@ deps = [ "../..:cr" ] } -js_library("focus_row_behavior") { - deps = [ - ":focus_row", - ":focus_without_ink", - ] +if (is_chromeos_ash) { + js_library("focus_row_behavior") { + deps = [ + ":focus_row", + ":focus_without_ink", + ] + } } js_library("focus_row") { @@ -208,8 +212,10 @@ ] } -js_library("grid") { - deps = [ ":list" ] +if (is_chromeos_ash) { + js_library("grid") { + deps = [ ":list" ] + } } js_library("keyboard_shortcut_list") {