diff --git a/DEPS b/DEPS index 2acbc3f..ab86b11 100644 --- a/DEPS +++ b/DEPS
@@ -209,11 +209,11 @@ # 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': 'f60081c6d7a8c63b06bd2eb986e3868d90dca4ff', + 'skia_revision': '0cb3b8280b52b7d61c06ef2d62c5e5b1bd34a50d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '9d1783a04b57fcd17142605d33bfd504a88dab0f', + 'v8_revision': '55e37b474d17543e9a8b6bcba71a1c53b2852da8', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -221,7 +221,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': 'f45dad5ec471a7a0cca0eb352ec15e80c574e6a2', + 'angle_revision': 'ab3b50bcdeef82814e45cc263b6ccb0e6179dbdf', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -280,7 +280,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': '785c56fc0ffa12b96475d37c5bd44e432e6f9c59', + 'catapult_revision': '7318bc06728f464275b8605e5c0da3f45b56710c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # 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 devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '81f64105731b5656b984f38d1982b87d37fc90fd', + 'devtools_frontend_revision': 'c01495c05ce3b1117b39ab4da19bf226ad7dd6b5', # 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. @@ -328,7 +328,7 @@ # 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': '6e62e2f8e529067d15113ed3b1d7e4057ca06bd3', + 'dawn_revision': 'a7f1c50f498e8d0655061e1530984449b8eba5e1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -643,7 +643,7 @@ 'packages': [ { 'package': 'chromium/rts/model/linux-amd64', - 'version': 'oeoQzSzs7TVxdItXFVzVHiYUocanjhc799DduUfj-S0C', + 'version': 'mK6h3vPf42deGRLcNhMs86C7kLFqRBbVdpj6je2B5l4C', }, ], 'dep_type': 'cipd', @@ -654,7 +654,7 @@ 'packages': [ { 'package': 'chromium/rts/model/mac-amd64', - 'version': 'TJjRB2dYdQGXH0TtNl_y_JT_1stRwadWKtneHg79nMMC', + 'version': 'rqMEoeQYWMnizGZkIjhiqqVSq1qopmEoG1_Enf0TzpoC', }, ], 'dep_type': 'cipd', @@ -665,7 +665,7 @@ 'packages': [ { 'package': 'chromium/rts/model/windows-amd64', - 'version': 'hnyWLOusdf5vsW0c0RL6MQwaUl2IbLn5RmefmU_g0CQC', + 'version': '7JwhT_B07YI8j600Y1b8sWxc0z-9agB2f0yas982MaoC', }, ], 'dep_type': 'cipd', @@ -730,7 +730,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'FNuFgvRBcpyQW5WOaiPBvxLfoUoh4aBd5S2QkEohikoC', + 'version': 'F-KyxlnPsilCF8hZJ4eXLycPHgTbV09Ch5FXUOHjzWMC', }, ], 'condition': 'checkout_android', @@ -946,7 +946,7 @@ # Tools used when building Chrome for Chrome OS. This affects both the Simple # Chrome workflow, as well as the chromeos-chrome ebuild. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'c5b619faabf18739581c4a15e3b6f93e03f4d301', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'c1fed741f4b199ee0f3ee424ea28be059877608a', 'condition': 'checkout_chromeos', }, @@ -966,7 +966,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '029279376e6c57e8725ddcabe6fb5d8a9be0a7b5', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '6b022d1efb1559ab795a1c91014a2a6fb7efba88', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1523,7 +1523,7 @@ }, 'src/third_party/usrsctp/usrsctplib': - Var('chromium_git') + '/external/github.com/sctplab/usrsctp' + '@' + '70d42ae95a1de83bd317c8cc9503f894671d1392', + Var('chromium_git') + '/external/github.com/sctplab/usrsctp' + '@' + '0bd8b8110bc1a388649e504de1e673114e91013f', 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@42d8716d02941f47870776a9c273de1effc51b1a', @@ -1549,10 +1549,10 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'a0b8774ce8cec1dc8f4308810bf05eb8867c62de', 'src/third_party/webgpu-cts/src': - Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '3692cbbd3224f9d7e2ae138ef26bd584855249a1', + Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '239db71432f4e4fe1f6192a7d54717701ef84f66', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '612ddd74f07bac7977d4bc1cb6ae91c000a505f2', + Var('webrtc_git') + '/src.git' + '@' + 'da3dc149b20576a9bae09b0d7a4ecfe819829c1f', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1613,7 +1613,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@7b6c9269295024ce875e795c611035b5457ac82c', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@4b648bf36750515bb4f2b451924d5535b8ab1e81', 'condition': 'checkout_src_internal', }, @@ -1632,7 +1632,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'JGsOzVAb46Ymzku7DjvyxxCeTGDJSvYRS6NTSg6gfn8C', + 'version': 'HrL-PzIgGG9Ditn5-3SSdItiYijy3Gpdv8BG7FmvKWMC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1643,7 +1643,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': '2B5B05ygDeofr7aRL1FFD24nF7DFcgThqzOGAq1qSwsC', + 'version': 'yq2wiZvZwXiTKDSQaIwCXw5lybPYtMXTyVf9nUElaXEC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal',
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 5d9e457..76c87f5 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -344,7 +344,7 @@ '^base/cancelable_callback.h', # Intentional. "^docs/callback\\.md", # Intentional "^docs/process/lsc/large_scale_changes\\.md", # Intentional - '^extensions/browser/', + '^extensions/browser/api/webcam_private', '^third_party/blink/PRESUBMIT_test.py', # Intentional. '^third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py' # Intentional pylint: disable=line-too-long '^tools/clang/base_bind_rewriters/', # Intentional.
diff --git a/WATCHLISTS b/WATCHLISTS index 55f3c922..311c9e5 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -1471,9 +1471,7 @@ '|ios/chrome/browser/ui/page_info/' }, 'page_load_metrics' : { - 'filepath': 'chrome/browser/page_load_metrics/'\ - '|chrome/common/page_load_metrics/'\ - '|chrome/renderer/page_load_metrics/' + 'filepath': '/page_load_metrics/' }, 'panels': { 'filepath': 'chrome/browser/ui/panels'\
diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw_contents.cc index 54ad96e8..717993e 100644 --- a/android_webview/browser/aw_contents.cc +++ b/android_webview/browser/aw_contents.cc
@@ -63,7 +63,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "components/autofill/android/provider/autofill_provider_android.h" #include "components/autofill/content/browser/content_autofill_driver_factory.h" -#include "components/autofill/core/browser/browser_autofill_manager.h" +#include "components/autofill/core/browser/android_autofill_manager.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/autofill/core/common/autofill_features.h" #include "components/navigation_interception/intercept_navigation_delegate.h" @@ -327,7 +327,8 @@ is_download_manager_disabled_for_testing()) ? autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER : autofill::AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER, - autofill_provider_.get()); + base::BindRepeating(&autofill::AndroidAutofillManager::Create, + autofill_provider_.get())); } void AwContents::SetAwAutofillClient(const JavaRef<jobject>& client) {
diff --git a/android_webview/browser/gfx/viz_compositor_thread_runner_webview.cc b/android_webview/browser/gfx/viz_compositor_thread_runner_webview.cc index e89895e..6f44e3a6 100644 --- a/android_webview/browser/gfx/viz_compositor_thread_runner_webview.cc +++ b/android_webview/browser/gfx/viz_compositor_thread_runner_webview.cc
@@ -145,13 +145,6 @@ } #endif -void VizCompositorThreadRunnerWebView::CleanupForShutdown( - base::OnceClosure cleanup_finished_callback) { - // In-process gpu is not supposed to shutdown. - // Plus viz thread in webview architecture is not owned by the gpu thread. - NOTREACHED(); -} - viz::GpuServiceImpl* VizCompositorThreadRunnerWebView::GetGpuService() { DCHECK_CALLED_ON_VALID_THREAD(viz_thread_checker_); return gpu_service_impl_;
diff --git a/android_webview/browser/gfx/viz_compositor_thread_runner_webview.h b/android_webview/browser/gfx/viz_compositor_thread_runner_webview.h index ce859ab..0cfb093 100644 --- a/android_webview/browser/gfx/viz_compositor_thread_runner_webview.h +++ b/android_webview/browser/gfx/viz_compositor_thread_runner_webview.h
@@ -66,7 +66,6 @@ #if BUILDFLAG(USE_VIZ_DEVTOOLS) void CreateVizDevTools(viz::mojom::VizDevToolsParamsPtr params) override; #endif - void CleanupForShutdown(base::OnceClosure cleanup_finished_callback) override; private: friend class base::NoDestructor<VizCompositorThreadRunnerWebView>;
diff --git a/android_webview/docs/web-page-layout.md b/android_webview/docs/web-page-layout.md index 5ecffd4..520f060 100644 --- a/android_webview/docs/web-page-layout.md +++ b/android_webview/docs/web-page-layout.md
@@ -56,7 +56,8 @@ Elements with a large fixed width can expand the layout width from the normal value (980 or device-width). This can happen when a mobile site includes a huge image for example. We respect the implied width of the page instead of the one -stated by the viewport tag; this makes us robust to webmaster mistakes. +stated by the viewport tag; this makes us robust to website administrator +mistakes. *** Font Scale is only affected by the TextZoom setting.
diff --git a/android_webview/tools/record_netlog.py b/android_webview/tools/record_netlog.py index 56cb19b1..90e647e 100755 --- a/android_webview/tools/record_netlog.py +++ b/android_webview/tools/record_netlog.py
@@ -1,4 +1,4 @@ -#!/usr/bin/env vpython +#!/usr/bin/env vpython3 # # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be
diff --git a/apps/ui/views/app_window_frame_view.cc b/apps/ui/views/app_window_frame_view.cc index f96d7be..6d940a4 100644 --- a/apps/ui/views/app_window_frame_view.cc +++ b/apps/ui/views/app_window_frame_view.cc
@@ -17,6 +17,7 @@ #include "third_party/skia/include/core/SkRegion.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" @@ -24,7 +25,6 @@ #include "ui/strings/grit/ui_strings.h" // Accessibility names #include "ui/views/controls/button/image_button.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/apps/ui/views/app_window_frame_view.h b/apps/ui/views/app_window_frame_view.h index 0d18c0bc..d97e944 100644 --- a/apps/ui/views/app_window_frame_view.h +++ b/apps/ui/views/app_window_frame_view.h
@@ -8,10 +8,10 @@ #include <string> #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/non_client_view.h" namespace extensions {
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 12442ea54..d7c50e9 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -515,6 +515,12 @@ "host/root_window_transformer.h", "host/transformer_helper.cc", "host/transformer_helper.h", + "hud_display/ash_tracing_handler.cc", + "hud_display/ash_tracing_handler.h", + "hud_display/ash_tracing_manager.cc", + "hud_display/ash_tracing_manager.h", + "hud_display/ash_tracing_request.cc", + "hud_display/ash_tracing_request.h", "hud_display/cpu_graph_page_view.cc", "hud_display/cpu_graph_page_view.h", "hud_display/cpu_status.cc", @@ -1888,6 +1894,7 @@ # TODO(msw): Remove this; ash should not depend on blink/webkit. "//third_party/blink/public:blink_headers", "//third_party/icu", + "//third_party/perfetto:libperfetto", "//third_party/qcms", "//third_party/re2", "//ui/accessibility",
diff --git a/ash/accelerators/accelerator_controller_impl.cc b/ash/accelerators/accelerator_controller_impl.cc index 273f42a..28de32a 100644 --- a/ash/accelerators/accelerator_controller_impl.cc +++ b/ash/accelerators/accelerator_controller_impl.cc
@@ -554,6 +554,11 @@ Shell::Get()->ime_controller()->SwitchToNextIme(); } +void HandleCalculator() { + base::RecordAction(UserMetricsAction("Accel_Open_Calculator")); + NewWindowDelegate::GetInstance()->OpenCalculator(); +} + void HandleDiagnostics() { base::RecordAction(UserMetricsAction("Accel_Open_Diagnostics")); NewWindowDelegate::GetInstance()->OpenDiagnostics(); @@ -903,7 +908,7 @@ } void HandleToggleFullscreen(const ui::Accelerator& accelerator) { - if (accelerator.key_code() == ui::VKEY_MEDIA_LAUNCH_APP2) + if (accelerator.key_code() == ui::VKEY_ZOOM) base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); OverviewController* overview_controller = Shell::Get()->overview_controller(); // Disable fullscreen while overview animation is running due to @@ -2089,6 +2094,7 @@ case MEDIA_STOP: case NEW_TAB: case NEW_WINDOW: + case OPEN_CALCULATOR: case OPEN_CROSH: case OPEN_DIAGNOSTICS: case OPEN_FEEDBACK_PAGE: @@ -2319,6 +2325,9 @@ case NEW_WINDOW: HandleNewWindow(); break; + case OPEN_CALCULATOR: + HandleCalculator(); + break; case OPEN_CROSH: HandleCrosh(); break;
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc index cf4fbfb3..f69e5e7 100644 --- a/ash/accelerators/accelerator_controller_unittest.cc +++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -31,6 +31,7 @@ #include "ash/public/cpp/ime_info.h" #include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/test/shell_test_api.h" +#include "ash/public/cpp/test/test_new_window_delegate.h" #include "ash/session/session_controller_impl.h" #include "ash/session/test_session_controller_client.h" #include "ash/shell.h" @@ -68,6 +69,7 @@ #include "media/base/media_switches.h" #include "services/media_session/public/cpp/test/test_media_controller.h" #include "services/media_session/public/mojom/media_session.mojom.h" +#include "testing/gmock/include/gmock/gmock.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/test/test_window_delegate.h" #include "ui/aura/test/test_windows.h" @@ -220,11 +222,22 @@ DISALLOW_COPY_AND_ASSIGN(DummyKeyboardBrightnessControlDelegate); }; +class MockNewWindowDelegate : public testing::NiceMock<TestNewWindowDelegate> { + public: + // TestNewWindowDelegate: + MOCK_METHOD(void, OpenCalculator, (), (override)); +}; + } // namespace class AcceleratorControllerTest : public AshTestBase { public: - AcceleratorControllerTest() = default; + AcceleratorControllerTest() { + auto delegate = std::make_unique<MockNewWindowDelegate>(); + new_window_delegate_ = delegate.get(); + delegate_provider_ = + std::make_unique<TestNewWindowDelegateProvider>(std::move(delegate)); + } ~AcceleratorControllerTest() override = default; void SetUp() override { @@ -361,6 +374,8 @@ AcceleratorControllerImpl* controller_ = nullptr; // Not owned. std::unique_ptr<AcceleratorControllerImpl::TestApi> test_api_; + MockNewWindowDelegate* new_window_delegate_; + std::unique_ptr<TestNewWindowDelegateProvider> delegate_provider_; private: DISALLOW_COPY_AND_ASSIGN(AcceleratorControllerTest); @@ -1025,7 +1040,7 @@ // Toggle overview and fullscreen immediately after. generator->PressKey(ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_NONE); - generator->PressKey(ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_NONE); + generator->PressKey(ui::VKEY_ZOOM, ui::EF_NONE); EXPECT_FALSE(WindowState::Get(widget->GetNativeWindow())->IsFullscreen()); EXPECT_TRUE(Shell::Get()->overview_controller()->InOverviewSession()); EXPECT_TRUE(Shell::Get() @@ -2128,6 +2143,18 @@ ui::VKEY_OEM_MINUS, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN))); } +TEST_F(AcceleratorControllerTest, CalculatorKey) { + // Verify that the launch calculator key (VKEY_MEDIA_LAUNCH_APP2) is + // registered. + ui::Accelerator accelerator(ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_NONE); + EXPECT_TRUE(controller_->IsRegistered(accelerator)); + + // Verify that the delegate to open the app is called. + EXPECT_CALL(*new_window_delegate_, OpenCalculator) + .WillOnce(testing::Return()); + EXPECT_TRUE(ProcessInController(accelerator)); +} + namespace { // TODO(crbug.com/1179893): Remove once the feature is enabled permantently.
diff --git a/ash/accelerators/accelerator_table_unittest.cc b/ash/accelerators/accelerator_table_unittest.cc index ddc9151..6d0f7b0 100644 --- a/ash/accelerators/accelerator_table_unittest.cc +++ b/ash/accelerators/accelerator_table_unittest.cc
@@ -17,10 +17,10 @@ namespace { // The number of non-Search-based accelerators. -constexpr int kNonSearchAcceleratorsNum = 102; +constexpr int kNonSearchAcceleratorsNum = 103; // The hash of non-Search-based accelerators. See HashAcceleratorData(). constexpr char kNonSearchAcceleratorsHash[] = - "3854f7bea40ae9c966710db8264744f5"; + "0f8a05d6977b992c557c28251c1ac639"; struct Cmp { bool operator()(const AcceleratorData& lhs,
diff --git a/ash/accelerators/accelerator_unittest.cc b/ash/accelerators/accelerator_unittest.cc index 927ee5b..8cff255 100644 --- a/ash/accelerators/accelerator_unittest.cc +++ b/ash/accelerators/accelerator_unittest.cc
@@ -300,9 +300,9 @@ // Test TOGGLE_FULLSCREEN. WindowState* active_window_state = WindowState::ForActiveWindow(); EXPECT_FALSE(active_window_state->IsFullscreen()); - SendKeyPressSync(ui::VKEY_MEDIA_LAUNCH_APP2, false, false, false); + SendKeyPressSync(ui::VKEY_ZOOM, false, false, false); EXPECT_TRUE(active_window_state->IsFullscreen()); - SendKeyPressSync(ui::VKEY_MEDIA_LAUNCH_APP2, false, false, false); + SendKeyPressSync(ui::VKEY_ZOOM, false, false, false); EXPECT_FALSE(active_window_state->IsFullscreen()); }
diff --git a/ash/accelerators/pre_target_accelerator_handler.cc b/ash/accelerators/pre_target_accelerator_handler.cc index 508acc9b..31ed5e8 100644 --- a/ash/accelerators/pre_target_accelerator_handler.cc +++ b/ash/accelerators/pre_target_accelerator_handler.cc
@@ -23,7 +23,7 @@ bool IsSystemKey(ui::KeyboardCode key_code) { switch (key_code) { case ui::VKEY_ASSISTANT: - case ui::VKEY_MEDIA_LAUNCH_APP2: // Fullscreen button. + case ui::VKEY_ZOOM: // Fullscreen button. case ui::VKEY_MEDIA_LAUNCH_APP1: // Overview button. case ui::VKEY_BRIGHTNESS_DOWN: case ui::VKEY_BRIGHTNESS_UP:
diff --git a/ash/ambient/ambient_access_token_controller.cc b/ash/ambient/ambient_access_token_controller.cc index 2e63fd8b..6dd5e7d 100644 --- a/ash/ambient/ambient_access_token_controller.cc +++ b/ash/ambient/ambient_access_token_controller.cc
@@ -84,10 +84,13 @@ if (gaia_id.empty() || access_token.empty()) { refresh_token_retry_backoff_.InformOfRequest(/*succeeded=*/false); - if (refresh_token_retry_backoff_.failure_count() <= kMaxRetries) + if (refresh_token_retry_backoff_.failure_count() <= kMaxRetries) { + LOG(WARNING) << "Unable to refresh access token. Retrying.."; RetryRefreshAccessToken(); - else + } else { + LOG(ERROR) << "Unable to refresh access token. All retries attempted."; NotifyAccessTokenRefreshed(); + } return; }
diff --git a/ash/ambient/ambient_photo_controller.cc b/ash/ambient/ambient_photo_controller.cc index 2999855..dbbb129 100644 --- a/ash/ambient/ambient_photo_controller.cc +++ b/ash/ambient/ambient_photo_controller.cc
@@ -250,7 +250,7 @@ // It is possible that |screen_update| is an empty instance if fatal errors // happened during the fetch. if (screen_update.next_topics.empty()) { - LOG(WARNING) << "The screen update has no topics."; + DVLOG(2) << "The screen update has no topics."; fetch_topic_retry_backoff_.InformOfRequest(/*succeeded=*/false); ScheduleFetchTopics(/*backoff=*/true);
diff --git a/ash/ambient/backdrop/ambient_backend_controller_impl.cc b/ash/ambient/backdrop/ambient_backend_controller_impl.cc index cdff116..3fa6ff9f 100644 --- a/ash/ambient/backdrop/ambient_backend_controller_impl.cc +++ b/ash/ambient/backdrop/ambient_backend_controller_impl.cc
@@ -329,9 +329,9 @@ response_code = simple_loader_->ResponseInfo()->headers->response_code(); } - LOG(ERROR) << "Downloading Backdrop proto failed with error code: " - << response_code << " with network error" - << simple_loader_->NetError(); + DVLOG(2) << "Downloading Backdrop proto failed with error code: " + << response_code << " with network error" + << simple_loader_->NetError(); simple_loader_.reset(); std::move(callback).Run(std::make_unique<std::string>()); return; @@ -457,7 +457,7 @@ const std::string& gaia_id, const std::string& access_token) { if (gaia_id.empty() || access_token.empty()) { - LOG(ERROR) << "Failed to fetch access token"; + DVLOG(2) << "Failed to fetch access token"; // Returns an empty instance to indicate the failure. std::move(callback).Run(ash::ScreenUpdate()); return; @@ -607,7 +607,7 @@ const std::string& gaia_id, const std::string& access_token) { if (gaia_id.empty() || access_token.empty()) { - LOG(ERROR) << "Failed to fetch access token"; + DVLOG(2) << "Failed to fetch access token"; // Returns an empty instance to indicate the failure. std::move(callback).Run(/*preview_urls=*/{}); return; @@ -650,7 +650,7 @@ const std::string& gaia_id, const std::string& access_token) { if (gaia_id.empty() || access_token.empty()) { - LOG(ERROR) << "Failed to fetch access token"; + DVLOG(2) << "Failed to fetch access token"; // Returns an empty instance to indicate the failure. std::move(callback).Run(ash::PersonalAlbums()); return;
diff --git a/ash/ambient/ui/ambient_background_image_view.cc b/ash/ambient/ui/ambient_background_image_view.cc index a5158d1..516645b 100644 --- a/ash/ambient/ui/ambient_background_image_view.cc +++ b/ash/ambient/ui/ambient_background_image_view.cc
@@ -13,6 +13,7 @@ #include "ash/ambient/ui/media_string_view.h" #include "ash/ambient/util/ambient_util.h" #include "base/rand_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/events/event.h" #include "ui/gfx/geometry/insets.h" @@ -22,7 +23,6 @@ #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace ash {
diff --git a/ash/ambient/ui/ambient_background_image_view.h b/ash/ambient/ui/ambient_background_image_view.h index 1ed61fd1..3f16cfe 100644 --- a/ash/ambient/ui/ambient_background_image_view.h +++ b/ash/ambient/ui/ambient_background_image_view.h
@@ -10,8 +10,8 @@ #include "ash/ambient/ui/ambient_view_delegate.h" #include "ash/ash_export.h" #include "base/scoped_multi_source_observation.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/view_observer.h"
diff --git a/ash/ambient/ui/ambient_container_view.cc b/ash/ambient/ui/ambient_container_view.cc index 77072a47..f952e02 100644 --- a/ash/ambient/ui/ambient_container_view.cc +++ b/ash/ambient/ui/ambient_container_view.cc
@@ -13,9 +13,9 @@ #include "ash/ambient/util/ambient_util.h" #include "ash/public/cpp/shell_window_ids.h" #include "ui/aura/window.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/background.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/ash/ambient/ui/ambient_info_view.cc b/ash/ambient/ui/ambient_info_view.cc index 9d73cfaa..c720a39 100644 --- a/ash/ambient/ui/ambient_info_view.cc +++ b/ash/ambient/ui/ambient_info_view.cc
@@ -10,11 +10,11 @@ #include "ash/ambient/ui/ambient_view_ids.h" #include "ash/ambient/ui/glanceable_info_view.h" #include "ash/ambient/util/ambient_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace ash {
diff --git a/ash/ambient/ui/ambient_info_view.h b/ash/ambient/ui/ambient_info_view.h index d4bbecbf..1d17d65 100644 --- a/ash/ambient/ui/ambient_info_view.h +++ b/ash/ambient/ui/ambient_info_view.h
@@ -7,7 +7,7 @@ #include "ash/ambient/ui/ambient_view_delegate.h" #include "ash/ash_export.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace gfx {
diff --git a/ash/ambient/ui/ambient_shield_view.cc b/ash/ambient/ui/ambient_shield_view.cc index 344410f5..9436d6c 100644 --- a/ash/ambient/ui/ambient_shield_view.cc +++ b/ash/ambient/ui/ambient_shield_view.cc
@@ -8,6 +8,7 @@ #include "ash/ambient/ui/ambient_view_ids.h" #include "ash/style/ash_color_provider.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer_delegate.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" @@ -15,7 +16,6 @@ #include "ui/views/background.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/view_class_properties.h"
diff --git a/ash/ambient/ui/ambient_shield_view.h b/ash/ambient/ui/ambient_shield_view.h index 35587a9..9bfa47e 100644 --- a/ash/ambient/ui/ambient_shield_view.h +++ b/ash/ambient/ui/ambient_shield_view.h
@@ -5,7 +5,7 @@ #ifndef ASH_AMBIENT_UI_AMBIENT_SHIELD_VIEW_H_ #define ASH_AMBIENT_UI_AMBIENT_SHIELD_VIEW_H_ -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace ash {
diff --git a/ash/ambient/ui/glanceable_info_view.cc b/ash/ambient/ui/glanceable_info_view.cc index 1a589f4..da44d8f3 100644 --- a/ash/ambient/ui/glanceable_info_view.cc +++ b/ash/ambient/ui/glanceable_info_view.cc
@@ -21,6 +21,7 @@ #include "base/strings/utf_string_conversions.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/font_list.h" #include "ui/gfx/geometry/insets.h" @@ -31,7 +32,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" namespace ash {
diff --git a/ash/ambient/ui/media_string_view.cc b/ash/ambient/ui/media_string_view.cc index a07560a..af1d2b69 100644 --- a/ash/ambient/ui/media_string_view.cc +++ b/ash/ambient/ui/media_string_view.cc
@@ -21,6 +21,7 @@ #include "services/media_session/public/cpp/media_session_service.h" #include "services/media_session/public/mojom/media_session.mojom.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/paint_recorder.h" #include "ui/compositor/scoped_layer_animation_settings.h" @@ -36,7 +37,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/ambient/ui/photo_view.cc b/ash/ambient/ui/photo_view.cc index 6a162cd6..fc14a9f 100644 --- a/ash/ambient/ui/photo_view.cc +++ b/ash/ambient/ui/photo_view.cc
@@ -17,12 +17,12 @@ #include "base/metrics/histogram_functions.h" #include "base/strings/utf_string_conversions.h" #include "ui/aura/window.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/animation_throughput_reporter.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/views/controls/image_view.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/app_list/BUILD.gn b/ash/app_list/BUILD.gn index c70ec08..2281567 100644 --- a/ash/app_list/BUILD.gn +++ b/ash/app_list/BUILD.gn
@@ -23,6 +23,10 @@ "app_list_util.cc", "app_list_util.h", "app_list_view_delegate.h", + "bubble/app_list_bubble.cc", + "bubble/app_list_bubble.h", + "bubble/app_list_bubble_view.cc", + "bubble/app_list_bubble_view.h", "home_launcher_animation_info.h", "paged_view_structure.cc", "paged_view_structure.h", @@ -206,6 +210,7 @@ "app_list_presenter_delegate_unittest.cc", "app_list_presenter_impl_unittest.cc", "app_list_unittest.cc", + "bubble/app_list_bubble_unittest.cc", "folder_image_unittest.cc", "model/app_list_item_list_unittest.cc", "model/app_list_model_unittest.cc",
diff --git a/ash/app_list/app_list_controller_impl.cc b/ash/app_list/app_list_controller_impl.cc index 2b94580..c78ca0a6 100644 --- a/ash/app_list/app_list_controller_impl.cc +++ b/ash/app_list/app_list_controller_impl.cc
@@ -9,6 +9,7 @@ #include "ash/app_list/app_list_metrics.h" #include "ash/app_list/app_list_presenter_delegate_impl.h" +#include "ash/app_list/bubble/app_list_bubble.h" #include "ash/app_list/model/app_list_folder_item.h" #include "ash/app_list/model/app_list_item.h" #include "ash/app_list/views/app_list_main_view.h" @@ -260,6 +261,9 @@ presenter_(this, std::make_unique<AppListPresenterDelegateImpl>(this)), is_notification_indicator_enabled_( ::features::IsNotificationIndicatorEnabled()) { + if (features::IsAppListBubbleEnabled()) + app_list_bubble_ = std::make_unique<AppListBubble>(); + model_->AddObserver(this); SessionControllerImpl* session_controller = Shell::Get()->session_controller(); @@ -540,6 +544,11 @@ tracked_app_window_ = nullptr; } + // Don't check tablet mode here. This function can be called during tablet + // mode transitions and we always want to close anyway. + if (features::IsAppListBubbleEnabled()) + app_list_bubble_->Dismiss(); + presenter_.Dismiss(base::TimeTicks()); } @@ -553,6 +562,12 @@ } void AppListControllerImpl::ShowAppList() { + if (features::IsAppListBubbleEnabled() && !IsTabletMode()) { + DCHECK(!presenter_.GetTargetVisibility()); + app_list_bubble_->Show(GetDisplayIdToShowAppListOn()); + return; + } + DCHECK(!features::IsAppListBubbleEnabled() || !app_list_bubble_->IsShowing()); presenter_.Show(AppListViewState::kPeeking, GetDisplayIdToShowAppListOn(), base::TimeTicks()); } @@ -695,6 +710,10 @@ if (show_source.has_value()) LogAppListShowSource(show_source.value()); + if (features::IsAppListBubbleEnabled() && !IsTabletMode()) { + app_list_bubble_->Show(display_id); + return; + } presenter_.Show(AppListViewState::kPeeking, display_id, event_time_stamp); } @@ -740,6 +759,12 @@ return SHELF_ACTION_APP_LIST_SHOWN; } + if (features::IsAppListBubbleEnabled()) { + app_list_bubble_->Toggle(display_id); + return app_list_bubble_->IsShowing() ? SHELF_ACTION_APP_LIST_SHOWN + : SHELF_ACTION_APP_LIST_DISMISSED; + } + base::AutoReset<bool> auto_reset(&should_dismiss_immediately_, display_id != last_visible_display_id_); ShelfAction action = @@ -990,6 +1015,10 @@ if (app_list_view && app_list_view->is_side_shelf()) DismissAppList(); + // AppListBubble is only used in clamshell mode. + if (features::IsAppListBubbleEnabled()) + DismissAppList(); + presenter_.OnTabletModeChanged(true); // Show the app list if the tablet mode starts.
diff --git a/ash/app_list/app_list_controller_impl.h b/ash/app_list/app_list_controller_impl.h index 3c193ee5..25ae2c6 100644 --- a/ash/app_list/app_list_controller_impl.h +++ b/ash/app_list/app_list_controller_impl.h
@@ -52,6 +52,7 @@ namespace ash { +class AppListBubble; class AppListControllerObserver; // Ash's AppListController owns the AppListModel and implements interface @@ -370,6 +371,8 @@ void SetHomeLauncherAnimationCallbackForTesting( HomeLauncherAnimationCallback callback); + AppListBubble* app_list_bubble_for_test() { return app_list_bubble_.get(); } + void RecordShelfAppLaunched(); // Updates which container the launcher window should be in. @@ -471,6 +474,10 @@ // in destruction. AppListPresenterImpl presenter_; + // Manages the clamshell launcher bubble. Null when the feature AppListBubble + // is disabled. + std::unique_ptr<AppListBubble> app_list_bubble_; + // True if the on-screen keyboard is shown. bool onscreen_keyboard_shown_ = false;
diff --git a/ash/app_list/app_list_controller_impl_unittest.cc b/ash/app_list/app_list_controller_impl_unittest.cc index fbfc934..5eadaee 100644 --- a/ash/app_list/app_list_controller_impl_unittest.cc +++ b/ash/app_list/app_list_controller_impl_unittest.cc
@@ -9,6 +9,7 @@ #include "ash/app_list/app_list_metrics.h" #include "ash/app_list/app_list_test_view_delegate.h" +#include "ash/app_list/bubble/app_list_bubble.h" #include "ash/app_list/test/app_list_test_helper.h" #include "ash/app_list/views/app_list_item_view.h" #include "ash/app_list/views/app_list_main_view.h" @@ -19,6 +20,7 @@ #include "ash/app_list/views/contents_view.h" #include "ash/app_list/views/expand_arrow_view.h" #include "ash/app_list/views/search_box_view.h" +#include "ash/constants/ash_features.h" #include "ash/ime/ime_controller_impl.h" #include "ash/ime/test_ime_controller_client.h" #include "ash/keyboard/keyboard_controller_impl.h" @@ -111,6 +113,10 @@ return GetAppListView()->GetWidget()->GetNativeView(); } +void EnableTabletMode() { + Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true); +} + } // namespace class AppListControllerImplTest : public AshTestBase { @@ -1225,4 +1231,73 @@ "Apps.StateTransition.Drag.PresentationTime.MaxLatency.ClamshellMode", 1); } +// Tests with feature AppListBubble enabled. This is a separate test suite +// because the feature must be enabled before ash::Shell constructs the +// AppListControllerImpl. +class AppListControllerImplAppListBubbleTest : public AshTestBase { + public: + AppListControllerImplAppListBubbleTest() { + scoped_features_.InitAndEnableFeature(features::kAppListBubble); + } + ~AppListControllerImplAppListBubbleTest() override = default; + + base::test::ScopedFeatureList scoped_features_; +}; + +TEST_F(AppListControllerImplAppListBubbleTest, ShowAppListOpensBubble) { + auto* controller = Shell::Get()->app_list_controller(); + controller->ShowAppList(); + + EXPECT_TRUE(controller->app_list_bubble_for_test()->IsShowing()); +} + +TEST_F(AppListControllerImplAppListBubbleTest, ToggleAppListOpensBubble) { + auto* controller = Shell::Get()->app_list_controller(); + controller->ToggleAppList(GetPrimaryDisplay().id(), + AppListShowSource::kShelfButton, + /*event_time_stamp=*/{}); + + EXPECT_TRUE(controller->app_list_bubble_for_test()->IsShowing()); +} + +TEST_F(AppListControllerImplAppListBubbleTest, DismissAppListClosesBubble) { + auto* controller = Shell::Get()->app_list_controller(); + controller->ShowAppList(); + + controller->DismissAppList(); + + EXPECT_FALSE(controller->app_list_bubble_for_test()->IsShowing()); +} + +TEST_F(AppListControllerImplAppListBubbleTest, + ShowAppListDoesNotOpenBubbleInTabletMode) { + EnableTabletMode(); + + auto* controller = Shell::Get()->app_list_controller(); + controller->ShowAppList(); + + EXPECT_FALSE(controller->app_list_bubble_for_test()->IsShowing()); +} + +TEST_F(AppListControllerImplAppListBubbleTest, + ToggleAppListDoesNotOpenBubbleInTabletMode) { + EnableTabletMode(); + + auto* controller = Shell::Get()->app_list_controller(); + controller->ToggleAppList(GetPrimaryDisplay().id(), + AppListShowSource::kShelfButton, + /*event_time_stamp=*/{}); + + EXPECT_FALSE(controller->app_list_bubble_for_test()->IsShowing()); +} + +TEST_F(AppListControllerImplAppListBubbleTest, EnteringTabletModeClosesBubble) { + auto* controller = Shell::Get()->app_list_controller(); + controller->ShowAppList(); + + EnableTabletMode(); + + EXPECT_FALSE(controller->app_list_bubble_for_test()->IsShowing()); +} + } // namespace ash
diff --git a/ash/app_list/bubble/app_list_bubble.cc b/ash/app_list/bubble/app_list_bubble.cc new file mode 100644 index 0000000..49b7fa0a --- /dev/null +++ b/ash/app_list/bubble/app_list_bubble.cc
@@ -0,0 +1,48 @@ +// 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. + +#include "ash/app_list/bubble/app_list_bubble.h" + +#include <memory> + +#include "ash/app_list/bubble/app_list_bubble_view.h" +#include "base/logging.h" +#include "ui/views/widget/widget.h" + +namespace ash { + +AppListBubble::AppListBubble() = default; + +AppListBubble::~AppListBubble() = default; + +void AppListBubble::Show(int64_t display_id) { + DVLOG(1) << __PRETTY_FUNCTION__; + if (bubble_widget_) + return; + bubble_widget_ = + base::WrapUnique(views::BubbleDialogDelegateView::CreateBubble( + std::make_unique<AppListBubbleView>())); + bubble_widget_->Show(); + // TODO(https://crbug.com/1205494): Focus search box. +} + +void AppListBubble::Toggle(int64_t display_id) { + DVLOG(1) << __PRETTY_FUNCTION__; + if (bubble_widget_) { + Dismiss(); + return; + } + Show(display_id); +} + +void AppListBubble::Dismiss() { + DVLOG(1) << __PRETTY_FUNCTION__; + bubble_widget_.reset(); // Triggers asynchronous close. +} + +bool AppListBubble::IsShowing() const { + return !!bubble_widget_; +} + +} // namespace ash
diff --git a/ash/app_list/bubble/app_list_bubble.h b/ash/app_list/bubble/app_list_bubble.h new file mode 100644 index 0000000..933a8375 --- /dev/null +++ b/ash/app_list/bubble/app_list_bubble.h
@@ -0,0 +1,43 @@ +// 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. + +#ifndef ASH_APP_LIST_BUBBLE_APP_LIST_BUBBLE_H_ +#define ASH_APP_LIST_BUBBLE_APP_LIST_BUBBLE_H_ + +#include <stdint.h> + +#include "ash/ash_export.h" +#include "ui/views/widget/unique_widget_ptr.h" + +namespace ash { + +// Manages the UI for the bubble launcher used in clamshell mode. Handles +// showing and hiding the UI. Only one bubble can be visible at a time, across +// all displays. +class ASH_EXPORT AppListBubble { + public: + AppListBubble(); + ~AppListBubble(); + + // Shows the bubble on the display with `display_id`. + void Show(int64_t display_id); + + // Shows or hides the bubble on the display with `display_id`. + void Toggle(int64_t display_id); + + // Closes and destroys the bubble. + void Dismiss(); + + // Returns true if the bubble is showing on any display. + bool IsShowing() const; + + views::Widget* bubble_widget_for_test() { return bubble_widget_.get(); } + + private: + views::UniqueWidgetPtr bubble_widget_; +}; + +} // namespace ash + +#endif // ASH_APP_LIST_BUBBLE_APP_LIST_BUBBLE_H_
diff --git a/ash/app_list/bubble/app_list_bubble_unittest.cc b/ash/app_list/bubble/app_list_bubble_unittest.cc new file mode 100644 index 0000000..65c4bd3 --- /dev/null +++ b/ash/app_list/bubble/app_list_bubble_unittest.cc
@@ -0,0 +1,106 @@ +// 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. + +#include "ash/app_list/bubble/app_list_bubble.h" + +#include <set> + +#include "ash/public/cpp/shell_window_ids.h" +#include "ash/shell.h" +#include "ash/test/ash_test_base.h" +#include "base/run_loop.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/display/display.h" +#include "ui/views/test/widget_test.h" +#include "ui/views/widget/widget.h" + +using views::test::WidgetDestroyedWaiter; + +namespace ash { +namespace { + +// Returns the number of widgets in the app list container on the primary +// display. +size_t NumberOfWidgetsInAppListContainer() { + aura::Window* container = Shell::GetContainer( + Shell::GetPrimaryRootWindow(), kShellWindowId_AppListContainer); + std::set<views::Widget*> widgets; + views::Widget::GetAllChildWidgets(container, &widgets); + return widgets.size(); +} + +using AppListBubbleTest = AshTestBase; + +TEST_F(AppListBubbleTest, ShowOpensOneWidgetInAppListContainer) { + AppListBubble bubble; + bubble.Show(GetPrimaryDisplay().id()); + + EXPECT_EQ(1u, NumberOfWidgetsInAppListContainer()); +} + +TEST_F(AppListBubbleTest, DismissClosesWidget) { + AppListBubble bubble; + bubble.Show(GetPrimaryDisplay().id()); + + WidgetDestroyedWaiter waiter(bubble.bubble_widget_for_test()); + bubble.Dismiss(); + waiter.Wait(); + + EXPECT_EQ(0u, NumberOfWidgetsInAppListContainer()); +} + +TEST_F(AppListBubbleTest, ToggleOpensOneWidgetInAppListContainer) { + AppListBubble bubble; + bubble.Toggle(GetPrimaryDisplay().id()); + + EXPECT_EQ(1u, NumberOfWidgetsInAppListContainer()); +} + +TEST_F(AppListBubbleTest, ToggleClosesWidgetInAppListContainer) { + AppListBubble bubble; + bubble.Toggle(GetPrimaryDisplay().id()); + + WidgetDestroyedWaiter waiter(bubble.bubble_widget_for_test()); + bubble.Toggle(GetPrimaryDisplay().id()); + waiter.Wait(); + + EXPECT_EQ(0u, NumberOfWidgetsInAppListContainer()); +} + +TEST_F(AppListBubbleTest, BubbleIsNotShowingByDefault) { + AppListBubble bubble; + + EXPECT_FALSE(bubble.IsShowing()); +} + +TEST_F(AppListBubbleTest, BubbleIsShowingAfterShow) { + AppListBubble bubble; + bubble.Show(GetPrimaryDisplay().id()); + + EXPECT_TRUE(bubble.IsShowing()); +} + +TEST_F(AppListBubbleTest, BubbleIsNotShowingAfterDismiss) { + AppListBubble bubble; + bubble.Show(GetPrimaryDisplay().id()); + bubble.Dismiss(); + + EXPECT_FALSE(bubble.IsShowing()); +} + +TEST_F(AppListBubbleTest, DoesNotCrashWhenNativeWidgetDestroyed) { + AppListBubble bubble; + bubble.Show(GetPrimaryDisplay().id()); + + aura::Window* container = Shell::GetContainer( + Shell::GetPrimaryRootWindow(), kShellWindowId_AppListContainer); + ASSERT_EQ(1u, container->children().size()); + aura::Window* native_window = container->children()[0]; + delete native_window; + + // No crash. +} + +} // namespace +} // namespace ash
diff --git a/ash/app_list/bubble/app_list_bubble_view.cc b/ash/app_list/bubble/app_list_bubble_view.cc new file mode 100644 index 0000000..1baa5fb --- /dev/null +++ b/ash/app_list/bubble/app_list_bubble_view.cc
@@ -0,0 +1,48 @@ +// 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. + +#include "ash/app_list/bubble/app_list_bubble_view.h" + +#include <memory> + +#include "ash/public/cpp/shell_window_ids.h" +#include "ash/shelf/shelf.h" +#include "ash/shell.h" +#include "ui/base/ui_base_types.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/views/bubble/bubble_border.h" +#include "ui/views/controls/label.h" +#include "ui/views/layout/box_layout.h" + +using views::BoxLayout; + +namespace ash { + +AppListBubbleView::AppListBubbleView() + : views::BubbleDialogDelegateView(/*anchor_view=*/nullptr, + views::BubbleBorder::BOTTOM_LEFT) { + // TODO(https://crbug.com/1204554): Support BubbleBorder::TOP_LEFT and + // TOP_RIGHT for side-aligned shelf. + + SetButtons(ui::DIALOG_BUTTON_NONE); + + // TODO(https://crbug.com/1204554): Multi-display support. + aura::Window* root_window = Shell::GetPrimaryRootWindow(); + set_parent_window( + Shell::GetContainer(root_window, kShellWindowId_AppListContainer)); + + // TODO(https://crbug.com/1204554): Anchor to launcher button rect. + SetAnchorRect(Shelf::ForWindow(root_window)->GetShelfBoundsInScreen()); + + auto* layout = SetLayoutManager( + std::make_unique<BoxLayout>(BoxLayout::Orientation::kVertical)); + layout->set_cross_axis_alignment(BoxLayout::CrossAxisAlignment::kStretch); + + // TODO(https://crbug.com/1204551): Create real contents. + AddChildView(std::make_unique<views::Label>(u"Placeholder")); +} + +AppListBubbleView::~AppListBubbleView() = default; + +} // namespace ash
diff --git a/ash/app_list/bubble/app_list_bubble_view.h b/ash/app_list/bubble/app_list_bubble_view.h new file mode 100644 index 0000000..250d46099 --- /dev/null +++ b/ash/app_list/bubble/app_list_bubble_view.h
@@ -0,0 +1,24 @@ +// 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. + +#ifndef ASH_APP_LIST_BUBBLE_APP_LIST_BUBBLE_VIEW_H_ +#define ASH_APP_LIST_BUBBLE_APP_LIST_BUBBLE_VIEW_H_ + +#include "ash/ash_export.h" +#include "ui/views/bubble/bubble_dialog_delegate_view.h" + +namespace ash { + +// Contains the views for the bubble version of the launcher. +class ASH_EXPORT AppListBubbleView : public views::BubbleDialogDelegateView { + public: + AppListBubbleView(); + AppListBubbleView(const AppListBubbleView&) = delete; + AppListBubbleView& operator=(const AppListBubbleView&) = delete; + ~AppListBubbleView() override; +}; + +} // namespace ash + +#endif // ASH_APP_LIST_BUBBLE_APP_LIST_BUBBLE_VIEW_H_
diff --git a/ash/app_list/views/app_list_folder_view.cc b/ash/app_list/views/app_list_folder_view.cc index ac541fb..8d44492 100644 --- a/ash/app_list/views/app_list_folder_view.cc +++ b/ash/app_list/views/app_list_folder_view.cc
@@ -30,6 +30,7 @@ #include "ash/public/cpp/pagination/pagination_model.h" #include "base/strings/utf_string_conversions.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_observer.h" #include "ui/compositor/scoped_layer_animation_settings.h" @@ -42,7 +43,6 @@ #include "ui/views/animation/animation_delegate_views.h" #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/view_model.h" #include "ui/views/view_model_utils.h"
diff --git a/ash/app_list/views/app_list_folder_view.h b/ash/app_list/views/app_list_folder_view.h index 5284f24a..d7e7038 100644 --- a/ash/app_list/views/app_list_folder_view.h +++ b/ash/app_list/views/app_list_folder_view.h
@@ -14,9 +14,9 @@ #include "ash/app_list/views/folder_header_view.h" #include "ash/app_list/views/folder_header_view_delegate.h" #include "base/optional.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/compositor/throughput_tracker.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/view_model.h"
diff --git a/ash/app_list/views/app_list_item_view.cc b/ash/app_list/views/app_list_item_view.cc index e3e641d3..4ca1b8fc 100644 --- a/ash/app_list/views/app_list_item_view.cc +++ b/ash/app_list/views/app_list_item_view.cc
@@ -26,6 +26,7 @@ #include "cc/paint/paint_flags.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_features.h" #include "ui/compositor/layer.h" @@ -50,7 +51,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/drag_controller.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/app_list/views/expand_arrow_view.cc b/ash/app_list/views/expand_arrow_view.cc index f81b688..855c2b1d 100644 --- a/ash/app_list/views/expand_arrow_view.cc +++ b/ash/app_list/views/expand_arrow_view.cc
@@ -144,6 +144,8 @@ SetInkDropMode(InkDropMode::ON); views::HighlightPathGenerator::Install( this, std::make_unique<ExpandArrowHighlightPathGenerator>()); + views::InkDrop::UseInkDropWithoutAutoHighlight(this, + /*highlight_on_hover=*/false); SetAccessibleName(l10n_util::GetStringUTF16(IDS_APP_LIST_EXPAND_BUTTON)); @@ -271,11 +273,6 @@ return "ExpandArrowView"; } -std::unique_ptr<views::InkDrop> ExpandArrowView::CreateInkDrop() { - return views::InkDrop::CreateInkDropWithoutAutoHighlight( - this, /*highlight_on_hover=*/false); -} - std::unique_ptr<views::InkDropRipple> ExpandArrowView::CreateInkDropRipple() const { const AppListColorProvider* color_provider = AppListColorProvider::Get();
diff --git a/ash/app_list/views/expand_arrow_view.h b/ash/app_list/views/expand_arrow_view.h index daf2a2a..3e8e379 100644 --- a/ash/app_list/views/expand_arrow_view.h +++ b/ash/app_list/views/expand_arrow_view.h
@@ -18,7 +18,6 @@ } // namespace gfx namespace views { -class InkDrop; class InkDropRipple; } // namespace views @@ -45,7 +44,6 @@ const char* GetClassName() const override; // views::InkDropHostView: - std::unique_ptr<views::InkDrop> CreateInkDrop() override; std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; // Calculates vertical offset between expand arrow circle's positions with app
diff --git a/ash/app_list/views/page_switcher.cc b/ash/app_list/views/page_switcher.cc index 47d47d3..bdd1d7f 100644 --- a/ash/app_list/views/page_switcher.cc +++ b/ash/app_list/views/page_switcher.cc
@@ -56,6 +56,7 @@ background_color_(background_color) { SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY); SetInkDropMode(InkDropMode::ON); + views::InkDrop::UseInkDropForFloodFillRipple(this); views::InstallFixedSizeCircleHighlightPathGenerator( this, is_root_app_grid_page_switcher ? kInkDropRadiusForRootGrid : kInkDropRadiusForFolderGrid); @@ -88,10 +89,6 @@ } protected: - std::unique_ptr<views::InkDrop> CreateInkDrop() override { - return views::InkDrop::CreateInkDropForFloodFillRipple(this); - } - std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override { gfx::Point center = GetLocalBounds().CenterPoint(); const int max_radius = is_root_app_grid_page_switcher_
diff --git a/ash/app_list/views/search_result_page_view.cc b/ash/app_list/views/search_result_page_view.cc index 340432c..62f00d2 100644 --- a/ash/app_list/views/search_result_page_view.cc +++ b/ash/app_list/views/search_result_page_view.cc
@@ -27,6 +27,8 @@ #include "base/optional.h" #include "base/strings/string_number_conversions.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/compositor_extra/shadow.h" @@ -42,8 +44,6 @@ #include "ui/views/focus/focus_manager.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/dialog_delegate.h" namespace ash {
diff --git a/ash/app_list/views/search_result_suggestion_chip_view.cc b/ash/app_list/views/search_result_suggestion_chip_view.cc index d2fcfd4..c2475bc 100644 --- a/ash/app_list/views/search_result_suggestion_chip_view.cc +++ b/ash/app_list/views/search_result_suggestion_chip_view.cc
@@ -14,6 +14,7 @@ #include "ash/public/cpp/app_list/app_list_config.h" #include "ash/public/cpp/app_list/app_list_types.h" #include "ash/public/cpp/app_list/internal_app_id_constants.h" +#include "base/bind.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" @@ -64,6 +65,8 @@ SetInkDropMode(InkDropMode::ON); views::InstallPillHighlightPathGenerator(this); + views::InkDrop::UseInkDropWithoutAutoHighlight(this, + /*highlight_on_hover=*/false); InitLayout(); } @@ -153,12 +156,6 @@ SchedulePaint(); } -std::unique_ptr<views::InkDrop> -SearchResultSuggestionChipView::CreateInkDrop() { - return views::InkDrop::CreateInkDropWithoutAutoHighlight( - this, /*highlight_on_hover=*/false); -} - std::unique_ptr<views::InkDropRipple> SearchResultSuggestionChipView::CreateInkDropRipple() const { const gfx::Point center = GetLocalBounds().CenterPoint();
diff --git a/ash/app_list/views/search_result_suggestion_chip_view.h b/ash/app_list/views/search_result_suggestion_chip_view.h index 8adbf802..5161b492 100644 --- a/ash/app_list/views/search_result_suggestion_chip_view.h +++ b/ash/app_list/views/search_result_suggestion_chip_view.h
@@ -14,7 +14,6 @@ namespace views { class BoxLayout; class ImageView; -class InkDrop; class InkDropRipple; class Label; } // namespace views @@ -51,7 +50,6 @@ void OnThemeChanged() override; // views::InkDropHost: - std::unique_ptr<views::InkDrop> CreateInkDrop() override; std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; // ui::LayerOwner:
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index e9b3eb7a..a25ae19 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -628,7 +628,12 @@ <message name="IDS_ASH_STATUS_TRAY_MIC_STATE_MUTED" desc="The accessible text used when the mic gain button is in the muted state."> Mic is muted. </message> - + <message name="IDS_ASH_STATUS_AREA_TOAST_MIC_OFF" desc="The text in the toast that shows up when the mic is muted using a physical key or shortcut."> + Microphone is off + </message> + <message name="IDS_ASH_STATUS_AREA_TOAST_MIC_ON" desc="The text in the toast that shows up when the mic is unmuted using a physical key or shortcut."> + Microphone is on + </message> <message name="IDS_ASH_STATUS_TRAY_VOLUME" desc="The accessible text for the toggle volume muted button in the tray."> Toggle Volume. <ph name="STATE_TEXT">$1<ex>Volume is muted</ex></ph> </message> @@ -1521,6 +1526,9 @@ <message name="IDS_ASH_STATUS_TRAY_NETWORK_A11Y_LABEL_CONNECT" desc="Accessibility label used for a network in quick settings network list that connects to the network."> Connect to <ph name="NETWORK_NAME">$1<ex>Ethernet</ex></ph> </message> + <message name="IDS_ASH_STATUS_TRAY_NETWORK_A11Y_LABEL_ACTIVATE" desc="Accessibility label used for an unactivated cellular network in quick settings network list that opens the activation flow when clicked."> + Click to activate <ph name="NETWORK_NAME">$1<ex>Verizon</ex></ph> + </message> <message name="IDS_ASH_STATUS_TRAY_NETWORK_DISCONNECT_BUTTON_A11Y_LABEL" desc="Accessibility label used for a button to disconnect from a network in quick settings network list."> Disconnect from <ph name="NETWORK_NAME">$1<ex>Ethernet</ex></ph> </message>
diff --git a/ash/ash_strings_grd/IDS_ASH_STATUS_AREA_TOAST_MIC_OFF.png.sha1 b/ash/ash_strings_grd/IDS_ASH_STATUS_AREA_TOAST_MIC_OFF.png.sha1 new file mode 100644 index 0000000..5e221a2 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_STATUS_AREA_TOAST_MIC_OFF.png.sha1
@@ -0,0 +1 @@ +2eec248082c775e6293ba3bad6a7ff88b2b7f287 \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_STATUS_AREA_TOAST_MIC_ON.png.sha1 b/ash/ash_strings_grd/IDS_ASH_STATUS_AREA_TOAST_MIC_ON.png.sha1 new file mode 100644 index 0000000..173e4d83 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_STATUS_AREA_TOAST_MIC_ON.png.sha1
@@ -0,0 +1 @@ +d5affacf158cd422891415d0d6491d61232a73c7 \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NETWORK_A11Y_LABEL_ACTIVATE.png.sha1 b/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NETWORK_A11Y_LABEL_ACTIVATE.png.sha1 new file mode 100644 index 0000000..18c8135 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_NETWORK_A11Y_LABEL_ACTIVATE.png.sha1
@@ -0,0 +1 @@ +cf26ab3dd269a054e2cf397a8a48f0d9f2765429 \ No newline at end of file
diff --git a/ash/assistant/ui/assistant_web_container_view.cc b/ash/assistant/ui/assistant_web_container_view.cc index f42a7f7..7f1a90c 100644 --- a/ash/assistant/ui/assistant_web_container_view.cc +++ b/ash/assistant/ui/assistant_web_container_view.cc
@@ -14,13 +14,13 @@ #include "ash/assistant/util/deep_link_util.h" #include "ash/public/cpp/assistant/assistant_web_view_factory.h" #include "ash/public/cpp/assistant/controller/assistant_controller.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/window_open_disposition.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/caption_button_layout_constants.h" namespace ash {
diff --git a/ash/assistant/ui/assistant_web_container_view.h b/ash/assistant/ui/assistant_web_container_view.h index 6ada15c..461adb3 100644 --- a/ash/assistant/ui/assistant_web_container_view.h +++ b/ash/assistant/ui/assistant_web_container_view.h
@@ -8,7 +8,7 @@ #include "ash/public/cpp/assistant/assistant_web_view.h" #include "base/component_export.h" #include "base/macros.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_delegate.h" namespace ash {
diff --git a/ash/assistant/ui/base/assistant_button.cc b/ash/assistant/ui/base/assistant_button.cc index 3538fd19..db1b2bd 100644 --- a/ash/assistant/ui/base/assistant_button.cc +++ b/ash/assistant/ui/base/assistant_button.cc
@@ -9,12 +9,12 @@ #include "ash/assistant/util/histogram_util.h" #include "base/bind.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/flood_fill_ink_drop_ripple.h" #include "ui/views/animation/ink_drop_impl.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { @@ -58,6 +58,7 @@ SetInkDropBaseColor(kInkDropBaseColor); SetInkDropVisibleOpacity(kInkDropVisibleOpacity); views::InstallCircleHighlightPathGenerator(this, gfx::Insets(kInkDropInset)); + views::InkDrop::UseInkDropForFloodFillRipple(this); } AssistantButton::~AssistantButton() = default; @@ -96,10 +97,6 @@ width() / 2 - kInkDropInset, gfx::Insets(kInkDropInset))); } -std::unique_ptr<views::InkDrop> AssistantButton::CreateInkDrop() { - return views::InkDrop::CreateInkDropForFloodFillRipple(this); -} - std::unique_ptr<views::InkDropHighlight> AssistantButton::CreateInkDropHighlight() const { auto highlight = std::make_unique<views::InkDropHighlight>(
diff --git a/ash/assistant/ui/base/assistant_button.h b/ash/assistant/ui/base/assistant_button.h index f4bdd7a6..c0263af 100644 --- a/ash/assistant/ui/base/assistant_button.h +++ b/ash/assistant/ui/base/assistant_button.h
@@ -11,9 +11,9 @@ #include "base/macros.h" #include "base/optional.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/color_palette.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace gfx { struct VectorIcon; @@ -71,8 +71,8 @@ AssistantButtonId GetAssistantButtonId() const { return id_; } + // views::ImageButton: void OnBoundsChanged(const gfx::Rect& previous_bounds) override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() const override; std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
diff --git a/ash/assistant/ui/base/assistant_scroll_view.cc b/ash/assistant/ui/base/assistant_scroll_view.cc index f2a18db..1be0c10 100644 --- a/ash/assistant/ui/base/assistant_scroll_view.cc +++ b/ash/assistant/ui/base/assistant_scroll_view.cc
@@ -8,8 +8,8 @@ #include <utility> #include "base/optional.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/assistant/ui/base/assistant_scroll_view.h b/ash/assistant/ui/base/assistant_scroll_view.h index b7b748db..12934d9 100644 --- a/ash/assistant/ui/base/assistant_scroll_view.h +++ b/ash/assistant/ui/base/assistant_scroll_view.h
@@ -7,8 +7,8 @@ #include "base/component_export.h" #include "base/observer_list.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/scroll_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view_observer.h" namespace ash {
diff --git a/ash/assistant/ui/dialog_plate/mic_view.cc b/ash/assistant/ui/dialog_plate/mic_view.cc index beeeaa0..e540638 100644 --- a/ash/assistant/ui/dialog_plate/mic_view.cc +++ b/ash/assistant/ui/dialog_plate/mic_view.cc
@@ -11,9 +11,9 @@ #include "ash/assistant/ui/logo_view/logo_view.h" #include "ash/public/cpp/assistant/controller/assistant_interaction_controller.h" #include "ash/public/cpp/assistant/controller/assistant_ui_controller.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/assistant/ui/dialog_plate/mic_view.h b/ash/assistant/ui/dialog_plate/mic_view.h index 0c90516..dbd567bb 100644 --- a/ash/assistant/ui/dialog_plate/mic_view.h +++ b/ash/assistant/ui/dialog_plate/mic_view.h
@@ -12,7 +12,7 @@ #include "base/component_export.h" #include "base/macros.h" #include "base/scoped_observation.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace ash {
diff --git a/ash/assistant/ui/logo_view/logo_view_impl.cc b/ash/assistant/ui/logo_view/logo_view_impl.cc index 88f4583d..b25a3664 100644 --- a/ash/assistant/ui/logo_view/logo_view_impl.cc +++ b/ash/assistant/ui/logo_view/logo_view_impl.cc
@@ -11,13 +11,13 @@ #include "base/notreached.h" #include "chromeos/assistant/internal/logo_view/logo_model/dot.h" #include "chromeos/assistant/internal/logo_view/logo_view_constants.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/compositor.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/rect_f.h" #include "ui/gfx/geometry/vector2d.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/assistant/ui/logo_view/logo_view_impl.h b/ash/assistant/ui/logo_view/logo_view_impl.h index 48f324d7..a609af8 100644 --- a/ash/assistant/ui/logo_view/logo_view_impl.h +++ b/ash/assistant/ui/logo_view/logo_view_impl.h
@@ -17,8 +17,8 @@ #include "chromeos/assistant/internal/logo_view/state_animator_timer_delegate.h" #include "chromeos/assistant/internal/logo_view/state_model.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/compositor/compositor_animation_observer.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace chromeos { namespace assistant {
diff --git a/ash/assistant/ui/main_stage/animated_container_view.cc b/ash/assistant/ui/main_stage/animated_container_view.cc index 22e81f3..c5e3536 100644 --- a/ash/assistant/ui/main_stage/animated_container_view.cc +++ b/ash/assistant/ui/main_stage/animated_container_view.cc
@@ -12,10 +12,10 @@ #include "ash/assistant/ui/main_stage/element_animator.h" #include "ash/public/cpp/assistant/controller/assistant_interaction_controller.h" #include "chromeos/services/assistant/public/cpp/features.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/callback_layer_animation_observer.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animator.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/assistant/ui/main_stage/animated_container_view.h b/ash/assistant/ui/main_stage/animated_container_view.h index e8f2d018..72e164a 100644 --- a/ash/assistant/ui/main_stage/animated_container_view.h +++ b/ash/assistant/ui/main_stage/animated_container_view.h
@@ -15,7 +15,7 @@ #include "ash/public/cpp/assistant/controller/assistant_controller_observer.h" #include "base/scoped_observation.h" #include "chromeos/services/libassistant/public/cpp/assistant_suggestion.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace ui { class CallbackLayerAnimationObserver;
diff --git a/ash/assistant/ui/main_stage/assistant_onboarding_suggestion_view.cc b/ash/assistant/ui/main_stage/assistant_onboarding_suggestion_view.cc index 1ec807f..3253c5c 100644 --- a/ash/assistant/ui/main_stage/assistant_onboarding_suggestion_view.cc +++ b/ash/assistant/ui/main_stage/assistant_onboarding_suggestion_view.cc
@@ -11,6 +11,7 @@ #include "base/stl_util.h" #include "base/strings/utf_string_conversions.h" #include "chromeos/services/libassistant/public/cpp/assistant_suggestion.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/background.h" @@ -18,7 +19,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace ash {
diff --git a/ash/assistant/ui/main_stage/assistant_onboarding_suggestion_view.h b/ash/assistant/ui/main_stage/assistant_onboarding_suggestion_view.h index 521a086..6f02bc4 100644 --- a/ash/assistant/ui/main_stage/assistant_onboarding_suggestion_view.h +++ b/ash/assistant/ui/main_stage/assistant_onboarding_suggestion_view.h
@@ -7,8 +7,8 @@ #include "base/component_export.h" #include "base/unguessable_token.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace chromeos { namespace assistant {
diff --git a/ash/assistant/ui/main_stage/assistant_opt_in_view.cc b/ash/assistant/ui/main_stage/assistant_opt_in_view.cc index f89910f..fb17d7d 100644 --- a/ash/assistant/ui/main_stage/assistant_opt_in_view.cc +++ b/ash/assistant/ui/main_stage/assistant_opt_in_view.cc
@@ -13,12 +13,12 @@ #include "ash/strings/grit/ash_strings.h" #include "base/bind.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/assistant/ui/main_stage/assistant_opt_in_view.h b/ash/assistant/ui/main_stage/assistant_opt_in_view.h index 16ac23f..f2b65c4 100644 --- a/ash/assistant/ui/main_stage/assistant_opt_in_view.h +++ b/ash/assistant/ui/main_stage/assistant_opt_in_view.h
@@ -8,7 +8,7 @@ #include "ash/public/cpp/assistant/assistant_state.h" #include "base/component_export.h" #include "base/macros.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/ash/assistant/ui/main_stage/suggestion_chip_view.cc b/ash/assistant/ui/main_stage/suggestion_chip_view.cc index e7836045..2b1ec4a 100644 --- a/ash/assistant/ui/main_stage/suggestion_chip_view.cc +++ b/ash/assistant/ui/main_stage/suggestion_chip_view.cc
@@ -14,13 +14,13 @@ #include "base/strings/utf_string_conversions.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/views/background.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/assistant/ui/main_stage/suggestion_chip_view.h b/ash/assistant/ui/main_stage/suggestion_chip_view.h index 90b9d0abf..f46c88b 100644 --- a/ash/assistant/ui/main_stage/suggestion_chip_view.h +++ b/ash/assistant/ui/main_stage/suggestion_chip_view.h
@@ -8,8 +8,8 @@ #include "base/component_export.h" #include "base/macros.h" #include "chromeos/services/libassistant/public/cpp/assistant_suggestion.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class BoxLayout;
diff --git a/ash/assistant/ui/main_stage/suggestion_container_view.cc b/ash/assistant/ui/main_stage/suggestion_container_view.cc index e9e4d623..4dab848 100644 --- a/ash/assistant/ui/main_stage/suggestion_container_view.cc +++ b/ash/assistant/ui/main_stage/suggestion_container_view.cc
@@ -23,11 +23,11 @@ #include "ash/public/cpp/assistant/controller/assistant_ui_controller.h" #include "base/bind.h" #include "base/metrics/histogram_functions.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/callback_layer_animation_observer.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_element.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/assistant/ui/main_stage/suggestion_container_view.h b/ash/assistant/ui/main_stage/suggestion_container_view.h index 4339ae9..40d633f 100644 --- a/ash/assistant/ui/main_stage/suggestion_container_view.h +++ b/ash/assistant/ui/main_stage/suggestion_container_view.h
@@ -16,8 +16,8 @@ #include "base/macros.h" #include "base/memory/scoped_refptr.h" #include "chromeos/services/libassistant/public/cpp/assistant_suggestion.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/scroll_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class BoxLayout;
diff --git a/ash/capture_mode/capture_label_view.cc b/ash/capture_mode/capture_label_view.cc index 61b93201..00c53d9 100644 --- a/ash/capture_mode/capture_label_view.cc +++ b/ash/capture_mode/capture_label_view.cc
@@ -14,6 +14,7 @@ #include "base/i18n/number_formatting.h" #include "base/task_runner.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/callback_layer_animation_observer.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_element.h" @@ -27,7 +28,6 @@ #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" namespace ash {
diff --git a/ash/capture_mode/capture_mode_bar_view.cc b/ash/capture_mode/capture_mode_bar_view.cc index f5704b1..1c387a4 100644 --- a/ash/capture_mode/capture_mode_bar_view.cc +++ b/ash/capture_mode/capture_mode_bar_view.cc
@@ -22,13 +22,13 @@ #include "base/bind.h" #include "ui/aura/window.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/background.h" #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" namespace ash {
diff --git a/ash/capture_mode/capture_mode_bar_view.h b/ash/capture_mode/capture_mode_bar_view.h index 2ff1920..959516d 100644 --- a/ash/capture_mode/capture_mode_bar_view.h +++ b/ash/capture_mode/capture_mode_bar_view.h
@@ -7,7 +7,7 @@ #include "ash/ash_export.h" #include "ash/capture_mode/capture_mode_types.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/ash/capture_mode/capture_mode_button.cc b/ash/capture_mode/capture_mode_button.cc index 1ef6aee5..7e82451 100644 --- a/ash/capture_mode/capture_mode_button.cc +++ b/ash/capture_mode/capture_mode_button.cc
@@ -6,10 +6,10 @@ #include "ash/resources/vector_icons/vector_icons.h" #include "ash/style/ash_color_provider.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/capture_mode/capture_mode_button.h b/ash/capture_mode/capture_mode_button.h index 8df9032..d11266a 100644 --- a/ash/capture_mode/capture_mode_button.h +++ b/ash/capture_mode/capture_mode_button.h
@@ -8,9 +8,9 @@ #include "ash/ash_export.h" #include "ash/capture_mode/capture_mode_session_focus_cycler.h" #include "ash/capture_mode/view_with_ink_drop.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace gfx { struct VectorIcon;
diff --git a/ash/capture_mode/capture_mode_settings_entry_view.cc b/ash/capture_mode/capture_mode_settings_entry_view.cc index 8fc32f1e..726048d 100644 --- a/ash/capture_mode/capture_mode_settings_entry_view.cc +++ b/ash/capture_mode/capture_mode_settings_entry_view.cc
@@ -9,12 +9,12 @@ #include "base/bind.h" #include "base/strings/utf_string_conversions.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/controls/button/toggle_button.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/capture_mode/capture_mode_settings_entry_view.h b/ash/capture_mode/capture_mode_settings_entry_view.h index 689ec976..4c5d7dd 100644 --- a/ash/capture_mode/capture_mode_settings_entry_view.h +++ b/ash/capture_mode/capture_mode_settings_entry_view.h
@@ -7,8 +7,8 @@ #include "ash/ash_export.h" #include "ash/capture_mode/capture_mode_session_focus_cycler.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace gfx {
diff --git a/ash/capture_mode/capture_mode_settings_view.cc b/ash/capture_mode/capture_mode_settings_view.cc index 722edafd..733843f 100644 --- a/ash/capture_mode/capture_mode_settings_view.cc +++ b/ash/capture_mode/capture_mode_settings_view.cc
@@ -14,11 +14,11 @@ #include "ash/style/ash_color_provider.h" #include "base/bind.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/views/background.h" #include "ui/views/controls/button/toggle_button.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" namespace ash {
diff --git a/ash/capture_mode/capture_mode_settings_view.h b/ash/capture_mode/capture_mode_settings_view.h index 473bd79..0eebd55d 100644 --- a/ash/capture_mode/capture_mode_settings_view.h +++ b/ash/capture_mode/capture_mode_settings_view.h
@@ -6,9 +6,9 @@ #define ASH_CAPTURE_MODE_CAPTURE_MODE_SETTINGS_VIEW_H_ #include "ash/ash_export.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/toggle_button.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace ash {
diff --git a/ash/capture_mode/capture_mode_source_view.cc b/ash/capture_mode/capture_mode_source_view.cc index 6c351e8..19cecc3 100644 --- a/ash/capture_mode/capture_mode_source_view.cc +++ b/ash/capture_mode/capture_mode_source_view.cc
@@ -13,8 +13,8 @@ #include "ash/strings/grit/ash_strings.h" #include "base/bind.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/capture_mode/capture_mode_source_view.h b/ash/capture_mode/capture_mode_source_view.h index 1fe5d5b..95db320 100644 --- a/ash/capture_mode/capture_mode_source_view.h +++ b/ash/capture_mode/capture_mode_source_view.h
@@ -7,7 +7,7 @@ #include "ash/ash_export.h" #include "ash/capture_mode/capture_mode_types.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace ash {
diff --git a/ash/capture_mode/capture_mode_toggle_button.cc b/ash/capture_mode/capture_mode_toggle_button.cc index 5ab7e9c..07b8b54f 100644 --- a/ash/capture_mode/capture_mode_toggle_button.cc +++ b/ash/capture_mode/capture_mode_toggle_button.cc
@@ -6,11 +6,11 @@ #include "ash/style/ash_color_provider.h" #include "base/strings/utf_string_conversions.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/capture_mode/capture_mode_toggle_button.h b/ash/capture_mode/capture_mode_toggle_button.h index 6d4b0b3f..02c57d2 100644 --- a/ash/capture_mode/capture_mode_toggle_button.h +++ b/ash/capture_mode/capture_mode_toggle_button.h
@@ -8,9 +8,9 @@ #include "ash/ash_export.h" #include "ash/capture_mode/capture_mode_session_focus_cycler.h" #include "ash/capture_mode/view_with_ink_drop.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace gfx { struct VectorIcon;
diff --git a/ash/capture_mode/capture_mode_type_view.cc b/ash/capture_mode/capture_mode_type_view.cc index 5ef6ec48..84115c5 100644 --- a/ash/capture_mode/capture_mode_type_view.cc +++ b/ash/capture_mode/capture_mode_type_view.cc
@@ -14,9 +14,9 @@ #include "ash/style/ash_color_provider.h" #include "base/bind.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/background.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/capture_mode/capture_mode_type_view.h b/ash/capture_mode/capture_mode_type_view.h index 3188127a..889c90ad 100644 --- a/ash/capture_mode/capture_mode_type_view.h +++ b/ash/capture_mode/capture_mode_type_view.h
@@ -7,7 +7,7 @@ #include "ash/ash_export.h" #include "ash/capture_mode/capture_mode_types.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace ash {
diff --git a/ash/capture_mode/view_with_ink_drop.h b/ash/capture_mode/view_with_ink_drop.h index 5ebab31..00b1110 100644 --- a/ash/capture_mode/view_with_ink_drop.h +++ b/ash/capture_mode/view_with_ink_drop.h
@@ -17,6 +17,9 @@ // plate code for all the Capture Mode views that will need it. This is used by // CaptureModeToggleButton, CaptureModeCloseButton, ... etc. // |T| must be a subtype of |views::InkDropHostView|. +// TODO(pbos): After migrating below to use SetCreateInkDrop* callbacks, replace +// this class with a shared ConfigureInkDrop function called from all current +// ViewWithInkDrop subclasses' constructors). template <typename T> class ViewWithInkDrop : public T { public: @@ -31,19 +34,14 @@ T::SetInkDropMode(views::InkDropHostView::InkDropMode::ON); T::SetHasInkDropActionOnClick(true); T::SetInkDropVisibleOpacity(capture_mode::kInkDropVisibleOpacity); + views::InkDrop::UseInkDropForFloodFillRipple(this, + /*highlight_on_hover=*/false, + /*highlight_on_focus=*/false); } ~ViewWithInkDrop() override = default; // views::InkDropHostView: - std::unique_ptr<views::InkDrop> CreateInkDrop() override { - std::unique_ptr<views::InkDrop> ink_drop = - views::InkDrop::CreateInkDropForFloodFillRipple(this); - ink_drop->SetShowHighlightOnHover(false); - ink_drop->SetShowHighlightOnFocus(false); - return ink_drop; - } - std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() const override { auto highlight = std::make_unique<views::InkDropHighlight>(
diff --git a/ash/clipboard/views/clipboard_history_delete_button.cc b/ash/clipboard/views/clipboard_history_delete_button.cc index dfbf653..c23904e 100644 --- a/ash/clipboard/views/clipboard_history_delete_button.cc +++ b/ash/clipboard/views/clipboard_history_delete_button.cc
@@ -9,6 +9,7 @@ #include "ash/resources/vector_icons/vector_icons.h" #include "ash/style/ash_color_provider.h" #include "ash/style/scoped_light_mode_as_default.h" +#include "base/bind.h" #include "ui/base/l10n/l10n_util.h" #include "ui/compositor/layer.h" #include "ui/strings/grit/ui_strings.h" @@ -48,6 +49,8 @@ // The ink drop ripple should be circular. views::InstallFixedSizeCircleHighlightPathGenerator( this, ClipboardHistoryViews::kDeleteButtonSizeDip / 2); + views::InkDrop::UseInkDropForFloodFillRipple( + this, /*highlight_on_hover=*/false, /*highlight_on_focus=*/true); } ClipboardHistoryDeleteButton::~ClipboardHistoryDeleteButton() = default; @@ -60,11 +63,6 @@ ink_drop_container_->AddLayerBeneathView(layer); } -std::unique_ptr<views::InkDrop> ClipboardHistoryDeleteButton::CreateInkDrop() { - return views::InkDrop::CreateInkDropForFloodFillRipple( - this, /*highlight_on_hover=*/false, /*highlight_on_focus=*/true); -} - void ClipboardHistoryDeleteButton::OnClickCanceled(const ui::Event& event) { DCHECK(event.IsMouseEvent());
diff --git a/ash/clipboard/views/clipboard_history_delete_button.h b/ash/clipboard/views/clipboard_history_delete_button.h index 3efdd41..54e2870 100644 --- a/ash/clipboard/views/clipboard_history_delete_button.h +++ b/ash/clipboard/views/clipboard_history_delete_button.h
@@ -28,7 +28,6 @@ // views::ImageButton: const char* GetClassName() const override; void AddLayerBeneathView(ui::Layer* layer) override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; void OnClickCanceled(const ui::Event& event) override; void OnThemeChanged() override; void RemoveLayerBeneathView(ui::Layer* layer) override;
diff --git a/ash/clipboard/views/clipboard_history_main_button.cc b/ash/clipboard/views/clipboard_history_main_button.cc index 7f7c47fa..a7d64f25 100644 --- a/ash/clipboard/views/clipboard_history_main_button.cc +++ b/ash/clipboard/views/clipboard_history_main_button.cc
@@ -7,6 +7,7 @@ #include "ash/clipboard/views/clipboard_history_item_view.h" #include "ash/style/ash_color_provider.h" #include "ash/style/scoped_light_mode_as_default.h" +#include "base/bind.h" #include "ui/gfx/canvas.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/animation/ink_drop.h" @@ -34,6 +35,23 @@ // Let the parent handle accessibility features. GetViewAccessibility().OverrideIsIgnored(/*value=*/true); + + // TODO(crbug.com/1205227): Revisit if this comment makes sense still. It was + // attached to CreateInkDrop() but sounds more about talking about a null + // CreateInkDropHighlight(), but at the time of writing the class inherited + // from Button and had no other InkDrop-related override than CreateInkDrop(). + // This may need an upstream fix in InkDrop. + // + // We do not use the ripple highlight due to the following reasons: + // (1) Events may be intercepted by the menu controller. As a result, the + // ripple highlight may not update properly. + // (2) The animation to fade in/out highlight does not look good when the menu + // selection is advanced by the up/down arrow key. + // Hence, highlighted background is implemented by customizing in + // `PaintButtonContents()`. + views::InkDrop::UseInkDropForFloodFillRipple( + this, /*highlight_on_hover=*/false, + /*highlight_on_focus=*/!focus_ring()); } ClipboardHistoryMainButton::~ClipboardHistoryMainButton() = default; @@ -54,18 +72,6 @@ return "ClipboardHistoryMainButton"; } -std::unique_ptr<views::InkDrop> ClipboardHistoryMainButton::CreateInkDrop() { - // We do not use the ripple highlight due to the following reasons: - // (1) Events may be intercepted by the menu controller. As a result, the - // ripple highlight may not update properly. - // (2) The animation to fade in/out highlight does not look good when the menu - // selection is advanced by the up/down arrow key. - // Hence, highlighted background is implemented by customizing in - // `PaintButtonContents()`. - return views::InkDrop::CreateInkDropForFloodFillRipple( - this, /*highlight_on_hover=*/false, /*highlight_on_focus=*/!focus_ring()); -} - void ClipboardHistoryMainButton::OnClickCanceled(const ui::Event& event) { DCHECK(event.IsMouseEvent());
diff --git a/ash/clipboard/views/clipboard_history_main_button.h b/ash/clipboard/views/clipboard_history_main_button.h index 5d549a6c..522edfb9 100644 --- a/ash/clipboard/views/clipboard_history_main_button.h +++ b/ash/clipboard/views/clipboard_history_main_button.h
@@ -26,7 +26,6 @@ // views::Button: const char* GetClassName() const override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; void OnClickCanceled(const ui::Event& event) override; void OnThemeChanged() override; void OnGestureEvent(ui::GestureEvent* event) override;
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 564fcd3..bb32ef64 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -83,6 +83,10 @@ "ChromeOSAmbientModeDevChannelUseProdServer", base::FEATURE_DISABLED_BY_DEFAULT}; +// See https://crbug.com/1204551 +const base::Feature kAppListBubble{"AppListBubble", + base::FEATURE_DISABLED_BY_DEFAULT}; + // Controls whether to enable ARC ADB sideloading support. const base::Feature kArcAdbSideloadingFeature{ "ArcAdbSideloading", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -531,6 +535,10 @@ const base::Feature kOsFeedback{"OsFeedback", base::FEATURE_DISABLED_BY_DEFAULT}; +// Whether the device supports on-device speech recognition. +const base::Feature kOnDeviceSpeechRecognition{ + "OnDeviceSpeechRecognition", base::FEATURE_DISABLED_BY_DEFAULT}; + // Enables a unique URL for each path in CrOS settings. // This allows deep linking to individual settings, i.e. in settings search. const base::Feature kOsSettingsDeepLinking{"OsSettingsDeepLinking", @@ -794,6 +802,10 @@ return base::FeatureList::IsEnabled(kAmbientModeDevUseProdFeature); } +bool IsAppListBubbleEnabled() { + return base::FeatureList::IsEnabled(kAppListBubble); +} + bool IsCellularActivationUiEnabled() { return base::FeatureList::IsEnabled(kUpdatedCellularActivationUi); }
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 730b5a9..840765fb 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -54,6 +54,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kAmbientModeDevUseProdFeature; COMPONENT_EXPORT(ASH_CONSTANTS) +extern const base::Feature kAppListBubble; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kArcAdbSideloadingFeature; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kArcManagedAdbSideloadingSupport; @@ -229,6 +231,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kOnDeviceGrammarCheck; COMPONENT_EXPORT(ASH_CONSTANTS) +extern const base::Feature kOnDeviceSpeechRecognition; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kNewOobeLayout; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kOsFeedback; @@ -349,6 +353,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAmbientModeDevUseProdEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAmbientModeEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAmbientModePhotoPreviewEnabled(); +COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAppListBubbleEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsAssistantEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsCellularActivationUiEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS)
diff --git a/ash/constants/ash_switches.cc b/ash/constants/ash_switches.cc index 383e191..ff046ba1 100644 --- a/ash/constants/ash_switches.cc +++ b/ash/constants/ash_switches.cc
@@ -513,6 +513,12 @@ // is not in tablet mode. const char kOobeForceTabletFirstRun[] = "oobe-force-tablet-first-run"; +// Indicates that OOBE should be scaled for big displays similar to how Meets +// app scales UI. +// TODO(crbug.com/1205364): Remove after adding new scheme. +const char kOobeLargeScreenSpecialScaling[] = + "oobe-large-screen-special-scaling"; + // Skips all other OOBE pages after user login. const char kOobeSkipPostLogin[] = "oobe-skip-postlogin"; @@ -706,6 +712,11 @@ kOobeForceTabletFirstRun); } +bool ShouldScaleOobe() { + return base::CommandLine::ForCurrentProcess()->HasSwitch( + kOobeLargeScreenSpecialScaling); +} + bool IsAueReachedForUpdateRequiredForTest() { return base::CommandLine::ForCurrentProcess()->HasSwitch( kUpdateRequiredAueForTest);
diff --git a/ash/constants/ash_switches.h b/ash/constants/ash_switches.h index 8266f80..8c78c73e 100644 --- a/ash/constants/ash_switches.h +++ b/ash/constants/ash_switches.h
@@ -187,6 +187,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kOobeEulaUrlForTests[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kOobeForceTabletFirstRun[]; +COMPONENT_EXPORT(ASH_CONSTANTS) +extern const char kOobeLargeScreenSpecialScaling[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kOobeSkipPostLogin[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kOobeSkipToLogin[]; COMPONENT_EXPORT(ASH_CONSTANTS) extern const char kOobeTimerInterval[]; @@ -281,6 +283,9 @@ // device is not in tablet mode. COMPONENT_EXPORT(ASH_CONSTANTS) bool ShouldOobeUseTabletModeFirstRun(); +// Returns whether OOBE should be scaled for CfM devices. +COMPONENT_EXPORT(ASH_CONSTANTS) bool ShouldScaleOobe(); + // Returns true if device policy DeviceMinimumVersion should assume that // Auto Update Expiration is reached. This should only be used for testing. COMPONENT_EXPORT(ASH_CONSTANTS)
diff --git a/ash/content/scanning/resources/scanning_app.js b/ash/content/scanning/resources/scanning_app.js index ddd05da3..87f3c03c 100644 --- a/ash/content/scanning/resources/scanning_app.js +++ b/ash/content/scanning/resources/scanning_app.js
@@ -35,7 +35,7 @@ import {getScanService} from './mojo_interface_provider.js'; import {AppState, ScannerArr, ScannerCapabilitiesResponse, ScannerInfo, ScannerSetting, ScanSettings} from './scanning_app_types.js'; import {colorModeFromString, fileTypeFromString, getScannerDisplayName, pageSizeFromString, tokenToString} from './scanning_app_util.js'; -import {ScanningBrowserProxy, ScanningBrowserProxyImpl} from './scanning_browser_proxy.js'; +import {ScanningBrowserProxy, ScanningBrowserProxyImpl, SelectedPath} from './scanning_browser_proxy.js'; /** * URL for the Scanning help page. @@ -766,6 +766,8 @@ return; } + this.setScanToPathFromSavedSettings_(); + const scannerSettings = this.getSelectedScannerSavedSettings_(); if (!scannerSettings) { return; @@ -854,6 +856,27 @@ }, /** + * Validates that the file path from saved settings still exists on the local + * filesystem then sets the proper display name for the 'Scan to' dropdown. If + * the file path no longer exists, leave the default 'Scan to' path. + * @private + */ + setScanToPathFromSavedSettings_() { + this.browserProxy_.ensureValidFilePath(this.savedScanSettings_.scanToPath) + .then( + /* @type {!SelectedPath} */ (selectedPath) => { + const baseName = selectedPath.baseName; + const filePath = selectedPath.filePath; + if (!baseName || !filePath) { + return; + } + + this.selectedFolder = baseName; + this.selectedFilePath = filePath; + }); + }, + + /** * @param {string} sourceName * @private */
diff --git a/ash/content/scanning/resources/scanning_browser_proxy.js b/ash/content/scanning/resources/scanning_browser_proxy.js index 4b695849..634bdab 100644 --- a/ash/content/scanning/resources/scanning_browser_proxy.js +++ b/ash/content/scanning/resources/scanning_browser_proxy.js
@@ -98,6 +98,14 @@ * @return {!Promise<string>} */ getScanSettings() {} + + /** + * Validates that |filePath| exists on the local filesystem and returns its + * display name. If |filePath| doesn't exist, return an empty SelectedPath. + * @param {string} filePath + * @return {!Promise<!SelectedPath>} + */ + ensureValidFilePath(filePath) {} } /** @implements {ScanningBrowserProxy} */ @@ -156,6 +164,11 @@ getScanSettings() { return sendWithPromise('getScanSettings'); } + + /** @override */ + ensureValidFilePath(filePath) { + return sendWithPromise('ensureValidFilePath', filePath); + } } // The singleton instance_ can be replaced with a test version of this wrapper
diff --git a/ash/content/scanning/scanning_app_delegate.h b/ash/content/scanning/scanning_app_delegate.h index 209418558..ca48fb8 100644 --- a/ash/content/scanning/scanning_app_delegate.h +++ b/ash/content/scanning/scanning_app_delegate.h
@@ -38,6 +38,9 @@ // Gets scan settings from Pref service. virtual std::string GetScanSettingsFromPrefs() = 0; + // Determines if |path_to_file| is a supported file path for the Files app. + virtual bool IsFilePathSupported(const base::FilePath& path_to_file) = 0; + // Opens the Media app with the files specified in |file_paths|. virtual void OpenFilesInMediaApp( const std::vector<base::FilePath>& file_paths) = 0;
diff --git a/ash/content/scanning/scanning_handler.cc b/ash/content/scanning/scanning_handler.cc index c6b2c11..7ad81d7e 100644 --- a/ash/content/scanning/scanning_handler.cc +++ b/ash/content/scanning/scanning_handler.cc
@@ -9,6 +9,7 @@ #include "base/check.h" #include "base/check_op.h" #include "base/feature_list.h" +#include "base/files/file_util.h" #include "base/values.h" #include "chromeos/strings/grit/chromeos_strings.h" #include "content/public/browser/web_contents.h" @@ -70,6 +71,11 @@ "getScanSettings", base::BindRepeating(&ScanningHandler::HandleGetScanSettings, base::Unretained(this))); + + web_ui()->RegisterMessageCallback( + "ensureValidFilePath", + base::BindRepeating(&ScanningHandler::HandleEnsureValidFilePath, + base::Unretained(this))); } void ScanningHandler::FileSelected(const base::FilePath& path, @@ -215,4 +221,21 @@ base::Value(scanning_app_delegate_->GetScanSettingsFromPrefs())); } +void ScanningHandler::HandleEnsureValidFilePath(const base::ListValue* args) { + if (!IsJavascriptAllowed()) + return; + + CHECK_EQ(2U, args->GetSize()); + const std::string callback = args->GetList()[0].GetString(); + const base::FilePath file_path(args->GetList()[1].GetString()); + + // When |file_path| is not valid, return a dictionary with an empty file path. + const bool filePathValid = + scanning_app_delegate_->IsFilePathSupported(file_path) && + base::PathExists(file_path); + ResolveJavascriptCallback( + base::Value(callback), + CreateSelectedPathValue(filePathValid ? file_path : base::FilePath())); +} + } // namespace ash
diff --git a/ash/content/scanning/scanning_handler.h b/ash/content/scanning/scanning_handler.h index ee80f00..3ecc374 100644 --- a/ash/content/scanning/scanning_handler.h +++ b/ash/content/scanning/scanning_handler.h
@@ -82,6 +82,10 @@ // Fetches scan settings from Pref service. void HandleGetScanSettings(const base::ListValue* args); + // Validates that a file path exists on the local filesystem and returns its + // display name. If the file path doesn't exist, return an empty file path. + void HandleEnsureValidFilePath(const base::ListValue* args); + std::string scan_location_callback_id_; scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
diff --git a/ash/content/scanning/scanning_handler_unittest.cc b/ash/content/scanning/scanning_handler_unittest.cc index b27e8c4d..faf1a30 100644 --- a/ash/content/scanning/scanning_handler_unittest.cc +++ b/ash/content/scanning/scanning_handler_unittest.cc
@@ -12,7 +12,10 @@ #include "ash/constants/ash_features.h" #include "ash/content/scanning/scanning_app_delegate.h" #include "base/check.h" +#include "base/files/file.h" #include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/files/scoped_temp_dir.h" #include "base/test/scoped_feature_list.h" #include "base/values.h" #include "content/public/browser/web_contents.h" @@ -128,6 +131,11 @@ return base::FilePath(kTestFilePath); } + bool IsFilePathSupported(const base::FilePath& path_to_file) override { + return !path_to_file.ReferencesParent() && + my_files_path_.IsParent(path_to_file); + } + void OpenFilesInMediaApp( const std::vector<base::FilePath>& file_paths) override { DCHECK(!file_paths.empty()); @@ -147,9 +155,14 @@ // Returns the file paths saved in OpenFilesInMediaApp(). const std::vector<base::FilePath>& file_paths() const { return file_paths_; } + void SetMyFilesPath(base::FilePath my_files_path) { + my_files_path_ = my_files_path; + } + private: std::vector<base::FilePath> file_paths_; std::string scan_settings_; + base::FilePath my_files_path_; }; class ScanningHandlerTest : public testing::Test { @@ -173,6 +186,11 @@ scoped_feature_list_.InitWithFeatures( {features::kScanAppMediaLink, ash::features::kScanAppStickySettings}, {}); + + EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); + my_files_path_ = temp_dir_.GetPath().Append("MyFiles"); + EXPECT_TRUE(base::CreateDirectory(my_files_path_)); + fake_scanning_app_delegate_->SetMyFilesPath(my_files_path_); } void TearDown() override { ui::SelectFileDialog::SetFactory(nullptr); } @@ -199,6 +217,8 @@ std::unique_ptr<ScanningHandler> scanning_handler_; FakeScanningAppDelegate* fake_scanning_app_delegate_; base::test::ScopedFeatureList scoped_feature_list_; + base::ScopedTempDir temp_dir_; + base::FilePath my_files_path_; }; // Validates that invoking the requestScanToLocation Web UI event opens the @@ -325,4 +345,44 @@ EXPECT_EQ(expected_sticky_settings, call_data.arg3()->GetString()); } +// Validates that invoking the ensureValidFilePath Web UI event with a valid +// file path returns the expected result. +TEST_F(ScanningHandlerTest, ValidFilePathExists) { + const base::FilePath myScanPath = my_files_path_.Append("myScanPath"); + base::File(myScanPath, base::File::FLAG_CREATE | base::File::FLAG_READ); + + const size_t call_data_count_before_call = web_ui_.call_data().size(); + base::ListValue args; + args.Append(kHandlerFunctionName); + args.Append(myScanPath.value()); + web_ui_.HandleReceivedMessage("ensureValidFilePath", &args); + + const content::TestWebUI::CallData& call_data = + GetCallData(call_data_count_before_call); + const base::DictionaryValue* selected_path_dict; + EXPECT_TRUE(call_data.arg3()->GetAsDictionary(&selected_path_dict)); + EXPECT_EQ(myScanPath.value(), + *selected_path_dict->FindStringPath("filePath")); + EXPECT_EQ("myScanPath", *selected_path_dict->FindStringPath("baseName")); +} + +// Validates that invoking the ensureValidFilePath Web UI event with an invalid +// file path returns an object with an empty file path. +TEST_F(ScanningHandlerTest, InvalidFilePath) { + const std::string invalidFilePath = "invalid/file/path"; + + const size_t call_data_count_before_call = web_ui_.call_data().size(); + base::ListValue args; + args.Append(kHandlerFunctionName); + args.Append(invalidFilePath); + web_ui_.HandleReceivedMessage("ensureValidFilePath", &args); + + const content::TestWebUI::CallData& call_data = + GetCallData(call_data_count_before_call); + const base::DictionaryValue* selected_path_dict; + EXPECT_TRUE(call_data.arg3()->GetAsDictionary(&selected_path_dict)); + EXPECT_EQ(std::string(), *selected_path_dict->FindStringPath("filePath")); + EXPECT_EQ(std::string(), *selected_path_dict->FindStringPath("baseName")); +} + } // namespace ash
diff --git a/ash/frame/header_view.cc b/ash/frame/header_view.cc index 30be384..5071b78 100644 --- a/ash/frame/header_view.cc +++ b/ash/frame/header_view.cc
@@ -16,10 +16,10 @@ #include "chromeos/ui/frame/caption_buttons/frame_caption_button_container_view.h" #include "chromeos/ui/frame/default_frame_header.h" #include "ui/aura/client/aura_constants.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_features.h" #include "ui/compositor/layer.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/non_client_view.h"
diff --git a/ash/frame/non_client_frame_view_ash.cc b/ash/frame/non_client_frame_view_ash.cc index 04cc5b9..b0e444f 100644 --- a/ash/frame/non_client_frame_view_ash.cc +++ b/ash/frame/non_client_frame_view_ash.cc
@@ -31,14 +31,14 @@ #include "ui/aura/window.h" #include "ui/aura/window_observer.h" #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/image/image_skia.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/menu/menu_runner.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/view_targeter.h" #include "ui/views/widget/widget.h"
diff --git a/ash/frame/non_client_frame_view_ash.h b/ash/frame/non_client_frame_view_ash.h index 0ab2b93..b5d372b 100644 --- a/ash/frame/non_client_frame_view_ash.h +++ b/ash/frame/non_client_frame_view_ash.h
@@ -14,8 +14,8 @@ #include "base/memory/weak_ptr.h" #include "base/optional.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/context_menu_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/non_client_view.h"
diff --git a/ash/hud_display/DEPS b/ash/hud_display/DEPS new file mode 100644 index 0000000..58d2ae3 --- /dev/null +++ b/ash/hud_display/DEPS
@@ -0,0 +1,5 @@ +include_rules = [ + "+services/tracing/public", + "+third_party/perfetto/include/perfetto/tracing/core/trace_config.h", + "+third_party/perfetto/include/perfetto/tracing/tracing.h", +]
diff --git a/ash/hud_display/ash_tracing_handler.cc b/ash/hud_display/ash_tracing_handler.cc new file mode 100644 index 0000000..92f763ee --- /dev/null +++ b/ash/hud_display/ash_tracing_handler.cc
@@ -0,0 +1,112 @@ +// 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. + +#include "ash/hud_display/ash_tracing_handler.h" + +#include <sys/mman.h> + +#include <algorithm> + +#include "ash/hud_display/ash_tracing_request.h" +#include "ash/shell.h" +#include "base/bind.h" +#include "base/files/file.h" +#include "base/files/platform_file.h" +#include "base/logging.h" +#include "base/no_destructor.h" +#include "base/stl_util.h" +#include "base/task/task_traits.h" +#include "base/task/thread_pool.h" +#include "base/threading/sequenced_task_runner_handle.h" +#include "services/tracing/public/cpp/perfetto/perfetto_config.h" +#include "third_party/perfetto/include/perfetto/tracing/core/trace_config.h" +#include "third_party/perfetto/include/perfetto/tracing/tracing.h" + +namespace ash { +namespace hud_display { +namespace { + +std::unique_ptr<perfetto::TracingSession> (*testing_perfetto_session_creator)( + void) = nullptr; + +} // anonymous namespace + +AshTracingHandler::AshTracingHandler() { + // Bind sequence checker. + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); +} + +AshTracingHandler::~AshTracingHandler() { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); +} + +void AshTracingHandler::Start(AshTracingRequest* request) { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + DCHECK(!request_); + DCHECK(!tracing_session_); + + request_ = request; + perfetto::TraceConfig perfetto_config = tracing::GetDefaultPerfettoConfig( + base::trace_event::TraceConfig(), + /*privacy_filtering_enabled=*/false, + /*convert_to_legacy_json=*/false, + perfetto::protos::gen::ChromeConfig::USER_INITIATED); + + perfetto_config.set_write_into_file(true); + tracing_session_ = testing_perfetto_session_creator + ? testing_perfetto_session_creator() + : perfetto::Tracing::NewTrace(); + tracing_session_->Setup(perfetto_config, request->GetPlatformFile()); + auto runner = base::SequencedTaskRunnerHandle::Get(); + base::WeakPtr<AshTracingHandler> weak_ptr = weak_factory_.GetWeakPtr(); + tracing_session_->SetOnStartCallback([runner, weak_ptr]() { + runner->PostTask( + FROM_HERE, + base::BindOnce(&AshTracingHandler::OnTracingStarted, weak_ptr)); + }); + tracing_session_->SetOnStopCallback([runner, weak_ptr]() { + runner->PostTask( + FROM_HERE, + base::BindOnce(&AshTracingHandler::OnTracingFinished, weak_ptr)); + }); + tracing_session_->Start(); +} + +void AshTracingHandler::Stop() { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + DCHECK(tracing_session_); + tracing_session_->Stop(); +} + +bool AshTracingHandler::IsStarted() const { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + return static_cast<bool>(tracing_session_); +} + +// static +void AshTracingHandler::SetPerfettoTracingSessionCreatorForTesting( + std::unique_ptr<perfetto::TracingSession> (*creator)(void)) { + DCHECK(!testing_perfetto_session_creator); + testing_perfetto_session_creator = creator; +} + +// static +void AshTracingHandler::ResetPerfettoTracingSessionCreatorForTesting() { + DCHECK(testing_perfetto_session_creator); + testing_perfetto_session_creator = nullptr; +} + +void AshTracingHandler::OnTracingStarted() { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + request_->OnTracingStarted(); +} + +void AshTracingHandler::OnTracingFinished() { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + tracing_session_.reset(); + request_->OnTracingFinished(); +} + +} // namespace hud_display +} // namespace ash
diff --git a/ash/hud_display/ash_tracing_handler.h b/ash/hud_display/ash_tracing_handler.h new file mode 100644 index 0000000..edcf086 --- /dev/null +++ b/ash/hud_display/ash_tracing_handler.h
@@ -0,0 +1,62 @@ +// 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. + +#ifndef ASH_HUD_DISPLAY_ASH_TRACING_HANDLER_H_ +#define ASH_HUD_DISPLAY_ASH_TRACING_HANDLER_H_ + +#include <memory> + +#include "ash/ash_export.h" +#include "base/files/platform_file.h" +#include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" +#include "base/trace_event/trace_config.h" + +namespace perfetto { +class TracingSession; +} + +namespace ash { +namespace hud_display { + +class AshTracingRequest; + +// Only one instance of this object can exist at a time. +class ASH_EXPORT AshTracingHandler { + public: + AshTracingHandler(); + AshTracingHandler(const AshTracingHandler&) = delete; + AshTracingHandler& operator=(const AshTracingHandler&) = delete; + ~AshTracingHandler(); + + // Initiates tracing start. Observer will be notified with the result. + void Start(AshTracingRequest* request); + + // Initiates tracing stop. Observer will be notified with the result. + void Stop(); + + // Returns true if tracing was started. + bool IsStarted() const; + + // This allows to use fake Perfetto sessions for testing. + static void SetPerfettoTracingSessionCreatorForTesting( + std::unique_ptr<perfetto::TracingSession> (*creator)(void)); + static void ResetPerfettoTracingSessionCreatorForTesting(); + + private: + void OnTracingStarted(); + void OnTracingFinished(); + + AshTracingRequest* request_ = nullptr; + + std::unique_ptr<perfetto::TracingSession> tracing_session_; + + SEQUENCE_CHECKER(my_sequence_checker_); + base::WeakPtrFactory<AshTracingHandler> weak_factory_{this}; +}; + +} // namespace hud_display +} // namespace ash + +#endif // ASH_HUD_DISPLAY_ASH_TRACING_HANDLER_H_
diff --git a/ash/hud_display/ash_tracing_manager.cc b/ash/hud_display/ash_tracing_manager.cc new file mode 100644 index 0000000..9b4bf462 --- /dev/null +++ b/ash/hud_display/ash_tracing_manager.cc
@@ -0,0 +1,177 @@ +// 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. + +#include "ash/hud_display/ash_tracing_manager.h" + +#include <vector> + +#include "ash/hud_display/ash_tracing_request.h" +#include "ash/session/session_controller_impl.h" +#include "base/compiler_specific.h" +#include "base/logging.h" +#include "base/no_destructor.h" +#include "base/sequence_checker.h" +#include "base/stl_util.h" +#include "base/strings/stringprintf.h" + +namespace ash { +namespace hud_display { + +AshTracingManager::AshTracingManager() { + SessionController::Get()->AddObserver(this); +} + +AshTracingManager::~AshTracingManager() { + if (SessionController::Get()) + SessionController::Get()->RemoveObserver(this); +} + +// static +AshTracingManager& AshTracingManager::Get() { + static base::NoDestructor<AshTracingManager> manager; + return *manager; +} + +bool AshTracingManager::IsBusy() const { + if (tracing_requests_.empty()) + return false; + + switch (GetLastRequestStatus()) { + case AshTracingRequest::Status::kEmpty: + FALLTHROUGH; + case AshTracingRequest::Status::kInitialized: + return true; + case AshTracingRequest::Status::kStarted: + return false; + case AshTracingRequest::Status::kStopping: + return true; + case AshTracingRequest::Status::kPendingMount: + FALLTHROUGH; + case AshTracingRequest::Status::kWritingFile: + FALLTHROUGH; + case AshTracingRequest::Status::kCompleted: + return false; + } +} + +bool AshTracingManager::IsTracingStarted() const { + if (tracing_requests_.empty()) + return false; + + switch (GetLastRequestStatus()) { + case AshTracingRequest::Status::kEmpty: + FALLTHROUGH; + case AshTracingRequest::Status::kInitialized: + FALLTHROUGH; + case AshTracingRequest::Status::kStarted: + FALLTHROUGH; + case AshTracingRequest::Status::kStopping: + return true; + case AshTracingRequest::Status::kPendingMount: + FALLTHROUGH; + case AshTracingRequest::Status::kWritingFile: + FALLTHROUGH; + case AshTracingRequest::Status::kCompleted: + return false; + } +} + +std::string AshTracingManager::GetStatusMessage() const { + std::string result; + if (tracing_requests_.empty()) + return result; + + unsigned started = 0; + unsigned waiting_for_login = 0; + unsigned writing_trace_file = 0; + unsigned completed = 0; + for (const auto& request : tracing_requests_) { + switch (request->status()) { + case AshTracingRequest::Status::kEmpty: + FALLTHROUGH; + case AshTracingRequest::Status::kInitialized: + FALLTHROUGH; + case AshTracingRequest::Status::kStarted: + FALLTHROUGH; + case AshTracingRequest::Status::kStopping: + ++started; + break; + case AshTracingRequest::Status::kPendingMount: + ++waiting_for_login; + break; + case AshTracingRequest::Status::kWritingFile: + ++writing_trace_file; + break; + case AshTracingRequest::Status::kCompleted: + ++completed; + } + } + if (started) + result = base::StringPrintf("%u active", started); + + if (waiting_for_login) { + if (!result.empty()) + result += ", "; + + result += base::StringPrintf("%u pending login", waiting_for_login); + } + if (writing_trace_file) { + if (!result.empty()) + result += ", "; + + result += base::StringPrintf("%u writing", writing_trace_file); + } + if (completed) { + if (!result.empty()) + result += ", "; + + result += base::StringPrintf("%u completed", completed); + } + if (!result.empty()) + result = std::string("Tracing: ") + result + "."; + + return result; +} + +void AshTracingManager::Start() { + DCHECK(!IsBusy()); + DCHECK(!IsTracingStarted()); + tracing_requests_.push_back(std::make_unique<AshTracingRequest>(this)); +} + +void AshTracingManager::Stop() { + DCHECK(!tracing_requests_.empty()); + DCHECK_EQ(GetLastRequestStatus(), AshTracingRequest::Status::kStarted); + tracing_requests_.back()->Stop(); +} + +void AshTracingManager::AddObserver(AshTracingManager::Observer* observer) { + observers_.AddObserver(observer); +} + +void AshTracingManager::RemoveObserver(AshTracingManager::Observer* observer) { + observers_.RemoveObserver(observer); +} + +void AshTracingManager::OnRequestStatusChanged(AshTracingRequest* request) { + for (Observer& observer : observers_) + observer.OnTracingStatusChange(); +} + +void AshTracingManager::OnFirstSessionStarted() { + for (auto& request : tracing_requests_) + request->OnUserLoggedIn(); +} + +const std::vector<std::unique_ptr<AshTracingRequest>>& +AshTracingManager::GetTracingRequestsForTesting() const { + return tracing_requests_; +} + +AshTracingRequest::Status AshTracingManager::GetLastRequestStatus() const { + return tracing_requests_.back()->status(); +} + +} // namespace hud_display +} // namespace ash
diff --git a/ash/hud_display/ash_tracing_manager.h b/ash/hud_display/ash_tracing_manager.h new file mode 100644 index 0000000..050eb9f --- /dev/null +++ b/ash/hud_display/ash_tracing_manager.h
@@ -0,0 +1,81 @@ +// 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. + +#ifndef ASH_HUD_DISPLAY_ASH_TRACING_MANAGER_H_ +#define ASH_HUD_DISPLAY_ASH_TRACING_MANAGER_H_ + +#include <memory> + +#include "ash/hud_display/ash_tracing_request.h" +#include "ash/public/cpp/session/session_observer.h" +#include "base/memory/weak_ptr.h" +#include "base/observer_list.h" +#include "base/observer_list_types.h" + +namespace ash { +namespace hud_display { + +// Singleton object to manager Ash tracing sessions. +class ASH_EXPORT AshTracingManager : public SessionObserver { + public: + class Observer : public base::CheckedObserver { + public: + Observer() = default; + ~Observer() override = default; + + virtual void OnTracingStatusChange() = 0; + }; + + AshTracingManager(); + AshTracingManager(const AshTracingManager&) = delete; + AshTracingManager& operator=(const AshTracingManager&) = delete; + ~AshTracingManager() override; + + static AshTracingManager& Get(); + + // True when tracing is being started or stopped. No control requests are + // possible. + bool IsBusy() const; + + // True when tracing can be stopped. + bool IsTracingStarted() const; + + // Returns user status message. + std::string GetStatusMessage() const; + + // Initiates asynchronous tracing start. Observer will be notified with the + // result. + void Start(); + + // Initiates asynchronous tracing stop. Observer will be notified with the + // result. + void Stop(); + + void AddObserver(Observer* observer); + void RemoveObserver(Observer* observer); + + // Called by AshTracingRequest to update system state. + void OnRequestStatusChanged(AshTracingRequest* request); + + // SessionObserver + void OnFirstSessionStarted() override; + + const std::vector<std::unique_ptr<AshTracingRequest>>& + GetTracingRequestsForTesting() const; + + private: + // Returns status of the last request in tracing_requests_. + AshTracingRequest::Status GetLastRequestStatus() const; + + // Only last tracing request can be active. Other can be either finished, or + // waiting for user session start to save the trace. + std::vector<std::unique_ptr<AshTracingRequest>> tracing_requests_; + + base::ObserverList<Observer> observers_; +}; + +} // namespace hud_display +} // namespace ash + +#endif // ASH_HUD_DISPLAY_ASH_TRACING_MANAGER_H_
diff --git a/ash/hud_display/ash_tracing_request.cc b/ash/hud_display/ash_tracing_request.cc new file mode 100644 index 0000000..f588067 --- /dev/null +++ b/ash/hud_display/ash_tracing_request.cc
@@ -0,0 +1,409 @@ +// 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. + +#include "ash/hud_display/ash_tracing_request.h" + +#include <sys/mman.h> +#include <sys/sendfile.h> + +#include "ash/hud_display/ash_tracing_handler.h" +#include "ash/hud_display/ash_tracing_manager.h" +#include "ash/shell.h" +#include "ash/shell_delegate.h" +#include "base/bind.h" +#include "base/callback.h" +#include "base/files/file.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/files/platform_file.h" +#include "base/logging.h" +#include "base/posix/safe_strerror.h" +#include "base/strings/stringprintf.h" +#include "base/task/task_traits.h" +#include "base/task/thread_pool.h" + +namespace ash { +namespace hud_display { +namespace { + +// Tests supply their own IO layer generator. +static std::unique_ptr<AshTraceDestinationIO> ( + *test_ash_trace_destination_io_creator)(void) = nullptr; + +class DefaultAshTraceDestinationIO : public AshTraceDestinationIO { + public: + ~DefaultAshTraceDestinationIO() override = default; + + // Overrides base::CreateDirectory. + bool CreateDirectory(const base::FilePath& path) override { + base::File::Error error; + if (!base::CreateDirectoryAndGetError(path, &error)) { + LOG(ERROR) << "Failed to create Ash trace file directory '" + << path.value() << "' : error " << error; + return false; + } + return true; + } + + // Overrides base::File::File(). Returns pair {File file, bool success}. + std::tuple<base::File, bool> CreateTracingFile( + const base::FilePath& path) override { + base::File file(path, base::File::FLAG_CREATE | base::File::FLAG_WRITE); + const bool success = file.IsValid(); + return std::make_tuple(std::move(file), success); + } + + // Implements memfd_create(2). + std::tuple<base::PlatformFile, bool> CreateMemFD( + const char* name, + unsigned int flags) override { + base::PlatformFile memfd = memfd_create(name, flags); + return std::make_tuple(memfd, memfd != base::kInvalidPlatformFile); + } + + bool CanWriteFile(base::PlatformFile fd) override { + return fd != base::kInvalidPlatformFile; + } + + int fstat(base::PlatformFile fd, struct stat* statbuf) override { + return ::fstat(fd, statbuf); + } + + ssize_t sendfile(base::PlatformFile out_fd, + base::PlatformFile in_fd, + off_t* offset, + size_t size) override { + return ::sendfile(out_fd, in_fd, offset, size); + } +}; + +std::string GenerateTraceFileName(base::Time timestamp) { + base::Time::Exploded time_deets; + timestamp.LocalExplode(&time_deets); + return base::StringPrintf( + "ash-trace_%02d%02d%02d-%02d%02d%02d.%03d.dat", time_deets.year, + time_deets.month, time_deets.day_of_month, time_deets.hour, + time_deets.minute, time_deets.second, time_deets.millisecond); +} + +std::unique_ptr<AshTraceDestination> GenerateTraceDestinationFile( + std::unique_ptr<AshTraceDestinationIO> io, + const base::FilePath& tracng_directory_path, + base::Time timestamp) { + if (!io->CreateDirectory(tracng_directory_path)) + return nullptr; + + base::FilePath path = + tracng_directory_path.AppendASCII(GenerateTraceFileName(timestamp)); + base::File file; + bool success; + std::tie(file, success) = io->CreateTracingFile(path); + if (!success) { + LOG(ERROR) << "Failed to create Ash trace '" << path.value() << "' : error " + << file.error_details(); + return nullptr; + } + + return std::make_unique<AshTraceDestination>(std::move(io), std::move(path), + std::move(file), + base::kInvalidPlatformFile); +} + +std::unique_ptr<AshTraceDestination> GenerateTraceDestinationMemFD( + std::unique_ptr<AshTraceDestinationIO> io) { + constexpr char kMemFDDebugName[] = "ash-trace-buffer.dat"; + base::PlatformFile memfd; + bool success; + std::tie(memfd, success) = io->CreateMemFD(kMemFDDebugName, MFD_CLOEXEC); + if (!success) { + LOG(ERROR) << "Failed to create memfd for '" << kMemFDDebugName + << "', error:" << base::safe_strerror(errno); + return nullptr; + } + return std::make_unique<AshTraceDestination>(std::move(io), base::FilePath(), + base::File(), memfd); +} + +// Must be called with blocking allowed (i.e. from the thread pool). +// Returns null pointer in case of error. +std::unique_ptr<AshTraceDestination> GenerateTraceDestination( + std::unique_ptr<AshTraceDestinationIO> io, + base::Time timestamp, + bool is_logging_redirect_disabled, + const base::FilePath& user_downloads_folder) { + constexpr char kTracingDir[] = "tracing"; + constexpr char kGlobalTracingPath[] = "/run/chrome/"; + if (is_logging_redirect_disabled) { + return GenerateTraceDestinationFile( + std::move(io), + base::FilePath(kGlobalTracingPath).AppendASCII(kTracingDir), timestamp); + } + if (!user_downloads_folder.empty()) { + // User already logged in. + return GenerateTraceDestinationFile( + std::move(io), + base::FilePath(user_downloads_folder.AppendASCII(kTracingDir)), + timestamp); + } + // Need to write trace to the user Downloads folder, but it is not available + // yet. Create memfd. + return GenerateTraceDestinationMemFD(std::move(io)); +} + +base::FilePath GetUserDownloadsFolder() { + return Shell::Get()->shell_delegate()->GetPrimaryUserDownloadsFolder(); +} + +bool IsLoggingRedirectDisabled() { + return Shell::Get()->shell_delegate()->IsLoggingRedirectDisabled(); +} + +struct ExportStatus { + std::unique_ptr<AshTraceDestination> destination; + bool success = false; + std::string error_message; +}; + +ExportStatus ExportDataOnThreadPool(base::PlatformFile memfd, + const base::FilePath& user_downloads_folder, + base::Time timestamp) { + ExportStatus result; + result.destination = GenerateTraceDestination( + test_ash_trace_destination_io_creator + ? test_ash_trace_destination_io_creator() + : std::make_unique<DefaultAshTraceDestinationIO>(), + timestamp, + /*is_logging_redirect_disabled=*/false, user_downloads_folder); + + DCHECK(!result.destination->path().empty()); + + struct stat statbuf; + if (result.destination->io()->fstat(memfd, &statbuf)) { + result.error_message = std::string("Failed to stat memfd, error: ") + + base::safe_strerror(errno); + LOG(ERROR) << result.error_message; + return result; + } + off_t offset = 0; + const ssize_t written = result.destination->io()->sendfile( + result.destination->GetPlatformFile(), memfd, &offset, statbuf.st_size); + if (written != statbuf.st_size) { + const std::string system_error = base::safe_strerror(errno); + result.error_message = + base::StringPrintf("Stored only %zd trace bytes of %" PRId64 " to '", + written, static_cast<int64_t>(statbuf.st_size)) + + result.destination->path().value() + "', error: " + system_error; + LOG(ERROR) << result.error_message; + return result; + } + result.success = true; + return result; +} + +AshTracingRequest::GenerateTraceDestinationTask +CreateGenerateTraceDestinationTask(std::unique_ptr<AshTraceDestinationIO> io, + base::Time timestamp) { + return base::BindOnce(&GenerateTraceDestination, std::move(io), timestamp, + IsLoggingRedirectDisabled(), GetUserDownloadsFolder()); +} + +} // anonymous namespace + +AshTraceDestinationIO::~AshTraceDestinationIO() = default; + +AshTraceDestination::AshTraceDestination() = default; + +AshTraceDestination::AshTraceDestination( + std::unique_ptr<AshTraceDestinationIO> io, + const base::FilePath& path, + base::File&& file, + base::PlatformFile fd) + : io_(std::move(io)), path_(path), file_(std::move(file)), memfd_(fd) {} + +AshTraceDestination::~AshTraceDestination() { + Done(); +} + +base::PlatformFile AshTraceDestination::GetPlatformFile() const { + if (memfd_ != base::kInvalidPlatformFile) + return memfd_; + + return file_.GetPlatformFile(); +} + +bool AshTraceDestination::CanWriteFile() const { + return io_->CanWriteFile(GetPlatformFile()); +} + +void AshTraceDestination::Done() { + if (memfd_ != base::kInvalidPlatformFile) { + base::ThreadPool::PostTask( + FROM_HERE, + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, + base::BindOnce([](base::PlatformFile fd) { close(fd); }, memfd_)); + memfd_ = base::kInvalidPlatformFile; + } + if (file_.IsValid()) { + base::ThreadPool::PostTask( + FROM_HERE, + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, + base::BindOnce([](base::File fd) { fd.Close(); }, std::move(file_))); + } +} + +AshTracingRequest::AshTracingRequest(AshTracingManager* manager) + : timestamp_(base::Time::Now()), tracing_manager_(manager) { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + std::unique_ptr<AshTraceDestinationIO> io = + test_ash_trace_destination_io_creator + ? test_ash_trace_destination_io_creator() + : std::make_unique<DefaultAshTraceDestinationIO>(); + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, + CreateGenerateTraceDestinationTask(std::move(io), timestamp_), + base::BindOnce(&AshTracingRequest::OnTraceDestinationInitialized, + weak_factory_.GetWeakPtr())); +} + +AshTracingRequest::~AshTracingRequest() = default; + +void AshTracingRequest::Stop() { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + DCHECK(tracing_handler_); + status_ = Status::kStopping; + tracing_manager_->OnRequestStatusChanged(this); + tracing_handler_->Stop(); +} + +void AshTracingRequest::OnTracingStarted() { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + status_ = Status::kStarted; + tracing_manager_->OnRequestStatusChanged(this); +} + +void AshTracingRequest::OnTracingFinished() { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + tracing_handler_.reset(); + if (!trace_destination_->path().empty()) { + // Trace was already stored to the real file. + status_ = Status::kCompleted; + trace_destination_->Done(); + tracing_manager_->OnRequestStatusChanged(this); + return; + } + status_ = Status::kPendingMount; + tracing_manager_->OnRequestStatusChanged(this); + + // User logged in while tracing. Need to start saving file immediately. + if (user_logged_in_) + StorePendingFile(); +} + +// Will trigger trace file write if needed. +// If trace is already finalized, `on_completed` will be called immediately. +void AshTracingRequest::OnUserLoggedIn() { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + user_logged_in_ = true; + StorePendingFile(); +} + +base::PlatformFile AshTracingRequest::GetPlatformFile() const { + return trace_destination_->GetPlatformFile(); +} + +// static +void AshTracingRequest::SetAshTraceDestinationIOCreatorForTesting( + std::unique_ptr<AshTraceDestinationIO> (*creator)(void)) { + CHECK(!test_ash_trace_destination_io_creator); + test_ash_trace_destination_io_creator = creator; +} + +// static +void AshTracingRequest::ResetAshTraceDestinationIOCreatorForTesting() { + test_ash_trace_destination_io_creator = nullptr; +} + +// static +AshTracingRequest::GenerateTraceDestinationTask +AshTracingRequest::CreateGenerateTraceDestinationTaskForTesting( + std::unique_ptr<AshTraceDestinationIO> io, + base::Time timestamp) { + return CreateGenerateTraceDestinationTask(std::move(io), timestamp); +} + +const AshTraceDestination* AshTracingRequest::GetTraceDestinationForTesting() + const { + return trace_destination_.get(); +} + +void AshTracingRequest::OnTraceDestinationInitialized( + std::unique_ptr<AshTraceDestination> destination) { + DCHECK(!trace_destination_.get()); + trace_destination_ = std::move(destination); + status_ = Status::kInitialized; + tracing_manager_->OnRequestStatusChanged(this); + + tracing_handler_ = std::make_unique<AshTracingHandler>(); + tracing_handler_->Start(this); +} + +void AshTracingRequest::OnPendingFileStored( + std::unique_ptr<AshTraceDestination> destination, + bool success, + std::string error_message) { + trace_destination_ = std::move(destination); + // Cleanup possible errors. + trace_destination_->Done(); + status_ = Status::kCompleted; + error_message_ = error_message; + tracing_manager_->OnRequestStatusChanged(this); +} + +void AshTracingRequest::StorePendingFile() { + DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); + if (status_ != Status::kPendingMount) + return; + + if (!user_logged_in_) + return; + + base::FilePath user_downloads_folder = GetUserDownloadsFolder(); + if (user_downloads_folder.empty()) { + error_message_ = "No user Downloads folder."; + status_ = Status::kCompleted; + trace_destination_->Done(); + tracing_manager_->OnRequestStatusChanged(this); + return; + } + + status_ = Status::kWritingFile; + tracing_manager_->OnRequestStatusChanged(this); + + DCHECK(trace_destination_->CanWriteFile()); + + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, + base::BindOnce(&ExportDataOnThreadPool, GetPlatformFile(), + GetUserDownloadsFolder(), timestamp_), + base::BindOnce( + [](base::WeakPtr<AshTracingRequest> self, + ExportStatus export_status) { + if (!self) + return; + + self->OnPendingFileStored(std::move(export_status.destination), + export_status.success, + export_status.error_message); + }, + weak_factory_.GetWeakPtr())); +} + +} // namespace hud_display +} // namespace ash
diff --git a/ash/hud_display/ash_tracing_request.h b/ash/hud_display/ash_tracing_request.h new file mode 100644 index 0000000..30f0ac5 --- /dev/null +++ b/ash/hud_display/ash_tracing_request.h
@@ -0,0 +1,186 @@ +// 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. + +#ifndef ASH_HUD_DISPLAY_ASH_TRACING_REQUEST_H_ +#define ASH_HUD_DISPLAY_ASH_TRACING_REQUEST_H_ + +#include <memory> + +#include "base/callback_forward.h" +#include "base/files/file.h" +#include "base/files/file_path.h" +#include "base/files/platform_file.h" +#include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" +#include "base/time/time.h" + +#include "ash/ash_export.h" + +namespace ash { +namespace hud_display { + +class AshTracingManager; +class AshTracingHandler; + +// This is needed for testing to override File IO. +class ASH_EXPORT AshTraceDestinationIO { + public: + virtual ~AshTraceDestinationIO(); + + // Overrides base::CreateDirectory. + virtual bool CreateDirectory(const base::FilePath& path) = 0; + + // Overrides base::File::File(). Returns pair {File file, bool success}. + // Test implementation may return success with invalid file. + virtual std::tuple<base::File, bool> CreateTracingFile( + const base::FilePath& path) = 0; + + // Implements memfd_create(2). Returns pair {int fd, bool success}. + // Test implementation may return success with invalid fd. + virtual std::tuple<base::PlatformFile, bool> CreateMemFD( + const char* name, + unsigned int flags) = 0; + + // Takes GetPlatformFile() from AshTraceDestination and returns true if + // given fd is valid for storing traces. Checks for -1 in regular case, + // and checks internal status in tests. + virtual bool CanWriteFile(base::PlatformFile fd) = 0; + + virtual int fstat(base::PlatformFile fd, struct stat* statbuf) = 0; + + virtual ssize_t sendfile(base::PlatformFile out_fd, + base::PlatformFile in_fd, + off_t* offset, + size_t size) = 0; +}; + +class ASH_EXPORT AshTraceDestination { + public: + AshTraceDestination(); + AshTraceDestination(std::unique_ptr<AshTraceDestinationIO> io, + const base::FilePath& path, + base::File&& file, + base::PlatformFile memfd); + + AshTraceDestination(const AshTraceDestination&) = delete; + AshTraceDestination& operator=(const AshTraceDestination&) = delete; + + ~AshTraceDestination(); + + const base::FilePath& path() const { return path_; } + + // Returns PlatformFile for storing trace. + // Can be memfd or file depending on the setup. + base::PlatformFile GetPlatformFile() const; + + // Reurns true if GetPlatformFile() will return valid file descriptor. + // In tests when test IO layer is used returns true if test IO layer will + // succeed saving file. + bool CanWriteFile() const; + + // Close all files. + void Done(); + + AshTraceDestinationIO* io() const { return io_.get(); } + + private: + std::unique_ptr<AshTraceDestinationIO> io_; + + base::FilePath path_; + base::File file_; + base::PlatformFile memfd_ = base::kInvalidPlatformFile; +}; + +class AshTracingRequest { + public: + enum class Status { + kEmpty, // Object created. + kInitialized, // File data is initialized + kStarted, // Tracing is in progress. + kStopping, // Tracing is being stopped. + kPendingMount, // Tracing is complete, waiting for home directory mount. + kWritingFile, // Writing trace file from memory to file after user login. + kCompleted, // Trace file is written. Object has valid path. + }; + + // Will start tracing (asynchronously). + AshTracingRequest(AshTracingManager* tracing_manager); + AshTracingRequest(const AshTracingRequest&) = delete; + AshTracingRequest& operator=(const AshTracingRequest&) = delete; + + ~AshTracingRequest(); + + void Stop(); + + // Receive notifications from AshTracingHandler. + void OnTracingStarted(); + void OnTracingFinished(); + + // Will trigger trace file write if needed. + void OnUserLoggedIn(); + // Returns file descriptor that will actually be used for tracing. + base::PlatformFile GetPlatformFile() const; + + Status status() const { return status_; } + const std::string& error_message() const { return error_message_; } + + // Tests generate specific fake IO. + static ASH_EXPORT void SetAshTraceDestinationIOCreatorForTesting( + std::unique_ptr<AshTraceDestinationIO> (*creator)(void)); + static ASH_EXPORT void ResetAshTraceDestinationIOCreatorForTesting(); + + // Tests explicitly check AshTraceDestination behavior and they need to + // be able to generate ThreadPool tasks to crete AshTraceDestination. + // So this function will return a task that can be sent to IO-enabled + // sequence runner to create AshTraceDestination. + using AshTraceDestinationUniquePtr = std::unique_ptr<AshTraceDestination>; + using GenerateTraceDestinationTask = + base::OnceCallback<AshTraceDestinationUniquePtr(void)>; + ASH_EXPORT static GenerateTraceDestinationTask + CreateGenerateTraceDestinationTaskForTesting( + std::unique_ptr<AshTraceDestinationIO> io, + base::Time timestamp); + + ASH_EXPORT const AshTraceDestination* GetTraceDestinationForTesting() const; + + private: + // Starts tracing after `destination` was initialized on the ThreadPool. + void OnTraceDestinationInitialized( + std::unique_ptr<AshTraceDestination> destination); + + // Marks file export operation completed. + void OnPendingFileStored(std::unique_ptr<AshTraceDestination> destination, + bool success, + std::string error_message); + + // Stores memory trace file to permanent location. + void StorePendingFile(); + + // Trace status + Status status_ = Status::kEmpty; + + // When trace was started. + const base::Time timestamp_; + + bool user_logged_in_ = false; + + AshTracingManager* tracing_manager_; + + // This object is deleted once tracing is stopped. + std::unique_ptr<AshTracingHandler> tracing_handler_; + + // Non-empty if error has occurred. + std::string error_message_; + + std::unique_ptr<AshTraceDestination> trace_destination_; + + SEQUENCE_CHECKER(my_sequence_checker_); + + base::WeakPtrFactory<AshTracingRequest> weak_factory_{this}; +}; + +} // namespace hud_display +} // namespace ash + +#endif // ASH_HUD_DISPLAY_ASH_TRACING_REQUEST_H_
diff --git a/ash/hud_display/cpu_graph_page_view.cc b/ash/hud_display/cpu_graph_page_view.cc index fd0dd1f..bfa538b 100644 --- a/ash/hud_display/cpu_graph_page_view.cc +++ b/ash/hud_display/cpu_graph_page_view.cc
@@ -10,8 +10,8 @@ #include "ash/hud_display/hud_constants.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace hud_display {
diff --git a/ash/hud_display/fps_graph_page_view.cc b/ash/hud_display/fps_graph_page_view.cc index fd65896..6c9e4b8b 100644 --- a/ash/hud_display/fps_graph_page_view.cc +++ b/ash/hud_display/fps_graph_page_view.cc
@@ -14,10 +14,10 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "ui/aura/window_tree_host.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/compositor.h" #include "ui/gfx/canvas.h" #include "ui/gfx/presentation_feedback.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace ash {
diff --git a/ash/hud_display/graph_page_view_base.cc b/ash/hud_display/graph_page_view_base.cc index 521b80f..8aea9c5 100644 --- a/ash/hud_display/graph_page_view_base.cc +++ b/ash/hud_display/graph_page_view_base.cc
@@ -10,6 +10,7 @@ #include "ash/hud_display/legend.h" #include "ash/hud_display/solid_source_background.h" #include "base/bind.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/border.h" @@ -17,7 +18,6 @@ #include "ui/views/controls/button/image_button.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/vector_icons/vector_icons.h" namespace ash { @@ -116,6 +116,8 @@ legend_min_max_button_ = legend_container_->AddChildView( std::make_unique<MinMaxButton>(base::BindRepeating( &GraphPageViewBase::OnButtonPressed, base::Unretained(this)))); + + legend_min_max_button_->SetTooltipText(u"Trigger graph legend"); SetMinimizeIconToButton(legend_min_max_button_); }
diff --git a/ash/hud_display/graphs_container_view.cc b/ash/hud_display/graphs_container_view.cc index 7bbf2b1d..a172c43 100644 --- a/ash/hud_display/graphs_container_view.cc +++ b/ash/hud_display/graphs_container_view.cc
@@ -14,8 +14,8 @@ #include "base/task/post_task.h" #include "base/task/thread_pool.h" #include "base/threading/thread_task_runner_handle.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace hud_display {
diff --git a/ash/hud_display/grid.cc b/ash/hud_display/grid.cc index f8b30d1..b14d3e9 100644 --- a/ash/hud_display/grid.cc +++ b/ash/hud_display/grid.cc
@@ -12,9 +12,9 @@ #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/core/SkPath.h" #include "third_party/skia/include/effects/SkDashPathEffect.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/text_constants.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace hud_display {
diff --git a/ash/hud_display/hud_constants.h b/ash/hud_display/hud_constants.h index 9d4cff1c..b712f70 100644 --- a/ash/hud_display/hud_constants.h +++ b/ash/hud_display/hud_constants.h
@@ -18,6 +18,8 @@ constexpr SkColor kHUDBackground = SkColorSetARGB(kHUDAlpha, 17, 17, 17); constexpr SkColor kHUDLegendBackground = kHUDBackground; +constexpr SkColor kHUDDisabledButtonColor = + SkColorSetA(kHUDDefaultColor, 0xFF * 0.5); // Radius of rounded corners for tabs. // Must be be divisible by 3 to make kTabOverlayWidth integer.
diff --git a/ash/hud_display/hud_display.cc b/ash/hud_display/hud_display.cc index 41640cb..a4b9eb5 100644 --- a/ash/hud_display/hud_display.cc +++ b/ash/hud_display/hud_display.cc
@@ -20,13 +20,13 @@ #include "components/vector_icons/vector_icons.h" #include "ui/aura/window.h" #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/events/base_event_utils.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/native_widget.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -39,6 +39,7 @@ // Default HUDDisplayView height. constexpr size_t kDefaultHUDGraphHeight = 300; +constexpr size_t kDefaultHUDSettingHeight = 400; // Top border + Header height + margin + graph height + bottom border.. constexpr int kHUDViewDefaultHeight = @@ -70,6 +71,8 @@ return hud_display_->NonClientHitTest(point); } + HUDDisplayView* GetHUDDisplayViewForTesting() { return hud_display_; } + private: HUDDisplayView* hud_display_; }; @@ -136,6 +139,11 @@ g_hud_widget = widget; } +// static +bool HUDDisplayView::IsShown() { + return g_hud_widget; +} + HUDDisplayView::HUDDisplayView() { DCHECK_CALLED_ON_VALID_SEQUENCE(ui_sequence_checker_); @@ -191,6 +199,14 @@ // There is only one button. void HUDDisplayView::OnSettingsToggle() { + gfx::Rect bounds = g_hud_widget->GetWindowBoundsInScreen(); + constexpr int settings_height_addition = + kDefaultHUDSettingHeight - kDefaultHUDGraphHeight; + // Adjust window height. + bounds.set_height(bounds.height() + (settings_view_->GetVisible() ? -1 : 1) * + settings_height_addition); + g_hud_widget->SetBounds(bounds); + settings_view_->ToggleVisibility(); graphs_container_->SetVisible(!settings_view_->GetVisible()); } @@ -206,6 +222,28 @@ ->SetIsOverlayCandidate(g_hud_overlay_mode); } +// static +HUDDisplayView* HUDDisplayView::GetForTesting() { + if (!g_hud_widget) + return nullptr; + + HTClientView* client_view = + static_cast<HTClientView*>(g_hud_widget->client_view()); + + if (!client_view) + return nullptr; + + return client_view->GetHUDDisplayViewForTesting(); // IN-TEST +} + +HUDSettingsView* HUDDisplayView::GetSettingsViewForTesting() { + return settings_view_; +} + +void HUDDisplayView::ToggleSettingsForTesting() { + OnSettingsToggle(); +} + int HUDDisplayView::NonClientHitTest(const gfx::Point& point) { const View* view = GetEventHandlerForPoint(point); if (!view)
diff --git a/ash/hud_display/hud_display.h b/ash/hud_display/hud_display.h index 8dc3f3f..e929ea4b 100644 --- a/ash/hud_display/hud_display.h +++ b/ash/hud_display/hud_display.h
@@ -5,6 +5,7 @@ #ifndef ASH_HUD_DISPLAY_HUD_DISPLAY_H_ #define ASH_HUD_DISPLAY_HUD_DISPLAY_H_ +#include "ash/ash_export.h" #include "base/sequence_checker.h" #include "ui/views/view.h" @@ -33,6 +34,9 @@ // Creates/Destroys global singleton. static void Toggle(); + // True when HUD is shown. + static bool ASH_EXPORT IsShown(); + // Called from ClientView. Responsible for moving widget when clicked outside // of the children. int NonClientHitTest(const gfx::Point& point); @@ -49,6 +53,10 @@ // Changes HUD overlay flag. void ToggleOverlay(); + ASH_EXPORT static HUDDisplayView* GetForTesting(); + ASH_EXPORT HUDSettingsView* GetSettingsViewForTesting(); + ASH_EXPORT void ToggleSettingsForTesting(); + private: HUDHeaderView* header_view_ = nullptr; // not owned GraphsContainerView* graphs_container_ = nullptr; // not owned
diff --git a/ash/hud_display/hud_header_view.cc b/ash/hud_display/hud_header_view.cc index 6ce1307..b8bbbf6 100644 --- a/ash/hud_display/hud_header_view.cc +++ b/ash/hud_display/hud_header_view.cc
@@ -10,6 +10,7 @@ #include "ash/hud_display/solid_source_background.h" #include "ash/hud_display/tab_strip.h" #include "components/vector_icons/vector_icons.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/skia_util.h" @@ -19,7 +20,6 @@ #include "ui/views/controls/button/image_button.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_manager.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace hud_display { @@ -186,9 +186,10 @@ gfx::Insets(kHUDInset, kHUDInset, 0, kHUDInset))); // Add buttons and tab strip. - header_buttons->AddChildView( - std::make_unique<SettingsButton>(base::BindRepeating( - &HUDDisplayView::OnSettingsToggle, base::Unretained(hud)))); + header_buttons + ->AddChildView(std::make_unique<SettingsButton>(base::BindRepeating( + &HUDDisplayView::OnSettingsToggle, base::Unretained(hud)))) + ->SetTooltipText(u"Trigger Ash HUD Settings"); tab_strip_ = header_buttons->AddChildView(std::make_unique<HUDTabStrip>(hud)); // Padding will take the rest of the header and draw bottom inner left
diff --git a/ash/hud_display/hud_settings_view.cc b/ash/hud_display/hud_settings_view.cc index 1ae2042..900753f 100644 --- a/ash/hud_display/hud_settings_view.cc +++ b/ash/hud_display/hud_settings_view.cc
@@ -6,6 +6,7 @@ #include <string> +#include "ash/hud_display/ash_tracing_handler.h" #include "ash/hud_display/hud_display.h" #include "ash/hud_display/hud_properties.h" #include "ash/shell.h" @@ -19,16 +20,17 @@ #include "third_party/skia/include/core/SkPath.h" #include "ui/aura/env.h" #include "ui/aura/window_tree_host.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/compositor.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/gfx/canvas.h" +#include "ui/gfx/paint_throbber.h" #include "ui/views/background.h" #include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/label.h" #include "ui/views/controls/slider.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace hud_display { @@ -334,19 +336,72 @@ views::View::Layout(); } -std::unique_ptr<views::LabelButton> CreateActionButton( - views::Button::PressedCallback::Callback callback, - const std::u16string& text) { - auto button = std::make_unique<views::LabelButton>(callback, text); - button->SetHorizontalAlignment(gfx::ALIGN_CENTER); - button->SetEnabledTextColors(kHUDBackground); - button->SetProperty(kHUDClickHandler, HTCLIENT); - constexpr float kActionButtonCournerRadius = 2; - button->SetBackground(views::CreateRoundedRectBackground( - kHUDDefaultColor, kActionButtonCournerRadius)); - button->SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY); - return button; -} +class HUDActionButton : public views::LabelButton { + public: + HUDActionButton(views::Button::PressedCallback::Callback callback, + const std::u16string& text) + : LabelButton(callback, text) { + SetHorizontalAlignment(gfx::ALIGN_CENTER); + SetEnabledTextColors(kHUDBackground); + SetProperty(kHUDClickHandler, HTCLIENT); + constexpr float kActionButtonCournerRadius = 2; + SetBackground(views::CreateRoundedRectBackground( + kHUDDefaultColor, kActionButtonCournerRadius)); + SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY); + on_enabled_changed_subscription_ = + AddEnabledChangedCallback(base::BindRepeating( + &HUDActionButton::OnEnabedChanged, base::Unretained(this))); + } + + HUDActionButton(const HUDActionButton&) = delete; + HUDActionButton& operator=(const HUDActionButton&) = delete; + + ~HUDActionButton() override = default; + + void PaintButtonContents(gfx::Canvas* canvas) override { + views::LabelButton::PaintButtonContents(canvas); + if (spinner_refresh_timer_.IsRunning()) { + base::Time now = base::Time::Now(); + gfx::Rect spinner = GetContentsBounds(); + int spinner_width = std::min(spinner.width(), spinner.height()); + spinner.ClampToCenteredSize(gfx::Size(spinner_width, spinner_width)); + gfx::PaintThrobberSpinning(canvas, spinner, + SkColorSetA(SK_ColorWHITE, 0xFF * (.5)), + (now - spinner_created_) / 8); + } + } + + void DisableWithSpinner() { + DCHECK(!spinner_refresh_timer_.IsRunning()); + SetEnabled(false); + constexpr base::TimeDelta interval = base::TimeDelta::FromSecondsD(0.5); + spinner_created_ = base::Time::Now(); + spinner_refresh_timer_.Start( + FROM_HERE, interval, + base::BindRepeating( + [](views::View* button) { button->SchedulePaint(); }, + base::Unretained(this))); + SchedulePaint(); + } + + void UpdateBackgroundColor() override { + if (GetVisualState() == STATE_DISABLED) { + GetBackground()->SetNativeControlColor(kHUDDisabledButtonColor); + } else { + GetBackground()->SetNativeControlColor(kHUDDefaultColor); + } + } + + private: + void OnEnabedChanged() { + if (GetEnabled()) + spinner_refresh_timer_.Stop(); + } + + base::CallbackListSubscription on_enabled_changed_subscription_; + base::Time spinner_created_; + base::RepeatingTimer spinner_refresh_timer_; +}; } // anonymous namespace @@ -444,14 +499,66 @@ views::BoxLayout::Orientation::kVertical)) ->set_cross_axis_alignment( views::BoxLayout::CrossAxisAlignment::kStretch); + + // Tracing controls. + constexpr int kTracingControlButtonMargin = 6; + views::View* tracing_controls = AddChildView(std::make_unique<views::View>()); + tracing_controls + ->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kVertical)) + ->set_cross_axis_alignment( + views::BoxLayout::CrossAxisAlignment::kStretch); + ui_devtools_controls->SetBorder( views::CreateEmptyBorder(gfx::Insets(kUiDevToolsControlButtonMargin))); ui_dev_tools_control_button_ = - ui_devtools_controls->AddChildView(CreateActionButton( + ui_devtools_controls->AddChildView(std::make_unique<HUDActionButton>( base::BindRepeating(&HUDSettingsView::OnEnableUiDevToolsButtonPressed, base::Unretained(this)), std::u16string())); UpdateDevToolsControlButtonLabel(); + + tracing_controls->SetBorder( + views::CreateEmptyBorder(gfx::Insets(kTracingControlButtonMargin))); + tracing_control_button_ = + tracing_controls->AddChildView(std::make_unique<HUDActionButton>( + base::BindRepeating(&HUDSettingsView::OnEnableTracingButtonPressed, + base::Unretained(this)), + std::u16string())); + + const int kLabelBorderWidth = 3; + tracing_status_message_ = + tracing_controls->AddChildView(std::make_unique<views::Label>( + std::u16string(), views::style::CONTEXT_LABEL)); + tracing_status_message_->SetAutoColorReadabilityEnabled(false); + tracing_status_message_->SetEnabledColor(kHUDDefaultColor); + tracing_status_message_->SetBorder(views::CreateEmptyBorder( + gfx::Insets(/*vertical=*/0, /*horizontal=*/kLabelBorderWidth))); + tracing_status_message_->SetHorizontalAlignment(gfx::ALIGN_LEFT); + + views::Label* pii_label = tracing_controls->AddChildView(std::make_unique< + views::Label>( + u"WARNING: Trace files may contain Personally Identifiable Information. " + u"You should use discretion when sharing your trace files.", + views::style::CONTEXT_LABEL)); + pii_label->SetMultiLine(true); + pii_label->SetAutoColorReadabilityEnabled(false); + pii_label->SetEnabledColor(kHUDDefaultColor); + pii_label->SetBorder(views::CreateEmptyBorder( + gfx::Insets(/*vertical=*/0, /*horizontal=*/kLabelBorderWidth))); + pii_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); + + UpdateTracingControlButton(); + + AshTracingManager::Get().AddObserver(this); +} + +HUDSettingsView::~HUDSettingsView() { + AshTracingManager::Get().RemoveObserver(this); +} + +void HUDSettingsView::OnTracingStatusChange() { + UpdateTracingControlButton(); } void HUDSettingsView::OnEnableUiDevToolsButtonPressed(const ui::Event& event) { @@ -473,8 +580,6 @@ } } -HUDSettingsView::~HUDSettingsView() = default; - void HUDSettingsView::ToggleVisibility() { const bool is_shown = !GetVisible(); if (is_shown) { @@ -485,6 +590,38 @@ SetVisible(is_shown); } +void HUDSettingsView::OnEnableTracingButtonPressed(const ui::Event& event) { + ToggleTracing(); +} + +void HUDSettingsView::ToggleTracingForTesting() { + ToggleTracing(); +} + +void HUDSettingsView::ToggleTracing() { + AshTracingManager& manager = AshTracingManager::Get(); + tracing_control_button_->DisableWithSpinner(); + if (manager.IsTracingStarted()) { + manager.Stop(); + } else { + manager.Start(); + } +} + +void HUDSettingsView::UpdateTracingControlButton() { + AshTracingManager& manager = AshTracingManager::Get(); + if (!manager.IsBusy()) + tracing_control_button_->SetEnabled(true); + + tracing_status_message_->SetText( + base::ASCIIToUTF16(manager.GetStatusMessage())); + if (manager.IsTracingStarted()) { + tracing_control_button_->SetText(u"Stop tracing."); + } else { + tracing_control_button_->SetText(u"Start tracing."); + } +} + } // namespace hud_display } // namespace ash
diff --git a/ash/hud_display/hud_settings_view.h b/ash/hud_display/hud_settings_view.h index 8a900740..0734234 100644 --- a/ash/hud_display/hud_settings_view.h +++ b/ash/hud_display/hud_settings_view.h
@@ -8,7 +8,9 @@ #include <memory> #include <vector> +#include "ash/hud_display/ash_tracing_manager.h" #include "ash/hud_display/hud_constants.h" +#include "base/memory/weak_ptr.h" #include "ui/views/view.h" namespace ui { @@ -16,6 +18,7 @@ } namespace views { +class Label; class LabelButton; } @@ -25,7 +28,11 @@ class HUDCheckboxHandler; class HUDDisplayView; -class HUDSettingsView : public views::View { +namespace { +class HUDActionButton; +} + +class HUDSettingsView : public AshTracingManager::Observer, public views::View { public: METADATA_HEADER(HUDSettingsView); @@ -35,20 +42,39 @@ HUDSettingsView(const HUDSettingsView&) = delete; HUDSettingsView& operator=(const HUDSettingsView&) = delete; + // AshTracingManager::Observer + void OnTracingStatusChange() override; + // Shows/hides the view. void ToggleVisibility(); // Creates Ui Dev Tools. void OnEnableUiDevToolsButtonPressed(const ui::Event& event); + // Starts tracing. + void OnEnableTracingButtonPressed(const ui::Event& event); + + ASH_EXPORT void ToggleTracingForTesting(); + private: + // Starts/Stops tracing. + void ToggleTracing(); + // Replace "Create Ui Dev Tools" button label with "DevTools running". void UpdateDevToolsControlButtonLabel(); + // Switches between "Start tracing" and "Stop tracing" button labels. + void UpdateTracingControlButton(); + std::vector<std::unique_ptr<HUDCheckboxHandler>> checkbox_handlers_; // Container for "Create Ui Dev Tools" button or "DevTools running" label. views::LabelButton* ui_dev_tools_control_button_ = nullptr; + + HUDActionButton* tracing_control_button_ = nullptr; + views::Label* tracing_status_message_ = nullptr; + + base::WeakPtrFactory<HUDSettingsView> weak_factory_{this}; }; } // namespace hud_display
diff --git a/ash/hud_display/legend.cc b/ash/hud_display/legend.cc index 814b9c3a..c4307abd 100644 --- a/ash/hud_display/legend.cc +++ b/ash/hud_display/legend.cc
@@ -11,12 +11,12 @@ #include "third_party/skia/include/core/SkBlendMode.h" #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/core/SkPath.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/text_constants.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace hud_display {
diff --git a/ash/hud_display/memory_graph_page_view.cc b/ash/hud_display/memory_graph_page_view.cc index be64ed8..ece6819 100644 --- a/ash/hud_display/memory_graph_page_view.cc +++ b/ash/hud_display/memory_graph_page_view.cc
@@ -12,8 +12,8 @@ #include "ash/hud_display/hud_constants.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace hud_display {
diff --git a/ash/hud_display/tab_strip.cc b/ash/hud_display/tab_strip.cc index 2f54483..ea8e1da 100644 --- a/ash/hud_display/tab_strip.cc +++ b/ash/hud_display/tab_strip.cc
@@ -10,10 +10,10 @@ #include "ash/hud_display/hud_properties.h" #include "base/bind.h" #include "third_party/skia/include/core/SkPath.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/text_constants.h" #include "ui/views/layout/layout_manager.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace hud_display {
diff --git a/ash/hud_display/tab_strip.h b/ash/hud_display/tab_strip.h index 369c7004..96ba756 100644 --- a/ash/hud_display/tab_strip.h +++ b/ash/hud_display/tab_strip.h
@@ -8,8 +8,8 @@ #include <string> #include "ash/hud_display/hud_constants.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace gfx {
diff --git a/ash/ime/ime_mode_indicator_view.cc b/ash/ime/ime_mode_indicator_view.cc index 2950067..95354d66 100644 --- a/ash/ime/ime_mode_indicator_view.cc +++ b/ash/ime/ime_mode_indicator_view.cc
@@ -9,12 +9,12 @@ #include "ash/wm/window_util.h" #include "base/logging.h" #include "base/macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/wm/core/window_animations.h" namespace ash {
diff --git a/ash/ime/ime_mode_indicator_view.h b/ash/ime/ime_mode_indicator_view.h index 251f1e8..9392e5b 100644 --- a/ash/ime/ime_mode_indicator_view.h +++ b/ash/ime/ime_mode_indicator_view.h
@@ -10,9 +10,9 @@ #include "ash/ash_export.h" #include "base/macros.h" #include "base/timer/timer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget.h" namespace views {
diff --git a/ash/lock_screen_action/lock_screen_action_background_view.cc b/ash/lock_screen_action/lock_screen_action_background_view.cc index 7c707b3f..c7b0f85 100644 --- a/ash/lock_screen_action/lock_screen_action_background_view.cc +++ b/ash/lock_screen_action/lock_screen_action_background_view.cc
@@ -30,18 +30,20 @@ : observer_(observer) { DCHECK(observer); SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER); + + SetCreateInkDropCallback(base::BindRepeating( + [](NoteBackground* host) { + std::unique_ptr<views::InkDrop> ink_drop = + views::InkDrop::CreateInkDropWithoutAutoHighlight( + host, /*highlight_on_hover=*/false); + ink_drop->AddObserver(host->observer_); + return ink_drop; + }, + this)); } ~NoteBackground() override = default; - std::unique_ptr<views::InkDrop> CreateInkDrop() override { - std::unique_ptr<views::InkDrop> ink_drop = - views::InkDrop::CreateInkDropWithoutAutoHighlight( - this, /*highlight_on_hover=*/false); - ink_drop->AddObserver(observer_); - return ink_drop; - } - std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override { gfx::Point center = base::i18n::IsRTL() ? GetLocalBounds().origin() : GetLocalBounds().top_right();
diff --git a/ash/login/ui/arrow_button_view.cc b/ash/login/ui/arrow_button_view.cc index 44946871..fe9a9f5 100644 --- a/ash/login/ui/arrow_button_view.cc +++ b/ash/login/ui/arrow_button_view.cc
@@ -10,6 +10,7 @@ #include "ash/style/ash_color_provider.h" #include "base/time/time.h" #include "cc/paint/paint_flags.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/animation/multi_animation.h" #include "ui/gfx/animation/tween.h" @@ -18,7 +19,6 @@ #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/skia_util.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace {
diff --git a/ash/login/ui/arrow_button_view.h b/ash/login/ui/arrow_button_view.h index 6b943388..ca587a1 100644 --- a/ash/login/ui/arrow_button_view.h +++ b/ash/login/ui/arrow_button_view.h
@@ -8,9 +8,9 @@ #include <memory> #include "ash/login/ui/login_button.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/animation_delegate.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace gfx { class MultiAnimation;
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc index b9f7b0b0..b8540827 100644 --- a/ash/login/ui/lock_contents_view.cc +++ b/ash/login/ui/lock_contents_view.cc
@@ -60,6 +60,7 @@ #include "components/user_manager/user_type.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/user_activity/user_activity_detector.h" #include "ui/base/user_activity/user_activity_observer.h" #include "ui/chromeos/devicetype_utils.h" @@ -82,7 +83,6 @@ #include "ui/views/focus/focus_search.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/vector_icons.h" #include "ui/views/view.h"
diff --git a/ash/login/ui/lock_contents_view.h b/ash/login/ui/lock_contents_view.h index 8a2262c..9482ba0 100644 --- a/ash/login/ui/lock_contents_view.h +++ b/ash/login/ui/lock_contents_view.h
@@ -30,9 +30,9 @@ #include "base/scoped_observation.h" #include "chromeos/dbus/power/power_manager_client.h" #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/display/display_observer.h" #include "ui/display/screen.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace keyboard {
diff --git a/ash/login/ui/lock_screen_media_controls_view.cc b/ash/login/ui/lock_screen_media_controls_view.cc index ef7068d2..d995323e 100644 --- a/ash/login/ui/lock_screen_media_controls_view.cc +++ b/ash/login/ui/lock_screen_media_controls_view.cc
@@ -25,6 +25,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/font.h" @@ -40,7 +41,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/login/ui/lock_screen_media_controls_view.h b/ash/login/ui/lock_screen_media_controls_view.h index ef548750..54c3445 100644 --- a/ash/login/ui/lock_screen_media_controls_view.h +++ b/ash/login/ui/lock_screen_media_controls_view.h
@@ -14,8 +14,8 @@ #include "mojo/public/cpp/bindings/remote.h" #include "services/media_session/public/mojom/media_controller.mojom.h" #include "services/media_session/public/mojom/media_session.mojom.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/compositor/layer_animation_observer.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/ash/projector/ui/projector_bar_view.cc b/ash/projector/ui/projector_bar_view.cc index 61d196e4..a3b45b5b 100644 --- a/ash/projector/ui/projector_bar_view.cc +++ b/ash/projector/ui/projector_bar_view.cc
@@ -11,13 +11,13 @@ #include "ash/wm/work_area_insets.h" #include "components/vector_icons/vector_icons.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/background.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/unique_widget_ptr.h"
diff --git a/ash/projector/ui/projector_button.cc b/ash/projector/ui/projector_button.cc index 0c88dc67..f0ec43d3 100644 --- a/ash/projector/ui/projector_button.cc +++ b/ash/projector/ui/projector_button.cc
@@ -29,11 +29,10 @@ // Rounded background. views::InstallRoundRectHighlightPathGenerator(this, gfx::Insets(), kProjectorButtonSize / 2.f); -} -std::unique_ptr<views::InkDrop> ProjectorButton::CreateInkDrop() { - return views::InkDrop::CreateInkDropForFloodFillRipple( - this, /*highlight_on_hover=*/true, /*highlight_on_focus=*/true); + views::InkDrop::UseInkDropForFloodFillRipple(this, + /*highlight_on_hover=*/true, + /*highlight_on_focus=*/true); } void ProjectorButton::OnPaintBackground(gfx::Canvas* canvas) {
diff --git a/ash/projector/ui/projector_button.h b/ash/projector/ui/projector_button.h index 1d491e4..bab80be 100644 --- a/ash/projector/ui/projector_button.h +++ b/ash/projector/ui/projector_button.h
@@ -23,7 +23,6 @@ ~ProjectorButton() override = default; // views::ToggleImageButton: - std::unique_ptr<views::InkDrop> CreateInkDrop() override; void OnPaintBackground(gfx::Canvas* canvas) override; void OnThemeChanged() override; };
diff --git a/ash/public/cpp/accelerators.cc b/ash/public/cpp/accelerators.cc index 65500237..8335ed15 100644 --- a/ash/public/cpp/accelerators.cc +++ b/ash/public/cpp/accelerators.cc
@@ -36,8 +36,8 @@ {true, ui::VKEY_KBD_BRIGHTNESS_DOWN, ui::EF_NONE, KEYBOARD_BRIGHTNESS_DOWN}, {true, ui::VKEY_KBD_BRIGHTNESS_UP, ui::EF_NONE, KEYBOARD_BRIGHTNESS_UP}, // Maximize button. - {true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_CONTROL_DOWN, TOGGLE_MIRROR_MODE}, - {true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_ALT_DOWN, SWAP_PRIMARY_DISPLAY}, + {true, ui::VKEY_ZOOM, ui::EF_CONTROL_DOWN, TOGGLE_MIRROR_MODE}, + {true, ui::VKEY_ZOOM, ui::EF_ALT_DOWN, SWAP_PRIMARY_DISPLAY}, // Cycle windows button. {true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_CONTROL_DOWN, TAKE_SCREENSHOT}, {true, ui::VKEY_MEDIA_LAUNCH_APP1, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, @@ -63,6 +63,7 @@ {false, ui::VKEY_SLEEP, ui::EF_NONE, LOCK_RELEASED}, {true, ui::VKEY_POWER, ui::EF_NONE, POWER_PRESSED}, {false, ui::VKEY_POWER, ui::EF_NONE, POWER_RELEASED}, + {true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_NONE, OPEN_CALCULATOR}, {true, ui::VKEY_ESCAPE, ui::EF_CONTROL_DOWN | ui::EF_COMMAND_DOWN, OPEN_DIAGNOSTICS}, {true, ui::VKEY_M, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, OPEN_FILE_MANAGER}, @@ -127,8 +128,8 @@ // extended keyboard shortcuts. {false, ui::VKEY_LWIN, ui::EF_NONE, TOGGLE_APP_LIST}, {false, ui::VKEY_LWIN, ui::EF_SHIFT_DOWN, TOGGLE_APP_LIST_FULLSCREEN}, - {true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_NONE, TOGGLE_FULLSCREEN}, - {true, ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_SHIFT_DOWN, TOGGLE_FULLSCREEN}, + {true, ui::VKEY_ZOOM, ui::EF_NONE, TOGGLE_FULLSCREEN}, + {true, ui::VKEY_ZOOM, ui::EF_SHIFT_DOWN, TOGGLE_FULLSCREEN}, {true, ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN | ui::EF_COMMAND_DOWN, UNPIN}, {true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, FOCUS_SHELF}, {true, ui::VKEY_V, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, FOCUS_PIP},
diff --git a/ash/public/cpp/accelerators.h b/ash/public/cpp/accelerators.h index d72c511..fb81043f9 100644 --- a/ash/public/cpp/accelerators.h +++ b/ash/public/cpp/accelerators.h
@@ -66,6 +66,7 @@ NEW_INCOGNITO_WINDOW, NEW_TAB, NEW_WINDOW, + OPEN_CALCULATOR, OPEN_CROSH, OPEN_DIAGNOSTICS, OPEN_FEEDBACK_PAGE,
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 d373e7db0..198d9b3 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
@@ -17,6 +17,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_observer.h" #include "ui/compositor/layer_tree_owner.h" @@ -30,7 +31,6 @@ #include "ui/strings/grit/ui_strings.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/focus/focus_manager.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/root_view.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/ash/public/cpp/external_arc/message_center/arc_notification_content_view.h b/ash/public/cpp/external_arc/message_center/arc_notification_content_view.h index 95340f84..30f2330 100644 --- a/ash/public/cpp/external_arc/message_center/arc_notification_content_view.h +++ b/ash/public/cpp/external_arc/message_center/arc_notification_content_view.h
@@ -12,10 +12,10 @@ #include "ash/public/cpp/external_arc/message_center/arc_notification_surface_manager.h" #include "base/macros.h" #include "ui/aura/window_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/message_center/views/notification_background_painter.h" #include "ui/message_center/views/notification_control_buttons_view.h" #include "ui/views/controls/native/native_view_host.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_observer.h" namespace message_center {
diff --git a/ash/public/cpp/external_arc/overlay/arc_overlay_controller_impl.cc b/ash/public/cpp/external_arc/overlay/arc_overlay_controller_impl.cc index fe0702b..ae3c0c9 100644 --- a/ash/public/cpp/external_arc/overlay/arc_overlay_controller_impl.cc +++ b/ash/public/cpp/external_arc/overlay/arc_overlay_controller_impl.cc
@@ -7,7 +7,7 @@ #include "components/exo/shell_surface_util.h" #include "components/exo/surface.h" #include "ui/aura/window_targeter.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace ash {
diff --git a/ash/public/cpp/holding_space/holding_space_image.cc b/ash/public/cpp/holding_space/holding_space_image.cc index a1f6563..f846335e 100644 --- a/ash/public/cpp/holding_space/holding_space_image.cc +++ b/ash/public/cpp/holding_space/holding_space_image.cc
@@ -60,11 +60,7 @@ const gfx::ImageSkia file_type_icon = is_folder ? GetIconFromType(IconType::kFolder, dark_background) : GetIconForPath(file_path, dark_background); - - // Superimpose the `file_type_icon` over an empty image in order to center it - // within the image at a fixed size. - return gfx::ImageSkiaOperations::CreateSuperimposedImage( - CreateEmptyImageSkia(size), file_type_icon); + return HoldingSpaceImage::SuperimposeOverEmptyImage(file_type_icon, size); } } // namespace @@ -97,14 +93,18 @@ // HoldingSpaceImage ----------------------------------------------------------- -HoldingSpaceImage::HoldingSpaceImage(const gfx::Size& max_size, - const base::FilePath& backing_file_path, - AsyncBitmapResolver async_bitmap_resolver) +HoldingSpaceImage::HoldingSpaceImage( + const gfx::Size& max_size, + const base::FilePath& backing_file_path, + AsyncBitmapResolver async_bitmap_resolver, + base::Optional<gfx::ImageSkia> file_type_icon) : max_size_(max_size), backing_file_path_(backing_file_path), - async_bitmap_resolver_(async_bitmap_resolver) { - // Use an empty `placeholder_` until a bitmap is asynchronously returned. - placeholder_ = CreateEmptyImageSkia(max_size_); + async_bitmap_resolver_(async_bitmap_resolver), + file_type_icon_(std::move(file_type_icon)) { + // If there is no supplied `file_type_icon`, use an empty `placeholder_` until + // a bitmap is asynchronously returned. + placeholder_ = file_type_icon_.value_or(CreateEmptyImageSkia(max_size_)); CreateImageSkia(); } @@ -139,6 +139,16 @@ g_use_zero_invalidation_delay_for_testing = value; } +// static +gfx::ImageSkia HoldingSpaceImage::SuperimposeOverEmptyImage( + const gfx::ImageSkia& icon, + const gfx::Size& size) { + // Superimpose the `icon` over an empty image in order to center it + // within the image at a fixed size. + return gfx::ImageSkiaOperations::CreateSuperimposedImage( + CreateEmptyImageSkia(size), icon); +} + bool HoldingSpaceImage::operator==(const HoldingSpaceImage& rhs) const { return gfx::BitmapsAreEqual(*image_skia_.bitmap(), *rhs.image_skia_.bitmap()); } @@ -213,6 +223,8 @@ // When an error occurs, fallback to an image representing file type. if (async_bitmap_resolver_error_ && async_bitmap_resolver_error_ != base::File::FILE_OK) { + if (file_type_icon_) + return file_type_icon_.value(); const bool is_folder = async_bitmap_resolver_error_ == base::File::FILE_ERROR_NOT_A_FILE; return CreateFileTypeImageSkia(backing_file_path_, is_folder, size,
diff --git a/ash/public/cpp/holding_space/holding_space_image.h b/ash/public/cpp/holding_space/holding_space_image.h index bdcecc8..a5924969 100644 --- a/ash/public/cpp/holding_space/holding_space_image.h +++ b/ash/public/cpp/holding_space/holding_space_image.h
@@ -33,9 +33,13 @@ const gfx::Size& size, BitmapCallback callback)>; - HoldingSpaceImage(const gfx::Size& max_size, - const base::FilePath& backing_file_path, - AsyncBitmapResolver async_bitmap_resolver); + // TODO(crbug.com/1189945): Rename to FilesThumbnailImage and create a + // PlaceholderImage factory that is passed in which generates/sets images. + HoldingSpaceImage( + const gfx::Size& max_size, + const base::FilePath& backing_file_path, + AsyncBitmapResolver async_bitmap_resolver, + base::Optional<gfx::ImageSkia> file_type_icon = base::nullopt); HoldingSpaceImage(const HoldingSpaceImage&) = delete; HoldingSpaceImage& operator=(const HoldingSpaceImage&) = delete; ~HoldingSpaceImage(); @@ -45,6 +49,9 @@ static void SetUseZeroInvalidationDelayForTesting(bool value); + static gfx::ImageSkia SuperimposeOverEmptyImage(const gfx::ImageSkia& icon, + const gfx::Size& size); + bool operator==(const HoldingSpaceImage& rhs) const; // Adds `callback` to be notified of changes to the underlying `image_skia_`. @@ -104,6 +111,7 @@ gfx::ImageSkia image_skia_; gfx::ImageSkia placeholder_; + base::Optional<gfx::ImageSkia> file_type_icon_; // Timer used to throttle image invalidate requests. base::OneShotTimer invalidate_timer_;
diff --git a/ash/public/cpp/new_window_delegate.h b/ash/public/cpp/new_window_delegate.h index b9f00e6..83341eb 100644 --- a/ash/public/cpp/new_window_delegate.h +++ b/ash/public/cpp/new_window_delegate.h
@@ -36,6 +36,9 @@ // Invoked when the user uses Ctrl-N or Ctrl-Shift-N to open a new window. virtual void NewWindow(bool incognito) = 0; + // Invoked when an accelerator (calculator key) is used to open calculator. + virtual void OpenCalculator() = 0; + // Invoked when an accelerator is used to open the file manager. virtual void OpenFileManager() = 0;
diff --git a/ash/public/cpp/test/shell_test_api.h b/ash/public/cpp/test/shell_test_api.h index 2f8a01d..85e039df 100644 --- a/ash/public/cpp/test/shell_test_api.h +++ b/ash/public/cpp/test/shell_test_api.h
@@ -21,6 +21,10 @@ class DisplayManager; } +namespace ui { +class Accelerator; +} + namespace ash { enum class AppListViewState; class DragDropController; @@ -126,6 +130,13 @@ // shown. bool IsContextMenuShown() const; + // Sends accelerator directly to AcceleratorController. + bool IsActionForAcceleratorEnabled(const ui::Accelerator& accelerator) const; + bool PressAccelerator(const ui::Accelerator& accelerator); + + // Returns true when Ash HUD is shown. + bool IsHUDShown(); + private: Shell* shell_; // not owned
diff --git a/ash/public/cpp/test/test_new_window_delegate.cc b/ash/public/cpp/test/test_new_window_delegate.cc index 220a34e..64293e5 100644 --- a/ash/public/cpp/test/test_new_window_delegate.cc +++ b/ash/public/cpp/test/test_new_window_delegate.cc
@@ -15,6 +15,7 @@ void TestNewWindowDelegate::NewTabWithUrl(const GURL& url, bool from_user_interaction) {} void TestNewWindowDelegate::NewWindow(bool incognito) {} +void TestNewWindowDelegate::OpenCalculator() {} void TestNewWindowDelegate::OpenFileManager() {} void TestNewWindowDelegate::OpenDownloadsFolder() {} void TestNewWindowDelegate::OpenCrosh() {}
diff --git a/ash/public/cpp/test/test_new_window_delegate.h b/ash/public/cpp/test/test_new_window_delegate.h index 2adfd9a..de3f06b 100644 --- a/ash/public/cpp/test/test_new_window_delegate.h +++ b/ash/public/cpp/test/test_new_window_delegate.h
@@ -24,6 +24,7 @@ void NewTab() override; void NewTabWithUrl(const GURL& url, bool from_user_interaction) override; void NewWindow(bool incognito) override; + void OpenCalculator() override; void OpenFileManager() override; void OpenDownloadsFolder() override; void OpenCrosh() override;
diff --git a/ash/session/fullscreen_alert_bubble.cc b/ash/session/fullscreen_alert_bubble.cc index 812c024..e466e78f 100644 --- a/ash/session/fullscreen_alert_bubble.cc +++ b/ash/session/fullscreen_alert_bubble.cc
@@ -19,14 +19,14 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/events/event.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/background.h" #include "ui/views/controls/button/button.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/wm/core/visibility_controller.h" #include "ui/wm/core/window_animations.h"
diff --git a/ash/shelf/login_shelf_view.cc b/ash/shelf/login_shelf_view.cc index ef3e97a2..2073b8b 100644 --- a/ash/shelf/login_shelf_view.cc +++ b/ash/shelf/login_shelf_view.cc
@@ -224,6 +224,8 @@ color_provider->GetRippleAttributes(); SetInkDropBaseColor(ripple_attributes.base_color); SetInkDropVisibleOpacity(ripple_attributes.inkdrop_opacity); + views::InkDrop::UseInkDropWithoutAutoHighlight( + this, /*highlight_on_hover=*/false); // Layer rendering is required when the shelf background is visible, which // happens when the wallpaper is not blurred. @@ -259,11 +261,6 @@ canvas->DrawPath(GetButtonHighlightPath(this), flags); } - std::unique_ptr<views::InkDrop> CreateInkDrop() override { - return views::InkDrop::CreateInkDropWithoutAutoHighlight( - this, /*highlight_on_hover=*/false); - } - std::u16string GetTooltipText(const gfx::Point& p) const override { if (label()->IsDisplayTextTruncated()) return label()->GetText(); @@ -320,6 +317,8 @@ SetFocusPainter(nullptr); SetInkDropMode(InkDropMode::ON); SetHasInkDropActionOnClick(true); + views::InkDrop::UseInkDropWithoutAutoHighlight( + this, /*highlight_on_hover=*/false); const AshColorProvider::RippleAttributes ripple_attributes = AshColorProvider::Get()->GetRippleAttributes(); @@ -394,11 +393,6 @@ is_launch_enabled_ = true; } - std::unique_ptr<views::InkDrop> CreateInkDrop() override { - return views::InkDrop::CreateInkDropWithoutAutoHighlight( - this, /*highlight_on_hover=*/false); - } - void UpdateButtonColors() { SetEnabledTextColors(GetButtonTextColor()); SetImage(views::Button::STATE_NORMAL,
diff --git a/ash/shelf/shelf_button.cc b/ash/shelf/shelf_button.cc index 59247b0..74423fa 100644 --- a/ash/shelf/shelf_button.cc +++ b/ash/shelf/shelf_button.cc
@@ -31,6 +31,8 @@ SetFocusPainter(views::Painter::CreateSolidFocusPainter( ShelfConfig::Get()->shelf_focus_border_color(), kFocusBorderThickness, gfx::InsetsF())); + views::InkDrop::UseInkDropForSquareRipple(this, + /*highlight_on_hover=*/false); } ShelfButton::~ShelfButton() = default; @@ -77,10 +79,4 @@ shelf_button_delegate_->ButtonPressed(/*sender=*/this, event, GetInkDrop()); } -std::unique_ptr<views::InkDrop> ShelfButton::CreateInkDrop() { - return views::InkDrop::CreateInkDropForSquareRipple( - this, - /*highlight_on_hover=*/false); -} - } // namespace ash
diff --git a/ash/shelf/shelf_button.h b/ash/shelf/shelf_button.h index 9a95b68..c33c19c9 100644 --- a/ash/shelf/shelf_button.h +++ b/ash/shelf/shelf_button.h
@@ -24,7 +24,6 @@ void AboutToRequestFocusFromTabTraversal(bool reverse) override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; void NotifyClick(const ui::Event& event) override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; Shelf* shelf() { return shelf_; } const Shelf* shelf() const { return shelf_; }
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc index 9feebd4..6f474c77 100644 --- a/ash/shelf/shelf_layout_manager.cc +++ b/ash/shelf/shelf_layout_manager.cc
@@ -665,6 +665,14 @@ UpdateAutoHideState(); } + // When hotseat is hidden and in app shelf is shown, then a tap on the + // shelf should hide it. + if (is_shelf_window && !IsStatusAreaWindow(target) && + hotseat_state() == HotseatState::kHidden && + ShelfConfig::Get()->is_in_app()) { + UpdateAutoHideState(); + } + // Complete gesture drag when Shelf is visible in auto-hide mode. It is // called when swiping Shelf up to show. if (is_shelf_window && !IsStatusAreaWindow(target) && @@ -1344,12 +1352,9 @@ if (state_forced_by_back_gesture_) return HotseatState::kExtended; - if (visibility_state == SHELF_AUTO_HIDE) { - if (auto_hide_state == SHELF_AUTO_HIDE_HIDDEN || should_hide_hotseat_) - return HotseatState::kHidden; + if (visibility_state == SHELF_AUTO_HIDE) + return HotseatState::kHidden; - return HotseatState::kExtended; - } if (shelf_->hotseat_widget()->is_manually_extended() && !should_hide_hotseat_) { return HotseatState::kExtended;
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index ebdf832..2c3fcb6 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -1070,6 +1070,61 @@ EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); } +// Test that in tablet mode with auto hide enabled, opening a tray bubble while +// closing another keeps the hotseat hidden. +TEST_F(ShelfLayoutManagerTest, HotseatExtendingWhileClosingTrayBubble) { + TabletModeControllerTestApi().EnterTabletMode(); + ui::test::EventGenerator* generator = GetEventGenerator(); + Shelf* shelf = GetPrimaryShelf(); + StatusAreaWidget* status_area = shelf->status_area_widget(); + status_area->ime_menu_tray()->SetVisiblePreferred(true); + + // Set the shelf to be auto hidden. + shelf->SetAutoHideBehavior(ShelfAutoHideBehavior::kAlways); + EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); + EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState()); + + // Create a widget. The shelf and hotseat should become hidden. + CreateTestWidget()->GetNativeWindow(); + EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); + EXPECT_EQ(HotseatState::kHidden, GetShelfLayoutManager()->hotseat_state()); + + // Swipe up to show the auto-hide shelf, and extend the hotseat. + SwipeUpOnShelf(); + EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState()); + EXPECT_EQ(HotseatState::kExtended, GetShelfLayoutManager()->hotseat_state()); + + // Tap on the ime menu tray button, to show a tray bubble. The shelf + // should be showing, but the hotseat should be hidden. + EXPECT_FALSE(status_area->ime_menu_tray()->GetBubbleView()); + generator->GestureTapAt( + status_area->ime_menu_tray()->GetBoundsInScreen().CenterPoint()); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(status_area->ime_menu_tray()->GetBubbleView()); + EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState()); + EXPECT_EQ(HotseatState::kHidden, GetShelfLayoutManager()->hotseat_state()); + + // Tap on the unified system tray to open its bubble and close the ime menu + // bubble. The hotseat should remain in the hidden state. + EXPECT_FALSE(status_area->IsMessageBubbleShown()); + generator->GestureTapAt( + status_area->unified_system_tray()->GetBoundsInScreen().CenterPoint()); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(status_area->IsMessageBubbleShown()); + EXPECT_FALSE(status_area->ime_menu_tray()->GetBubbleView()); + EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState()); + EXPECT_EQ(HotseatState::kHidden, GetShelfLayoutManager()->hotseat_state()); + + // Check that the status bubble and shelf are hidden after tapping on the + // in-app shelf. + generator->GestureTapAt( + GetShelfWidget()->GetVisibleShelfBounds().CenterPoint()); + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(status_area->IsMessageBubbleShown()); + EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); + EXPECT_EQ(HotseatState::kHidden, GetShelfLayoutManager()->hotseat_state()); +} + // With a fullscreen window, ensure the hidden shelf is shown temporarily when // the app list is shown and when tray bubbles are shown. Ensure that the shelf // is hidden again once tray bubbles are closed.
diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h index 6d63a36..f9236911 100644 --- a/ash/shell_delegate.h +++ b/ash/shell_delegate.h
@@ -10,6 +10,7 @@ #include "ash/ash_export.h" #include "base/callback.h" +#include "base/files/file_path.h" #include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom-forward.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "services/device/public/mojom/bluetooth_system.mojom-forward.h" @@ -115,6 +116,13 @@ virtual void StartUiDevTools() {} virtual void StopUiDevTools() {} virtual int GetUiDevToolsPort() const; + + // Returns true if Chrome was started with --disable-logging-redirect option. + virtual bool IsLoggingRedirectDisabled() const = 0; + + // Returns empty path is user session has not started yet, or path to the + // primary user Downloads folder if user has already logged in. + virtual base::FilePath GetPrimaryUserDownloadsFolder() const = 0; }; } // namespace ash
diff --git a/ash/shell_test_api.cc b/ash/shell_test_api.cc index 87a3760a..8a0e1e4 100644 --- a/ash/shell_test_api.cc +++ b/ash/shell_test_api.cc
@@ -8,9 +8,11 @@ #include <utility> #include "ash/accelerators/accelerator_commands.h" +#include "ash/accelerators/accelerator_controller_impl.h" #include "ash/accelerometer/accelerometer_reader.h" #include "ash/app_list/app_list_controller_impl.h" #include "ash/app_list/views/app_list_view.h" +#include "ash/hud_display/hud_display.h" #include "ash/keyboard/keyboard_controller_impl.h" #include "ash/public/cpp/autotest_private_api_utils.h" #include "ash/public/cpp/tablet_mode_observer.h" @@ -263,4 +265,19 @@ return Shell::GetPrimaryRootWindowController()->IsContextMenuShown(); } +bool ShellTestApi::IsActionForAcceleratorEnabled( + const ui::Accelerator& accelerator) const { + return Shell::Get()->accelerator_controller()->IsActionForAcceleratorEnabled( + accelerator); +} + +bool ShellTestApi::PressAccelerator(const ui::Accelerator& accelerator) { + return Shell::Get()->accelerator_controller()->AcceleratorPressed( + accelerator); +} + +bool ShellTestApi::IsHUDShown() { + return hud_display::HUDDisplayView::IsShown(); +} + } // namespace ash
diff --git a/ash/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc b/ash/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc index 60d1d1b4..46110f1 100644 --- a/ash/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc +++ b/ash/shortcut_viewer/keyboard_shortcut_viewer_metadata.cc
@@ -84,7 +84,7 @@ case ui::VKEY_MEDIA_LAUNCH_APP1: msg_id = IDS_KSV_KEY_OVERVIEW; break; - case ui::VKEY_MEDIA_LAUNCH_APP2: + case ui::VKEY_ZOOM: msg_id = IDS_KSV_KEY_FULLSCREEN; break; case ui::VKEY_SNAPSHOT: @@ -250,7 +250,7 @@ return &kKsvBrowserForwardIcon; case ui::VKEY_BROWSER_REFRESH: return &kKsvReloadIcon; - case ui::VKEY_MEDIA_LAUNCH_APP2: + case ui::VKEY_ZOOM: return &kKsvFullscreenIcon; case ui::VKEY_MEDIA_LAUNCH_APP1: return &kKsvOverviewIcon; @@ -1204,14 +1204,14 @@ IDS_KSV_DESCRIPTION_TOGGLE_MIRROR_MODE, {}, // |accelerator_ids| - {{ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_CONTROL_DOWN}}}, + {{ui::VKEY_ZOOM, ui::EF_CONTROL_DOWN}}}, {// |categories| {ShortcutCategory::kSystemAndDisplay}, IDS_KSV_DESCRIPTION_SWAP_PRIMARY_DISPLAY, {}, // |accelerator_ids| - {{ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_ALT_DOWN}}}, + {{ui::VKEY_ZOOM, ui::EF_ALT_DOWN}}}, {// |categories| {ShortcutCategory::kSystemAndDisplay}, @@ -1274,7 +1274,7 @@ IDS_KSV_DESCRIPTION_TOGGLE_FULLSCREEN, {}, // |accelerator_ids| - {{ui::VKEY_MEDIA_LAUNCH_APP2, ui::EF_NONE}}}, + {{ui::VKEY_ZOOM, ui::EF_NONE}}}, {// |categories| {ShortcutCategory::kTabAndWindow},
diff --git a/ash/system/accessibility/autoclick_menu_view.cc b/ash/system/accessibility/autoclick_menu_view.cc index 8491555..f4f6a76 100644 --- a/ash/system/accessibility/autoclick_menu_view.cc +++ b/ash/system/accessibility/autoclick_menu_view.cc
@@ -16,6 +16,7 @@ #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/vector_icon_types.h" @@ -24,7 +25,6 @@ #include "ui/views/controls/button/button.h" #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/accessibility/autoclick_menu_view.h b/ash/system/accessibility/autoclick_menu_view.h index 74937234..723959f 100644 --- a/ash/system/accessibility/autoclick_menu_view.h +++ b/ash/system/accessibility/autoclick_menu_view.h
@@ -7,8 +7,8 @@ #include "ash/public/cpp/accessibility_controller_enums.h" #include "ash/system/tray/tray_bubble_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/layout/box_layout_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace ash {
diff --git a/ash/system/accessibility/autoclick_scroll_view.cc b/ash/system/accessibility/autoclick_scroll_view.cc index 1c583557..0957129 100644 --- a/ash/system/accessibility/autoclick_scroll_view.cc +++ b/ash/system/accessibility/autoclick_scroll_view.cc
@@ -17,14 +17,14 @@ #include "base/metrics/user_metrics.h" #include "base/timer/timer.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/vector_icon_types.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/masked_targeter_delegate.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" namespace ash {
diff --git a/ash/system/accessibility/floating_accessibility_view.cc b/ash/system/accessibility/floating_accessibility_view.cc index fc78ab4..aadd4c5b 100644 --- a/ash/system/accessibility/floating_accessibility_view.cc +++ b/ash/system/accessibility/floating_accessibility_view.cc
@@ -20,9 +20,9 @@ #include "ash/system/virtual_keyboard/virtual_keyboard_tray.h" #include "base/bind.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/accessibility/floating_accessibility_view.h b/ash/system/accessibility/floating_accessibility_view.h index 215425161..a7238551 100644 --- a/ash/system/accessibility/floating_accessibility_view.h +++ b/ash/system/accessibility/floating_accessibility_view.h
@@ -10,9 +10,9 @@ #include "ash/public/cpp/accessibility_controller_enums.h" #include "ash/shell_observer.h" #include "ash/system/tray/tray_bubble_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" #include "ui/views/layout/box_layout_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace ash {
diff --git a/ash/system/accessibility/floating_menu_button.cc b/ash/system/accessibility/floating_menu_button.cc index 4e73b6b..d23e01df 100644 --- a/ash/system/accessibility/floating_menu_button.cc +++ b/ash/system/accessibility/floating_menu_button.cc
@@ -8,6 +8,7 @@ #include "ash/system/tray/tray_popup_utils.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/vector_icon_types.h" #include "ui/gfx/vector_icon_utils.h" @@ -17,7 +18,6 @@ #include "ui/views/animation/ink_drop_impl.h" #include "ui/views/animation/ink_drop_mask.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/accessibility/floating_menu_button.h b/ash/system/accessibility/floating_menu_button.h index 6aff7ef..0c3f6d8 100644 --- a/ash/system/accessibility/floating_menu_button.h +++ b/ash/system/accessibility/floating_menu_button.h
@@ -6,9 +6,9 @@ #define ASH_SYSTEM_ACCESSIBILITY_FLOATING_MENU_BUTTON_H_ #include "ash/system/tray/tray_constants.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace gfx {
diff --git a/ash/system/accessibility/select_to_speak_menu_view.cc b/ash/system/accessibility/select_to_speak_menu_view.cc index cacaee7cf..c036616 100644 --- a/ash/system/accessibility/select_to_speak_menu_view.cc +++ b/ash/system/accessibility/select_to_speak_menu_view.cc
@@ -15,6 +15,7 @@ #include "base/bind.h" #include "base/metrics/histogram_functions.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/vector_icon_types.h" @@ -23,7 +24,6 @@ #include "ui/views/controls/button/button.h" #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/accessibility/select_to_speak_menu_view.h b/ash/system/accessibility/select_to_speak_menu_view.h index b1bbc07c..8d6a1d6e 100644 --- a/ash/system/accessibility/select_to_speak_menu_view.h +++ b/ash/system/accessibility/select_to_speak_menu_view.h
@@ -7,10 +7,10 @@ #include "ash/ash_export.h" #include "ash/public/cpp/accessibility_controller_enums.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/events/event.h" #include "ui/views/controls/button/button.h" #include "ui/views/layout/box_layout_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace ash {
diff --git a/ash/system/accessibility/select_to_speak_speed_view.cc b/ash/system/accessibility/select_to_speak_speed_view.cc index fc1ab35f..8e87701 100644 --- a/ash/system/accessibility/select_to_speak_speed_view.cc +++ b/ash/system/accessibility/select_to_speak_speed_view.cc
@@ -12,13 +12,13 @@ #include "base/bind.h" #include "base/strings/stringprintf.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/border.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/separator.h" #include "ui/views/focus/focus_manager.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/accessibility/select_to_speak_speed_view.h b/ash/system/accessibility/select_to_speak_speed_view.h index 7f534de..376b836e 100644 --- a/ash/system/accessibility/select_to_speak_speed_view.h +++ b/ash/system/accessibility/select_to_speak_speed_view.h
@@ -7,10 +7,10 @@ #include "ash/ash_export.h" #include "ash/system/tray/view_click_listener.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/events/event.h" #include "ui/views/controls/button/button.h" #include "ui/views/layout/box_layout_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace ash {
diff --git a/ash/system/accessibility/switch_access_back_button_view.cc b/ash/system/accessibility/switch_access_back_button_view.cc index 49cda44..763c5f9 100644 --- a/ash/system/accessibility/switch_access_back_button_view.cc +++ b/ash/system/accessibility/switch_access_back_button_view.cc
@@ -14,13 +14,13 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/mojom/ax_node_data.mojom-shared.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/point_f.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/accessibility/switch_access_back_button_view.h b/ash/system/accessibility/switch_access_back_button_view.h index 07eb4e5..2b23d9b 100644 --- a/ash/system/accessibility/switch_access_back_button_view.h +++ b/ash/system/accessibility/switch_access_back_button_view.h
@@ -5,8 +5,8 @@ #ifndef ASH_SYSTEM_ACCESSIBILITY_SWITCH_ACCESS_BACK_BUTTON_VIEW_H_ #define ASH_SYSTEM_ACCESSIBILITY_SWITCH_ACCESS_BACK_BUTTON_VIEW_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/layout/box_layout_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h"
diff --git a/ash/system/accessibility/switch_access_menu_button.cc b/ash/system/accessibility/switch_access_menu_button.cc index 010e216b..965a9e1 100644 --- a/ash/system/accessibility/switch_access_menu_button.cc +++ b/ash/system/accessibility/switch_access_menu_button.cc
@@ -9,6 +9,7 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/mojom/ax_node_data.mojom-shared.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/vector_icon_types.h" @@ -16,7 +17,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" namespace ash {
diff --git a/ash/system/accessibility/switch_access_menu_button.h b/ash/system/accessibility/switch_access_menu_button.h index 7b86dd6..3af0b4bb 100644 --- a/ash/system/accessibility/switch_access_menu_button.h +++ b/ash/system/accessibility/switch_access_menu_button.h
@@ -5,8 +5,8 @@ #ifndef ASH_SYSTEM_ACCESSIBILITY_SWITCH_ACCESS_MENU_BUTTON_H_ #define ASH_SYSTEM_ACCESSIBILITY_SWITCH_ACCESS_MENU_BUTTON_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace gfx {
diff --git a/ash/system/audio/mic_gain_slider_controller.cc b/ash/system/audio/mic_gain_slider_controller.cc index fc230e6..b827e9c5 100644 --- a/ash/system/audio/mic_gain_slider_controller.cc +++ b/ash/system/audio/mic_gain_slider_controller.cc
@@ -36,7 +36,7 @@ } views::View* MicGainSliderController::CreateView() { - return nullptr; + return new MicGainSliderView(this); } void MicGainSliderController::SliderValueChanged(
diff --git a/ash/system/audio/mic_gain_slider_view.cc b/ash/system/audio/mic_gain_slider_view.cc index ec929b5..bab8078d9 100644 --- a/ash/system/audio/mic_gain_slider_view.cc +++ b/ash/system/audio/mic_gain_slider_view.cc
@@ -4,16 +4,35 @@ #include "ash/system/audio/mic_gain_slider_view.h" +#include "ash/components/audio/cras_audio_handler.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/audio/mic_gain_slider_controller.h" #include "ash/system/tray/tray_constants.h" -#include "components/vector_icons/vector_icons.h" +#include "ash/system/tray/tray_popup_utils.h" #include "ui/base/l10n/l10n_util.h" #include "ui/views/layout/box_layout.h" +#include "ui/views/style/typography.h" namespace ash { +MicGainSliderView::MicGainSliderView(MicGainSliderController* controller) + : UnifiedSliderView( + base::BindRepeating(&MicGainSliderController::SliderButtonPressed, + base::Unretained(controller)), + controller, + kImeMenuMicrophoneIcon, + IDS_ASH_STATUS_TRAY_VOLUME_SLIDER_LABEL), + device_id_(CrasAudioHandler::Get()->GetPrimaryActiveInputNode()), + internal_(false) { + CrasAudioHandler::Get()->AddAudioObserver(this); + + toast_label_ = AddChildView(std::make_unique<views::Label>()); + TrayPopupUtils::SetLabelFontList(toast_label_, + TrayPopupUtils::FontStyle::kPodMenuHeader); + slider()->SetVisible(false); +} + MicGainSliderView::MicGainSliderView(MicGainSliderController* controller, uint64_t device_id, bool internal) @@ -63,6 +82,12 @@ SetVisible(true); bool is_muted = audio_handler->IsInputMuted(); float level = audio_handler->GetInputGainPercent() / 100.f; + + if (toast_label_) { + toast_label_->SetText( + l10n_util::GetStringUTF16(is_muted ? IDS_ASH_STATUS_AREA_TOAST_MIC_OFF + : IDS_ASH_STATUS_AREA_TOAST_MIC_ON)); + } // To indicate that the volume is muted, set the volume slider to the minimal // visual style. slider()->SetRenderingStyle(
diff --git a/ash/system/audio/mic_gain_slider_view.h b/ash/system/audio/mic_gain_slider_view.h index 830648c2..a80123ef 100644 --- a/ash/system/audio/mic_gain_slider_view.h +++ b/ash/system/audio/mic_gain_slider_view.h
@@ -7,6 +7,7 @@ #include "ash/components/audio/cras_audio_handler.h" #include "ash/system/unified/unified_slider_view.h" +#include "ui/views/controls/label.h" namespace ash { @@ -15,6 +16,7 @@ class MicGainSliderView : public UnifiedSliderView, public CrasAudioHandler::AudioObserver { public: + explicit MicGainSliderView(MicGainSliderController* controller); MicGainSliderView(MicGainSliderController* controller, uint64_t device_id, bool internal); @@ -33,6 +35,8 @@ private: void Update(bool by_user); + views::Label* toast_label_ = nullptr; + // device id for the input device tied to this slider. const uint64_t device_id_;
diff --git a/ash/system/dark_mode/dark_mode_detailed_view.cc b/ash/system/dark_mode/dark_mode_detailed_view.cc index 31d05dc..a181d66 100644 --- a/ash/system/dark_mode/dark_mode_detailed_view.cc +++ b/ash/system/dark_mode/dark_mode_detailed_view.cc
@@ -12,11 +12,11 @@ #include "ash/system/tray/tray_detailed_view.h" #include "ash/system/tray/tray_popup_utils.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/vector_icon_types.h" #include "ui/views/controls/button/radio_button.h" #include "ui/views/controls/button/toggle_button.h" #include "ui/views/controls/scroll_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/dark_mode/dark_mode_detailed_view.h b/ash/system/dark_mode/dark_mode_detailed_view.h index 8086969..f0c5d0f4 100644 --- a/ash/system/dark_mode/dark_mode_detailed_view.h +++ b/ash/system/dark_mode/dark_mode_detailed_view.h
@@ -6,7 +6,7 @@ #define ASH_SYSTEM_DARK_MODE_DARK_MODE_DETAILED_VIEW_H_ #include "ash/system/tray/tray_detailed_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace views { class Label;
diff --git a/ash/system/holding_space/holding_space_item_chip_view.cc b/ash/system/holding_space/holding_space_item_chip_view.cc index 15d5b8d6..5e929e1 100644 --- a/ash/system/holding_space/holding_space_item_chip_view.cc +++ b/ash/system/holding_space/holding_space_item_chip_view.cc
@@ -13,6 +13,7 @@ #include "ash/system/holding_space/holding_space_item_view.h" #include "ash/system/holding_space/holding_space_item_view_delegate.h" #include "ash/system/holding_space/holding_space_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_owner.h" #include "ui/compositor/paint_recorder.h" @@ -24,7 +25,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace {
diff --git a/ash/system/holding_space/holding_space_item_chip_view.h b/ash/system/holding_space/holding_space_item_chip_view.h index 19b92978..4a8c8319 100644 --- a/ash/system/holding_space/holding_space_item_chip_view.h +++ b/ash/system/holding_space/holding_space_item_chip_view.h
@@ -10,7 +10,7 @@ #include "ash/ash_export.h" #include "ash/public/cpp/holding_space/holding_space_image.h" #include "ash/system/holding_space/holding_space_item_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace views { class Label;
diff --git a/ash/system/holding_space/holding_space_item_chips_container.cc b/ash/system/holding_space/holding_space_item_chips_container.cc index 1c3e51d..e4dc98e 100644 --- a/ash/system/holding_space/holding_space_item_chips_container.cc +++ b/ash/system/holding_space/holding_space_item_chips_container.cc
@@ -5,9 +5,9 @@ #include "ash/system/holding_space/holding_space_item_chips_container.h" #include "ash/public/cpp/holding_space/holding_space_constants.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/layout_manager_base.h" #include "ui/views/layout/proposed_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash { namespace {
diff --git a/ash/system/holding_space/holding_space_item_chips_container.h b/ash/system/holding_space/holding_space_item_chips_container.h index 96956a7..bc0fe554 100644 --- a/ash/system/holding_space/holding_space_item_chips_container.h +++ b/ash/system/holding_space/holding_space_item_chips_container.h
@@ -6,7 +6,7 @@ #define ASH_SYSTEM_HOLDING_SPACE_HOLDING_SPACE_ITEM_CHIPS_CONTAINER_H_ #include "ash/ash_export.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace ash {
diff --git a/ash/system/holding_space/holding_space_item_screen_capture_view.cc b/ash/system/holding_space/holding_space_item_screen_capture_view.cc index 4ca1f80..fddac0c 100644 --- a/ash/system/holding_space/holding_space_item_screen_capture_view.cc +++ b/ash/system/holding_space/holding_space_item_screen_capture_view.cc
@@ -12,6 +12,7 @@ #include "ash/system/holding_space/holding_space_util.h" #include "ash/system/tray/tray_constants.h" #include "components/vector_icons/vector_icons.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/background.h" @@ -19,7 +20,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/holding_space/holding_space_item_screen_capture_view.h b/ash/system/holding_space/holding_space_item_screen_capture_view.h index 6e0734a4..1fb1680 100644 --- a/ash/system/holding_space/holding_space_item_screen_capture_view.h +++ b/ash/system/holding_space/holding_space_item_screen_capture_view.h
@@ -8,7 +8,7 @@ #include "ash/ash_export.h" #include "ash/public/cpp/holding_space/holding_space_image.h" #include "ash/system/holding_space/holding_space_item_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace views { class ImageView;
diff --git a/ash/system/holding_space/holding_space_item_view.cc b/ash/system/holding_space/holding_space_item_view.cc index 14d3a31..48bb458 100644 --- a/ash/system/holding_space/holding_space_item_view.cc +++ b/ash/system/holding_space/holding_space_item_view.cc
@@ -16,6 +16,7 @@ #include "base/bind.h" #include "ui/base/class_property.h" #include "ui/base/dragdrop/drag_drop_types.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" @@ -24,7 +25,6 @@ #include "ui/views/background.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/style/platform_style.h" #include "ui/views/vector_icons.h"
diff --git a/ash/system/holding_space/holding_space_item_view.h b/ash/system/holding_space/holding_space_item_view.h index 84ae8c0..5c55d17 100644 --- a/ash/system/holding_space/holding_space_item_view.h +++ b/ash/system/holding_space/holding_space_item_view.h
@@ -12,7 +12,7 @@ #include "ash/public/cpp/holding_space/holding_space_model_observer.h" #include "base/callback_list.h" #include "base/scoped_observation.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/ash/system/holding_space/holding_space_tray.cc b/ash/system/holding_space/holding_space_tray.cc index ac81edd..9e619e7 100644 --- a/ash/system/holding_space/holding_space_tray.cc +++ b/ash/system/holding_space/holding_space_tray.cc
@@ -35,6 +35,7 @@ #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/paint_vector_icon.h" @@ -42,7 +43,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" #include "ui/wm/core/coordinate_conversion.h"
diff --git a/ash/system/holding_space/holding_space_tray.h b/ash/system/holding_space/holding_space_tray.h index 6f73d8dc..e08adc0 100644 --- a/ash/system/holding_space/holding_space_tray.h +++ b/ash/system/holding_space/holding_space_tray.h
@@ -21,9 +21,9 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "base/timer/timer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/simple_menu_model.h" #include "ui/views/context_menu_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_observer.h"
diff --git a/ash/system/holding_space/holding_space_tray_icon.cc b/ash/system/holding_space/holding_space_tray_icon.cc index c18332a..d0799775 100644 --- a/ash/system/holding_space/holding_space_tray_icon.cc +++ b/ash/system/holding_space/holding_space_tray_icon.cc
@@ -20,13 +20,13 @@ #include "base/containers/unique_ptr_adapters.h" #include "base/stl_util.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/animation_delegate_views.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace ash {
diff --git a/ash/system/holding_space/holding_space_tray_icon.h b/ash/system/holding_space/holding_space_tray_icon.h index 25ea93b..a7a00e4 100644 --- a/ash/system/holding_space/holding_space_tray_icon.h +++ b/ash/system/holding_space/holding_space_tray_icon.h
@@ -15,7 +15,7 @@ #include "ash/shell.h" #include "ash/shell_observer.h" #include "base/scoped_observation.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace ash {
diff --git a/ash/system/ime/tray_ime_chromeos.cc b/ash/system/ime/tray_ime_chromeos.cc index 8e5e2f6a..80c12e5 100644 --- a/ash/system/ime/tray_ime_chromeos.cc +++ b/ash/system/ime/tray_ime_chromeos.cc
@@ -21,11 +21,11 @@ #include "ash/system/tray/tri_view.h" #include "base/metrics/user_metrics.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/font.h" #include "ui/gfx/image/image.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/ime/tray_ime_chromeos.h b/ash/system/ime/tray_ime_chromeos.h index 71760b7..370cc3e 100644 --- a/ash/system/ime/tray_ime_chromeos.h +++ b/ash/system/ime/tray_ime_chromeos.h
@@ -10,7 +10,7 @@ #include "ash/public/cpp/ime_info.h" #include "ash/system/ime_menu/ime_list_view.h" #include "base/macros.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace views { class ImageView;
diff --git a/ash/system/ime_menu/ime_list_view.cc b/ash/system/ime_menu/ime_list_view.cc index 35536726..22239c6 100644 --- a/ash/system/ime_menu/ime_list_view.cc +++ b/ash/system/ime_menu/ime_list_view.cc
@@ -24,6 +24,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" @@ -33,7 +34,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/separator.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/ash/system/ime_menu/ime_list_view.h b/ash/system/ime_menu/ime_list_view.h index 8cb4707..ff09ef4 100644 --- a/ash/system/ime_menu/ime_list_view.h +++ b/ash/system/ime_menu/ime_list_view.h
@@ -9,8 +9,8 @@ #include "ash/ash_export.h" #include "ash/system/tray/tray_detailed_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace ash {
diff --git a/ash/system/ime_menu/ime_menu_tray.cc b/ash/system/ime_menu/ime_menu_tray.cc index cc426f2..4ffd05e 100644 --- a/ash/system/ime_menu/ime_menu_tray.cc +++ b/ash/system/ime_menu/ime_menu_tray.cc
@@ -37,6 +37,7 @@ #include "ui/base/ime/chromeos/ime_bridge.h" #include "ui/base/ime/text_input_client.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/layer.h" #include "ui/gfx/geometry/insets.h" @@ -48,7 +49,6 @@ #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/ime_menu/ime_menu_tray.h b/ash/system/ime_menu/ime_menu_tray.h index 2690421ac..0af3014 100644 --- a/ash/system/ime_menu/ime_menu_tray.h +++ b/ash/system/ime_menu/ime_menu_tray.h
@@ -14,7 +14,7 @@ #include "ash/system/virtual_keyboard/virtual_keyboard_observer.h" #include "base/macros.h" #include "ui/base/ime/chromeos/ime_keyset.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace views { class ImageView;
diff --git a/ash/system/locale/locale_detailed_view.cc b/ash/system/locale/locale_detailed_view.cc index 160d59a..8d2fa127 100644 --- a/ash/system/locale/locale_detailed_view.cc +++ b/ash/system/locale/locale_detailed_view.cc
@@ -19,13 +19,13 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/locale/locale_detailed_view.h b/ash/system/locale/locale_detailed_view.h index 9ba5a7f..388acd2b 100644 --- a/ash/system/locale/locale_detailed_view.h +++ b/ash/system/locale/locale_detailed_view.h
@@ -10,7 +10,7 @@ #include "ash/system/tray/tray_detailed_view.h" #include "base/containers/flat_map.h" #include "base/macros.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace ash { namespace tray {
diff --git a/ash/system/network/network_list_view.cc b/ash/system/network/network_list_view.cc index 9365a06..67e018f 100644 --- a/ash/system/network/network_list_view.cc +++ b/ash/system/network/network_list_view.cc
@@ -517,10 +517,17 @@ std::u16string NetworkListView::GenerateAccessibilityLabel( const NetworkInfo& info) { - if (CanNetworkConnect(info.connection_state, info.type, info.connectable)) { + if (CanNetworkConnect(info.connection_state, info.type, info.activation_state, + info.connectable)) { return l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_NETWORK_A11Y_LABEL_CONNECT, info.label); } + + if (ShouldShowActivateCellularNetwork(info)) { + return l10n_util::GetStringFUTF16( + IDS_ASH_STATUS_TRAY_NETWORK_A11Y_LABEL_ACTIVATE, info.label); + } + return l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_NETWORK_A11Y_LABEL_OPEN, info.label); }
diff --git a/ash/system/network/network_state_list_detailed_view.cc b/ash/system/network/network_state_list_detailed_view.cc index fcfee21..2a401c7 100644 --- a/ash/system/network/network_state_list_detailed_view.cc +++ b/ash/system/network/network_state_list_detailed_view.cc
@@ -33,6 +33,7 @@ #include "ui/views/layout/layout_manager.h" #include "ui/views/widget/widget.h" +using chromeos::network_config::mojom::ActivationStateType; using chromeos::network_config::mojom::ConnectionStateType; using chromeos::network_config::mojom::DeviceStateProperties; using chromeos::network_config::mojom::DeviceStateType; @@ -96,13 +97,26 @@ bool CanNetworkConnect( chromeos::network_config::mojom::ConnectionStateType connection_state, chromeos::network_config::mojom::NetworkType type, + chromeos::network_config::mojom::ActivationStateType activation_state, bool connectable) { // Network can be connected to if the network is not connected and: // * The network is connectable or - // * The active user is primary and the network is configurable - return connection_state == ConnectionStateType::kNotConnected && - (connectable || - (!IsSecondaryUser() && NetworkTypeIsConfigurable(type))); + // * The active user is primary and the network is configurable or + // * The network is cellular and activated + if (connection_state != ConnectionStateType::kNotConnected) { + return false; + } + if (connectable) { + return true; + } + if (!IsSecondaryUser() && NetworkTypeIsConfigurable(type)) { + return true; + } + if (type == NetworkType::kCellular && + activation_state == ActivationStateType::kActivated) { + return true; + } + return false; } // A bubble which displays network info. @@ -294,8 +308,12 @@ return; } - if (network && CanNetworkConnect(network->connection_state, network->type, - network->connectable)) { + if (network && CanNetworkConnect( + network->connection_state, network->type, + network->type == NetworkType::kCellular + ? network->type_state->get_cellular()->activation_state + : ActivationStateType::kUnknown, + network->connectable)) { Shell::Get()->metrics()->RecordUserMetricsAction( list_type_ == LIST_TYPE_VPN ? UMA_STATUS_AREA_CONNECT_TO_VPN
diff --git a/ash/system/network/network_state_list_detailed_view.h b/ash/system/network/network_state_list_detailed_view.h index 55337f82..9c63ac2 100644 --- a/ash/system/network/network_state_list_detailed_view.h +++ b/ash/system/network/network_state_list_detailed_view.h
@@ -28,6 +28,7 @@ bool CanNetworkConnect( chromeos::network_config::mojom::ConnectionStateType connection_state, chromeos::network_config::mojom::NetworkType type, + chromeos::network_config::mojom::ActivationStateType activation_state, bool is_connectable); // Exported for tests.
diff --git a/ash/system/overview/overview_button_tray.cc b/ash/system/overview/overview_button_tray.cc index 953db939..2cb9f88 100644 --- a/ash/system/overview/overview_button_tray.cc +++ b/ash/system/overview/overview_button_tray.cc
@@ -22,11 +22,11 @@ #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/border.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/wm/core/window_util.h" namespace ash {
diff --git a/ash/system/overview/overview_button_tray.h b/ash/system/overview/overview_button_tray.h index 4f0df67..9a5b359 100644 --- a/ash/system/overview/overview_button_tray.h +++ b/ash/system/overview/overview_button_tray.h
@@ -12,8 +12,8 @@ #include "ash/system/tray/tray_background_view.h" #include "ash/wm/overview/overview_observer.h" #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/events/event_constants.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class ImageView;
diff --git a/ash/system/phonehub/bluetooth_disabled_view.cc b/ash/system/phonehub/bluetooth_disabled_view.cc index 45dd1285..9b3d3d2 100644 --- a/ash/system/phonehub/bluetooth_disabled_view.cc +++ b/ash/system/phonehub/bluetooth_disabled_view.cc
@@ -19,10 +19,10 @@ #include "ash/system/status_area_widget.h" #include "chromeos/components/phonehub/url_constants.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/chromeos/devicetype_utils.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/phonehub/interstitial_view_button.cc b/ash/system/phonehub/interstitial_view_button.cc index 1aa541d..763a9b0c 100644 --- a/ash/system/phonehub/interstitial_view_button.cc +++ b/ash/system/phonehub/interstitial_view_button.cc
@@ -5,8 +5,8 @@ #include "ash/system/phonehub/interstitial_view_button.h" #include "ash/system/unified/rounded_label_button.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/phonehub/notification_opt_in_view.cc b/ash/system/phonehub/notification_opt_in_view.cc index 7c245ed..73028a6 100644 --- a/ash/system/phonehub/notification_opt_in_view.cc +++ b/ash/system/phonehub/notification_opt_in_view.cc
@@ -16,6 +16,7 @@ #include "base/strings/utf_string_conversions.h" #include "chromeos/components/phonehub/notification_access_manager.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/chromeos/devicetype_utils.h" #include "ui/compositor/layer.h" #include "ui/gfx/geometry/insets.h" @@ -23,7 +24,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "url/gurl.h" namespace ash {
diff --git a/ash/system/phonehub/notification_opt_in_view.h b/ash/system/phonehub/notification_opt_in_view.h index d18747a73..40d280d 100644 --- a/ash/system/phonehub/notification_opt_in_view.h +++ b/ash/system/phonehub/notification_opt_in_view.h
@@ -9,8 +9,8 @@ #include "ash/system/phonehub/interstitial_view_button.h" #include "base/scoped_observation.h" #include "chromeos/components/phonehub/notification_access_manager.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/ash/system/phonehub/onboarding_view.cc b/ash/system/phonehub/onboarding_view.cc index 5ef1888..ebe7f9c 100644 --- a/ash/system/phonehub/onboarding_view.cc +++ b/ash/system/phonehub/onboarding_view.cc
@@ -28,10 +28,10 @@ #include "base/strings/strcat.h" #include "chromeos/components/phonehub/onboarding_ui_tracker.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/chromeos/devicetype_utils.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/phonehub/onboarding_view.h b/ash/system/phonehub/onboarding_view.h index dbf5de5..e96d812 100644 --- a/ash/system/phonehub/onboarding_view.h +++ b/ash/system/phonehub/onboarding_view.h
@@ -10,8 +10,8 @@ #include "ash/ash_export.h" #include "ash/system/phonehub/phone_hub_content_view.h" #include "ash/system/tray/tray_bubble_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace chromeos {
diff --git a/ash/system/phonehub/phone_connecting_view.cc b/ash/system/phonehub/phone_connecting_view.cc index d1f7964..246bef0 100644 --- a/ash/system/phonehub/phone_connecting_view.cc +++ b/ash/system/phonehub/phone_connecting_view.cc
@@ -14,9 +14,9 @@ #include "ash/system/phonehub/phone_hub_metrics.h" #include "ash/system/phonehub/phone_hub_view_ids.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/phonehub/phone_connecting_view.h b/ash/system/phonehub/phone_connecting_view.h index 199125f..3f74c77 100644 --- a/ash/system/phonehub/phone_connecting_view.h +++ b/ash/system/phonehub/phone_connecting_view.h
@@ -7,7 +7,7 @@ #include "ash/ash_export.h" #include "ash/system/phonehub/phone_hub_content_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace ash {
diff --git a/ash/system/phonehub/phone_disconnected_view.cc b/ash/system/phonehub/phone_disconnected_view.cc index 3b455d4..7f21898b 100644 --- a/ash/system/phonehub/phone_disconnected_view.cc +++ b/ash/system/phonehub/phone_disconnected_view.cc
@@ -18,9 +18,9 @@ #include "chromeos/components/phonehub/connection_scheduler.h" #include "chromeos/components/phonehub/url_constants.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/phonehub/phone_hub_interstitial_view.cc b/ash/system/phonehub/phone_hub_interstitial_view.cc index 2a027b1c..139ba78 100644 --- a/ash/system/phonehub/phone_hub_interstitial_view.cc +++ b/ash/system/phonehub/phone_hub_interstitial_view.cc
@@ -17,6 +17,7 @@ #include "ash/system/unified/rounded_label_button.h" #include "skia/ext/image_operations.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/layer.h" #include "ui/gfx/geometry/insets.h" @@ -28,7 +29,6 @@ #include "ui/views/controls/progress_bar.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/phonehub/phone_hub_interstitial_view.h b/ash/system/phonehub/phone_hub_interstitial_view.h index 2c3fa20..93350f3 100644 --- a/ash/system/phonehub/phone_hub_interstitial_view.h +++ b/ash/system/phonehub/phone_hub_interstitial_view.h
@@ -9,8 +9,8 @@ #include "ash/ash_export.h" #include "ash/system/phonehub/phone_hub_content_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/progress_bar.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/ash/system/phonehub/tether_connection_pending_view.cc b/ash/system/phonehub/tether_connection_pending_view.cc index e0bf1f8..58365a11e 100644 --- a/ash/system/phonehub/tether_connection_pending_view.cc +++ b/ash/system/phonehub/tether_connection_pending_view.cc
@@ -14,9 +14,9 @@ #include "ash/system/phonehub/phone_hub_metrics.h" #include "ash/system/phonehub/phone_hub_view_ids.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/system/phonehub/tether_connection_pending_view.h b/ash/system/phonehub/tether_connection_pending_view.h index 9f20590b3..0a4c1886 100644 --- a/ash/system/phonehub/tether_connection_pending_view.h +++ b/ash/system/phonehub/tether_connection_pending_view.h
@@ -7,7 +7,7 @@ #include "ash/ash_export.h" #include "ash/system/phonehub/phone_hub_content_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace ash {
diff --git a/ash/system/tray/actionable_view.cc b/ash/system/tray/actionable_view.cc index c6f338f6..50ea80e 100644 --- a/ash/system/tray/actionable_view.cc +++ b/ash/system/tray/actionable_view.cc
@@ -5,6 +5,7 @@ #include "ash/system/tray/actionable_view.h" #include "ash/system/tray/tray_popup_utils.h" +#include "base/bind.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/events/keycodes/keyboard_codes.h" @@ -33,6 +34,9 @@ SetInstallFocusRingOnFocus(false); SetFocusPainter(TrayPopupUtils::CreateFocusPainter()); TrayPopupUtils::InstallHighlightPathGenerator(this, ink_drop_style_); + SetCreateInkDropCallback(base::BindRepeating( + [](InkDropHostView* host) { return TrayPopupUtils::CreateInkDrop(host); }, + this)); } ActionableView::~ActionableView() { @@ -64,9 +68,6 @@ node_data->SetName(GetAccessibleName()); } -std::unique_ptr<views::InkDrop> ActionableView::CreateInkDrop() { - return TrayPopupUtils::CreateInkDrop(this); -} std::unique_ptr<views::InkDropRipple> ActionableView::CreateInkDropRipple() const {
diff --git a/ash/system/tray/actionable_view.h b/ash/system/tray/actionable_view.h index fba278e6..d5122b52 100644 --- a/ash/system/tray/actionable_view.h +++ b/ash/system/tray/actionable_view.h
@@ -48,7 +48,6 @@ const char* GetClassName() const override; bool OnKeyPressed(const ui::KeyEvent& event) override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() const override;
diff --git a/ash/system/tray/tray_background_view.cc b/ash/system/tray/tray_background_view.cc index 9a95134b..f9b6f417 100644 --- a/ash/system/tray/tray_background_view.cc +++ b/ash/system/tray/tray_background_view.cc
@@ -30,6 +30,7 @@ #include "base/time/time.h" #include "ui/accessibility/ax_node_data.h" #include "ui/aura/window.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_element.h" #include "ui/compositor/layer_animation_sequence.h" @@ -48,7 +49,6 @@ #include "ui/views/background.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h"
diff --git a/ash/system/tray/tray_bubble_view.cc b/ash/system/tray/tray_bubble_view.cc index 3cc4bd6..85beffb 100644 --- a/ash/system/tray/tray_bubble_view.cc +++ b/ash/system/tray/tray_bubble_view.cc
@@ -22,6 +22,7 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/aura/env.h" #include "ui/aura/window.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_type.h" #include "ui/events/event.h" @@ -32,7 +33,6 @@ #include "ui/gfx/skia_util.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/views_delegate.h" #include "ui/wm/core/shadow_types.h" @@ -323,7 +323,7 @@ } gfx::Insets TrayBubbleView::GetBorderInsets() const { - return bubble_border_->GetInsets(); + return bubble_border_ ? bubble_border_->GetInsets() : gfx::Insets(); } void TrayBubbleView::ResetDelegate() { @@ -487,7 +487,8 @@ } void TrayBubbleView::SetBubbleBorderInsets(gfx::Insets insets) { - bubble_border_->set_insets(insets); + if (bubble_border_) + bubble_border_->set_insets(insets); } void TrayBubbleView::CloseBubbleView() {
diff --git a/ash/system/tray/tray_bubble_view.h b/ash/system/tray/tray_bubble_view.h index 51359a1..5b54fef 100644 --- a/ash/system/tray/tray_bubble_view.h +++ b/ash/system/tray/tray_bubble_view.h
@@ -13,12 +13,12 @@ #include "base/macros.h" #include "base/optional.h" #include "ui/accessibility/ax_enums.mojom-forward.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/events/event.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/mouse_watcher.h"
diff --git a/ash/system/unified/page_indicator_view.cc b/ash/system/unified/page_indicator_view.cc index 773cf01..e307bb8 100644 --- a/ash/system/unified/page_indicator_view.cc +++ b/ash/system/unified/page_indicator_view.cc
@@ -13,6 +13,7 @@ #include "ash/style/ash_color_provider.h" #include "ash/system/tray/tray_popup_utils.h" #include "ash/system/unified/unified_system_tray_controller.h" +#include "base/bind.h" #include "base/i18n/number_formatting.h" #include "base/macros.h" #include "base/metrics/histogram_macros.h" @@ -53,6 +54,12 @@ SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY); SetInkDropMode(InkDropMode::ON); views::InstallFixedSizeCircleHighlightPathGenerator(this, kInkDropRadius); + SetCreateInkDropCallback(base::BindRepeating( + [](InkDropHostView* host) { + return TrayPopupUtils::CreateInkDrop(host, + /*highlight_on_hover=*/true); + }, + this)); } ~PageIndicatorButton() override {} @@ -106,10 +113,6 @@ protected: // views::Button: - std::unique_ptr<views::InkDrop> CreateInkDrop() override { - return TrayPopupUtils::CreateInkDrop(this, /*highlight_on_hover=*/true); - } - std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override { gfx::Point center = GetLocalBounds().CenterPoint(); gfx::Rect bounds(center.x() - kInkDropRadius, center.y() - kInkDropRadius,
diff --git a/ash/system/unified/unified_slider_bubble_controller.cc b/ash/system/unified/unified_slider_bubble_controller.cc index b52bdde..1460c820 100644 --- a/ash/system/unified/unified_slider_bubble_controller.cc +++ b/ash/system/unified/unified_slider_bubble_controller.cc
@@ -8,6 +8,7 @@ #include "ash/session/session_controller_impl.h" #include "ash/shelf/shelf.h" #include "ash/shell.h" +#include "ash/system/audio/mic_gain_slider_controller.h" #include "ash/system/brightness/unified_brightness_slider_controller.h" #include "ash/system/keyboard_brightness/unified_keyboard_brightness_slider_controller.h" #include "ash/system/status_area_widget.h" @@ -97,6 +98,10 @@ ShowBubble(SLIDER_TYPE_VOLUME); } +void UnifiedSliderBubbleController::OnInputMuteChanged(bool mute_on) { + ShowBubble(SLIDER_TYPE_MIC); +} + void UnifiedSliderBubbleController::OnDisplayBrightnessChanged(bool by_user) { if (by_user) ShowBubble(SLIDER_TYPE_DISPLAY_BRIGHTNESS); @@ -215,6 +220,8 @@ std::make_unique<UnifiedKeyboardBrightnessSliderController>( tray_->model()); return; + case SLIDER_TYPE_MIC: + slider_controller_ = std::make_unique<MicGainSliderController>(); } }
diff --git a/ash/system/unified/unified_slider_bubble_controller.h b/ash/system/unified/unified_slider_bubble_controller.h index 91fb9aa..827a7387 100644 --- a/ash/system/unified/unified_slider_bubble_controller.h +++ b/ash/system/unified/unified_slider_bubble_controller.h
@@ -30,7 +30,8 @@ enum SliderType { SLIDER_TYPE_VOLUME = 0, SLIDER_TYPE_DISPLAY_BRIGHTNESS, - SLIDER_TYPE_KEYBOARD_BRIGHTNESS + SLIDER_TYPE_KEYBOARD_BRIGHTNESS, + SLIDER_TYPE_MIC }; explicit UnifiedSliderBubbleController(UnifiedSystemTray* tray); @@ -53,6 +54,7 @@ // CrasAudioHandler::AudioObserver: void OnOutputNodeVolumeChanged(uint64_t node_id, int volume) override; void OnOutputMuteChanged(bool mute_on) override; + void OnInputMuteChanged(bool mute_on) override; // UnifiedSystemTrayModel::Observer: void OnDisplayBrightnessChanged(bool by_user) override;
diff --git a/ash/test_shell_delegate.cc b/ash/test_shell_delegate.cc index a508bd2..074690b 100644 --- a/ash/test_shell_delegate.cc +++ b/ash/test_shell_delegate.cc
@@ -86,4 +86,12 @@ session_restore_in_progress_ = in_progress; } +bool TestShellDelegate::IsLoggingRedirectDisabled() const { + return false; +} + +base::FilePath TestShellDelegate::GetPrimaryUserDownloadsFolder() const { + return base::FilePath(); +} + } // namespace ash
diff --git a/ash/test_shell_delegate.h b/ash/test_shell_delegate.h index b288e27..638bc57 100644 --- a/ash/test_shell_delegate.h +++ b/ash/test_shell_delegate.h
@@ -52,6 +52,8 @@ void SetCanGoBack(bool can_go_back); void SetShouldWaitForTouchAck(bool should_wait_for_touch_ack); void SetSessionRestoreInProgress(bool in_progress); + bool IsLoggingRedirectDisabled() const override; + base::FilePath GetPrimaryUserDownloadsFolder() const override; private: // True if the current top window can go back.
diff --git a/ash/wallpaper/wallpaper_base_view.cc b/ash/wallpaper/wallpaper_base_view.cc index 0da8adc..7882fd1 100644 --- a/ash/wallpaper/wallpaper_base_view.cc +++ b/ash/wallpaper/wallpaper_base_view.cc
@@ -10,8 +10,8 @@ #include "ash/style/ash_color_provider.h" #include "ash/wallpaper/wallpaper_controller_impl.h" #include "base/numerics/safe_conversions.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/wm/cursor_manager_chromeos.cc b/ash/wm/cursor_manager_chromeos.cc index dd59927..6389c54 100644 --- a/ash/wm/cursor_manager_chromeos.cc +++ b/ash/wm/cursor_manager_chromeos.cc
@@ -70,6 +70,7 @@ case ui::VKEY_KBD_BRIGHTNESS_UP: case ui::VKEY_KBD_BRIGHTNESS_DOWN: case ui::VKEY_PRIVACY_SCREEN_TOGGLE: + case ui::VKEY_ZOOM: return false; default: return true;
diff --git a/ash/wm/desks/close_desk_button.cc b/ash/wm/desks/close_desk_button.cc index 15f2b40..35514ea 100644 --- a/ash/wm/desks/close_desk_button.cc +++ b/ash/wm/desks/close_desk_button.cc
@@ -29,6 +29,7 @@ SetInkDropMode(InkDropMode::ON); SetHasInkDropActionOnClick(true); + views::InkDrop::UseInkDropForFloodFillRipple(this); SetFocusPainter(nullptr); SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY); @@ -43,10 +44,6 @@ return "CloseDeskButton"; } -std::unique_ptr<views::InkDrop> CloseDeskButton::CreateInkDrop() { - return views::InkDrop::CreateInkDropForFloodFillRipple(this); -} - std::unique_ptr<views::InkDropHighlight> CloseDeskButton::CreateInkDropHighlight() const { auto highlight = std::make_unique<views::InkDropHighlight>(
diff --git a/ash/wm/desks/close_desk_button.h b/ash/wm/desks/close_desk_button.h index 7168998..72d2c36d 100644 --- a/ash/wm/desks/close_desk_button.h +++ b/ash/wm/desks/close_desk_button.h
@@ -28,7 +28,6 @@ // views::ImageButton: const char* GetClassName() const override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() const override; SkColor GetInkDropBaseColor() const override;
diff --git a/ash/wm/desks/zero_state_button.cc b/ash/wm/desks/zero_state_button.cc index 8182db2..0748ade 100644 --- a/ash/wm/desks/zero_state_button.cc +++ b/ash/wm/desks/zero_state_button.cc
@@ -13,6 +13,7 @@ #include "ash/wm/desks/desks_bar_view.h" #include "ash/wm/desks/desks_controller.h" #include "ash/wm/wm_highlight_item_border.h" +#include "base/bind.h" #include "ui/base/l10n/l10n_util.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" @@ -53,6 +54,11 @@ layer()->SetFillsBoundsOpaquely(false); SetHorizontalAlignment(gfx::ALIGN_CENTER); + // Do not show highlight on hover and focus. Since the button will be painted + // with a background, see |highlight_on_hover_| for more details. + views::InkDrop::UseInkDropForFloodFillRipple(this, + /*highlight_on_hover=*/false, + /*highlight_on_focus=*/false); SetInkDropMode(InkDropMode::ON); SetHasInkDropActionOnClick(true); SetFocusPainter(nullptr); @@ -89,15 +95,6 @@ } } -std::unique_ptr<views::InkDrop> DeskButtonBase::CreateInkDrop() { - // Do not show highlight on hover and focus. Since the button will be painted - // with a background, see |highlight_on_hover_| for more details. - return views::InkDrop::CreateInkDropForFloodFillRipple( - this, - /*highlight_on_hover=*/false, - /*highlight_on_focus=*/false); -} - std::unique_ptr<views::InkDropHighlight> DeskButtonBase::CreateInkDropHighlight() const { auto highlight = std::make_unique<views::InkDropHighlight>(
diff --git a/ash/wm/desks/zero_state_button.h b/ash/wm/desks/zero_state_button.h index 749cf30a..633efb09 100644 --- a/ash/wm/desks/zero_state_button.h +++ b/ash/wm/desks/zero_state_button.h
@@ -28,7 +28,6 @@ // LabelButton: const char* GetClassName() const override; void OnPaintBackground(gfx::Canvas* canvas) override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() const override; SkColor GetInkDropBaseColor() const override;
diff --git a/ash/wm/full_restore/full_restore_controller.cc b/ash/wm/full_restore/full_restore_controller.cc index 8eb8717..141380b7 100644 --- a/ash/wm/full_restore/full_restore_controller.cc +++ b/ash/wm/full_restore/full_restore_controller.cc
@@ -67,25 +67,26 @@ DCHECK(window->parent()); auto siblings = window->parent()->children(); #if DCHECK_IS_ON() - // Verify that the activation keys are descending and that non-restored - // windows are all at the end. - for (int i = 0; i < int{siblings.size()} - 2; ++i) { + // Verify that the activation keys are descending. Non-restored windows may be + // stacked in certain ways by other window manager features so there may be + // non-restored windows at any point but the windows that have the + // `full_restore::kActivationIndexKey` should be in relative descending order. + base::Optional<int32_t> last_activation_key; + for (size_t i = 0; i < siblings.size(); ++i) { + // The current window needs to be stacked, so there is a chance it is + // initially out of order. + if (window == siblings[i]) + continue; + int32_t* current_activation_key = siblings[i]->GetProperty(full_restore::kActivationIndexKey); - size_t next_index = i + 1; - int32_t* next_activation_key = - siblings[next_index]->GetProperty(full_restore::kActivationIndexKey); + if (!current_activation_key) + continue; - const bool descending_order = - current_activation_key && - (!next_activation_key || - *current_activation_key > *next_activation_key); - const bool both_null = !current_activation_key && !next_activation_key; - - DCHECK(descending_order || both_null); + if (last_activation_key) + DCHECK_LT(*current_activation_key, *last_activation_key); + last_activation_key = *current_activation_key; } - - DCHECK_EQ(siblings.back(), window); #endif int32_t* restore_activation_key = @@ -200,11 +201,6 @@ } } - int32_t* activation_index = - window->GetProperty(full_restore::kActivationIndexKey); - if (!activation_index) - return; - // Window that are launched from full restore are not activatable initially to // prevent them from taking activation when Widget::Show() is called. Make // these windows activatable once they are launched. Use a post task since it @@ -221,6 +217,11 @@ }, window)); + int32_t* activation_index = + window->GetProperty(full_restore::kActivationIndexKey); + if (!activation_index) + return; + // Stack the window. auto* target_sibling = GetSiblingToStackBelow(window); if (target_sibling) { @@ -304,8 +305,12 @@ gfx::Rect* override_bounds = window->GetProperty(kRestoreBoundsOverrideKey); if (override_bounds) { window_info.current_bounds = *override_bounds; + // Snapped state can be restored from tablet onto clamshell, so we do not + // use the restore override state here. window_info.window_state_type = - window->GetProperty(kRestoreWindowStateTypeOverrideKey); + window_state->IsSnapped() + ? window_state->GetStateType() + : window->GetProperty(kRestoreWindowStateTypeOverrideKey); } else { // If there are restore bounds, use those as current bounds. On restore, for // states with restore bounds (maximized, minimized, snapped, etc), they @@ -317,7 +322,7 @@ // Full restore does not support restoring fullscreen windows. If a window // is fullscreen save the pre-fullscreen window state instead. window_info.window_state_type = - window_state->IsInImmersiveFullscreen() + window_state->IsFullscreen() ? chromeos::ToWindowStateType( window->GetProperty(aura::client::kPreFullscreenShowStateKey)) : window_state->GetStateType();
diff --git a/ash/wm/full_restore/full_restore_controller_unittest.cc b/ash/wm/full_restore/full_restore_controller_unittest.cc index ba25e4a..c60ca69 100644 --- a/ash/wm/full_restore/full_restore_controller_unittest.cc +++ b/ash/wm/full_restore/full_restore_controller_unittest.cc
@@ -691,11 +691,37 @@ window_2, window_1}); } +// Tests that the splitview data in tablet is saved properly. +TEST_F(FullRestoreControllerTest, TabletSplitviewWindow) { + TabletModeControllerTestApi().EnterTabletMode(); + + const gfx::Rect bounds(300, 300); + auto window1 = CreateAppWindow(gfx::Rect(300, 300), AppType::BROWSER); + auto window2 = CreateAppWindow(gfx::Rect(300, 300), AppType::BROWSER); + + auto* split_view_controller = + SplitViewController::Get(Shell::GetPrimaryRootWindow()); + split_view_controller->SnapWindow(window1.get(), SplitViewController::LEFT); + split_view_controller->SnapWindow(window2.get(), SplitViewController::RIGHT); + + full_restore::WindowInfo* window1_info = GetWindowInfo(window1.get()); + full_restore::WindowInfo* window2_info = GetWindowInfo(window2.get()); + ASSERT_TRUE(window1_info); + ASSERT_TRUE(window2_info); + ASSERT_TRUE(window1_info->window_state_type); + ASSERT_TRUE(window2_info->window_state_type); + + EXPECT_EQ(chromeos::WindowStateType::kLeftSnapped, + *window1_info->window_state_type); + EXPECT_EQ(chromeos::WindowStateType::kRightSnapped, + *window2_info->window_state_type); + EXPECT_EQ(bounds, *window1_info->current_bounds); + EXPECT_EQ(bounds, *window2_info->current_bounds); +} + // Tests tablet snapped window functionality when creating a window from full // restore. TEST_F(FullRestoreControllerTest, TabletSnapWindow) { - UpdateDisplay("800x800"); - // Add two entries to our fake full restore file, one snapped left and the // other snapped right. const gfx::Rect restored_bounds(200, 200);
diff --git a/ash/wm/gestures/wm_gesture_handler.cc b/ash/wm/gestures/wm_gesture_handler.cc index d032ca8..e406e76 100644 --- a/ash/wm/gestures/wm_gesture_handler.cc +++ b/ash/wm/gestures/wm_gesture_handler.cc
@@ -183,6 +183,16 @@ // Disable touchpad swipe when screen is pinned. if (Shell::Get()->screen_pinning_controller()->IsPinned()) return false; + + // Also disable horizontal touchpad swipe when alt-tab is open. See + // crbug.com/1204345. + float delta_x = event.x_offset(); + float delta_y = event.y_offset(); + if (Shell::Get()->window_cycle_controller()->IsWindowListVisible() && + std::fabs(delta_x) > std::fabs(delta_y)) { + return false; + } + // ET_SCROLL_FLING_CANCEL means a touchpad swipe has started. if (event.type() == ui::ET_SCROLL_FLING_CANCEL) { scroll_data_ = ScrollData(); @@ -197,8 +207,7 @@ } DCHECK_EQ(ui::ET_SCROLL, event.type()); - return ProcessEventImpl(event.finger_count(), event.x_offset(), - event.y_offset()); + return ProcessEventImpl(event.finger_count(), delta_x, delta_y); } bool WmGestureHandler::ProcessEventImpl(int finger_count,
diff --git a/ash/wm/overview/overview_item_view.cc b/ash/wm/overview/overview_item_view.cc index 2573728..75da1c8 100644 --- a/ash/wm/overview/overview_item_view.cc +++ b/ash/wm/overview/overview_item_view.cc
@@ -89,6 +89,7 @@ explicit OverviewCloseButton(PressedCallback callback) : views::ImageButton(std::move(callback)) { SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER); + views::InkDrop::UseInkDropForFloodFillRipple(this); SetImageHorizontalAlignment(views::ImageButton::ALIGN_CENTER); SetImageVerticalAlignment(views::ImageButton::ALIGN_MIDDLE); SetMinimumImageSize(gfx::Size(kHeaderHeightDp, kHeaderHeightDp)); @@ -107,11 +108,6 @@ void ResetListener() { SetCallback(views::Button::PressedCallback()); } protected: - // views::Button: - std::unique_ptr<views::InkDrop> CreateInkDrop() override { - return views::InkDrop::CreateInkDropForFloodFillRipple(this); - } - // views::ImageButton: void OnThemeChanged() override { views::ImageButton::OnThemeChanged();
diff --git a/ash/wm/window_cycle/window_cycle_controller_unittest.cc b/ash/wm/window_cycle/window_cycle_controller_unittest.cc index 7e3f4ed..41e61fc 100644 --- a/ash/wm/window_cycle/window_cycle_controller_unittest.cc +++ b/ash/wm/window_cycle/window_cycle_controller_unittest.cc
@@ -37,6 +37,8 @@ #include "ash/wm/desks/desks_test_util.h" #include "ash/wm/gestures/wm_gesture_handler.h" #include "ash/wm/overview/overview_controller.h" +#include "ash/wm/overview/overview_highlight_controller.h" +#include "ash/wm/overview/overview_session.h" #include "ash/wm/overview/overview_test_util.h" #include "ash/wm/tablet_mode/tablet_mode_controller_test_api.h" #include "ash/wm/window_cycle/window_cycle_event_filter.h" @@ -1427,20 +1429,22 @@ scroll_until_window_highlighted_and_confirm(horizontal_scroll, 0); EXPECT_TRUE(wm::IsActiveWindow(window2.get())); - // Open an overview session and window cycle list. Scroll right to second - // item. Scroll should only go to the window cycle list. - // Current order is [2,4,5,3,1]. + // Open an overview session. Shell::Get()->overview_controller()->StartOverview(); EXPECT_TRUE(InOverviewSession()); + // Open the window cycle list. Scroll right to second item. Scroll should only + // go to the window cycle list so the overview focus should not be visible. + // Current order is [2,4,5,3,1]. auto* cycle_controller = Shell::Get()->window_cycle_controller(); cycle_controller->StartCycling(); Scroll(GetOffsetX(horizontal_scroll), 0, kNumFingersForTrackpad); - - // TODO(crbug.com/1204345): Input events are currently incorrectly handled by - // both the overview session and the window cycle list. Once that bug has been - // fixed, this test should verify that GetOverviewHighlightedWindow() returns - // nullptr. + EXPECT_TRUE(InOverviewSession()); + EXPECT_FALSE(Shell::Get() + ->overview_controller() + ->overview_session() + ->highlight_controller() + ->IsFocusHighlightVisible()); CompleteCycling(cycle_controller); EXPECT_FALSE(InOverviewSession());
diff --git a/ash/wm/window_cycle/window_cycle_tab_slider.cc b/ash/wm/window_cycle/window_cycle_tab_slider.cc index 70e68f6..d6ea58247 100644 --- a/ash/wm/window_cycle/window_cycle_tab_slider.cc +++ b/ash/wm/window_cycle/window_cycle_tab_slider.cc
@@ -14,6 +14,7 @@ #include "base/strings/utf_string_conversions.h" #include "components/prefs/pref_service.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/canvas.h" @@ -22,7 +23,6 @@ #include "ui/views/background.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/wm/window_cycle/window_cycle_tab_slider.h b/ash/wm/window_cycle/window_cycle_tab_slider.h index def89e09..329d37a 100644 --- a/ash/wm/window_cycle/window_cycle_tab_slider.h +++ b/ash/wm/window_cycle/window_cycle_tab_slider.h
@@ -8,7 +8,7 @@ #include "ash/ash_export.h" #include "ash/wm/window_cycle/window_cycle_tab_slider_button.h" #include "ash/wm/wm_highlight_item_border.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace gfx { class Size;
diff --git a/ash/wm/window_cycle/window_cycle_tab_slider_button.cc b/ash/wm/window_cycle/window_cycle_tab_slider_button.cc index d151b25..2756d83 100644 --- a/ash/wm/window_cycle/window_cycle_tab_slider_button.cc +++ b/ash/wm/window_cycle/window_cycle_tab_slider_button.cc
@@ -6,11 +6,11 @@ #include "ash/style/ash_color_provider.h" #include "base/strings/utf_string_conversions.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/views/background.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/ash/wm/window_cycle/window_cycle_tab_slider_button.h b/ash/wm/window_cycle/window_cycle_tab_slider_button.h index 4dc7cdd..4190878 100644 --- a/ash/wm/window_cycle/window_cycle_tab_slider_button.h +++ b/ash/wm/window_cycle/window_cycle_tab_slider_button.h
@@ -6,8 +6,8 @@ #define ASH_WM_WINDOW_CYCLE_WINDOW_CYCLE_TAB_SLIDER_BUTTON_H_ #include "ash/ash_export.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace ash {
diff --git a/base/BUILD.gn b/base/BUILD.gn index 59dae84..3deef35 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -4165,6 +4165,7 @@ "test/android/junit/src/org/chromium/base/task/test/CustomShadowAsyncTask.java", "test/android/junit/src/org/chromium/base/task/test/ShadowPostTask.java", "test/android/junit/src/org/chromium/base/test/BaseRobolectricTestRunner.java", + "test/android/junit/src/org/chromium/base/test/ShadowBuildInfo.java", "test/android/junit/src/org/chromium/base/test/util/TestRunnerTestRule.java", ]
diff --git a/base/json/json_parser_unittest.cc b/base/json/json_parser_unittest.cc index 0c278c97..4261473 100644 --- a/base/json/json_parser_unittest.cc +++ b/base/json/json_parser_unittest.cc
@@ -165,9 +165,8 @@ TestLastThree(parser.get()); ASSERT_TRUE(value); - double number_d; - EXPECT_TRUE(value->GetAsDouble(&number_d)); - EXPECT_EQ(12.34, number_d); + ASSERT_TRUE(value->is_double()); + EXPECT_EQ(12.34, value->GetDouble()); // Scientific. input = "42e3,|"; @@ -178,8 +177,8 @@ TestLastThree(parser.get()); ASSERT_TRUE(value); - EXPECT_TRUE(value->GetAsDouble(&number_d)); - EXPECT_EQ(42000, number_d); + ASSERT_TRUE(value->is_double()); + EXPECT_EQ(42000, value->GetDouble()); // Negative scientific. input = "314159e-5,|"; @@ -190,8 +189,8 @@ TestLastThree(parser.get()); ASSERT_TRUE(value); - EXPECT_TRUE(value->GetAsDouble(&number_d)); - EXPECT_EQ(3.14159, number_d); + ASSERT_TRUE(value->is_double()); + EXPECT_EQ(3.14159, value->GetDouble()); // Positive scientific. input = "0.42e+3,|"; @@ -202,8 +201,8 @@ TestLastThree(parser.get()); ASSERT_TRUE(value); - EXPECT_TRUE(value->GetAsDouble(&number_d)); - EXPECT_EQ(420, number_d); + ASSERT_TRUE(value->is_double()); + EXPECT_EQ(420, value->GetDouble()); } TEST_F(JSONParserTest, ErrorMessages) {
diff --git a/base/logging.cc b/base/logging.cc index 782de98d..48886b30 100644 --- a/base/logging.cc +++ b/base/logging.cc
@@ -195,7 +195,7 @@ } // A log message handler that gets notified of every log message we process. -LogMessageHandlerFunction log_message_handler = nullptr; +LogMessageHandlerFunction g_log_message_handler = nullptr; uint64_t TickCount() { #if defined(OS_WIN) @@ -478,7 +478,7 @@ return false; // Return true here unless we know ~LogMessage won't do anything. - return g_logging_destination != LOG_NONE || log_message_handler || + return g_logging_destination != LOG_NONE || g_log_message_handler || severity >= kAlwaysPrintErrorLevel; } @@ -536,11 +536,11 @@ } void SetLogMessageHandler(LogMessageHandlerFunction handler) { - log_message_handler = handler; + g_log_message_handler = handler; } LogMessageHandlerFunction GetLogMessageHandler() { - return log_message_handler; + return g_log_message_handler; } #if !defined(NDEBUG) @@ -608,9 +608,9 @@ file_, base::StringPiece(str_newline).substr(message_start_), line_); // Give any log message handler first dibs on the message. - if (log_message_handler && - log_message_handler(severity_, file_, line_, - message_start_, str_newline)) { + if (g_log_message_handler && + g_log_message_handler(severity_, file_, line_, message_start_, + str_newline)) { // The handler took care of it, no further processing. return; } @@ -1058,28 +1058,45 @@ // Used for testing. Declared in test/scoped_logging_settings.h. ScopedLoggingSettings::ScopedLoggingSettings() - : enable_process_id_(g_log_process_id), + : min_log_level_(g_min_log_level), + logging_destination_(g_logging_destination), +#if BUILDFLAG(IS_CHROMEOS_ASH) + log_format_(g_log_format), +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + enable_process_id_(g_log_process_id), enable_thread_id_(g_log_thread_id), enable_timestamp_(g_log_timestamp), enable_tickcount_(g_log_tickcount), - min_log_level_(GetMinLogLevel()), - message_handler_(GetLogMessageHandler()) { -#if BUILDFLAG(IS_CHROMEOS_ASH) - log_format_ = g_log_format; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) + log_prefix_(g_log_prefix), + message_handler_(g_log_message_handler) { + if (g_log_file_name) + log_file_name_ = std::make_unique<PathString>(*g_log_file_name); + // Duplicating |g_log_file| is complex & unnecessary for this test helpers' + // use-cases, and so long as |g_log_file_name| is set, it will be re-opened + // automatically anyway, when required, so just close the existing one. + if (g_log_file) { + CHECK(g_log_file_name) << "Un-named |log_file| is not supported."; + CloseLogFileUnlocked(); + } } ScopedLoggingSettings::~ScopedLoggingSettings() { - g_log_process_id = enable_process_id_; - g_log_thread_id = enable_thread_id_; - g_log_timestamp = enable_timestamp_; - g_log_tickcount = enable_tickcount_; - SetMinLogLevel(min_log_level_); - SetLogMessageHandler(message_handler_); - + // Re-initialize logging via the normal path. This will clean up old file + // name and handle state, including re-initializing the VLOG internal state. + CHECK(InitLogging({ + .logging_dest = logging_destination_, + .log_file_path = log_file_name_ ? log_file_name_->data() : nullptr, #if BUILDFLAG(IS_CHROMEOS_ASH) - g_log_format = log_format_; -#endif // BUILDFLAG(IS_CHROMEOS_ASH) + .log_format = log_format_ +#endif + })) << "~ScopedLoggingSettings() failed to restore settings."; + + // Restore plain data settings. + SetMinLogLevel(min_log_level_); + SetLogItems(enable_process_id_, enable_thread_id_, enable_timestamp_, + enable_tickcount_); + SetLogPrefix(log_prefix_); + SetLogMessageHandler(message_handler_); } #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/base/task/sequence_manager/task_queue_impl.h b/base/task/sequence_manager/task_queue_impl.h index 8dec036..aae938f 100644 --- a/base/task/sequence_manager/task_queue_impl.h +++ b/base/task/sequence_manager/task_queue_impl.h
@@ -291,8 +291,6 @@ private: ~TaskRunner() final; - bool PostTask(PostedTask task) const; - const scoped_refptr<GuardedTaskPoster> task_poster_; const scoped_refptr<AssociatedThreadId> associated_thread_; const TaskType task_type_;
diff --git a/base/test/android/junit/src/org/chromium/base/test/ShadowBuildInfo.java b/base/test/android/junit/src/org/chromium/base/test/ShadowBuildInfo.java new file mode 100644 index 0000000..92845d1 --- /dev/null +++ b/base/test/android/junit/src/org/chromium/base/test/ShadowBuildInfo.java
@@ -0,0 +1,34 @@ +// 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. + +package org.chromium.base.test; + +import org.robolectric.annotation.Implementation; +import org.robolectric.annotation.Implements; +import org.robolectric.annotation.Resetter; + +import org.chromium.base.BuildInfo; + +/** Shadow class of {@link BuildInfo} */ +@Implements(BuildInfo.class) +public class ShadowBuildInfo { + private static boolean sIsAtLeastS; + + /** Rests the changes made to static state. */ + @Resetter + public static void reset() { + sIsAtLeastS = false; + } + + /** Whether the current build is considered to be at least S. */ + @Implementation + public static boolean isAtLeastS() { + return sIsAtLeastS; + } + + /** Sets whether current Android version is at least S. */ + public static void setIsAtLeastS(boolean isAtLeastS) { + sIsAtLeastS = isAtLeastS; + } +}
diff --git a/base/test/scoped_logging_settings.h b/base/test/scoped_logging_settings.h index 61164ad..cf664f1 100644 --- a/base/test/scoped_logging_settings.h +++ b/base/test/scoped_logging_settings.h
@@ -5,6 +5,9 @@ #ifndef BASE_TEST_SCOPED_LOGGING_SETTINGS_H_ #define BASE_TEST_SCOPED_LOGGING_SETTINGS_H_ +#include <memory> + +#include "base/files/file_path.h" #include "base/logging.h" #include "build/chromeos_buildflags.h" @@ -12,7 +15,8 @@ // Saves the current logging settings and restores them when destroyed. // This is used by logging tests to avoid affecting later tests that // may run afterward, in the same process. -// Note that the log_file setting is not currently saved/restored. +// Note that this helper cannot be used when an un-named log-file is configured +// via |LoggingSettings::log_file|. class BASE_EXPORT ScopedLoggingSettings { public: ScopedLoggingSettings(); @@ -26,16 +30,25 @@ #endif private: - bool enable_process_id_; - bool enable_thread_id_; - bool enable_timestamp_; - bool enable_tickcount_; - int min_log_level_; - LogMessageHandlerFunction message_handler_; + // Please keep the following fields in the same order as the corresponding + // globals in //base/logging.cc + + const int min_log_level_; + const int logging_destination_; #if BUILDFLAG(IS_CHROMEOS_ASH) - LogFormat log_format_; + const LogFormat log_format_; #endif // BUILDFLAG(IS_CHROMEOS_ASH) + + std::unique_ptr<base::FilePath::StringType> log_file_name_; + + const bool enable_process_id_; + const bool enable_thread_id_; + const bool enable_timestamp_; + const bool enable_tickcount_; + const char* const log_prefix_; + + const LogMessageHandlerFunction message_handler_; }; } // namespace logging
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc index 555eb2dd..c9114954 100644 --- a/base/test/test_suite.cc +++ b/base/test/test_suite.cc
@@ -266,18 +266,16 @@ } void InitializeLogging() { - logging::LoggingSettings settings; - settings.logging_dest = - logging::LOG_TO_SYSTEM_DEBUG_LOG | logging::LOG_TO_STDERR; - logging::InitLogging(settings); + CHECK(logging::InitLogging({.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG | + logging::LOG_TO_STDERR})); + // We want process and thread IDs because we may have multiple processes. #if defined(OS_ANDROID) // To view log output with IDs and timestamps use "adb logcat -v threadtime". logging::SetLogItems(false, false, false, false); #else // We want process and thread IDs because we may have multiple processes. - // Note: temporarily enabled timestamps in an effort to catch bug 6361. - logging::SetLogItems(true, true, true, true); + logging::SetLogItems(true, true, false, false); #endif // !defined(OS_ANDROID) }
diff --git a/build/OWNERS.setnoparent b/build/OWNERS.setnoparent index 5797d4dc..0d473a4 100644 --- a/build/OWNERS.setnoparent +++ b/build/OWNERS.setnoparent
@@ -51,7 +51,7 @@ # Notification channels appear in system UI and are persisted forever by # Android, so should not be added or removed lightly, and the proper # deprecation and versioning steps must be taken when doing so. -file://chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS +file://chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS # The Weblayer API is supposed to be stable and will be used outside of the # chromium repository.
diff --git a/build/android/pylib/__init__.py b/build/android/pylib/__init__.py index c9a4c03..0841981 100644 --- a/build/android/pylib/__init__.py +++ b/build/android/pylib/__init__.py
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import import os import sys
diff --git a/build/android/pylib/android/logcat_symbolizer.py b/build/android/pylib/android/logcat_symbolizer.py index 720629b..78e18f5 100644 --- a/build/android/pylib/android/logcat_symbolizer.py +++ b/build/android/pylib/android/logcat_symbolizer.py
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import import re from devil.android import logcat_monitor
diff --git a/build/android/pylib/content_settings.py b/build/android/pylib/content_settings.py index 3bf11bc4..5ea7c52 100644 --- a/build/android/pylib/content_settings.py +++ b/build/android/pylib/content_settings.py
@@ -23,7 +23,7 @@ return 'f' if isinstance(value, int): return 'i' - if isinstance(value, long): + if isinstance(value, int): return 'l' if isinstance(value, str): return 's'
diff --git a/build/android/pylib/device_settings.py b/build/android/pylib/device_settings.py index ab4ad1b..1fa0903 100644 --- a/build/android/pylib/device_settings.py +++ b/build/android/pylib/device_settings.py
@@ -2,7 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import import logging +import six from pylib import content_settings @@ -33,7 +35,7 @@ for key, value in key_value: settings[key] = value logging.info('\n%s %s', table, (80 - len(table)) * '-') - for key, value in sorted(settings.iteritems()): + for key, value in sorted(six.iteritems(settings)): logging.info('\t%s: %s', key, value)
diff --git a/build/android/pylib/gtest/gtest_test_instance.py b/build/android/pylib/gtest/gtest_test_instance.py index a88c365..56c346b6 100644 --- a/build/android/pylib/gtest/gtest_test_instance.py +++ b/build/android/pylib/gtest/gtest_test_instance.py
@@ -2,7 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import HTMLParser +from __future__ import absolute_import + import json import logging import os @@ -11,6 +12,7 @@ import threading import xml.etree.ElementTree +import six from devil.android import apk_helper from pylib import constants from pylib.constants import host_paths @@ -19,6 +21,7 @@ from pylib.symbols import stack_symbolizer from pylib.utils import test_filter + with host_paths.SysPath(host_paths.BUILD_COMMON_PATH): import unittest_util # pylint: disable=import-error @@ -246,7 +249,7 @@ if not xml_content: return results - html = HTMLParser.HTMLParser() + html = six.moves.html_parser.HTMLParser() testsuites = xml.etree.ElementTree.fromstring(xml_content) for testsuite in testsuites: @@ -276,7 +279,7 @@ json_data = json.loads(json_content) - openstack = json_data['tests'].items() + openstack = list(json_data['tests'].items()) while openstack: name, value = openstack.pop() @@ -286,7 +289,7 @@ 'actual'] == 'PASS' else base_test_result.ResultType.FAIL results.append(base_test_result.BaseTestResult(name, result_type)) else: - openstack += [("%s.%s" % (name, k), v) for k, v in value.iteritems()] + openstack += [("%s.%s" % (name, k), v) for k, v in six.iteritems(value)] return results
diff --git a/build/android/pylib/gtest/gtest_test_instance_test.py b/build/android/pylib/gtest/gtest_test_instance_test.py index 1429e3d..bb093c74 100755 --- a/build/android/pylib/gtest/gtest_test_instance_test.py +++ b/build/android/pylib/gtest/gtest_test_instance_test.py
@@ -3,6 +3,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import import unittest from pylib.base import base_test_result
diff --git a/build/android/pylib/instrumentation/instrumentation_parser.py b/build/android/pylib/instrumentation/instrumentation_parser.py index dd9f9cc5..fd875cb1 100644 --- a/build/android/pylib/instrumentation/instrumentation_parser.py +++ b/build/android/pylib/instrumentation/instrumentation_parser.py
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import import logging import re
diff --git a/build/android/pylib/instrumentation/instrumentation_parser_test.py b/build/android/pylib/instrumentation/instrumentation_parser_test.py index d664455..00e4b91 100755 --- a/build/android/pylib/instrumentation/instrumentation_parser_test.py +++ b/build/android/pylib/instrumentation/instrumentation_parser_test.py
@@ -6,6 +6,7 @@ """Unit tests for instrumentation.InstrumentationParser.""" +from __future__ import absolute_import import unittest from pylib.instrumentation import instrumentation_parser
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py index 5493c365..aba3663 100644 --- a/build/android/pylib/instrumentation/instrumentation_test_instance.py +++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py
@@ -2,12 +2,14 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import import copy import logging import os import pickle import re +import six from devil.android import apk_helper from pylib import constants from pylib.base import base_test_result @@ -186,9 +188,8 @@ if current_result: if current_result.GetType() == base_test_result.ResultType.UNKNOWN: - crashed = (result_code == _ACTIVITY_RESULT_CANCELED - and any(_NATIVE_CRASH_RE.search(l) - for l in result_bundle.itervalues())) + crashed = (result_code == _ACTIVITY_RESULT_CANCELED and any( + _NATIVE_CRASH_RE.search(l) for l in six.itervalues(result_bundle))) if crashed: current_result.SetType(base_test_result.ResultType.CRASH) @@ -391,8 +392,8 @@ } for m in methods if m.startswith('test')] for dump in dex_dumps: - for package_name, package_info in dump.iteritems(): - for class_name, class_info in package_info['classes'].iteritems(): + for package_name, package_info in six.iteritems(dump): + for class_name, class_info in six.iteritems(package_info['classes']): if class_name.endswith('Test'): tests.append({ 'class': '%s.%s' % (package_name, class_name), @@ -649,7 +650,7 @@ self._package_info = None if self._apk_under_test: package_under_test = self._apk_under_test.GetPackageName() - for package_info in constants.PACKAGE_INFO.itervalues(): + for package_info in six.itervalues(constants.PACKAGE_INFO): if package_under_test == package_info.package: self._package_info = package_info break @@ -993,7 +994,7 @@ elif clazz == _PARAMETERIZED_COMMAND_LINE_FLAGS: list_of_switches = [] for annotation in methods['value']: - for clazz, methods in annotation.iteritems(): + for clazz, methods in six.iteritems(annotation): list_of_switches += _annotationToSwitches(clazz, methods) return list_of_switches else: @@ -1011,7 +1012,7 @@ list_of_switches = [] _checkParameterization(annotations) if _SKIP_PARAMETERIZATION not in annotations: - for clazz, methods in annotations.iteritems(): + for clazz, methods in six.iteritems(annotations): list_of_switches += _annotationToSwitches(clazz, methods) if list_of_switches: _setTestFlags(t, _switchesToFlags(list_of_switches[0]))
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance_test.py b/build/android/pylib/instrumentation/instrumentation_test_instance_test.py index 77918bb3e..3f38251 100755 --- a/build/android/pylib/instrumentation/instrumentation_test_instance_test.py +++ b/build/android/pylib/instrumentation/instrumentation_test_instance_test.py
@@ -7,10 +7,12 @@ # pylint: disable=protected-access +from __future__ import absolute_import import collections import tempfile import unittest +from six.moves import range # pylint: disable=redefined-builtin from pylib.base import base_test_result from pylib.instrumentation import instrumentation_test_instance
diff --git a/build/android/pylib/instrumentation/json_perf_parser.py b/build/android/pylib/instrumentation/json_perf_parser.py index c647890..6954074 100644 --- a/build/android/pylib/instrumentation/json_perf_parser.py +++ b/build/android/pylib/instrumentation/json_perf_parser.py
@@ -5,6 +5,7 @@ """A helper module for parsing JSON objects from perf tests results.""" +from __future__ import absolute_import import json
diff --git a/build/android/pylib/instrumentation/test_result.py b/build/android/pylib/instrumentation/test_result.py index a1c7307f..ed1e44c 100644 --- a/build/android/pylib/instrumentation/test_result.py +++ b/build/android/pylib/instrumentation/test_result.py
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import from pylib.base import base_test_result
diff --git a/build/android/pylib/junit/junit_test_instance.py b/build/android/pylib/junit/junit_test_instance.py index a3d18e07..b6bf8ae2 100644 --- a/build/android/pylib/junit/junit_test_instance.py +++ b/build/android/pylib/junit/junit_test_instance.py
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import from pylib.base import test_instance from pylib.utils import test_filter
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 7f16d6a9..a4d3cbe 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
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import import collections import contextlib import copy @@ -16,6 +17,8 @@ import tempfile import time +from six.moves import range # pylint: disable=redefined-builtin +from six.moves import zip # pylint: disable=redefined-builtin from devil import base_error from devil.android import apk_helper from devil.android import crash_handler @@ -108,6 +111,7 @@ RENDER_TEST_MODEL_SDK_CONFIGS = { # Android x86 emulator. 'Android SDK built for x86': [23], + 'Pixel 2': [28], } _BATCH_SUFFIX = '_batch' @@ -132,7 +136,7 @@ # Dismiss any error dialogs. Limit the number in case we have an error # loop or we are failing to dismiss. try: - for _ in xrange(10): + for _ in range(10): package = device.DismissCrashDialogIfNeeded(timeout=10, retries=1) if not package: return False @@ -592,7 +596,7 @@ i = self._GetTimeoutFromAnnotations(t['annotations'], n) return (n, i) - test_names, timeouts = zip(*(name_and_timeout(t) for t in test)) + test_names, timeouts = list(zip(*(name_and_timeout(t) for t in test))) test_name = instrumentation_test_instance.GetTestName( test[0]) + _BATCH_SUFFIX
diff --git a/build/android/pylib/monkey/monkey_test_instance.py b/build/android/pylib/monkey/monkey_test_instance.py index 10b1131..6ab4e370 100644 --- a/build/android/pylib/monkey/monkey_test_instance.py +++ b/build/android/pylib/monkey/monkey_test_instance.py
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import import random from pylib import constants
diff --git a/build/android/pylib/results/json_results.py b/build/android/pylib/results/json_results.py index 9b3bcb5..48ea42c 100644 --- a/build/android/pylib/results/json_results.py +++ b/build/android/pylib/results/json_results.py
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import import collections import itertools import json @@ -220,7 +221,7 @@ results_list = [] testsuite_runs = json_results['per_iteration_data'] for testsuite_run in testsuite_runs: - for test, test_runs in testsuite_run.iteritems(): + for test, test_runs in six.iteritems(testsuite_run): results_list.extend( [base_test_result.BaseTestResult(test, string_as_status(tr['status']),
diff --git a/build/android/pylib/results/json_results_test.py b/build/android/pylib/results/json_results_test.py index 66473311..12cd067 100755 --- a/build/android/pylib/results/json_results_test.py +++ b/build/android/pylib/results/json_results_test.py
@@ -3,8 +3,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import absolute_import import unittest +import six from pylib.base import base_test_result from pylib.results import json_results @@ -119,7 +121,7 @@ 'test.package.TestName2', ]) - for test_name, iteration_result in iterations[0].iteritems(): + for test_name, iteration_result in six.iteritems(iterations[0]): self.assertTrue(test_name in expected_tests) expected_tests.remove(test_name) self.assertEquals(1, len(iteration_result))
diff --git a/build/android/pylib/results/report_results.py b/build/android/pylib/results/report_results.py index 56eefac4..66b0717 100644 --- a/build/android/pylib/results/report_results.py +++ b/build/android/pylib/results/report_results.py
@@ -6,6 +6,7 @@ from __future__ import print_function +from __future__ import absolute_import import logging import os import re
diff --git a/build/android/pylib/valgrind_tools.py b/build/android/pylib/valgrind_tools.py index 4689dc3..aea70ec 100644 --- a/build/android/pylib/valgrind_tools.py +++ b/build/android/pylib/valgrind_tools.py
@@ -6,6 +6,7 @@ from __future__ import print_function +from __future__ import absolute_import import logging import sys
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index 8925ae1b..3a15d060 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -4.20210504.0.1 +4.20210504.3.1
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index 8925ae1b..3a15d060 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -4.20210504.0.1 +4.20210504.3.1
diff --git a/chrome/VERSION b/chrome/VERSION index 003a7a4..8af07ca3 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=92 MINOR=0 -BUILD=4498 +BUILD=4499 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 26f4b91a..9d8d835 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -660,6 +660,9 @@ if (enable_basic_printing) { deps += [ "//printing:printing_java" ] } + + # TODO(crbug.com/1174713): This is temporary to not break downstream targets. + public_deps = [ "//chrome/browser/notifications:java" ] } # Template for strict mode detection enabling/disabling so that proguard strips out @@ -691,6 +694,7 @@ "//chrome/browser/attribution_reporting/android/internal:java", "//chrome/browser/commerce/merchant_viewer/android:java", "//chrome/browser/commerce/subscriptions/android:java", + "//chrome/browser/content_creation/notes/internal/android:java", "//chrome/browser/download/internal/android:java", "//chrome/browser/page_annotations/android:java", "//chrome/browser/password_check:internal_java", @@ -777,7 +781,6 @@ "//chrome/browser/installable/installed_webapp_geolocation_bridge.cc", "//chrome/browser/installable/quality_enforcer.cc", "//chrome/browser/long_screenshots/long_screenshots_tab_service.h", - "//chrome/browser/notifications/notification_channels_provider_android.h", "//chrome/browser/notifications/notification_handler.h", "//chrome/browser/notifications/notification_platform_bridge_android.cc", ] @@ -867,6 +870,7 @@ "//chrome/browser/android/browserservices/verification:java", "//chrome/browser/android/lifecycle:java", "//chrome/browser/android/webapps/launchpad:junit_tests", + "//chrome/browser/attribution_reporting/android/internal:junit_tests", "//chrome/browser/banners/android:java", "//chrome/browser/browser_controls/android:java", "//chrome/browser/browser_controls/android:junit", @@ -896,6 +900,8 @@ "//chrome/browser/lens:delegate_public_impl_java", "//chrome/browser/lens:java", "//chrome/browser/locale:java", + "//chrome/browser/notifications:java", + "//chrome/browser/notifications:junit_tests", "//chrome/browser/omaha/android:java", "//chrome/browser/optimization_guide/android:java", "//chrome/browser/page_annotations/test/android:junit", @@ -1186,6 +1192,8 @@ "//chrome/browser/language/android:java", "//chrome/browser/lens:java", "//chrome/browser/locale:java", + "//chrome/browser/notifications:java", + "//chrome/browser/notifications:javatests", "//chrome/browser/offline_pages/android:java", "//chrome/browser/omaha/android:java", "//chrome/browser/optimization_guide/android:java", @@ -3531,8 +3539,6 @@ "java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java", "java/src/org/chromium/chrome/browser/notifications/ActionInfo.java", "java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java", - "java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java", - "java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java", "java/src/org/chromium/chrome/browser/notifications/NotificationTriggerScheduler.java", "java/src/org/chromium/chrome/browser/notifications/scheduler/DisplayAgent.java", "java/src/org/chromium/chrome/browser/notifications/scheduler/NotificationSchedulerTask.java",
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni index a7401fb7..ddbe08f9 100644 --- a/chrome/android/chrome_java_resources.gni +++ b/chrome/android/chrome_java_resources.gni
@@ -54,7 +54,6 @@ "java/res/drawable-hdpi/google_logo.png", "java/res/drawable-hdpi/help_outline.png", "java/res/drawable-hdpi/ic_account_child_20dp.png", - "java/res/drawable-hdpi/ic_chrome.png", "java/res/drawable-hdpi/ic_devices_16dp.png", "java/res/drawable-hdpi/ic_devices_48dp.png", "java/res/drawable-hdpi/ic_dialer_icon_blue_40dp.png", @@ -180,7 +179,6 @@ "java/res/drawable-mdpi/google_logo.png", "java/res/drawable-mdpi/help_outline.png", "java/res/drawable-mdpi/ic_account_child_20dp.png", - "java/res/drawable-mdpi/ic_chrome.png", "java/res/drawable-mdpi/ic_devices_16dp.png", "java/res/drawable-mdpi/ic_devices_48dp.png", "java/res/drawable-mdpi/ic_dialer_icon_blue_40dp.png", @@ -294,7 +292,6 @@ "java/res/drawable-xhdpi/google_logo.png", "java/res/drawable-xhdpi/help_outline.png", "java/res/drawable-xhdpi/ic_account_child_20dp.png", - "java/res/drawable-xhdpi/ic_chrome.png", "java/res/drawable-xhdpi/ic_devices_16dp.png", "java/res/drawable-xhdpi/ic_devices_48dp.png", "java/res/drawable-xhdpi/ic_dialer_icon_blue_40dp.png", @@ -387,7 +384,6 @@ "java/res/drawable-xxhdpi/google_logo.png", "java/res/drawable-xxhdpi/help_outline.png", "java/res/drawable-xxhdpi/ic_account_child_20dp.png", - "java/res/drawable-xxhdpi/ic_chrome.png", "java/res/drawable-xxhdpi/ic_devices_16dp.png", "java/res/drawable-xxhdpi/ic_devices_48dp.png", "java/res/drawable-xxhdpi/ic_dialer_icon_blue_40dp.png", @@ -479,7 +475,6 @@ "java/res/drawable-xxxhdpi/google_logo.png", "java/res/drawable-xxxhdpi/help_outline.png", "java/res/drawable-xxxhdpi/ic_account_child_20dp.png", - "java/res/drawable-xxxhdpi/ic_chrome.png", "java/res/drawable-xxxhdpi/ic_devices_16dp.png", "java/res/drawable-xxxhdpi/ic_devices_48dp.png", "java/res/drawable-xxxhdpi/ic_dialer_icon_blue_40dp.png", @@ -854,11 +849,6 @@ "java/res/layout/update_menu_item.xml", "java/res/layout/url_action_container.xml", "java/res/layout/url_bar.xml", - "java/res/layout/web_notification.xml", - "java/res/layout/web_notification_big.xml", - "java/res/layout/web_notification_button.xml", - "java/res/layout/web_notification_icon_frame.xml", - "java/res/layout/web_notification_small_icon.xml", "java/res/menu/bookmark_action_bar_menu.xml", "java/res/menu/custom_tabs_menu.xml", "java/res/menu/history_manager_menu.xml",
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni index 88ad8f4a..4e0e569 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni
@@ -783,27 +783,12 @@ "java/src/org/chromium/chrome/browser/net/nqe/NetworkQualityProvider.java", "java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java", "java/src/org/chromium/chrome/browser/notifications/ActionInfo.java", - "java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperCompatBuilder.java", - "java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperStandardBuilder.java", - "java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java", - "java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java", - "java/src/org/chromium/chrome/browser/notifications/NotificationConstants.java", - "java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptor.java", "java/src/org/chromium/chrome/browser/notifications/NotificationJobServiceImpl.java", "java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java", "java/src/org/chromium/chrome/browser/notifications/NotificationServiceImpl.java", - "java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java", - "java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java", "java/src/org/chromium/chrome/browser/notifications/NotificationTriggerBackgroundTask.java", "java/src/org/chromium/chrome/browser/notifications/NotificationTriggerScheduler.java", - "java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java", - "java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactory.java", - "java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java", "java/src/org/chromium/chrome/browser/notifications/WebPlatformNotificationMetrics.java", - "java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdater.java", - "java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java", - "java/src/org/chromium/chrome/browser/notifications/channels/LocaleChangedBroadcastReceiver.java", - "java/src/org/chromium/chrome/browser/notifications/channels/SiteChannelsManager.java", "java/src/org/chromium/chrome/browser/notifications/scheduler/DisplayAgent.java", "java/src/org/chromium/chrome/browser/notifications/scheduler/NotificationSchedulerTask.java", "java/src/org/chromium/chrome/browser/ntp/FakeRecentlyClosedTabManager.java", @@ -855,6 +840,7 @@ "java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderProperties.java", "java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderView.java", "java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderViewBinder.java", + "java/src/org/chromium/chrome/browser/ntp/snippets/SectionType.java", "java/src/org/chromium/chrome/browser/offline/measurements/OfflineMeasurementsBackgroundTask.java", "java/src/org/chromium/chrome/browser/offlinepages/AutoFetchNotifier.java", "java/src/org/chromium/chrome/browser/offlinepages/BackgroundScheduler.java", @@ -1027,7 +1013,6 @@ "java/src/org/chromium/chrome/browser/omnibox/voice/VoiceRecognitionHandler.java", "java/src/org/chromium/chrome/browser/page_info/ChromePageInfo.java", "java/src/org/chromium/chrome/browser/page_info/ChromePageInfoControllerDelegate.java", - "java/src/org/chromium/chrome/browser/page_info/ChromePermissionParamsListBuilderDelegate.java", "java/src/org/chromium/chrome/browser/page_info/PageInfoHistoryController.java", "java/src/org/chromium/chrome/browser/page_info/SiteSettingsHelper.java", "java/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreviewHelper.java",
diff --git a/chrome/android/chrome_junit_test_java_sources.gni b/chrome/android/chrome_junit_test_java_sources.gni index 5a6c939..39c6b58 100644 --- a/chrome/android/chrome_junit_test_java_sources.gni +++ b/chrome/android/chrome_junit_test_java_sources.gni
@@ -135,13 +135,9 @@ "junit/src/org/chromium/chrome/browser/net/nqe/NetworkQualityProviderTest.java", "junit/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateControllerTest.java", "junit/src/org/chromium/chrome/browser/night_mode/GlobalNightModeStateProviderHolderTest.java", - "junit/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptorTest.java", - "junit/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtilUnitTest.java", "junit/src/org/chromium/chrome/browser/notifications/NotificationTriggerBackgroundTaskTest.java", "junit/src/org/chromium/chrome/browser/notifications/NotificationTriggerSchedulerTest.java", - "junit/src/org/chromium/chrome/browser/notifications/PendingIntentProviderTest.java", "junit/src/org/chromium/chrome/browser/notifications/WebPlatformNotificationMetricsTest.java", - "junit/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitionsTest.java", "junit/src/org/chromium/chrome/browser/ntp/cards/InnerNodeTest.java", "junit/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerTest.java", "junit/src/org/chromium/chrome/browser/offlinepages/CctOfflinePageModelObserverTest.java",
diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni index b91e66b..24b4105 100644 --- a/chrome/android/chrome_test_java_sources.gni +++ b/chrome/android/chrome_test_java_sources.gni
@@ -131,6 +131,7 @@ "javatests/src/org/chromium/chrome/browser/crash/PureJavaExceptionReporterTest.java", "javatests/src/org/chromium/chrome/browser/crypto/CipherFactoryTest.java", "javatests/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java", + "javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityAppMenuTest.java", "javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityIncognitoMetricTest.java", "javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityIncognitoTest.java", "javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityRenderTest.java", @@ -281,17 +282,10 @@ "javatests/src/org/chromium/chrome/browser/multiwindow/MultiWindowUtilsTest.java", "javatests/src/org/chromium/chrome/browser/net/connectivitydetector/ConnectivityDetectorDelegateStub.java", "javatests/src/org/chromium/chrome/browser/net/connectivitydetector/ConnectivityDetectorTest.java", - "javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java", - "javatests/src/org/chromium/chrome/browser/notifications/NotificationBuilderBaseTest.java", "javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeIntentTest.java", "javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java", "javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeUnitTest.java", "javatests/src/org/chromium/chrome/browser/notifications/NotificationTestRule.java", - "javatests/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java", - "javatests/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactoryTest.java", - "javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java", - "javatests/src/org/chromium/chrome/browser/notifications/channels/ChannelsInitializerTest.java", - "javatests/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdaterTest.java", "javatests/src/org/chromium/chrome/browser/notifications/channels/SiteChannelsManagerTest.java", "javatests/src/org/chromium/chrome/browser/ntp/IncognitoDescriptionViewRenderTest.java", "javatests/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageTest.java",
diff --git a/chrome/android/expectations/lint-suppressions.xml b/chrome/android/expectations/lint-suppressions.xml index c6c4410..e1785792 100644 --- a/chrome/android/expectations/lint-suppressions.xml +++ b/chrome/android/expectations/lint-suppressions.xml
@@ -273,14 +273,6 @@ <ignore regexp="The resource `R.string.accessibility_merchant_viewer_message_announcement` appears to be unused"/> <ignore regexp="The resource `R.string.merchant_viewer_message_rating_numerical` appears to be unused"/> - <!--TODO(crbug.com/1198233): Remove this suppression when download later V2 is fully implemented.--> - <ignore regexp="The resource `R.string.download_later_slow_network_subtitle` appears to be unused"/> - <ignore regexp="The resource `R.string.download_later_2g_connection` appears to be unused"/> - <ignore regexp="The resource `R.string.download_later_bluetooth_connection` appears to be unused"/> - <ignore regexp="The resource `R.string.download_later_wifi_connection` appears to be unused"/> - <ignore regexp="The resource `R.string.download_later_large_file_subtitle` appears to be unused"/> - <ignore regexp="The resource `R.string.download_later_dialog_positive_button_text` appears to be unused"/> - <!-- Endnote: Please specify number of suppressions when adding more --> </issue> <issue id="VectorPath" severity="ignore"/>
diff --git a/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected b/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected index d5372cbf..5dfb845 100644 --- a/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected +++ b/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected
@@ -1017,14 +1017,6 @@ android:name="org.chromium.chrome.browser.offlinepages.AutoFetchNotifier$InProgressCancelReceiver" android:exported="false"> </receiver> # DIFF-ANCHOR: 05f19ac3 - <receiver # DIFF-ANCHOR: f2ef5c19 - android:name="org.chromium.chrome.browser.offlinepages.prefetch.PrefetchedPagesNotifier$ClickReceiver" - android:exported="false"> - </receiver> # DIFF-ANCHOR: f2ef5c19 - <receiver # DIFF-ANCHOR: 0267e562 - android:name="org.chromium.chrome.browser.offlinepages.prefetch.PrefetchedPagesNotifier$SettingsReceiver" - android:exported="false"> - </receiver> # DIFF-ANCHOR: 0267e562 <receiver # DIFF-ANCHOR: a3a6e991 android:name="org.chromium.chrome.browser.omaha.UpdateNotificationController$UpdateNotificationReceiver" android:exported="false">
diff --git a/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected b/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected index ed1cd4fd..ef74215 100644 --- a/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected +++ b/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected
@@ -955,14 +955,6 @@ android:name="org.chromium.chrome.browser.offlinepages.AutoFetchNotifier$InProgressCancelReceiver" android:exported="false"> </receiver> # DIFF-ANCHOR: 05f19ac3 - <receiver # DIFF-ANCHOR: f2ef5c19 - android:name="org.chromium.chrome.browser.offlinepages.prefetch.PrefetchedPagesNotifier$ClickReceiver" - android:exported="false"> - </receiver> # DIFF-ANCHOR: f2ef5c19 - <receiver # DIFF-ANCHOR: 0267e562 - android:name="org.chromium.chrome.browser.offlinepages.prefetch.PrefetchedPagesNotifier$SettingsReceiver" - android:exported="false"> - </receiver> # DIFF-ANCHOR: 0267e562 <receiver # DIFF-ANCHOR: a3a6e991 android:name="org.chromium.chrome.browser.omaha.UpdateNotificationController$UpdateNotificationReceiver" android:exported="false">
diff --git a/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantAccessibilityIntegrationTest.java b/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantAccessibilityIntegrationTest.java index 6e6e959c..da11782 100644 --- a/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantAccessibilityIntegrationTest.java +++ b/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantAccessibilityIntegrationTest.java
@@ -40,6 +40,7 @@ import org.junit.runner.RunWith; import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.DisableIf; import org.chromium.base.test.util.DisabledTest; import org.chromium.chrome.autofill_assistant.R; import org.chromium.chrome.browser.autofill_assistant.proto.ActionProto; @@ -117,6 +118,7 @@ @Test @MediumTest + @DisableIf.Build(sdk_is_less_than = 23) // see: https://crbug.com/1202724 public void testBottomSheetHasRestrictedFixedHeight() throws Exception { ArrayList<ActionProto> list = new ArrayList<>();
diff --git a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java index 6e95d42..40ba6878 100644 --- a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java +++ b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceTest.java
@@ -230,8 +230,14 @@ @Feature({"StartSurface"}) @CommandLineFlags.Add({BASE_PARAMS + "/single/home_button_on_grid_tab_switcher/false"}) public void testShow_SingleAsHomepage() { - // TODO(https://crbug.com/1196473): Re-enable the test once it is fixed. - Assume.assumeFalse(mUseInstantStart && mImmediateReturn); + Assume.assumeFalse("https://crbug.com/1196473", + mUseInstantStart && mImmediateReturn + && (Build.VERSION.SDK_INT == Build.VERSION_CODES.N + || Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1)); + Assume.assumeFalse("https://crbug.com/1205514", + mUseInstantStart && !mImmediateReturn + && (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP + || Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP_MR1)); if (!mImmediateReturn) { pressHomePageButton(); @@ -635,6 +641,11 @@ @Feature({"StartSurface"}) @CommandLineFlags.Add({BASE_PARAMS + "/single"}) public void testTapMVTilesInSingleSurface() { + Assume.assumeFalse("https://crbug.com/1205525", + mUseInstantStart && mImmediateReturn + && (Build.VERSION.SDK_INT == Build.VERSION_CODES.N + || Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1)); + if (!mImmediateReturn) { pressHomePageButton(); } @@ -1142,10 +1153,12 @@ @Test @MediumTest @Feature({"StartSurface"}) - // clang-format off @CommandLineFlags.Add({BASE_PARAMS + "/single"}) public void testShow_SingleAsHomepage_BackButtonWithTabSwitcher() throws ExecutionException { - // clang-format on + Assume.assumeFalse("https://crbug.com/1205525", + mUseInstantStart && mImmediateReturn + && (Build.VERSION.SDK_INT == Build.VERSION_CODES.N + || Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1)); singleAsHomepage_BackButtonWithTabSwitcher(); } @@ -1274,11 +1287,13 @@ @LargeTest @Feature({"StartSurface"}) @EnableFeatures(ChromeFeatureList.TAB_GROUPS_ANDROID) - // clang-format off @CommandLineFlags.Add({BASE_PARAMS + "/single"}) public void testShow_SingleAsHomepage_BackButtonOnTabSwitcherWithDialogShowing() throws ExecutionException { - // clang-format on + Assume.assumeFalse("https://crbug.com/1205525", + mUseInstantStart && mImmediateReturn + && (Build.VERSION.SDK_INT == Build.VERSION_CODES.N + || Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1)); backButtonOnTabSwitcherWithDialogShowingImpl(); } @@ -1371,11 +1386,13 @@ @LargeTest @Feature({"StartSurface"}) @EnableFeatures(ChromeFeatureList.TAB_GROUPS_ANDROID) - // clang-format off @CommandLineFlags.Add({BASE_PARAMS + "/single"}) public void testShow_SingleAsHomepage_BackButtonOnHomepageWithGroupTabsDialog() throws ExecutionException { - // clang-format on + Assume.assumeFalse("https://crbug.com/1205525", + mUseInstantStart && mImmediateReturn + && (Build.VERSION.SDK_INT == Build.VERSION_CODES.N + || Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1)); backButtonOnHomepageWithGroupTabsDialogImpl(); } @@ -1758,10 +1775,13 @@ @LargeTest @Feature({"StartSurface"}) @DisableIf.Build(sdk_is_less_than = N, supported_abis_includes = "x86") - // clang-format off @CommandLineFlags.Add({BASE_PARAMS + "/single/show_tabs_in_mru_order/true"}) public void testShow_SingleAsHomepage_ShowTabsInMRUOrder() throws ExecutionException { - // clang-format on + Assume.assumeFalse("https://crbug.com/1205525", + mUseInstantStart && mImmediateReturn + && (Build.VERSION.SDK_INT == Build.VERSION_CODES.N + || Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1)); + if (!mImmediateReturn) { pressHomePageButton(); } @@ -1817,10 +1837,12 @@ @LargeTest @Feature({"StartSurface"}) @DisableIf.Build(sdk_is_less_than = N, supported_abis_includes = "x86") - // clang-format off @CommandLineFlags.Add({BASE_PARAMS + "/single/show_tabs_in_mru_order/true"}) public void testShow_TabSwitcher_ShowTabsInMRUOrder() throws ExecutionException { - // clang-format on + Assume.assumeFalse("https://crbug.com/1205525", + mUseInstantStart && mImmediateReturn + && (Build.VERSION.SDK_INT == Build.VERSION_CODES.N + || Build.VERSION.SDK_INT == Build.VERSION_CODES.N_MR1)); tabSwitcher_ShowTabsInMRUOrderImpl(); }
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd index f556256..7b74d286 100644 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd
@@ -434,8 +434,8 @@ </message> <message name="IDS_MERCHANT_VIEWER_MESSAGE_DESCRIPTION_REVIEWS" desc="Second part of the message description. Shows the number of reviews."> {REVIEWS, plural, - =1 {(<ph name="REVIEWS_COUNT_ONE">%1$s<ex>1</ex></ph> review)} - other {(<ph name="REVIEWS_COUNT_MANY">%1$s<ex>8</ex></ph> reviews)}} + =1 {(<ph name="REVIEWS_COUNT_ONE">%1$d<ex>1</ex></ph> review)} + other {(<ph name="REVIEWS_COUNT_MANY">%1$d<ex>8</ex></ph> reviews)}} </message> <message name="IDS_MERCHANT_VIEWER_MESSAGE_RATING_NUMERICAL" desc="The rating of the merchant in numerical form."> <ph name="CURRENT_RATING">%1$.1f<ex>4.5</ex></ph>/<ph name="RATING_BASELINE">%2$d<ex>5</ex></ph>
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_MERCHANT_VIEWER_MESSAGE_DESCRIPTION_REVIEWS.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_MERCHANT_VIEWER_MESSAGE_DESCRIPTION_REVIEWS.png.sha1 index 938288c..c7274f49 100644 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_MERCHANT_VIEWER_MESSAGE_DESCRIPTION_REVIEWS.png.sha1 +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_MERCHANT_VIEWER_MESSAGE_DESCRIPTION_REVIEWS.png.sha1
@@ -1 +1 @@ -416f0632e256c88ddf97ccc3e4bb36e2e39f8795 \ No newline at end of file +50348ef2b33b3e48032bc2d10e842f137e558d13
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java index 5f8bc5e..d832df42 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java
@@ -359,7 +359,7 @@ /** @return Whether the placeholder is shown. */ public boolean isPlaceholderShown() { - return mStream.isPlaceholderShown(); + return mStream != null ? mStream.isPlaceholderShown() : false; } /** Launches autoplay settings activity. */ @@ -380,14 +380,14 @@ if (!FeedSurfaceTracker.getInstance().isStartupCalled()) return; mIsActive = true; - mMediator.rebindStream(); + mMediator.onSurfaceOpened(); } /** Hides the feed. */ public void onSurfaceClosed() { if (!FeedSurfaceTracker.getInstance().isStartupCalled()) return; mIsActive = false; - mMediator.unbindStream(); + mMediator.onSurfaceClosed(); } /** Returns a string usable for restoring the UI to current state. */ @@ -454,6 +454,8 @@ * Create a {@link Stream} for this class. */ void createStream() { + assert mStream == null; + if (mScrollViewForPolicy != null) { mRootView.removeView(mScrollViewForPolicy); mScrollViewForPolicy = null;
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java index 0a916c45..eabd15bf 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceMediator.java
@@ -10,6 +10,7 @@ import android.content.Intent; import android.content.res.Resources; import android.graphics.Rect; +import android.os.Handler; import android.os.SystemClock; import android.view.View; import android.widget.ScrollView; @@ -43,6 +44,7 @@ import org.chromium.chrome.browser.ntp.snippets.OnSectionHeaderSelectedListener; import org.chromium.chrome.browser.ntp.snippets.SectionHeaderListProperties; import org.chromium.chrome.browser.ntp.snippets.SectionHeaderProperties; +import org.chromium.chrome.browser.ntp.snippets.SectionType; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.preferences.PrefChangeRegistrar; import org.chromium.chrome.browser.profiles.Profile; @@ -211,6 +213,8 @@ private ContentChangedListener mStreamContentChangedListener; private MemoryPressureCallback mMemoryPressureCallback; private @Nullable SignInPromo mSignInPromo; + private RecyclerViewAnimationFinishDetector mRecyclerViewAnimationFinishDetector = + new RecyclerViewAnimationFinishDetector(); private boolean mFeedEnabled; private boolean mHasHeader; @@ -273,6 +277,14 @@ mSectionHeaderModel = headerModel; + // This works around the bug that the out-of-screen toolbar is not brought back together + // with the new tab page view when it slides down. This is because the RecyclerView + // animation may not finish when content changed event is triggered and thus the new tab + // page layout view may still be partially off screen. + mStreamContentChangedListener = contents + -> mRecyclerViewAnimationFinishDetector.runWhenAnimationComplete( + this::onContentsChanged); + initialize(); } @@ -391,10 +403,7 @@ mSectionHeaderModel.set( SectionHeaderListProperties.MENU_DELEGATE_KEY, this::onItemSelected); - if (WebFeedBridge.isWebFeedSubscriber() && FeedFeatures.isWebFeedUIEnabled()) { - addHeaderAndStream(mContext.getResources().getString(R.string.ntp_following), - mCoordinator.createFeedStream(/* isInterestFeed = */ false)); - } + setUpWebFeedTab(); } else { // Show feed if there is no header that would allow user to hide feed. // This is currently only relevant for the two panes start surface. @@ -435,6 +444,40 @@ mTabToStreamMap.put(tabId, stream); } + private int getTabIdForSection(@SectionType int sectionType) { + for (int tabId : mTabToStreamMap.keySet()) { + if (mTabToStreamMap.get(tabId).getSectionType() == sectionType) { + return tabId; + } + } + return -1; + } + + /** Adds or removes the WebFeed tab, depending on whether it should be shown. */ + private void setUpWebFeedTab() { + // Skip if the for-you tab hasn't been added yet. + if (getTabIdForSection(SectionType.FOR_YOU_FEED) == -1) { + return; + } + int tabId = getTabIdForSection(SectionType.WEB_FEED); + boolean hasWebFeedTab = tabId != -1; + boolean shouldHaveWebFeedTab = mHasHeader && WebFeedBridge.isWebFeedSubscriber() + && FeedFeatures.isWebFeedUIEnabled(); + if (hasWebFeedTab == shouldHaveWebFeedTab) return; + if (shouldHaveWebFeedTab) { + addHeaderAndStream(mContext.getResources().getString(R.string.ntp_following), + mCoordinator.createFeedStream(/* isInterestFeed = */ false)); + } else { + if (mCurrentStream != null && mCurrentStream.getSectionType() == SectionType.WEB_FEED) { + unbindStream(); + } + mTabToStreamMap.remove(tabId); + mSectionHeaderModel.get(SectionHeaderListProperties.SECTION_HEADERS_KEY) + .removeAt(tabId); + mSectionHeaderModel.set(SectionHeaderListProperties.CURRENT_TAB_INDEX_KEY, 0); + } + } + /** * Binds a stream to the {@link NtpListContentManager}. Unbinds currently active stream if * different from new stream. Once bound, the stream can add/remove contents. @@ -444,11 +487,12 @@ if (mCurrentStream != null) { unbindStream(); } - stream.bind(mCoordinator.getRecyclerView(), mCoordinator.getContentManager(), + mCurrentStream = stream; + mCurrentStream.addOnContentChangedListener(mStreamContentChangedListener); + mCurrentStream.bind(mCoordinator.getRecyclerView(), mCoordinator.getContentManager(), mRestoreScrollState, mCoordinator.getSurfaceScope(), mCoordinator.getHybridListRenderer()); mRestoreScrollState = null; - mCurrentStream = stream; mCoordinator.getHybridListRenderer().onSurfaceOpened(); if (mSnapScrollHelper != null) { mStreamScrollListener = new ScrollListener() { @@ -465,43 +509,48 @@ }; mCurrentStream.addScrollListener(mStreamScrollListener); } - - mStreamContentChangedListener = contents -> { - if (mSnapScrollHelper != null) mSnapScrollHelper.resetSearchBoxOnScroll(true); - - if (mContentFirstAvailableTimeMs == 0) { - mContentFirstAvailableTimeMs = SystemClock.elapsedRealtime(); - if (mHasPendingUmaRecording) { - maybeRecordContentLoadingTime(); - mHasPendingUmaRecording = false; - } - } - mIsLoadingFeed = false; - mStreamContentChanged = true; - }; - mCurrentStream.addOnContentChangedListener(mStreamContentChangedListener); } - void unbindStream() { + void onContentsChanged() { + if (mSnapScrollHelper != null) mSnapScrollHelper.resetSearchBoxOnScroll(true); + + if (mContentFirstAvailableTimeMs == 0) { + mContentFirstAvailableTimeMs = SystemClock.elapsedRealtime(); + if (mHasPendingUmaRecording) { + maybeRecordContentLoadingTime(); + mHasPendingUmaRecording = false; + } + } + mIsLoadingFeed = false; + mStreamContentChanged = true; + } + + private void unbindStream() { if (mCurrentStream == null) return; if (mStreamScrollListener != null) { mCurrentStream.removeScrollListener(mStreamScrollListener); mStreamScrollListener = null; } - mCurrentStream.removeOnContentChangedListener(mStreamContentChangedListener); - mCoordinator.getHybridListRenderer().onSurfaceClosed(); mCurrentStream.unbind(); + mCurrentStream.removeOnContentChangedListener(mStreamContentChangedListener); mCurrentStream = null; } - void rebindStream() { + void onSurfaceOpened() { + setUpWebFeedTab(); + rebindStream(); + } + + void onSurfaceClosed() { + unbindStream(); + } + + private void rebindStream() { // If a stream is already bound, then do nothing. if (mCurrentStream != null) return; - // If feed shouldn't be shown, do nothing. if (!mSectionHeaderModel.get(SectionHeaderListProperties.IS_SECTION_ENABLED_KEY)) return; - // Find the stream that should be bound and bind it. If no stream matches, then we haven't // fully set up yet. This will be taken care of by setup. Stream stream = mTabToStreamMap.get( @@ -932,4 +981,54 @@ mContentFirstAvailableTimeMs - mActivityCreationTimeMs, mIsInstantStart); return true; } + + // Detects animation finishes in RecyclerView. + // https://stackoverflow.com/questions/33710605/detect-animation-finish-in-androids-recyclerview + private class RecyclerViewAnimationFinishDetector + implements RecyclerView.ItemAnimator.ItemAnimatorFinishedListener { + private Runnable mFinishedCallback; + + /** + * Asynchronously waits for the animation to finish. If there's already a callback waiting, + * this replaces the existing callback. + * + * @param finishedCallback Callback to invoke when the animation finishes. + */ + public void runWhenAnimationComplete(Runnable finishedCallback) { + if (mCoordinator.getRecyclerView() == null) { + return; + } + mFinishedCallback = finishedCallback; + + // The RecyclerView has not started animating yet, so post a message to the + // message queue that will be run after the RecyclerView has started animating. + new Handler().post(() -> { checkFinish(); }); + } + + private void checkFinish() { + RecyclerView recyclerView = mCoordinator.getRecyclerView(); + + if (recyclerView != null && recyclerView.isAnimating()) { + // The RecyclerView is still animating, try again when the animation has finished. + recyclerView.getItemAnimator().isRunning(this); + return; + } + + // The RecyclerView has animated all it's views. + onFinished(); + } + + private void onFinished() { + if (mFinishedCallback != null) { + mFinishedCallback.run(); + mFinishedCallback = null; + } + } + + @Override + public void onAnimationsFinished() { + // There might still be more items that will be animated after this one. + new Handler().post(() -> { checkFinish(); }); + } + } }
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/stream/Stream.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/stream/Stream.java index 7535e459..c09c3a98 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/stream/Stream.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/stream/Stream.java
@@ -13,6 +13,7 @@ import org.chromium.chrome.browser.feed.NtpListContentManager; import org.chromium.chrome.browser.feed.NtpListContentManager.FeedContent; import org.chromium.chrome.browser.ntp.ScrollListener; +import org.chromium.chrome.browser.ntp.snippets.SectionType; import org.chromium.chrome.browser.xsurface.HybridListRenderer; import org.chromium.chrome.browser.xsurface.SurfaceScope; @@ -23,6 +24,10 @@ /** Called when the Stream is no longer needed. */ default void destroy() {} + /** Returns the section type for this stream. */ + @SectionType + int getSectionType(); + /** * @param scrollState Previous saved scroll state to restore to. */
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStream.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStream.java index 631729e..1afbca9 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStream.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStream.java
@@ -7,7 +7,6 @@ import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.app.Activity; -import android.os.Handler; import android.util.TypedValue; import android.view.View; import android.view.ViewParent; @@ -40,6 +39,7 @@ import org.chromium.chrome.browser.native_page.NativePageNavigationDelegate; import org.chromium.chrome.browser.ntp.NewTabPageUma; import org.chromium.chrome.browser.ntp.ScrollListener; +import org.chromium.chrome.browser.ntp.snippets.SectionType; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; import org.chromium.chrome.browser.offlinepages.RequestCoordinatorBridge; import org.chromium.chrome.browser.profiles.Profile; @@ -400,6 +400,7 @@ new ObserverList<ContentChangedListener>(); private final ObserverList<InteractionsListener> mInteractionListeners = new ObserverList<>(); private final NativePageNavigationDelegate mNavigationDelegate; + private final boolean mIsInterestFeed; // Various helpers/controllers. private ShareHelperWrapper mShareHelper; private SnackbarManager mSnackManager; @@ -425,7 +426,6 @@ private @Nullable NtpListContentManager mContentManager; private @Nullable SurfaceScope mSurfaceScope; private @Nullable HybridListRenderer mRenderer; - private @Nullable RecyclerViewAnimationFinishDetector mRecyclerViewAnimationFinishDetector; private FeedSurfaceMediator.ScrollState mScrollStateToRestore; private int mHeaderCount; private boolean mIsPlaceholderShown; @@ -452,7 +452,7 @@ WindowAndroid windowAndroid, Supplier<ShareDelegate> shareDelegateSupplier, boolean isInterestFeed) { this.mActivity = activity; - + mIsInterestFeed = isInterestFeed; mNativeFeedStream = FeedStreamJni.get().init(this, isInterestFeed); mBottomSheetController = bottomSheetController; @@ -515,6 +515,12 @@ } @Override + @SectionType + public int getSectionType() { + return mIsInterestFeed ? SectionType.FOR_YOU_FEED : SectionType.WEB_FEED; + } + + @Override public void bind(RecyclerView rootView, NtpListContentManager manager, FeedSurfaceMediator.ScrollState savedInstanceState, SurfaceScope surfaceScope, HybridListRenderer renderer) { @@ -531,7 +537,6 @@ mSurfaceScope = surfaceScope; mRenderer = renderer; mHeaderCount = manager.getItemCount(); - mRecyclerViewAnimationFinishDetector = new RecyclerViewAnimationFinishDetector(); if (mWindowAndroid.getDisplay() != null) { mWindowAndroid.getDisplay().addObserver(mRotationObserver); } @@ -565,13 +570,12 @@ int feedCount = mContentManager.getItemCount() - mHeaderCount; if (feedCount > 0) { mContentManager.removeContents(mHeaderCount, feedCount); - notifyContentChangeOnAnimationFinish(); + notifyContentChange(); } mContentManager.setHandlers(new HashMap<>()); mContentManager = null; - mRecyclerViewAnimationFinishDetector = null; mRecyclerView.removeOnScrollListener(mMainScrollListener); mRecyclerView.getAdapter().unregisterAdapterDataObserver(mRestoreScrollObserver); mRecyclerView = null; @@ -891,7 +895,7 @@ } if (hasContentChange) { - notifyContentChangeOnAnimationFinish(); + notifyContentChange(); } } @@ -915,17 +919,11 @@ return true; } - private void notifyContentChangeOnAnimationFinish() { - // This works around the bug that the out-of-screen toolbar is not brought back together - // with the new tab page view when it slides down. This is because the RecyclerView - // animation may not finish when content changed event is triggered and thus the new tab - // page layout view may still be partially off screen. - mRecyclerViewAnimationFinishDetector.asyncWait(mRecyclerView, () -> { - for (ContentChangedListener listener : mContentChangedListeners) { - listener.onContentChanged( - mContentManager != null ? mContentManager.getContentList() : null); - } - }); + private void notifyContentChange() { + for (ContentChangedListener listener : mContentChangedListeners) { + listener.onContentChanged( + mContentManager != null ? mContentManager.getContentList() : null); + } } @VisibleForTesting @@ -973,57 +971,6 @@ } } - // Detects animation finishes in RecyclerView. - // https://stackoverflow.com/questions/33710605/detect-animation-finish-in-androids-recyclerview - private static class RecyclerViewAnimationFinishDetector - implements RecyclerView.ItemAnimator.ItemAnimatorFinishedListener { - private RecyclerView mRecyclerView; - private Runnable mFinishedCallback; - - /** - * Asynchronously waits for the animation to finish. - * - * @param recyclerView RecyclerView to wait for animation to finish. - * @param finishedCallback Callback to invoke when the animation finishes. - */ - public void asyncWait(RecyclerView recyclerView, Runnable finishedCallback) { - if (mRecyclerView != null) { - return; - } - mRecyclerView = recyclerView; - mFinishedCallback = finishedCallback; - - // The RecyclerView has not started animating yet, so post a message to the - // message queue that will be run after the RecyclerView has started animating. - new Handler().post(() -> { checkFinish(); }); - } - - private void checkFinish() { - if (mRecyclerView != null && mRecyclerView.isAnimating()) { - // The RecyclerView is still animating, try again when the animation has finished. - mRecyclerView.getItemAnimator().isRunning(this); - return; - } - - // The RecyclerView has animated all it's views. - onFinished(); - } - - private void onFinished() { - mRecyclerView = null; - if (mFinishedCallback != null) { - mFinishedCallback.run(); - mFinishedCallback = null; - } - } - - @Override - public void onAnimationsFinished() { - // There might still be more items that will be animated after this one. - new Handler().post(() -> { checkFinish(); }); - } - } - /** * Provides a wrapper around sharing methods. *
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml index ca626dbb..cf8bc19 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml
@@ -1106,11 +1106,6 @@ <receiver android:name="org.chromium.chrome.browser.sharing.sms_fetcher.SmsFetcherMessageHandler$NotificationReceiver" android:exported="false"/> - <receiver android:name="org.chromium.chrome.browser.offlinepages.prefetch.PrefetchedPagesNotifier$ClickReceiver" - android:exported="false"/> - <receiver android:name="org.chromium.chrome.browser.offlinepages.prefetch.PrefetchedPagesNotifier$SettingsReceiver" - android:exported="false"/> - <receiver android:name="org.chromium.chrome.browser.offlinepages.AutoFetchNotifier$CompleteNotificationReceiver" android:exported="false"/> <receiver android:name="org.chromium.chrome.browser.offlinepages.AutoFetchNotifier$InProgressCancelReceiver"
diff --git a/chrome/android/java/res/drawable/new_tab_section_header_content_circle.xml b/chrome/android/java/res/drawable/new_tab_section_header_content_circle.xml index b4d4b2a7..b798a6c 100644 --- a/chrome/android/java/res/drawable/new_tab_section_header_content_circle.xml +++ b/chrome/android/java/res/drawable/new_tab_section_header_content_circle.xml
@@ -4,7 +4,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/new_tab_section_header_content_circle" android:shape="oval"> - <solid android:color="@color/modern_blue_600"/> + <solid android:color="@color/default_icon_color_blue"/> <size android:width="5dp" android:height="5dp"/>
diff --git a/chrome/android/java/res/layout/new_tab_page_section_tab.xml b/chrome/android/java/res/layout/new_tab_page_section_tab.xml index 24c56b3..0c0494e5 100644 --- a/chrome/android/java/res/layout/new_tab_page_section_tab.xml +++ b/chrome/android/java/res/layout/new_tab_page_section_tab.xml
@@ -11,10 +11,7 @@ android:gravity="center_vertical" android:orientation="horizontal" android:focusable="true" - android:paddingTop="0dp" - android:paddingBottom="0dp" - android:paddingLeft="13dp" - android:paddingRight="13dp"> + android:padding="0dp"> <TextView android:id="@android:id/text1"
diff --git a/chrome/android/java/res/values-v21/styles.xml b/chrome/android/java/res/values-v21/styles.xml index 2f8e27cf..48e203b 100644 --- a/chrome/android/java/res/values-v21/styles.xml +++ b/chrome/android/java/res/values-v21/styles.xml
@@ -16,49 +16,6 @@ </style> <style name="Base.Theme.Chromium" parent="Base.V21.Theme.Chromium" /> - <!-- Web Notifications --> - <style name="WebNotificationTitle" - parent="@android:style/TextAppearance.Material.Notification.Title"/> - <style name="WebNotificationBody" - parent="@android:style/TextAppearance.Material.Notification.Line2"/> - <style name="WebNotificationBodyBig" - parent="@android:style/TextAppearance.Material.Notification"/> - <style name="WebNotificationOrigin" - parent="@android:style/TextAppearance.Material.Notification.Info"/> - <style name="WebNotificationTime" - parent="@android:style/TextAppearance.Material.Notification.Time"/> - <style name="WebNotificationDivider"> - <!-- From the non-public Drawable notification_template_divider --> - <item name="android:background">#29000000</item> - </style> - <style name="WebNotificationButtons"> - <item name="android:layout_marginStart">-8dp</item> - </style> - <style name="WebNotificationButton" - parent="@android:style/Widget.DeviceDefault.Light.Button.Borderless.Small"> - <item name="android:background">@drawable/web_notification_button_background</item> - <item name="android:textAppearance">@style/TextAppearance.WebNotificationButton</item> - </style> - <style name="TextAppearance.WebNotificationButton" - parent="android:TextAppearance.DeviceDefault.Widget.Button"> - <item name="android:textColor">@color/secondary_text_default_material_light</item> - </style> - <style name="WebNotificationSettingsButton" - parent="@style/WebNotificationButton"> - <item name="android:textAppearance">@android:style/TextAppearance.Material.Notification.Info</item> - <item name="android:paddingStart">32dp</item> - </style> - <style name="WebNotificationSettingsIcon"> - <!-- This is a blank override of the v17 style. --> - </style> - <style name="WebNotificationLargeIcon"> - <item name="android:padding">12dp</item> - </style> - <style name="WebNotificationSmallIcon"> - <item name="android:background">@drawable/web_notification_small_icon_background</item> - <item name="android:padding">3dp</item> - </style> - <!-- Theme variation for low-end devices. Since ChromeActivities are not HW accelerated, they don't get fancy
diff --git a/chrome/android/java/res/values/styles.xml b/chrome/android/java/res/values/styles.xml index 3c2c755..d4d1619 100644 --- a/chrome/android/java/res/values/styles.xml +++ b/chrome/android/java/res/values/styles.xml
@@ -237,66 +237,6 @@ <item name="android:textAppearance">@style/TextAppearance.FreFirstFrameButton</item> </style> - <!-- Web Notifications --> - <style name="TextAppearance.Notification" - parent="@android:style/TextAppearance.StatusBar.EventContent"> - <!-- This style is defined as a workaround for TextAppearance.StatusBar.EventContent.Line2 - not being exposed by the framework and removed from the Support Library. It copies - the pre v26 implementation, and refers to the text size defined in the Support Library. - --> - <item name="android:textSize">@dimen/notification_subtext_size</item> - - </style> - <style name="WebNotificationTitle" - parent="@android:style/TextAppearance.StatusBar.EventContent.Title"> - <item name="android:layout_marginStart">8dp</item> - </style> - <style name="WebNotificationBody" parent="TextAppearance.Notification"> - <item name="android:layout_marginStart">8dp</item> - </style> - <style name="WebNotificationBodyBig" - parent="@android:style/TextAppearance.StatusBar.EventContent"> - <item name="android:layout_marginStart">8dp</item> - </style> - <style name="WebNotificationOrigin" parent="TextAppearance.Notification"> - <item name="android:layout_marginStart">8dp</item> - </style> - <style name="WebNotificationTime" parent="TextAppearance.Notification"/> - <style name="WebNotificationDivider"> - <item name="android:background">?android:dividerHorizontal</item> - </style> - <style name="WebNotificationButtons"> - <item name="android:layout_marginStart">0dp</item> - <item name="android:showDividers">middle</item> - <item name="android:divider">?android:attr/listDivider</item> - <item name="android:dividerPadding">12dp</item> - </style> - <style name="WebNotificationButton" - parent="@android:style/Widget.DeviceDefault.Button.Borderless.Small"> - <item name="android:textAppearance">@style/TextAppearance.WebNotificationButton</item> - </style> - <style name="TextAppearance.WebNotificationButton" - parent="android:TextAppearance.DeviceDefault.Widget.Button"> - <!-- textColor from the 4.4.4 notification_action.xml - no public aliases. --> - <item name="android:textColor">@color/web_notification_text</item> - </style> - <style name="WebNotificationSettingsButton" - parent="@style/WebNotificationButton"> - <item name="android:textAppearance">@style/TextAppearance.Notification</item> - <item name="android:paddingStart">40dp</item> - <!-- Margin at the end to avoid overlap with the small icon. --> - <item name="android:layout_marginEnd">24dp</item> - </style> - <style name="WebNotificationSettingsIcon"> - <item name="android:layout_marginStart">8dp</item> - </style> - <style name="WebNotificationLargeIcon"> - <item name="android:background">@drawable/notification_template_icon_bg</item> - </style> - <style name="WebNotificationSmallIcon"> - <item name="android:alpha">0.6</item> - </style> - <!-- Generic Overlay Panel styles --> <style name="OverlayPanelTextViewLayout"> <item name="android:layout_width">match_parent</item>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java index e9ad90d..ca8373b0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
@@ -30,6 +30,7 @@ import org.chromium.chrome.browser.datareduction.DataReductionPromoUtils; import org.chromium.chrome.browser.datareduction.DataReductionProxyUma; import org.chromium.chrome.browser.fonts.FontPreloader; +import org.chromium.chrome.browser.lifecycle.NativeInitObserver; import org.chromium.chrome.browser.metrics.UmaUtils; import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; @@ -37,9 +38,7 @@ import org.chromium.ui.base.LocalizationUtils; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; /** * Handles the First Run Experience sequences shown to the user launching Chrome for the first time. @@ -118,8 +117,6 @@ private boolean mFlowIsKnown; private boolean mPostNativeAndPolicyPagesCreated; private boolean mNativeSideIsInitialized; - private Set<FirstRunFragment> mPagesToNotifyOfNativeInit; - private boolean mDeferredCompleteFRE; private FirstRunFlowSequencer mFirstRunFlowSequencer; @@ -156,6 +153,8 @@ ? new TosAndUmaFirstRunFragmentWithEnterpriseSupport.Page() : new ToSAndUMAFirstRunFragment.Page()); mFreProgressStates.add(FRE_PROGRESS_WELCOME_SHOWN); + mPagerAdapter = new FirstRunPagerAdapter(FirstRunActivity.this, mPages); + mPager.setAdapter(mPagerAdapter); // Other pages will be created by createPostNativeAndPoliciesPageSequence() after // native and policy service have been initialized. } @@ -176,11 +175,7 @@ * @see #areNativeAndPoliciesInitialized() */ private void createPostNativeAndPoliciesPageSequence() { - // Note: Can't just use POST_NATIVE_SETUP_NEEDED for the early return, because this - // populates |mPages| which needs to be done even if onNativeDependenciesFullyInitialized() - // was performed in a previous session. - if (mPostNativeAndPolicyPagesCreated) return; - + assert !mPostNativeAndPolicyPagesCreated; assert areNativeAndPoliciesInitialized(); mFirstRunFlowSequencer.onNativeAndPoliciesInitialized(mFreProperties); @@ -260,28 +255,9 @@ @Override public void onFlowIsKnown(Bundle freProperties) { mFlowIsKnown = true; - if (freProperties == null) { - completeFirstRunExperience(); - return; - } - mFreProperties = freProperties; - createPageSequence(); - if (areNativeAndPoliciesInitialized()) { - createPostNativeAndPoliciesPageSequence(); - } - if (mPages.size() == 0) { - completeFirstRunExperience(); - return; - } - - mPagerAdapter = new FirstRunPagerAdapter(FirstRunActivity.this, mPages); - mPager.setAdapter(mPagerAdapter); - - if (areNativeAndPoliciesInitialized()) { - skipPagesIfNecessary(); - } + onInternalStateChanged(); recordFreProgressHistogram(mFreProgressStates.get(0)); long inflationCompletion = SystemClock.elapsedRealtime(); @@ -334,36 +310,36 @@ private void onNativeDependenciesFullyInitialized() { mNativeSideIsInitialized = true; - if (mDeferredCompleteFRE) { - completeFirstRunExperience(); - mDeferredCompleteFRE = false; - } else if (mFlowIsKnown) { - boolean doCreatePostPolicyPageSequence = areNativeAndPoliciesInitialized(); - // Note: If mFlowIsKnown is false, then we're not ready to create the post native page - // sequence - in that case this will be done when onFlowIsKnown() gets called. - if (doCreatePostPolicyPageSequence) { - createPostNativeAndPoliciesPageSequence(); - } - if (mPagesToNotifyOfNativeInit != null) { - for (FirstRunFragment page : mPagesToNotifyOfNativeInit) { - page.onNativeInitialized(); - } - mPagesToNotifyOfNativeInit = null; - } - - if (doCreatePostPolicyPageSequence) { - skipPagesIfNecessary(); - } - } + onInternalStateChanged(); } @Override protected void onPolicyLoadListenerAvailable(boolean onDevicePolicyFound) { super.onPolicyLoadListenerAvailable(onDevicePolicyFound); - if (areNativeAndPoliciesInitialized()) { + onInternalStateChanged(); + } + + private void onInternalStateChanged() { + if (!mFlowIsKnown) { + return; + } + + if (mNativeSideIsInitialized && mFreProperties == null) { + completeFirstRunExperience(); + return; + } + + if (mPagerAdapter == null) { + createPageSequence(); + } + + if (!mPostNativeAndPolicyPagesCreated && areNativeAndPoliciesInitialized()) { createPostNativeAndPoliciesPageSequence(); + } + + if (areNativeAndPoliciesInitialized()) { skipPagesIfNecessary(); } } @@ -380,15 +356,12 @@ if (!(fragment instanceof FirstRunFragment)) return; FirstRunFragment page = (FirstRunFragment) fragment; - if (mNativeSideIsInitialized) { - page.onNativeInitialized(); - return; - } - - if (mPagesToNotifyOfNativeInit == null) { - mPagesToNotifyOfNativeInit = new HashSet<>(); - } - mPagesToNotifyOfNativeInit.add(page); + getLifecycleDispatcher().register(new NativeInitObserver() { + @Override + public void onFinishNativeInitialization() { + page.onNativeInitialized(); + } + }); } @Override @@ -466,11 +439,6 @@ @Override public void completeFirstRunExperience() { - if (!mNativeSideIsInitialized) { - mDeferredCompleteFRE = true; - return; - } - RecordHistogram.recordMediumTimesHistogram("MobileFre.FromLaunch.FreCompleted", SystemClock.elapsedRealtime() - mIntentCreationElapsedRealtimeMs); if (!TextUtils.isEmpty(mResultSignInAccountName)) { @@ -631,8 +599,6 @@ } private void skipPagesIfNecessary() { - if (mPagerAdapter == null) return; - boolean shouldSkip = mPages.get(mPager.getCurrentItem()).shouldSkipPageOnCreate(); while (shouldSkip) { if (!jumpToPage(mPager.getCurrentItem() + 1)) return;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java index c95eb8f71..46bfe080 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
@@ -18,6 +18,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.fragment.app.Fragment; @@ -49,8 +50,17 @@ } } + /** Alerts about some methods once ToSAndUMAFirstRunFragment executes them. */ + public interface Observer { + /** See {@link #onNativeInitialized}. */ + public void onNativeInitialized(); + } + private static boolean sShowUmaCheckBoxForTesting; + @Nullable + private static ToSAndUMAFirstRunFragment.Observer sObserver; + private boolean mNativeInitialized; private boolean mTosButtonClicked; @@ -174,6 +184,10 @@ mNativeInitialized = true; tryMarkTermsAccepted(false); + + if (sObserver != null) { + sObserver.onNativeInitialized(); + } } @Override @@ -266,4 +280,10 @@ public static void setShowUmaCheckBoxForTesting(boolean showForTesting) { sShowUmaCheckBoxForTesting = showForTesting; } + + @VisibleForTesting + public static void setObserverForTesting(ToSAndUMAFirstRunFragment.Observer observer) { + assert sObserver == null; + sObserver = observer; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderView.java index 8526ea4a..a67b1151 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderView.java
@@ -141,6 +141,13 @@ } } + /** Removes a tab. */ + void removeTabAt(int index) { + if (mTabLayout != null) { + mTabLayout.removeTabAt(index); + } + } + /** * Set text for the header tab at a particular index to text. *
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderViewBinder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderViewBinder.java index 9b31cab6..2fd8bad 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderViewBinder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionHeaderViewBinder.java
@@ -62,8 +62,9 @@ @Override public void onItemsRemoved(PropertyListModel<PropertyModel, PropertyKey> model, SectionHeaderView view, int index, int count) { - // Do nothing. We don't expect to remove tabs. - assert false; + for (int i = index + count - 1; i >= index; i--) { + view.removeTabAt(i); + } } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionType.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionType.java new file mode 100644 index 0000000..8752848 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SectionType.java
@@ -0,0 +1,17 @@ +// 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. + +package org.chromium.chrome.browser.ntp.snippets; + +import androidx.annotation.IntDef; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@IntDef({SectionType.FOR_YOU_FEED, SectionType.WEB_FEED}) +@Retention(RetentionPolicy.SOURCE) +public @interface SectionType { + int FOR_YOU_FEED = 0; + int WEB_FEED = 1; +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offline/measurements/OfflineMeasurementsBackgroundTask.java b/chrome/android/java/src/org/chromium/chrome/browser/offline/measurements/OfflineMeasurementsBackgroundTask.java index 42e065f..5788b6b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offline/measurements/OfflineMeasurementsBackgroundTask.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offline/measurements/OfflineMeasurementsBackgroundTask.java
@@ -8,11 +8,15 @@ import android.net.ConnectivityManager; import android.net.Network; import android.net.NetworkCapabilities; +import android.os.PowerManager; +import android.os.SystemClock; import android.provider.Settings; import androidx.annotation.IntDef; import androidx.annotation.VisibleForTesting; +import org.chromium.base.ApplicationState; +import org.chromium.base.ApplicationStatus; import org.chromium.base.Callback; import org.chromium.base.ContextUtils; import org.chromium.base.metrics.RecordHistogram; @@ -59,6 +63,8 @@ private static int sNewMeasurementIntervalInMinutesTestingOverride; private static Boolean sIsAirplaneModeEnabledTestingOverride; private static Boolean sIsRoamingTestingOverride; + private static Boolean sIsInteractiveTestingOverride; + private static Boolean sIsApplicationForegroundTestingOverride; // UMA histograms. public static final String OFFLINE_MEASUREMENTS_MEASUREMENT_INTERVAL = @@ -70,15 +76,16 @@ public static final String OFFLINE_MEASUREMENTS_IS_AIRPLANE_MODE_ENABLED = "Offline.Measurements.IsAirplaneModeEnabled"; public static final String OFFLINE_MEASUREMENTS_IS_ROAMING = "Offline.Measurements.IsRoaming"; + public static final String OFFLINE_MEASUREMENTS_USER_STATE = "Offline.Measurements.UserState"; // The result of the HTTP probing. Defined in tools/metrics/histograms/enums.xml. // These values are persisted to logs. Entries should not be renumbered and // numeric values should never be reused. - @IntDef({ProbeResult.NO_INTERNET, ProbeResult.SERVER_ERROR, ProbeResult.UNEXPECTED_RESPONSE, - ProbeResult.VALIDATED, ProbeResult.CANCELLED}) + @IntDef({ProbeResult.INVALID, ProbeResult.NO_INTERNET, ProbeResult.SERVER_ERROR, + ProbeResult.UNEXPECTED_RESPONSE, ProbeResult.VALIDATED, ProbeResult.CANCELLED}) @Retention(RetentionPolicy.SOURCE) public @interface ProbeResult { - // Value could not be prased from Prefs. + // Value could not be parsed from Prefs. int INVALID = 0; // The HTTP probe could not connect to the Internet. int NO_INTERNET = 1; @@ -96,13 +103,40 @@ int RESULT_COUNT = 6; } + // The state of the phone and how / if the user is interacting with it. Defined in + // tools/metrics/histograms/enums.xml. These values are persisted to logs. Entries should not be + // renumbered and numeric values should never be reused. + @IntDef({UserState.INVALID, UserState.PHONE_OFF, UserState.NOT_USING_PHONE, + UserState.USING_CHROME}) + @Retention(RetentionPolicy.SOURCE) + public @interface UserState { + // Value could not be parsed from Prefs. + int INVALID = 0; + // The user's phone was off.. + int PHONE_OFF = 1; + // The user's phone screen is not interactive. + int NOT_USING_PHONE = 2; + // The user's phone screen is interactive and Chrome is not in the foreground. + int USING_PHONE_NOT_CHROME = 3; + // The user's phone screen is interactive and Chrome is in the foreground. + int USING_CHROME = 4; + // Count. + int RESULT_COUNT = 5; + } + /** * Clock to use so we can mock the time in tests. */ - public interface Clock { - long currentTimeMillis(); + public static class Clock { + long currentTimeMillis() { + return System.currentTimeMillis(); + } + + long elapsedRealtime() { + return SystemClock.elapsedRealtime(); + } } - private static Clock sClock = System::currentTimeMillis; + private static Clock sClock = new Clock(); @VisibleForTesting static void setClockForTesting(Clock clock) { @@ -151,11 +185,18 @@ RecordHistogram.recordBooleanHistogram(OFFLINE_MEASUREMENTS_IS_ROAMING, isRoaming); } + long[] userStateList = getUserStatesFromPrefs(); + for (long userState : userStateList) { + RecordHistogram.recordEnumeratedHistogram( + OFFLINE_MEASUREMENTS_USER_STATE, (int) userState, UserState.RESULT_COUNT); + } + // After logging the data to UMA, clear the data from prefs so it isn't logged again. clearTimeBetweenChecksFromPrefs(); clearHttpProbeResultsFromPrefs(); clearIsAirplaneModeEnabledListFromPrefs(); clearIsRoamingListFromPrefs(); + clearUserStatesFromPrefs(); } private static void scheduleTask() { @@ -182,8 +223,9 @@ .setIntervalMs(TimeUnit.MINUTES.toMillis(newMeasurementIntervalInMinutes)) .build(); - TaskInfo taskInfo = - TaskInfo.createTask(TaskIds.OFFLINE_MEASUREMENT_JOB_ID, timingInfo).build(); + TaskInfo taskInfo = TaskInfo.createTask(TaskIds.OFFLINE_MEASUREMENT_JOB_ID, timingInfo) + .setIsPersisted(true) + .build(); BackgroundTaskSchedulerFactory.getScheduler().schedule( ContextUtils.getApplicationContext(), taskInfo); @@ -245,7 +287,7 @@ ChromePreferenceKeys.OFFLINE_MEASUREMENTS_USER_AGENT_STRING, userAgentString); // Gets the parameters from Finch. If there is a value for a given parameter and it doesn't - // match the default value, then it is written to Prefs.. + // match the default value, then it is written to Prefs. String httpProbeUrl = ChromeFeatureList.getFieldTrialParamByFeature( ChromeFeatureList.OFFLINE_MEASUREMENTS_BACKGROUND_TASK, HTTP_PROBE_URL); if (!httpProbeUrl.isEmpty() && !httpProbeUrl.equals(DEFAULT_HTTP_PROBE_URL)) { @@ -347,16 +389,27 @@ long currentCheckMillis = sClock.currentTimeMillis(); setLastCheckMillis(currentCheckMillis); + boolean didSystemBootSinceLastCheck = false; if (lastCheckMillis > 0) { long timeBetweenChecksMillis = currentCheckMillis - lastCheckMillis; addTimeBetweenChecksToPrefs(timeBetweenChecksMillis); + + long timeSinceBootMillis = sClock.elapsedRealtime(); + didSystemBootSinceLastCheck = timeSinceBootMillis < timeBetweenChecksMillis; } // Gets whether airplane mode is enabled or disabled. boolean isAirplaneModeEnabled = isAirplaneModeEnabled(context); boolean isRoaming = isRoaming(context); + boolean isInteractive = isInteractive(context); + boolean isApplicationForeground = isApplicationForeground(); + + int userState = convertToUserState( + didSystemBootSinceLastCheck, isInteractive, isApplicationForeground); + addIsAirplaneModeEnabledToPrefs(isAirplaneModeEnabled); addIsRoamingToPrefs(isRoaming); + addUserStateToPrefs(userState); // Starts the HTTP probe. sendHttpProbe((Integer result) -> { processResult(result, callback); }); @@ -504,7 +557,7 @@ // If and only if all networks are roaming, then the system is roaming. for (Network network : allNetworks) { NetworkCapabilities networkCapabilities = - connectivityManager.getNetworkCapabilities(allNetworks[0]); + connectivityManager.getNetworkCapabilities(network); if (networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING)) { return false; } @@ -512,6 +565,24 @@ return true; } + private static boolean isInteractive(Context context) { + if (sIsInteractiveTestingOverride != null) { + return sIsInteractiveTestingOverride; + } + + PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); + return powerManager.isInteractive(); + } + + private static boolean isApplicationForeground() { + if (sIsApplicationForegroundTestingOverride != null) { + return sIsApplicationForegroundTestingOverride; + } + + return ApplicationStatus.getStateForApplication() + == ApplicationState.HAS_RUNNING_ACTIVITIES; + } + @VisibleForTesting static void setIsAirplaneModeEnabledForTesting(boolean isAirplaneModeEnabled) { sIsAirplaneModeEnabledTestingOverride = isAirplaneModeEnabled; @@ -522,6 +593,30 @@ sIsRoamingTestingOverride = isRoaming; } + @VisibleForTesting + static void setIsInteractiveForTesting(boolean isInteractive) { + sIsInteractiveTestingOverride = isInteractive; + } + + @VisibleForTesting + static void setIsApplicationForegroundForTesting(boolean isApplicationForeground) { + sIsApplicationForegroundTestingOverride = isApplicationForeground; + } + + private static int convertToUserState(boolean didSystemBootSinceLastCheck, + boolean isInteractive, boolean isApplicationForeground) { + if (didSystemBootSinceLastCheck) { + return UserState.PHONE_OFF; + } + if (!isInteractive) { + return UserState.NOT_USING_PHONE; + } + if (isApplicationForeground) { + return UserState.USING_CHROME; + } + return UserState.USING_PHONE_NOT_CHROME; + } + private static String getTimeBetweenChecksFromPrefsAsString() { return SharedPreferencesManager.getInstance().readString( ChromePreferenceKeys.OFFLINE_MEASUREMENTS_TIME_BETWEEN_CHECKS_MILLIS_LIST, ""); @@ -548,9 +643,8 @@ } private static String getHttpProbeResultsFromPrefsAsString() { - String rv = SharedPreferencesManager.getInstance().readString( + return SharedPreferencesManager.getInstance().readString( ChromePreferenceKeys.OFFLINE_MEASUREMENTS_HTTP_PROBE_RESULTS_LIST, ""); - return rv; } private static void addHttpProbeResultToPrefs(int newValue) { @@ -647,6 +741,32 @@ ChromePreferenceKeys.OFFLINE_MEASUREMENTS_IS_ROAMING_LIST); } + private static String getUserStatesFromPrefsAsString() { + return SharedPreferencesManager.getInstance().readString( + ChromePreferenceKeys.OFFLINE_MEASUREMENTS_USER_STATE_LIST, ""); + } + + private static void addUserStateToPrefs(int newValue) { + // Add new value to comma separate list currently in Prefs. + String existingList = getUserStatesFromPrefsAsString(); + String newList = addValueToStringList(newValue, existingList); + + // Write the new list to Prefs. + SharedPreferencesManager.getInstance().writeString( + ChromePreferenceKeys.OFFLINE_MEASUREMENTS_USER_STATE_LIST, newList); + } + + private static long[] getUserStatesFromPrefs() { + // Get values as an array of longs. + String rawList = getUserStatesFromPrefsAsString(); + return getValuesFromStringList(rawList, UserState.INVALID); + } + + private static void clearUserStatesFromPrefs() { + SharedPreferencesManager.getInstance().removeKey( + ChromePreferenceKeys.OFFLINE_MEASUREMENTS_USER_STATE_LIST); + } + /** * Adds the given value to the end of the comma separated list. * @param newValue Value to be added to the end of the list.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManager.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManager.java index c79f2bb3..4954413 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManager.java
@@ -9,6 +9,10 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; +import android.net.ConnectivityManager; +import android.net.Network; +import android.net.NetworkCapabilities; +import android.net.TransportInfo; import android.net.wifi.ScanResult; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; @@ -30,6 +34,7 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.base.BuildInfo; import org.chromium.base.Callback; import org.chromium.base.compat.ApiHelperForQ; import org.chromium.base.task.PostTask; @@ -60,21 +65,48 @@ * Get the connected wifi, but do not use it (nullify it) if its BSSID is unknown. * * @param context The application context - * @param wifiManager Provides access to wifi information on the device * @return The possibly null connected wifi */ - private static VisibleWifi getConnectedWifiIfKnown(Context context, WifiManager wifiManager) { - VisibleWifi connectedWifi = getConnectedWifi(context, wifiManager); + private static VisibleWifi getConnectedWifiIfKnown(Context context) { + VisibleWifi connectedWifi = getConnectedWifi(context); if (connectedWifi != null && connectedWifi.bssid() == null) { return null; } return connectedWifi; } - static VisibleWifi getConnectedWifi(Context context, WifiManager wifiManager) { + private static WifiInfo getWifiInfo(Context context) { + if (BuildInfo.isAtLeastS()) { + // TODO(https://crbug.com/1181393): Look into taking a dependency on net/android and + // extracting this logic there to a method that can be called from here. + // On Android S+, need to use NetworkCapabilities to get the WifiInfo. + ConnectivityManager connectivityManager = + (ConnectivityManager) context.getApplicationContext().getSystemService( + Context.CONNECTIVITY_SERVICE); + + Network[] allNetworks = connectivityManager.getAllNetworks(); + for (Network network : allNetworks) { + NetworkCapabilities networkCapabilities = + connectivityManager.getNetworkCapabilities(network); + if (networkCapabilities != null + && networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) { + TransportInfo transportInfo = + ApiHelperForQ.getTransportInfo(networkCapabilities); + if (transportInfo != null && transportInfo instanceof WifiInfo) { + return (WifiInfo) transportInfo; + } + } + } + return null; + } + + WifiManager wifiManager = getWifiManager(context); + return wifiManager.getConnectionInfo(); + } + + static VisibleWifi getConnectedWifi(Context context) { if (hasLocationAndWifiPermission(context)) { - WifiInfo wifiInfo = wifiManager.getConnectionInfo(); - return connectedWifiInfoToVisibleWifi(wifiInfo); + return connectedWifiInfoToVisibleWifi(getWifiInfo(context)); } if (hasLocationPermission(context)) { // Only location permission, so fallback to pre-marshmallow. @@ -283,10 +315,9 @@ * @param context The application context */ static VisibleNetworks computeConnectedNetworks(Context context) { - WifiManager wifiManager = getWifiManager(context); TelephonyManager telephonyManager = getTelephonyManager(context); - VisibleWifi connectedWifi = getConnectedWifiIfKnown(context, wifiManager); + VisibleWifi connectedWifi = getConnectedWifiIfKnown(context); VisibleCell connectedCell = getConnectedCellIfKnown(context, telephonyManager); return VisibleNetworks.create(connectedWifi, connectedCell, null, null); @@ -305,13 +336,12 @@ * @param callback The callback to invoke with the results of this computation */ static void computeVisibleNetworks(Context context, Callback<VisibleNetworks> callback) { - WifiManager wifiManager = getWifiManager(context); TelephonyManager telephonyManager = getTelephonyManager(context); - VisibleWifi connectedWifi = getConnectedWifiIfKnown(context, wifiManager); + VisibleWifi connectedWifi = getConnectedWifiIfKnown(context); VisibleCell connectedCell = getConnectedCellIfKnown(context, telephonyManager); - Set<VisibleWifi> allVisibleWifis = getAllVisibleWifis(context, wifiManager); + Set<VisibleWifi> allVisibleWifis = getAllVisibleWifis(context, getWifiManager(context)); getAllVisibleCells(context, telephonyManager, (allVisibleCells) -> { callback.onResult(VisibleNetworks.create( @@ -326,8 +356,7 @@ private static WifiManager getWifiManager(Context context) { Context applicationContext = context.getApplicationContext(); - Object wifiManager = applicationContext.getSystemService(Context.WIFI_SERVICE); - return (WifiManager) wifiManager; + return (WifiManager) applicationContext.getSystemService(Context.WIFI_SERVICE); } private static boolean hasPermission(Context context, String permission) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfo.java index f9c1f9b..8d22188 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfo.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfo.java
@@ -51,6 +51,6 @@ new ChromePageInfoControllerDelegate(activity, webContents, mModalDialogManagerSupplier, new OfflinePageUtils.TabOfflinePageLoadUrlDelegate(tab)), - new ChromePermissionParamsListBuilderDelegate(), permission); + permission); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePermissionParamsListBuilderDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePermissionParamsListBuilderDelegate.java deleted file mode 100644 index 483900a..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePermissionParamsListBuilderDelegate.java +++ /dev/null
@@ -1,43 +0,0 @@ -// Copyright 2020 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.page_info; - -import androidx.annotation.Nullable; -import androidx.annotation.VisibleForTesting; - -import org.chromium.chrome.browser.browserservices.permissiondelegation.TrustedWebActivityPermissionManager; -import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.components.content_settings.ContentSettingsType; -import org.chromium.components.embedder_support.util.Origin; -import org.chromium.components.page_info.PermissionParamsListBuilderDelegate; - -/** - * Chrome's customization of PermissionParamsListBuilderDelegate logic. - */ -public class ChromePermissionParamsListBuilderDelegate extends PermissionParamsListBuilderDelegate { - private static Profile sProfileForTesting; - - public ChromePermissionParamsListBuilderDelegate() { - super((sProfileForTesting != null) ? sProfileForTesting - : Profile.getLastUsedRegularProfile()); - } - - @Override - @Nullable - public String getDelegateAppName(Origin origin, @ContentSettingsType int type) { - if (type != ContentSettingsType.NOTIFICATIONS) { - return null; - } - - assert origin != null; - TrustedWebActivityPermissionManager manager = TrustedWebActivityPermissionManager.get(); - return manager.getDelegateAppName(origin); - } - - @VisibleForTesting - public static void setProfileForTesting(Profile profileForTesting) { - sProfileForTesting = profileForTesting; - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarCoordinator.java index 436d39e9f..9603176 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarCoordinator.java
@@ -14,7 +14,6 @@ import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.page_info.ChromePageInfoControllerDelegate; -import org.chromium.chrome.browser.page_info.ChromePermissionParamsListBuilderDelegate; import org.chromium.chrome.browser.payments.handler.toolbar.PaymentHandlerToolbarMediator.PaymentHandlerToolbarMediatorDelegate; import org.chromium.components.omnibox.SecurityStatusIcon; import org.chromium.components.page_info.PageInfoController; @@ -150,7 +149,6 @@ mModalDialogManagerSupplier, /*offlinePageLoadUrlDelegate=*/ new OfflinePageUtils.WebContentsOfflinePageLoadUrlDelegate(mWebContents)), - new ChromePermissionParamsListBuilderDelegate(), PageInfoController.NO_HIGHLIGHTED_PERMISSION); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java index 033cd715..f2016a9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
@@ -171,7 +171,7 @@ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { // If we are on Android O+ the Notifications preference should lead to the Android - // Settings notifications page, not to Chrome's notifications settings page. + // Settings notifications page. Preference notifications = findPreference(PREF_NOTIFICATIONS); notifications.setOnPreferenceClickListener(preference -> { Intent intent = new Intent(); @@ -183,7 +183,7 @@ return true; }); } else { - // The per-website notification settings page. The latter can be accessed from Site + // The per-website notification settings page can be accessed from Site // Settings, so we don't need to show this here. getPreferenceScreen().removePreference(findPreference(PREF_NOTIFICATIONS)); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkServiceClient.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkServiceClient.java index 3622af3a..829ca1c41 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkServiceClient.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkServiceClient.java
@@ -23,6 +23,7 @@ import org.chromium.chrome.browser.metrics.WebApkUma; import org.chromium.chrome.browser.notifications.NotificationBuilderBase; import org.chromium.chrome.browser.notifications.NotificationUmaTracker; +import org.chromium.chrome.browser.notifications.channels.ChromeChannelDefinitions; import org.chromium.components.browser_ui.notifications.NotificationMetadata; import org.chromium.content_public.browser.UiThreadTaskTraits; import org.chromium.webapk.lib.client.WebApkServiceConnectionManager; @@ -54,12 +55,6 @@ } } - /** - * Keeps the value consistent with {@link - * org.chromium.webapk.shell_apk.WebApkServiceImplWrapper#DEFAULT_NOTIFICATION_CHANNEL_ID}. - */ - public static final String CHANNEL_ID_WEBAPKS = "default_channel_id"; - private static final String CATEGORY_WEBAPK_API = "android.intent.category.WEBAPK_API"; private static final String TAG = "WebApk"; @@ -98,7 +93,8 @@ if (notificationPermissionEnabled) { String channelName = null; if (webApkTargetsAtLeastO(webApkPackage)) { - notificationBuilder.setChannelId(CHANNEL_ID_WEBAPKS); + notificationBuilder.setChannelId( + ChromeChannelDefinitions.CHANNEL_ID_WEBAPKS); channelName = ContextUtils.getApplicationContext().getString( org.chromium.chrome.R.string.webapk_notification_channel_name); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityAppMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityAppMenuTest.java new file mode 100644 index 0000000..e10f3d9 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityAppMenuTest.java
@@ -0,0 +1,471 @@ +// 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. + +package org.chromium.chrome.browser.customtabs; + +import static org.hamcrest.Matchers.equalTo; +import static org.junit.Assert.assertEquals; + +import static org.chromium.chrome.browser.customtabs.CustomTabsTestUtils.getVisibleMenuSize; + +import android.app.Activity; +import android.app.Instrumentation; +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.net.Uri; +import android.os.Bundle; +import android.support.test.InstrumentationRegistry; +import android.view.Menu; +import android.view.MenuItem; +import android.view.SubMenu; + +import androidx.annotation.IdRes; +import androidx.browser.customtabs.CustomTabsCallback; +import androidx.browser.customtabs.CustomTabsIntent; +import androidx.browser.customtabs.CustomTabsSession; +import androidx.browser.customtabs.CustomTabsSessionToken; +import androidx.test.filters.SmallTest; + +import org.hamcrest.Matchers; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.library_loader.LibraryLoader; +import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.task.PostTask; +import org.chromium.base.test.util.CallbackHelper; +import org.chromium.base.test.util.Criteria; +import org.chromium.base.test.util.CriteriaHelper; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.IntentHandler; +import org.chromium.chrome.browser.app.metrics.LaunchCauseMetrics; +import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider.CustomTabsUiType; +import org.chromium.chrome.browser.document.ChromeLauncherActivity; +import org.chromium.chrome.browser.firstrun.FirstRunStatus; +import org.chromium.chrome.browser.test.ScreenShooter; +import org.chromium.chrome.browser.ui.appmenu.AppMenuCoordinator; +import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; +import org.chromium.chrome.browser.ui.appmenu.AppMenuTestSupport; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.content_public.browser.UiThreadTaskTraits; +import org.chromium.content_public.browser.test.util.TestThreadUtils; + +import java.util.concurrent.TimeoutException; + +/** + * Integration tests for the Custom Tab App Menu. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +public class CustomTabActivityAppMenuTest { + private static final int MAX_MENU_CUSTOM_ITEMS = 5; + private static final int NUM_CHROME_MENU_ITEMS = 5; + private static final String TEST_PAGE = "/chrome/test/data/android/google.html"; + private static final String TEST_MENU_TITLE = "testMenuTitle"; + + @Rule + public CustomTabActivityTestRule mCustomTabActivityTestRule = new CustomTabActivityTestRule(); + @Rule + public final ScreenShooter mScreenShooter = new ScreenShooter(); + + private String mTestPage; + + @Before + public void setUp() throws Exception { + TestThreadUtils.runOnUiThreadBlocking(() -> FirstRunStatus.setFirstRunFlowComplete(true)); + mTestPage = mCustomTabActivityTestRule.getTestServer().getURL(TEST_PAGE); + LibraryLoader.getInstance().ensureInitialized(); + } + + @After + public void tearDown() { + TestThreadUtils.runOnUiThreadBlocking(() -> FirstRunStatus.setFirstRunFlowComplete(false)); + + // finish() is called on a non-UI thread by the testing harness. Must hide the menu + // first, otherwise the UI is manipulated on a non-UI thread. + TestThreadUtils.runOnUiThreadBlocking(() -> { + if (mCustomTabActivityTestRule.getActivity() == null) return; + AppMenuCoordinator coordinator = mCustomTabActivityTestRule.getAppMenuCoordinator(); + // CCT doesn't always have a menu (ex. in the media viewer). + if (coordinator == null) return; + AppMenuHandler handler = coordinator.getAppMenuHandler(); + if (handler != null) handler.hideAppMenu(); + }); + } + + private Intent createMinimalCustomTabIntent() { + return CustomTabsTestUtils.createMinimalCustomTabIntent( + InstrumentationRegistry.getTargetContext(), mTestPage); + } + + private CustomTabIntentDataProvider getCustomTabIntentDataProvider() { + return (CustomTabIntentDataProvider) mCustomTabActivityTestRule.getActivity() + .getIntentDataProvider(); + } + + private void openAppMenuAndAssertMenuShown() { + CustomTabsTestUtils.openAppMenuAndAssertMenuShown(mCustomTabActivityTestRule.getActivity()); + } + + /** + * @return The number of visible and enabled items in the given menu. + */ + private int getActualMenuSize(Menu menu) { + int actualMenuSize = 0; + for (int i = 0; i < menu.size(); i++) { + MenuItem item = menu.getItem(i); + if (item.isVisible() && item.isEnabled()) actualMenuSize++; + } + return actualMenuSize; + } + + private void assertAppMenuItemNotVisible(Menu menu, @IdRes int id, String itemName) { + MenuItem item = menu.findItem(id); + Assert.assertNotNull(String.format("Cannot find <%s>", itemName), item); + Assert.assertFalse(String.format("<%s> is visible", itemName), item.isVisible()); + } + + /** + * Test the entries in the app menu. + */ + @Test + @SmallTest + public void testAppMenu() throws Exception { + Intent intent = createMinimalCustomTabIntent(); + int numMenuEntries = 1; + CustomTabsTestUtils.addMenuEntriesToIntent(intent, numMenuEntries, TEST_MENU_TITLE); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + + openAppMenuAndAssertMenuShown(); + Menu menu = mCustomTabActivityTestRule.getMenu(); + final int expectedMenuSize = numMenuEntries + NUM_CHROME_MENU_ITEMS; + + Assert.assertNotNull("App menu is not initialized: ", menu); + assertEquals(expectedMenuSize, getActualMenuSize(menu)); + assertEquals(expectedMenuSize, getVisibleMenuSize(menu)); + Assert.assertNotNull(menu.findItem(R.id.forward_menu_id)); + Assert.assertNotNull(menu.findItem(R.id.bookmark_this_page_id)); + Assert.assertNotNull(menu.findItem(R.id.offline_page_id)); + Assert.assertNotNull(menu.findItem(R.id.info_menu_id)); + Assert.assertNotNull(menu.findItem(R.id.reload_menu_id)); + Assert.assertNotNull(menu.findItem(R.id.open_in_browser_id)); + Assert.assertFalse(menu.findItem(R.id.share_row_menu_id).isVisible()); + Assert.assertFalse(menu.findItem(R.id.share_row_menu_id).isEnabled()); + Assert.assertNotNull(menu.findItem(R.id.find_in_page_id)); + Assert.assertNotNull(menu.findItem(R.id.add_to_homescreen_id)); + Assert.assertNotNull(menu.findItem(R.id.request_desktop_site_row_menu_id)); + Assert.assertNotNull(menu.findItem(R.id.translate_id)); + + mScreenShooter.shoot("Testtttt"); + } + + /** + * Test the App Menu does not show for media viewer. + */ + @Test + @SmallTest + public void testAppMenuForMediaViewer() { + Intent intent = createMinimalCustomTabIntent(); + intent.putExtra(CustomTabIntentDataProvider.EXTRA_UI_TYPE, CustomTabsUiType.MEDIA_VIEWER); + IntentHandler.addTrustedIntentExtras(intent); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + + PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { + mCustomTabActivityTestRule.getActivity().onMenuOrKeyboardAction(R.id.show_menu, false); + Assert.assertNull(mCustomTabActivityTestRule.getAppMenuCoordinator()); + }); + } + + /** + * Test the entries in app menu for Reader Mode. + */ + @Test + @SmallTest + public void testAppMenuForReaderMode() throws Exception { + Intent intent = createMinimalCustomTabIntent(); + intent.putExtra(CustomTabIntentDataProvider.EXTRA_UI_TYPE, CustomTabsUiType.READER_MODE); + IntentHandler.addTrustedIntentExtras(intent); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + + openAppMenuAndAssertMenuShown(); + Menu menu = mCustomTabActivityTestRule.getMenu(); + final int expectedMenuSize = 2; + + Assert.assertNotNull("App menu is not initialized: ", menu); + assertEquals(expectedMenuSize, getActualMenuSize(menu)); + assertEquals(expectedMenuSize, getVisibleMenuSize(menu)); + Assert.assertTrue(menu.findItem(R.id.find_in_page_id).isVisible()); + Assert.assertTrue(menu.findItem(R.id.reader_mode_prefs_id).isVisible()); + } + + /** + * Test the entries in app menu for media viewer. + */ + @Test + @SmallTest + public void testAppMenuForOfflinePage() throws Exception { + Intent intent = createMinimalCustomTabIntent(); + intent.putExtra(CustomTabIntentDataProvider.EXTRA_UI_TYPE, + CustomTabIntentDataProvider.CustomTabsUiType.OFFLINE_PAGE); + IntentHandler.addTrustedIntentExtras(intent); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + + openAppMenuAndAssertMenuShown(); + Menu menu = mCustomTabActivityTestRule.getMenu(); + final int expectedMenuSize = 3; + + Assert.assertNotNull("App menu is not initialized: ", menu); + assertEquals(expectedMenuSize, getActualMenuSize(menu)); + assertEquals(expectedMenuSize, getVisibleMenuSize(menu)); + Assert.assertTrue(menu.findItem(R.id.find_in_page_id).isVisible()); + Assert.assertNotNull(menu.findItem(R.id.request_desktop_site_row_menu_id)); + + MenuItem icon_row = menu.findItem(R.id.icon_row_menu_id); + Assert.assertNotNull(icon_row); + Assert.assertNotNull(icon_row.hasSubMenu()); + SubMenu icon_row_menu = icon_row.getSubMenu(); + final int expectedIconMenuSize = 4; + assertEquals(expectedIconMenuSize, getVisibleMenuSize(icon_row_menu)); + Assert.assertNotNull(icon_row_menu.findItem(R.id.forward_menu_id)); + Assert.assertNotNull(icon_row_menu.findItem(R.id.bookmark_this_page_id)); + Assert.assertNotNull(icon_row_menu.findItem(R.id.info_menu_id)); + Assert.assertNotNull(icon_row_menu.findItem(R.id.reload_menu_id)); + } + + @Test + @SmallTest + public void testAppMenuBeforeFirstRun() throws Exception { + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(createMinimalCustomTabIntent()); + // Mark the first run as not completed. This has to be done after we start the intent, + // otherwise we are going to hit the FRE. + TestThreadUtils.runOnUiThreadBlocking(() -> FirstRunStatus.setFirstRunFlowComplete(false)); + + openAppMenuAndAssertMenuShown(); + Menu menu = mCustomTabActivityTestRule.getMenu(); + final int expectedMenuSize = 3; + + Assert.assertNotNull("App menu is not initialized: ", menu); + assertEquals(expectedMenuSize, getActualMenuSize(menu)); + assertEquals(expectedMenuSize, getVisibleMenuSize(menu)); + + // Checks the first row (icons). + Assert.assertNotNull(menu.findItem(R.id.forward_menu_id)); + Assert.assertNotNull(menu.findItem(R.id.info_menu_id)); + Assert.assertNotNull(menu.findItem(R.id.reload_menu_id)); + assertAppMenuItemNotVisible(menu, R.id.offline_page_id, "offline_page"); + assertAppMenuItemNotVisible(menu, R.id.bookmark_this_page_id, "bookmark_this_page"); + + // Following rows. + Assert.assertNotNull(menu.findItem(R.id.find_in_page_id)); + Assert.assertNotNull(menu.findItem(R.id.request_desktop_site_row_menu_id)); + assertAppMenuItemNotVisible(menu, R.id.open_in_browser_id, "open_in_browser"); + assertAppMenuItemNotVisible(menu, R.id.add_to_homescreen_id, "add_to_homescreen"); + } + + /** + * Tests if the default share item can be shown in the app menu. + */ + @Test + @SmallTest + public void testShareMenuItem() throws Exception { + Intent intent = createMinimalCustomTabIntent(); + intent.putExtra(CustomTabsIntent.EXTRA_DEFAULT_SHARE_MENU_ITEM, true); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + + openAppMenuAndAssertMenuShown(); + Menu menu = mCustomTabActivityTestRule.getMenu(); + Assert.assertTrue(menu.findItem(R.id.share_menu_id).isVisible()); + Assert.assertTrue(menu.findItem(R.id.share_menu_id).isEnabled()); + } + + /** + * Test that only up to 5 entries are added to the custom menu. + */ + @Test + @SmallTest + public void testMaxMenuItems() throws Exception { + Intent intent = createMinimalCustomTabIntent(); + int numMenuEntries = 7; + Assert.assertTrue(MAX_MENU_CUSTOM_ITEMS < numMenuEntries); + CustomTabsTestUtils.addMenuEntriesToIntent(intent, numMenuEntries, TEST_MENU_TITLE); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + + openAppMenuAndAssertMenuShown(); + Menu menu = mCustomTabActivityTestRule.getMenu(); + final int expectedMenuSize = MAX_MENU_CUSTOM_ITEMS + NUM_CHROME_MENU_ITEMS; + Assert.assertNotNull("App menu is not initialized: ", menu); + assertEquals(expectedMenuSize, getActualMenuSize(menu)); + assertEquals(expectedMenuSize, getVisibleMenuSize(menu)); + } + + /** + * Test whether the custom menu is correctly shown and clicking it sends the right + * {@link PendingIntent}. + */ + @Test + @SmallTest + public void testCustomMenuEntry() throws TimeoutException { + Intent customTabIntent = createMinimalCustomTabIntent(); + Intent baseCallbackIntent = new Intent(); + baseCallbackIntent.putExtra("FOO", 42); + final PendingIntent pi = CustomTabsTestUtils.addMenuEntriesToIntent( + customTabIntent, 1, baseCallbackIntent, TEST_MENU_TITLE); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(customTabIntent); + + final CustomTabsTestUtils.OnFinishedForTest onFinished = + new CustomTabsTestUtils.OnFinishedForTest(pi); + getCustomTabIntentDataProvider().setPendingIntentOnFinishedForTesting(onFinished); + + openAppMenuAndAssertMenuShown(); + PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { + MenuItem item = ((CustomTabAppMenuPropertiesDelegate) + AppMenuTestSupport.getAppMenuPropertiesDelegate( + mCustomTabActivityTestRule.getAppMenuCoordinator())) + .getMenuItemForTitle(TEST_MENU_TITLE); + Assert.assertNotNull(item); + AppMenuTestSupport.onOptionsItemSelected( + mCustomTabActivityTestRule.getAppMenuCoordinator(), item); + }); + + onFinished.waitForCallback("Pending Intent was not sent."); + Intent callbackIntent = onFinished.getCallbackIntent(); + Assert.assertThat(callbackIntent.getDataString(), equalTo(mTestPage)); + + // Verify that the callback intent has the page title as the subject, but other extras are + // kept intact. + Assert.assertThat( + callbackIntent.getStringExtra(Intent.EXTRA_SUBJECT), equalTo("The Google")); + Assert.assertThat(callbackIntent.getIntExtra("FOO", 0), equalTo(42)); + } + + /** + * Test whether clicking "Open in Chrome" takes us to a chrome normal tab, loading the same url. + */ + @Test + @SmallTest + public void testOpenInBrowser() throws Exception { + // Augment the CustomTabsSession to catch the callback. + CallbackHelper callbackTriggered = new CallbackHelper(); + CustomTabsSession session = + CustomTabsTestUtils + .bindWithCallback(new CustomTabsCallback() { + @Override + public void extraCallback(String callbackName, Bundle args) { + if (callbackName.equals( + CustomTabsConnection.OPEN_IN_BROWSER_CALLBACK)) { + callbackTriggered.notifyCalled(); + } + } + }) + .session; + + Intent intent = new CustomTabsIntent.Builder(session).build().intent; + intent.setData(Uri.parse(mTestPage)); + intent.setComponent(new ComponentName( + InstrumentationRegistry.getTargetContext(), ChromeLauncherActivity.class)); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + // These ensure the open in chrome chooser is not shown. + intent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_OPENED_BY_CHROME, true); + IntentHandler.setForceIntentSenderChromeToTrue(true); + + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + assertEquals(1, + RecordHistogram.getHistogramValueCountForTesting( + LaunchCauseMetrics.LAUNCH_CAUSE_HISTOGRAM, + LaunchCauseMetrics.LaunchCause.CUSTOM_TAB)); + + IntentFilter filter = new IntentFilter(Intent.ACTION_VIEW); + filter.addDataScheme( + Uri.parse(mCustomTabActivityTestRule.getTestServer().getURL("/")).getScheme()); + final Instrumentation.ActivityMonitor monitor = + InstrumentationRegistry.getInstrumentation().addMonitor(filter, null, false); + openAppMenuAndAssertMenuShown(); + PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { + MenuItem item = + AppMenuTestSupport.getMenu(mCustomTabActivityTestRule.getAppMenuCoordinator()) + .findItem(R.id.open_in_browser_id); + Assert.assertNotNull(item); + mCustomTabActivityTestRule.getActivity().onMenuOrKeyboardAction( + R.id.open_in_browser_id, false); + }); + final Activity activity = + monitor.waitForActivityWithTimeout(CriteriaHelper.DEFAULT_MAX_TIME_TO_POLL); + + callbackTriggered.waitForCallback(0); + + CriteriaHelper.pollInstrumentationThread(() -> { + Criteria.checkThat(RecordHistogram.getHistogramValueCountForTesting( + LaunchCauseMetrics.LAUNCH_CAUSE_HISTOGRAM, + LaunchCauseMetrics.LaunchCause.OPEN_IN_BROWSER_FROM_MENU), + Matchers.is(1)); + }, 5000L, CriteriaHelper.DEFAULT_POLLING_INTERVAL); + activity.finish(); + } + + @Test + @SmallTest + public void testHideOpenInChromeMenuItem() throws Exception { + Context context = InstrumentationRegistry.getInstrumentation() + .getTargetContext() + .getApplicationContext(); + Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage); + intent.setData(Uri.parse(mTestPage)); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.putExtra(CustomTabIntentDataProvider.EXTRA_HIDE_OPEN_IN_CHROME_MENU_ITEM, true); + CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + CustomTabsConnection connection = CustomTabsConnection.getInstance(); + connection.newSession(token); + connection.overridePackageNameForSessionForTesting( + token, "com.google.android.googlequicksearchbox"); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + + IntentFilter filter = new IntentFilter(Intent.ACTION_VIEW); + final Instrumentation.ActivityMonitor monitor = + InstrumentationRegistry.getInstrumentation().addMonitor(filter, null, false); + openAppMenuAndAssertMenuShown(); + PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { + MenuItem item = + AppMenuTestSupport.getMenu(mCustomTabActivityTestRule.getAppMenuCoordinator()) + .findItem(R.id.open_in_browser_id); + // The menu item should be there, but hidden. + Assert.assertNotNull(item); + Assert.assertFalse(item.isVisible()); + }); + } + + @Test + @SmallTest + public void testHideOpenInChromeMenuItemVisibleWithWrongPackage() throws Exception { + Context context = InstrumentationRegistry.getInstrumentation() + .getTargetContext() + .getApplicationContext(); + Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage); + intent.setData(Uri.parse(mTestPage)); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.putExtra(CustomTabIntentDataProvider.EXTRA_HIDE_OPEN_IN_CHROME_MENU_ITEM, true); + CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); + CustomTabsConnection connection = CustomTabsConnection.getInstance(); + connection.newSession(token); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); + + IntentFilter filter = new IntentFilter(Intent.ACTION_VIEW); + final Instrumentation.ActivityMonitor monitor = + InstrumentationRegistry.getInstrumentation().addMonitor(filter, null, false); + openAppMenuAndAssertMenuShown(); + PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { + MenuItem item = + AppMenuTestSupport.getMenu(mCustomTabActivityTestRule.getAppMenuCoordinator()) + .findItem(R.id.open_in_browser_id); + // As the package name doesn't match the expected package, the item should be visible. + Assert.assertNotNull(item); + Assert.assertTrue(item.isVisible()); + }); + } +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityIncognitoTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityIncognitoTest.java index 5686604..605927548 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityIncognitoTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityIncognitoTest.java
@@ -462,9 +462,9 @@ // views with the @RemoteView annotation. RemoteViews remoteViews = new RemoteViews(InstrumentationRegistry.getTargetContext().getPackageName(), - R.layout.web_notification); - remoteViews.setTextViewText(R.id.title, "Kittens!"); - remoteViews.setTextViewText(R.id.body, "So fluffy"); + R.layout.share_sheet_item); + remoteViews.setTextViewText(R.id.text, "Kittens!"); + remoteViews.setTextViewText(R.id.display_new, "So fluffy"); remoteViews.setImageViewResource(R.id.icon, R.drawable.ic_email_googblue_36dp); intent.putExtra(CustomTabsIntent.EXTRA_REMOTEVIEWS, remoteViews); intent.putExtra(CustomTabsIntent.EXTRA_REMOTEVIEWS_VIEW_IDS, new int[] {R.id.icon});
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java index 7f11609..93e0e62 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -15,7 +15,6 @@ import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_END_DEVICE; import static org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule.LONG_TIMEOUT_MS; import static org.chromium.chrome.browser.customtabs.CustomTabsTestUtils.createTestBitmap; -import static org.chromium.chrome.browser.customtabs.CustomTabsTestUtils.getVisibleMenuSize; import static org.chromium.components.content_settings.PrefNames.COOKIE_CONTROLS_MODE; import android.app.Activity; @@ -39,9 +38,7 @@ import android.os.SystemClock; import android.provider.Browser; import android.support.test.InstrumentationRegistry; -import android.view.Menu; import android.view.MenuItem; -import android.view.SubMenu; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; @@ -50,7 +47,6 @@ import android.widget.TextView; import androidx.annotation.DrawableRes; -import androidx.annotation.IdRes; import androidx.appcompat.content.res.AppCompatResources; import androidx.browser.customtabs.CustomTabsCallback; import androidx.browser.customtabs.CustomTabsIntent; @@ -95,7 +91,6 @@ import org.chromium.chrome.browser.app.metrics.LaunchCauseMetrics; import org.chromium.chrome.browser.browserservices.SessionDataHolder; import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider; -import org.chromium.chrome.browser.browserservices.intents.BrowserServicesIntentDataProvider.CustomTabsUiType; import org.chromium.chrome.browser.browserservices.verification.OriginVerifier; import org.chromium.chrome.browser.contextmenu.RevampedContextMenuCoordinator; import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils.OnFinishedForTest; @@ -171,8 +166,6 @@ public CustomTabActivityTestRule mCustomTabActivityTestRule = new CustomTabActivityTestRule(); private static final int TIMEOUT_PAGE_LOAD_SECONDS = 10; - private static final int MAX_MENU_CUSTOM_ITEMS = 5; - private static final int NUM_CHROME_MENU_ITEMS = 5; private static final String TEST_PAGE = "/chrome/test/data/android/google.html"; private static final String TEST_PAGE_2 = "/chrome/test/data/android/test.html"; private static final String POPUP_PAGE = @@ -181,7 +174,6 @@ private static final String FRAGMENT_TEST_PAGE = "/chrome/test/data/android/fragment.html"; private static final String TARGET_BLANK_TEST_PAGE = "/chrome/test/data/android/cct_target_blank.html"; - private static final String TEST_MENU_TITLE = "testMenuTitle"; private static final String JS_MESSAGE = "from_js"; private static final String TITLE_FROM_POSTMESSAGE_TO_CHANNEL = "<!DOCTYPE html><html><body>" @@ -352,24 +344,6 @@ CustomTabsTestUtils.openAppMenuAndAssertMenuShown(mCustomTabActivityTestRule.getActivity()); } - private void assertAppMenuItemNotVisible(Menu menu, @IdRes int id, String itemName) { - MenuItem item = menu.findItem(id); - Assert.assertNotNull(String.format("Cannot find <%s>", itemName), item); - Assert.assertFalse(String.format("<%s> is visible", itemName), item.isVisible()); - } - - /** - * @return The number of visible and enabled items in the given menu. - */ - private int getActualMenuSize(Menu menu) { - int actualMenuSize = 0; - for (int i = 0; i < menu.size(); i++) { - MenuItem item = menu.getItem(i); - if (item.isVisible() && item.isEnabled()) actualMenuSize++; - } - return actualMenuSize; - } - private Bitmap createVectorDrawableBitmap(@DrawableRes int resId, int widthDp, int heightDp) { Context context = InstrumentationRegistry.getTargetContext(); Drawable vectorDrawable = AppCompatResources.getDrawable(context, resId); @@ -539,277 +513,6 @@ } /** - * Test the entries in the app menu. - */ - @Test - @SmallTest - public void testAppMenu() throws Exception { - Intent intent = createMinimalCustomTabIntent(); - int numMenuEntries = 1; - CustomTabsTestUtils.addMenuEntriesToIntent(intent, numMenuEntries, TEST_MENU_TITLE); - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - - openAppMenuAndAssertMenuShown(); - Menu menu = mCustomTabActivityTestRule.getMenu(); - final int expectedMenuSize = numMenuEntries + NUM_CHROME_MENU_ITEMS; - - Assert.assertNotNull("App menu is not initialized: ", menu); - assertEquals(expectedMenuSize, getActualMenuSize(menu)); - assertEquals(expectedMenuSize, getVisibleMenuSize(menu)); - Assert.assertNotNull(menu.findItem(R.id.forward_menu_id)); - Assert.assertNotNull(menu.findItem(R.id.bookmark_this_page_id)); - Assert.assertNotNull(menu.findItem(R.id.offline_page_id)); - Assert.assertNotNull(menu.findItem(R.id.info_menu_id)); - Assert.assertNotNull(menu.findItem(R.id.reload_menu_id)); - Assert.assertNotNull(menu.findItem(R.id.open_in_browser_id)); - Assert.assertFalse(menu.findItem(R.id.share_row_menu_id).isVisible()); - Assert.assertFalse(menu.findItem(R.id.share_row_menu_id).isEnabled()); - Assert.assertNotNull(menu.findItem(R.id.find_in_page_id)); - Assert.assertNotNull(menu.findItem(R.id.add_to_homescreen_id)); - Assert.assertNotNull(menu.findItem(R.id.request_desktop_site_row_menu_id)); - Assert.assertNotNull(menu.findItem(R.id.translate_id)); - - mScreenShooter.shoot("Testtttt"); - } - - /** - * Test the App Menu does not show for media viewer. - */ - @Test - @SmallTest - public void testAppMenuForMediaViewer() { - Intent intent = createMinimalCustomTabIntent(); - intent.putExtra(CustomTabIntentDataProvider.EXTRA_UI_TYPE, CustomTabsUiType.MEDIA_VIEWER); - IntentHandler.addTrustedIntentExtras(intent); - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - - PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { - getActivity().onMenuOrKeyboardAction(R.id.show_menu, false); - Assert.assertNull(mCustomTabActivityTestRule.getAppMenuCoordinator()); - }); - } - - /** - * Test the entries in app menu for Reader Mode. - */ - @Test - @SmallTest - public void testAppMenuForReaderMode() throws Exception { - Intent intent = createMinimalCustomTabIntent(); - intent.putExtra(CustomTabIntentDataProvider.EXTRA_UI_TYPE, CustomTabsUiType.READER_MODE); - IntentHandler.addTrustedIntentExtras(intent); - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - - openAppMenuAndAssertMenuShown(); - Menu menu = mCustomTabActivityTestRule.getMenu(); - final int expectedMenuSize = 2; - - Assert.assertNotNull("App menu is not initialized: ", menu); - assertEquals(expectedMenuSize, getActualMenuSize(menu)); - assertEquals(expectedMenuSize, getVisibleMenuSize(menu)); - Assert.assertTrue(menu.findItem(R.id.find_in_page_id).isVisible()); - Assert.assertTrue(menu.findItem(R.id.reader_mode_prefs_id).isVisible()); - } - - /** - * Test the entries in app menu for media viewer. - */ - @Test - @SmallTest - public void testAppMenuForOfflinePage() throws Exception { - Intent intent = createMinimalCustomTabIntent(); - intent.putExtra(CustomTabIntentDataProvider.EXTRA_UI_TYPE, - CustomTabIntentDataProvider.CustomTabsUiType.OFFLINE_PAGE); - IntentHandler.addTrustedIntentExtras(intent); - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - - openAppMenuAndAssertMenuShown(); - Menu menu = mCustomTabActivityTestRule.getMenu(); - final int expectedMenuSize = 3; - - Assert.assertNotNull("App menu is not initialized: ", menu); - assertEquals(expectedMenuSize, getActualMenuSize(menu)); - assertEquals(expectedMenuSize, getVisibleMenuSize(menu)); - Assert.assertTrue(menu.findItem(R.id.find_in_page_id).isVisible()); - Assert.assertNotNull(menu.findItem(R.id.request_desktop_site_row_menu_id)); - - MenuItem icon_row = menu.findItem(R.id.icon_row_menu_id); - Assert.assertNotNull(icon_row); - Assert.assertNotNull(icon_row.hasSubMenu()); - SubMenu icon_row_menu = icon_row.getSubMenu(); - final int expectedIconMenuSize = 4; - assertEquals(expectedIconMenuSize, getVisibleMenuSize(icon_row_menu)); - Assert.assertNotNull(icon_row_menu.findItem(R.id.forward_menu_id)); - Assert.assertNotNull(icon_row_menu.findItem(R.id.bookmark_this_page_id)); - Assert.assertNotNull(icon_row_menu.findItem(R.id.info_menu_id)); - Assert.assertNotNull(icon_row_menu.findItem(R.id.reload_menu_id)); - } - - @Test - @SmallTest - public void testAppMenuBeforeFirstRun() throws Exception { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(createMinimalCustomTabIntent()); - // Mark the first run as not completed. This has to be done after we start the intent, - // otherwise we are going to hit the FRE. - TestThreadUtils.runOnUiThreadBlocking(() -> FirstRunStatus.setFirstRunFlowComplete(false)); - - openAppMenuAndAssertMenuShown(); - Menu menu = mCustomTabActivityTestRule.getMenu(); - final int expectedMenuSize = 3; - - Assert.assertNotNull("App menu is not initialized: ", menu); - assertEquals(expectedMenuSize, getActualMenuSize(menu)); - assertEquals(expectedMenuSize, getVisibleMenuSize(menu)); - - // Checks the first row (icons). - Assert.assertNotNull(menu.findItem(R.id.forward_menu_id)); - Assert.assertNotNull(menu.findItem(R.id.info_menu_id)); - Assert.assertNotNull(menu.findItem(R.id.reload_menu_id)); - assertAppMenuItemNotVisible(menu, R.id.offline_page_id, "offline_page"); - assertAppMenuItemNotVisible(menu, R.id.bookmark_this_page_id, "bookmark_this_page"); - - // Following rows. - Assert.assertNotNull(menu.findItem(R.id.find_in_page_id)); - Assert.assertNotNull(menu.findItem(R.id.request_desktop_site_row_menu_id)); - assertAppMenuItemNotVisible(menu, R.id.open_in_browser_id, "open_in_browser"); - assertAppMenuItemNotVisible(menu, R.id.add_to_homescreen_id, "add_to_homescreen"); - } - - /** - * Tests if the default share item can be shown in the app menu. - */ - @Test - @SmallTest - public void testShareMenuItem() throws Exception { - Intent intent = createMinimalCustomTabIntent(); - intent.putExtra(CustomTabsIntent.EXTRA_DEFAULT_SHARE_MENU_ITEM, true); - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - - openAppMenuAndAssertMenuShown(); - Menu menu = mCustomTabActivityTestRule.getMenu(); - Assert.assertTrue(menu.findItem(R.id.share_menu_id).isVisible()); - Assert.assertTrue(menu.findItem(R.id.share_menu_id).isEnabled()); - } - - - /** - * Test that only up to 5 entries are added to the custom menu. - */ - @Test - @SmallTest - public void testMaxMenuItems() throws Exception { - Intent intent = createMinimalCustomTabIntent(); - int numMenuEntries = 7; - Assert.assertTrue(MAX_MENU_CUSTOM_ITEMS < numMenuEntries); - CustomTabsTestUtils.addMenuEntriesToIntent(intent, numMenuEntries, TEST_MENU_TITLE); - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - - openAppMenuAndAssertMenuShown(); - Menu menu = mCustomTabActivityTestRule.getMenu(); - final int expectedMenuSize = MAX_MENU_CUSTOM_ITEMS + NUM_CHROME_MENU_ITEMS; - Assert.assertNotNull("App menu is not initialized: ", menu); - assertEquals(expectedMenuSize, getActualMenuSize(menu)); - assertEquals(expectedMenuSize, getVisibleMenuSize(menu)); - } - - /** - * Test whether the custom menu is correctly shown and clicking it sends the right - * {@link PendingIntent}. - */ - @Test - @SmallTest - public void testCustomMenuEntry() throws TimeoutException { - Intent customTabIntent = createMinimalCustomTabIntent(); - Intent baseCallbackIntent = new Intent(); - baseCallbackIntent.putExtra("FOO", 42); - final PendingIntent pi = CustomTabsTestUtils.addMenuEntriesToIntent( - customTabIntent, 1, baseCallbackIntent, TEST_MENU_TITLE); - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(customTabIntent); - - final OnFinishedForTest onFinished = new OnFinishedForTest(pi); - getCustomTabIntentDataProvider().setPendingIntentOnFinishedForTesting(onFinished); - - openAppMenuAndAssertMenuShown(); - PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { - MenuItem item = ((CustomTabAppMenuPropertiesDelegate) - AppMenuTestSupport.getAppMenuPropertiesDelegate( - mCustomTabActivityTestRule.getAppMenuCoordinator())) - .getMenuItemForTitle(TEST_MENU_TITLE); - Assert.assertNotNull(item); - AppMenuTestSupport.onOptionsItemSelected( - mCustomTabActivityTestRule.getAppMenuCoordinator(), item); - }); - - onFinished.waitForCallback("Pending Intent was not sent."); - Intent callbackIntent = onFinished.getCallbackIntent(); - Assert.assertThat(callbackIntent.getDataString(), equalTo(mTestPage)); - - // Verify that the callback intent has the page title as the subject, but other extras are - // kept intact. - Assert.assertThat( - callbackIntent.getStringExtra(Intent.EXTRA_SUBJECT), equalTo("The Google")); - Assert.assertThat(callbackIntent.getIntExtra("FOO", 0), equalTo(42)); - } - - /** - * Test whether clicking "Open in Chrome" takes us to a chrome normal tab, loading the same url. - */ - @Test - @SmallTest - public void testOpenInBrowser() throws Exception { - // Augment the CustomTabsSession to catch the callback. - CallbackHelper callbackTriggered = new CallbackHelper(); - CustomTabsSession session = CustomTabsTestUtils.bindWithCallback(new CustomTabsCallback() { - @Override - public void extraCallback(String callbackName, Bundle args) { - if (callbackName.equals(CustomTabsConnection.OPEN_IN_BROWSER_CALLBACK)) { - callbackTriggered.notifyCalled(); - } - } - }).session; - - Intent intent = new CustomTabsIntent.Builder(session).build().intent; - intent.setData(Uri.parse(mTestPage)); - intent.setComponent(new ComponentName( - InstrumentationRegistry.getTargetContext(), ChromeLauncherActivity.class)); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - // These ensure the open in chrome chooser is not shown. - intent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_OPENED_BY_CHROME, true); - IntentHandler.setForceIntentSenderChromeToTrue(true); - - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - assertEquals(1, - RecordHistogram.getHistogramValueCountForTesting( - LaunchCauseMetrics.LAUNCH_CAUSE_HISTOGRAM, - LaunchCauseMetrics.LaunchCause.CUSTOM_TAB)); - - IntentFilter filter = new IntentFilter(Intent.ACTION_VIEW); - filter.addDataScheme(Uri.parse(mTestServer.getURL("/")).getScheme()); - final ActivityMonitor monitor = - InstrumentationRegistry.getInstrumentation().addMonitor(filter, null, false); - openAppMenuAndAssertMenuShown(); - PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { - MenuItem item = - AppMenuTestSupport.getMenu(mCustomTabActivityTestRule.getAppMenuCoordinator()) - .findItem(R.id.open_in_browser_id); - Assert.assertNotNull(item); - getActivity().onMenuOrKeyboardAction(R.id.open_in_browser_id, false); - }); - final Activity activity = - monitor.waitForActivityWithTimeout(CriteriaHelper.DEFAULT_MAX_TIME_TO_POLL); - - callbackTriggered.waitForCallback(0); - - CriteriaHelper.pollInstrumentationThread(() -> { - Criteria.checkThat(RecordHistogram.getHistogramValueCountForTesting( - LaunchCauseMetrics.LAUNCH_CAUSE_HISTOGRAM, - LaunchCauseMetrics.LaunchCause.OPEN_IN_BROWSER_FROM_MENU), - Matchers.is(1)); - }, 5000L, CriteriaHelper.DEFAULT_POLLING_INTERVAL); - activity.finish(); - } - - /** * Test whether a custom tab can be reparented to a new activity. */ @Test @@ -1115,9 +818,9 @@ // with the @RemoteView annotation. RemoteViews remoteViews = new RemoteViews(InstrumentationRegistry.getTargetContext().getPackageName(), - R.layout.web_notification); - remoteViews.setTextViewText(R.id.title, "Kittens!"); - remoteViews.setTextViewText(R.id.body, "So fluffy"); + R.layout.share_sheet_item); + remoteViews.setTextViewText(R.id.text, "Kittens!"); + remoteViews.setTextViewText(R.id.display_new, "So fluffy"); remoteViews.setImageViewResource(R.id.icon, R.drawable.ic_email_googblue_36dp); intent.putExtra(CustomTabsIntent.EXTRA_REMOTEVIEWS, remoteViews); intent.putExtra(CustomTabsIntent.EXTRA_REMOTEVIEWS_VIEW_IDS, new int[] {R.id.icon}); @@ -2722,66 +2425,6 @@ }); } - @Test - @SmallTest - public void testHideOpenInChromeMenuItem() throws Exception { - Context context = InstrumentationRegistry.getInstrumentation() - .getTargetContext() - .getApplicationContext(); - Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage); - intent.setData(Uri.parse(mTestPage)); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.putExtra(CustomTabIntentDataProvider.EXTRA_HIDE_OPEN_IN_CHROME_MENU_ITEM, true); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); - connection.overridePackageNameForSessionForTesting( - token, "com.google.android.googlequicksearchbox"); - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - - IntentFilter filter = new IntentFilter(Intent.ACTION_VIEW); - final ActivityMonitor monitor = - InstrumentationRegistry.getInstrumentation().addMonitor(filter, null, false); - openAppMenuAndAssertMenuShown(); - PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { - MenuItem item = - AppMenuTestSupport.getMenu(mCustomTabActivityTestRule.getAppMenuCoordinator()) - .findItem(R.id.open_in_browser_id); - // The menu item should be there, but hidden. - Assert.assertNotNull(item); - Assert.assertFalse(item.isVisible()); - }); - } - - @Test - @SmallTest - public void testHideOpenInChromeMenuItemVisibleWithWrongPackage() throws Exception { - Context context = InstrumentationRegistry.getInstrumentation() - .getTargetContext() - .getApplicationContext(); - Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage); - intent.setData(Uri.parse(mTestPage)); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.putExtra(CustomTabIntentDataProvider.EXTRA_HIDE_OPEN_IN_CHROME_MENU_ITEM, true); - CustomTabsSessionToken token = CustomTabsSessionToken.getSessionTokenFromIntent(intent); - CustomTabsConnection connection = CustomTabsConnection.getInstance(); - connection.newSession(token); - mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); - - IntentFilter filter = new IntentFilter(Intent.ACTION_VIEW); - final ActivityMonitor monitor = - InstrumentationRegistry.getInstrumentation().addMonitor(filter, null, false); - openAppMenuAndAssertMenuShown(); - PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { - MenuItem item = - AppMenuTestSupport.getMenu(mCustomTabActivityTestRule.getAppMenuCoordinator()) - .findItem(R.id.open_in_browser_id); - // As the package name doesn't match the expected package, the item should be visible. - Assert.assertNotNull(item); - Assert.assertTrue(item.isVisible()); - }); - } - /** * The following test that history only has a single final page after speculation, * whether it was a hit or a miss. @@ -3144,8 +2787,4 @@ private SessionDataHolder getSessionDataHolder() { return ChromeApplicationImpl.getComponent().resolveSessionDataHolder(); } - - private CustomTabIntentDataProvider getCustomTabIntentDataProvider() { - return (CustomTabIntentDataProvider) getActivity().getIntentDataProvider(); - } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/TosAndUmaFirstRunFragmentWithEnterpriseSupportTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/TosAndUmaFirstRunFragmentWithEnterpriseSupportTest.java index bcd46c3..045a16c1 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/TosAndUmaFirstRunFragmentWithEnterpriseSupportTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/TosAndUmaFirstRunFragmentWithEnterpriseSupportTest.java
@@ -68,6 +68,7 @@ import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.TimeoutException; /** * Test for first run activity and {@link TosAndUmaFirstRunFragmentWithEnterpriseSupport}. @@ -123,6 +124,7 @@ private final List<Callback<EnterpriseInfo.OwnedState>> mOwnedStateCallbacks = new ArrayList<>(); private final CallbackHelper mAcceptTosCallbackHelper = new CallbackHelper(); + private CallbackHelper mOnNativeInitializedHelper = new CallbackHelper(); private int mExitCount; private View mTosText; @@ -182,6 +184,12 @@ mExitCount++; } }); + ToSAndUMAFirstRunFragment.setObserverForTesting(new ToSAndUMAFirstRunFragment.Observer() { + @Override + public void onNativeInitialized() { + mOnNativeInitializedHelper.notifyCalled(); + } + }); } @After @@ -200,7 +208,7 @@ @Test @SmallTest - public void testNoRestriction() { + public void testNoRestriction() throws Exception { launchFirstRunThroughCustomTab(); assertUIState(FragmentState.LOADING); @@ -221,16 +229,13 @@ @Test @SmallTest - public void testNoRestriction_AcceptBeforeNative() { + public void testNoRestriction_AcceptBeforeNative() throws Exception { launchFirstRunThroughCustomTabPreNative(); assertUIState(FragmentState.LOADING); setAppRestrictionsMockInitialized(false); assertUIState(FragmentState.NO_POLICY); - assertHistograms(true, SpeedComparedToInflation.SLOWER, - SpeedComparedToInflation.NOT_RECORDED, SpeedComparedToInflation.NOT_RECORDED); - // Try to accept ToS. setMetricsReportDisabled(); TestThreadUtils.runOnUiThreadBlocking((Runnable) mAcceptButton::performClick); @@ -241,6 +246,8 @@ // ToS should be accepted when native is initialized. startNativeInitializationAndWait(); + assertHistograms(true, SpeedComparedToInflation.SLOWER, + SpeedComparedToInflation.NOT_RECORDED, SpeedComparedToInflation.NOT_RECORDED); String histogram = "MobileFre.TosFragment.SpinnerVisibleDuration"; Assert.assertEquals(String.format("Histogram <%s> should be recorded.", histogram), 1, RecordHistogram.getHistogramTotalCountForTesting(histogram)); @@ -251,7 +258,7 @@ @Test @SmallTest - public void testNoRestriction_BeforeInflation() { + public void testNoRestriction_BeforeInflation() throws Exception { setAppRestrictionsMockInitialized(false); launchFirstRunThroughCustomTab(); assertUIState(FragmentState.NO_POLICY); @@ -264,7 +271,7 @@ @SmallTest // TODO(crbug.com/1120859): Test the policy check when native initializes before inflation. // This will be possible when FragmentScenario is available. - public void testDialogEnabled() { + public void testDialogEnabled() throws Exception { setAppRestrictionsMockInitialized(true); launchFirstRunThroughCustomTab(); assertUIState(FragmentState.LOADING); @@ -284,7 +291,7 @@ @Test @SmallTest - public void testDialogEnabled_BeforeAppRestrictions() { + public void testDialogEnabled_BeforeAppRestrictions() throws Exception { launchFirstRunThroughCustomTab(); assertUIState(FragmentState.LOADING); @@ -298,7 +305,7 @@ @Test @SmallTest - public void testNotOwnedDevice() { + public void testNotOwnedDevice() throws Exception { setAppRestrictionsMockInitialized(true); launchFirstRunThroughCustomTab(); assertUIState(FragmentState.LOADING); @@ -312,7 +319,7 @@ @Test @SmallTest - public void testNotOwnedDevice_AcceptBeforePolicy() { + public void testNotOwnedDevice_AcceptBeforePolicy() throws Exception { setAppRestrictionsMockInitialized(true); launchFirstRunThroughCustomTab(); assertUIState(FragmentState.LOADING); @@ -339,7 +346,7 @@ @Test @SmallTest - public void testNotOwnedDevice_BeforeInflation() { + public void testNotOwnedDevice_BeforeInflation() throws Exception { setAppRestrictionsMockInitialized(true); setEnterpriseInfoInitializedWithDeviceOwner(false); @@ -352,7 +359,7 @@ @Test @SmallTest - public void testOwnedDevice_NoRestriction() { + public void testOwnedDevice_NoRestriction() throws Exception { setEnterpriseInfoInitializedWithDeviceOwner(true); launchFirstRunThroughCustomTab(); assertUIState(FragmentState.LOADING); @@ -366,7 +373,7 @@ @Test @SmallTest - public void testOwnedDevice_NoPolicy() { + public void testOwnedDevice_NoPolicy() throws Exception { setEnterpriseInfoInitializedWithDeviceOwner(true); launchFirstRunThroughCustomTab(); assertUIState(FragmentState.LOADING); @@ -383,7 +390,7 @@ @Test @SmallTest - public void testSkip_DeviceOwnedThenDialogPolicy() { + public void testSkip_DeviceOwnedThenDialogPolicy() throws Exception { setAppRestrictionsMockInitialized(true); launchFirstRunThroughCustomTab(); assertUIState(FragmentState.LOADING); @@ -403,7 +410,7 @@ @Test @SmallTest - public void testSkip_DialogPolicyThenDeviceOwned() { + public void testSkip_DialogPolicyThenDeviceOwned() throws Exception { setAppRestrictionsMockInitialized(true); launchFirstRunThroughCustomTab(); assertUIState(FragmentState.LOADING); @@ -423,7 +430,7 @@ @Test @SmallTest - public void testSkip_LateAppRestrictions() { + public void testSkip_LateAppRestrictions() throws Exception { launchFirstRunThroughCustomTab(); assertUIState(FragmentState.LOADING); @@ -450,7 +457,7 @@ @Test @SmallTest - public void testNullOwnedState() { + public void testNullOwnedState() throws Exception { setAppRestrictionsMockInitialized(true); setPolicyServiceMockInitializedWithDialogEnabled(false); launchFirstRunThroughCustomTab(); @@ -532,7 +539,7 @@ renderWithPortraitAndLandscape(tosAndUmaFragment, "fre_tosanduma_withpolicy"); } - private void launchFirstRunThroughCustomTab() { + private void launchFirstRunThroughCustomTab() throws TimeoutException { launchFirstRunThroughCustomTabPreNative(); startNativeInitializationAndWait(); } @@ -606,7 +613,7 @@ () -> Criteria.checkThat(mExitCount, Matchers.is(expectedExitCount))); } - private void startNativeInitializationAndWait() { + private void startNativeInitializationAndWait() throws TimeoutException { Mockito.verify(mInitializer, Mockito.timeout(3000L)) .handlePostNativeStartup(eq(true), mBrowserParts.capture()); Mockito.doCallRealMethod() @@ -617,8 +624,7 @@ () -> mInitializer.handlePostNativeStartup( /*isAsync*/ false, mBrowserParts.getValue())); - CriteriaHelper.pollUiThread( - (() -> mActivity.isNativeSideIsInitializedForTest()), "native never initialized."); + mOnNativeInitializedHelper.waitForCallback("native never initialized.", 0); } /**
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/gesturenav/NavigationHandlerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/gesturenav/NavigationHandlerTest.java index d252a1af..8a4d26ff 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/gesturenav/NavigationHandlerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/gesturenav/NavigationHandlerTest.java
@@ -21,15 +21,12 @@ import org.chromium.base.ActivityState; import org.chromium.base.ApplicationStatus; -import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Criteria; import org.chromium.base.test.util.CriteriaHelper; -import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Restriction; -import org.chromium.chrome.browser.compositor.layouts.LayoutManagerChrome; import org.chromium.chrome.browser.flags.ChromeSwitches; -import org.chromium.chrome.browser.layouts.LayoutStateProvider; +import org.chromium.chrome.browser.layouts.LayoutTestUtils; import org.chromium.chrome.browser.layouts.LayoutType; import org.chromium.chrome.browser.layouts.animation.CompositorAnimationHandler; import org.chromium.chrome.browser.tab.Tab; @@ -60,6 +57,28 @@ private static final boolean RIGHT_EDGE = false; private static final int PAGELOAD_TIMEOUT_MS = 4000; + private static class ActivityStateListener implements ApplicationStatus.ActivityStateListener { + private final @ActivityState int mInitState; + private @ActivityState int mCurState; + + private ActivityStateListener(@ActivityState int state) { + mInitState = mCurState = state; + } + + @Override + public void onActivityStateChange(Activity activity, int newState) { + mCurState = newState; + } + + private boolean isUpdated() { + return mCurState != mInitState; + } + + private @ActivityState int getState() { + return mCurState; + } + } + private EmbeddedTestServer mTestServer; private HistoryNavigationLayout mNavigationLayout; private NavigationHandler mNavigationHandler; @@ -161,15 +180,18 @@ @Test @SmallTest - @DisabledTest(message = "https://crbug.com/1205167") public void testCloseChromeAtHistoryStackHead() { loadNewTabPage(); final Activity activity = mActivityTestRule.getActivity(); + ActivityStateListener stateListener = + new ActivityStateListener(ApplicationStatus.getStateForActivity(activity)); + ApplicationStatus.registerStateListenerForAllActivities(stateListener); swipeFromEdge(LEFT_EDGE); - CriteriaHelper.pollUiThread(() -> { - int state = ApplicationStatus.getStateForActivity(activity); - return state == ActivityState.STOPPED || state == ActivityState.DESTROYED; - }, "Chrome should be in background"); + CriteriaHelper.pollUiThread(stateListener::isUpdated); + ApplicationStatus.unregisterActivityStateListener(stateListener); + Assert.assertThat(stateListener.getState(), + Matchers.isOneOf( + ActivityState.STOPPED, ActivityState.PAUSED, ActivityState.DESTROYED)); } @Test @@ -280,7 +302,6 @@ @Test @SmallTest @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) - @DisabledTest(message = "https://crbug.com/1205106") public void testEdgeSwipeIsNoopInTabSwitcher() throws TimeoutException { mActivityTestRule.loadUrl(UrlConstants.NTP_URL); mActivityTestRule.loadUrl(UrlConstants.RECENT_TABS_URL); @@ -289,7 +310,7 @@ Assert.assertTrue("Chrome should stay in tab switcher", mActivityTestRule.getActivity().isInOverviewMode()); setTabSwitcherModeAndWait(false); - Assert.assertEquals("Current page should not change", UrlConstants.RECENT_TABS_URL, + Assert.assertEquals("Current page should not change. ", UrlConstants.RECENT_TABS_URL, ChromeTabUtils.getUrlStringOnUiThread(currentTab())); } @@ -298,26 +319,14 @@ * @param inSwitcher Whether to enter or exit the tab switcher. */ private void setTabSwitcherModeAndWait(boolean inSwitcher) throws TimeoutException { - CallbackHelper switchHelper = new CallbackHelper(); - LayoutStateProvider.LayoutStateObserver layoutObserver = - new LayoutStateProvider.LayoutStateObserver() { - @Override - public void onFinishedShowing(int layoutType) { - if ((inSwitcher && layoutType == LayoutType.TAB_SWITCHER) - || (!inSwitcher && layoutType == LayoutType.BROWSING)) { - switchHelper.notifyCalled(); - } - } - }; - - LayoutManagerChrome controller = mActivityTestRule.getActivity().getLayoutManager(); - controller.addObserver(layoutObserver); - if (inSwitcher) { - TestThreadUtils.runOnUiThreadBlocking(() -> controller.showOverview(false)); - } else { - TestThreadUtils.runOnUiThreadBlocking(() -> controller.hideOverview(false)); - } - switchHelper.waitForCallback(0); - controller.removeObserver(layoutObserver); + TestThreadUtils.runOnUiThreadBlocking(() -> { + if (inSwitcher) { + mActivityTestRule.getActivity().getLayoutManager().showOverview(false); + } else { + mActivityTestRule.getActivity().getLayoutManager().hideOverview(false); + } + }); + LayoutTestUtils.waitForLayout( + mActivityTestRule.getActivity().getLayoutManager(), LayoutType.TAB_SWITCHER); } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offline/measurements/OfflineMeasurementsBackgroundTaskTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offline/measurements/OfflineMeasurementsBackgroundTaskTest.java index 6a1f2d2..7a3efef9 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/offline/measurements/OfflineMeasurementsBackgroundTaskTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offline/measurements/OfflineMeasurementsBackgroundTaskTest.java
@@ -86,11 +86,13 @@ * Fake of OfflineMeasurementsBackgroundTask.Clock that can be used to test the timing parts of * OfflineMeasurementsBackgroundTask. */ - public static class FakeClock implements OfflineMeasurementsBackgroundTask.Clock { + public static class FakeClock extends OfflineMeasurementsBackgroundTask.Clock { private long mCurrentTimeMillis; + private long mElapsedRealtime; public FakeClock() { mCurrentTimeMillis = 0; + mElapsedRealtime = 0; } @Override @@ -98,12 +100,22 @@ return mCurrentTimeMillis; } + @Override + public long elapsedRealtime() { + return mElapsedRealtime; + } + public void setCurrentTimeMillis(long currentTimeMillis) { mCurrentTimeMillis = currentTimeMillis; } + public void setElapsedRealtime(long elapsedRealtime) { + mElapsedRealtime = elapsedRealtime; + } + public void advanceCurrentTimeMillis(long millis) { mCurrentTimeMillis += millis; + mElapsedRealtime += millis; } } @@ -131,10 +143,12 @@ mNumTaskFinishedCallbacksTriggered = 0; - // Overrides the checks for airplane mode and roaming so that we don't run the full checks - // in any tests. + // Overrides the checks for airplane mode, roaming, screen interactivity, and application + // state so that we don't run the full checks in any tests. OfflineMeasurementsBackgroundTask.setIsAirplaneModeEnabledForTesting(false); // IN-TEST OfflineMeasurementsBackgroundTask.setIsRoamingForTesting(false); // IN-TEST + OfflineMeasurementsBackgroundTask.setIsInteractiveForTesting(false); // IN-TEST + OfflineMeasurementsBackgroundTask.setIsApplicationForegroundForTesting(false); // IN-TEST } private void maybeScheduleTaskAndReportMetrics() { @@ -796,4 +810,194 @@ OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_IS_ROAMING, /*true*/ 1)); } + + /** + * Tests running the background task when the phone's screen is not interative. Checks that the + * expected values are recorded to the UMA histogram Offline.Measurements.UserState. + */ + @Test + @MediumTest + public void recordUserState_NotUsingPhone() throws Exception { + // Enable feature and initialize the HTTP probe parameters. + setFeatureStatusForTest(true); + + // Set the task parameters. + TaskParameters testParameters = + TaskParameters.create(TaskIds.OFFLINE_MEASUREMENT_JOB_ID).build(); + BackgroundTask.TaskFinishedCallback testCallback = needsReschedule -> {}; + + // Tests running the background task when the screen is not interactive. This should record + // a value of UserState.NOT_USING_PHONE regardless of whehter Chrome is in the foreground or + // not. + OfflineMeasurementsBackgroundTask.setIsInteractiveForTesting(false); + OfflineMeasurementsBackgroundTask.setIsApplicationForegroundForTesting(false); + TestThreadUtils.runOnUiThreadBlocking(() -> { + OfflineMeasurementsBackgroundTask task = new OfflineMeasurementsBackgroundTask(); + task.onStartTask(null, testParameters, testCallback); + }); + + OfflineMeasurementsBackgroundTask.setIsApplicationForegroundForTesting(true); + TestThreadUtils.runOnUiThreadBlocking(() -> { + OfflineMeasurementsBackgroundTask task = new OfflineMeasurementsBackgroundTask(); + task.onStartTask(null, testParameters, testCallback); + }); + + // Reports the metrics stored in Prefs. + maybeScheduleTaskAndReportMetrics(); + + // Check that the expected values were recorded to Offline.Measurements.UserState. + assertEquals("There should be one sample for each time the task was ran", 2, + RecordHistogram.getHistogramTotalCountForTesting( + OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_USER_STATE)); + assertEquals("There should be two entries for NOT_USING_PHONE", 2, + RecordHistogram.getHistogramValueCountForTesting( + OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_USER_STATE, + OfflineMeasurementsBackgroundTask.UserState.NOT_USING_PHONE)); + } + + /** + * Tests running the background task when the phone screen is interative, but Chrome is not in + * the foreground. Checks that the expected values are recorded to the UMA histogram + * Offline.Measurements.UserState. + */ + @Test + @MediumTest + public void recordUserState_UsingPhoneNotChrome() throws Exception { + // Enable feature and initialize the HTTP probe parameters. + setFeatureStatusForTest(true); + + // Set the task parameters. + TaskParameters testParameters = + TaskParameters.create(TaskIds.OFFLINE_MEASUREMENT_JOB_ID).build(); + BackgroundTask.TaskFinishedCallback testCallback = needsReschedule -> {}; + + // Tests running the background task when the screen is on and Chrome is not in the + // foreground. This should record a value of UserState.USING_PHONE_NOT_CHROME. + OfflineMeasurementsBackgroundTask.setIsInteractiveForTesting(true); + OfflineMeasurementsBackgroundTask.setIsApplicationForegroundForTesting(false); + TestThreadUtils.runOnUiThreadBlocking(() -> { + OfflineMeasurementsBackgroundTask task = new OfflineMeasurementsBackgroundTask(); + task.onStartTask(null, testParameters, testCallback); + }); + + // Reports the metrics stored in Prefs. + maybeScheduleTaskAndReportMetrics(); + + // Check that the expected values were recorded to Offline.Measurements.UserState. + assertEquals("There should be one sample for each time the task was ran", 1, + RecordHistogram.getHistogramTotalCountForTesting( + OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_USER_STATE)); + assertEquals("There should be one entry for USING_PHONE_NOT_CHROME", 1, + RecordHistogram.getHistogramValueCountForTesting( + OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_USER_STATE, + OfflineMeasurementsBackgroundTask.UserState.USING_PHONE_NOT_CHROME)); + } + + /** + * Tests running the background task when chrome is in the foreground. Checks that the expected + * values are recorded to the UMA histogram Offline.Measurements.UserState. + */ + @Test + @MediumTest + public void recordUserState_UsingChrome() throws Exception { + // Enable feature and initialize the HTTP probe parameters. + setFeatureStatusForTest(true); + + // Set the task parameters. + TaskParameters testParameters = + TaskParameters.create(TaskIds.OFFLINE_MEASUREMENT_JOB_ID).build(); + BackgroundTask.TaskFinishedCallback testCallback = needsReschedule -> {}; + + // Tests running the background task when the screen is on and Chrome is in the foreground. + // This should record a value of UserState.USING_CHROME. + OfflineMeasurementsBackgroundTask.setIsInteractiveForTesting(true); + OfflineMeasurementsBackgroundTask.setIsApplicationForegroundForTesting(true); + TestThreadUtils.runOnUiThreadBlocking(() -> { + OfflineMeasurementsBackgroundTask task = new OfflineMeasurementsBackgroundTask(); + task.onStartTask(null, testParameters, testCallback); + }); + + // Reports the metrics stored in Prefs. + maybeScheduleTaskAndReportMetrics(); + + // Check that the expected values were recorded to Offline.Measurements.UserState. + assertEquals("There should be one sample for each time the task was ran", 1, + RecordHistogram.getHistogramTotalCountForTesting( + OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_USER_STATE)); + assertEquals("There should be one entry for USING_CHROME", 1, + RecordHistogram.getHistogramValueCountForTesting( + OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_USER_STATE, + OfflineMeasurementsBackgroundTask.UserState.USING_CHROME)); + } + + /** + * Tests running the background task after the device boots up. Checks that the expected values + * are recorded to the UMA histogram Offline.Measurements.UserState. + */ + @Test + @MediumTest + public void recordUserState_PhoneOff() throws Exception { + // Enable feature and initialize the HTTP probe parameters. + setFeatureStatusForTest(true); + + // Schedule the task, so that we initialize the "lastCheckMillis" timestamp in Prefs. + maybeScheduleTaskAndReportMetrics(); + + // Set the task parameters. + TaskParameters testParameters = + TaskParameters.create(TaskIds.OFFLINE_MEASUREMENT_JOB_ID).build(); + BackgroundTask.TaskFinishedCallback testCallback = needsReschedule -> {}; + + OfflineMeasurementsBackgroundTask.setIsInteractiveForTesting(true); + OfflineMeasurementsBackgroundTask.setIsApplicationForegroundForTesting(true); + + // Advance the clock then reset elapsed realtime to zero in order to simulate the system + // restarting. + mFakeClock.advanceCurrentTimeMillis(1000); + mFakeClock.setElapsedRealtime(0); + + // Tests running the background task immediately after booting up. Since this is the first + // time the task is run, we can't tell if the system just booted up. + OfflineMeasurementsBackgroundTask.setIsApplicationForegroundForTesting(true); + TestThreadUtils.runOnUiThreadBlocking(() -> { + OfflineMeasurementsBackgroundTask task = new OfflineMeasurementsBackgroundTask(); + task.onStartTask(null, testParameters, testCallback); + }); + + // Reports the metrics stored in Prefs. + maybeScheduleTaskAndReportMetrics(); + + // Check that the expected values were recorded to Offline.Measurements.UserState. + assertEquals("There should be one sample for each time the task was ran", 1, + RecordHistogram.getHistogramTotalCountForTesting( + OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_USER_STATE)); + assertEquals("There should be one entry for USING_CHROME", 1, + RecordHistogram.getHistogramValueCountForTesting( + OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_USER_STATE, + OfflineMeasurementsBackgroundTask.UserState.USING_CHROME)); + + // Simulate the system restarting again. + mFakeClock.advanceCurrentTimeMillis(1000); + mFakeClock.setElapsedRealtime(0); + + // Run the task again. Since the time since the last check is longer than the time since + // last boot up, then we know that system was just restarted. + OfflineMeasurementsBackgroundTask.setIsApplicationForegroundForTesting(true); + TestThreadUtils.runOnUiThreadBlocking(() -> { + OfflineMeasurementsBackgroundTask task = new OfflineMeasurementsBackgroundTask(); + task.onStartTask(null, testParameters, testCallback); + }); + + // Reports the metrics stored in Prefs. + maybeScheduleTaskAndReportMetrics(); + + // Check that the expected values were recorded to Offline.Measurements.UserState. + assertEquals("There should be one sample for each time the task was ran", 2, + RecordHistogram.getHistogramTotalCountForTesting( + OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_USER_STATE)); + assertEquals("There should be one entry for PHONE_OFF", 1, + RecordHistogram.getHistogramValueCountForTesting( + OfflineMeasurementsBackgroundTask.OFFLINE_MEASUREMENTS_USER_STATE, + OfflineMeasurementsBackgroundTask.UserState.PHONE_OFF)); + } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewTest.java index b10ba0c..aa268dd 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewTest.java
@@ -529,7 +529,6 @@ }; PageInfoController.show(sActivityTestRule.getActivity(), tab.getWebContents(), null, PageInfoController.OpenedFromSource.MENU, pageInfoControllerDelegate, - new ChromePermissionParamsListBuilderDelegate(), PageInfoController.NO_HIGHLIGHTED_PERMISSION); }); onViewWaiting(allOf(withText(R.string.page_info_connection_paint_preview), isDisplayed()));
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManagerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManagerTest.java index 2d53778..cdfc0171 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManagerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/geo/PlatformNetworksManagerTest.java
@@ -19,7 +19,10 @@ import android.content.IntentFilter; import android.content.pm.PackageManager; import android.net.ConnectivityManager; +import android.net.Network; +import android.net.NetworkCapabilities; import android.net.NetworkInfo; +import android.net.TransportInfo; import android.net.wifi.ScanResult; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; @@ -47,6 +50,7 @@ import org.chromium.base.Callback; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.base.test.ShadowBuildInfo; import org.chromium.chrome.browser.omnibox.geo.VisibleNetworks.VisibleCell; import org.chromium.chrome.browser.omnibox.geo.VisibleNetworks.VisibleCell.RadioType; import org.chromium.chrome.browser.omnibox.geo.VisibleNetworks.VisibleWifi; @@ -61,7 +65,7 @@ * Robolectric tests for {@link PlatformNetworksManager}. */ @RunWith(BaseRobolectricTestRunner.class) -@Config(manifest = Config.NONE) +@Config(sdk = 29, manifest = Config.NONE, shadows = {ShadowBuildInfo.class}) public class PlatformNetworksManagerTest { private static final VisibleWifi CONNECTED_WIFI = VisibleWifi.create("ssid1", "11:11:11:11:11:11", -1, 10L); @@ -120,12 +124,18 @@ @Mock private WifiManager mWifiManager; @Mock + private ConnectivityManager mConnectivityManager; + @Mock + private Network mNetwork; + @Mock + private NetworkCapabilities mNetworkCapabilitites; + @Mock private NetworkInfo mCellNetworkInfo; @Mock private NetworkInfo mWifiNetworkInfo; @Mock private NetworkInfo mEthernetNetworkInfo; - @Mock + @Mock(extraInterfaces = {TransportInfo.class}) private WifiInfo mWifiInfo; @Mock private ScanResult mWifiScanResult; @@ -184,6 +194,17 @@ when(mWifiInfo.getBSSID()).thenReturn(CONNECTED_WIFI.bssid()); when(mWifiManager.getConnectionInfo()).thenReturn(mWifiInfo); + // Sets up an alternative path for retrieving WiFi information on Android S. + when(mContext.getSystemService(Context.CONNECTIVITY_SERVICE)) + .thenReturn(mConnectivityManager); + when(mConnectivityManager.getNetworkCapabilities(eq(mNetwork))) + .thenReturn(mNetworkCapabilitites); + when(mNetworkCapabilitites.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) + .thenReturn(true); + // This line forces SDK to be at least 29 in manifest. + when(mNetworkCapabilitites.getTransportInfo()).thenReturn((TransportInfo) mWifiInfo); + when(mConnectivityManager.getAllNetworks()).thenReturn(new Network[] {mNetwork}); + mWifiScanResult.SSID = CONNECTED_WIFI.ssid(); mWifiScanResult.BSSID = CONNECTED_WIFI.bssid(); mWifiScanResult.level = CONNECTED_WIFI.level(); @@ -244,6 +265,8 @@ .thenReturn(mNetworkStateChangedIntent); when(mNetworkStateChangedIntent.getParcelableExtra(eq(WifiManager.EXTRA_WIFI_INFO))) .thenReturn(mWifiInfo); + + ShadowBuildInfo.reset(); } @Test @@ -262,43 +285,6 @@ } @Test - public void testGetAllVisibleCells_JBMR2() { - ReflectionHelpers.setStaticField( - Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.JELLY_BEAN_MR2); - PlatformNetworksManager.getAllVisibleCells( - mContext, mTelephonyManager, mVisibleCellCallback); - verify(mVisibleCellCallback).onResult(mVisibleCellsArgument.capture()); - - assertEquals(4, mVisibleCellsArgument.getValue().size()); - for (VisibleCell visibleCell : mVisibleCellsArgument.getValue()) { - switch (visibleCell.radioType()) { - case RadioType.LTE: - assertEquals(LTE_CELL, visibleCell); - assertEquals(Long.valueOf(CURRENT_TIME_MS - LTE_CELL_AGE), - visibleCell.timestampMs()); - break; - case RadioType.WCDMA: - assertEquals(visibleCell, WCDMA_CELL); - assertEquals(Long.valueOf(CURRENT_TIME_MS - WCDMA_CELL_AGE), - visibleCell.timestampMs()); - break; - case RadioType.GSM: - assertEquals(visibleCell, GSM_CELL); - assertEquals(Long.valueOf(CURRENT_TIME_MS - GSM_CELL_AGE), - visibleCell.timestampMs()); - break; - case RadioType.CDMA: - assertEquals(visibleCell, CDMA_CELL); - assertEquals(Long.valueOf(CURRENT_TIME_MS - CDMA_CELL_AGE), - visibleCell.timestampMs()); - break; - default: - break; - } - } - } - - @Test public void testGetAllVisibleCells_allPermissionsDenied() { ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.M); allPermissionsDenied(); @@ -311,8 +297,17 @@ } @Test - public void testGetConnectedWifi() { - VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext, mWifiManager); + public void testGetConnectedWifi_BeforeS() { + VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext); + assertEquals(CONNECTED_WIFI, visibleWifi); + // When we get it through get connected wifi, we should see the current time. + assertEquals(Long.valueOf(CURRENT_TIME_MS), visibleWifi.timestampMs()); + } + + @Test + public void testGetConnectedWifi_S() { + ShadowBuildInfo.setIsAtLeastS(true); + VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext); assertEquals(CONNECTED_WIFI, visibleWifi); // When we get it through get connected wifi, we should see the current time. assertEquals(Long.valueOf(CURRENT_TIME_MS), visibleWifi.timestampMs()); @@ -322,7 +317,7 @@ public void testGetConnectedWifi_allPermissionsDenied() { ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.M); allPermissionsDenied(); - VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext, mWifiManager); + VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext); assertEquals(UNKNOWN_VISIBLE_WIFI, visibleWifi); assertNull(visibleWifi.timestampMs()); } @@ -332,7 +327,7 @@ ReflectionHelpers.setStaticField( Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.LOLLIPOP); locationGrantedWifiDenied(); - VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext, mWifiManager); + VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext); assertEquals(CONNECTED_WIFI, visibleWifi); assertEquals(Long.valueOf(CURRENT_TIME_MS), visibleWifi.timestampMs()); verifyNetworkStateAction(); @@ -345,7 +340,7 @@ locationGrantedWifiDenied(); when(mNetworkStateChangedIntent.getParcelableExtra(eq(WifiManager.EXTRA_WIFI_INFO))) .thenReturn(null); - VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext, mWifiManager); + VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext); assertEquals(UNKNOWN_VISIBLE_WIFI, visibleWifi); assertNull(visibleWifi.timestampMs()); verifyNetworkStateAction(); @@ -355,7 +350,7 @@ public void testGetConnectedWifi_locationDeniedWifiGranted() { ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.M); locationDeniedWifiGranted(); - VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext, mWifiManager); + VisibleWifi visibleWifi = PlatformNetworksManager.getConnectedWifi(mContext); assertEquals(UNKNOWN_VISIBLE_WIFI, visibleWifi); assertNull(visibleWifi.timestampMs()); } @@ -420,6 +415,7 @@ @Test public void testComputeVisibleNetworks_withNonConnectedNetworks() { + ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.P); Set<VisibleCell> expectedVisibleCells = new HashSet<VisibleCell>(Arrays.asList(LTE_CELL, WCDMA_CELL, GSM_CELL, CDMA_CELL)); Set<VisibleWifi> expectedVisibleWifis = @@ -443,6 +439,7 @@ @Test public void testComputeVisibleNetworks_locationGrantedWifiDenied() { + ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", Build.VERSION_CODES.P); Set<VisibleCell> expectedVisibleCells = new HashSet<VisibleCell>(Arrays.asList(LTE_CELL, WCDMA_CELL, GSM_CELL, CDMA_CELL)); Set<VisibleWifi> expectedVisibleWifis = Collections.emptySet();
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilderUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilderUnitTest.java index f893bcc..9982326 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilderUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilderUnitTest.java
@@ -49,7 +49,6 @@ @Before public void setUp() { MockitoAnnotations.initMocks(this); - ChromePermissionParamsListBuilderDelegate.setProfileForTesting(mProfileMock); FakePermissionDelegate.clearBlockedPermissions(); AndroidPermissionDelegate permissionDelegate = new FakePermissionDelegate(); mPermissionParamsListBuilder =
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index 7defaa9e..7fd525f 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -1676,6 +1676,12 @@ <message name="IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_MANAGED_WITH_CONNECTION_STATUS_AND_PROVIDER_NAME" desc="A11y label for an enterprise managed cellular network in a list in settings and oobe. Includes connection status and provider name. Clicking the network navigates to the details page."> Network <ph name="NETWORK_INDEX">$1<ex>1</ex></ph> of <ph name="NETWORK_COUNT">$2<ex>10</ex></ph>, <ph name="NETWORK_NAME">$3<ex>Verizon Wireless</ex></ph>, <ph name="NETWORK_PROVIDER_NAME">$4<ex>Verizon LTE</ex></ph>, <ph name="CONNECTION_STATUS">$5<ex>Connecting...</ex></ph>, Signal Strength <ph name="SIGNAL_STRENGTH">$6<ex>80</ex></ph>%, Managed by your Administrator, Details </message> + <message name="IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_UNACTIVATED" desc="A11y label for a cellular network in a list in settings and oobe that has not been activated to be available for use. Clicking the network navigates to the details page."> + Network <ph name="NETWORK_INDEX">$1<ex>1</ex></ph> of <ph name="NETWORK_COUNT">$2<ex>10</ex></ph>, <ph name="NETWORK_NAME">$3<ex>Verizon Wireless</ex></ph>, Unactivated, Signal Strength <ph name="SIGNAL_STRENGTH">$4<ex>80</ex></ph>%, Details + </message> + <message name="IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_UNACTIVATED_WITH_CONNECTION_STATUS" desc="A11y label for a cellular network in a list in settings and oobe that has not been activated to be available for use. Includes connection status. Clicking the network navigates to the details page."> + Network <ph name="NETWORK_INDEX">$1<ex>1</ex></ph> of <ph name="NETWORK_COUNT">$2<ex>10</ex></ph>, <ph name="NETWORK_NAME">$3<ex>Verizon Wireless</ex></ph>, Unactivated, <ph name="CONNECTION_STATUS">$4<ex>Connecting...</ex></ph>, Signal Strength <ph name="SIGNAL_STRENGTH">$5<ex>80</ex></ph>%, Details + </message> <message name="IDS_NETWORK_LIST_ITEM_LABEL_TETHER" desc="A11y label for a phone tether network in a list in settings and oobe. Clicking the network navigates to the details page."> Network <ph name="NETWORK_INDEX">$1<ex>1</ex></ph> of <ph name="NETWORK_COUNT">$2<ex>10</ex></ph>, <ph name="PHONE_NAME">$3<ex>Pixel 4</ex></ph>, Signal Strength <ph name="SIGNAL_STRENGTH">$4<ex>80</ex></ph>%, Phone Battery <ph name="BATTERY_STATUS">$5<ex>80</ex></ph>%, Connect </message> @@ -3544,6 +3550,12 @@ <message name="IDS_NETWORK_UI_NO_CELLULAR_ERROR_TEXT" desc="Text displayed when the cellular activation UI cannot be opened because no cellular network exists."> No cellular network exists </message> + <message name="IDS_NETWORK_UI_RESET_ESIM_PROFILES_LABEL" desc="Label for section of the debug networking page which allows developers and QA testers to reset the cache of eSIM profile metadata stored in Chrome OS."> + Reset eSIM profiles + </message> + <message name="IDS_NETWORK_UI_RESET_ESIM_PROFILES_BUTTON_TEXT" desc="Text for button in the debug networking page which allows developers and QA testers to reset the cache of eSIM profile metadata stored in Chrome OS. After this button is clicked, Chrome needs to request that the hardware re-scan for installed profiles."> + Reset eSIM profile cache + </message> <message name="IDS_NETWORK_UI_ADD_NEW_WIFI_LABEL" desc="Label for section dealing with showing the 'Add new Wi-Fi network' dialog."> New Wi-Fi Network Dialog </message>
diff --git a/chrome/app/chromeos_strings_grdp/IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_UNACTIVATED.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_UNACTIVATED.png.sha1 new file mode 100644 index 0000000..0206d29 --- /dev/null +++ b/chrome/app/chromeos_strings_grdp/IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_UNACTIVATED.png.sha1
@@ -0,0 +1 @@ +42ea0ce0d5dc1e8eafda32003a3938167326b4ea \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_UNACTIVATED_WITH_CONNECTION_STATUS.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_UNACTIVATED_WITH_CONNECTION_STATUS.png.sha1 new file mode 100644 index 0000000..55f8031 --- /dev/null +++ b/chrome/app/chromeos_strings_grdp/IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_UNACTIVATED_WITH_CONNECTION_STATUS.png.sha1
@@ -0,0 +1 @@ +18dd1befac8cb46eebaf1f6935028785d0af6e0e \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_NETWORK_UI_RESET_ESIM_PROFILES_BUTTON_TEXT.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_NETWORK_UI_RESET_ESIM_PROFILES_BUTTON_TEXT.png.sha1 new file mode 100644 index 0000000..7b2fbddf --- /dev/null +++ b/chrome/app/chromeos_strings_grdp/IDS_NETWORK_UI_RESET_ESIM_PROFILES_BUTTON_TEXT.png.sha1
@@ -0,0 +1 @@ +51d71772e5f38046a6617021c65a6c84b92fd504 \ No newline at end of file
diff --git a/chrome/app/chromeos_strings_grdp/IDS_NETWORK_UI_RESET_ESIM_PROFILES_LABEL.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_NETWORK_UI_RESET_ESIM_PROFILES_LABEL.png.sha1 new file mode 100644 index 0000000..7b2fbddf --- /dev/null +++ b/chrome/app/chromeos_strings_grdp/IDS_NETWORK_UI_RESET_ESIM_PROFILES_LABEL.png.sha1
@@ -0,0 +1 @@ +51d71772e5f38046a6617021c65a6c84b92fd504 \ No newline at end of file
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 5fe7a15..494b91b6 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -7532,9 +7532,12 @@ </message> <!-- Sharing Hub feature strings. --> - <message name="IDS_SHARING_HUB_TITLE" desc="The title for the Sharing Hub."> + <message name="IDS_SHARING_HUB_TITLE" desc="The title for the Sharing Hub feature."> Share </message> + <message name="IDS_SHARING_HUB_TOOLTIP" desc="Tooltip for the Sharing Hub feature omnibox icon."> + Share this page + </message> <!-- Clipboard History Menu feature. --> <message name="IDS_CONTEXT_MENU_SHOW_CLIPBOARD_HISTORY_MENU" @@ -10879,10 +10882,10 @@ A notification was sent to your phone to confirm it's you. </message> - <message name="IDS_WEBAUTHN_CABLEV2_SERVERLINK_DESCRIPTION" desc="Contents of the dialog shown when the user tries to sign-in using a phone as a security key. The second placeholder will be replaced by the contents of the translated string IDS_WEBAUTHN_CABLEV2_SERVERLINK_TROUBLE. A placeholder is used for this because that link will be styled as a clickable link. The word 'Yes' will appear on the phone and is TC ID 6139894934866548097."> - <ph name="WEBSITE"><ex>accounts.google.com</ex>$1</ph> sent a notification to your phone. Tap Yes to confirm it's you. <ph name="LINK"><ex>Didn't get it?</ex>$2</ph> + <message name="IDS_WEBAUTHN_CABLEV2_SERVERLINK_DESCRIPTION" desc="Contents of the dialog shown when the user tries to sign-in using a phone as a security key."> + <ph name="WEBSITE"><ex>accounts.google.com</ex>$1</ph> sent a notification to your phone. To confirm it's you, follow the steps there. </message> - <message name="IDS_WEBAUTHN_CABLEV2_SERVERLINK_TROUBLE" desc="This message is shown as a link inside of IDS_WEBAUTHN_CABLEV2_SERVERLINK_DESCRIPTION and replaces placeholder two. The 'it' referenced here is the notification mentioned in that message."> + <message name="IDS_WEBAUTHN_CABLEV2_SERVERLINK_TROUBLE" desc="This message is shown as a link below IDS_WEBAUTHN_CABLEV2_SERVERLINK_DESCRIPTION. The 'it' referenced here is the notification mentioned in that message."> Didn't get it? </message> <message name="IDS_WEBAUTHN_CABLEV2_AOA_TITLE" desc="Contents of the dialog shown when the user tries to sign-in using a phone as a security key. The 'cable' is a physical USB cable.">
diff --git a/chrome/app/generated_resources_grd/IDS_SHARING_HUB_TOOLTIP.png.sha1 b/chrome/app/generated_resources_grd/IDS_SHARING_HUB_TOOLTIP.png.sha1 new file mode 100644 index 0000000..70e2595 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_SHARING_HUB_TOOLTIP.png.sha1
@@ -0,0 +1 @@ +7fa602f8a2957ac3cbc20690af08cd4e40366e14 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_WEBAUTHN_CABLEV2_SERVERLINK_DESCRIPTION.png.sha1 b/chrome/app/generated_resources_grd/IDS_WEBAUTHN_CABLEV2_SERVERLINK_DESCRIPTION.png.sha1 index 4a93695..bdc6e8c 100644 --- a/chrome/app/generated_resources_grd/IDS_WEBAUTHN_CABLEV2_SERVERLINK_DESCRIPTION.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_WEBAUTHN_CABLEV2_SERVERLINK_DESCRIPTION.png.sha1
@@ -1 +1 @@ -9bee4dce3b1c187db275c916687d8a86759fb3f2 \ No newline at end of file +72765005b97f9095a0db3e652b678ffccd898cb9 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_WEB_APP_FILE_HANDLING_PERMISSION_TEXT.png.sha1 b/chrome/app/generated_resources_grd/IDS_WEB_APP_FILE_HANDLING_PERMISSION_TEXT.png.sha1 index 6ee6d61..09a7bfb 100644 --- a/chrome/app/generated_resources_grd/IDS_WEB_APP_FILE_HANDLING_PERMISSION_TEXT.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_WEB_APP_FILE_HANDLING_PERMISSION_TEXT.png.sha1
@@ -1 +1 @@ -aa286efbaee111ce1a8e37854ff384fa397f929e \ No newline at end of file +37f7c25715c1e4e3a8f861719c3e758cef07498f \ No newline at end of file
diff --git a/chrome/app/nearby_share_strings.grdp b/chrome/app/nearby_share_strings.grdp index 4c3d48e..44290c4 100644 --- a/chrome/app/nearby_share_strings.grdp +++ b/chrome/app/nearby_share_strings.grdp
@@ -344,8 +344,8 @@ </message> <message name="IDS_NEARBY_NOTIFICATION_SEND_SUCCESS_TITLE" desc="Text shown as the title of a notfication when data was successfully sent via Nearby Share."> {COUNT, plural, - =1 {<ph name="ATTACHMENTS">$1<ex>1 item</ex></ph> successfully sent to <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>} - other {<ph name="ATTACHMENTS">$1<ex>3 items</ex></ph> successfully sent to <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>}} + =1 {<ph name="ATTACHMENTS">$1<ex>1 item</ex></ph> sent to <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>} + other {<ph name="ATTACHMENTS">$1<ex>3 items</ex></ph> sent to <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>}} </message> <message name="IDS_NEARBY_NOTIFICATION_SOURCE" desc="Text shown as the source of a Nearby Share notification."> Nearby Share
diff --git a/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_SEND_SUCCESS_TITLE.png.sha1 b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_SEND_SUCCESS_TITLE.png.sha1 index 8cba3e4..ea55c44a 100644 --- a/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_SEND_SUCCESS_TITLE.png.sha1 +++ b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_SEND_SUCCESS_TITLE.png.sha1
@@ -1 +1 @@ -e469e9b7fe91b0ce18f6624ef3d13276cb47f459 \ No newline at end of file +dc1a8a573ad504593eb7dc7b5413389e9e8080b1 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings.grdp b/chrome/app/os_settings_strings.grdp index 4693b44d..d9276cf4 100644 --- a/chrome/app/os_settings_strings.grdp +++ b/chrome/app/os_settings_strings.grdp
@@ -171,6 +171,15 @@ <message name="IDS_SETTINGS_ABOUT_PAGE_DEVICE_NAME_CONSTRAINTS" desc="Label describing the requirements for the text of the device hostname."> Name can use letters, numbers, and hyphens (-) </message> + <message name="IDS_SETTINGS_UPGRADE_TRY_AGAIN" desc="Status label: Update check error (ChromiumOS/ChromeOS)"> + Couldn't update your Chromebook. Please try again later. + </message> + <message name="IDS_SETTINGS_UPGRADE_DOWNLOAD_ERROR" desc="Status label: Update check download error(ChromiumOS/ChromeOS)"> + There was an issue downloading the update. Please try again later. + </message> + <message name="IDS_SETTINGS_UPGRADE_ADMINISTRATOR_ERROR" desc="Status label: Update blocked by policy (ChromiumOS/ChromeOS)"> + This update is blocked by your administrator + </message> <message name="IDS_SETTINGS_UPGRADE_UP_TO_DATE" desc="Status label: Already up to date (ChromiumOS/ChromeOS)"> Your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> is up to date </message> @@ -873,6 +882,9 @@ <message name="IDS_SETTINGS_CHROMEVOX_OPTIONS_LABEL" desc="Label for button to open ChromeVox options."> Open ChromeVox settings </message> + <message name="IDS_SETTINGS_CHROMEVOX_TUTORIAL_LABEL" desc="Label for button to open ChromeVox tutorial."> + Open ChromeVox tutorial + </message> <message name="IDS_SETTINGS_SCREEN_MAGNIFIER_LABEL" desc="Label for checkbox which enables the fullscreen magnifier"> Enable fullscreen magnifier </message>
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_CHROMEVOX_TUTORIAL_LABEL.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_CHROMEVOX_TUTORIAL_LABEL.png.sha1 new file mode 100644 index 0000000..0bbf178 --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_CHROMEVOX_TUTORIAL_LABEL.png.sha1
@@ -0,0 +1 @@ +fe93622971879e443f0f47052a36aa98fca13a40 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_UPGRADE_ADMINISTRATOR_ERROR.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_UPGRADE_ADMINISTRATOR_ERROR.png.sha1 new file mode 100644 index 0000000..85ac041 --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_UPGRADE_ADMINISTRATOR_ERROR.png.sha1
@@ -0,0 +1 @@ +886da1b08c9b335a946beda54bd53dad6ad6c34f \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_UPGRADE_DOWNLOAD_ERROR.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_UPGRADE_DOWNLOAD_ERROR.png.sha1 new file mode 100644 index 0000000..292575ad --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_UPGRADE_DOWNLOAD_ERROR.png.sha1
@@ -0,0 +1 @@ +aa5475b993579e0421d66c521aba528e42e48ef8 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_UPGRADE_TRY_AGAIN.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_UPGRADE_TRY_AGAIN.png.sha1 new file mode 100644 index 0000000..c7ac6487 --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_UPGRADE_TRY_AGAIN.png.sha1
@@ -0,0 +1 @@ +de7921fb47059f6da5c202cd71fe32e0a99b5af2 \ No newline at end of file
diff --git a/chrome/app/printing_strings.grdp b/chrome/app/printing_strings.grdp index 46057a89..df8df2fe 100644 --- a/chrome/app/printing_strings.grdp +++ b/chrome/app/printing_strings.grdp
@@ -111,10 +111,6 @@ desc="Option shown on printer drop-down list for saving previewed document as a PDF."> Save as PDF </message> - <message name="IDS_PRINT_PREVIEW_PRINT_TO_GOOGLE_DRIVE" - desc="Option shown on printer drop-down list for saving previewed document to Google Drive."> - Save to Google Drive - </message> <message name="IDS_PRINT_PREVIEW_SHEET_SUMMARY_LABEL" desc="Print summary, explaining to the user how many pages will be printed."> {COUNT, plural, =1 {1 sheet of paper} @@ -272,21 +268,6 @@ <message name="IDS_PRINT_PREVIEW_NEW_SHOW_ADVANCED_OPTIONS" desc="The text for the button to open the printer's advanced settings dialog in the new UI."> Advanced settings </message> - <message name="IDS_PRINT_PREVIEW_ACCEPT_INVITE" desc="Text for the button to accept the printer-sharing invitation."> - Accept - </message> - <message name="IDS_PRINT_PREVIEW_ACCEPT_GROUP_INVITE" desc="Text for the button to accept the printer-sharing invitation for the group of users."> - Accept for group - </message> - <message name="IDS_PRINT_PREVIEW_REJECT_INVITE" desc="Text for the button to reject the printer-sharing invitation."> - Reject - </message> - <message name="IDS_PRINT_PREVIEW_GROUP_INVITE_TEXT" desc="Message to show when the user has pending printer-sharing invitation for the group of users they are a manager of."> - <strong><ph name="SENDER">$1</ph></strong> wants to share a printer <strong><ph name="PRINTER_NAME">$2</ph></strong> with a group you own: <strong><ph name="GROUP_NAME">$3</ph></strong>. If you accept, all group members will be able to print to the printer. - </message> - <message name="IDS_PRINT_PREVIEW_INVITE_TEXT" desc="Message to show when the user has pending printer-sharing invitation."> - <strong><ph name="SENDER">$1</ph></strong> wants to share a printer <strong><ph name="PRINTER_NAME">$2</ph></strong> with you. - </message> <message name="IDS_PRINT_PREVIEW_BUTTON_SELECT" desc="Label for a button in a dialog asking a user to confirm selection of a printer in print preview UI. The printer gets selected if the user clicks the button."> Select </message> @@ -306,6 +287,10 @@ These settings are enforced by your administrator </message> <if expr="chromeos"> + <message name="IDS_PRINT_PREVIEW_PRINT_TO_GOOGLE_DRIVE" + desc="Option shown on printer drop-down list for saving previewed document to Google Drive."> + Save to Google Drive + </message> <message name="IDS_PRINT_PREVIEW_SERVER_SEARCH_BOX_PLACEHOLDER" desc="Text to put in a print server search box when user has not entered a search query."> Print servers </message>
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index 48a30d4..c80a6c0 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -1803,7 +1803,7 @@ All sites can show any ads to you </message> <message name="IDS_SETTINGS_SITE_SETTINGS_ADS_BLOCKED" desc="Label for the disabled option of the ads content setting."> - Block ads on sites that show intrusive or misleading ads (recommended) + Block ads on sites that show intrusive or misleading ads </message> <message name="IDS_SETTINGS_SITE_SETTINGS_ADS_ALLOWED_EXCEPTIONS" desc="Label for the allowed exceptions site list of the ads content setting."> Allowed to show any ads @@ -1830,7 +1830,7 @@ Sites might automatically download related files together to save you time </message> <message name="IDS_SETTINGS_SITE_SETTINGS_AUTOMATIC_DOWNLOADS_ALLOWED" desc="Label for the enabled option of the automatic downloads content setting."> - Sites can ask to automatically download multiple files (recommended) + Sites can ask to automatically download multiple files </message> <message name="IDS_SETTINGS_SITE_SETTINGS_AUTOMATIC_DOWNLOADS_BLOCKED" desc="Label for the disabled option of the automatic downloads content setting."> Don't allow sites to automatically download multiple files @@ -1845,11 +1845,14 @@ After you leave a site, it can keep syncing to finish tasks, like uploading photos or sending a chat message </message> <message name="IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOWED" desc="Label for the enabled option of the background sync content setting."> - Recently closed sites can finish sending and receiving data (recommended) + Recently closed sites can finish sending and receiving data </message> <message name="IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_BLOCKED" desc="Label for the disabled option of the background sync content setting."> Don't allow closed sites to finish sending or receiving data </message> + <message name="IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_BLOCKED_SUB_LABEL" desc="Sub label for the disabled option of the background sync content setting."> + After closing a page, tasks you started might not finish + </message> <message name="IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOWED_EXCEPTIONS" desc="Label for the allowed exceptions site list of the background sync content setting."> Allowed to finish sending and receiving data </message> @@ -1869,7 +1872,7 @@ Sites usually use your video camera for communication features like video chatting </message> <message name="IDS_SETTINGS_SITE_SETTINGS_CAMERA_ALLOWED" desc="Label for the enabled option of the camera content setting."> - Sites can ask to use your camera (recommended) + Sites can ask to use your camera </message> <message name="IDS_SETTINGS_SITE_SETTINGS_CAMERA_BLOCKED" desc="Label for the disabled option of the camera content setting."> Don't allow sites to use your camera @@ -1932,7 +1935,7 @@ Sites usually access files and folders on your device for features like automatically saving your work </message> <message name="IDS_SETTINGS_SITE_SETTINGS_FILE_SYSTEM_WRITE_ALLOWED" desc="Label for the enabled option of the file system write content setting."> - Sites can ask to edit files and folders on your device (recommended) + Sites can ask to edit files and folders on your device </message> <message name="IDS_SETTINGS_SITE_SETTINGS_FILE_SYSTEM_WRITE_BLOCKED" desc="Label for the disabled option of the file system write content setting."> Don't allow sites to edit files or folders on your device @@ -1968,11 +1971,14 @@ Sites usually show images to provide illustration, like photos for online stores or news articles </message> <message name="IDS_SETTINGS_SITE_SETTINGS_IMAGES_ALLOWED" desc="Label for the enabled option of the images content setting."> - Sites can show images (recommended) + Sites can show images </message> <message name="IDS_SETTINGS_SITE_SETTINGS_IMAGES_BLOCKED" desc="Label for the disabled option of the images content setting."> Don't allow sites to show images </message> + <message name="IDS_SETTINGS_SITE_SETTINGS_IMAGES_BLOCKED_SUB_LABEL" desc="Sub label for the disabled option of the images content setting."> + Features that need images won't work + </message> <message name="IDS_SETTINGS_SITE_SETTINGS_IMAGES_ALLOWED_EXCEPTIONS" desc="Label for the allowed exceptions site list of the images content setting."> Allowed to show images </message> @@ -1992,7 +1998,7 @@ Sites usually use Javascript to display interactive features, like video games or web forms </message> <message name="IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_ALLOWED" desc="Label for the enabled option of the Javascript content setting."> - Sites can use Javascript (recommended) + Sites can use Javascript </message> <message name="IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_BLOCKED" desc="Label for the disabled option of the Javascript content setting."> Don't allow sites to use Javascript @@ -2007,7 +2013,7 @@ Sites usually use your location for relevant features or info, like local news or nearby shops </message> <message name="IDS_SETTINGS_SITE_SETTINGS_LOCATION_ALLOWED" desc="Label for the enabled option of the location content setting."> - Sites can ask for your location (recommended) + Sites can ask for your location </message> <message name="IDS_SETTINGS_SITE_SETTINGS_LOCATION_BLOCKED" desc="Label for the disabled option of the location content setting."> Don't allow sites to see your location @@ -2025,7 +2031,7 @@ Sites usually use your microphone for communication features like video chatting </message> <message name="IDS_SETTINGS_SITE_SETTINGS_MIC_ALLOWED" desc="Label for the enabled option of the microphone content setting."> - Sites can ask to use your microphone (recommended) + Sites can ask to use your microphone </message> <message name="IDS_SETTINGS_SITE_SETTINGS_MIC_BLOCKED" desc="Label for the disabled option of the microphone content setting."> Don't allow sites to use your microphone @@ -2100,7 +2106,7 @@ Sites usually install payment handlers for shopping features like easier checkout </message> <message name="IDS_SETTINGS_SITE_SETTINGS_PAYMENT_HANDLERS_ALLOWED" desc="Label for the enabled option of the payment handlers content setting."> - Sites can install payment handlers (recommended) + Sites can install payment handlers </message> <message name="IDS_SETTINGS_SITE_SETTINGS_PAYMENT_HANDLERS_BLOCKED" desc="Label for the disabled option of the payment handlers content setting."> Don't allow sites to install payment handlers @@ -2124,7 +2130,7 @@ Sites can send pop-ups and use redirects </message> <message name="IDS_SETTINGS_SITE_SETTINGS_POPUPS_BLOCKED" desc="Label for the disabled option of the pop-ups content setting."> - Don't allow sites to send pop-ups or use redirects (recommended) + Don't allow sites to send pop-ups or use redirects </message> <message name="IDS_SETTINGS_SITE_SETTINGS_POPUPS_ALLOWED_EXCEPTIONS" desc="Label for the allowed exceptions site list of the pop-ups content setting."> Allowed to send pop-ups and use redirects @@ -2136,11 +2142,14 @@ When a site plays content protected by copyright, it might ask to recognize your device </message> <message name="IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_ALLOWED" desc="Label for the enabled option of the protected content content setting."> - Sites can ask to play protected content (recommended) + Sites can ask to play protected content </message> <message name="IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_BLOCKED" desc="Label for the disabled option of the protected content content setting."> Don't allow sites to play protected content </message> + <message name="IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_BLOCKED_SUB_LABEL" desc="Sub label for the disabled option of the protected content content setting."> + Media with a copyright might not play + </message> <message name="IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_ALLOWED_EXCEPTIONS" desc="Label for the allowed exceptions site list of the protected content content setting."> Allowed to play protected content </message> @@ -2172,11 +2181,14 @@ Sites might play sound to provide audio for music, videos, and other media </message> <message name="IDS_SETTINGS_SITE_SETTINGS_SOUND_ALLOWED" desc="Label for the enabled option of the sound content setting."> - Sites can play sound (recommended) + Sites can play sound </message> <message name="IDS_SETTINGS_SITE_SETTINGS_SOUND_BLOCKED" desc="Label for the disabled option of the sound content setting."> Don't allow sites to play sound </message> + <message name="IDS_SETTINGS_SITE_SETTINGS_SOUND_BLOCKED_SUB_LABEL" desc=" Sub label for the disabled option of the sound content setting."> + Features that need sound won't work + </message> <message name="IDS_SETTINGS_SITE_SETTINGS_SOUND_ALLOWED_EXCEPTIONS" desc="Label for the allowed exceptions site list of the sound content setting."> Allowed to play sound </message>
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_ADS_BLOCKED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_ADS_BLOCKED.png.sha1 index f6836a1..9733942 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_ADS_BLOCKED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_ADS_BLOCKED.png.sha1
@@ -1 +1 @@ -af33578dd4141ae5fb23545465977d9412b591be \ No newline at end of file +2b5ee4ad601d17098b8dd80ed60c9f10c2cb12d6 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_AUTOMATIC_DOWNLOADS_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_AUTOMATIC_DOWNLOADS_ALLOWED.png.sha1 index 5b9e315..454b3bb 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_AUTOMATIC_DOWNLOADS_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_AUTOMATIC_DOWNLOADS_ALLOWED.png.sha1
@@ -1 +1 @@ -38000b8a76679d71bc28b53e0c98ef8e23bf900a \ No newline at end of file +07a10511f905406550555f7894173c67f10eb8e0 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOWED.png.sha1 index a4233d2e..4d5bbaa 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOWED.png.sha1
@@ -1 +1 @@ -9b7c8d6f332ba94c05453b6c8f80a146f3498cf7 \ No newline at end of file +ddf961dea6e8207f71f53d24cb5750f3b7701ee9 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_BLOCKED_SUB_LABEL.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_BLOCKED_SUB_LABEL.png.sha1 new file mode 100644 index 0000000..4d5bbaa --- /dev/null +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_BLOCKED_SUB_LABEL.png.sha1
@@ -0,0 +1 @@ +ddf961dea6e8207f71f53d24cb5750f3b7701ee9 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_CAMERA_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_CAMERA_ALLOWED.png.sha1 index f0a7f3f..d6ef469 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_CAMERA_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_CAMERA_ALLOWED.png.sha1
@@ -1 +1 @@ -69bf88f767318f68d68c437b99a1b1eeede2fb4f \ No newline at end of file +5ef1151461deb8c61383c19b78346991083c9e31 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_FILE_SYSTEM_WRITE_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_FILE_SYSTEM_WRITE_ALLOWED.png.sha1 index 7256d47e..661a7eb 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_FILE_SYSTEM_WRITE_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_FILE_SYSTEM_WRITE_ALLOWED.png.sha1
@@ -1 +1 @@ -292aaee31e764acf8249416e92d25f804bfc1bb9 \ No newline at end of file +6f9600eec6b75112c6a05600e5b79619a3ff44f6 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_IMAGES_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_IMAGES_ALLOWED.png.sha1 index 7cc5fa2..bf328efe 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_IMAGES_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_IMAGES_ALLOWED.png.sha1
@@ -1 +1 @@ -44f9c0a979b566f4d418965831cc84ffd299c860 \ No newline at end of file +10caf0b3a169a4f673f783451e477bccfd59bd78 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_IMAGES_BLOCKED_SUB_LABEL.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_IMAGES_BLOCKED_SUB_LABEL.png.sha1 new file mode 100644 index 0000000..bf328efe --- /dev/null +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_IMAGES_BLOCKED_SUB_LABEL.png.sha1
@@ -0,0 +1 @@ +10caf0b3a169a4f673f783451e477bccfd59bd78 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_ALLOWED.png.sha1 index e7fd7b73..1f3b4a5 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_ALLOWED.png.sha1
@@ -1 +1 @@ -4c4d73ad5acb8164701626388044cf0f8a0d7e26 \ No newline at end of file +25a6f61d7fba5983cc6e90f859a7922544bd96e1 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_LOCATION_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_LOCATION_ALLOWED.png.sha1 index b4f560e6..c79a5d8b 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_LOCATION_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_LOCATION_ALLOWED.png.sha1
@@ -1 +1 @@ -b37d5830ab844b5a03b5c01ce35d6fa30f2e6b8a \ No newline at end of file +8eca610bb46cdc2c6833940fe514425922da2598 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_MIC_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_MIC_ALLOWED.png.sha1 index 652f2ff..9ff15837 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_MIC_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_MIC_ALLOWED.png.sha1
@@ -1 +1 @@ -adf00c89e3d5d85f305f7f1d49690a8f53e2b5e9 \ No newline at end of file +eeb6a73781d4e59a9f2eecf625ca77cd37c9e2c0 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PAYMENT_HANDLERS_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PAYMENT_HANDLERS_ALLOWED.png.sha1 index 5106ace..fee7d5fb 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PAYMENT_HANDLERS_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PAYMENT_HANDLERS_ALLOWED.png.sha1
@@ -1 +1 @@ -b1894e872b3d554addb05ae39fda674e12aa124c \ No newline at end of file +74bbdf175bf9805769547e49eb96ebfed0e6bc12 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_POPUPS_BLOCKED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_POPUPS_BLOCKED.png.sha1 index 1e63840..1cae17b 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_POPUPS_BLOCKED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_POPUPS_BLOCKED.png.sha1
@@ -1 +1 @@ -c30d0e23e1a124173cfe38ed8ccdd80b165f0c92 \ No newline at end of file +df654454ff11b4bdd7df5bf5e0978a8233e6c883 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_ALLOWED.png.sha1 index b782b2fa..e590e2a 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_ALLOWED.png.sha1
@@ -1 +1 @@ -6cc2461c2e5f3bdaae6f1b124ac9bf31c890873e \ No newline at end of file +9910ba7883f8fb64f71e602d9afa1c3ca9474bc6 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_BLOCKED_SUB_LABEL.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_BLOCKED_SUB_LABEL.png.sha1 new file mode 100644 index 0000000..e590e2a --- /dev/null +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_BLOCKED_SUB_LABEL.png.sha1
@@ -0,0 +1 @@ +9910ba7883f8fb64f71e602d9afa1c3ca9474bc6 \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_SOUND_ALLOWED.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_SOUND_ALLOWED.png.sha1 index 8da72b6..17440e0 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_SOUND_ALLOWED.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_SOUND_ALLOWED.png.sha1
@@ -1 +1 @@ -315079d5b99dfedc1c0034c70b5f9789e6ac6249 \ No newline at end of file +c53ef43ece1b0fb36a85eb96341c3af0b149d0fe \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_SOUND_BLOCKED_SUB_LABEL.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_SOUND_BLOCKED_SUB_LABEL.png.sha1 new file mode 100644 index 0000000..17440e0 --- /dev/null +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_SITE_SETTINGS_SOUND_BLOCKED_SUB_LABEL.png.sha1
@@ -0,0 +1 @@ +c53ef43ece1b0fb36a85eb96341c3af0b149d0fe \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index f0dbcef..c235983 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -2952,6 +2952,7 @@ "chrome_browser_main_android.cc", "chrome_browser_main_android.h", "commerce/merchant_viewer/web_contents_helper.cc", + "content_creation/notes/internal/android/note_service_bridge_factory.cc", "crash_upload_list/crash_upload_list_android.cc", "crash_upload_list/crash_upload_list_android.h", "data_reduction_proxy/data_reduction_promo_infobar_delegate_android.cc", @@ -3043,8 +3044,6 @@ "metrics/page_load_metrics_provider.h", "metrics/thread_watcher_android.cc", "metrics/thread_watcher_android.h", - "notifications/notification_channels_provider_android.cc", - "notifications/notification_channels_provider_android.h", "notifications/notification_platform_bridge_android.cc", "notifications/notification_platform_bridge_android.h", "notifications/notification_trigger_scheduler_android.cc", @@ -3218,6 +3217,8 @@ "//chrome/browser/commerce/subscriptions:commerce_subscription_db_content_proto", "//chrome/browser/commerce/subscriptions/android:jni_headers", "//chrome/browser/consent_auditor/android:jni_headers", + "//chrome/browser/content_creation/notes/internal", + "//chrome/browser/content_creation/notes/internal/android:jni_headers", "//chrome/browser/continuous_search:jni_headers", "//chrome/browser/continuous_search/internal", "//chrome/browser/download/internal/android", @@ -3227,6 +3228,7 @@ "//chrome/browser/flags:flags_android", "//chrome/browser/language/android:jni_headers", "//chrome/browser/long_screenshots:services", + "//chrome/browser/notifications:jni_headers", "//chrome/browser/notifications/chime/android", "//chrome/browser/notifications/scheduler/public", "//chrome/browser/optimization_guide/android:jni_headers", @@ -3270,6 +3272,7 @@ "//components/cdm/browser", "//components/component_updater/android:native_background_task_update_scheduler", "//components/content_capture/android", + "//components/content_creation/notes/android", "//components/content_settings/android", "//components/crash/android:crash_android", "//components/embedder_support/android:browser_context", @@ -3557,8 +3560,6 @@ "enterprise/connectors/connectors_prefs.h", "enterprise/connectors/connectors_service.cc", "enterprise/connectors/connectors_service.h", - "enterprise/connectors/device_trust/attestation_service.cc", - "enterprise/connectors/device_trust/attestation_service.h", "enterprise/connectors/device_trust/device_trust_factory.cc", "enterprise/connectors/device_trust/device_trust_factory.h", "enterprise/connectors/device_trust/device_trust_service.cc", @@ -4179,10 +4180,6 @@ "//chrome/app/theme:chrome_unscaled_resources_grit", "//chrome/app/vector_icons", "//chrome/browser/cart:mojo_bindings", - "//chrome/browser/enterprise/connectors/device_trust:attestation_ca_proto", - "//chrome/browser/enterprise/connectors/device_trust:google_key_proto", - "//chrome/browser/enterprise/connectors/device_trust:interface_proto", - "//chrome/browser/enterprise/connectors/device_trust:keystore_proto", "//chrome/browser/policy:path_parser", "//chrome/browser/profile_resetter:profile_reset_report_proto", "//chrome/browser/resource_coordinator:intervention_policy_database_proto",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 7a336fd3..ae453d7 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -3469,6 +3469,11 @@ flag_descriptions::kDesktopPWAsFlashAppNameInsteadOfOriginDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kDesktopPWAsFlashAppNameInsteadOfOrigin)}, + {"enable-desktop-pwas-notification-icon-and-title", + flag_descriptions::kDesktopPWAsNotificationIconAndTitleName, + flag_descriptions::kDesktopPWAsNotificationIconAndTitleDescription, + kOsDesktop, + FEATURE_VALUE_TYPE(features::kDesktopPWAsNotificationIconAndTitle)}, {"enable-desktop-pwas-tab-strip", flag_descriptions::kDesktopPWAsTabStripName, flag_descriptions::kDesktopPWAsTabStripDescription, kOsDesktop, @@ -3616,12 +3621,6 @@ kOsAndroid, FEATURE_VALUE_TYPE( offline_pages::kOfflinePagesInDownloadHomeOpenInCctFeature)}, - {"offline-pages-alternate-dino-page", - flag_descriptions::kOfflinePagesShowAlternateDinoPageName, - flag_descriptions::kOfflinePagesShowAlternateDinoPageDescription, - kOsAndroid, - FEATURE_VALUE_TYPE( - offline_pages::kOfflinePagesShowAlternateDinoPageFeature)}, {"offline-indicator-choice", flag_descriptions::kOfflineIndicatorChoiceName, flag_descriptions::kOfflineIndicatorChoiceDescription, kOsAndroid, FEATURE_WITH_PARAMS_VALUE_TYPE(offline_pages::kOfflineIndicatorFeature, @@ -4258,14 +4257,6 @@ flag_descriptions::kOmniboxTabSwitchSuggestionsName, flag_descriptions::kOmniboxTabSwitchSuggestionsDescription, kOsDesktop, FEATURE_VALUE_TYPE(omnibox::kOmniboxTabSwitchSuggestions)}, - {"omnibox-suggestion-button-row", - flag_descriptions::kOmniboxSuggestionButtonRowName, - flag_descriptions::kOmniboxSuggestionButtonRowDescription, kOsDesktop, - FEATURE_VALUE_TYPE(omnibox::kOmniboxSuggestionButtonRow)}, - {"omnibox-pedal-suggestions", - flag_descriptions::kOmniboxPedalSuggestionsName, - flag_descriptions::kOmniboxPedalSuggestionsDescription, kOsDesktop, - FEATURE_VALUE_TYPE(omnibox::kOmniboxPedalSuggestions)}, {"omnibox-pedals-batch2", flag_descriptions::kOmniboxPedalsBatch2Name, flag_descriptions::kOmniboxPedalsBatch2Description, kOsDesktop, FEATURE_VALUE_TYPE(omnibox::kOmniboxPedalsBatch2)}, @@ -5747,13 +5738,6 @@ FEATURE_VALUE_TYPE(chrome::android::kEnhancedProtectionPromoCard)}, #endif - {"safe-browsing-real-time-url-lookup-enterprise-ga-endpoint", - flag_descriptions::kSafeBrowsingRealTimeUrlLookupEnterpriseGaEndpointName, - flag_descriptions:: - kSafeBrowsingRealTimeUrlLookupEnterpriseGaEndpointDescription, - kOsAll, - FEATURE_VALUE_TYPE(safe_browsing::kRealTimeUrlLookupEnterpriseGaEndpoint)}, - #if BUILDFLAG(IS_CHROMEOS_ASH) {"gesture-properties-dbus-service", flag_descriptions::kEnableGesturePropertiesDBusServiceName,
diff --git a/chrome/browser/accessibility/caption_controller.h b/chrome/browser/accessibility/caption_controller.h index 0123a84..850fed1 100644 --- a/chrome/browser/accessibility/caption_controller.h +++ b/chrome/browser/accessibility/caption_controller.h
@@ -9,6 +9,7 @@ #include "chrome/common/caption.mojom.h" #include "components/keyed_service/core/keyed_service.h" +#include "components/soda/constants.h" #include "components/soda/soda_installer.h" #include "media/mojo/mojom/speech_recognition_service.mojom.h" #include "ui/native_theme/caption_style.h" @@ -75,8 +76,14 @@ // SodaInstaller::Observer: void OnSodaInstalled() override; - void OnSodaProgress(int progress) override {} + void OnSodaLanguagePackInstalled( + speech::LanguageCode language_code) override {} + void OnSodaProgress(int combined_progress) override {} + void OnSodaLanguagePackProgress(int language_progress, + speech::LanguageCode language_code) override { + } void OnSodaError() override {} + void OnSodaLanguagePackError(speech::LanguageCode language_code) override {} // ui::NativeThemeObserver: void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override {}
diff --git a/chrome/browser/accessibility/caption_controller_browsertest.cc b/chrome/browser/accessibility/caption_controller_browsertest.cc index 54414c9..551c87e 100644 --- a/chrome/browser/accessibility/caption_controller_browsertest.cc +++ b/chrome/browser/accessibility/caption_controller_browsertest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/accessibility/caption_controller.h" +#include "base/feature_list.h" #include "base/files/file_path.h" #include "base/ranges/ranges.h" #include "base/test/scoped_feature_list.h" @@ -30,8 +31,24 @@ #include "content/public/test/browser_test.h" #include "media/base/media_switches.h" +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/constants/ash_features.h" +#endif + namespace captions { +namespace { +// Chrome OS requires an additional feature flag to enable Live Caption. +std::vector<base::Feature> RequiredFeatureFlags() { + std::vector<base::Feature> features = {media::kLiveCaption, + media::kUseSodaForLiveCaption}; +#if BUILDFLAG(IS_CHROMEOS_ASH) + features.push_back(ash::features::kOnDeviceSpeechRecognition); +#endif + return features; +} +} // namespace + // Blocks until a new profile is created. void UnblockOnProfileCreation(base::RunLoop* run_loop, Profile* profile, @@ -60,8 +77,7 @@ // InProcessBrowserTest overrides: void SetUp() override { - scoped_feature_list_.InitWithFeatures( - {media::kLiveCaption, media::kUseSodaForLiveCaption}, {}); + scoped_feature_list_.InitWithFeatures(RequiredFeatureFlags(), {}); InProcessBrowserTest::SetUp(); }
diff --git a/chrome/browser/accessibility/soda_installer_impl.cc b/chrome/browser/accessibility/soda_installer_impl.cc index aefbf59..79526d1 100644 --- a/chrome/browser/accessibility/soda_installer_impl.cc +++ b/chrome/browser/accessibility/soda_installer_impl.cc
@@ -145,6 +145,12 @@ return; } + LanguageCode language_code = LanguageCode::kNone; + if (id != component_updater::SodaComponentInstallerPolicy::GetExtensionId()) { + language_code = GetLanguageCodeByComponentId(id); + DCHECK_NE(language_code, LanguageCode::kNone); + } + switch (event) { case Events::COMPONENT_UPDATE_FOUND: case Events::COMPONENT_UPDATE_READY: @@ -154,14 +160,29 @@ update_client::CrxUpdateItem item; g_browser_process->component_updater()->GetComponentDetails(id, &item); downloading_components_[id] = item; - const int progress = GetDownloadProgress(downloading_components_); + const int combined_progress = + GetDownloadProgress(downloading_components_); + // When GetDownloadProgress returns -1, do nothing. It returns -1 when the // downloaded or total bytes is unknown. - if (progress != -1) { - NotifyOnSodaProgress(progress); + if (combined_progress != -1) { + NotifyOnSodaProgress(combined_progress); } + + if (language_code != LanguageCode::kNone) { + const int language_progress = GetDownloadProgress( + std::map<std::string, update_client::CrxUpdateItem>{{id, item}}); + if (language_progress != -1) { + NotifyOnSodaLanguagePackProgress(language_progress, language_code); + } + } + } break; case Events::COMPONENT_UPDATE_ERROR: + if (language_code != LanguageCode::kNone) { + NotifyOnSodaLanguagePackError(language_code); + } + NotifyOnSodaError(); break; case Events::COMPONENT_CHECKING_FOR_UPDATES: @@ -180,8 +201,11 @@ } } -void SodaInstallerImpl::OnSodaLanguagePackInstalled() { +void SodaInstallerImpl::OnSodaLanguagePackInstalled( + speech::LanguageCode language_code) { language_installed_ = true; + NotifyOnSodaLanguagePackInstalled(language_code); + if (soda_binary_installed_) { component_updater_observer_.RemoveAll(); NotifyOnSodaInstalled();
diff --git a/chrome/browser/accessibility/soda_installer_impl.h b/chrome/browser/accessibility/soda_installer_impl.h index 16006b1..867e97f75 100644 --- a/chrome/browser/accessibility/soda_installer_impl.h +++ b/chrome/browser/accessibility/soda_installer_impl.h
@@ -54,7 +54,7 @@ void OnEvent(Events event, const std::string& id) override; void OnSodaBinaryInstalled(); - void OnSodaLanguagePackInstalled(); + void OnSodaLanguagePackInstalled(speech::LanguageCode language_code); std::map<std::string, update_client::CrxUpdateItem> downloading_components_;
diff --git a/chrome/browser/android/feed/v2/feed_service_factory.cc b/chrome/browser/android/feed/v2/feed_service_factory.cc index d514e10..f6bd630 100644 --- a/chrome/browser/android/feed/v2/feed_service_factory.cc +++ b/chrome/browser/android/feed/v2/feed_service_factory.cc
@@ -15,8 +15,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" -#include "chrome/browser/offline_pages/offline_page_model_factory.h" -#include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_key.h" #include "chrome/browser/signin/identity_manager_factory.h" @@ -92,8 +90,6 @@ DependsOn(IdentityManagerFactory::GetInstance()); DependsOn(HistoryServiceFactory::GetInstance()); DependsOn(background_task::BackgroundTaskSchedulerFactory::GetInstance()); - DependsOn(offline_pages::PrefetchServiceFactory::GetInstance()); - DependsOn(offline_pages::OfflinePageModelFactory::GetInstance()); } FeedServiceFactory::~FeedServiceFactory() = default; @@ -125,12 +121,6 @@ chrome_info.version = base::Version({CHROME_VERSION}); chrome_info.channel = chrome::GetChannel(); - offline_pages::PrefetchService* prefetch_service = nullptr; - if (offline_pages::IsPrefetchingOfflinePagesEnabled()) { - prefetch_service = offline_pages::PrefetchServiceFactory::GetForKey( - profile->GetProfileKey()); - } - return new FeedService( std::make_unique<FeedServiceDelegateImpl>(), std::make_unique<RefreshTaskSchedulerImpl>( @@ -146,9 +136,6 @@ identity_manager, HistoryServiceFactory::GetForProfile(profile, ServiceAccessType::IMPLICIT_ACCESS), - prefetch_service, - offline_pages::OfflinePageModelFactory::GetForKey( - profile->GetProfileKey()), storage_partition->GetURLLoaderFactoryForBrowserProcess(), background_task_runner, api_key, chrome_info); }
diff --git a/chrome/browser/apps/app_service/app_icon_factory.cc b/chrome/browser/apps/app_service/app_icon_factory.cc index 0c5a3dee..67c88c5f 100644 --- a/chrome/browser/apps/app_service/app_icon_factory.cc +++ b/chrome/browser/apps/app_service/app_icon_factory.cc
@@ -1305,12 +1305,6 @@ extensions::ChromeAppIcon::ApplyEffects(size_hint_in_dip, resize_function, app_launchable, from_bookmark, badge_type, image_skia); - - if (icon_effects & IconEffects::kPendingLocalLaunch) { - color_utils::HSL shift = {-1, 0, 0.6}; - *image_skia = - gfx::ImageSkiaOperations::CreateHSLShiftedImage(*image_skia, shift); - } } void LoadIconFromExtension(apps::mojom::IconType icon_type,
diff --git a/chrome/browser/apps/app_service/app_icon_factory.h b/chrome/browser/apps/app_service/app_icon_factory.h index 4739b53..45f7487 100644 --- a/chrome/browser/apps/app_service/app_icon_factory.h +++ b/chrome/browser/apps/app_service/app_icon_factory.h
@@ -50,9 +50,6 @@ kRoundCorners = 0x08, // Bookmark apps get round corners. kPaused = 0x10, // Paused apps are grayed out and badged to indicate they // cannot be launched. - kPendingLocalLaunch = 0x20, // Apps that are installed through sync, but - // have not been launched locally yet. They - // should appear gray until they are launched. kCrOsStandardBackground = 0x40, // Add the white background to the standard icon. kCrOsStandardMask = 0x80, // Apply the mask to the standard icon.
diff --git a/chrome/browser/apps/app_service/app_platform_metrics.cc b/chrome/browser/apps/app_service/app_platform_metrics.cc index cad30a41..ebb002c 100644 --- a/chrome/browser/apps/app_service/app_platform_metrics.cc +++ b/chrome/browser/apps/app_service/app_platform_metrics.cc
@@ -31,6 +31,8 @@ // UMA metrics for a snapshot count of installed apps. constexpr char kAppsCountHistogramPrefix[] = "Apps.AppsCount."; constexpr char kAppsRunningDurationHistogramPrefix[] = "Apps.RunningDuration."; +constexpr char kAppsRunningPercentageHistogramPrefix[] = + "Apps.RunningPercentage."; constexpr char kAppsActivatedCountHistogramPrefix[] = "Apps.ActivatedCount."; constexpr char kAppsUsageTimeHistogramPrefix[] = "Apps.UsageTime."; @@ -363,6 +365,13 @@ } // static +std::string AppPlatformMetrics::GetAppsRunningPercentageHistogramNameForTest( + AppTypeName app_type_name) { + return kAppsRunningPercentageHistogramPrefix + + GetAppTypeHistogramName(app_type_name); +} + +// static std::string AppPlatformMetrics::GetAppsActivatedCountHistogramNameForTest( AppTypeName app_type_name) { return kAppsActivatedCountHistogramPrefix + @@ -574,10 +583,20 @@ it.second.start_time = base::TimeTicks::Now(); } + base::TimeDelta total_running_duration; for (auto it : running_duration_) { base::UmaHistogramCustomTimes( kAppsRunningDurationHistogramPrefix + GetAppTypeHistogramName(it.first), it.second, kMinDuration, kMaxDuration, kDurationBuckets); + total_running_duration += it.second; + } + + if (!total_running_duration.is_zero()) { + for (auto it : running_duration_) { + base::UmaHistogramPercentage(kAppsRunningPercentageHistogramPrefix + + GetAppTypeHistogramName(it.first), + 100 * (it.second / total_running_duration)); + } } for (auto it : activated_count_) {
diff --git a/chrome/browser/apps/app_service/app_platform_metrics.h b/chrome/browser/apps/app_service/app_platform_metrics.h index 85cdc1c..ceb3eae 100644 --- a/chrome/browser/apps/app_service/app_platform_metrics.h +++ b/chrome/browser/apps/app_service/app_platform_metrics.h
@@ -86,6 +86,10 @@ static std::string GetAppsRunningDurationHistogramNameForTest( AppTypeName app_type_name); + // UMA metrics name for apps running percentage in Chrome OS. + static std::string GetAppsRunningPercentageHistogramNameForTest( + AppTypeName app_type_name); + // UMA metrics name for app window activated count in Chrome OS. static std::string GetAppsActivatedCountHistogramNameForTest( AppTypeName app_type_name);
diff --git a/chrome/browser/apps/app_service/app_platform_metrics_service_unittest.cc b/chrome/browser/apps/app_service/app_platform_metrics_service_unittest.cc index 17ab5ba..24877a9a 100644 --- a/chrome/browser/apps/app_service/app_platform_metrics_service_unittest.cc +++ b/chrome/browser/apps/app_service/app_platform_metrics_service_unittest.cc
@@ -95,6 +95,8 @@ void TearDown() override { app_platform_metrics_service_.reset(); chromeos::PowerManagerClient::Shutdown(); + browser_window1_.reset(); + browser_window2_.reset(); } void InstallApps() { @@ -250,6 +252,25 @@ time_delta, count); } + void VerifyAppRunningPercentageCountHistogram( + base::HistogramBase::Count count, + AppTypeName app_type_name) { + histogram_tester_.ExpectTotalCount( + AppPlatformMetrics::GetAppsRunningPercentageHistogramNameForTest( + app_type_name), + count); + } + + void VerifyAppRunningPercentageHistogram( + int count, + base::HistogramBase::Count expected_count, + AppTypeName app_type_name) { + histogram_tester().ExpectBucketCount( + AppPlatformMetrics::GetAppsRunningPercentageHistogramNameForTest( + app_type_name), + count, expected_count); + } + void VerifyAppActivatedCount(int count, AppTypeName app_type_name) { DictionaryPrefUpdate update(GetPrefService(), kAppActivatedCount); std::string key = GetAppTypeHistogramName(app_type_name); @@ -420,6 +441,11 @@ VerifyAppRunningDurationHistogram(base::TimeDelta::FromHours(1), /*expected_count=*/1, AppTypeName::kChromeBrowser); + VerifyAppRunningPercentageCountHistogram(/*expected_count=*/1, + AppTypeName::kChromeBrowser); + VerifyAppRunningPercentageHistogram(100, + /*expected_count=*/1, + AppTypeName::kChromeBrowser); VerifyAppActivatedCountHistogram(/*expected_count=*/1, AppTypeName::kChromeBrowser); VerifyAppActivatedHistogram(/*count*/ 2, /*expected_count=*/1, @@ -465,6 +491,10 @@ AppTypeName::kArc); VerifyAppRunningDurationHistogram(base::TimeDelta::FromHours(1), /*expected_count=*/1, AppTypeName::kArc); + VerifyAppRunningPercentageCountHistogram(/*expected_count=*/1, + AppTypeName::kArc); + VerifyAppRunningPercentageHistogram(100, + /*expected_count=*/1, AppTypeName::kArc); VerifyAppActivatedCountHistogram(/*expected_count=*/1, AppTypeName::kArc); } @@ -611,6 +641,49 @@ VerifyAppActivatedCount(/*expected_count=*/0, AppTypeName::kArc); } +// Tests the app running percentage UMA metrics when launch a browser window +// and an ARC app in one day. +TEST_F(AppPlatformMetricsServiceTest, AppRunningPercentrage) { + // Launch a browser window. + InstallOneApp(extension_misc::kChromeAppId, apps::mojom::AppType::kExtension); + std::unique_ptr<Browser> browser = CreateBrowserWithAuraWindow1(); + EXPECT_EQ(1U, BrowserList::GetInstance()->size()); + + // Set the browser window active. + ModifyInstance(extension_misc::kChromeAppId, + browser->window()->GetNativeWindow(), kActiveInstanceState); + task_environment_.FastForwardBy(base::TimeDelta::FromHours(1)); + + // Set the browser window running in the background. + ModifyInstance(extension_misc::kChromeAppId, + browser->window()->GetNativeWindow(), kInactiveInstanceState); + + // Launch an ARC app. + std::string app_id = "aa"; + InstallOneApp(app_id, apps::mojom::AppType::kArc); + + // Create a window to simulate launching the app. + auto window = std::make_unique<aura::Window>(nullptr); + window->Init(ui::LAYER_NOT_DRAWN); + ModifyInstance(app_id, window.get(), apps::InstanceState::kActive); + + // Close the window after running one hour. + task_environment_.FastForwardBy(base::TimeDelta::FromHours(1)); + ModifyInstance(app_id, window.get(), apps::InstanceState::kDestroyed); + + // One day passes. + task_environment_.FastForwardBy(base::TimeDelta::FromHours(1)); + VerifyAppRunningPercentageCountHistogram(/*expected_count=*/1, + AppTypeName::kChromeBrowser); + VerifyAppRunningPercentageCountHistogram(/*expected_count=*/1, + AppTypeName::kArc); + VerifyAppRunningPercentageHistogram(50, + /*expected_count=*/1, + AppTypeName::kChromeBrowser); + VerifyAppRunningPercentageHistogram(50, + /*expected_count=*/1, AppTypeName::kArc); +} + TEST_F(AppPlatformMetricsServiceTest, UsageTime) { // Create an ARC app window. std::string app_id = "aa";
diff --git a/chrome/browser/ash/accessibility/accessibility_manager.cc b/chrome/browser/ash/accessibility/accessibility_manager.cc index 57c5d232..051950a 100644 --- a/chrome/browser/ash/accessibility/accessibility_manager.cc +++ b/chrome/browser/ash/accessibility/accessibility_manager.cc
@@ -1784,4 +1784,24 @@ extension_misc::kSelectToSpeakExtensionId, std::move(event)); } +void AccessibilityManager::ShowChromeVoxTutorial() { + if (!profile_) + return; + + extensions::EventRouter* event_router = + extensions::EventRouter::Get(profile_); + + auto event_args = + extensions::api::accessibility_private::OnShowChromeVoxTutorial::Create(); + + auto event = std::make_unique<extensions::Event>( + extensions::events::ACCESSIBILITY_PRIVATE_ON_SHOW_CHROMEVOX_TUTORIAL, + extensions::api::accessibility_private::OnShowChromeVoxTutorial:: + kEventName, + std::move(event_args)); + + event_router->DispatchEventWithLazyListener( + extension_misc::kChromeVoxExtensionId, std::move(event)); +} + } // namespace ash
diff --git a/chrome/browser/ash/accessibility/accessibility_manager.h b/chrome/browser/ash/accessibility/accessibility_manager.h index bb663e07..d39a57d 100644 --- a/chrome/browser/ash/accessibility/accessibility_manager.h +++ b/chrome/browser/ash/accessibility/accessibility_manager.h
@@ -124,6 +124,8 @@ // Returns true when the accessibility menu should be shown. bool ShouldShowAccessibilityMenu(); + void ShowChromeVoxTutorial(); + // Enables or disables the large cursor. void EnableLargeCursor(bool enabled);
diff --git a/chrome/browser/ash/accessibility/soda_installer_impl_chromeos.cc b/chrome/browser/ash/accessibility/soda_installer_impl_chromeos.cc index 996e174e..161bc97 100644 --- a/chrome/browser/ash/accessibility/soda_installer_impl_chromeos.cc +++ b/chrome/browser/ash/accessibility/soda_installer_impl_chromeos.cc
@@ -159,7 +159,10 @@ } else { language_installed_ = false; language_progress_ = 0.0; - NotifyOnSodaError(); + + // TODO: Notify the observer of the specific language pack that failed to + // install. ChromeOS currently only supports the en-US language pack. + NotifyOnSodaLanguagePackError(speech::LanguageCode::kEnUs); } is_language_downloading_ = false; } @@ -171,7 +174,10 @@ void SodaInstallerImplChromeOS::OnLanguageProgress(double progress) { language_progress_ = progress; - OnSodaCombinedProgress(); + + // TODO: Notify the observer of the specific language pack that is currently + // being installed. ChromeOS currently only supports the en-US language pack. + NotifyOnSodaLanguagePackProgress(progress, speech::LanguageCode::kEnUs); } void SodaInstallerImplChromeOS::OnSodaCombinedProgress() {
diff --git a/chrome/browser/ash/arc/intent_helper/arc_settings_service_unittest.cc b/chrome/browser/ash/arc/intent_helper/arc_settings_service_unittest.cc index 71e9829..b85fe572 100644 --- a/chrome/browser/ash/arc/intent_helper/arc_settings_service_unittest.cc +++ b/chrome/browser/ash/arc/intent_helper/arc_settings_service_unittest.cc
@@ -19,7 +19,7 @@ #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/testing_profile.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h" #include "components/arc/arc_prefs.h" #include "components/arc/arc_service_manager.h" @@ -56,7 +56,8 @@ base::CommandLine::ForCurrentProcess()); ArcSessionManager::SetUiEnabledForTesting(false); chromeos::DBusThreadManager::Initialize(); - chromeos::NetworkHandler::Initialize(); + network_handler_test_helper_ = + std::make_unique<chromeos::NetworkHandlerTestHelper>(); network_config_helper_ = std::make_unique< chromeos::network_config::CrosNetworkConfigTestHelper>(); ash::StatsReportingController::RegisterLocalStatePrefs( @@ -106,7 +107,7 @@ arc_service_manager_.reset(); ash::StatsReportingController::Shutdown(); - chromeos::NetworkHandler::Shutdown(); + network_handler_test_helper_.reset(); chromeos::DBusThreadManager::Shutdown(); } @@ -138,6 +139,8 @@ } private: + std::unique_ptr<chromeos::NetworkHandlerTestHelper> + network_handler_test_helper_; std::unique_ptr<chromeos::network_config::CrosNetworkConfigTestHelper> network_config_helper_; TestingPrefServiceSimple local_state_;
diff --git a/chrome/browser/ash/authpolicy/authpolicy_credentials_manager_unittest.cc b/chrome/browser/ash/authpolicy/authpolicy_credentials_manager_unittest.cc index d324eee2..7c37336 100644 --- a/chrome/browser/ash/authpolicy/authpolicy_credentials_manager_unittest.cc +++ b/chrome/browser/ash/authpolicy/authpolicy_credentials_manager_unittest.cc
@@ -17,8 +17,7 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chromeos/dbus/authpolicy/fake_authpolicy_client.h" -#include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user_manager.h" #include "content/public/test/browser_task_environment.h" @@ -52,8 +51,6 @@ ~AuthPolicyCredentialsManagerTest() override = default; void SetUp() override { - chromeos::DBusThreadManager::Initialize(); - chromeos::NetworkHandler::Initialize(); AuthPolicyClient::InitializeFake(); fake_authpolicy_client()->DisableOperationDelayForTesting(); @@ -86,8 +83,6 @@ EXPECT_CALL(*mock_user_manager(), Shutdown()); profile_.reset(); AuthPolicyClient::Shutdown(); - NetworkHandler::Shutdown(); - DBusThreadManager::Shutdown(); } protected: @@ -128,6 +123,7 @@ } content::BrowserTaskEnvironment task_environment_; + chromeos::NetworkHandlerTestHelper network_handler_test_helper_; AccountId account_id_; std::unique_ptr<TestingProfile> profile_;
diff --git a/chrome/browser/ash/crosapi/browser_loader.cc b/chrome/browser/ash/crosapi/browser_loader.cc index a0b5e1e..9bf9d7a7 100644 --- a/chrome/browser/ash/crosapi/browser_loader.cc +++ b/chrome/browser/ash/crosapi/browser_loader.cc
@@ -17,7 +17,7 @@ #include "base/task/thread_pool.h" #include "chrome/browser/ash/crosapi/browser_util.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chromeos/cryptohome/system_salt_getter.h" #include "components/component_updater/component_updater_service.h" @@ -112,7 +112,7 @@ void SetLacrosUpdateAvailable() override { if (base::FeatureList::IsEnabled(kLacrosShowUpdateNotifications)) { // Show the update notification in ash. - SystemTrayClient::Get()->SetLacrosUpdateAvailable(); + SystemTrayClientImpl::Get()->SetLacrosUpdateAvailable(); } } };
diff --git a/chrome/browser/ash/customization/customization_document_unittest.cc b/chrome/browser/ash/customization/customization_document_unittest.cc index 1966573..1f8f1cf7 100644 --- a/chrome/browser/ash/customization/customization_document_unittest.cc +++ b/chrome/browser/ash/customization/customization_document_unittest.cc
@@ -18,8 +18,8 @@ #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/system/fake_statistics_provider.h" @@ -198,10 +198,8 @@ ServicesCustomizationDocument::InitializeForTesting( base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>( &loader_factory_)); - - DBusThreadManager::Initialize(); - NetworkHandler::Initialize(); RunUntilIdle(); + const NetworkState* default_network = NetworkHandler::Get()->network_state_handler()->DefaultNetwork(); std::string default_network_path = @@ -225,8 +223,6 @@ void TearDown() override { TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); - NetworkHandler::Shutdown(); - DBusThreadManager::Shutdown(); network_portal_detector::InitializeForTesting(nullptr); loader_factory_.ClearResponses(); interceptor_.reset(); @@ -286,6 +282,7 @@ private: content::BrowserTaskEnvironment task_environment_; + chromeos::NetworkHandlerTestHelper network_handler_test_helper_; chromeos::system::ScopedFakeStatisticsProvider fake_statistics_provider_; ScopedCrosSettingsTestHelper scoped_cros_settings_test_helper_; TestingPrefServiceSimple local_state_;
diff --git a/chrome/browser/ash/lock_screen_apps/toast_dialog_view.cc b/chrome/browser/ash/lock_screen_apps/toast_dialog_view.cc index 3105605..115095f 100644 --- a/chrome/browser/ash/lock_screen_apps/toast_dialog_view.cc +++ b/chrome/browser/ash/lock_screen_apps/toast_dialog_view.cc
@@ -13,13 +13,13 @@ #include "chrome/grit/generated_resources.h" #include "ui/aura/window.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace lock_screen_apps {
diff --git a/chrome/browser/ash/lock_screen_apps/toast_dialog_view.h b/chrome/browser/ash/lock_screen_apps/toast_dialog_view.h index fdc052f..f83ab1f 100644 --- a/chrome/browser/ash/lock_screen_apps/toast_dialog_view.h +++ b/chrome/browser/ash/lock_screen_apps/toast_dialog_view.h
@@ -9,8 +9,8 @@ #include "base/callback.h" #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace lock_screen_apps {
diff --git a/chrome/browser/ash/login/ash_hud_login_browsertest.cc b/chrome/browser/ash/login/ash_hud_login_browsertest.cc new file mode 100644 index 0000000..9d4f9b74 --- /dev/null +++ b/chrome/browser/ash/login/ash_hud_login_browsertest.cc
@@ -0,0 +1,814 @@ +// 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. + +#include "ash/hud_display/ash_tracing_handler.h" +#include "ash/hud_display/ash_tracing_request.h" +#include "ash/hud_display/hud_display.h" +#include "ash/hud_display/hud_settings_view.h" +#include "ash/public/cpp/accelerators.h" +#include "ash/public/cpp/ash_switches.h" +#include "ash/public/cpp/login_screen_test_api.h" +#include "ash/public/cpp/test/shell_test_api.h" +#include "ash/shell.h" +#include "base/command_line.h" +#include "base/rand_util.h" +#include "base/strings/string_util.h" +#include "base/synchronization/lock.h" +#include "base/task/thread_pool.h" +#include "chrome/browser/ash/login/login_manager_test.h" +#include "chrome/browser/ash/login/test/login_manager_mixin.h" +#include "chrome/browser/ash/login/wizard_controller.h" +#include "chrome/browser/ui/ash/chrome_shell_delegate.h" +#include "chrome/common/chrome_switches.h" +#include "content/public/test/browser_test.h" +#include "third_party/perfetto/include/perfetto/tracing/tracing.h" + +namespace chromeos { +namespace { + +// Two global registries track test ash::hud_display::AshTraceDestinationIO and +// test perfetto sessions. +class TestAshTraceDestinationIORegistry; +class TestTracingSessionRegistry; +static TestAshTraceDestinationIORegistry* + test_ash_trace_destination_io_registry = nullptr; +static TestTracingSessionRegistry* test_tracing_session_registry{nullptr}; + +std::unique_ptr<ash::hud_display::AshTraceDestinationIO> +CreateTestAshTraceDestinationIO(); + +const char* AshTracingRequestStatus2String( + const ash::hud_display::AshTracingRequest::Status& status) { + switch (status) { + case ash::hud_display::AshTracingRequest::Status::kEmpty: + return "kEmpty"; + case ash::hud_display::AshTracingRequest::Status::kInitialized: + return "kInitialized"; + case ash::hud_display::AshTracingRequest::Status::kStarted: + return "kStarted"; + case ash::hud_display::AshTracingRequest::Status::kStopping: + return "kStopping"; + case ash::hud_display::AshTracingRequest::Status::kPendingMount: + return "kPendingMount"; + case ash::hud_display::AshTracingRequest::Status::kWritingFile: + return "kWritingFile"; + case ash::hud_display::AshTracingRequest::Status::kCompleted: + return "kCompleted"; + } +} + +// Tracks all ash::hud_display::AshTraceDestinationIO objects. +class TestAshTraceDestinationIORegistry { + public: + struct IOStatus { + base::FilePath tracing_directory_created; + base::FilePath tracing_file_created; + bool memfd_created{false}; + bool sendfile_ok{false}; + }; + + TestAshTraceDestinationIORegistry() : id_(base::RandUint64()) {} + + TestAshTraceDestinationIORegistry(const TestAshTraceDestinationIORegistry&) = + delete; + TestAshTraceDestinationIORegistry& operator=( + const TestAshTraceDestinationIORegistry&) = delete; + + ~TestAshTraceDestinationIORegistry() = default; + + // CreateTestAshTraceDestinationIO() can be called on the ThreadPool, so we + // use lock to keep it running. + IOStatus* NewIOStatus() { + base::AutoLock l(lock_); + sessions_.push_back(std::make_unique<IOStatus>()); + return sessions_.back().get(); + } + + // This is used for individual DestinationIO object to check that registry + // was not replaced (when tests are run the ine same process). + uint64_t id() const { return id_; } + + const std::vector<std::unique_ptr<IOStatus>>& sessions() const { + return sessions_; + } + + private: + const unsigned id_; + std::vector<std::unique_ptr<IOStatus>> sessions_; + base::Lock lock_; +}; + +// Test ash::hud_display::AshTraceDestinationIO object. +class TestAshTraceDestinationIO + : public ash::hud_display::AshTraceDestinationIO { + public: + explicit TestAshTraceDestinationIO( + TestAshTraceDestinationIORegistry* registry) + : registry_(registry), + registry_id_(registry->id()), + status_(registry->NewIOStatus()) { + AssertRegistry(); + } + TestAshTraceDestinationIO(const TestAshTraceDestinationIO&) = delete; + TestAshTraceDestinationIO& operator=(const TestAshTraceDestinationIO&) = + delete; + + ~TestAshTraceDestinationIO() override = default; + + // Overrides base::CreateDirectory. + bool CreateDirectory(const base::FilePath& path) override { + LOG(INFO) << "TestAshTraceDestinationIO::CreateDirectory(path=" + << path.value() << ")"; + AssertRegistry(); + status_->tracing_directory_created = path; + return true; + } + + std::tuple<base::File, bool> CreateTracingFile( + const base::FilePath& path) override { + LOG(INFO) << "TestAshTraceDestinationIO::CreateTracingFile(path=" + << path.value() << ")"; + AssertRegistry(); + status_->tracing_file_created = path; + return std::make_tuple(base::File(), true); + } + + std::tuple<base::PlatformFile, bool> CreateMemFD( + const char* name, + unsigned int flags) override { + LOG(INFO) << "TestAshTraceDestinationIO::CreateMemFD(name=" << name + << ", flags=" << flags << ")"; + AssertRegistry(); + status_->memfd_created = true; + return std::make_tuple(base::kInvalidPlatformFile, true); + } + + bool CanWriteFile(base::PlatformFile fd) override { + AssertRegistry(); + return status_->memfd_created || !status_->tracing_file_created.empty(); + } + + int fstat(base::PlatformFile fd, struct stat* statbuf) override { + LOG(INFO) << "TestAshTraceDestinationIO::fstat(): Called."; + AssertRegistry(); + memset(statbuf, 0, sizeof(struct stat)); + return CanWriteFile(fd) ? 0 : -1; + } + + ssize_t sendfile(base::PlatformFile out_fd, + base::PlatformFile in_fd, + off_t* offset, + size_t size) override { + LOG(INFO) << "TestAshTraceDestinationIO::sendfile(): Called."; + AssertRegistry(); + status_->sendfile_ok = CanWriteFile(out_fd); + // Should number of bytes written. fstat() from above reports 0 size. + return status_->sendfile_ok ? 0 : -1; + } + + const TestAshTraceDestinationIORegistry::IOStatus* status() const { + return status_; + } + + private: + void AssertRegistry() { + CHECK_EQ(test_ash_trace_destination_io_registry, registry_); + CHECK_EQ(test_ash_trace_destination_io_registry->id(), registry_id_); + } + + const TestAshTraceDestinationIORegistry* registry_; + const uint64_t registry_id_; + + TestAshTraceDestinationIORegistry::IOStatus* status_; +}; + +// Keeps track of all test TracingSession objects. +class TestTracingSessionRegistry { + public: + struct SessionStatus { + enum class Status { + kCreated, + kConfigured, + kStarted, + kStopped, + kDestroyed, + }; + Status status; + }; + + TestTracingSessionRegistry() : id_(base::RandUint64()) {} + + TestTracingSessionRegistry(const TestTracingSessionRegistry&) = delete; + TestTracingSessionRegistry& operator=(const TestTracingSessionRegistry&) = + delete; + + ~TestTracingSessionRegistry() = default; + + SessionStatus* NewSessionStatus() { + sessions_.push_back(std::make_unique<SessionStatus>()); + return sessions_.back().get(); + } + + // This is used for individual TracingSession object to check that registry + // was not replaced (when tests are run the ine same process). + uint64_t id() const { return id_; } + + const std::vector<std::unique_ptr<SessionStatus>>& sessions() const { + return sessions_; + } + + private: + const unsigned id_; + + std::vector<std::unique_ptr<SessionStatus>> sessions_; +}; + +// Fake perfetto::TracingSession. +class TestTracingSession : public perfetto::TracingSession { + public: + explicit TestTracingSession(TestTracingSessionRegistry* registry) + : registry_(registry), + registry_id_(registry->id()), + status_(registry->NewSessionStatus()) { + AssertRegistry(); + status_->status = + TestTracingSessionRegistry::SessionStatus::Status::kCreated; + } + + ~TestTracingSession() override { + AssertRegistry(); + CHECK_EQ(status_->status, + TestTracingSessionRegistry::SessionStatus::Status::kStopped); + status_->status = + TestTracingSessionRegistry::SessionStatus::Status::kDestroyed; + } + + void Setup(const perfetto::TraceConfig&, int fd = -1) override { + AssertRegistry(); + CHECK_EQ(status_->status, + TestTracingSessionRegistry::SessionStatus::Status::kCreated); + status_->status = + TestTracingSessionRegistry::SessionStatus::Status::kConfigured; + } + + void Start() override { + AssertRegistry(); + CHECK_EQ(status_->status, + TestTracingSessionRegistry::SessionStatus::Status::kConfigured); + status_->status = + TestTracingSessionRegistry::SessionStatus::Status::kStarted; + // perfetto::TracingSession runs callbacks from its own background thread. + base::ThreadPool::PostTask( + FROM_HERE, + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, + base::BindOnce( + [](std::function<void()> on_start_callback) { // nocheck + on_start_callback(); + }, + on_start_callback_)); + } + + void StartBlocking() override { NOTIMPLEMENTED(); } + + void SetOnStartCallback(std::function<void()> on_start) override { // nocheck + on_start_callback_ = on_start; + } + + void SetOnErrorCallback( + std::function<void(perfetto::TracingError)>) override { // nocheck + NOTIMPLEMENTED(); + } + + void Flush(std::function<void(bool)>, uint32_t timeout_ms = 0) // nocheck + override { + NOTIMPLEMENTED(); + } + + void Stop() override { + AssertRegistry(); + CHECK_EQ(status_->status, + TestTracingSessionRegistry::SessionStatus::Status::kStarted); + status_->status = + TestTracingSessionRegistry::SessionStatus::Status::kStopped; + // perfetto::TracingSession runs callbacks from its own background thread. + base::ThreadPool::PostTask( + FROM_HERE, + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, + base::BindOnce( + [](std::function<void()> on_stop_callback) { // nocheck + on_stop_callback(); + }, + on_stop_callback_)); + } + + void StopBlocking() override { NOTIMPLEMENTED(); } + + void SetOnStopCallback(std::function<void()> on_stop) override { // nocheck + on_stop_callback_ = on_stop; + } + + void ChangeTraceConfig(const perfetto::TraceConfig&) override { + NOTIMPLEMENTED(); + } + void ReadTrace(ReadTraceCallback) override { NOTIMPLEMENTED(); } + void GetTraceStats(GetTraceStatsCallback) override { NOTIMPLEMENTED(); } + void QueryServiceState(QueryServiceStateCallback) override { + NOTIMPLEMENTED(); + } + + private: + void AssertRegistry() { + CHECK_EQ(test_tracing_session_registry, registry_); + CHECK_EQ(test_tracing_session_registry->id(), registry_id_); + } + + const TestTracingSessionRegistry* registry_; + const uint64_t registry_id_; + + std::function<void()> on_start_callback_; // nocheck + std::function<void()> on_stop_callback_; // nocheck + + TestTracingSessionRegistry::SessionStatus* status_; +}; + +// Generates TraceDestination on the ThreadPool (IO-enabled sequence runner) +// and waits for the result. +class TraceDestinationWaiter { + public: + TraceDestinationWaiter() = default; + + ash::hud_display::AshTracingRequest::AshTraceDestinationUniquePtr Wait( + base::Time timestamp) { + run_loop_ = std::make_unique<base::RunLoop>(); + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, + ash::hud_display::AshTracingRequest:: + CreateGenerateTraceDestinationTaskForTesting( + CreateTestAshTraceDestinationIO(), base::Time::Now()), + base::BindOnce(&TraceDestinationWaiter::OnGenerated, + weak_factory_.GetWeakPtr())); + run_loop_->Run(); + return std::move(destination_); + } + + void OnGenerated( + ash::hud_display::AshTracingRequest::AshTraceDestinationUniquePtr + destination) { + destination_ = std::move(destination); + run_loop_->Quit(); + } + + private: + std::unique_ptr<base::RunLoop> run_loop_; + ash::hud_display::AshTracingRequest::AshTraceDestinationUniquePtr + destination_; + + base::WeakPtrFactory<TraceDestinationWaiter> weak_factory_{this}; +}; + +// Waits for ash::hud_display::TracingManager to receive a known status. +class TestAshTracingManagerObserver + : public ash::hud_display::AshTracingManager::Observer { + public: + using Condition = + base::RepeatingCallback<bool(ash::hud_display::AshTracingManager&)>; + + explicit TestAshTracingManagerObserver( + ash::hud_display::AshTracingManager& manager) + : manager_(manager) {} + + void Wait(Condition condition) { + if (condition.Run(manager_)) + return; + + condition_ = condition; + manager_.AddObserver(this); + run_loop_ = std::make_unique<base::RunLoop>(); + run_loop_->Run(); + manager_.RemoveObserver(this); + } + + void OnTracingStatusChange() override { + if (condition_.Run(manager_)) + run_loop_->Quit(); + } + + private: + ash::hud_display::AshTracingManager& manager_; + Condition condition_; + + std::unique_ptr<base::RunLoop> run_loop_; +}; + +// Waits for the last tracing request to get expected status. +void WaiFortLastTracingRequestStatus( + ash::hud_display::AshTracingRequest::Status expected_status) { + LOG(INFO) << "Wait for the last tracing request status = '" + << AshTracingRequestStatus2String(expected_status) << "'"; + TestAshTracingManagerObserver(ash::hud_display::AshTracingManager::Get()) + .Wait(base::BindRepeating( + [](ash::hud_display::AshTracingRequest::Status expected_status, + ash::hud_display::AshTracingManager& manager) { + if (manager.GetTracingRequestsForTesting().size() == 0) + return false; + + const ash::hud_display::AshTracingRequest::Status status = + manager.GetTracingRequestsForTesting().back()->status(); + + LOG(INFO) << "Last tracing request status = '" + << AshTracingRequestStatus2String(status) << "'"; + + return status == expected_status; + }, + expected_status)); +} + +// Waits for all except the last one tracing requests to complete. +void WaitForAllButLastTracingRequestsToComplete() { + LOG(INFO) << "WaitForAllButLastTracingRequestsToComplete(): Waiting."; + TestAshTracingManagerObserver(ash::hud_display::AshTracingManager::Get()) + .Wait( + base::BindRepeating([](ash::hud_display::AshTracingManager& manager) { + if (manager.GetTracingRequestsForTesting().size() < 2) + return false; + + LOG(INFO) + << "WaitForAllButLastTracingRequestsToComplete(): There are " + << manager.GetTracingRequestsForTesting().size() + << " tracing requests."; + bool success = true; + for (size_t i = 0; + i < manager.GetTracingRequestsForTesting().size() - 1; ++i) { + const ash::hud_display::AshTracingRequest::Status status = + manager.GetTracingRequestsForTesting()[i]->status(); + + LOG(INFO) << "request[" << i + 1 << "/" + << manager.GetTracingRequestsForTesting().size() + << "] status = '" + << AshTracingRequestStatus2String(status) << "'"; + + if (status != + ash::hud_display::AshTracingRequest::Status::kCompleted) + success = false; + } + return success; + })); +} + +// This is used in +// ash::hud_display::AshTracingHandler:: +// SetPerfettoTracingSessionCreatorForTesting(). +std::unique_ptr<perfetto::TracingSession> CreateTestPerfettoSession() { + return std::make_unique<TestTracingSession>(test_tracing_session_registry); +} + +// This is used in +// ash::hud_display::AshTracingRequest:: +// SetAshTraceDestinationIOCreatorForTesting(). +std::unique_ptr<ash::hud_display::AshTraceDestinationIO> +CreateTestAshTraceDestinationIO() { + return std::make_unique<TestAshTraceDestinationIO>( + test_ash_trace_destination_io_registry); +} + +bool GetAshHUDSettingsViewVisible() { + return ash::hud_display::HUDDisplayView::GetForTesting() + ->GetSettingsViewForTesting() + ->GetVisible(); +} + +void ToggleAshHUDSettingsView() { + ash::hud_display::HUDDisplayView::GetForTesting()->ToggleSettingsForTesting(); +} + +void ToggleAshHUDTracing() { + ash::hud_display::HUDDisplayView::GetForTesting() + ->GetSettingsViewForTesting() + ->ToggleTracingForTesting(); +} + +} // anonymous namespace + +class AshHUDLoginTest + : public LoginManagerTest, + public ::testing::WithParamInterface<std::tuple<bool, bool>> { + protected: + AshHUDLoginTest() : LoginManagerTest() { + LOG(INFO) << "AshHUDLoginTest: starting test with IsAshDebugFlagSet()=" + << IsAshDebugFlagSet() << ", IsDisableLoggingRedirectFlagSet()=" + << IsDisableLoggingRedirectFlagSet(); + login_manager_mixin_.AppendRegularUsers(1); + } + + AshHUDLoginTest(const AshHUDLoginTest&) = delete; + ~AshHUDLoginTest() override = default; + + AshHUDLoginTest& operator=(const AshHUDLoginTest&) = delete; + + bool IsAshDebugFlagSet() const { return std::get<0>(GetParam()); } + + bool IsDisableLoggingRedirectFlagSet() const { + return std::get<1>(GetParam()); + } + + void SetUpInProcessBrowserTestFixture() override { + ASSERT_FALSE(test_tracing_session_registry); + test_tracing_session_registry = new TestTracingSessionRegistry; + + ASSERT_FALSE(test_ash_trace_destination_io_registry); + test_ash_trace_destination_io_registry = + new TestAshTraceDestinationIORegistry; + + if (IsAshDebugFlagSet()) { + base::CommandLine::ForCurrentProcess()->AppendSwitch( + ash::switches::kAshDebugShortcuts); + } + ChromeShellDelegate::SetDisableLoggingRedirectForTesting( + IsDisableLoggingRedirectFlagSet()); + + ash::hud_display::AshTracingHandler:: + SetPerfettoTracingSessionCreatorForTesting(CreateTestPerfettoSession); + + ash::hud_display::AshTracingRequest:: + SetAshTraceDestinationIOCreatorForTesting( + &CreateTestAshTraceDestinationIO); + + LoginManagerTest::SetUpInProcessBrowserTestFixture(); + } + + void TearDownInProcessBrowserTestFixture() override { + LoginManagerTest::TearDownInProcessBrowserTestFixture(); + + ash::hud_display::AshTracingRequest:: + ResetAshTraceDestinationIOCreatorForTesting(); + + ash::hud_display::AshTracingHandler:: + ResetPerfettoTracingSessionCreatorForTesting(); + + ChromeShellDelegate::ResetDisableLoggingRedirectForTesting(); + + if (IsAshDebugFlagSet()) { + base::CommandLine::ForCurrentProcess()->RemoveSwitch( + ash::switches::kAshDebugShortcuts); + } + + delete test_tracing_session_registry; + test_tracing_session_registry = nullptr; + + delete test_ash_trace_destination_io_registry; + test_ash_trace_destination_io_registry = nullptr; + } + + void Login() { + chromeos::WizardController::SkipPostLoginScreensForTesting(); + + auto context = LoginManagerMixin::CreateDefaultUserContext( + login_manager_mixin_.users()[0]); + login_manager_mixin_.LoginAndWaitForActiveSession(context); + } + + // This call verifies given ash::hud_display::AshTraceDestination status + // (via TestAshTraceDestinationIO that keeps track of status in global + // registry TestAshTraceDestinationIORegistry). Current value of + // --disable-logging-redirect flag is used from the test parameter, but + // user login status is given explicitly, because we need to verify + // "pre-login" status even after login. + void VerifyTraceDestination( + const TestAshTraceDestinationIORegistry::IOStatus* destination_status, + bool user_logged_in) { + if (IsDisableLoggingRedirectFlagSet()) { + // Trace file should exist and be a real file in '/run/chrome/tracing/' + EXPECT_EQ(destination_status->tracing_directory_created.value(), + "/run/chrome/tracing"); + EXPECT_EQ(destination_status->tracing_file_created.DirName().value(), + "/run/chrome/tracing"); + EXPECT_FALSE(destination_status->memfd_created); + return; + } + // If DisableLoggingRedirectFlag is not set, destination depends on whether + // user has logged in. + if (user_logged_in) { + // Trace file should exist and be real file in user downloads. + const base::FilePath folder = ash::Shell::Get() + ->shell_delegate() + ->GetPrimaryUserDownloadsFolder() + .AppendASCII("tracing"); + EXPECT_EQ(destination_status->tracing_directory_created, folder); + EXPECT_EQ(destination_status->tracing_file_created.DirName(), folder); + EXPECT_FALSE(destination_status->memfd_created); + return; + } + // DisableLoggingRedirectFlag is not set and user has not logged in. + // Destination must be memfd. + EXPECT_TRUE(destination_status->tracing_directory_created.empty()); + EXPECT_TRUE(destination_status->tracing_file_created.empty()); + EXPECT_TRUE(destination_status->memfd_created); + return; + } + + protected: + LoginManagerMixin login_manager_mixin_{&mixin_host_}; +}; + +// See "Testing" section in https://goto.google.com/ash-tracing for details. +IN_PROC_BROWSER_TEST_P(AshHUDLoginTest, AshHUDVerifyTracing) { + const ui::Accelerator hud_accelerator = + ui::Accelerator(ui::VKEY_G, ash::kDebugModifier); + auto trigger_hud = [&]() { + return ash::ShellTestApi().IsActionForAcceleratorEnabled(hud_accelerator) && + ash::ShellTestApi().PressAccelerator(hud_accelerator); + }; + + // Depending on the test parameters, registry grows to different values. + unsigned expected_io_registry_size = 0; + + // Check that the login screen is shown, but HUD is not. + EXPECT_FALSE(ash::LoginScreenTestApi::IsOobeDialogVisible()); + EXPECT_FALSE(ash::ShellTestApi().IsHUDShown()); + + // Make sure that Ash HUD can be triggered if and only if + // --ash-debug-shortcuts flag is set. + EXPECT_EQ(IsAshDebugFlagSet(), trigger_hud()); + EXPECT_EQ(IsAshDebugFlagSet(), ash::ShellTestApi().IsHUDShown()); + + { + LOG(INFO) + << "########### Verifying AshTraceDestination generation before login."; + // Calculate trace destination and verify it. + // + // Trace destination should be correct even if HUD UI is not enabled, so + // we verify it separately. + auto destination = TraceDestinationWaiter().Wait(base::Time::Now()); + VerifyTraceDestination( + static_cast<TestAshTraceDestinationIO*>(destination->io())->status(), + /*user_logged_in=*/false); + ++expected_io_registry_size; + } + if (IsAshDebugFlagSet()) { + // HUD is visible now. + // Switch HUD to settings view. + EXPECT_FALSE(GetAshHUDSettingsViewVisible()); + ToggleAshHUDSettingsView(); + EXPECT_TRUE(GetAshHUDSettingsViewVisible()); + + // Start tracing. + ToggleAshHUDTracing(); + ++expected_io_registry_size; + + // Wait for tracing to start. + WaiFortLastTracingRequestStatus( + ash::hud_display::AshTracingRequest::Status::kStarted); + + // Stop tracing. + ToggleAshHUDTracing(); + + // Wait for tracing to stop. Depending on --disable-logging-redirect flag + // trace may end up Completed or kPendingMount. + WaiFortLastTracingRequestStatus( + IsDisableLoggingRedirectFlagSet() + ? ash::hud_display::AshTracingRequest::Status::kCompleted + : ash::hud_display::AshTracingRequest::Status::kPendingMount); + + // Start another trace and continue into user session. + ToggleAshHUDTracing(); + ++expected_io_registry_size; + + // Wait for tracing to start. + WaiFortLastTracingRequestStatus( + ash::hud_display::AshTracingRequest::Status::kStarted); + + // Check that trace was started using correct destination. + EXPECT_EQ(test_tracing_session_registry->sessions().size(), 2u); + EXPECT_EQ(test_ash_trace_destination_io_registry->sessions().size(), + expected_io_registry_size); + LOG(INFO) << "########### Verifying AshTraceDestination for the trace " + "started before login."; + VerifyTraceDestination( + test_ash_trace_destination_io_registry->sessions().back().get(), + /*user_logged_in=*/false); + } + + // Turn HUD off. + EXPECT_EQ(IsAshDebugFlagSet(), trigger_hud()); + EXPECT_FALSE(ash::ShellTestApi().IsHUDShown()); + + EXPECT_FALSE(user_manager::UserManager::Get()->IsUserLoggedIn()); + Login(); + ASSERT_TRUE(user_manager::UserManager::Get()->IsUserLoggedIn()); + LOG(INFO) << "########### User logged in."; + + EXPECT_FALSE(ash::ShellTestApi().IsHUDShown()); + + // Make sure that Ash HUD can be triggered if and only if + // --ash-debug-shortcuts flag is set. + EXPECT_EQ(IsAshDebugFlagSet(), trigger_hud()); + EXPECT_EQ(IsAshDebugFlagSet(), ash::ShellTestApi().IsHUDShown()); + + { + LOG(INFO) + << "########### Verifying AshTraceDestination generation after login."; + + // Calculate trace destination and verify it. + // Trace destination should be correct even if HUD UI is not enabled, so + // we verify it separately. + auto destination = TraceDestinationWaiter().Wait(base::Time::Now()); + VerifyTraceDestination( + static_cast<TestAshTraceDestinationIO*>(destination->io())->status(), + /*user_logged_in=*/true); + ++expected_io_registry_size; + } + + if (IsAshDebugFlagSet()) { + // HUD is visible now. + // Switch HUD to settings view. + ASSERT_FALSE(GetAshHUDSettingsViewVisible()); + ToggleAshHUDSettingsView(); + ASSERT_TRUE(GetAshHUDSettingsViewVisible()); + + // Make sure saved trace is here and another tracing still continues. + EXPECT_EQ(test_tracing_session_registry->sessions().size(), 2u); + EXPECT_EQ(ash::hud_display::AshTracingManager::Get() + .GetTracingRequestsForTesting() + .size(), + 2u); + + if (!IsDisableLoggingRedirectFlagSet()) { + // We have a pending trace from before the user login. It needs to create + // another AshTraceDestination to store data to user Downloads directory. + // Wait for pending trace to finish data copy. + // + // Another trace is running, so we wait for all but last tracing sessions + // to get to kCompleted state. + WaitForAllButLastTracingRequestsToComplete(); + // Add AshTraceDestination that was created by pending trace. + ++expected_io_registry_size; + } + EXPECT_EQ(test_ash_trace_destination_io_registry->sessions().size(), + expected_io_registry_size); + + // Make sure tracing continues to the old destination (i.e. when + // user_logged_in=false). + LOG(INFO) << "########### Verifying AshTraceDestination for trace started " + "before login and still running into user session."; + VerifyTraceDestination(static_cast<TestAshTraceDestinationIO*>( + ash::hud_display::AshTracingManager::Get() + .GetTracingRequestsForTesting() + .back() + ->GetTraceDestinationForTesting() + ->io()) + ->status(), + /*user_logged_in=*/false); + + // Stop tracing. + ToggleAshHUDTracing(); + + // Wait for tracing to finish. + WaiFortLastTracingRequestStatus( + ash::hud_display::AshTracingRequest::Status::kCompleted); + + // We still have two records of ash traces. + EXPECT_EQ(test_tracing_session_registry->sessions().size(), 2u); + + // Tracing session is completely stopped. + EXPECT_EQ(test_tracing_session_registry->sessions().back()->status, + TestTracingSessionRegistry::SessionStatus::Status::kDestroyed); + + // - If logging redirect was disabled, trace destination should always be + // real file, so the original destination should be final. + // - If it was enabled, after log in, destination should change (new + // destination should be created) after trace was stopped, and trace should + // be copied to the user Downloads folder. + const unsigned expected_destinations_number = + IsDisableLoggingRedirectFlagSet() ? expected_io_registry_size + : expected_io_registry_size + 1; + EXPECT_EQ(test_ash_trace_destination_io_registry->sessions().size(), + expected_destinations_number); + + LOG(INFO) << "########### Verifying AshTraceDestination for the trace " + "started before login and finished in user session."; + // Make sure final trace destination is correct. + VerifyTraceDestination(static_cast<TestAshTraceDestinationIO*>( + ash::hud_display::AshTracingManager::Get() + .GetTracingRequestsForTesting() + .back() + ->GetTraceDestinationForTesting() + ->io()) + ->status(), + /*user_logged_in=*/true); + } + + // Turn HUD off. + EXPECT_EQ(IsAshDebugFlagSet(), trigger_hud()); + EXPECT_FALSE(ash::ShellTestApi().IsHUDShown()); +} + +INSTANTIATE_TEST_SUITE_P(All, + AshHUDLoginTest, + testing::Combine(testing::Bool(), testing::Bool())); + +} // namespace chromeos
diff --git a/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.cc b/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.cc index f569710e..dcba36c 100644 --- a/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.cc +++ b/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.cc
@@ -13,9 +13,9 @@ #include "components/ownership/owner_key_util.h" #include "content/public/browser/browser_thread.h" -using content::BrowserThread; +namespace ash { -namespace chromeos { +using ::content::BrowserThread; ChromeCryptohomeAuthenticator::ChromeCryptohomeAuthenticator( AuthStatusConsumer* consumer) @@ -25,4 +25,4 @@ ChromeCryptohomeAuthenticator::~ChromeCryptohomeAuthenticator() {} -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.h b/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.h index 4c0b7c6..901b671 100644 --- a/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.h +++ b/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.h
@@ -8,7 +8,7 @@ #include "base/macros.h" #include "chromeos/login/auth/cryptohome_authenticator.h" -namespace chromeos { +namespace ash { class ChromeCryptohomeAuthenticator : public CryptohomeAuthenticator { public: @@ -20,11 +20,12 @@ DISALLOW_COPY_AND_ASSIGN(ChromeCryptohomeAuthenticator); }; -} // namespace chromeos +} // namespace ash -// TODO(https://crbug.com/1164001): remove when moved to ash. -namespace ash { -using ::chromeos::ChromeCryptohomeAuthenticator; +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source migration is finished. +namespace chromeos { +using ::ash::ChromeCryptohomeAuthenticator; } #endif // CHROME_BROWSER_ASH_LOGIN_AUTH_CHROME_CRYPTOHOME_AUTHENTICATOR_H_
diff --git a/chrome/browser/ash/login/auth/chrome_login_performer.cc b/chrome/browser/ash/login/auth/chrome_login_performer.cc index 198a1a0..ff40090e 100644 --- a/chrome/browser/ash/login/auth/chrome_login_performer.cc +++ b/chrome/browser/ash/login/auth/chrome_login_performer.cc
@@ -21,7 +21,7 @@ #include "components/account_id/account_id.h" #include "services/network/public/cpp/shared_url_loader_factory.h" -namespace chromeos { +namespace ash { ChromeLoginPerformer::ChromeLoginPerformer(Delegate* delegate) : LoginPerformer(base::ThreadTaskRunnerHandle::Get(), delegate) {} @@ -156,4 +156,4 @@ } } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/login/auth/chrome_login_performer.h b/chrome/browser/ash/login/auth/chrome_login_performer.h index 529e62c..70d7b7a 100644 --- a/chrome/browser/ash/login/auth/chrome_login_performer.h +++ b/chrome/browser/ash/login/auth/chrome_login_performer.h
@@ -28,7 +28,7 @@ class WildcardLoginChecker; } -namespace chromeos { +namespace ash { // This class implements chrome-specific elements of Login Performer. @@ -76,11 +76,12 @@ DISALLOW_COPY_AND_ASSIGN(ChromeLoginPerformer); }; -} // namespace chromeos +} // namespace ash -// TODO(https://crbug.com/1164001): remove when moved to chrome/browser/ash/. -namespace ash { -using ::chromeos::ChromeLoginPerformer; +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source migration is finished. +namespace chromeos { +using ::ash::ChromeLoginPerformer; } #endif // CHROME_BROWSER_ASH_LOGIN_AUTH_CHROME_LOGIN_PERFORMER_H_
diff --git a/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.cc b/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.cc index 518c2245..73eacb9 100644 --- a/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.cc +++ b/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.cc
@@ -10,7 +10,7 @@ #include "chromeos/login/auth/user_context.h" #include "chromeos/login/login_state/login_state.h" -namespace chromeos { +namespace ash { bool ChromeSafeModeDelegate::IsSafeMode() { bool is_safe_mode = false; @@ -33,4 +33,4 @@ std::move(callback)); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.h b/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.h index 36153a1..c6be1bc 100644 --- a/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.h +++ b/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.h
@@ -6,10 +6,10 @@ #define CHROME_BROWSER_ASH_LOGIN_AUTH_CHROME_SAFE_MODE_DELEGATE_H_ #include "chromeos/login/auth/safe_mode_delegate.h" +// TODO(https://crbug.com/1164001): move to forward declaration +#include "chromeos/login/auth/user_context.h" -namespace chromeos { - -class UserContext; +namespace ash { class ChromeSafeModeDelegate : public SafeModeDelegate { public: @@ -25,6 +25,6 @@ IsOwnerCallback callback) override; }; -} // namespace chromeos +} // namespace ash #endif // CHROME_BROWSER_ASH_LOGIN_AUTH_CHROME_SAFE_MODE_DELEGATE_H_
diff --git a/chrome/browser/ash/login/auth/cryptohome_authenticator_unittest.cc b/chrome/browser/ash/login/auth/cryptohome_authenticator_unittest.cc index bf9a265..76e1529 100644 --- a/chrome/browser/ash/login/auth/cryptohome_authenticator_unittest.cc +++ b/chrome/browser/ash/login/auth/cryptohome_authenticator_unittest.cc
@@ -55,15 +55,14 @@ #include "third_party/cros_system_api/dbus/service_constants.h" #include "url/gurl.h" +namespace ash { +namespace { + using ::testing::Invoke; using ::testing::Return; using ::testing::WithArg; using ::testing::_; -namespace chromeos { - -namespace { - // A fake sanitized username used for testing. constexpr char kFakeSanitizedUsername[] = "01234567890ABC"; @@ -868,4 +867,4 @@ run_loop_.Run(); } -} // namespace chromeos +} // namespace ash
diff --git a/chrome/browser/ash/login/demo_mode/demo_session.cc b/chrome/browser/ash/login/demo_mode/demo_session.cc index f75976b4..245ba797 100644 --- a/chrome/browser/ash/login/demo_mode/demo_session.cc +++ b/chrome/browser/ash/login/demo_mode/demo_session.cc
@@ -37,7 +37,7 @@ #include "chrome/browser/chromeos/file_manager/path_util.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/ash/wallpaper_controller_client_impl.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/pref_names.h" @@ -521,13 +521,13 @@ if (ShouldRemoveSplashScreen()) RemoveSplashScreen(); - // SystemTrayClient may not exist in unit tests. - if (SystemTrayClient::Get()) { + // SystemTrayClientImpl may not exist in unit tests. + if (SystemTrayClientImpl::Get()) { const std::string current_locale_iso_code = ProfileManager::GetActiveUserProfile()->GetPrefs()->GetString( language::prefs::kApplicationLocale); - SystemTrayClient::Get()->SetLocaleList(GetSupportedLocales(), - current_locale_iso_code); + SystemTrayClientImpl::Get()->SetLocaleList(GetSupportedLocales(), + current_locale_iso_code); } RestoreDefaultLocaleForNextSession();
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_user_login_flow.h b/chrome/browser/ash/login/easy_unlock/easy_unlock_user_login_flow.h index da064cf6..264a1a4 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_user_login_flow.h +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_user_login_flow.h
@@ -30,4 +30,10 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove when the //chrome/browser/chromeos +// source code migration is finished. +namespace ash { +using ::chromeos::EasyUnlockUserLoginFlow; +} + #endif // CHROME_BROWSER_ASH_LOGIN_EASY_UNLOCK_EASY_UNLOCK_USER_LOGIN_FLOW_H_
diff --git a/chrome/browser/ash/login/existing_user_controller.cc b/chrome/browser/ash/login/existing_user_controller.cc index b143591..7e3df0a 100644 --- a/chrome/browser/ash/login/existing_user_controller.cc +++ b/chrome/browser/ash/login/existing_user_controller.cc
@@ -71,7 +71,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/signin/chrome_device_id_helper.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" #include "chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/kiosk_autolaunch_screen_handler.h" @@ -1044,7 +1044,7 @@ base::MakeRefCounted<message_center::HandleNotificationClickDelegate>( base::BindRepeating([](base::Optional<int> button_index) { DCHECK(button_index); - SystemTrayClient::Get()->ShowEnterpriseInfo(); + SystemTrayClientImpl::Get()->ShowEnterpriseInfo(); })); std::unique_ptr<message_center::Notification> notification = ash::CreateSystemNotification(
diff --git a/chrome/browser/ash/login/oobe_browsertest.cc b/chrome/browser/ash/login/oobe_browsertest.cc index 1ba2a32e..decb4e2 100644 --- a/chrome/browser/ash/login/oobe_browsertest.cc +++ b/chrome/browser/ash/login/oobe_browsertest.cc
@@ -3,6 +3,9 @@ // found in the LICENSE file. #include "ash/constants/ash_switches.h" +#include "ash/display/window_tree_host_manager.h" +#include "ash/public/cpp/test/shell_test_api.h" +#include "ash/shell.h" #include "base/bind.h" #include "base/command_line.h" #include "base/location.h" @@ -18,6 +21,7 @@ #include "chrome/browser/ash/login/ui/login_display_host_webui.h" #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/chromeos/policy/enrollment_requisition_manager.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" @@ -41,6 +45,9 @@ #include "net/test/embedded_test_server/http_response.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/test/ui_controls.h" +#include "ui/display/manager/display_manager.h" +#include "ui/display/screen.h" +#include "ui/display/test/display_manager_test_api.h" #include "ui/views/widget/widget.h" namespace chromeos { @@ -177,4 +184,60 @@ OobeScreenWaiter(WelcomeView::kScreenId).Wait(); } +class DisplayOobeTest : public OobeBaseTest { + public: + DisplayOobeTest() = default; + ~DisplayOobeTest() override = default; + + // InProcessBrowserTest: + void SetUpCommandLine(base::CommandLine* command_line) override { + command_line->AppendSwitch(switches::kOobeLargeScreenSpecialScaling); + OobeBaseTest::SetUpCommandLine(command_line); + } +}; + +IN_PROC_BROWSER_TEST_F(DisplayOobeTest, OobeMeets4kDisplay) { + policy::EnrollmentRequisitionManager::SetDeviceRequisition( + policy::EnrollmentRequisitionManager::kRemoraRequisition); + + std::string display_spec("0+0-3840x2160"); + ash::ShellTestApi shell_test_api; + display::test::DisplayManagerTestApi(shell_test_api.display_manager()) + .UpdateDisplay(display_spec); + + display::Screen* screen = display::Screen::GetScreen(); + gfx::Size display = screen->GetPrimaryDisplay().size(); + EXPECT_EQ(display.width(), 2560); + EXPECT_EQ(display.height(), 1440); + + display::DisplayManager* display_manager = + ash::Shell::Get()->display_manager(); + display_manager->ResetDisplayZoom(screen->GetPrimaryDisplay().id()); + display = screen->GetPrimaryDisplay().size(); + EXPECT_EQ(display.width(), 3840); + EXPECT_EQ(display.height(), 2160); +} + +IN_PROC_BROWSER_TEST_F(DisplayOobeTest, OobeMeets2kDisplay) { + policy::EnrollmentRequisitionManager::SetDeviceRequisition( + policy::EnrollmentRequisitionManager::kRemoraRequisition); + + std::string display_spec("0+0-2560x1440"); + ash::ShellTestApi shell_test_api; + display::test::DisplayManagerTestApi(shell_test_api.display_manager()) + .UpdateDisplay(display_spec); + + display::Screen* screen = display::Screen::GetScreen(); + gfx::Size display = screen->GetPrimaryDisplay().size(); + EXPECT_EQ(display.width(), 1920); + EXPECT_EQ(display.height(), 1080); + + display::DisplayManager* display_manager = + ash::Shell::Get()->display_manager(); + display_manager->ResetDisplayZoom(screen->GetPrimaryDisplay().id()); + display = screen->GetPrimaryDisplay().size(); + EXPECT_EQ(display.width(), 2560); + EXPECT_EQ(display.height(), 1440); +} + } // namespace chromeos
diff --git a/chrome/browser/ash/login/screens/update_required_screen_unittest.cc b/chrome/browser/ash/login/screens/update_required_screen_unittest.cc index 8de1994a..bcba587 100644 --- a/chrome/browser/ash/login/screens/update_required_screen_unittest.cc +++ b/chrome/browser/ash/login/screens/update_required_screen_unittest.cc
@@ -23,8 +23,7 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_update_engine_client.h" #include "chromeos/dbus/update_engine_client.h" -#include "chromeos/network/network_handler.h" -#include "chromeos/network/network_state_test_helper.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/portal_detector/mock_network_portal_detector.h" #include "chromeos/network/portal_detector/network_portal_detector.h" #include "chromeos/tpm/stub_install_attributes.h" @@ -61,7 +60,10 @@ DBusThreadManager::GetSetterForTesting()->SetUpdateEngineClient( std::unique_ptr<UpdateEngineClient>(fake_update_engine_client_)); - NetworkHandler::Initialize(); + network_handler_test_helper_ = + std::make_unique<chromeos::NetworkHandlerTestHelper>(); + network_handler_test_helper_->AddDefaultProfiles(); + mock_network_portal_detector_ = new MockNetworkPortalDetector(); network_portal_detector::SetNetworkPortalDetector( mock_network_portal_detector_); @@ -78,10 +80,6 @@ update_required_screen_->GetVersionUpdaterForTesting() ->set_wait_for_reboot_time_for_testing(base::TimeDelta::FromSeconds(0)); - - network_state_test_helper_ = - std::make_unique<chromeos::NetworkStateTestHelper>( - true /*use_default_devices_and_services*/); } void TearDown() override { @@ -91,10 +89,9 @@ update_required_screen_.reset(); mock_error_view_.reset(); mock_error_screen_.reset(); - network_state_test_helper_.reset(); network_portal_detector::Shutdown(); - NetworkHandler::Shutdown(); + network_handler_test_helper_.reset(); DBusThreadManager::Shutdown(); } @@ -112,8 +109,9 @@ MockNetworkPortalDetector* mock_network_portal_detector_; // Will be deleted in `DBusThreadManager::Shutdown()`. FakeUpdateEngineClient* fake_update_engine_client_; - // Initializes NetworkStateHandler - std::unique_ptr<chromeos::NetworkStateTestHelper> network_state_test_helper_; + // Initializes NetworkHandler and required DBus clients. + std::unique_ptr<chromeos::NetworkHandlerTestHelper> + network_handler_test_helper_; private: // Test versions of core browser infrastructure.
diff --git a/chrome/browser/ash/login/screens/update_screen_unittest.cc b/chrome/browser/ash/login/screens/update_screen_unittest.cc index 71c7898a..aac6ede 100644 --- a/chrome/browser/ash/login/screens/update_screen_unittest.cc +++ b/chrome/browser/ash/login/screens/update_screen_unittest.cc
@@ -20,7 +20,7 @@ #include "chromeos/dbus/fake_update_engine_client.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/update_engine_client.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/portal_detector/mock_network_portal_detector.h" #include "chromeos/network/portal_detector/network_portal_detector.h" #include "content/public/test/browser_task_environment.h" @@ -76,7 +76,7 @@ fake_update_engine_client_ = new FakeUpdateEngineClient(); DBusThreadManager::GetSetterForTesting()->SetUpdateEngineClient( std::unique_ptr<UpdateEngineClient>(fake_update_engine_client_)); - NetworkHandler::Initialize(); + network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>(); mock_network_portal_detector_ = new MockNetworkPortalDetector(); network_portal_detector::SetNetworkPortalDetector( mock_network_portal_detector_); @@ -98,7 +98,7 @@ update_screen_.reset(); mock_error_screen_.reset(); network_portal_detector::Shutdown(); - NetworkHandler::Shutdown(); + network_handler_test_helper_.reset(); PowerManagerClient::Shutdown(); DBusThreadManager::Shutdown(); } @@ -126,6 +126,7 @@ // Test versions of core browser infrastructure. content::BrowserTaskEnvironment task_environment_; ScopedTestingLocalState local_state_; + std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_; DISALLOW_COPY_AND_ASSIGN(UpdateScreenUnitTest); };
diff --git a/chrome/browser/ash/login/ui/login_display_host_mojo.cc b/chrome/browser/ash/login/ui/login_display_host_mojo.cc index c18e459f..7809950 100644 --- a/chrome/browser/ash/login/ui/login_display_host_mojo.cc +++ b/chrome/browser/ash/login/ui/login_display_host_mojo.cc
@@ -32,7 +32,7 @@ #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/ash/login_screen_client_impl.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/ash/wallpaper_controller_client_impl.h" #include "chrome/browser/ui/webui/chromeos/login/gaia_password_changed_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" @@ -194,7 +194,7 @@ } void LoginDisplayHostMojo::SetStatusAreaVisible(bool visible) { - SystemTrayClient::Get()->SetPrimaryTrayVisible(visible); + SystemTrayClientImpl::Get()->SetPrimaryTrayVisible(visible); } void LoginDisplayHostMojo::StartWizard(OobeScreenId first_screen) {
diff --git a/chrome/browser/ash/login/ui/login_display_host_webui.cc b/chrome/browser/ash/login/ui/login_display_host_webui.cc index 9241c4c..c9c5c07 100644 --- a/chrome/browser/ash/login/ui/login_display_host_webui.cc +++ b/chrome/browser/ash/login/ui/login_display_host_webui.cc
@@ -61,11 +61,12 @@ #include "chrome/browser/chromeos/net/delay_network_call.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/policy/enrollment_config.h" +#include "chrome/browser/chromeos/policy/enrollment_requisition_manager.h" #include "chrome/browser/lifetime/browser_shutdown.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/ash/ash_util.h" #include "chrome/browser/ui/ash/keyboard/chrome_keyboard_controller_client.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/ash/wallpaper_controller_client_impl.h" #include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h" @@ -106,6 +107,7 @@ #include "ui/compositor/layer_animation_observer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/display/display.h" +#include "ui/display/manager/display_manager.h" #include "ui/display/screen.h" #include "ui/events/devices/device_data_manager.h" #include "ui/events/event_handler.h" @@ -144,6 +146,14 @@ // The default fade out animation time in ms. const int kDefaultFadeTimeMs = 200; +struct DisplayScaleFactor { + int longest_side; + float scale_factor; +}; + +const DisplayScaleFactor k4KDisplay = {3840, 1.5f}, + kMediumDisplay = {1440, 4.f / 3}; + // A class to observe an implicit animation and invokes the callback after the // animation is completed. class AnimationObserver : public ui::ImplicitAnimationObserver { @@ -424,7 +434,7 @@ // ui::EventHandler void OnKeyEvent(ui::KeyEvent* event) override { if (event->key_code() == ui::VKEY_F6) { - SystemTrayClient::Get()->SetPrimaryTrayVisible(false); + SystemTrayClientImpl::Get()->SetPrimaryTrayVisible(false); event->StopPropagation(); } } @@ -755,6 +765,11 @@ return; } + if (switches::ShouldScaleOobe() && + policy::EnrollmentRequisitionManager::IsRemoraRequisition()) { + UpScaleOobe(); + } + if (GetOobeUI()) { GetOobeUI()->GetCoreOobeView()->UpdateClientAreaSize( primary_display.size()); @@ -763,6 +778,25 @@ } } +void LoginDisplayHostWebUI::UpScaleOobe() { + const int64_t display_id = + display::Screen::GetScreen()->GetPrimaryDisplay().id(); + if (primary_display_id_ == display_id) { + return; + } + primary_display_id_ = display_id; + display::DisplayManager* display_manager = + ash::Shell::Get()->display_manager(); + const gfx::Size size = + display::Screen::GetScreen()->GetPrimaryDisplay().work_area_size(); + const int longest_side = std::max(size.width(), size.height()); + if (longest_side >= k4KDisplay.longest_side) { + display_manager->UpdateZoomFactor(display_id, k4KDisplay.scale_factor); + } else if (longest_side >= kMediumDisplay.longest_side) { + display_manager->UpdateZoomFactor(display_id, kMediumDisplay.scale_factor); + } +} + //////////////////////////////////////////////////////////////////////////////// // LoginDisplayHostWebUI, ui::InputDeviceEventObserver void LoginDisplayHostWebUI::OnInputDeviceConfigurationChanged(
diff --git a/chrome/browser/ash/login/ui/login_display_host_webui.h b/chrome/browser/ash/login/ui/login_display_host_webui.h index 571e01b..c3f86ab 100644 --- a/chrome/browser/ash/login/ui/login_display_host_webui.h +++ b/chrome/browser/ash/login/ui/login_display_host_webui.h
@@ -202,6 +202,9 @@ // Resets login view and unbinds login display from the signin screen handler. void ResetLoginView(); + // Updates default scaling for CfM devices. + void UpScaleOobe(); + // Sign in screen controller. std::unique_ptr<ExistingUserController> existing_user_controller_; @@ -252,6 +255,9 @@ FinalizeAnimationType finalize_animation_type_ = ANIMATION_WORKSPACE; + // Id of display that was already scaled for CfM devices. + int64_t primary_display_id_ = -1; + // Time when login prompt visible signal is received. Used for // calculations of delay before startup sound. base::TimeTicks login_prompt_visible_time_;
diff --git a/chrome/browser/ash/login/ui/login_screen_extension_ui/web_dialog_view.cc b/chrome/browser/ash/login/ui/login_screen_extension_ui/web_dialog_view.cc index 4f9747b..90a44a6 100644 --- a/chrome/browser/ash/login/ui/login_screen_extension_ui/web_dialog_view.cc +++ b/chrome/browser/ash/login/ui/login_screen_extension_ui/web_dialog_view.cc
@@ -8,7 +8,7 @@ #include "chrome/browser/ash/login/ui/login_screen_extension_ui/dialog_delegate.h" #include "chrome/browser/ui/ash/login_screen_client_impl.h" #include "content/public/browser/browser_context.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" namespace chromeos {
diff --git a/chrome/browser/ash/login/ui/login_screen_extension_ui/web_dialog_view.h b/chrome/browser/ash/login/ui/login_screen_extension_ui/web_dialog_view.h index 0c24571..91c695b 100644 --- a/chrome/browser/ash/login/ui/login_screen_extension_ui/web_dialog_view.h +++ b/chrome/browser/ash/login/ui/login_screen_extension_ui/web_dialog_view.h
@@ -10,8 +10,8 @@ #include "ash/public/cpp/system_tray_observer.h" #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/webview/web_dialog_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" namespace content {
diff --git a/chrome/browser/ash/login/ui/oobe_ui_dialog_delegate.cc b/chrome/browser/ash/login/ui/oobe_ui_dialog_delegate.cc index 0ed03b55..c4a2eae 100644 --- a/chrome/browser/ash/login/ui/oobe_ui_dialog_delegate.cc +++ b/chrome/browser/ash/login/ui/oobe_ui_dialog_delegate.cc
@@ -28,14 +28,14 @@ #include "content/public/browser/web_contents.h" #include "ui/aura/window.h" #include "ui/base/accelerators/accelerator.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_features.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" #include "ui/views/controls/webview/web_dialog_view.h" #include "ui/views/focus/focus_manager.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/metadata/type_conversion.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ash/login/ui/simple_web_view_dialog.cc b/chrome/browser/ash/login/ui/simple_web_view_dialog.cc index 3c22e982..d198e97d 100644 --- a/chrome/browser/ash/login/ui/simple_web_view_dialog.cc +++ b/chrome/browser/ash/login/ui/simple_web_view_dialog.cc
@@ -34,12 +34,12 @@ #include "content/public/common/content_constants.h" #include "ipc/ipc_message.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/views/background.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/chrome/browser/ash/login/ui/simple_web_view_dialog.h b/chrome/browser/ash/login/ui/simple_web_view_dialog.h index 348a8767..d5ca29c 100644 --- a/chrome/browser/ash/login/ui/simple_web_view_dialog.h +++ b/chrome/browser/ash/login/ui/simple_web_view_dialog.h
@@ -17,8 +17,8 @@ #include "components/web_modal/web_contents_modal_dialog_host.h" #include "content/public/browser/page_navigator.h" #include "content/public/browser/web_contents_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "url/gurl.h" class CommandUpdaterImpl;
diff --git a/chrome/browser/ash/login/ui/webui_login_view.cc b/chrome/browser/ash/login/ui/webui_login_view.cc index 950e6ac..dec584d 100644 --- a/chrome/browser/ash/login/ui/webui_login_view.cc +++ b/chrome/browser/ash/login/ui/webui_login_view.cc
@@ -31,7 +31,7 @@ #include "chrome/browser/sessions/session_tab_helper_factory.h" #include "chrome/browser/ui/ash/keyboard/chrome_keyboard_controller_client.h" #include "chrome/browser/ui/ash/login_screen_client_impl.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/autofill/chrome_autofill_client.h" #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" #include "chromeos/dbus/session_manager/session_manager_client.h" @@ -52,11 +52,11 @@ #include "extensions/common/mojom/view_type.mojom.h" #include "third_party/blink/public/common/input/web_input_event.h" #include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" #include "ui/views/controls/webview/web_contents_set_background_color.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" using chromeos::AutoEnrollmentController; @@ -267,13 +267,13 @@ } void WebUILoginView::SetStatusAreaVisible(bool visible) { - SystemTrayClient::Get()->SetPrimaryTrayVisible(visible); + SystemTrayClientImpl::Get()->SetPrimaryTrayVisible(visible); } void WebUILoginView::SetUIEnabled(bool enabled) { forward_keyboard_event_ = enabled; - SystemTrayClient::Get()->SetPrimaryTrayEnabled(enabled); + SystemTrayClientImpl::Get()->SetPrimaryTrayEnabled(enabled); } // WebUILoginView protected: ---------------------------------------------------
diff --git a/chrome/browser/ash/login/ui/webui_login_view.h b/chrome/browser/ash/login/ui/webui_login_view.h index a0a8f65..e7bf928 100644 --- a/chrome/browser/ash/login/ui/webui_login_view.h +++ b/chrome/browser/ash/login/ui/webui_login_view.h
@@ -19,8 +19,8 @@ #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/web_contents_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" #include "url/gurl.h"
diff --git a/chrome/browser/ash/login/version_updater/version_updater_unittest.cc b/chrome/browser/ash/login/version_updater/version_updater_unittest.cc index e19adbe..9d765268 100644 --- a/chrome/browser/ash/login/version_updater/version_updater_unittest.cc +++ b/chrome/browser/ash/login/version_updater/version_updater_unittest.cc
@@ -20,7 +20,7 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_update_engine_client.h" #include "chromeos/dbus/update_engine_client.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/portal_detector/mock_network_portal_detector.h" #include "chromeos/network/portal_detector/network_portal_detector.h" #include "content/public/test/browser_task_environment.h" @@ -93,7 +93,8 @@ DBusThreadManager::GetSetterForTesting()->SetUpdateEngineClient( std::unique_ptr<UpdateEngineClient>(fake_update_engine_client_)); - NetworkHandler::Initialize(); + network_handler_test_helper_ = + std::make_unique<chromeos::NetworkHandlerTestHelper>(); // `mock_network_portal_detector_->IsEnabled()` will always return false. mock_network_portal_detector_ = @@ -120,7 +121,7 @@ mock_delegate_.reset(); network_portal_detector::InitializeForTesting(nullptr); - NetworkHandler::Shutdown(); + network_handler_test_helper_.reset(); // It will delete `fake_update_engine_client_`. DBusThreadManager::Shutdown(); @@ -130,6 +131,8 @@ std::unique_ptr<VersionUpdater> version_updater_; // Accessory objects needed by VersionUpdater. + std::unique_ptr<chromeos::NetworkHandlerTestHelper> + network_handler_test_helper_; std::unique_ptr<MockVersionUpdaterDelegate> mock_delegate_; std::unique_ptr<MockNetworkPortalDetector> mock_network_portal_detector_; std::unique_ptr<NetworkPortalDetectorTestImpl> fake_network_portal_detector_;
diff --git a/chrome/browser/ash/mobile/mobile_activator_unittest.cc b/chrome/browser/ash/mobile/mobile_activator_unittest.cc index ce2bfb7..4cc930d2 100644 --- a/chrome/browser/ash/mobile/mobile_activator_unittest.cc +++ b/chrome/browser/ash/mobile/mobile_activator_unittest.cc
@@ -10,9 +10,8 @@ #include "base/macros.h" #include "base/test/task_environment.h" #include "base/values.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/network/network_connection_handler.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "content/public/browser/browser_thread.h" @@ -104,14 +103,8 @@ ~MobileActivatorTest() override {} protected: - void SetUp() override { - DBusThreadManager::Initialize(); - NetworkHandler::Initialize(); - } void TearDown() override { mobile_activator_.TerminateActivation(); - NetworkHandler::Shutdown(); - DBusThreadManager::Shutdown(); } void set_activator_state(const MobileActivator::PlanActivationState state) { @@ -129,6 +122,7 @@ } base::test::SingleThreadTaskEnvironment task_environment_; + chromeos::NetworkHandlerTestHelper network_handler_test_helper_; NetworkState cellular_network_; TestMobileActivator mobile_activator_;
diff --git a/chrome/browser/ash/net/secure_dns_manager_unittest.cc b/chrome/browser/ash/net/secure_dns_manager_unittest.cc index c5ccb97..3491ff9 100644 --- a/chrome/browser/ash/net/secure_dns_manager_unittest.cc +++ b/chrome/browser/ash/net/secure_dns_manager_unittest.cc
@@ -9,9 +9,8 @@ #include "base/values.h" #include "chrome/browser/net/secure_dns_config.h" #include "chrome/common/pref_names.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/shill/shill_manager_client.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h" #include "content/public/test/browser_task_environment.h" @@ -47,7 +46,7 @@ bool success = false; std::map<std::string, std::string> props; chromeos::ShillManagerClient* shill_manager = - chromeos::DBusThreadManager::Get()->GetShillManagerClient(); + chromeos::ShillManagerClient::Get(); base::RunLoop run_loop; shill_manager->GetProperties( base::BindOnce(&OnGetProperties, base::Unretained(&success), @@ -67,25 +66,17 @@ SecureDnsManagerTest() = default; void SetUp() override { - chromeos::DBusThreadManager::Initialize(); - EXPECT_TRUE(chromeos::DBusThreadManager::Get()->IsUsingFakes()); - chromeos::NetworkHandler::Initialize(); - EXPECT_TRUE(chromeos::NetworkHandler::IsInitialized()); pref_service_.registry()->RegisterStringPref(prefs::kDnsOverHttpsMode, SecureDnsConfig::kModeOff); pref_service_.registry()->RegisterStringPref(prefs::kDnsOverHttpsTemplates, ""); } - void TearDown() override { - chromeos::NetworkHandler::Shutdown(); - chromeos::DBusThreadManager::Shutdown(); - } - PrefService* pref_service() { return &pref_service_; } private: content::BrowserTaskEnvironment task_environment_; + chromeos::NetworkHandlerTestHelper network_handler_test_helper_; TestingPrefServiceSimple pref_service_; DISALLOW_COPY_AND_ASSIGN(SecureDnsManagerTest);
diff --git a/chrome/browser/ash/notifications/echo_dialog_view.cc b/chrome/browser/ash/notifications/echo_dialog_view.cc index 3ea3615c..9ad2216 100644 --- a/chrome/browser/ash/notifications/echo_dialog_view.cc +++ b/chrome/browser/ash/notifications/echo_dialog_view.cc
@@ -12,13 +12,13 @@ #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/font.h" #include "ui/views/border.h" #include "ui/views/controls/button/image_button_factory.h" #include "ui/views/controls/label.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace ash {
diff --git a/chrome/browser/ash/notifications/echo_dialog_view.h b/chrome/browser/ash/notifications/echo_dialog_view.h index 6d4208f..dbe38d2 100644 --- a/chrome/browser/ash/notifications/echo_dialog_view.h +++ b/chrome/browser/ash/notifications/echo_dialog_view.h
@@ -7,8 +7,8 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace views {
diff --git a/chrome/browser/ash/notifications/idle_app_name_notification_view.cc b/chrome/browser/ash/notifications/idle_app_name_notification_view.cc index c4ca810..dae9aa1 100644 --- a/chrome/browser/ash/notifications/idle_app_name_notification_view.cc +++ b/chrome/browser/ash/notifications/idle_app_name_notification_view.cc
@@ -19,6 +19,8 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/aura/window.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_observer.h" @@ -31,8 +33,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/chrome/browser/ash/notifications/kiosk_external_update_notification.cc b/chrome/browser/ash/notifications/kiosk_external_update_notification.cc index 044b4894..a099fd4 100644 --- a/chrome/browser/ash/notifications/kiosk_external_update_notification.cc +++ b/chrome/browser/ash/notifications/kiosk_external_update_notification.cc
@@ -8,6 +8,8 @@ #include "base/macros.h" #include "chrome/browser/ui/ash/ash_util.h" #include "ui/aura/window.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" @@ -16,8 +18,6 @@ #include "ui/gfx/canvas.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/chrome/browser/ash/notifications/passphrase_textfield.cc b/chrome/browser/ash/notifications/passphrase_textfield.cc index 5979f8da..244e706 100644 --- a/chrome/browser/ash/notifications/passphrase_textfield.cc +++ b/chrome/browser/ash/notifications/passphrase_textfield.cc
@@ -6,7 +6,7 @@ #include "base/no_destructor.h" #include "base/strings/utf_string_conversions.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" namespace ash {
diff --git a/chrome/browser/ash/notifications/passphrase_textfield.h b/chrome/browser/ash/notifications/passphrase_textfield.h index e9fd544..7300feb 100644 --- a/chrome/browser/ash/notifications/passphrase_textfield.h +++ b/chrome/browser/ash/notifications/passphrase_textfield.h
@@ -7,8 +7,8 @@ #include <string> +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/textfield/textfield.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace ash {
diff --git a/chrome/browser/ash/notifications/request_pin_view.cc b/chrome/browser/ash/notifications/request_pin_view.cc index 8997e2dc..6559bf0 100644 --- a/chrome/browser/ash/notifications/request_pin_view.cc +++ b/chrome/browser/ash/notifications/request_pin_view.cc
@@ -18,13 +18,13 @@ #include "chrome/grit/generated_resources.h" #include "chromeos/components/security_token_pin/error_generator.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/events/event.h" #include "ui/gfx/color_palette.h" #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace ash {
diff --git a/chrome/browser/ash/notifications/request_pin_view.h b/chrome/browser/ash/notifications/request_pin_view.h index 1591f53f..57c53b3 100644 --- a/chrome/browser/ash/notifications/request_pin_view.h +++ b/chrome/browser/ash/notifications/request_pin_view.h
@@ -12,11 +12,11 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/certificate_provider/security_token_pin_dialog_host.h" #include "chromeos/components/security_token_pin/constants.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ash/notifications/request_system_proxy_credentials_view.cc b/chrome/browser/ash/notifications/request_system_proxy_credentials_view.cc index d1206ed..e842169 100644 --- a/chrome/browser/ash/notifications/request_system_proxy_credentials_view.cc +++ b/chrome/browser/ash/notifications/request_system_proxy_credentials_view.cc
@@ -18,6 +18,7 @@ #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/events/event.h" #include "ui/gfx/color_palette.h" @@ -27,7 +28,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace ash {
diff --git a/chrome/browser/ash/notifications/request_system_proxy_credentials_view.h b/chrome/browser/ash/notifications/request_system_proxy_credentials_view.h index 3507d931..98a3e6e 100644 --- a/chrome/browser/ash/notifications/request_system_proxy_credentials_view.h +++ b/chrome/browser/ash/notifications/request_system_proxy_credentials_view.h
@@ -9,8 +9,8 @@ #include <string> #include "base/callback.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ash/notifications/update_required_notification_unittest.cc b/chrome/browser/ash/notifications/update_required_notification_unittest.cc index 533d3b2..1ba14a8 100644 --- a/chrome/browser/ash/notifications/update_required_notification_unittest.cc +++ b/chrome/browser/ash/notifications/update_required_notification_unittest.cc
@@ -24,7 +24,7 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_update_engine_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/settings/cros_settings_names.h" #include "chromeos/tpm/stub_install_attributes.h" #include "components/prefs/pref_service.h" @@ -95,6 +95,10 @@ return fake_update_engine_client_; } + chromeos::NetworkHandlerTestHelper* network_handler_test_helper() { + return network_handler_test_helper_.get(); + } + void SetUserManaged(bool managed) { user_managed_ = managed; } content::BrowserTaskEnvironment task_environment_{ @@ -110,6 +114,8 @@ std::unique_ptr<base::Version> current_version_; std::unique_ptr<policy::MinimumVersionPolicyHandler> minimum_version_policy_handler_; + std::unique_ptr<chromeos::NetworkHandlerTestHelper> + network_handler_test_helper_; }; UpdateRequiredNotificationTest::UpdateRequiredNotificationTest() @@ -124,12 +130,11 @@ fake_update_engine_client_ = fake_update_engine_client.get(); chromeos::DBusThreadManager::GetSetterForTesting()->SetUpdateEngineClient( std::move(fake_update_engine_client)); - chromeos::NetworkHandler::Initialize(); + network_handler_test_helper_ = + std::make_unique<chromeos::NetworkHandlerTestHelper>(); chromeos::ShillServiceClient::TestInterface* service_test = - chromeos::DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface(); + network_handler_test_helper_->service_test(); service_test->ClearServices(); service_test->AddService("/service/eth", "eth" /* guid */, "eth", shill::kTypeEthernet, shill::kStateOnline, @@ -149,7 +154,7 @@ void UpdateRequiredNotificationTest::TearDown() { minimum_version_policy_handler_.reset(); - chromeos::NetworkHandler::Shutdown(); + network_handler_test_helper_.reset(); } void UpdateRequiredNotificationTest::CreateMinimumVersionHandler() { @@ -197,9 +202,7 @@ // Disconnect all networks chromeos::ShillServiceClient::TestInterface* service_test = - chromeos::DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface(); + network_handler_test_helper()->service_test(); service_test->ClearServices(); // This is needed to wait till EOL status is fetched from the update_engine. @@ -238,9 +241,7 @@ TEST_F(UpdateRequiredNotificationTest, MeteredNetworkNotifications) { // Connect to metered network chromeos::ShillServiceClient::TestInterface* service_test = - chromeos::DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface(); + network_handler_test_helper()->service_test(); service_test->ClearServices(); service_test->AddService(kCellularServicePath, kCellularServicePath /* guid */,
diff --git a/chrome/browser/ash/ownership/owner_settings_service_ash.cc b/chrome/browser/ash/ownership/owner_settings_service_ash.cc index 732bc2b..34201f2b 100644 --- a/chrome/browser/ash/ownership/owner_settings_service_ash.cc +++ b/chrome/browser/ash/ownership/owner_settings_service_ash.cc
@@ -325,7 +325,7 @@ std::unique_ptr<base::ListValue> new_value( old_value ? static_cast<const base::ListValue*>(old_value)->DeepCopy() : new base::ListValue()); - new_value->Append(value.CreateDeepCopy()); + new_value->Append(value.Clone()); return Set(setting, *new_value); }
diff --git a/chrome/browser/ash/scanning/chrome_scanning_app_delegate.cc b/chrome/browser/ash/scanning/chrome_scanning_app_delegate.cc index f43a7ed4..a06bc9c 100644 --- a/chrome/browser/ash/scanning/chrome_scanning_app_delegate.cc +++ b/chrome/browser/ash/scanning/chrome_scanning_app_delegate.cc
@@ -42,18 +42,6 @@ constexpr char kScanningStickySettingsPref[] = "scanning.scanning_sticky_settings"; -// Determines if |path_to_file| is a supported file path for the Files app. Only -// files under the |drive_path| and |my_files_path| paths are allowed to be -// opened to from the Scan app. Paths with references (i.e. "../path") are not -// supported. -bool FilePathSupported(const base::FilePath& drive_path, - const base::FilePath& my_files_path, - const base::FilePath& path_to_file) { - return !path_to_file.ReferencesParent() && - (drive_path.IsParent(path_to_file) || - my_files_path.IsParent(path_to_file)); -} - } // namespace ChromeScanningAppDelegate::ChromeScanningAppDelegate(content::WebUI* web_ui) @@ -101,6 +89,17 @@ return GetPrefs()->GetString(kScanningStickySettingsPref); } +// Determines if |path_to_file| is a supported file path for the Files app. Only +// files under the |drive_path_| and |my_files_path_| paths are allowed to be +// opened to from the Scan app. Paths with references (i.e. "../path") are not +// supported. +bool ChromeScanningAppDelegate::IsFilePathSupported( + const base::FilePath& path_to_file) { + return !path_to_file.ReferencesParent() && + (google_drive_path_.IsParent(path_to_file) || + my_files_path_.IsParent(path_to_file)); +} + void ChromeScanningAppDelegate::OpenFilesInMediaApp( const std::vector<base::FilePath>& file_paths) { if (!base::FeatureList::IsEnabled(chromeos::features::kScanAppMediaLink)) @@ -123,8 +122,7 @@ bool ChromeScanningAppDelegate::ShowFileInFilesApp( const base::FilePath& path_to_file) { const bool can_show_file_picker = - FilePathSupported(google_drive_path_, my_files_path_, path_to_file) && - base::PathExists(path_to_file); + IsFilePathSupported(path_to_file) && base::PathExists(path_to_file); if (!can_show_file_picker) return false;
diff --git a/chrome/browser/ash/scanning/chrome_scanning_app_delegate.h b/chrome/browser/ash/scanning/chrome_scanning_app_delegate.h index f6815c19..32a1431 100644 --- a/chrome/browser/ash/scanning/chrome_scanning_app_delegate.h +++ b/chrome/browser/ash/scanning/chrome_scanning_app_delegate.h
@@ -42,6 +42,7 @@ std::string GetBaseNameFromPath(const base::FilePath& path) override; base::FilePath GetMyFilesPath() override; std::string GetScanSettingsFromPrefs() override; + bool IsFilePathSupported(const base::FilePath& path_to_file) override; void OpenFilesInMediaApp( const std::vector<base::FilePath>& file_paths) override; void SaveScanSettingsToPrefs(const std::string& scan_settings) override;
diff --git a/chrome/browser/ash/scanning/chrome_scanning_app_delegate_unittest.cc b/chrome/browser/ash/scanning/chrome_scanning_app_delegate_unittest.cc index ef7ea6ea..10c3433 100644 --- a/chrome/browser/ash/scanning/chrome_scanning_app_delegate_unittest.cc +++ b/chrome/browser/ash/scanning/chrome_scanning_app_delegate_unittest.cc
@@ -179,4 +179,36 @@ chrome_scanning_app_delegate_->GetScanSettingsFromPrefs()); } +// Validates that passing a file path that is a child of the MyFiles path +// returns true for IsFilePathSupported(). +TEST_F(ChromeScanningAppDelegateTest, FilePathSupportedMyFilesChild) { + const base::FilePath test_file = my_files_path_.Append("test_file.png"); + base::File(test_file, base::File::FLAG_CREATE | base::File::FLAG_READ); + EXPECT_TRUE(chrome_scanning_app_delegate_->IsFilePathSupported(test_file)); +} + +// Validates that passing a file path that is a child of the Drive path returns +// true for IsFilePathSupported(). +TEST_F(ChromeScanningAppDelegateTest, FilePathSupportedGoogleDrivePathChild) { + const base::FilePath test_file = drive_path_.Append("test_file.png"); + base::File(test_file, base::File::FLAG_CREATE | base::File::FLAG_READ); + EXPECT_TRUE(chrome_scanning_app_delegate_->IsFilePathSupported(test_file)); +} + +// Validates that passing an unsupported path returns false for +// IsFilePathSupported(). +TEST_F(ChromeScanningAppDelegateTest, FilePathNotSupported) { + ASSERT_FALSE(chrome_scanning_app_delegate_->IsFilePathSupported( + base::FilePath("/wrong/file/path/file.png"))); +} + +// Validates that passing a file path with a reference returns false for +// IsFilePathSupported(). +TEST_F(ChromeScanningAppDelegateTest, FilePathReferencesNotSupported) { + const base::FilePath test_file = my_files_path_.Append("test_file.png"); + base::File(test_file, base::File::FLAG_CREATE | base::File::FLAG_READ); + ASSERT_FALSE(chrome_scanning_app_delegate_->IsFilePathSupported( + my_files_path_.Append("../MyFiles/test_file.png"))); +} + } // namespace ash
diff --git a/chrome/browser/ash/web_applications/help_app/help_app_integration_browsertest.cc b/chrome/browser/ash/web_applications/help_app/help_app_integration_browsertest.cc index 0b9aad2..7fad635d 100644 --- a/chrome/browser/ash/web_applications/help_app/help_app_integration_browsertest.cc +++ b/chrome/browser/ash/web_applications/help_app/help_app_integration_browsertest.cc
@@ -22,7 +22,7 @@ #include "chrome/browser/ash/web_applications/help_app/help_app_discover_tab_notification.h" #include "chrome/browser/ash/web_applications/system_web_app_integration_test.h" #include "chrome/browser/notifications/notification_display_service_tester.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" @@ -447,7 +447,7 @@ WaitForTestSystemAppInstall(); base::HistogramTester histogram_tester; - SystemTrayClient::Get()->ShowGestureEducationHelp(); + SystemTrayClientImpl::Get()->ShowGestureEducationHelp(); EXPECT_NO_FATAL_FAILURE( WaitForAppToOpen(GURL("chrome://help-app/help/sub/3399710/id/9739838")));
diff --git a/chrome/browser/attribution_reporting/android/internal/BUILD.gn b/chrome/browser/attribution_reporting/android/internal/BUILD.gn index 605c7cc..e2da33c 100644 --- a/chrome/browser/attribution_reporting/android/internal/BUILD.gn +++ b/chrome/browser/attribution_reporting/android/internal/BUILD.gn
@@ -3,7 +3,32 @@ android_library("java") { sources = [ "java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerFactory.java", + "java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerImpl.java", "java/src/org/chromium/chrome/browser/attribution_reporting/NoopAttributionIntentHandler.java", ] - deps = [ "//chrome/browser/attribution_reporting/android:java" ] + deps = [ + "//base:base_java", + "//chrome/browser/attribution_reporting/android:java", + "//third_party/androidx:androidx_annotation_annotation_java", + ] +} + +android_library("junit_tests") { + # Skip platform checks since Robolectric depends on requires_android targets. + bypass_platform_checks = true + testonly = true + + sources = [ "java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerImplTest.java" ] + + deps = [ + ":java", + "//base:base_java", + "//base:base_junit_test_support", + "//chrome/browser/attribution_reporting/android:java", + "//third_party/android_deps:robolectric_all_java", + "//third_party/android_support_test_runner:runner_java", + "//third_party/androidx:androidx_test_runner_java", + "//third_party/junit", + "//third_party/mockito:mockito_java", + ] }
diff --git a/chrome/browser/attribution_reporting/android/internal/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerImpl.java b/chrome/browser/attribution_reporting/android/internal/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerImpl.java new file mode 100644 index 0000000..0364299 --- /dev/null +++ b/chrome/browser/attribution_reporting/android/internal/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerImpl.java
@@ -0,0 +1,152 @@ +// 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. + +package org.chromium.chrome.browser.attribution_reporting; + +import android.app.PendingIntent; +import android.content.Intent; +import android.view.InputEvent; + +import androidx.annotation.VisibleForTesting; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.base.ContextUtils; +import org.chromium.base.IntentUtils; +import org.chromium.base.Log; + +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.Arrays; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + +/** + * Handles incoming App Attribution intents. + * + * The intent flow works as follows: + * 1. An app sends an "outer" intent to Chrome, which is simply a standard VIEW intent for a URL, + * but with the EXTRA_ATTRIBUTION_INTENT set to a Mutable PendingIntent that contains the + * attribution parameters and the ACTION_APP_ATTRIBUTION action. + * 2. Chrome adds the PackageName and PackageName hash from the PendingIntent creator, as well as + * the original VIEW intent, as extras to the PendingIntent and sends it. + * 3. The LauncherActivity receives the ACTION_APP_ATTRIBUTION intent, validates the PackageName + * hash to verify the source of the attribution, processes the attribution data, then un-wraps + * the original VIEW intent for the LauncherActivity to handle and resume the navigation. + * + * Note that the sending app fully controls the contents of both the outer and inner intent - the + * hash only validates the sender's package, so further validation would be required if we wanted to + * make any guarantees of data matching between the outer and inner intents. + * + * Explainer: https://github.com/WICG/conversion-measurement-api/blob/main/app_to_web.md + * + */ +public class AttributionIntentHandlerImpl implements AttributionIntentHandler { + private static final String TAG = "AppAttribution"; + + // Mac that is valid for the life of the process (and no longer). + @VisibleForTesting + /* protected */ static final Mac sHasher; + private static final int SECRET_KEY_NUM_BYTES = 64; + private static final String MAC_ALGORITHM = "HmacSHA256"; + + /* protected */ static final String EXTRA_ORIGINAL_INTENT = + "com.android.chrome.original_intent"; + /* protected */ static final String EXTRA_PACKAGE_NAME = "com.android.chrome.package_name"; + /* protected */ static final String EXTRA_PACKAGE_MAC = "com.android.chrome.package_mac"; + + static { + try { + byte secret[] = new byte[SECRET_KEY_NUM_BYTES]; + new SecureRandom().nextBytes(secret); + Key key = new SecretKeySpec(secret, MAC_ALGORITHM); + sHasher = Mac.getInstance(MAC_ALGORITHM); + sHasher.init(key); + } catch (NoSuchAlgorithmException | InvalidKeyException e) { + // Should never happen. + throw new RuntimeException(e); + } + } + + @Override + public boolean handleOuterAttributionIntent(Intent intent) { + PendingIntent outerIntent = IntentUtils.safeGetParcelableExtra( + intent, AttributionConstants.EXTRA_ATTRIBUTION_INTENT); + if (outerIntent == null) return false; + // Remove the PendingIntent so we don't process it again. + intent.removeExtra(AttributionConstants.EXTRA_ATTRIBUTION_INTENT); + + // Add extras to the Intent sent by the PendingIntent (the 'inner' intent) that will be used + // for sender validation. We also add the original intent to the inner intent, so that when + // we receive it we can handle the original view intent after processing the attribution + // data. + Intent fillIn = new Intent(); + fillIn.putExtra(EXTRA_ORIGINAL_INTENT, intent); + String senderPackage = outerIntent.getCreatorPackage(); + byte packageMac[] = sHasher.doFinal(ApiCompatibilityUtils.getBytesUtf8(senderPackage)); + fillIn.putExtra(EXTRA_PACKAGE_NAME, outerIntent.getCreatorPackage()); + fillIn.putExtra(EXTRA_PACKAGE_MAC, packageMac); + + try { + // By firing the PendingIntent, we can guarantee that only the sending app and Chrome + // can control the data on the sent Intent. The app could still mistakenly mis-target + // the sent intent, but there's nothing we can do about that. + outerIntent.send(ContextUtils.getApplicationContext(), 0, fillIn); + } catch (PendingIntent.CanceledException e) { + // PendingIntent was cancelled by the sender, so treat just treat the intent as a + // regular non-attribution Intent. + return false; + } + return true; + } + + @Override + public Intent handleInnerAttributionIntent(Intent intent) { + if (!AttributionConstants.ACTION_APP_ATTRIBUTION.equals(intent.getAction())) return null; + + String senderPackage = IntentUtils.safeGetStringExtra(intent, EXTRA_PACKAGE_NAME); + byte packageMac[] = IntentUtils.safeGetByteArrayExtra(intent, EXTRA_PACKAGE_MAC); + Intent originalIntent = IntentUtils.safeGetParcelableExtra(intent, EXTRA_ORIGINAL_INTENT); + String sourceEventId = IntentUtils.safeGetStringExtra( + intent, AttributionConstants.EXTRA_ATTRIBUTION_SOURCE_EVENT_ID); + String attributionDestination = IntentUtils.safeGetStringExtra( + intent, AttributionConstants.EXTRA_ATTRIBUTION_DESTINATION); + String reportTo = IntentUtils.safeGetStringExtra( + intent, AttributionConstants.EXTRA_ATTRIBUTION_REPORT_TO); + String expiry = IntentUtils.safeGetStringExtra( + intent, AttributionConstants.EXTRA_ATTRIBUTION_EXPIRY); + InputEvent inputEvent = + IntentUtils.safeGetParcelableExtra(intent, AttributionConstants.EXTRA_INPUT_EVENT); + if (!isValidAttributionIntent(senderPackage, packageMac, originalIntent, sourceEventId, + attributionDestination, inputEvent)) { + Log.w(TAG, "Invalid APP_ATTRIBUTION intent: " + intent.toUri(0)); + // Even if the attribution intent was invalid, we can still handle the original view + // intent, which shouldn't be null unless the sending app is intentionally removing it. + return originalIntent; + } + // TODO(https://crbug.com/1198308): Use the attribution info. + return originalIntent; + } + + @VisibleForTesting + public boolean isValidAttributionIntent(String senderPackage, byte[] packageMac, + Intent originalIntent, String sourceEventId, String attributionDestination, + InputEvent inputEvent) { + // TODO(https://crbug.com/1198308): Validate InputEvents from the sender. + if (senderPackage == null || packageMac == null || originalIntent == null + || sourceEventId == null || attributionDestination == null || inputEvent == null) { + Log.d(TAG, "Attribution intent missing attributes."); + return false; + } + byte correctPackageMac[] = + sHasher.doFinal(ApiCompatibilityUtils.getBytesUtf8(senderPackage)); + if (!Arrays.equals(correctPackageMac, packageMac)) { + Log.d(TAG, "Attribution intent package MAC incorrect."); + return false; + } + return true; + } +}
diff --git a/chrome/browser/attribution_reporting/android/internal/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerImplTest.java b/chrome/browser/attribution_reporting/android/internal/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerImplTest.java new file mode 100644 index 0000000..91a58d0 --- /dev/null +++ b/chrome/browser/attribution_reporting/android/internal/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerImplTest.java
@@ -0,0 +1,193 @@ +// 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. + +package org.chromium.chrome.browser.attribution_reporting; + +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyObject; +import static org.mockito.ArgumentMatchers.eq; + +import android.app.PendingIntent; +import android.content.Intent; +import android.net.Uri; +import android.view.InputEvent; + +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.Captor; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.quality.Strictness; +import org.robolectric.annotation.Config; + +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.base.ContextUtils; +import org.chromium.base.test.BaseRobolectricTestRunner; + +/** Unit tests for AttributionIntentHandlerImpl. */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE) +public class AttributionIntentHandlerImplTest { + private AttributionIntentHandlerImpl mAttributionIntentHandlerImpl; + + @Rule + public MockitoRule mMockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); + + @Mock + private PendingIntent mPendingIntent; + + @Mock + private InputEvent mInputEvent; + + @Captor + private ArgumentCaptor<Intent> mPendingIntentSendCaptor; + + private String mPackageName = "packageName"; + private byte mPackageMac[]; + + @Before + public void setUp() { + mAttributionIntentHandlerImpl = new AttributionIntentHandlerImpl(); + mPackageMac = AttributionIntentHandlerImpl.sHasher.doFinal( + ApiCompatibilityUtils.getBytesUtf8(mPackageName)); + } + + private Intent makeValidAttributionIntent() { + Intent intent = new Intent(AttributionConstants.ACTION_APP_ATTRIBUTION); + byte packageMac[] = AttributionIntentHandlerImpl.sHasher.doFinal( + ApiCompatibilityUtils.getBytesUtf8(mPackageName)); + intent.putExtra(AttributionIntentHandlerImpl.EXTRA_PACKAGE_NAME, mPackageName); + intent.putExtra(AttributionIntentHandlerImpl.EXTRA_PACKAGE_MAC, packageMac); + intent.putExtra(AttributionIntentHandlerImpl.EXTRA_ORIGINAL_INTENT, new Intent()); + + intent.putExtra(AttributionConstants.EXTRA_ATTRIBUTION_SOURCE_EVENT_ID, "1234"); + intent.putExtra(AttributionConstants.EXTRA_ATTRIBUTION_DESTINATION, "https://example.com"); + intent.putExtra(AttributionConstants.EXTRA_INPUT_EVENT, mInputEvent); + return intent; + } + + @Test + public void testHandleOuterAttributionIntent() throws Exception { + Intent intent = new Intent(); + intent.setData(Uri.parse("https://www.example.com")); + intent.putExtra("testKey", "testValue"); + intent.putExtra(AttributionConstants.EXTRA_ATTRIBUTION_INTENT, mPendingIntent); + Mockito.when(mPendingIntent.getCreatorPackage()).thenReturn(mPackageName); + + Assert.assertTrue(mAttributionIntentHandlerImpl.handleOuterAttributionIntent(intent)); + + Mockito.verify(mPendingIntent) + .send(eq(ContextUtils.getApplicationContext()), eq(0), + mPendingIntentSendCaptor.capture()); + intent.removeExtra(AttributionConstants.EXTRA_ATTRIBUTION_INTENT); + Intent fillIn = mPendingIntentSendCaptor.getValue(); + Intent originalIntent = + fillIn.getParcelableExtra(AttributionIntentHandlerImpl.EXTRA_ORIGINAL_INTENT); + Assert.assertEquals(intent.toUri(0), originalIntent.toUri(0)); + Assert.assertEquals(mPackageName, + fillIn.getStringExtra(AttributionIntentHandlerImpl.EXTRA_PACKAGE_NAME)); + byte[] expectedMac = AttributionIntentHandlerImpl.sHasher.doFinal( + ApiCompatibilityUtils.getBytesUtf8(mPackageName)); + Assert.assertArrayEquals(expectedMac, + fillIn.getByteArrayExtra(AttributionIntentHandlerImpl.EXTRA_PACKAGE_MAC)); + } + + @Test + public void testHandleOuterAttributionIntent_canceledPendingIntent() throws Exception { + Intent intent = new Intent(); + intent.putExtra(AttributionConstants.EXTRA_ATTRIBUTION_INTENT, mPendingIntent); + String packageName = "packageName"; + Mockito.when(mPendingIntent.getCreatorPackage()).thenReturn(packageName); + Mockito.doThrow(new PendingIntent.CanceledException()) + .when(mPendingIntent) + .send(anyObject(), anyInt(), anyObject()); + + Assert.assertFalse(mAttributionIntentHandlerImpl.handleOuterAttributionIntent(intent)); + } + + @Test + public void testHandleOuterAttributionIntent_NoAttribution() throws Exception { + Assert.assertFalse( + mAttributionIntentHandlerImpl.handleOuterAttributionIntent(new Intent())); + } + + @Test + public void testIsValidAttributionIntent_valid() { + Assert.assertTrue(mAttributionIntentHandlerImpl.isValidAttributionIntent(mPackageName, + mPackageMac, new Intent(), "event", "https://example.com", mInputEvent)); + } + + @Test + public void testIsValidAttributionIntent_wrongMac() { + mPackageMac[mPackageMac.length - 1] = (byte) ~mPackageMac[mPackageMac.length - 1]; + Assert.assertFalse(mAttributionIntentHandlerImpl.isValidAttributionIntent(mPackageName, + mPackageMac, new Intent(), "event", "https://example.com", mInputEvent)); + } + + @Test + public void testIsValidAttributionIntent_noIntent() { + Assert.assertFalse(mAttributionIntentHandlerImpl.isValidAttributionIntent( + mPackageName, mPackageMac, null, "event", "https://example.com", mInputEvent)); + } + + @Test + public void testIsValidAttributionIntent_noEventId() { + Assert.assertFalse(mAttributionIntentHandlerImpl.isValidAttributionIntent( + mPackageName, mPackageMac, new Intent(), null, "https://example.com", mInputEvent)); + } + + @Test + public void testIsValidAttributionIntent_noAttributionDestitation() { + Assert.assertFalse(mAttributionIntentHandlerImpl.isValidAttributionIntent( + mPackageName, mPackageMac, new Intent(), "event", null, mInputEvent)); + } + + @Test + public void testIsValidAttributionIntent_noInputEvent() { + Assert.assertFalse(mAttributionIntentHandlerImpl.isValidAttributionIntent( + mPackageName, mPackageMac, new Intent(), "event", "https://example.com", null)); + } + + @Test + public void testHandleInnerAttributionIntent() { + Intent originalIntent = new Intent(Intent.ACTION_VIEW); + originalIntent.setData(Uri.parse("https://www.example.com")); + originalIntent.putExtra("testKey", "testValue"); + Intent intent = makeValidAttributionIntent(); + intent.putExtra(AttributionIntentHandlerImpl.EXTRA_ORIGINAL_INTENT, originalIntent); + + Intent result = mAttributionIntentHandlerImpl.handleInnerAttributionIntent(intent); + + Assert.assertEquals(result.toUri(0), originalIntent.toUri(0)); + } + + @Test + public void testHandleInnerAttributionIntent_invalid() { + Intent originalIntent = new Intent(Intent.ACTION_VIEW); + originalIntent.setData(Uri.parse("https://www.example.com")); + originalIntent.putExtra("testKey", "testValue"); + Intent intent = makeValidAttributionIntent(); + intent.putExtra(AttributionIntentHandlerImpl.EXTRA_ORIGINAL_INTENT, originalIntent); + intent.putExtra(AttributionIntentHandlerImpl.EXTRA_PACKAGE_NAME, "wrongPackage"); + + // Even for an invalid attribution intent, we should still un-wrap to the original intent. + Intent result = mAttributionIntentHandlerImpl.handleInnerAttributionIntent(intent); + + Assert.assertEquals(result.toUri(0), originalIntent.toUri(0)); + } + + @Test + public void testHandleInnerAttributionIntent_noAttributionAction() { + Intent intent = makeValidAttributionIntent(); + // Replace the attribution action with a VIEW action. + intent.setAction(Intent.ACTION_VIEW); + Assert.assertNull(mAttributionIntentHandlerImpl.handleInnerAttributionIntent(intent)); + } +}
diff --git a/chrome/browser/attribution_reporting/android/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionConstants.java b/chrome/browser/attribution_reporting/android/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionConstants.java index 0caa288..69164bc0 100644 --- a/chrome/browser/attribution_reporting/android/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionConstants.java +++ b/chrome/browser/attribution_reporting/android/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionConstants.java
@@ -8,4 +8,14 @@ public class AttributionConstants { public static final String ACTION_APP_ATTRIBUTION = "android.web.action.APP_ATTRIBUTION"; public static final String EXTRA_ATTRIBUTION_INTENT = "android.web.extra.ATTRIBUTION_INTENT"; + + // Attribution parameters. + public static final String EXTRA_ATTRIBUTION_SOURCE_EVENT_ID = "attributionSourceEventId"; + public static final String EXTRA_ATTRIBUTION_DESTINATION = "attributionDestination"; + // Optional + public static final String EXTRA_ATTRIBUTION_REPORT_TO = "attributionReportTo"; + // Optional + public static final String EXTRA_ATTRIBUTION_EXPIRY = "attributionExpiry"; + // Input event used for validation. + public static final String EXTRA_INPUT_EVENT = "inputEvent"; }
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc index 0ff25fd..49be3d8 100644 --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -192,17 +192,16 @@ storage_partition_(nullptr), omnibox_triggered_feature_service_( std::make_unique<OmniboxTriggeredFeatureService>()) { - if (OmniboxFieldTrial::IsPedalSuggestionsEnabled()) { +#if !defined(OS_ANDROID) #if BUILDFLAG(GOOGLE_CHROME_BRANDING) - pedal_provider_ = std::make_unique<OmniboxPedalProvider>(*this, true); + pedal_provider_ = std::make_unique<OmniboxPedalProvider>(*this, true); #else - pedal_provider_ = std::make_unique<OmniboxPedalProvider>(*this, false); + pedal_provider_ = std::make_unique<OmniboxPedalProvider>(*this, false); #endif - } +#endif } -ChromeAutocompleteProviderClient::~ChromeAutocompleteProviderClient() { -} +ChromeAutocompleteProviderClient::~ChromeAutocompleteProviderClient() = default; scoped_refptr<network::SharedURLLoaderFactory> ChromeAutocompleteProviderClient::GetURLLoaderFactory() { @@ -279,9 +278,7 @@ OmniboxPedalProvider* ChromeAutocompleteProviderClient::GetPedalProvider() const { - // If Pedals are disabled, we should never get here to use the provider. - DCHECK(OmniboxFieldTrial::IsPedalSuggestionsEnabled()); - DCHECK(pedal_provider_); + // This may be null for systems that don't have Pedals (Android, e.g.). return pedal_provider_.get(); }
diff --git a/chrome/browser/autofill/autofill_provider_browsertest.cc b/chrome/browser/autofill/autofill_provider_browsertest.cc index a227f45..1760ea43 100644 --- a/chrome/browser/autofill/autofill_provider_browsertest.cc +++ b/chrome/browser/autofill/autofill_provider_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/base_switches.h" +#include "base/bind.h" #include "base/macros.h" #include "build/build_config.h" #include "chrome/browser/ui/browser.h" @@ -12,6 +13,7 @@ #include "chrome/test/base/ui_test_utils.h" #include "components/autofill/content/browser/content_autofill_driver.h" #include "components/autofill/content/browser/content_autofill_driver_factory.h" +#include "components/autofill/core/browser/android_autofill_manager.h" #include "components/autofill/core/browser/test_autofill_client.h" #include "components/autofill/core/browser/test_autofill_provider.h" #include "components/autofill/core/common/autofill_features.h" @@ -119,18 +121,8 @@ ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( web_contents, autofill_client_.get(), "en-US", BrowserAutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER, - autofill_provider_.get()); - } - - void ReplaceAutofillDriver() { - content::WebContents* web_contents = WebContents(); - // Set AutofillProvider for current WebContents. - ContentAutofillDriverFactory* factory = - ContentAutofillDriverFactory::FromWebContents(web_contents); - ContentAutofillDriver* driver = - factory->DriverForFrame(web_contents->GetMainFrame()); - driver->SetAutofillProviderForTesting(autofill_provider_.get(), - autofill_client_.get()); + base::BindRepeating(&AndroidAutofillManager::Create, + autofill_provider_.get())); } void TearDownOnMainThread() override { @@ -166,7 +158,6 @@ } void SetLabelChangeExpectationAndTriggerQuery() { - ReplaceAutofillDriver(); // One query for the single click, and a second query when the typing is // simulated. base::RunLoop run_loop;
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 9011780..51855dc 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2089,10 +2089,12 @@ std::vector<std::string> ChromeContentBrowserClient::GetAdditionalSiteIsolationModes() { + std::vector<std::string> modes; if (site_isolation::SiteIsolationPolicy::IsIsolationForPasswordSitesEnabled()) - return {"Isolate Password Sites"}; - else - return {}; + modes.push_back("Password Sites"); + if (site_isolation::SiteIsolationPolicy::IsIsolationForOAuthSitesEnabled()) + modes.push_back("Logged-in Sites"); + return modes; } void ChromeContentBrowserClient::PersistIsolatedOrigin(
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index f3bb33b..b5e1015 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -2358,6 +2358,8 @@ "input_method/suggestion_handler_interface.h", "input_method/suggestions_collector.cc", "input_method/suggestions_collector.h", + "input_method/suggestions_service_client.cc", + "input_method/suggestions_service_client.h", "input_method/suggestions_source.h", "input_method/tts_handler.cc", "input_method/tts_handler.h", @@ -4023,6 +4025,7 @@ "input_method/native_input_method_engine_unittest.cc", "input_method/personal_info_suggester_unittest.cc", "input_method/suggestions_collector_unittest.cc", + "input_method/suggestions_service_client_unittest.cc", "input_method/ui/candidate_view_unittest.cc", "input_method/ui/candidate_window_view_unittest.cc", "input_method/ui/input_method_menu_item_unittest.cc",
diff --git a/chrome/browser/chromeos/dbus/proxy_resolution_service_provider_unittest.cc b/chrome/browser/chromeos/dbus/proxy_resolution_service_provider_unittest.cc index cb4cf18..4237166 100644 --- a/chrome/browser/chromeos/dbus/proxy_resolution_service_provider_unittest.cc +++ b/chrome/browser/chromeos/dbus/proxy_resolution_service_provider_unittest.cc
@@ -13,9 +13,8 @@ #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" #include "chromeos/dbus/services/service_provider_test_helper.h" -#include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/system_proxy/system_proxy_client.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/tpm/stub_install_attributes.h" #include "dbus/message.h" #include "dbus/object_path.h" @@ -228,8 +227,6 @@ ash::features::kSystemProxyForSystemServices); ProxyResolutionServiceProviderTest::SetUp(); - shill_clients::InitializeFakes(); - NetworkHandler::Initialize(); SystemProxyClient::InitializeFake(); SystemProxyManager::Initialize(local_state_.Get()); SystemProxyManager::Get()->SetSystemServicesProxyUrlForTest( @@ -238,8 +235,6 @@ void TearDown() override { SystemProxyManager::Shutdown(); - NetworkHandler::Shutdown(); - shill_clients::Shutdown(); SystemProxyClient::Shutdown(); } @@ -270,6 +265,7 @@ ScopedTestingLocalState local_state_; private: + NetworkHandlerTestHelper network_handler_test_helper_; base::test::ScopedFeatureList scoped_feature_list_; };
diff --git a/chrome/browser/chromeos/events/event_rewriter_unittest.cc b/chrome/browser/chromeos/events/event_rewriter_unittest.cc index a8950b0..891427f 100644 --- a/chrome/browser/chromeos/events/event_rewriter_unittest.cc +++ b/chrome/browser/chromeos/events/event_rewriter_unittest.cc
@@ -2132,18 +2132,18 @@ {ui::VKEY_F3, ui::DomCode::F3, ui::EF_ALT_DOWN, ui::DomKey::F3}, {ui::VKEY_BROWSER_REFRESH, ui::DomCode::BROWSER_REFRESH, ui::EF_ALT_DOWN, ui::DomKey::BROWSER_REFRESH}}, - // F4 -> Launch App 2 + // F4 -> Zoom (aka Fullscreen) {ui::ET_KEY_PRESSED, {ui::VKEY_F4, ui::DomCode::F4, ui::EF_NONE, ui::DomKey::F4}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, ui::DomKey::ZOOM_TOGGLE}}, {ui::ET_KEY_PRESSED, {ui::VKEY_F4, ui::DomCode::F4, ui::EF_CONTROL_DOWN, ui::DomKey::F4}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, - ui::EF_CONTROL_DOWN, ui::DomKey::ZOOM_TOGGLE}}, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_CONTROL_DOWN, + ui::DomKey::ZOOM_TOGGLE}}, {ui::ET_KEY_PRESSED, {ui::VKEY_F4, ui::DomCode::F4, ui::EF_ALT_DOWN, ui::DomKey::F4}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, ui::EF_ALT_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_ALT_DOWN, ui::DomKey::ZOOM_TOGGLE}}, // F5 -> Launch App 1 {ui::ET_KEY_PRESSED, @@ -2604,19 +2604,19 @@ {ui::VKEY_F2, ui::DomCode::F2, ui::EF_ALT_DOWN, ui::DomKey::F2}, {ui::VKEY_BROWSER_REFRESH, ui::DomCode::BROWSER_REFRESH, ui::EF_ALT_DOWN, ui::DomKey::BROWSER_REFRESH}}, - // F3 -> Launch App 2 + // F3 -> Zoom (aka Fullscreen) {ui::ET_KEY_PRESSED, {ui::VKEY_F3, ui::DomCode::F3, ui::EF_NONE, ui::DomKey::F3}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, ui::DomKey::ZOOM_TOGGLE}}, {ui::ET_KEY_PRESSED, {ui::VKEY_F3, ui::DomCode::F3, ui::EF_CONTROL_DOWN, ui::DomKey::F3}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, - ui::EF_CONTROL_DOWN, ui::DomKey::ZOOM_TOGGLE}}, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_CONTROL_DOWN, + ui::DomKey::ZOOM_TOGGLE}}, {ui::ET_KEY_PRESSED, {ui::VKEY_F3, ui::DomCode::F3, ui::EF_ALT_DOWN, ui::DomKey::F3}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, - ui::EF_ALT_DOWN, ui::DomKey::ZOOM_TOGGLE}}, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_ALT_DOWN, + ui::DomKey::ZOOM_TOGGLE}}, // F4 -> Launch App 1 {ui::ET_KEY_PRESSED, {ui::VKEY_F4, ui::DomCode::F4, ui::EF_NONE, ui::DomKey::F4}, @@ -2768,13 +2768,13 @@ {ui::ET_KEY_PRESSED, {ui::VKEY_F2, ui::DomCode::F2, ui::EF_ALT_DOWN, ui::DomKey::F2}, {ui::VKEY_F2, ui::DomCode::F2, ui::EF_ALT_DOWN, ui::DomKey::F2}}, - // F3 -> F3, Search + F3 -> Full Screen + // F3 -> F3, Search + F3 -> Zoom (aka Fullscreen) {ui::ET_KEY_PRESSED, {ui::VKEY_F3, ui::DomCode::F3, ui::EF_NONE, ui::DomKey::F3}, {ui::VKEY_F3, ui::DomCode::F3, ui::EF_NONE, ui::DomKey::F3}}, {ui::ET_KEY_PRESSED, {ui::VKEY_F3, ui::DomCode::F3, ui::EF_COMMAND_DOWN, ui::DomKey::F3}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, ui::DomKey::ZOOM_TOGGLE}}, {ui::ET_KEY_PRESSED, {ui::VKEY_F3, ui::DomCode::F3, ui::EF_CONTROL_DOWN, ui::DomKey::F3}, @@ -3018,11 +3018,10 @@ }); KeyTestCase wilco_1_test = - // Search + F12 -> Ctrl + Launch App 2 (Display toggle) + // Search + F12 -> Ctrl + Zoom (aka Fullscreen) (Display toggle) {ui::ET_KEY_PRESSED, {ui::VKEY_F12, ui::DomCode::F12, ui::EF_COMMAND_DOWN, ui::DomKey::F12}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::F12, ui::EF_CONTROL_DOWN, - ui::DomKey::F12}}; + {ui::VKEY_ZOOM, ui::DomCode::F12, ui::EF_CONTROL_DOWN, ui::DomKey::F12}}; KeyTestCase drallion_test_no_privacy_screen = // Search + F12 -> F12 (Privacy screen not supported) @@ -3088,7 +3087,7 @@ {ui::ET_KEY_PRESSED, {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, ui::DomKey::ZOOM_TOGGLE}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, ui::DomKey::ZOOM_TOGGLE}}, {ui::ET_KEY_PRESSED, {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_COMMAND_DOWN, @@ -3170,15 +3169,13 @@ {ui::VKEY_F11, ui::DomCode::F11, ui::EF_NONE, ui::DomKey::F11}}}; KeyTestCase wilco_1_tests[] = { - // Ctrl + Launch App 1 (Display toggle) -> Unchanged - // Search + Ctrl + Launch App 1 (Display toggle) -> F12 + // Ctrl + Zoom (Display toggle) -> Unchanged + // Search + Ctrl + Zoom (Display toggle) -> F12 {ui::ET_KEY_PRESSED, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::F12, ui::EF_CONTROL_DOWN, - ui::DomKey::F12}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::F12, ui::EF_CONTROL_DOWN, - ui::DomKey::F12}}, + {ui::VKEY_ZOOM, ui::DomCode::F12, ui::EF_CONTROL_DOWN, ui::DomKey::F12}, + {ui::VKEY_ZOOM, ui::DomCode::F12, ui::EF_CONTROL_DOWN, ui::DomKey::F12}}, {ui::ET_KEY_PRESSED, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::F12, + {ui::VKEY_ZOOM, ui::DomCode::F12, ui::EF_COMMAND_DOWN + ui::EF_CONTROL_DOWN, ui::DomKey::F12}, {ui::VKEY_F12, ui::DomCode::F12, ui::EF_NONE, ui::DomKey::F12}}}; @@ -3193,17 +3190,17 @@ {ui::VKEY_PRIVACY_SCREEN_TOGGLE, ui::DomCode::PRIVACY_SCREEN_TOGGLE, ui::EF_COMMAND_DOWN, ui::DomKey::UNIDENTIFIED}, {ui::VKEY_F12, ui::DomCode::F12, ui::EF_NONE, ui::DomKey::F12}}, - // Ctrl + Launch App 1 (Display toggle) -> Unchanged - // Search + Ctrl + Launch App 1 (Display toggle) -> Unchanged + // Ctrl + Zoom (Display toggle) -> Unchanged + // Search + Ctrl + Zoom (Display toggle) -> Unchanged {ui::ET_KEY_PRESSED, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}}, {ui::ET_KEY_PRESSED, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_COMMAND_DOWN + ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}}}; KeyTestCase drallion_tests_privacy_screen[] = { @@ -3218,17 +3215,17 @@ {ui::VKEY_PRIVACY_SCREEN_TOGGLE, ui::DomCode::PRIVACY_SCREEN_TOGGLE, ui::EF_COMMAND_DOWN, ui::DomKey::UNIDENTIFIED}, {ui::VKEY_F12, ui::DomCode::F12, ui::EF_NONE, ui::DomKey::F12}}, - // Ctrl + Launch App 1 (Display toggle) -> Unchanged - // Search + Ctrl + Launch App 1 (Display toggle) -> Unchanged + // Ctrl + Zoom (Display toggle) -> Unchanged + // Search + Ctrl + Zoom (Display toggle) -> Unchanged {ui::ET_KEY_PRESSED, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}}, {ui::ET_KEY_PRESSED, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_COMMAND_DOWN + ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}}}; // Set keyboard layout to Wilco 1.0 @@ -3297,7 +3294,7 @@ {ui::ET_KEY_PRESSED, {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_COMMAND_DOWN, ui::DomKey::ZOOM_TOGGLE}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, ui::DomKey::ZOOM_TOGGLE}}, // Launch App 1 -> F4, Search + Launch App 1 -> Launch App 1 {ui::ET_KEY_PRESSED, @@ -3375,16 +3372,15 @@ {ui::VKEY_F11, ui::DomCode::F11, ui::EF_NONE, ui::DomKey::F11}}}; KeyTestCase wilco_1_tests[] = { - // Ctrl + Launch App 1 (Display toggle) -> F12 - // Search + Ctrl + Launch App 1 (Display toggle) -> Unchanged + // Ctrl + Zoom (Display toggle) -> F12 + // Search + Ctrl + Zoom (Display toggle) -> Unchanged {ui::ET_KEY_PRESSED, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::F12, ui::EF_CONTROL_DOWN, - ui::DomKey::F12}, + {ui::VKEY_ZOOM, ui::DomCode::F12, ui::EF_CONTROL_DOWN, ui::DomKey::F12}, {ui::VKEY_F12, ui::DomCode::F12, ui::EF_NONE, ui::DomKey::F12}}, {ui::ET_KEY_PRESSED, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::F12, + {ui::VKEY_ZOOM, ui::DomCode::F12, ui::EF_COMMAND_DOWN + ui::EF_CONTROL_DOWN, ui::DomKey::F12}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::F12, ui::EF_CONTROL_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::F12, ui::EF_CONTROL_DOWN, ui::DomKey::F12}}}; KeyTestCase drallion_tests_no_privacy_screen[] = { @@ -3398,17 +3394,17 @@ {ui::VKEY_PRIVACY_SCREEN_TOGGLE, ui::DomCode::PRIVACY_SCREEN_TOGGLE, ui::EF_COMMAND_DOWN, ui::DomKey::UNIDENTIFIED}, {ui::VKEY_F12, ui::DomCode::F12, ui::EF_NONE, ui::DomKey::F12}}, - // Ctrl + Launch App 1 (Display toggle) -> Unchanged - // Search + Ctrl + Launch App 1 (Display toggle) -> Unchanged + // Ctrl + Zoom (Display toggle) -> Unchanged + // Search + Ctrl + Zoom (Display toggle) -> Unchanged {ui::ET_KEY_PRESSED, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}}, {ui::ET_KEY_PRESSED, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_COMMAND_DOWN + ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, + {ui::VKEY_ZOOM, ui::DomCode::NONE, ui::EF_CONTROL_DOWN, ui::DomKey::UNIDENTIFIED}}}; KeyTestCase drallion_tests_privacy_screen[] = { @@ -3467,10 +3463,10 @@ {ui::VKEY_F3, ui::DomCode::F3, ui::EF_NONE, ui::DomKey::F3}, {ui::VKEY_BROWSER_REFRESH, ui::DomCode::BROWSER_REFRESH, ui::EF_NONE, ui::DomKey::BROWSER_REFRESH}}, - // F4 -> Launch App 2 + // F4 -> Zoom (aka Fullscreen) {ui::ET_KEY_PRESSED, {ui::VKEY_F4, ui::DomCode::F4, ui::EF_NONE, ui::DomKey::F4}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, ui::DomKey::ZOOM_TOGGLE}}, // F7 -> Brightness up {ui::ET_KEY_PRESSED, @@ -3489,10 +3485,10 @@ {ui::VKEY_F2, ui::DomCode::F2, ui::EF_NONE, ui::DomKey::F2}, {ui::VKEY_BROWSER_REFRESH, ui::DomCode::BROWSER_REFRESH, ui::EF_NONE, ui::DomKey::BROWSER_REFRESH}}, - // F3 -> Launch App 2 + // F3 -> Zoom (aka Fullscreen) {ui::ET_KEY_PRESSED, {ui::VKEY_F3, ui::DomCode::F3, ui::EF_NONE, ui::DomKey::F3}, - {ui::VKEY_MEDIA_LAUNCH_APP2, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, + {ui::VKEY_ZOOM, ui::DomCode::ZOOM_TOGGLE, ui::EF_NONE, ui::DomKey::ZOOM_TOGGLE}}, // F4 -> Launch App 1 {ui::ET_KEY_PRESSED,
diff --git a/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc b/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc index cca3f72c..dd6fc51 100644 --- a/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc +++ b/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc
@@ -18,6 +18,7 @@ #include "chrome/grit/generated_resources.h" #include "extensions/browser/device_local_account_util.h" #include "extensions/common/api/incognito.h" +#include "extensions/common/api/requirements.h" #include "extensions/common/api/shared_module.h" #include "extensions/common/api/web_accessible_resources.h" #include "extensions/common/extension.h" @@ -213,7 +214,7 @@ "plugins", // Stated 3D/WebGL requirements of an app. - emk::kRequirements, + ext_api::requirements::ManifestKeys::kRequirements, // Execute some pages in a separate sandbox. (Note: Using string literal // since extensions::manifest_keys only has constants for sub-keys.)
diff --git a/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc b/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc index 8a58e53..ace2f64 100644 --- a/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc +++ b/chrome/browser/chromeos/input_method/input_method_engine_browsertests.cc
@@ -445,27 +445,27 @@ const char* code; const char* key; } kMediaKeyCases[] = { - { ui::VKEY_BROWSER_BACK, "BrowserBack", "HistoryBack" }, - { ui::VKEY_BROWSER_FORWARD, "BrowserForward", "HistoryForward" }, - { ui::VKEY_BROWSER_REFRESH, "BrowserRefresh", "BrowserRefresh" }, - { ui::VKEY_MEDIA_LAUNCH_APP2, "ChromeOSFullscreen", "ChromeOSFullscreen" }, - { ui::VKEY_MEDIA_LAUNCH_APP1, - "ChromeOSSwitchWindow", "ChromeOSSwitchWindow" }, - { ui::VKEY_BRIGHTNESS_DOWN, "BrightnessDown", "BrightnessDown" }, - { ui::VKEY_BRIGHTNESS_UP, "BrightnessUp", "BrightnessUp" }, - { ui::VKEY_VOLUME_MUTE, "VolumeMute", "AudioVolumeMute" }, - { ui::VKEY_VOLUME_DOWN, "VolumeDown", "AudioVolumeDown" }, - { ui::VKEY_VOLUME_UP, "VolumeUp", "AudioVolumeUp" }, - { ui::VKEY_F1, "F1", "HistoryBack" }, - { ui::VKEY_F2, "F2", "HistoryForward" }, - { ui::VKEY_F3, "F3", "BrowserRefresh" }, - { ui::VKEY_F4, "F4", "ChromeOSFullscreen" }, - { ui::VKEY_F5, "F5", "ChromeOSSwitchWindow" }, - { ui::VKEY_F6, "F6", "BrightnessDown" }, - { ui::VKEY_F7, "F7", "BrightnessUp" }, - { ui::VKEY_F8, "F8", "AudioVolumeMute" }, - { ui::VKEY_F9, "F9", "AudioVolumeDown" }, - { ui::VKEY_F10, "F10", "AudioVolumeUp" }, + {ui::VKEY_BROWSER_BACK, "BrowserBack", "HistoryBack"}, + {ui::VKEY_BROWSER_FORWARD, "BrowserForward", "HistoryForward"}, + {ui::VKEY_BROWSER_REFRESH, "BrowserRefresh", "BrowserRefresh"}, + {ui::VKEY_ZOOM, "ChromeOSFullscreen", "ChromeOSFullscreen"}, + {ui::VKEY_MEDIA_LAUNCH_APP1, "ChromeOSSwitchWindow", + "ChromeOSSwitchWindow"}, + {ui::VKEY_BRIGHTNESS_DOWN, "BrightnessDown", "BrightnessDown"}, + {ui::VKEY_BRIGHTNESS_UP, "BrightnessUp", "BrightnessUp"}, + {ui::VKEY_VOLUME_MUTE, "VolumeMute", "AudioVolumeMute"}, + {ui::VKEY_VOLUME_DOWN, "VolumeDown", "AudioVolumeDown"}, + {ui::VKEY_VOLUME_UP, "VolumeUp", "AudioVolumeUp"}, + {ui::VKEY_F1, "F1", "HistoryBack"}, + {ui::VKEY_F2, "F2", "HistoryForward"}, + {ui::VKEY_F3, "F3", "BrowserRefresh"}, + {ui::VKEY_F4, "F4", "ChromeOSFullscreen"}, + {ui::VKEY_F5, "F5", "ChromeOSSwitchWindow"}, + {ui::VKEY_F6, "F6", "BrightnessDown"}, + {ui::VKEY_F7, "F7", "BrightnessUp"}, + {ui::VKEY_F8, "F8", "AudioVolumeMute"}, + {ui::VKEY_F9, "F9", "AudioVolumeDown"}, + {ui::VKEY_F10, "F10", "AudioVolumeUp"}, }; for (size_t i = 0; i < base::size(kMediaKeyCases); ++i) {
diff --git a/chrome/browser/chromeos/input_method/native_input_method_engine.cc b/chrome/browser/chromeos/input_method/native_input_method_engine.cc index 763088d..fbcdd8e 100644 --- a/chrome/browser/chromeos/input_method/native_input_method_engine.cc +++ b/chrome/browser/chromeos/input_method/native_input_method_engine.cc
@@ -15,6 +15,7 @@ #include "base/strings/utf_offset_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/chromeos/input_method/autocorrect_manager.h" +#include "chrome/browser/chromeos/input_method/suggestions_service_client.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/settings_window_manager_chromeos.h" #include "chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom.h" @@ -167,9 +168,15 @@ std::make_unique<AutocorrectManager>(this); autocorrect_manager_ = autocorrect_manager.get(); + auto suggestions_service_client = + base::FeatureList::IsEnabled(chromeos::features::kAssistMultiWord) + ? std::make_unique<SuggestionsServiceClient>() + : nullptr; + auto suggestions_collector = base::FeatureList::IsEnabled(chromeos::features::kAssistMultiWord) - ? std::make_unique<SuggestionsCollector>(assistive_suggester_) + ? std::make_unique<SuggestionsCollector>( + assistive_suggester_, std::move(suggestions_service_client)) : nullptr; chrome_keyboard_controller_client_observer_.Observe(
diff --git a/chrome/browser/chromeos/input_method/suggestions_collector.cc b/chrome/browser/chromeos/input_method/suggestions_collector.cc index 7910b49..d3d8cfc 100644 --- a/chrome/browser/chromeos/input_method/suggestions_collector.cc +++ b/chrome/browser/chromeos/input_method/suggestions_collector.cc
@@ -4,21 +4,58 @@ #include "chrome/browser/chromeos/input_method/suggestions_collector.h" +#include "base/callback.h" #include "chromeos/services/ime/public/cpp/suggestions.h" #include "chromeos/services/ime/public/mojom/input_engine.mojom.h" namespace chromeos { +using ::chromeos::ime::TextSuggestion; + +std::vector<TextSuggestion> CombineResults( + const std::vector<TextSuggestion>& first, + const std::vector<TextSuggestion>& second) { + std::vector<TextSuggestion> combined; + combined.reserve(first.size() + second.size()); + combined.insert(combined.end(), first.begin(), first.end()); + combined.insert(combined.end(), second.begin(), second.end()); + return combined; +} + SuggestionsCollector::SuggestionsCollector( - SuggestionsSource* assistive_suggester) - : assistive_suggester_(assistive_suggester) {} + SuggestionsSource* assistive_suggester, + std::unique_ptr<AsyncSuggestionsSource> suggestions_service_client) + : assistive_suggester_(assistive_suggester), + suggestions_service_client_(std::move(suggestions_service_client)) {} + +SuggestionsCollector::~SuggestionsCollector() = default; void SuggestionsCollector::GatherSuggestions( ime::mojom::SuggestionsRequestPtr request, GatherSuggestionsCallback callback) { - // TODO(crbug/1146266): Fetch suggestions from suggestions service as well. - auto response = ime::mojom::SuggestionsResponse::New(); - response->candidates = assistive_suggester_->GetSuggestions(); + std::vector<ime::TextSuggestion> assistive_suggestions = + assistive_suggester_->GetSuggestions(); + + if (!suggestions_service_client_->IsAvailable()) { + auto response = ime::mojom::SuggestionsResponse::New( + /*candidates=*/assistive_suggestions); + std::move(callback).Run(std::move(response)); + return; + } + + suggestions_service_client_->RequestSuggestions( + request->text, request->completion_candidates, + base::BindOnce(&SuggestionsCollector::OnSuggestionsGathered, + base::Unretained(this), std::move(callback), + assistive_suggestions)); +} + +void SuggestionsCollector::OnSuggestionsGathered( + GatherSuggestionsCallback callback, + const std::vector<ime::TextSuggestion>& assistive_suggestions, + const std::vector<ime::TextSuggestion>& system_suggestions) { + auto response = ime::mojom::SuggestionsResponse::New( + /*candidates=*/CombineResults(assistive_suggestions, system_suggestions)); std::move(callback).Run(std::move(response)); }
diff --git a/chrome/browser/chromeos/input_method/suggestions_collector.h b/chrome/browser/chromeos/input_method/suggestions_collector.h index e917ef5..a32f667 100644 --- a/chrome/browser/chromeos/input_method/suggestions_collector.h +++ b/chrome/browser/chromeos/input_method/suggestions_collector.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_SUGGESTIONS_COLLECTOR_H_ #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_SUGGESTIONS_COLLECTOR_H_ +#include <memory> #include <vector> #include "base/callback.h" @@ -18,7 +19,11 @@ class SuggestionsCollector { public: // `assistive_suggester` must exist for the lifetime of this instance. - explicit SuggestionsCollector(SuggestionsSource* assistive_suggester); + SuggestionsCollector( + SuggestionsSource* assistive_suggester, + std::unique_ptr<AsyncSuggestionsSource> suggestions_service_client); + + ~SuggestionsCollector(); using GatherSuggestionsCallback = base::OnceCallback<void(ime::mojom::SuggestionsResponsePtr)>; @@ -28,8 +33,18 @@ GatherSuggestionsCallback callback); private: + // Called when suggestions have been returned from the injected + // SuggestionsRequestor. + void OnSuggestionsGathered( + GatherSuggestionsCallback callback, + const std::vector<ime::TextSuggestion>& assistive_suggestions, + const std::vector<ime::TextSuggestion>& system_suggestions); + // Not owned by this class SuggestionsSource* assistive_suggester_; + + // Client used to request suggestions from the system + std::unique_ptr<AsyncSuggestionsSource> suggestions_service_client_; }; } // namespace chromeos
diff --git a/chrome/browser/chromeos/input_method/suggestions_collector_unittest.cc b/chrome/browser/chromeos/input_method/suggestions_collector_unittest.cc index 4cf510d..c896a53 100644 --- a/chrome/browser/chromeos/input_method/suggestions_collector_unittest.cc +++ b/chrome/browser/chromeos/input_method/suggestions_collector_unittest.cc
@@ -6,6 +6,8 @@ #include <vector> +#include "base/bind.h" +#include "base/callback.h" #include "base/test/bind.h" #include "chrome/browser/chromeos/input_method/suggestions_source.h" #include "chromeos/services/ime/public/cpp/suggestions.h" @@ -14,49 +16,172 @@ namespace chromeos { namespace { +using TextCompletionCandidate = ::chromeos::ime::TextCompletionCandidate; using TextSuggestion = ::chromeos::ime::TextSuggestion; using TextSuggestionMode = ::chromeos::ime::TextSuggestionMode; using TextSuggestionType = ::chromeos::ime::TextSuggestionType; class FakeAssistiveSuggester : public SuggestionsSource { public: - // SuggestionsSource overrides - std::vector<TextSuggestion> GetSuggestions() override { - return std::vector<TextSuggestion>{ - TextSuggestion{.mode = TextSuggestionMode::kCompletion, - .type = TextSuggestionType::kAssistivePersonalInfo, - .text = "my name is Mr Robot"}, - TextSuggestion{.mode = TextSuggestionMode::kCompletion, - .type = TextSuggestionType::kAssistivePersonalInfo, - .text = "my address is 123 Fake St"}, - }; + std::vector<TextSuggestion> GetSuggestions() override { return suggestions_; } + + void SetSuggestions(const std::vector<TextSuggestion> suggestions) { + suggestions_ = suggestions; } + + private: + std::vector<TextSuggestion> suggestions_; }; -TEST(SuggestionsCollectorTest, - ReturnsSuggestionsFromInjectedSuggestionsSource) { +class FakeSuggestionsService : public AsyncSuggestionsSource { + public: + void RequestSuggestions( + const std::string& preceding_text, + const std::vector<TextCompletionCandidate>& completion_candidates, + RequestSuggestionsCallback callback) override { + std::move(callback).Run(suggestions_); + } + + bool IsAvailable() override { return is_available_; } + + void SetSuggestions(const std::vector<TextSuggestion> suggestions) { + suggestions_ = suggestions; + } + + void SetIsAvailable(bool is_available) { is_available_ = is_available; } + + private: + std::vector<TextSuggestion> suggestions_; + bool is_available_ = true; +}; + +class SuggestionsCollectorTest : public ::testing::Test { + public: + void SetUp() override { + multi_word_result_ = TextSuggestion{.mode = TextSuggestionMode::kPrediction, + .type = TextSuggestionType::kMultiWord, + .text = "hello there"}; + + personal_info_name_result_ = + TextSuggestion{.mode = TextSuggestionMode::kCompletion, + .type = TextSuggestionType::kAssistivePersonalInfo, + .text = "my name is Mr Robot"}; + + personal_info_address_result_ = + TextSuggestion{.mode = TextSuggestionMode::kCompletion, + .type = TextSuggestionType::kAssistivePersonalInfo, + .text = "my address is 123 Fake St"}; + } + + std::vector<TextSuggestion> suggestions_returned() { + return suggestions_returned_; + } + + TextSuggestion multi_word_result() { return multi_word_result_; } + TextSuggestion personal_info_name_result() { + return personal_info_name_result_; + } + TextSuggestion personal_info_address_result() { + return personal_info_address_result_; + } + + void OnSuggestionsReturned(ime::mojom::SuggestionsResponsePtr response) { + suggestions_returned_ = response->candidates; + } + + private: + std::vector<TextSuggestion> suggestions_returned_; + TextSuggestion multi_word_result_; + TextSuggestion personal_info_name_result_; + TextSuggestion personal_info_address_result_; +}; + +TEST_F(SuggestionsCollectorTest, ReturnsResultsFromAssistiveSuggester) { FakeAssistiveSuggester suggester; - SuggestionsCollector collector(&suggester); - auto request = ime::mojom::SuggestionsRequest::New(); + auto requestor = std::make_unique<FakeSuggestionsService>(); - std::vector<TextSuggestion> suggestions_returned; - auto callback = base::BindLambdaForTesting( - [&suggestions_returned](ime::mojom::SuggestionsResponsePtr response) { - suggestions_returned = response->candidates; - }); - - std::vector<TextSuggestion> expected_suggestions = { - TextSuggestion{.mode = TextSuggestionMode::kCompletion, - .type = TextSuggestionType::kAssistivePersonalInfo, - .text = "my name is Mr Robot"}, - TextSuggestion{.mode = TextSuggestionMode::kCompletion, - .type = TextSuggestionType::kAssistivePersonalInfo, - .text = "my address is 123 Fake St"}, + auto expected_results = std::vector<TextSuggestion>{ + personal_info_name_result(), + personal_info_address_result(), }; - collector.GatherSuggestions(std::move(request), callback); + suggester.SetSuggestions(expected_results); + SuggestionsCollector collector(&suggester, std::move(requestor)); - EXPECT_EQ(suggestions_returned, expected_suggestions); + collector.GatherSuggestions( + ime::mojom::SuggestionsRequest::New(), + base::BindOnce(&SuggestionsCollectorTest::OnSuggestionsReturned, + base::Unretained(this))); + + EXPECT_EQ(suggestions_returned(), expected_results); +} + +TEST_F(SuggestionsCollectorTest, ReturnsResultsFromSuggestionsRequestor) { + FakeAssistiveSuggester suggester; + auto requestor = std::make_unique<FakeSuggestionsService>(); + + auto expected_results = std::vector<TextSuggestion>{multi_word_result()}; + + requestor->SetSuggestions(expected_results); + SuggestionsCollector collector(&suggester, std::move(requestor)); + + collector.GatherSuggestions( + ime::mojom::SuggestionsRequest::New(), + base::BindOnce(&SuggestionsCollectorTest::OnSuggestionsReturned, + base::Unretained(this))); + + EXPECT_EQ(suggestions_returned(), expected_results); +} + +TEST_F(SuggestionsCollectorTest, ReturnsCombinedResultsIfAvailable) { + FakeAssistiveSuggester assistive_suggester; + auto suggestions_requestor = std::make_unique<FakeSuggestionsService>(); + + suggestions_requestor->SetSuggestions({multi_word_result()}); + assistive_suggester.SetSuggestions( + {personal_info_name_result(), personal_info_address_result()}); + + SuggestionsCollector collector(&assistive_suggester, + std::move(suggestions_requestor)); + + auto expected_results = std::vector<TextSuggestion>{ + personal_info_name_result(), + personal_info_address_result(), + multi_word_result(), + }; + + collector.GatherSuggestions( + ime::mojom::SuggestionsRequest::New(), + base::BindOnce(&SuggestionsCollectorTest::OnSuggestionsReturned, + base::Unretained(this))); + + EXPECT_EQ(suggestions_returned(), expected_results); +} + +TEST_F(SuggestionsCollectorTest, + OnlyReturnsAssistiveResultsIfRequestorNotAvailable) { + FakeAssistiveSuggester assistive_suggester; + auto suggestions_requestor = std::make_unique<FakeSuggestionsService>(); + + suggestions_requestor->SetSuggestions({multi_word_result()}); + suggestions_requestor->SetIsAvailable(false); + assistive_suggester.SetSuggestions( + {personal_info_name_result(), personal_info_address_result()}); + + SuggestionsCollector collector(&assistive_suggester, + std::move(suggestions_requestor)); + + auto expected_results = std::vector<TextSuggestion>{ + personal_info_name_result(), + personal_info_address_result(), + }; + + collector.GatherSuggestions( + ime::mojom::SuggestionsRequest::New(), + base::BindOnce(&SuggestionsCollectorTest::OnSuggestionsReturned, + base::Unretained(this))); + + EXPECT_EQ(suggestions_returned(), expected_results); } } // namespace
diff --git a/chrome/browser/chromeos/input_method/suggestions_service_client.cc b/chrome/browser/chromeos/input_method/suggestions_service_client.cc new file mode 100644 index 0000000..2f7f99b --- /dev/null +++ b/chrome/browser/chromeos/input_method/suggestions_service_client.cc
@@ -0,0 +1,101 @@ +// 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. + +#include "chrome/browser/chromeos/input_method/suggestions_service_client.h" + +#include "base/bind.h" +#include "base/optional.h" +#include "chromeos/services/machine_learning/public/cpp/service_connection.h" + +namespace chromeos { +namespace { + +using ::chromeos::ime::TextSuggestion; +using ::chromeos::ime::TextSuggestionMode; +using ::chromeos::ime::TextSuggestionType; +using ::chromeos::machine_learning::mojom::NextWordCompletionCandidate; +using ::chromeos::machine_learning::mojom::TextSuggesterQuery; +using ::chromeos::machine_learning::mojom::TextSuggesterResultPtr; +using ::chromeos::machine_learning::mojom::TextSuggestionCandidatePtr; + +base::Optional<TextSuggestion> ToTextSuggestion( + const TextSuggestionCandidatePtr& candidate) { + if (!candidate->is_multi_word()) { + // TODO(crbug/1146266): Handle emoji suggestions + return base::nullopt; + } + + return TextSuggestion{ + // TODO(crbug/1146266): Introduce suggestion mode to suggestion service + // interface. For the moment, everything is a prediction. + .mode = TextSuggestionMode::kPrediction, + .type = TextSuggestionType::kMultiWord, + .text = candidate->get_multi_word()->text}; +} + +} // namespace + +SuggestionsServiceClient::SuggestionsServiceClient() { + chromeos::machine_learning::ServiceConnection::GetInstance() + ->GetMachineLearningService() + .LoadTextSuggester( + text_suggester_.BindNewPipeAndPassReceiver(), + base::BindOnce( + [](bool* text_suggester_loaded_, + chromeos::machine_learning::mojom::LoadModelResult result) { + *text_suggester_loaded_ = + result == + chromeos::machine_learning::mojom::LoadModelResult::OK; + }, + &text_suggester_loaded_)); +} + +SuggestionsServiceClient::~SuggestionsServiceClient() = default; + +void SuggestionsServiceClient::RequestSuggestions( + const std::string& preceding_text, + const std::vector<ime::TextCompletionCandidate>& completion_candidates, + RequestSuggestionsCallback callback) { + if (!IsAvailable()) { + std::move(callback).Run({}); + return; + } + + auto query = TextSuggesterQuery::New(); + query->text = preceding_text; + + for (const auto& candidate : completion_candidates) { + auto next_word_candidate = NextWordCompletionCandidate::New(); + next_word_candidate->text = candidate.text; + next_word_candidate->normalized_score = candidate.score; + query->next_word_candidates.push_back(std::move(next_word_candidate)); + } + + text_suggester_->Suggest( + std::move(query), + base::BindOnce(&SuggestionsServiceClient::OnSuggestionsReturned, + base::Unretained(this), std::move(callback))); +} + +void SuggestionsServiceClient::OnSuggestionsReturned( + RequestSuggestionsCallback callback, + chromeos::machine_learning::mojom::TextSuggesterResultPtr result) { + std::vector<TextSuggestion> suggestions; + + for (const auto& candidate : result->candidates) { + auto suggestion = ToTextSuggestion(std::move(candidate)); + if (suggestion) { + // Drop any unknown suggestions + suggestions.push_back(suggestion.value()); + } + } + + std::move(callback).Run(suggestions); +} + +bool SuggestionsServiceClient::IsAvailable() { + return text_suggester_loaded_; +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/input_method/suggestions_service_client.h b/chrome/browser/chromeos/input_method/suggestions_service_client.h new file mode 100644 index 0000000..34f7368 --- /dev/null +++ b/chrome/browser/chromeos/input_method/suggestions_service_client.h
@@ -0,0 +1,44 @@ +// 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. + +#ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_SUGGESTIONS_SERVICE_CLIENT_H_ +#define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_SUGGESTIONS_SERVICE_CLIENT_H_ + +#include <vector> + +#include "base/callback.h" +#include "chrome/browser/chromeos/input_method/suggestions_source.h" +#include "chromeos/services/ime/public/cpp/suggestions.h" +#include "chromeos/services/machine_learning/public/mojom/text_suggester.mojom.h" +#include "mojo/public/cpp/bindings/remote.h" + +namespace chromeos { + +// A client interface to the TextSuggestions service found in the ML service. +class SuggestionsServiceClient : public AsyncSuggestionsSource { + public: + SuggestionsServiceClient(); + ~SuggestionsServiceClient() override; + + // AsyncSuggestionsSource overrides + void RequestSuggestions( + const std::string& preceding_text, + const std::vector<ime::TextCompletionCandidate>& completion_candidates, + RequestSuggestionsCallback callback) override; + bool IsAvailable() override; + + private: + // Called when results are returned from the suggestions service + void OnSuggestionsReturned( + RequestSuggestionsCallback callback, + chromeos::machine_learning::mojom::TextSuggesterResultPtr result); + + mojo::Remote<chromeos::machine_learning::mojom::TextSuggester> + text_suggester_; + bool text_suggester_loaded_ = false; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_SUGGESTIONS_SERVICE_CLIENT_H_
diff --git a/chrome/browser/chromeos/input_method/suggestions_service_client_unittest.cc b/chrome/browser/chromeos/input_method/suggestions_service_client_unittest.cc new file mode 100644 index 0000000..2c67f7c --- /dev/null +++ b/chrome/browser/chromeos/input_method/suggestions_service_client_unittest.cc
@@ -0,0 +1,68 @@ +// 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. + +#include "chrome/browser/chromeos/input_method/suggestions_service_client.h" + +#include "base/run_loop.h" +#include "base/test/bind.h" +#include "chromeos/services/machine_learning/public/cpp/fake_service_connection.h" +#include "chromeos/services/machine_learning/public/mojom/text_suggester.mojom.h" +#include "content/public/test/browser_task_environment.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace chromeos { +namespace { + +using TextCompletionCandidate = ::chromeos::ime::TextCompletionCandidate; +using TextSuggestion = ::chromeos::ime::TextSuggestion; +using TextSuggestionMode = ::chromeos::ime::TextSuggestionMode; +using TextSuggestionType = ::chromeos::ime::TextSuggestionType; + +class SuggestionsServiceClientTest : public testing::Test { + public: + SuggestionsServiceClientTest() = default; + + private: + content::BrowserTaskEnvironment task_environment_; +}; + +TEST_F(SuggestionsServiceClientTest, ReturnsResultsFromMojoService) { + machine_learning::FakeServiceConnectionImpl fake_service_connection; + machine_learning::ServiceConnection::UseFakeServiceConnectionForTesting( + &fake_service_connection); + machine_learning::ServiceConnection::GetInstance()->Initialize(); + + // Construct fake output + auto result = machine_learning::mojom::TextSuggesterResult::New(); + result->status = machine_learning::mojom::TextSuggesterResult::Status::OK; + auto multi_word = machine_learning::mojom::MultiWordSuggestionCandidate::New( + /*text=*/"hi there", /*normalized_score=*/0.5f); + auto candidate = machine_learning::mojom::TextSuggestionCandidate::New(); + candidate->set_multi_word(std::move(multi_word)); + result->candidates.emplace_back(std::move(candidate)); + fake_service_connection.SetOutputTextSuggesterResult(result); + + SuggestionsServiceClient client; + base::RunLoop().RunUntilIdle(); + + std::vector<TextSuggestion> returned_results; + client.RequestSuggestions( + "this is some text", std::vector<TextCompletionCandidate>{}, + base::BindLambdaForTesting( + [&](const std::vector<TextSuggestion>& results) { + returned_results = results; + })); + + std::vector<TextSuggestion> expected_results = { + TextSuggestion{.mode = TextSuggestionMode::kPrediction, + .type = TextSuggestionType::kMultiWord, + .text = "hi there"}, + }; + + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(returned_results, expected_results); +} + +} // namespace +} // namespace chromeos
diff --git a/chrome/browser/chromeos/input_method/suggestions_source.h b/chrome/browser/chromeos/input_method/suggestions_source.h index da2a417..2bfd8d0 100644 --- a/chrome/browser/chromeos/input_method/suggestions_source.h +++ b/chrome/browser/chromeos/input_method/suggestions_source.h
@@ -7,6 +7,7 @@ #include <vector> +#include "base/callback.h" #include "chromeos/services/ime/public/cpp/suggestions.h" namespace chromeos { @@ -21,6 +22,27 @@ virtual std::vector<ime::TextSuggestion> GetSuggestions() = 0; }; +// As the name suggests, this also represents a source of text based +// suggestions, however the interface for fetching suggestions from this object +// is asynchronous. +class AsyncSuggestionsSource { + public: + virtual ~AsyncSuggestionsSource() = default; + + using RequestSuggestionsCallback = + base::OnceCallback<void(const std::vector<ime::TextSuggestion>&)>; + + // Fetch the suggestions from this object, any suggestions fetched will be + // returned in the callback passed. + virtual void RequestSuggestions( + const std::string& preceding_text, + const std::vector<ime::TextCompletionCandidate>& completion_candidates, + RequestSuggestionsCallback callback) = 0; + + // Is the source ready to produce suggestions? + virtual bool IsAvailable() = 0; +}; + } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_SUGGESTIONS_SOURCE_H_
diff --git a/chrome/browser/chromeos/input_method/ui/candidate_view.cc b/chrome/browser/chromeos/input_method/ui/candidate_view.cc index 6866f6fc..496e040 100644 --- a/chrome/browser/chromeos/input_method/ui/candidate_view.cc +++ b/chrome/browser/chromeos/input_method/ui/candidate_view.cc
@@ -10,12 +10,12 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/ime/candidate_window.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_utils.h" #include "ui/native_theme/native_theme.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace ui {
diff --git a/chrome/browser/chromeos/input_method/ui/candidate_view.h b/chrome/browser/chromeos/input_method/ui/candidate_view.h index 1ebe8e6..f330871b 100644 --- a/chrome/browser/chromeos/input_method/ui/candidate_view.h +++ b/chrome/browser/chromeos/input_method/ui/candidate_view.h
@@ -8,10 +8,10 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "ui/base/ime/candidate_window.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/chromeos/ui_chromeos_export.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h"
diff --git a/chrome/browser/chromeos/input_method/ui/candidate_window_view.cc b/chrome/browser/chromeos/input_method/ui/candidate_window_view.cc index c0fe65b7..c79cc9b 100644 --- a/chrome/browser/chromeos/input_method/ui/candidate_window_view.cc +++ b/chrome/browser/chromeos/input_method/ui/candidate_window_view.cc
@@ -12,6 +12,8 @@ #include "chrome/browser/chromeos/input_method/ui/candidate_view.h" #include "chrome/browser/chromeos/input_method/ui/candidate_window_constants.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/display/types/display_constants.h" @@ -26,8 +28,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/wm/core/window_animations.h" namespace ui {
diff --git a/chrome/browser/chromeos/input_method/ui/candidate_window_view.h b/chrome/browser/chromeos/input_method/ui/candidate_window_view.h index 16e5e854..9064a180 100644 --- a/chrome/browser/chromeos/input_method/ui/candidate_window_view.h +++ b/chrome/browser/chromeos/input_method/ui/candidate_window_view.h
@@ -9,9 +9,9 @@ #include "base/macros.h" #include "ui/base/ime/candidate_window.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/chromeos/ui_chromeos_export.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace ui {
diff --git a/chrome/browser/chromeos/input_method/ui/infolist_window.cc b/chrome/browser/chromeos/input_method/ui/infolist_window.cc index 035cc47..53ae006 100644 --- a/chrome/browser/chromeos/input_method/ui/infolist_window.cc +++ b/chrome/browser/chromeos/input_method/ui/infolist_window.cc
@@ -13,6 +13,7 @@ #include "base/macros.h" #include "chrome/browser/chromeos/input_method/ui/candidate_window_constants.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/insets.h" @@ -23,7 +24,6 @@ #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/window_animations.h"
diff --git a/chrome/browser/chromeos/input_method/ui/infolist_window.h b/chrome/browser/chromeos/input_method/ui/infolist_window.h index 1f848d1b..78b1e759 100644 --- a/chrome/browser/chromeos/input_method/ui/infolist_window.h +++ b/chrome/browser/chromeos/input_method/ui/infolist_window.h
@@ -12,10 +12,10 @@ #include "base/macros.h" #include "base/timer/timer.h" #include "ui/base/ime/infolist_entry.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/chromeos/ui_chromeos_export.h" #include "ui/gfx/font_list.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace ui {
diff --git a/chrome/browser/chromeos/input_method/ui/suggestion_view.cc b/chrome/browser/chromeos/input_method/ui/suggestion_view.cc index 60f1bad..2ead82cb 100644 --- a/chrome/browser/chromeos/input_method/ui/suggestion_view.cc +++ b/chrome/browser/chromeos/input_method/ui/suggestion_view.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/chromeos/input_method/ui/suggestion_view.h" + #include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/app/vector_icons/vector_icons.h" @@ -10,13 +11,13 @@ #include "chrome/grit/generated_resources.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace ui {
diff --git a/chrome/browser/chromeos/input_method/ui/suggestion_view.h b/chrome/browser/chromeos/input_method/ui/suggestion_view.h index 1b58973..5e3e578 100644 --- a/chrome/browser/chromeos/input_method/ui/suggestion_view.h +++ b/chrome/browser/chromeos/input_method/ui/suggestion_view.h
@@ -7,11 +7,11 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/chromeos/ui_chromeos_export.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/label.h" #include "ui/views/controls/styled_label.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h"
diff --git a/chrome/browser/chromeos/input_method/ui/suggestion_window_view.cc b/chrome/browser/chromeos/input_method/ui/suggestion_window_view.cc index 1c7eb0b..49d1f46 100644 --- a/chrome/browser/chromeos/input_method/ui/suggestion_window_view.cc +++ b/chrome/browser/chromeos/input_method/ui/suggestion_window_view.cc
@@ -19,6 +19,7 @@ #include "components/strings/grit/components_strings.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/font.h" @@ -36,7 +37,6 @@ #include "ui/views/controls/link.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/window_animations.h" #include "ui/wm/core/window_properties.h"
diff --git a/chrome/browser/chromeos/input_method/ui/suggestion_window_view.h b/chrome/browser/chromeos/input_method/ui/suggestion_window_view.h index f8a7ffa..366deef 100644 --- a/chrome/browser/chromeos/input_method/ui/suggestion_window_view.h +++ b/chrome/browser/chromeos/input_method/ui/suggestion_window_view.h
@@ -10,10 +10,10 @@ #include <memory> #include "base/containers/flat_map.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/chromeos/ui_chromeos_export.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace chromeos {
diff --git a/chrome/browser/chromeos/input_method/ui/undo_window.cc b/chrome/browser/chromeos/input_method/ui/undo_window.cc index b3c5bb9..1f662db9 100644 --- a/chrome/browser/chromeos/input_method/ui/undo_window.cc +++ b/chrome/browser/chromeos/input_method/ui/undo_window.cc
@@ -6,12 +6,12 @@ #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/chromeos/input_method/ui/border_factory.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/wm/core/window_animations.h" namespace ui {
diff --git a/chrome/browser/chromeos/input_method/ui/undo_window.h b/chrome/browser/chromeos/input_method/ui/undo_window.h index 32aced39..098aa7f5 100644 --- a/chrome/browser/chromeos/input_method/ui/undo_window.h +++ b/chrome/browser/chromeos/input_method/ui/undo_window.h
@@ -6,10 +6,10 @@ #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_UI_UNDO_WINDOW_H_ #include "chrome/browser/chromeos/input_method/ui/assistive_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/chromeos/ui_chromeos_export.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace ui {
diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc index d890a861..1ba039d 100644 --- a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc +++ b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc
@@ -28,6 +28,7 @@ #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/portal_detector/network_portal_detector_strategy.h" @@ -121,7 +122,7 @@ void TearDown() override { network_portal_detector_.reset(); profile_ = nullptr; - NetworkHandler::Shutdown(); + network_handler_test_helper_.reset(); DBusThreadManager::Shutdown(); PortalDetectorStrategy::reset_fields_for_testing(); } @@ -233,7 +234,7 @@ } void SetBehindPortal(const std::string& service_path) { - DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( + ShillServiceClient::Get()->SetProperty( dbus::ObjectPath(service_path), shill::kStateProperty, base::Value(shill::kStateNoConnectivity), base::DoNothing(), base::BindOnce(&ErrorCallbackFunction)); @@ -248,14 +249,14 @@ } void SetConnected(const std::string& service_path) { - DBusThreadManager::Get()->GetShillServiceClient()->Connect( - dbus::ObjectPath(service_path), base::DoNothing(), - base::BindOnce(&ErrorCallbackFunction)); + ShillServiceClient::Get()->Connect(dbus::ObjectPath(service_path), + base::DoNothing(), + base::BindOnce(&ErrorCallbackFunction)); base::RunLoop().RunUntilIdle(); } void SetDisconnected(const std::string& service_path) { - DBusThreadManager::Get()->GetShillServiceClient()->Disconnect( + ShillServiceClient::Get()->Disconnect( dbus::ObjectPath(service_path), base::DoNothing(), base::BindOnce(&ErrorCallbackFunction)); base::RunLoop().RunUntilIdle(); @@ -263,20 +264,15 @@ private: void AddService(const std::string& network_id, const std::string& type) { - DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface() - ->AddService(network_id /* service_path */, network_id /* guid */, - network_id /* name */, type, shill::kStateIdle, - true /* add_to_visible */); + network_handler_test_helper_->service_test()->AddService( + network_id /* service_path */, network_id /* guid */, + network_id /* name */, type, shill::kStateIdle, + true /* add_to_visible */); } void SetupDefaultShillState() { base::RunLoop().RunUntilIdle(); - DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface() - ->ClearServices(); + network_handler_test_helper_->service_test()->ClearServices(); AddService(kStubEthernet, shill::kTypeEthernet); AddService(kStubWireless1, shill::kTypeWifi); AddService(kStubWireless2, shill::kTypeWifi); @@ -284,11 +280,12 @@ } void SetupNetworkHandler() { + network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>(); SetupDefaultShillState(); - NetworkHandler::Initialize(); } content::BrowserTaskEnvironment task_environment_; + std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_; Profile* profile_ = nullptr; std::unique_ptr<NetworkPortalDetectorImpl> network_portal_detector_; std::unique_ptr<base::HistogramSamples> original_samples_;
diff --git a/chrome/browser/chromeos/net/network_pref_state_observer_unittest.cc b/chrome/browser/chromeos/net/network_pref_state_observer_unittest.cc index aeb4ea1..e2c97cef 100644 --- a/chrome/browser/chromeos/net/network_pref_state_observer_unittest.cc +++ b/chrome/browser/chromeos/net/network_pref_state_observer_unittest.cc
@@ -13,8 +13,8 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile_manager.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/proxy/ui_proxy_config_service.h" #include "components/onc/onc_constants.h" #include "components/prefs/pref_service.h" @@ -43,17 +43,12 @@ void SetUp() override { testing::Test::SetUp(); - DBusThreadManager::Initialize(); - NetworkHandler::Initialize(); - base::RunLoop().RunUntilIdle(); ASSERT_TRUE(profile_manager_.SetUp()); network_pref_state_observer_ = std::make_unique<NetworkPrefStateObserver>(); } void TearDown() override { network_pref_state_observer_.reset(); - NetworkHandler::Shutdown(); - DBusThreadManager::Shutdown(); testing::Test::TearDown(); } @@ -69,6 +64,7 @@ } content::BrowserTaskEnvironment task_environment_; + NetworkHandlerTestHelper network_handler_test_helper_; FakeChromeUserManager* fake_user_manager_; user_manager::ScopedUserManager user_manager_enabler_; TestingProfileManager profile_manager_;
diff --git a/chrome/browser/chromeos/net/network_throttling_observer_unittest.cc b/chrome/browser/chromeos/net/network_throttling_observer_unittest.cc index 5d022118..ff24fd7 100644 --- a/chrome/browser/chromeos/net/network_throttling_observer_unittest.cc +++ b/chrome/browser/chromeos/net/network_throttling_observer_unittest.cc
@@ -7,9 +7,8 @@ #include "base/test/task_environment.h" #include "chrome/browser/chromeos/net/network_throttling_observer.h" #include "chrome/common/pref_names.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/shill/shill_manager_client.h" -#include "chromeos/network/network_state_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h" @@ -21,9 +20,6 @@ class NetworkThrottlingObserverTest : public ::testing::Test { public: NetworkThrottlingObserverTest() { - DBusThreadManager::Initialize(); - network_state_handler_ = NetworkStateHandler::InitializeForTest(); - NetworkHandler::Initialize(); local_state_ = std::make_unique<TestingPrefServiceSimple>(); local_state_->registry()->RegisterDictionaryPref( prefs::kNetworkThrottlingEnabled); @@ -31,27 +27,21 @@ } ~NetworkThrottlingObserverTest() override { - network_state_handler_->Shutdown(); observer_.reset(); local_state_.reset(); - network_state_handler_.reset(); - NetworkHandler::Shutdown(); - DBusThreadManager::Shutdown(); } TestingPrefServiceSimple* local_state() { return local_state_.get(); } const ShillManagerClient::NetworkThrottlingStatus& GetNetworkThrottlingStatus() { - return DBusThreadManager::Get() - ->GetShillManagerClient() - ->GetTestInterface() + return network_handler_test_helper_.manager_test() ->GetNetworkThrottlingStatus(); } private: base::test::SingleThreadTaskEnvironment task_environment_; - std::unique_ptr<NetworkStateHandler> network_state_handler_; + NetworkHandlerTestHelper network_handler_test_helper_; std::unique_ptr<TestingPrefServiceSimple> local_state_; std::unique_ptr<NetworkThrottlingObserver> observer_;
diff --git a/chrome/browser/chromeos/net/system_proxy_manager_unittest.cc b/chrome/browser/chromeos/net/system_proxy_manager_unittest.cc index 6a24506..996af5f 100644 --- a/chrome/browser/chromeos/net/system_proxy_manager_unittest.cc +++ b/chrome/browser/chromeos/net/system_proxy_manager_unittest.cc
@@ -15,10 +15,10 @@ #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/system_proxy/system_proxy_client.h" #include "chromeos/dbus/system_proxy/system_proxy_service.pb.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/arc/arc_prefs.h" #include "components/prefs/pref_service.h" #include "components/proxy_config/proxy_config_pref_names.h" @@ -110,8 +110,7 @@ // testing::Test void SetUp() override { testing::Test::SetUp(); - shill_clients::InitializeFakes(); - NetworkHandler::Initialize(); + network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>(); LoginState::Initialize(); profile_ = std::make_unique<TestingProfile>(); @@ -129,8 +128,7 @@ system_proxy_manager_.reset(); LoginState::Shutdown(); SystemProxyClient::Shutdown(); - NetworkHandler::Shutdown(); - shill_clients::Shutdown(); + network_handler_test_helper_.reset(); } protected: @@ -147,6 +145,7 @@ } content::BrowserTaskEnvironment task_environment_; + std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_; ScopedTestingLocalState local_state_; std::unique_ptr<SystemProxyManager> system_proxy_manager_; std::unique_ptr<TestingProfile> profile_;
diff --git a/chrome/browser/chromeos/network_change_manager_client_unittest.cc b/chrome/browser/chromeos/network_change_manager_client_unittest.cc index f4f893f..9e7347a 100644 --- a/chrome/browser/chromeos/network_change_manager_client_unittest.cc +++ b/chrome/browser/chromeos/network_change_manager_client_unittest.cc
@@ -10,10 +10,8 @@ #include "base/stl_util.h" #include "base/strings/string_split.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state.h" #include "content/public/test/browser_task_environment.h" #include "net/base/network_change_notifier.h" @@ -118,14 +116,11 @@ EXPECT_EQ(net::NetworkChangeNotifier::CONNECTION_UNKNOWN, net::NetworkChangeNotifier::GetConnectionType()); - // Initialize DBus and clear services so NetworkHandler thinks we're offline. - DBusThreadManager::Initialize(); + // Initialize DBus clients and clear services so NetworkHandler thinks we're + // offline. PowerManagerClient::InitializeFake(); - NetworkHandler::Initialize(); - DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface() - ->ClearServices(); + NetworkHandlerTestHelper network_handler_test_helper; + network_handler_test_helper.service_test()->ClearServices(); auto client = std::make_unique<NetworkChangeManagerClient>( network_change_notifier.get()); @@ -138,9 +133,7 @@ net::NetworkChangeNotifier::GetConnectionType()); client.reset(); - NetworkHandler::Shutdown(); PowerManagerClient::Shutdown(); - DBusThreadManager::Shutdown(); } class NetworkChangeManagerClientUpdateTest : public testing::Test { @@ -150,9 +143,7 @@ void SetUp() override { network_change_notifier_ = net::NetworkChangeNotifier::CreateIfNeeded(); - DBusThreadManager::Initialize(); PowerManagerClient::InitializeFake(); - NetworkHandler::Initialize(); proxy_ = std::make_unique<NetworkChangeManagerClient>( static_cast<net::NetworkChangeNotifierPosix*>( network_change_notifier_.get())); @@ -160,9 +151,7 @@ void TearDown() override { proxy_.reset(); - NetworkHandler::Shutdown(); PowerManagerClient::Shutdown(); - DBusThreadManager::Shutdown(); network_change_notifier_.reset(); } @@ -217,6 +206,7 @@ private: content::BrowserTaskEnvironment task_environment_; + NetworkHandlerTestHelper network_handler_test_helper_; NetworkState default_network_; std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_; std::unique_ptr<NetworkChangeManagerClient> proxy_;
diff --git a/chrome/browser/chromeos/policy/arc_app_install_event_log_collector_unittest.cc b/chrome/browser/chromeos/policy/arc_app_install_event_log_collector_unittest.cc index 3d6bc27..13a4ec9 100644 --- a/chrome/browser/chromeos/policy/arc_app_install_event_log_collector_unittest.cc +++ b/chrome/browser/chromeos/policy/arc_app_install_event_log_collector_unittest.cc
@@ -18,10 +18,9 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/arc/mojom/app.mojom.h" #include "components/policy/proto/device_management_backend.pb.h" #include "components/prefs/pref_service.h" @@ -112,32 +111,28 @@ RegisterLocalState(pref_service_.registry()); TestingBrowserProcess::GetGlobal()->SetLocalState(&pref_service_); - chromeos::DBusThreadManager::Initialize(); chromeos::PowerManagerClient::InitializeFake(); - chromeos::NetworkHandler::Initialize(); profile_ = std::make_unique<TestingProfile>(); + arc_app_test_.SetUp(profile_.get()); - service_test_ = chromeos::DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface(); - service_test_->AddService(kEthernetServicePath, "eth1_guid", "eth1", - shill::kTypeEthernet, shill::kStateOffline, - true /* visible */); - service_test_->AddService(kWifiServicePath, "wifi1_guid", "wifi1", - shill::kTypeEthernet, shill::kStateOffline, - true /* visible */); + network_handler_test_helper_ = + std::make_unique<chromeos::NetworkHandlerTestHelper>(); + network_handler_test_helper_->service_test()->AddService( + kEthernetServicePath, "eth1_guid", "eth1", shill::kTypeEthernet, + shill::kStateOffline, true /* visible */); + network_handler_test_helper_->service_test()->AddService( + kWifiServicePath, "wifi1_guid", "wifi1", shill::kTypeEthernet, + shill::kStateOffline, true /* visible */); base::RunLoop().RunUntilIdle(); - arc_app_test_.SetUp(profile_.get()); } void TearDown() override { + network_handler_test_helper_.reset(); arc_app_test_.TearDown(); profile_.reset(); - chromeos::NetworkHandler::Shutdown(); chromeos::PowerManagerClient::Shutdown(); - chromeos::DBusThreadManager::Shutdown(); TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); } @@ -145,19 +140,21 @@ network::NetworkConnectionTracker::NetworkConnectionObserver* observer, const std::string& service_path, const std::string& state) { - service_test_->SetServiceProperty(service_path, shill::kStateProperty, - base::Value(state)); + network_handler_test_helper_->service_test()->SetServiceProperty( + service_path, shill::kStateProperty, base::Value(state)); base::RunLoop().RunUntilIdle(); network::mojom::ConnectionType connection_type = network::mojom::ConnectionType::CONNECTION_NONE; const std::string* network_state = - service_test_->GetServiceProperties(kWifiServicePath) + network_handler_test_helper_->service_test() + ->GetServiceProperties(kWifiServicePath) ->FindStringKey(shill::kStateProperty); if (network_state && *network_state == shill::kStateOnline) { connection_type = network::mojom::ConnectionType::CONNECTION_WIFI; } - network_state = service_test_->GetServiceProperties(kEthernetServicePath) + network_state = network_handler_test_helper_->service_test() + ->GetServiceProperties(kEthernetServicePath) ->FindStringKey(shill::kStateProperty); if (network_state && *network_state == shill::kStateOnline) { connection_type = network::mojom::ConnectionType::CONNECTION_ETHERNET; @@ -173,10 +170,10 @@ const std::set<std::string> packages_ = {kPackageName}; - chromeos::ShillServiceClient::TestInterface* service_test_ = nullptr; - private: content::BrowserTaskEnvironment task_environment_; + std::unique_ptr<chromeos::NetworkHandlerTestHelper> + network_handler_test_helper_; std::unique_ptr<TestingProfile> profile_; FakeAppInstallEventLogCollectorDelegate delegate_; TestingPrefServiceSimple pref_service_;
diff --git a/chrome/browser/chromeos/policy/arc_app_install_event_logger_unittest.cc b/chrome/browser/chromeos/policy/arc_app_install_event_logger_unittest.cc index 856bda2..58a1196 100644 --- a/chrome/browser/chromeos/policy/arc_app_install_event_logger_unittest.cc +++ b/chrome/browser/chromeos/policy/arc_app_install_event_logger_unittest.cc
@@ -15,10 +15,9 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chromeos/dbus/cros_disks_client.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/disks/disk_mount_manager.h" #include "chromeos/disks/mock_disk_mount_manager.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/arc/arc_prefs.h" #include "components/policy/policy_constants.h" #include "components/policy/proto/device_management_backend.pb.h" @@ -162,18 +161,13 @@ RegisterLocalState(pref_service_.registry()); TestingBrowserProcess::GetGlobal()->SetLocalState(&pref_service_); - chromeos::DBusThreadManager::Initialize(); chromeos::PowerManagerClient::InitializeFake(); - - chromeos::NetworkHandler::Initialize(); } void TearDown() override { logger_.reset(); task_environment_.RunUntilIdle(); chromeos::PowerManagerClient::Shutdown(); - chromeos::NetworkHandler::Shutdown(); - chromeos::DBusThreadManager::Shutdown(); TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); } @@ -223,6 +217,7 @@ } content::BrowserTaskEnvironment task_environment_; + chromeos::NetworkHandlerTestHelper network_handler_test_helper_; TestingProfile profile_; TestingPrefServiceSimple pref_service_;
diff --git a/chrome/browser/chromeos/policy/dlp/clipboard_bubble.cc b/chrome/browser/chromeos/policy/dlp/clipboard_bubble.cc index a43c9ab..d31b284 100644 --- a/chrome/browser/chromeos/policy/dlp/clipboard_bubble.cc +++ b/chrome/browser/chromeos/policy/dlp/clipboard_bubble.cc
@@ -10,12 +10,12 @@ #include "components/strings/grit/components_strings.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/text_utils.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace policy {
diff --git a/chrome/browser/chromeos/policy/dlp/clipboard_bubble.h b/chrome/browser/chromeos/policy/dlp/clipboard_bubble.h index a4066748..937aa75d 100644 --- a/chrome/browser/chromeos/policy/dlp/clipboard_bubble.h +++ b/chrome/browser/chromeos/policy/dlp/clipboard_bubble.h
@@ -8,8 +8,8 @@ #include <string> #include "base/callback.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/size.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/chromeos/policy/enrollment_requisition_manager.cc b/chrome/browser/chromeos/policy/enrollment_requisition_manager.cc index 34ee24b..c86ae71 100644 --- a/chrome/browser/chromeos/policy/enrollment_requisition_manager.cc +++ b/chrome/browser/chromeos/policy/enrollment_requisition_manager.cc
@@ -17,12 +17,6 @@ namespace { -// Well-known requisition types. -const char kNoRequisition[] = "none"; -const char kRemoraRequisition[] = "remora"; -const char kSharkRequisition[] = "shark"; -const char kRialtoRequisition[] = "rialto"; - // Fetches a machine statistic value from StatisticsProvider, returns an empty // string on failure. std::string GetMachineStatistic(const std::string& key) { @@ -50,6 +44,12 @@ } // namespace // static +const char EnrollmentRequisitionManager::kNoRequisition[] = "none"; +const char EnrollmentRequisitionManager::kRemoraRequisition[] = "remora"; +const char EnrollmentRequisitionManager::kSharkRequisition[] = "shark"; +const char EnrollmentRequisitionManager::kRialtoRequisition[] = "rialto"; + +// static void EnrollmentRequisitionManager::Initialize() { // OEM statistics are only loaded when OOBE is not completed. if (chromeos::StartupUtils::IsOobeCompleted())
diff --git a/chrome/browser/chromeos/policy/enrollment_requisition_manager.h b/chrome/browser/chromeos/policy/enrollment_requisition_manager.h index e110050..c5770f17 100644 --- a/chrome/browser/chromeos/policy/enrollment_requisition_manager.h +++ b/chrome/browser/chromeos/policy/enrollment_requisition_manager.h
@@ -21,6 +21,12 @@ EnrollmentRequisitionManager* operator=(const EnrollmentRequisitionManager&) = delete; + // Well-known requisition types. + static const char kNoRequisition[]; + static const char kRemoraRequisition[]; + static const char kSharkRequisition[]; + static const char kRialtoRequisition[]; + // Initializes requisition settings at OOBE with values from VPD. static void Initialize();
diff --git a/chrome/browser/chromeos/policy/extension_install_event_log_collector_unittest.cc b/chrome/browser/chromeos/policy/extension_install_event_log_collector_unittest.cc index a2b4b065a..c123847 100644 --- a/chrome/browser/chromeos/policy/extension_install_event_log_collector_unittest.cc +++ b/chrome/browser/chromeos/policy/extension_install_event_log_collector_unittest.cc
@@ -16,10 +16,9 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/policy/proto/device_management_backend.pb.h" #include "components/prefs/testing_pref_service.h" #include "components/user_manager/scoped_user_manager.h" @@ -127,31 +126,27 @@ RegisterLocalState(pref_service_.registry()); TestingBrowserProcess::GetGlobal()->SetLocalState(&pref_service_); - chromeos::DBusThreadManager::Initialize(); + network_handler_test_helper_ = + std::make_unique<chromeos::NetworkHandlerTestHelper>(); chromeos::PowerManagerClient::InitializeFake(); - chromeos::NetworkHandler::Initialize(); profile_ = std::make_unique<TestingProfile>(); registry_ = extensions::ExtensionRegistry::Get(profile_.get()); install_stage_tracker_ = extensions::InstallStageTracker::Get(profile_.get()); InitExtensionSystem(); - service_test_ = chromeos::DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface(); - service_test_->AddService(kEthernetServicePath, "eth1_guid", "eth1", - shill::kTypeEthernet, shill::kStateOffline, - true /* visible */); - service_test_->AddService(kWifiServicePath, "wifi1_guid", "wifi1", - shill::kTypeEthernet, shill::kStateOffline, - true /* visible */); + network_handler_test_helper_->service_test()->AddService( + kEthernetServicePath, "eth1_guid", "eth1", shill::kTypeEthernet, + shill::kStateOffline, true /* visible */); + network_handler_test_helper_->service_test()->AddService( + kWifiServicePath, "wifi1_guid", "wifi1", shill::kTypeEthernet, + shill::kStateOffline, true /* visible */); base::RunLoop().RunUntilIdle(); } void TearDown() override { profile_.reset(); - chromeos::NetworkHandler::Shutdown(); chromeos::PowerManagerClient::Shutdown(); - chromeos::DBusThreadManager::Shutdown(); + network_handler_test_helper_.reset(); TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); } @@ -169,19 +164,21 @@ network::NetworkConnectionTracker::NetworkConnectionObserver* observer, const std::string& service_path, const std::string& state) { - service_test_->SetServiceProperty(service_path, shill::kStateProperty, - base::Value(state)); + network_handler_test_helper_->service_test()->SetServiceProperty( + service_path, shill::kStateProperty, base::Value(state)); base::RunLoop().RunUntilIdle(); network::mojom::ConnectionType connection_type = network::mojom::ConnectionType::CONNECTION_NONE; const std::string* network_state = - service_test_->GetServiceProperties(kWifiServicePath) + network_handler_test_helper_->service_test() + ->GetServiceProperties(kWifiServicePath) ->FindStringKey(shill::kStateProperty); if (network_state && *network_state == shill::kStateOnline) { connection_type = network::mojom::ConnectionType::CONNECTION_WIFI; } - network_state = service_test_->GetServiceProperties(kEthernetServicePath) + network_state = network_handler_test_helper_->service_test() + ->GetServiceProperties(kEthernetServicePath) ->FindStringKey(shill::kStateProperty); if (network_state && *network_state == shill::kStateOnline) { connection_type = network::mojom::ConnectionType::CONNECTION_ETHERNET; @@ -223,10 +220,10 @@ return install_stage_tracker_; } - chromeos::ShillServiceClient::TestInterface* service_test_ = nullptr; - private: content::BrowserTaskEnvironment task_environment_; + std::unique_ptr<chromeos::NetworkHandlerTestHelper> + network_handler_test_helper_; std::unique_ptr<TestingProfile> profile_; extensions::ExtensionRegistry* registry_; extensions::InstallStageTracker* install_stage_tracker_;
diff --git a/chrome/browser/chromeos/policy/extension_install_event_logger_unittest.cc b/chrome/browser/chromeos/policy/extension_install_event_logger_unittest.cc index b0bc3e52..616fba3 100644 --- a/chrome/browser/chromeos/policy/extension_install_event_logger_unittest.cc +++ b/chrome/browser/chromeos/policy/extension_install_event_logger_unittest.cc
@@ -12,10 +12,9 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chromeos/dbus/cros_disks_client.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/disks/disk_mount_manager.h" #include "chromeos/disks/mock_disk_mount_manager.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/policy/policy_constants.h" #include "components/policy/proto/device_management_backend.pb.h" #include "components/prefs/testing_pref_service.h" @@ -144,18 +143,13 @@ RegisterLocalState(pref_service_.registry()); TestingBrowserProcess::GetGlobal()->SetLocalState(&pref_service_); - chromeos::DBusThreadManager::Initialize(); chromeos::PowerManagerClient::InitializeFake(); - - chromeos::NetworkHandler::Initialize(); } void TearDown() override { logger_.reset(); task_environment_.RunUntilIdle(); chromeos::PowerManagerClient::Shutdown(); - chromeos::NetworkHandler::Shutdown(); - chromeos::DBusThreadManager::Shutdown(); TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); } @@ -204,6 +198,7 @@ } content::BrowserTaskEnvironment task_environment_; + chromeos::NetworkHandlerTestHelper network_handler_test_helper_; TestingProfile profile_; TestingPrefServiceSimple pref_service_;
diff --git a/chrome/browser/chromeos/policy/minimum_version_policy_handler.cc b/chrome/browser/chromeos/policy/minimum_version_policy_handler.cc index 6ee1edd..d1af051 100644 --- a/chrome/browser/chromeos/policy/minimum_version_policy_handler.cc +++ b/chrome/browser/chromeos/policy/minimum_version_policy_handler.cc
@@ -23,7 +23,7 @@ #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/policy/minimum_version_policy_handler_delegate_impl.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/upgrade_detector/build_state.h" #include "chrome/browser/upgrade_detector/upgrade_detector.h" #include "chrome/common/pref_names.h" @@ -66,7 +66,7 @@ } void OpenEnterpriseInfoPage() { - SystemTrayClient::Get()->ShowEnterpriseInfo(); + SystemTrayClientImpl::Get()->ShowEnterpriseInfo(); } std::string GetEnterpriseManager() {
diff --git a/chrome/browser/chromeos/policy/minimum_version_policy_handler_unittest.cc b/chrome/browser/chromeos/policy/minimum_version_policy_handler_unittest.cc index c488338..1abeb16 100644 --- a/chrome/browser/chromeos/policy/minimum_version_policy_handler_unittest.cc +++ b/chrome/browser/chromeos/policy/minimum_version_policy_handler_unittest.cc
@@ -22,7 +22,7 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_update_engine_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/settings/cros_settings_names.h" #include "chromeos/tpm/stub_install_attributes.h" #include "components/prefs/pref_service.h" @@ -98,6 +98,8 @@ ash::ScopedTestingCrosSettings scoped_testing_cros_settings_; chromeos::ScopedStubInstallAttributes scoped_stub_install_attributes_; chromeos::FakeUpdateEngineClient* fake_update_engine_client_; + std::unique_ptr<chromeos::NetworkHandlerTestHelper> + network_handler_test_helper_; std::unique_ptr<base::Version> current_version_; std::unique_ptr<MinimumVersionPolicyHandler> minimum_version_policy_handler_; }; @@ -113,12 +115,11 @@ fake_update_engine_client_ = fake_update_engine_client.get(); chromeos::DBusThreadManager::GetSetterForTesting()->SetUpdateEngineClient( std::move(fake_update_engine_client)); - chromeos::NetworkHandler::Initialize(); + network_handler_test_helper_ = + std::make_unique<chromeos::NetworkHandlerTestHelper>(); chromeos::ShillServiceClient::TestInterface* service_test = - chromeos::DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface(); + network_handler_test_helper_->service_test(); service_test->ClearServices(); service_test->AddService("/service/eth", "eth" /* guid */, "eth", shill::kTypeEthernet, shill::kStateOnline, @@ -133,7 +134,7 @@ void MinimumVersionPolicyHandlerTest::TearDown() { minimum_version_policy_handler_.reset(); - chromeos::NetworkHandler::Shutdown(); + network_handler_test_helper_.reset(); } void MinimumVersionPolicyHandlerTest::CreateMinimumVersionHandler() {
diff --git a/chrome/browser/chromeos/policy/status_collector/device_status_collector_browsertest.cc b/chrome/browser/chromeos/policy/status_collector/device_status_collector_browsertest.cc index 1c1b51e..18d6f6f 100644 --- a/chrome/browser/chromeos/policy/status_collector/device_status_collector_browsertest.cc +++ b/chrome/browser/chromeos/policy/status_collector/device_status_collector_browsertest.cc
@@ -73,6 +73,7 @@ #include "chromeos/disks/mock_disk_mount_manager.h" #include "chromeos/login/login_state/login_state.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/settings/cros_settings_names.h" @@ -3730,21 +3731,12 @@ void SetUp() override { RestartStatusCollector(); - chromeos::NetworkHandler::Initialize(); - base::RunLoop().RunUntilIdle(); - chromeos::ShillDeviceClient::TestInterface* device_client = - chromeos::DBusThreadManager::Get() - ->GetShillDeviceClient() - ->GetTestInterface(); + network_handler_test_helper_.device_test(); chromeos::ShillServiceClient::TestInterface* service_client = - chromeos::DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface(); + network_handler_test_helper_.service_test(); chromeos::ShillIPConfigClient::TestInterface* ip_config_client = - chromeos::DBusThreadManager::Get() - ->GetShillIPConfigClient() - ->GetTestInterface(); + network_handler_test_helper_.ip_config_test(); device_client->ClearDevices(); service_client->ClearServices(); @@ -3768,10 +3760,8 @@ } } - chromeos::DBusThreadManager::Get() - ->GetShillProfileClient() - ->GetTestInterface() - ->AddProfile(kShillFakeProfilePath, kShillFakeUserhash); + network_handler_test_helper_.profile_test()->AddProfile( + kShillFakeProfilePath, kShillFakeUserhash); // Now add services for every fake network. for (const FakeNetworkState& fake_network : kFakeNetworks) { @@ -3842,11 +3832,13 @@ } void TearDown() override { - chromeos::NetworkHandler::Shutdown(); DeviceStatusCollectorTest::TearDown(); } virtual void VerifyReporting() = 0; + + private: + chromeos::NetworkHandlerTestHelper network_handler_test_helper_; }; class DeviceStatusCollectorNetworkInterfacesTest
diff --git a/chrome/browser/chromeos/policy/system_proxy_handler_unittest.cc b/chrome/browser/chromeos/policy/system_proxy_handler_unittest.cc index c8edc4d..90ee9cd4 100644 --- a/chrome/browser/chromeos/policy/system_proxy_handler_unittest.cc +++ b/chrome/browser/chromeos/policy/system_proxy_handler_unittest.cc
@@ -18,10 +18,10 @@ #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/system_proxy/system_proxy_client.h" #include "chromeos/dbus/system_proxy/system_proxy_service.pb.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/proxy_config/proxy_config_pref_names.h" #include "components/proxy_config/proxy_prefs.h" @@ -49,8 +49,8 @@ // testing::Test void SetUp() override { testing::Test::SetUp(); - chromeos::shill_clients::InitializeFakes(); - chromeos::NetworkHandler::Initialize(); + network_handler_test_helper_ = + std::make_unique<chromeos::NetworkHandlerTestHelper>(); chromeos::SystemProxyClient::InitializeFake(); system_proxy_handler_ = @@ -70,8 +70,7 @@ system_proxy_manager_->StopObservingPrimaryProfilePrefs(); system_proxy_manager_.reset(); chromeos::SystemProxyClient::Shutdown(); - chromeos::NetworkHandler::Shutdown(); - chromeos::shill_clients::Shutdown(); + network_handler_test_helper_.reset(); } protected: @@ -104,6 +103,8 @@ } content::BrowserTaskEnvironment task_environment_; + std::unique_ptr<chromeos::NetworkHandlerTestHelper> + network_handler_test_helper_; ScopedTestingLocalState local_state_; std::unique_ptr<TestingProfile> profile_; chromeos::ScopedTestingCrosSettings scoped_testing_cros_settings_;
diff --git a/chrome/browser/chromeos/power/idle_action_warning_dialog_view.cc b/chrome/browser/chromeos/power/idle_action_warning_dialog_view.cc index 91a3515..4751b4d 100644 --- a/chrome/browser/chromeos/power/idle_action_warning_dialog_view.cc +++ b/chrome/browser/chromeos/power/idle_action_warning_dialog_view.cc
@@ -14,13 +14,13 @@ #include "ui/aura/window_event_dispatcher.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/time_format.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/text_constants.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace chromeos {
diff --git a/chrome/browser/chromeos/power/idle_action_warning_dialog_view.h b/chrome/browser/chromeos/power/idle_action_warning_dialog_view.h index 9e9b2b35..2d7d2cd0 100644 --- a/chrome/browser/chromeos/power/idle_action_warning_dialog_view.h +++ b/chrome/browser/chromeos/power/idle_action_warning_dialog_view.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "base/time/time.h" #include "base/timer/timer.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace chromeos {
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index bc16522..3cc4e6b 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc
@@ -46,7 +46,7 @@ #include "chrome/browser/chromeos/input_method/input_method_syncer.h" #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/prefs/pref_service_syncable_util.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chromeos/settings/cros_settings_names.h" @@ -724,7 +724,7 @@ tracing_manager_ = ContentTracingManager::Create(); else tracing_manager_.reset(); - SystemTrayClient::Get()->SetPerformanceTracingIconVisible(enabled); + SystemTrayClientImpl::Get()->SetPerformanceTracingIconVisible(enabled); } if (reason != REASON_PREF_CHANGED || pref_name == ::prefs::kTapToClickEnabled) {
diff --git a/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc b/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc index 360ebc90..a11335ef 100644 --- a/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc +++ b/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc
@@ -17,10 +17,8 @@ #include "base/stl_util.h" #include "base/strings/stringprintf.h" #include "chrome/browser/ash/settings/scoped_cros_settings_test_helper.h" -#include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/shill/shill_profile_client.h" -#include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" @@ -262,9 +260,6 @@ ProxyConfigServiceImplTest() = default; void SetUp() override { - DBusThreadManager::Initialize(); - NetworkHandler::Initialize(); - PrefProxyConfigTrackerImpl::RegisterPrefs(pref_service_.registry()); ::onc::RegisterPrefs(pref_service_.registry()); PrefProxyConfigTrackerImpl::RegisterProfilePrefs(profile_prefs_.registry()); @@ -286,9 +281,9 @@ void SetUpPrivateWiFi() { ShillProfileClient::TestInterface* profile_test = - DBusThreadManager::Get()->GetShillProfileClient()->GetTestInterface(); + network_handler_test_helper_.profile_test(); ShillServiceClient::TestInterface* service_test = - DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); + network_handler_test_helper_.service_test(); // Process any pending notifications before clearing services. base::RunLoop().RunUntilIdle(); @@ -309,9 +304,9 @@ void SetUpSharedEthernet() { ShillProfileClient::TestInterface* profile_test = - DBusThreadManager::Get()->GetShillProfileClient()->GetTestInterface(); + network_handler_test_helper_.profile_test(); ShillServiceClient::TestInterface* service_test = - DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); + network_handler_test_helper_.service_test(); // Process any pending notifications before clearing services. base::RunLoop().RunUntilIdle(); @@ -334,8 +329,6 @@ base::RunLoop().RunUntilIdle(); config_service_impl_.reset(); proxy_config_service_.reset(); - NetworkHandler::Shutdown(); - DBusThreadManager::Shutdown(); } base::Value InitConfigWithTestInput(const Input& input) { @@ -364,11 +357,9 @@ NetworkHandler::Get()->network_state_handler(); const NetworkState* network = network_state_handler->DefaultNetwork(); ASSERT_TRUE(network); - DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface() - ->SetServiceProperty(network->path(), shill::kProxyConfigProperty, - base::Value(proxy_config)); + network_handler_test_helper_.service_test()->SetServiceProperty( + network->path(), shill::kProxyConfigProperty, + base::Value(proxy_config)); } // Synchronously gets the latest proxy config. @@ -385,6 +376,7 @@ } content::BrowserTaskEnvironment task_environment_; + NetworkHandlerTestHelper network_handler_test_helper_; std::unique_ptr<net::ProxyConfigService> proxy_config_service_; std::unique_ptr<ProxyConfigServiceImpl> config_service_impl_; TestingPrefServiceSimple pref_service_;
diff --git a/chrome/browser/chromeos/tether/tether_service_unittest.cc b/chrome/browser/chromeos/tether/tether_service_unittest.cc index bae4dca..2913f16 100644 --- a/chrome/browser/chromeos/tether/tether_service_unittest.cc +++ b/chrome/browser/chromeos/tether/tether_service_unittest.cc
@@ -28,7 +28,6 @@ #include "chromeos/components/tether/fake_tether_host_fetcher.h" #include "chromeos/components/tether/tether_component_impl.h" #include "chromeos/components/tether/tether_host_fetcher_impl.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/power/power_manager_client.h" #include "chromeos/dbus/power_manager/suspend.pb.h" @@ -37,6 +36,7 @@ #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/network/network_connect.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_type_pattern.h" #include "chromeos/services/device_sync/cryptauth_device_manager.h" @@ -306,12 +306,6 @@ fake_notification_presenter_ = nullptr; mock_timer_ = nullptr; - chromeos::DBusThreadManager::Initialize(); - manager_test_ = chromeos::DBusThreadManager::Get() - ->GetShillManagerClient() - ->GetTestInterface(); - - chromeos::NetworkHandler::Initialize(); chromeos::NetworkConnect::Initialize(nullptr); TestingProfile::Builder builder; @@ -408,8 +402,6 @@ chromeos::PowerManagerClient::Shutdown(); chromeos::NetworkConnect::Shutdown(); - chromeos::NetworkHandler::Shutdown(); - chromeos::DBusThreadManager::Shutdown(); } void SetPrimaryUserLoggedIn() { @@ -490,18 +482,16 @@ bool IsBluetoothPowered() { return is_adapter_powered_; } void RemoveWifiFromSystem() { - manager_test_->RemoveTechnology(shill::kTypeWifi); + manager_test()->RemoveTechnology(shill::kTypeWifi); base::RunLoop().RunUntilIdle(); } void DisconnectDefaultShillNetworks() { const chromeos::NetworkState* default_state; while ((default_state = network_state_handler()->DefaultNetwork())) { - chromeos::DBusThreadManager::Get() - ->GetShillServiceClient() - ->GetTestInterface() - ->SetServiceProperty(default_state->path(), shill::kStateProperty, - base::Value(shill::kStateIdle)); + network_handler_test_helper_.service_test()->SetServiceProperty( + default_state->path(), shill::kStateProperty, + base::Value(shill::kStateIdle)); base::RunLoop().RunUntilIdle(); } } @@ -529,7 +519,7 @@ } chromeos::ShillManagerClient::TestInterface* manager_test() { - return manager_test_; + return network_handler_test_helper_.manager_test(); } chromeos::NetworkStateHandler* network_state_handler() { @@ -539,6 +529,7 @@ const chromeos::multidevice::RemoteDeviceRefList test_devices_; const content::BrowserTaskEnvironment task_environment_; + chromeos::NetworkHandlerTestHelper network_handler_test_helper_; std::unique_ptr<TestingProfile> profile_; ash::FakeChromeUserManager* fake_chrome_user_manager_; std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_; @@ -580,8 +571,6 @@ base::HistogramTester histogram_tester_; - chromeos::ShillManagerClient::TestInterface* manager_test_ = nullptr; - private: DISALLOW_COPY_AND_ASSIGN(TetherServiceTest); };
diff --git a/chrome/browser/commerce/merchant_viewer/android/BUILD.gn b/chrome/browser/commerce/merchant_viewer/android/BUILD.gn index 2e17e98..2ae5a880 100644 --- a/chrome/browser/commerce/merchant_viewer/android/BUILD.gn +++ b/chrome/browser/commerce/merchant_viewer/android/BUILD.gn
@@ -122,6 +122,7 @@ testonly = true sources = [ + "javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabCoordinatorTest.java", "javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageViewTest.java", "javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustSignalsCoordinatorTest.java", "javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustSignalsEventLoadCallbackHelper.java", @@ -138,6 +139,7 @@ "//chrome/browser/tabmodel:java", "//chrome/test/android:chrome_java_test_support", "//components/browser_ui/bottomsheet/android:java", + "//components/embedder_support/android:content_view_java", "//components/messages/android:java", "//components/messages/android/internal:java", "//content/public/android:content_full_java",
diff --git a/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabCoordinator.java b/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabCoordinator.java index 4e59ec0..84a32e5 100644 --- a/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabCoordinator.java +++ b/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabCoordinator.java
@@ -6,6 +6,8 @@ import android.content.Context; import android.view.View; +import androidx.annotation.VisibleForTesting; + import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; @@ -30,9 +32,9 @@ private final BottomSheetController mBottomSheetController; private final Supplier<Tab> mTabSupplier; private final View mLayoutView; - private final MerchantTrustDetailsTabMediator mMediator; private final MerchantTrustMetrics mMetrics; + private MerchantTrustDetailsTabMediator mMediator; private WebContents mWebContents; private ContentView mWebContentView; private BottomSheetObserver mBottomSheetObserver; @@ -94,7 +96,11 @@ return tab.getView().getHeight(); } - private void destroyWebContents() { + @VisibleForTesting + void destroyWebContents() { + if (mSheetContent != null) { + mSheetContent.destroy(); + } mSheetContent = null; if (mWebContents != null) { @@ -174,4 +180,9 @@ mSheetContent.updateContentHeight(maxViewHeight); mCurrentMaxViewHeight = maxViewHeight; } + + @VisibleForTesting + void setMediatorForTesting(MerchantTrustDetailsTabMediator mediator) { + mMediator = mediator; + } } \ No newline at end of file
diff --git a/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabMediator.java b/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabMediator.java index 994d6e1..908662b 100644 --- a/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabMediator.java +++ b/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabMediator.java
@@ -173,4 +173,4 @@ private boolean isValidUrl(GURL url) { return UrlUtilitiesJni.get().isGoogleDomainUrl(url.getSpec(), true); } -} +} \ No newline at end of file
diff --git a/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageContext.java b/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageContext.java index c0c3f6a..5c85f51 100644 --- a/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageContext.java +++ b/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageContext.java
@@ -8,6 +8,7 @@ import org.chromium.content_public.browser.WebContents; import org.chromium.url.GURL; + /** * Additional data required for publishing and handling a merchant trust signals message. */
diff --git a/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageViewModel.java b/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageViewModel.java index 72ec588d..8dfd207e 100644 --- a/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageViewModel.java +++ b/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageViewModel.java
@@ -67,8 +67,7 @@ builder.append(" "); builder.append(context.getResources().getQuantityString( R.plurals.merchant_viewer_message_description_reviews, - trustSignals.getMerchantCountRating(), - numberFormatter.format(trustSignals.getMerchantCountRating()))); + trustSignals.getMerchantCountRating(), trustSignals.getMerchantCountRating())); return builder; }
diff --git a/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustSignalsCoordinator.java b/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustSignalsCoordinator.java index 481a82f..1c5afe2 100644 --- a/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustSignalsCoordinator.java +++ b/chrome/browser/commerce/merchant_viewer/android/java/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustSignalsCoordinator.java
@@ -49,7 +49,9 @@ this(context, windowAndroid, bottomSheetController, layoutView, tabModelSelector, new MerchantTrustMessageScheduler(messageDispatcher, metrics), tabSupplier, new MerchantTrustSignalsDataProvider(), - new MerchantTrustSignalsEventStorage(profileSupplier.get()), metrics); + new MerchantTrustSignalsEventStorage(profileSupplier.get()), metrics, + new MerchantTrustDetailsTabCoordinator(context, windowAndroid, + bottomSheetController, tabSupplier, layoutView, metrics)); } @VisibleForTesting @@ -57,7 +59,8 @@ BottomSheetController bottomSheetController, View layoutView, TabModelSelector tabModelSelector, MerchantTrustMessageScheduler messageScheduler, Supplier<Tab> tabSupplier, MerchantTrustSignalsDataProvider dataProvider, - MerchantTrustSignalsEventStorage storage, MerchantTrustMetrics metrics) { + MerchantTrustSignalsEventStorage storage, MerchantTrustMetrics metrics, + MerchantTrustDetailsTabCoordinator detailsTabCoordinator) { mContext = context; mWindowAndroid = windowAndroid; mBottomSheetController = bottomSheetController; @@ -68,8 +71,7 @@ mMediator = new MerchantTrustSignalsMediator(tabModelSelector, this::maybeDisplayMessage); mMessageScheduler = messageScheduler; - mDetailsTabCoordinator = new MerchantTrustDetailsTabCoordinator( - context, windowAndroid, bottomSheetController, tabSupplier, layoutView, mMetrics); + mDetailsTabCoordinator = detailsTabCoordinator; } /** Cleans up internal state. */ @@ -101,7 +103,8 @@ } } - private void onMessageEnqueued(MerchantTrustMessageContext messageContext) { + @VisibleForTesting + void onMessageEnqueued(MerchantTrustMessageContext messageContext) { if (messageContext == null) { return; }
diff --git a/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabCoordinatorTest.java b/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabCoordinatorTest.java new file mode 100644 index 0000000..fc4d750 --- /dev/null +++ b/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabCoordinatorTest.java
@@ -0,0 +1,169 @@ +// 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. + +package org.chromium.chrome.browser.merchant_viewer; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import android.app.Activity; +import android.view.View; +import android.view.View.OnLayoutChangeListener; + +import androidx.test.filters.SmallTest; + +import org.junit.After; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +import org.chromium.base.supplier.Supplier; +import org.chromium.base.test.util.Batch; +import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.chrome.browser.flags.ChromeSwitches; +import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.batch.BlankCTATabInitialStateRule; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetController.SheetState; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetController.StateChangeReason; +import org.chromium.components.browser_ui.bottomsheet.EmptyBottomSheetObserver; +import org.chromium.components.embedder_support.view.ContentView; +import org.chromium.content_public.browser.WebContents; +import org.chromium.content_public.browser.test.util.TestThreadUtils; +import org.chromium.ui.base.WindowAndroid; +import org.chromium.url.GURL; + +/** + * Tests for {@link MerchantTrustDetailsTabCoordinator}. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +@Batch(Batch.PER_CLASS) +@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) +public class MerchantTrustDetailsTabCoordinatorTest { + @ClassRule + public static final ChromeTabbedActivityTestRule sActivityTestRule = + new ChromeTabbedActivityTestRule(); + + @Rule + public final BlankCTATabInitialStateRule mBlankCTATabInitialStateRule = + new BlankCTATabInitialStateRule(sActivityTestRule, false); + + @Rule + public MockitoRule mMockitoRule = MockitoJUnit.rule(); + + @Mock + private BottomSheetController mMockBottomSheetController; + + @Mock + private View mMockDecorView; + + @Mock + private Supplier<Tab> mMockTabProvider; + + @Mock + private MerchantTrustMetrics mMockMetrics; + + @Mock + private GURL mMockGurl; + + @Mock + private MerchantTrustDetailsTabMediator mMockMediator; + + @Captor + private ArgumentCaptor<EmptyBottomSheetObserver> mBottomSheetObserverCaptor; + + @Captor + private ArgumentCaptor<MerchantTrustDetailsSheetContent> mSheetContentCaptor; + + private static final String DUMMY_SHEET_TITLE = "DUMMY_TITLE"; + + private Activity mActivity; + private WindowAndroid mWindowAndroid; + private MerchantTrustDetailsTabCoordinator mDetailsTabCoordinator; + + @Before + public void setUp() { + mActivity = sActivityTestRule.getActivity(); + TestThreadUtils.runOnUiThreadBlocking( + () -> { mWindowAndroid = new WindowAndroid(mActivity); }); + mDetailsTabCoordinator = new MerchantTrustDetailsTabCoordinator(mActivity, mWindowAndroid, + mMockBottomSheetController, mMockTabProvider, mMockDecorView, mMockMetrics); + mDetailsTabCoordinator.setMediatorForTesting(mMockMediator); + requestOpenSheetAndVerify(); + } + + @After + public void tearDown() { + TestThreadUtils.runOnUiThreadBlocking(() -> { + mDetailsTabCoordinator.destroyWebContents(); + mWindowAndroid.destroy(); + }); + } + + private void requestOpenSheetAndVerify() { + TestThreadUtils.runOnUiThreadBlocking( + () -> { mDetailsTabCoordinator.requestOpenSheet(mMockGurl, DUMMY_SHEET_TITLE); }); + verify(mMockBottomSheetController, times(1)) + .addObserver(mBottomSheetObserverCaptor.capture()); + verify(mMockMediator, times(1)) + .init(any(WebContents.class), any(ContentView.class), mSheetContentCaptor.capture(), + any(Profile.class)); + verify(mMockDecorView, times(1)) + .addOnLayoutChangeListener(any(OnLayoutChangeListener.class)); + verify(mMockMediator, times(1)).requestShowContent(any(GURL.class), eq(DUMMY_SHEET_TITLE)); + } + + @Test + @SmallTest + public void testClose() { + mDetailsTabCoordinator.close(); + verify(mMockBottomSheetController, times(1)) + .hideContent(eq(mSheetContentCaptor.getValue()), eq(true)); + } + + @Test + @SmallTest + public void testBottomSheetObserverOnSheetContentChanged() { + mBottomSheetObserverCaptor.getValue().onSheetClosed(StateChangeReason.BACK_PRESS); + TestThreadUtils.runOnUiThreadBlocking( + () -> { mBottomSheetObserverCaptor.getValue().onSheetContentChanged(null); }); + verify(mMockMetrics, times(1)) + .recordMetricsForBottomSheetClosed(eq(StateChangeReason.BACK_PRESS)); + verify(mMockMediator, times(1)).destroyContent(); + verify(mMockDecorView, times(1)) + .removeOnLayoutChangeListener(any(OnLayoutChangeListener.class)); + verify(mMockBottomSheetController, times(1)) + .removeObserver(eq(mBottomSheetObserverCaptor.getValue())); + } + + @Test + @SmallTest + public void testBottomSheetObserverOnSheetOpened() { + mBottomSheetObserverCaptor.getValue().onSheetOpened(StateChangeReason.PROMOTE_TAB); + verify(mMockMetrics, times(1)).recordMetricsForBottomSheetHalfOpened(); + } + + @Test + @SmallTest + public void testBottomSheetObserverOnSheetStateChanged() { + mBottomSheetObserverCaptor.getValue().onSheetStateChanged(SheetState.PEEK); + verify(mMockMetrics, times(1)).recordMetricsForBottomSheetPeeked(); + mBottomSheetObserverCaptor.getValue().onSheetStateChanged(SheetState.HALF); + verify(mMockMetrics, times(1)).recordMetricsForBottomSheetHalfOpened(); + mBottomSheetObserverCaptor.getValue().onSheetStateChanged(SheetState.FULL); + verify(mMockMetrics, times(1)).recordMetricsForBottomSheetFullyOpened(); + } +} \ No newline at end of file
diff --git a/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabMediatorTest.java b/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabMediatorTest.java index 5b9b2d9..b3e8962 100644 --- a/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabMediatorTest.java +++ b/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustDetailsTabMediatorTest.java
@@ -39,7 +39,9 @@ import org.chromium.components.security_state.SecurityStateModelJni; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.NavigationController; +import org.chromium.content_public.browser.NavigationHandle; import org.chromium.content_public.browser.WebContents; +import org.chromium.content_public.browser.WebContentsObserver; import org.chromium.url.GURL; /** @@ -80,9 +82,15 @@ @Mock private MerchantTrustMetrics mMockMetrics; + @Mock + private NavigationHandle mMockNavigationHandle; + @Captor private ArgumentCaptor<WebContentsDelegateAndroid> mWebContentsDelegateCaptor; + @Captor + private ArgumentCaptor<WebContentsObserver> mWebContentsObserverCaptor; + private static final String DUMMY_SHEET_TITLE = "DUMMY_TITLE"; private static final String DUMMY_URL = "dummy://visible/url"; @@ -211,6 +219,69 @@ verify(mMockSheetContent, times(1)).setProgressVisible(eq(true)); } + @Test + public void testWebContentsObserverLoadProgressChanged() { + MerchantTrustDetailsTabMediator instance = getMediatorUnderTest(); + instance.init(mMockWebContents, mMockContentView, mMockSheetContent, mMockProfile); + verify(mMockWebContents, times(1)).addObserver(mWebContentsObserverCaptor.capture()); + + float progress = 0.2f; + mWebContentsObserverCaptor.getValue().loadProgressChanged(progress); + verify(mMockSheetContent, times(1)).setProgress(eq(progress)); + } + + @Test + public void testWebContentsObserverDidStartNavigation() { + MerchantTrustDetailsTabMediator instance = getMediatorUnderTest(); + instance.init(mMockWebContents, mMockContentView, mMockSheetContent, mMockProfile); + verify(mMockWebContents, times(1)).addObserver(mWebContentsObserverCaptor.capture()); + + mWebContentsObserverCaptor.getValue().didStartNavigation(mMockNavigationHandle); + verify(mMockMetrics, times(1)).recordNavigateLinkOnBottomSheet(); + } + + @Test + public void testWebContentsObserverTitleWasSet() { + MerchantTrustDetailsTabMediator instance = getMediatorUnderTest(); + instance.init(mMockWebContents, mMockContentView, mMockSheetContent, mMockProfile); + verify(mMockWebContents, times(1)).addObserver(mWebContentsObserverCaptor.capture()); + + MerchantViewerConfig.TRUST_SIGNALS_SHEET_USE_PAGE_TITLE.setForTesting(false); + mWebContentsObserverCaptor.getValue().titleWasSet(DUMMY_SHEET_TITLE); + verify(mMockSheetContent, times(0)).setTitle(eq(DUMMY_SHEET_TITLE)); + + MerchantViewerConfig.TRUST_SIGNALS_SHEET_USE_PAGE_TITLE.setForTesting(true); + mWebContentsObserverCaptor.getValue().titleWasSet(DUMMY_SHEET_TITLE); + verify(mMockSheetContent, times(1)).setTitle(eq(DUMMY_SHEET_TITLE)); + } + + @Test + public void testWebContentsObserverDidFinishNavigation() { + MerchantTrustDetailsTabMediator instance = getMediatorUnderTest(); + instance.init(mMockWebContents, mMockContentView, mMockSheetContent, mMockProfile); + verify(mMockWebContents, times(1)).addObserver(mWebContentsObserverCaptor.capture()); + + doReturn(false).when(mMockNavigationHandle).isInMainFrame(); + doReturn(false).when(mMockNavigationHandle).hasCommitted(); + mWebContentsObserverCaptor.getValue().didFinishNavigation(mMockNavigationHandle); + verify(mMockSheetContent, times(0)).setUrl(any(GURL.class)); + + doReturn(true).when(mMockNavigationHandle).isInMainFrame(); + doReturn(false).when(mMockNavigationHandle).hasCommitted(); + mWebContentsObserverCaptor.getValue().didFinishNavigation(mMockNavigationHandle); + verify(mMockSheetContent, times(0)).setUrl(any(GURL.class)); + + doReturn(false).when(mMockNavigationHandle).isInMainFrame(); + doReturn(true).when(mMockNavigationHandle).hasCommitted(); + mWebContentsObserverCaptor.getValue().didFinishNavigation(mMockNavigationHandle); + verify(mMockSheetContent, times(0)).setUrl(any(GURL.class)); + + doReturn(true).when(mMockNavigationHandle).isInMainFrame(); + doReturn(true).when(mMockNavigationHandle).hasCommitted(); + mWebContentsObserverCaptor.getValue().didFinishNavigation(mMockNavigationHandle); + verify(mMockSheetContent, times(1)).setUrl(any(GURL.class)); + } + private MerchantTrustDetailsTabMediator getMediatorUnderTest() { return new MerchantTrustDetailsTabMediator(mMockBottomSheetController, 100, mMockMetrics); }
diff --git a/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageContextTest.java b/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageContextTest.java index 265f154b..de27b8c6 100644 --- a/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageContextTest.java +++ b/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustMessageContextTest.java
@@ -4,6 +4,7 @@ package org.chromium.chrome.browser.merchant_viewer; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.doReturn; @@ -81,4 +82,23 @@ MerchantTrustMessageContext context = new MerchantTrustMessageContext(mMockGurl, null); assertFalse(context.isValid()); } + + @Test + public void testGetHostName() { + assertEquals("", (new MerchantTrustMessageContext(null, mMockWebContents)).getHostName()); + assertEquals("fake_host", + (new MerchantTrustMessageContext(mMockGurl, mMockWebContents)).getHostName()); + } + + @Test + public void testGetWebContents() { + assertEquals(mMockWebContents, + (new MerchantTrustMessageContext(mMockGurl, mMockWebContents)).getWebContents()); + } + + @Test + public void testGetUrl() { + assertEquals( + mMockGurl, (new MerchantTrustMessageContext(mMockGurl, mMockWebContents)).getUrl()); + } } \ No newline at end of file
diff --git a/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustSignalsCoordinatorTest.java b/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustSignalsCoordinatorTest.java index a964974..9b9e68b 100644 --- a/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustSignalsCoordinatorTest.java +++ b/chrome/browser/commerce/merchant_viewer/android/javatests/src/org/chromium/chrome/browser/merchant_viewer/MerchantTrustSignalsCoordinatorTest.java
@@ -131,6 +131,9 @@ @Mock private MerchantTrustSignalsEvent mMockMerchantTrustSignalsEvent; + @Mock + private MerchantTrustDetailsTabCoordinator mMockDetailsTabCoordinator; + @Captor private ArgumentCaptor<Callback> mOnMessageEnqueuedCallbackCaptor; @@ -144,6 +147,7 @@ public void setUp() { MockitoAnnotations.initMocks(this); doReturn(mTabModelFilterProvider).when(mMockTabModelSelector).getTabModelFilterProvider(); + doReturn("Test").when(mMockResources).getString(anyInt()); doReturn("Test").when(mMockResources).getString(anyInt(), anyObject()); doReturn("Test").when(mMockResources).getQuantityString(anyInt(), anyInt(), anyObject()); doReturn(100).when(mMockResources).getDimensionPixelSize(any(Integer.class)); @@ -318,12 +322,33 @@ @SmallTest @Test + public void testOnMessageEnqueued() { + MerchantTrustSignalsCoordinator coordinator = getCoordinatorUnderTest(); + coordinator.onMessageEnqueued(null); + verify(mMockMerchantTrustStorage, times(0)).save(any(MerchantTrustSignalsEvent.class)); + + coordinator.onMessageEnqueued(new MerchantTrustMessageContext(mMockGurl, mMockWebContents)); + verify(mMockMerchantTrustStorage, times(1)).save(any(MerchantTrustSignalsEvent.class)); + } + + @SmallTest + @Test public void testOnMessageDismissed() { MerchantTrustSignalsCoordinator coordinator = getCoordinatorUnderTest(); coordinator.onMessageDismissed(DismissReason.TIMER); verify(mMockMetrics, times(1)).recordMetricsForMessageDismissed(eq(DismissReason.TIMER)); } + @SmallTest + @Test + public void testOnMessagePrimaryAction() { + MerchantTrustSignalsCoordinator coordinator = getCoordinatorUnderTest(); + coordinator.onMessagePrimaryAction(mDummyMerchantTrustSignals); + verify(mMockMetrics, times(1)).recordMetricsForMessageTapped(); + verify(mMockDetailsTabCoordinator, times(1)) + .requestOpenSheet(any(GURL.class), any(String.class)); + } + private void setMockTrustSignalsData(MerchantTrustSignals trustSignalsData) { doAnswer(new Answer<Void>() { @Override @@ -354,6 +379,6 @@ return new MerchantTrustSignalsCoordinator(mMockContext, mMockWindowAndroid, mMockBottomSheetController, mMockDecorView, mMockTabModelSelector, mMockMerchantMessageScheduler, mMockTabProvider, mMockMerchantTrustDataProvider, - mMockMerchantTrustStorage, mMockMetrics); + mMockMerchantTrustStorage, mMockMetrics, mMockDetailsTabCoordinator); } } \ No newline at end of file
diff --git a/chrome/browser/component_updater/soda_component_installer.cc b/chrome/browser/component_updater/soda_component_installer.cc index 8c583457..acb2617 100644 --- a/chrome/browser/component_updater/soda_component_installer.cc +++ b/chrome/browser/component_updater/soda_component_installer.cc
@@ -239,10 +239,11 @@ } } -void RegisterSodaLanguageComponent(ComponentUpdateService* cus, - PrefService* profile_prefs, - PrefService* global_prefs, - base::OnceClosure on_ready_callback) { +void RegisterSodaLanguageComponent( + ComponentUpdateService* cus, + PrefService* profile_prefs, + PrefService* global_prefs, + OnSodaLanguagePackComponentReadyCallback on_ready_callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (base::FeatureList::IsEnabled(media::kUseSodaForLiveCaption) &&
diff --git a/chrome/browser/component_updater/soda_component_installer.h b/chrome/browser/component_updater/soda_component_installer.h index 8ca3018..dd99cd9 100644 --- a/chrome/browser/component_updater/soda_component_installer.h +++ b/chrome/browser/component_updater/soda_component_installer.h
@@ -9,6 +9,7 @@ #include "components/component_updater/component_installer.h" #include "components/prefs/pref_service.h" +#include "components/soda/constants.h" #include "components/update_client/update_client.h" namespace component_updater { @@ -18,6 +19,8 @@ base::RepeatingCallback<void(const base::FilePath&)>; using OnSodaComponentReadyCallback = base::OnceClosure; +using OnSodaLanguagePackComponentReadyCallback = + base::OnceCallback<void(speech::LanguageCode)>; class SodaComponentInstallerPolicy : public ComponentInstallerPolicy { public: @@ -69,10 +72,11 @@ base::OnceClosure on_registered_callback); // Should only be called by SodaInstaller. -void RegisterSodaLanguageComponent(ComponentUpdateService* cus, - PrefService* profile_prefs, - PrefService* global_prefs, - base::OnceClosure on_ready_callback); +void RegisterSodaLanguageComponent( + ComponentUpdateService* cus, + PrefService* profile_prefs, + PrefService* global_prefs, + OnSodaLanguagePackComponentReadyCallback on_ready_callback); } // namespace component_updater
diff --git a/chrome/browser/component_updater/soda_language_pack_component_installer.cc b/chrome/browser/component_updater/soda_language_pack_component_installer.cc index 56f002a..e2bb1eb3 100644 --- a/chrome/browser/component_updater/soda_language_pack_component_installer.cc +++ b/chrome/browser/component_updater/soda_language_pack_component_installer.cc
@@ -129,7 +129,7 @@ on_installed_callback_.Run(install_dir); if (on_ready_callback_) - std::move(on_ready_callback_).Run(); + std::move(on_ready_callback_).Run(language_config_.language_code); } base::FilePath SodaLanguagePackComponentInstallerPolicy::GetRelativeInstallDir() @@ -172,7 +172,7 @@ speech::SodaLanguagePackComponentConfig language_config, ComponentUpdateService* cus, PrefService* prefs, - base::OnceClosure on_ready_callback) { + OnSodaLanguagePackComponentReadyCallback on_ready_callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); auto installer = base::MakeRefCounted<ComponentInstaller>(
diff --git a/chrome/browser/component_updater/soda_language_pack_component_installer.h b/chrome/browser/component_updater/soda_language_pack_component_installer.h index 31d70cf..74555f7 100644 --- a/chrome/browser/component_updater/soda_language_pack_component_installer.h +++ b/chrome/browser/component_updater/soda_language_pack_component_installer.h
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/containers/flat_set.h" +#include "chrome/browser/component_updater/soda_component_installer.h" #include "components/component_updater/component_installer.h" #include "components/soda/constants.h" #include "components/update_client/update_client.h" @@ -26,8 +27,6 @@ using OnSodaLanguagePackComponentInstalledCallback = base::RepeatingCallback<void(const base::FilePath&)>; -using OnSodaLanguagePackComponentReadyCallback = base::OnceClosure; - class SodaLanguagePackComponentInstallerPolicy : public ComponentInstallerPolicy { public: @@ -78,7 +77,7 @@ speech::SodaLanguagePackComponentConfig language_config, ComponentUpdateService* cus, PrefService* prefs, - base::OnceClosure on_ready_callback); + OnSodaLanguagePackComponentReadyCallback on_ready_callback); } // namespace component_updater
diff --git a/chrome/browser/content_creation/notes/android/BUILD.gn b/chrome/browser/content_creation/notes/android/BUILD.gn new file mode 100644 index 0000000..7f283c8 --- /dev/null +++ b/chrome/browser/content_creation/notes/android/BUILD.gn
@@ -0,0 +1,16 @@ +# 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("//build/config/android/rules.gni") +import("//chrome/android/features/android_library_factory_tmpl.gni") + +android_library("public_java") { + sources = [ "java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinator.java" ] +} + +android_library_factory("factory_java") { + deps = [ ":public_java" ] + + sources = [ "//chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinatorFactory.java" ] +}
diff --git a/chrome/browser/content_creation/notes/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinator.java b/chrome/browser/content_creation/notes/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinator.java new file mode 100644 index 0000000..cc66ce0 --- /dev/null +++ b/chrome/browser/content_creation/notes/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinator.java
@@ -0,0 +1,24 @@ +// Copyright 2020 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.content_creation.notes; + +import android.app.Activity; + +/** + * Public interface note creation component that is responsible for notes main UI and its + * subcomponents. + */ +public interface NoteCreationCoordinator { + /** + * Initializes the note creation coordinator and its sub components. + * @param activity A {@link Activity} to create views and retrieve resources. + */ + void initialize(Activity activity); + + /** + * Displays the main dialog for note creation. + */ + void showDialog(); +} \ No newline at end of file
diff --git a/chrome/browser/content_creation/notes/internal/BUILD.gn b/chrome/browser/content_creation/notes/internal/BUILD.gn index 1310f25..3b67d3d6 100644 --- a/chrome/browser/content_creation/notes/internal/BUILD.gn +++ b/chrome/browser/content_creation/notes/internal/BUILD.gn
@@ -14,8 +14,6 @@ ] if (is_android) { - sources += [ "android/note_service_bridge_factory.cc" ] - deps += [ "//chrome/browser/content_creation/notes/internal/android:jni_headers", ]
diff --git a/chrome/browser/content_creation/notes/internal/android/BUILD.gn b/chrome/browser/content_creation/notes/internal/android/BUILD.gn index e7018d73..d043434 100644 --- a/chrome/browser/content_creation/notes/internal/android/BUILD.gn +++ b/chrome/browser/content_creation/notes/internal/android/BUILD.gn
@@ -11,23 +11,37 @@ "//chrome/android:chrome_all_java", ] - sources = [ "android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteServiceFactory.java" ] - - deps = [ - "//base:base_java", - "//chrome/browser/profiles/android:java", - "//components/content_creation/notes/android:java", + sources = [ + "java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinatorFactory.java", + "java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinatorImpl.java", + "java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationDialog.java", + "java/src/org/chromium/chrome/browser/content_creation/notes/top_bar/TopBarCoordinator.java", + "java/src/org/chromium/chrome/browser/content_creation/notes/top_bar/TopBarView.java", ] - - resources_package = "org.chromium.chrome.browser.content_creation.notes" - annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] + deps = [ + ":java_resources", + "//base:base_java", + "//chrome/browser/content_creation/notes/android:public_java", + "//chrome/browser/profiles/android:java", + "//components/browser_ui/styles/android:java_resources", + "//components/content_creation/notes/android:java", + "//third_party/android_deps:android_support_v7_appcompat_java", + ] + resources_package = "org.chromium.chrome.browser.content_creation.internal" } generate_jni("jni_headers") { visibility = [ - ":*", "//chrome/browser", + "//chrome/browser/content_creation/notes/internal:*", ] - sources = [ "android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteServiceFactory.java" ] + sources = [ "java/src/org/chromium/chrome/browser/content_creation/notes/NoteServiceFactory.java" ] +} + +android_resources("java_resources") { + sources = [ + "java/res/layout/creation_dialog.xml", + "java/res/layout/top_bar.xml", + ] }
diff --git a/chrome/browser/content_creation/notes/internal/android/java/res/layout/creation_dialog.xml b/chrome/browser/content_creation/notes/internal/android/java/res/layout/creation_dialog.xml new file mode 100644 index 0000000..c640c9e --- /dev/null +++ b/chrome/browser/content_creation/notes/internal/android/java/res/layout/creation_dialog.xml
@@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- 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. --> + +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/default_bg_color" + android:orientation="vertical"> + + <include layout="@layout/top_bar"/> + +</LinearLayout> \ No newline at end of file
diff --git a/chrome/browser/content_creation/notes/internal/android/java/res/layout/top_bar.xml b/chrome/browser/content_creation/notes/internal/android/java/res/layout/top_bar.xml new file mode 100644 index 0000000..a30312ce --- /dev/null +++ b/chrome/browser/content_creation/notes/internal/android/java/res/layout/top_bar.xml
@@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- 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. --> + +<org.chromium.chrome.browser.content_creation.notes.top_bar.TopBarView + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/top_bar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/default_bg_color"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="56dp" + android:layout_weight="2" + android:baselineAligned="false" + android:orientation="horizontal"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" + android:gravity="center_vertical|start" + android:orientation="horizontal"> + + <org.chromium.ui.widget.ChromeImageButton + android:id="@+id/close" + style="@style/ToolbarButton" + android:src="@drawable/btn_close" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="24dp" + android:contentDescription="@string/close" + android:gravity="center_vertical|start"/> + </LinearLayout> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" + android:gravity="center_vertical|end" + android:orientation="horizontal"> + + <org.chromium.ui.widget.ButtonCompat + android:id="@+id/next" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="24dp" + android:ellipsize="end" + android:gravity="center_vertical|end" + android:text="@string/next" + style="@style/TextButton"/> + + </LinearLayout> + </LinearLayout> + +</org.chromium.chrome.browser.content_creation.notes.top_bar.TopBarView> \ No newline at end of file
diff --git a/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinatorFactory.java b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinatorFactory.java new file mode 100644 index 0000000..b4cecc6 --- /dev/null +++ b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinatorFactory.java
@@ -0,0 +1,17 @@ +// 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. + +package org.chromium.chrome.browser.content_creation.notes; + +/** + * Factory for creating instances of the NoteCreationCoordinatorImpl. + */ +public class NoteCreationCoordinatorFactory { + /** + * @return a NoteCreationCoordinator instance. + */ + public static NoteCreationCoordinator create() { + return new NoteCreationCoordinatorImpl(); + } +}
diff --git a/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinatorImpl.java b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinatorImpl.java new file mode 100644 index 0000000..3846fe1 --- /dev/null +++ b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationCoordinatorImpl.java
@@ -0,0 +1,51 @@ +// 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. + +package org.chromium.chrome.browser.content_creation.notes; + +import android.app.Activity; +import android.view.View; + +import androidx.fragment.app.FragmentActivity; + +import org.chromium.chrome.browser.content_creation.notes.top_bar.TopBarCoordinator; + +/** + * Responsible for notes main UI and its subcomponents. + */ +public class NoteCreationCoordinatorImpl implements NoteCreationCoordinator { + private Activity mActivity; + private NoteCreationDialog mDialog; + private TopBarCoordinator mTopBarCoordinator; + + @Override + public void initialize(Activity activity) { + mActivity = activity; + mDialog = new NoteCreationDialog(); + mDialog.initDialog(this::onViewCreated); + } + + @Override + public void showDialog() { + if (mDialog != null) { + FragmentActivity fragmentActivity = (FragmentActivity) mActivity; + mDialog.show(fragmentActivity.getSupportFragmentManager(), null); + } + } + + /** + * Dismiss the main dialog. + */ + public void dismissDialog() { + if (mDialog != null) mDialog.dismiss(); + } + + /** + * Initializes the top bar after the parent view is ready. + * @param view A {@link View} to corresponding to the parent view for the top bar. + */ + private void onViewCreated(View view) { + mTopBarCoordinator = new TopBarCoordinator(mActivity, view, this::dismissDialog); + } +}
diff --git a/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationDialog.java b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationDialog.java new file mode 100644 index 0000000..a906c9cd --- /dev/null +++ b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/NoteCreationDialog.java
@@ -0,0 +1,41 @@ +// 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. + +package org.chromium.chrome.browser.content_creation.notes; + +import android.app.Dialog; +import android.os.Bundle; +import android.view.View; + +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; + +import org.chromium.chrome.browser.content_creation.internal.R; + +/** + * Dialog for the note creation. + */ +public class NoteCreationDialog extends DialogFragment { + interface NoteDialogObserver { + void onViewCreated(View view); + } + private NoteDialogObserver mNoteDialogObserver; + + public void initDialog(NoteDialogObserver noteDialogObserver) { + mNoteDialogObserver = noteDialogObserver; + } + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + AlertDialog.Builder builder = + new AlertDialog.Builder(getActivity(), R.style.Theme_Chromium_Fullscreen); + View contentView = + getActivity().getLayoutInflater().inflate(R.layout.creation_dialog, null); + builder.setView(contentView); + + if (mNoteDialogObserver != null) mNoteDialogObserver.onViewCreated(contentView); + + return builder.create(); + } +} \ No newline at end of file
diff --git a/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/top_bar/TopBarCoordinator.java b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/top_bar/TopBarCoordinator.java new file mode 100644 index 0000000..79cd334 --- /dev/null +++ b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/top_bar/TopBarCoordinator.java
@@ -0,0 +1,19 @@ +// 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. +package org.chromium.chrome.browser.content_creation.notes.top_bar; + +import android.content.Context; +import android.view.View; + +import org.chromium.chrome.browser.content_creation.internal.R; + +/** + * Coordinator for the TopBar. + */ +public class TopBarCoordinator { + public TopBarCoordinator(Context context, View parentView, Runnable closeButtonRunnable) { + TopBarView topBarView = (TopBarView) parentView.findViewById(R.id.top_bar); + topBarView.setOnCloseListener(closeButtonRunnable); + } +} \ No newline at end of file
diff --git a/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/top_bar/TopBarView.java b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/top_bar/TopBarView.java new file mode 100644 index 0000000..aa5591e --- /dev/null +++ b/chrome/browser/content_creation/notes/internal/android/java/src/org/chromium/chrome/browser/content_creation/notes/top_bar/TopBarView.java
@@ -0,0 +1,27 @@ +// Copyright 2020 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.content_creation.notes.top_bar; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.View; +import android.widget.FrameLayout; + +import org.chromium.chrome.browser.content_creation.internal.R; + +/** + * The view for the top bar. + */ +public class TopBarView extends FrameLayout { + public TopBarView(Context context, AttributeSet attrs) { + super(context, attrs); + } + + // Set listener for close button. + void setOnCloseListener(Runnable listener) { + View button = findViewById(R.id.close); + button.setOnClickListener(v -> listener.run()); + } +} \ No newline at end of file
diff --git a/chrome/browser/content_creation/notes/internal/android/note_service_bridge_factory.cc b/chrome/browser/content_creation/notes/internal/android/note_service_bridge_factory.cc index 7ceaaf74..a64d210 100644 --- a/chrome/browser/content_creation/notes/internal/android/note_service_bridge_factory.cc +++ b/chrome/browser/content_creation/notes/internal/android/note_service_bridge_factory.cc
@@ -3,8 +3,8 @@ // found in the LICENSE file. #include "base/android/jni_android.h" -#include "chrome/browser/content_creation/internal/jni_headers/NoteServiceFactory_jni.h" -#include "chrome/browser/content_creation/internal/note_service_factory.h" +#include "chrome/browser/content_creation/notes/internal/android/jni_headers/NoteServiceFactory_jni.h" +#include "chrome/browser/content_creation/notes/internal/note_service_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_android.h" #include "chrome/browser/profiles/profile_key.h" @@ -24,7 +24,7 @@ return base::android::ScopedJavaLocalRef<jobject>(); content_creation::NoteService* note_service = - NoteServiceFactory::GetInstance()->GetForKey(profile_key); + NoteServiceFactory::GetInstance()->GetServiceInstance(profile_key); return content_creation::NoteServiceBridge::GetBridgeForNoteService( note_service); }
diff --git a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc index 9c98589..f938b68 100644 --- a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc +++ b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc
@@ -907,6 +907,8 @@ TEST_F(ChromeDownloadManagerDelegateTest, BlockedAsActiveContent_BenignExtensionsIgnored) { // Verifies benign extensions are not blocked for active content blocking. + // As of M89, there are no 'safe' extensions, so this test only works if the + // extension is explicitly allowlisted (and will be removed soon). const GURL kFooUrl("http://example.com/file.foo"); const auto kSecureOrigin = Origin::Create(GURL("https://example.org")); @@ -920,7 +922,9 @@ PrepareDownloadItemForMixedContent(kFooUrl, kSecureOrigin, base::nullopt); VerifyMixedContentExtensionOverride( - foo_download_item.get(), {{"TreatWarnListAsAllowlist", "false"}}, + foo_download_item.get(), + {{"TreatSilentBlockListAsAllowlist", "true"}, + {"SilentBlockExtensionList", "foo"}}, InsecureDownloadExtensions::kUnknown, download::DOWNLOAD_INTERRUPT_REASON_NONE, download::DownloadItem::MixedContentStatus::SAFE); @@ -963,12 +967,9 @@ } TEST_F(ChromeDownloadManagerDelegateTest, BlockedAsActiveContent_SilentBlock) { - // Verifies that active mixed content download silent blocking works by - // default, and that extensions can be overridden by feature parameter. + // Verifies that any extension is silently blocked by default, but may be + // overridden by feature parameters. const GURL kFooUrl("http://example.com/file.foo"); - const GURL kBarUrl("http://example.com/file.bar"); - const GURL kInsecureSilentlyBlockableFile( - "http://example.com/foo.silently_blocked_for_testing"); const auto kSecureOrigin = Origin::Create(GURL("https://example.org")); #if BUILDFLAG(ENABLE_PLUGINS) @@ -977,76 +978,50 @@ content::PluginService::GetInstance()->Init(); #endif - std::unique_ptr<download::MockDownloadItem> blocked_download_item = - PrepareDownloadItemForMixedContent(kInsecureSilentlyBlockableFile, - kSecureOrigin, base::nullopt); std::unique_ptr<download::MockDownloadItem> foo_download_item = PrepareDownloadItemForMixedContent(kFooUrl, kSecureOrigin, base::nullopt); - std::unique_ptr<download::MockDownloadItem> bar_download_item = - PrepareDownloadItemForMixedContent(kBarUrl, kSecureOrigin, base::nullopt); - // Test default-blocked extensions are blocked normally, but not when - // overridden. + // Test everything is blocked normally. VerifyMixedContentExtensionOverride( - blocked_download_item.get(), {{}}, InsecureDownloadExtensions::kTest, - download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, - download::DownloadItem::MixedContentStatus::SILENT_BLOCK); - VerifyMixedContentExtensionOverride( - blocked_download_item.get(), {{"SilentBlockExtensionList", "foo"}}, - InsecureDownloadExtensions::kTest, - download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::WARN); - - // Test default-listed extensions aren't blocked, but other extensions - // are, when the extension list is configured as an allowlist. - VerifyMixedContentExtensionOverride( - blocked_download_item.get(), - {{"TreatSilentBlockListAsAllowlist", "true"}}, - InsecureDownloadExtensions::kTest, - download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::WARN); - VerifyMixedContentExtensionOverride( - foo_download_item.get(), {{"TreatSilentBlockListAsAllowlist", "true"}}, - InsecureDownloadExtensions::kUnknown, + foo_download_item.get(), {{}}, InsecureDownloadExtensions::kUnknown, download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, download::DownloadItem::MixedContentStatus::SILENT_BLOCK); - // Test extensions blocked via parameter are indeed blocked. - VerifyMixedContentExtensionOverride( - foo_download_item.get(), {{"SilentBlockExtensionList", "foo,bar"}}, - InsecureDownloadExtensions::kUnknown, - download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, - download::DownloadItem::MixedContentStatus::SILENT_BLOCK); - VerifyMixedContentExtensionOverride( - bar_download_item.get(), {{"SilentBlockExtensionList", "foo,bar"}}, - InsecureDownloadExtensions::kUnknown, - download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, - download::DownloadItem::MixedContentStatus::SILENT_BLOCK); - - // Test that overriding extensions AND allowlisting work together. + // An extension can punch through silent blocking if it's allowlisted. VerifyMixedContentExtensionOverride( foo_download_item.get(), {{"SilentBlockExtensionList", "foo"}, {"TreatSilentBlockListAsAllowlist", "true"}}, InsecureDownloadExtensions::kUnknown, download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::WARN); + download::DownloadItem::MixedContentStatus::SAFE); + + // And if that happens it can still be subject to other treatment. VerifyMixedContentExtensionOverride( - bar_download_item.get(), + foo_download_item.get(), {{"SilentBlockExtensionList", "foo"}, - {"TreatSilentBlockListAsAllowlist", "true"}}, + {"TreatSilentBlockListAsAllowlist", "true"}, + {"BlockExtensionList", "foo"}, + {"TreatBlockListAsAllowlist", "false"}}, InsecureDownloadExtensions::kUnknown, - download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, - download::DownloadItem::MixedContentStatus::SILENT_BLOCK); + download::DOWNLOAD_INTERRUPT_REASON_NONE, + download::DownloadItem::MixedContentStatus::BLOCK); + + // It's also possible to punch through silent blocking by swapping + // configuration to a blocklist, but that's not expected to be needed again. + VerifyMixedContentExtensionOverride( + foo_download_item.get(), + {{"SilentBlockExtensionList", "bar"}, + {"TreatSilentBlockListAsAllowlist", "false"}}, + InsecureDownloadExtensions::kUnknown, + download::DOWNLOAD_INTERRUPT_REASON_NONE, + download::DownloadItem::MixedContentStatus::SAFE); } TEST_F(ChromeDownloadManagerDelegateTest, BlockedAsActiveContent_Warn) { - // Verifies that active mixed content download warning works by default, and - // that extensions can be overridden by feature parameter. + // Verifies that active mixed content download warning can still be configured + // by feature parameter. const GURL kFooUrl("http://example.com/file.foo"); - const GURL kBarUrl("http://example.com/file.bar"); - const GURL kDontWarnUrl("http://example.com/file.dont_warn_for_testing"); - const GURL kInsecureWarnableFile("http://example.com/foo.warn_for_testing"); const auto kSecureOrigin = Origin::Create(GURL("https://example.org")); #if BUILDFLAG(ENABLE_PLUGINS) @@ -1055,60 +1030,63 @@ content::PluginService::GetInstance()->Init(); #endif - std::unique_ptr<download::MockDownloadItem> warned_download_item = - PrepareDownloadItemForMixedContent(kInsecureWarnableFile, kSecureOrigin, - base::nullopt); std::unique_ptr<download::MockDownloadItem> foo_download_item = PrepareDownloadItemForMixedContent(kFooUrl, kSecureOrigin, base::nullopt); - std::unique_ptr<download::MockDownloadItem> bar_download_item = - PrepareDownloadItemForMixedContent(kBarUrl, kSecureOrigin, base::nullopt); - std::unique_ptr<download::MockDownloadItem> dont_warn_download_item = - PrepareDownloadItemForMixedContent(kDontWarnUrl, kSecureOrigin, - base::nullopt); - // WarnExtensionList is configured as an allowlist by default, so verify that - // extensions not listed are warned on normally, but not if they're listed. + // By default, nothing is warned on since everything is silently blocked. VerifyMixedContentExtensionOverride( - warned_download_item.get(), {{}}, InsecureDownloadExtensions::kTest, - download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::WARN); - VerifyMixedContentExtensionOverride( - warned_download_item.get(), {{"WarnExtensionList", "warn_for_testing"}}, - InsecureDownloadExtensions::kTest, - download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::SAFE); + foo_download_item.get(), {{}}, InsecureDownloadExtensions::kUnknown, + download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, + download::DownloadItem::MixedContentStatus::SILENT_BLOCK); - // Test default-warned extensions aren't still warned, but listed extensions - // are, when warnings are configured as a blocklist. - VerifyMixedContentExtensionOverride( - warned_download_item.get(), {{"TreatWarnListAsAllowlist", "false"}}, - InsecureDownloadExtensions::kTest, - download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::SAFE); - VerifyMixedContentExtensionOverride( - dont_warn_download_item.get(), {{"TreatWarnListAsAllowlist", "false"}}, - InsecureDownloadExtensions::kTest, - download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::WARN); - - // Test extensions selected via parameter are indeed warned on. + // This is true no matter what you do on the warn extension configuration. VerifyMixedContentExtensionOverride( foo_download_item.get(), - {{"WarnExtensionList", "foo,bar"}, {"TreatWarnListAsAllowlist", "false"}}, + {{"WarnExtensionList", "foo"}, {"TreatWarnListAsAllowlist", "true"}}, + InsecureDownloadExtensions::kUnknown, + download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, + download::DownloadItem::MixedContentStatus::SILENT_BLOCK); + VerifyMixedContentExtensionOverride( + foo_download_item.get(), + {{"WarnExtensionList", "foo"}, {"TreatWarnListAsAllowlist", "false"}}, + InsecureDownloadExtensions::kUnknown, + download::DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED, + download::DownloadItem::MixedContentStatus::SILENT_BLOCK); + + // To get to a warning, you need to disable other forms of blocking. + // By default, carving out silent blocking will leave the extension as safe. + VerifyMixedContentExtensionOverride( + foo_download_item.get(), + {{"SilentBlockExtensionList", "foo"}, + {"TreatSilentBlockListAsAllowlist", "true"}}, + InsecureDownloadExtensions::kUnknown, + download::DOWNLOAD_INTERRUPT_REASON_NONE, + download::DownloadItem::MixedContentStatus::SAFE); + // But from there you can individually warn on specific extensions. + VerifyMixedContentExtensionOverride( + foo_download_item.get(), + {{"SilentBlockExtensionList", "foo"}, + {"TreatSilentBlockListAsAllowlist", "true"}, + {"WarnExtensionList", "foo"}, + {"TreatWarnListAsAllowlist", "false"}}, InsecureDownloadExtensions::kUnknown, download::DOWNLOAD_INTERRUPT_REASON_NONE, download::DownloadItem::MixedContentStatus::WARN); + // Or warn on everything. VerifyMixedContentExtensionOverride( - bar_download_item.get(), - {{"WarnExtensionList", "foo,bar"}, {"TreatWarnListAsAllowlist", "false"}}, + foo_download_item.get(), + {{"SilentBlockExtensionList", "foo"}, + {"TreatSilentBlockListAsAllowlist", "true"}, + {"WarnExtensionList", ""}, + {"TreatWarnListAsAllowlist", "true"}}, InsecureDownloadExtensions::kUnknown, download::DOWNLOAD_INTERRUPT_REASON_NONE, download::DownloadItem::MixedContentStatus::WARN); } TEST_F(ChromeDownloadManagerDelegateTest, BlockedAsActiveContent_Block) { - // Verifies that active mixed content download user-visible blocking works by - // default, and that extensions can be overridden by feature parameter. + // Verifies that active mixed content download user-visible blocking works + // when configured via feature parameter. const GURL kFooUrl("http://example.com/file.foo"); const GURL kBarUrl("http://example.com/file.bar"); const GURL kInsecureBlockableFile("http://example.com/foo.exe"); @@ -1127,40 +1105,34 @@ std::unique_ptr<download::MockDownloadItem> bar_download_item = PrepareDownloadItemForMixedContent(kBarUrl, kSecureOrigin, base::nullopt); - // Test default-blocked extensions are blocked normally, but not when - // overridden. + // Test that toggling the allowlist parameter impacts blocking. VerifyMixedContentExtensionOverride( - blocked_download_item.get(), {{}}, + blocked_download_item.get(), + {{"TreatSilentBlockListAsAllowlist", "false"}, + {"TreatBlockListAsAllowlist", "true"}}, InsecureDownloadExtensions::kMSExecutable, download::DOWNLOAD_INTERRUPT_REASON_NONE, download::DownloadItem::MixedContentStatus::BLOCK); VerifyMixedContentExtensionOverride( - blocked_download_item.get(), {{"BlockExtensionList", "foo"}}, - InsecureDownloadExtensions::kMSExecutable, - download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::WARN); - - // Test default-listed extensions aren't blocked, but other extensions - // are, when the extension list is configured as an allowlist. - VerifyMixedContentExtensionOverride( - blocked_download_item.get(), {{"TreatBlockListAsAllowlist", "true"}}, - InsecureDownloadExtensions::kMSExecutable, - download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::WARN); - VerifyMixedContentExtensionOverride( - foo_download_item.get(), {{"TreatBlockListAsAllowlist", "true"}}, + foo_download_item.get(), + {{"TreatSilentBlockListAsAllowlist", "false"}, + {"TreatBlockListAsAllowlist", "false"}}, InsecureDownloadExtensions::kUnknown, download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::BLOCK); + download::DownloadItem::MixedContentStatus::SAFE); // Test extensions selected via parameter are indeed blocked. VerifyMixedContentExtensionOverride( - foo_download_item.get(), {{"BlockExtensionList", "foo,bar"}}, + foo_download_item.get(), + {{"TreatSilentBlockListAsAllowlist", "false"}, + {"BlockExtensionList", "foo,bar"}}, InsecureDownloadExtensions::kUnknown, download::DOWNLOAD_INTERRUPT_REASON_NONE, download::DownloadItem::MixedContentStatus::BLOCK); VerifyMixedContentExtensionOverride( - bar_download_item.get(), {{"BlockExtensionList", "foo,bar"}}, + bar_download_item.get(), + {{"TreatSilentBlockListAsAllowlist", "false"}, + {"BlockExtensionList", "foo,bar"}}, InsecureDownloadExtensions::kUnknown, download::DOWNLOAD_INTERRUPT_REASON_NONE, download::DownloadItem::MixedContentStatus::BLOCK); @@ -1168,13 +1140,17 @@ // Test that overriding extensions AND allowlisting work together. VerifyMixedContentExtensionOverride( foo_download_item.get(), - {{"BlockExtensionList", "foo"}, {"TreatBlockListAsAllowlist", "true"}}, + {{"TreatSilentBlockListAsAllowlist", "false"}, + {"BlockExtensionList", "foo"}, + {"TreatBlockListAsAllowlist", "true"}}, InsecureDownloadExtensions::kUnknown, download::DOWNLOAD_INTERRUPT_REASON_NONE, - download::DownloadItem::MixedContentStatus::WARN); + download::DownloadItem::MixedContentStatus::SAFE); VerifyMixedContentExtensionOverride( bar_download_item.get(), - {{"BlockExtensionList", "foo"}, {"TreatBlockListAsAllowlist", "true"}}, + {{"TreatSilentBlockListAsAllowlist", "false"}, + {"BlockExtensionList", "foo"}, + {"TreatBlockListAsAllowlist", "true"}}, InsecureDownloadExtensions::kUnknown, download::DOWNLOAD_INTERRUPT_REASON_NONE, download::DownloadItem::MixedContentStatus::BLOCK);
diff --git a/chrome/browser/download/download_query.cc b/chrome/browser/download/download_query.cc index 1c10324..4ab3d0f 100644 --- a/chrome/browser/download/download_query.cc +++ b/chrome/browser/download/download_query.cc
@@ -38,7 +38,11 @@ // Templatized base::Value::GetAs*(). template <typename T> bool GetAs(const base::Value& in, T* out); template<> bool GetAs(const base::Value& in, bool* out) { - return in.GetAsBoolean(out); + if (out && in.is_bool()) { + *out = in.GetBool(); + return true; + } + return in.is_bool(); } template <> bool GetAs(const base::Value& in, double* out) {
diff --git a/chrome/browser/download/mixed_content_download_blocking.cc b/chrome/browser/download/mixed_content_download_blocking.cc index 3692576..67e75d6 100644 --- a/chrome/browser/download/mixed_content_download_blocking.cc +++ b/chrome/browser/download/mixed_content_download_blocking.cc
@@ -49,11 +49,11 @@ const base::FeatureParam<bool> kTreatSilentBlockListAsAllowlist( &features::kTreatUnsafeDownloadsAsActive, "TreatSilentBlockListAsAllowlist", - false); + true); const base::FeatureParam<std::string> kSilentBlockExtensionList( &features::kTreatUnsafeDownloadsAsActive, "SilentBlockExtensionList", - "silently_blocked_for_testing"); + "silently_unblocked_for_testing"); const base::FeatureParam<bool> kTreatBlockListAsAllowlist( &features::kTreatUnsafeDownloadsAsActive, @@ -62,17 +62,17 @@ const base::FeatureParam<std::string> kBlockExtensionList( &features::kTreatUnsafeDownloadsAsActive, "BlockExtensionList", - "exe,scr,msi,vb,dmg,pkg,crx,gz,gzip,zip,bz2,rar,7z,tar"); + ""); // Note: this is an allowlist, so acts as a catch-all. const base::FeatureParam<bool> kTreatWarnListAsAllowlist( &features::kTreatUnsafeDownloadsAsActive, "TreatWarnListAsAllowlist", - true); + false); const base::FeatureParam<std::string> kWarnExtensionList( &features::kTreatUnsafeDownloadsAsActive, "WarnExtensionList", - "dont_warn_for_testing"); + ""); // Map the string file extension to the corresponding histogram enum. InsecureDownloadExtensions GetExtensionEnumFromString(
diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_browsertest.cc b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_browsertest.cc index 8766b50..bacb159 100644 --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_browsertest.cc +++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_browsertest.cc
@@ -556,8 +556,7 @@ "2E6D1C4A1F39A02562BF1505AD775C0323D7A04C0C37C9B29D25F532B9972080", }, /*trigger*/ SafeBrowsingPrivateEventRouter::kTriggerFileUpload, - // TODO(crbug.com/1191060): Update this string when the event is supported - /*reason*/ "SERVICE_UNAVAILABLE", + /*reason*/ "TOO_MANY_REQUESTS", /*mimetypes*/ ExeMimeTypes(), /*size*/ 9, /*result*/
diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.cc b/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.cc index c80aa31..2a8ce73 100644 --- a/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.cc +++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.cc
@@ -19,6 +19,8 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/canvas.h" @@ -39,8 +41,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace enterprise_connectors {
diff --git a/chrome/browser/enterprise/connectors/device_trust/BUILD.gn b/chrome/browser/enterprise/connectors/device_trust/BUILD.gn deleted file mode 100644 index e717cc8..0000000 --- a/chrome/browser/enterprise/connectors/device_trust/BUILD.gn +++ /dev/null
@@ -1,29 +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/protobuf/proto_library.gni") - -proto_library("keystore_proto") { - proto_out_dir = "chrome/browser/enterprise/connectors/device_trust/" - sources = [ "//chrome/browser/enterprise/connectors/device_trust/attestation_protos/keystore.proto" ] - generate_python = false -} - -proto_library("attestation_ca_proto") { - proto_out_dir = "chrome/browser/enterprise/connectors/device_trust/" - sources = [ "//chrome/browser/enterprise/connectors/device_trust/attestation_protos/attestation_ca.proto" ] - generate_python = false -} - -proto_library("interface_proto") { - proto_out_dir = "chrome/browser/enterprise/connectors/device_trust/" - sources = [ "//chrome/browser/enterprise/connectors/device_trust/attestation_protos/interface.proto" ] - generate_python = false -} - -proto_library("google_key_proto") { - proto_out_dir = "chrome/browser/enterprise/connectors/device_trust/" - sources = [ "//chrome/browser/enterprise/connectors/device_trust/attestation_protos/google_key.proto" ] - generate_python = false -}
diff --git a/chrome/browser/enterprise/connectors/device_trust/attestation_protos/attestation_ca.proto b/chrome/browser/enterprise/connectors/device_trust/attestation_protos/attestation_ca.proto deleted file mode 100644 index 6e843f3..0000000 --- a/chrome/browser/enterprise/connectors/device_trust/attestation_protos/attestation_ca.proto +++ /dev/null
@@ -1,345 +0,0 @@ -// Copyright 2021 The Chromium OS Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is an exact copy of -// third_party/cros_system_api/dbus/attestation/attestation_ca.proto -// third_party/cros_system_api is only for ChromeOS. - -syntax = "proto2"; - -option optimize_for = LITE_RUNTIME; - -package attestation; -option go_package = "chromiumos/system_api/attestation_proto"; - -// Enumerates various certificate profiles supported by the Attestation CA. -enum CertificateProfile { - // A certificate intended for enterprise-owned devices. It has the following - // subjectName fields: - // CN=<stable device identifier> - // OU=state:[verified|developer] - // O=Chrome Device Enterprise - ENTERPRISE_MACHINE_CERTIFICATE = 0; - - // A certificate intended for enterprise-owned user accounts. It has the - // following subjectName fields: - // OU=state:[verified|developer] - // O=Chrome Device Enterprise - ENTERPRISE_USER_CERTIFICATE = 1; - - // A certificate intended for platform verification by providers of protected - // content. It has the following subjectName fields: - // O=Chrome Device Content Protection - CONTENT_PROTECTION_CERTIFICATE = 2; - - // Like above, but it also includes a stable ID and origin. - // CN=<origin-specific device identifier> - // OU=<origin> - // O=Chrome Device Content Protection - CONTENT_PROTECTION_CERTIFICATE_WITH_STABLE_ID = 3; - - // A certificate intended for cast devices. - CAST_CERTIFICATE = 4; - - GFSC_CERTIFICATE = 5; - - JETSTREAM_CERTIFICATE = 6; - - // A certificate for enterprise enrollment. - ENTERPRISE_ENROLLMENT_CERTIFICATE = 7; - - // A certificate for signing Android Testsuite Results using CTS-in-a-box. - XTS_CERTIFICATE = 8; - - // An EK certificate for vTPM - // CN=CROS VTPM PRD EK ROOT CA - ENTERPRISE_VTPM_EK_CERTIFICATE = 9; -} - -enum TpmVersion { - TPM_1_2 = 1; // NOTE: This is the default. It must remain listed first. - TPM_2_0 = 2; -} - -// Types of NVRAM quotes used for attestation. -enum NVRAMQuoteType { - // Quote of the Cr50-backed BoardID. - BOARD_ID = 0; - // Quote of the Cr50-backed SN+RMA bits. - SN_BITS = 1; - // Quote of the Cr50-backed RSA public endorsement key certificate. - RSA_PUB_EK_CERT = 2; - // Quote of the Cr50-backed RSU device ID. - RSU_DEVICE_ID = 3; -} - -// Holds information about a quote generated by the TPM. -message Quote { - // The quote; a signature generated with the AIK. - optional bytes quote = 1; - // The serialized data that was quoted; this assists in verifying the quote. - optional bytes quoted_data = 2; - // The value of the PCR(s) at the time the quote was generated. - optional bytes quoted_pcr_value = 3; - // Source data which was originally used to extend the PCR. If this field - // exists it can be expected that SHA1(pcr_source_hint) was extended into the - // PCR. - optional bytes pcr_source_hint = 4; -} - -// Holds encrypted data and information required to decrypt it. -message EncryptedData { - // A key that has been sealed to the TPM or wrapped by another key. - optional bytes wrapped_key = 2; - // The initialization vector used during encryption. - optional bytes iv = 3; - // MAC of (iv + encrypted_data). - optional bytes mac = 4; - optional bytes encrypted_data = 5; - // An identifier for the wrapping key to assist in decryption. - optional bytes wrapping_key_id = 6; -} - -// The wrapper message of any data and its signature. -message SignedData { - // The data to be signed. - optional bytes data = 1; - // The signature of the data field. - optional bytes signature = 2; -} - -// The first two fields are suitable for passing to Tspi_TPM_ActivateIdentity() -// directly when using TPM 1.2. For TPM 2.0 the first two fields are not used. -message EncryptedIdentityCredential { - // TPM_ASYM_CA_CONTENTS, encrypted with EK public key. - optional bytes asym_ca_contents = 1; - // TPM_SYM_CA_ATTESTATION, encrypted with the key in aysm_ca_contents. - optional bytes sym_ca_attestation = 2; - - optional TpmVersion tpm_version = 3; - - // The following fields are used only for TPM 2.0. For details see the TPM 2.0 - // specification Part 1 Rev 1.16: - // - Section 9.5.3.3: General description of the scheme. - // - Section 24: More details including how to use the seed to compute the - // values for 'credential_mac' and 'wrapped_certificate-> - // wrapped_key' - // - Section B.10.4: Encrypting the seed with a RSA EK. - // - Section C.7.4: Encrypting the seed with an EC EK. - - // A seed encrypted with the EK public key. The TPM will use this seed to - // derive both an HMAC key to verify the 'credential_mac' field and an AES key - // to unwrap the 'wrapped_certificate->wrapped_key' field. - optional bytes encrypted_seed = 4; - - // An integrity value computed using HMAC-SHA256 over the - // 'wrapped_certificate.wrapped_key' field and the 'Name' of the identity key. - optional bytes credential_mac = 5; - - // A certificate encrypted with a 'credential' that is decrypted by the TPM. - // The 'wrapped_key' field contains the encrypted credential which is - // encrypted using AES-256-CFB with a zero IV. The encryption of the - // certificate itself uses AES-256-CBC with PKCS #5 padding and a random IV. - // The encryption key is derived from the 'credential' using: - // SHA256('ENCRYPT' + credential) - // The mac uses HMAC-SHA256 with a key derived using: - // SHA256('MAC' + credential) - optional EncryptedData wrapped_certificate = 6; -} - -// This message holds all information to be sent to the attestation server in -// order to complete enrollment. -message AttestationEnrollmentRequest { - // The EK cert, in X.509 form, encrypted using the server's public key with - // the following parameters: - // Key encryption: RSA-OAEP with no custom parameters. - // Data encryption: 256-bit key, AES-CBC with PKCS5 padding. - // MAC: HMAC-SHA-512 using the AES key. - optional EncryptedData encrypted_endorsement_credential = 1; - // The AIK public key, the raw TPM format. (TPM_PUBKEY for TPM 1.2, - // TPMT_PUBLIC for TPM 2.0). - optional bytes identity_public_key = 2; - // PCR0 quoted by AIK. - optional Quote pcr0_quote = 3; - // PCR1 quoted by AIK. - optional Quote pcr1_quote = 4; - // DEN for enterprise zero-touch enrollment (crbug/624187). - optional bytes enterprise_enrollment_nonce = 5; - // The device TPM version. - optional TpmVersion tpm_version = 6; - // An encrypted quote of the RSA EK cert, in X.509 form, if the endorsement - // credential is not RSA. - optional EncryptedData encrypted_rsa_endorsement_quote = 7; -} - -enum ResponseStatus { - OK = 0; - // Internal server error. - SERVER_ERROR = 1; - // The server cannot parse the request. - BAD_REQUEST = 2; - // The server rejects the request. - REJECT = 3; - // Only appears in enrollment response. The server returns the same generated - // id and reports the quota limit exceeded status when the number of reset - // action in a specified time window is more than self reset limitation. - QUOTA_LIMIT_EXCEEDED = 4; -} - -// The response from the attestation server for the enrollment request. -message AttestationEnrollmentResponse { - optional ResponseStatus status = 1; - // Short detail response message. Included when the result is not OK. - optional string detail = 2; - optional EncryptedIdentityCredential encrypted_identity_credential = 3; - // Extra details included when the result is not OK. - optional string extra_details = 4; -} - -// The certificate request to be sent to the attestation server. -message AttestationCertificateRequest { - // The AIK cert in X.509 format. - optional bytes identity_credential = 1; - // A certified public key in TPM_PUBKEY (TPMT_PUBLIC for TPM 2.0). - optional bytes certified_public_key = 3; - // The serialized TPM_CERTIFY_INFO (TPMS_ATTEST for TPM 2.0) for the - // certified key. - optional bytes certified_key_info = 4; - // The signature of the TPM_CERTIFY_INFO (TPMS_ATTEST for TPM 2.0) by the AIK. - optional bytes certified_key_proof = 5; - // A message identifier to be included in the response. - optional bytes message_id = 10; - // The certificate profile defines the type of certificate to issue. - optional CertificateProfile profile = 11; - // Information about the origin of the request which may be used depending on - // the certificate profile. - optional string origin = 12; - // The index of a temporal value. This may be used or ignored depending on - // the certificate profile. - optional int32 temporal_index = 13; - // The device TPM version. - optional TpmVersion tpm_version = 14; - // NVRAM quoted by AIK. Keys are values of the NVRAMQuoteType. This is only - // used for enrollment certificates. - map<int32, Quote> nvram_quotes = 15; -} - -// The response from the attestation server for the certificate request. -message AttestationCertificateResponse { - optional ResponseStatus status = 1; - // Short detail response message. Included when the result is not OK. - optional string detail = 2; - // The credential of the certified key in X.509 format. - optional bytes certified_key_credential = 3; - // The issuer intermediate CA certificate in X.509 format. - optional bytes intermediate_ca_cert = 5; - // A message identifier from the request this message is responding to. - optional bytes message_id = 6; - // Additional intermediate CA certificates that can help in validation. - // Certificate chaining order is from the leaf to the root. That is, - // |certified_key_credential| is signed by - // |intermediate_ca_cert|, which is signed by - // |additional_intermediate_ca_cert(0)|, which is signed by - // |additional_intermediate_ca_cert(1)|, ... and so on. - repeated bytes additional_intermediate_ca_cert = 7; - // Extra details included when the result is not OK. - optional string extra_details = 8; -} - -// The reset request to be sent to the attestation server. -message AttestationResetRequest { - // The AIK cert, in X.509 form, encrypted using the server's public key with - // the following parameters: - // Key encryption: RSA-OAEP with no custom parameters. - // Data encryption: 256-bit key, AES-CBC with PKCS5 padding. - // MAC: HMAC-SHA-512 using the AES key. - optional EncryptedData encrypted_identity_credential = 1; - - // The one time token to make sure the reset process can be triggered only - // once. - optional bytes token = 2; - - // The EK cert, in X.509 form, encrypted using the server's public key with - // the following parameters: - // Key encryption: RSA-OAEP with no custom parameters. - // Data encryption: 256-bit key, AES-CBC with PKCS5 padding. - // MAC: HMAC-SHA-512 using the AES key. - optional EncryptedData encrypted_endorsement_credential = 3; -} - -// The response from the attestation server for the reset request. -message AttestationResetResponse { - // The response status. - optional ResponseStatus status = 1; - // Short detail response message. Included when the result is not OK. - optional string detail = 2; - // Extra details included when the result is not OK. - optional string extra_details = 3; -} - -// The challenge data (as in challenge-response) generated by the server. -// Before transmitted to the client, this message will be wrapped as a -// SignedData message, in which the data field is the serialized Challenge -// message, and the signature field is the signature of the data field signed -// by the enterprise server using a hard-coded key. The signature algorithm is -// RSASSA-PKCS1-v1_5-SHA256. -message Challenge { - // A string for the client to sanity check a legitimate challenge. - optional string prefix = 1; - // A 256-bit random value generated by the server. - optional bytes nonce = 2; - // A timestamp for a stateless server to limit the timeframe during which the - // challenge may be replayed. - optional int64 timestamp = 3; -} - -// The response data (as in challenge-response) generated by the client. -// Before transmitted to the server, this message will be wrapped as a -// SignedData message, in which the data field is the serialized -// ChallengeResponse message, and the signature field is the signature of the -// data field signed by the client using the key being challenged. The -// signature algorithm is RSASSA-PKCS1-v1_5-SHA256. -message ChallengeResponse { - // The original challenge data. - optional SignedData challenge = 1; - // A 256-bit random value generated by the client. Mixing in this nonce - // prevents a caller from using a challenge to sign arbitrary data. - optional bytes nonce = 2; - // The KeyInfo message encrypted using a public encryption key, pushed via - // policy with the following parameters: - // Key encryption: RSA-OAEP with no custom parameters. - // Data encryption: 256-bit key, AES-CBC with PKCS5 padding. - // MAC: HMAC-SHA-512 using the AES key. - optional EncryptedData encrypted_key_info = 3; -} - -// The data type of the message decrypted from -// ChallengeResponse.encrypted_key_info.encrypted_data field. This message holds -// information required by enterprise server to complete the verification. -message KeyInfo { - // Indicates whether the key is an EMK or EUK. - optional KeyProfile key_type = 1; - // Domain information about the user associated with the key. For an - // EMK, this value is empty - customer_id is used instead. - // For an EUK, this value is the user's email address. - optional string domain = 2; - // The virtual device ID associated with the device or user. - optional bytes device_id = 3; - // If the key is an EUK, this value is the PCA-issued certificate for the key. - optional bytes certificate = 4; - // If the key is an EUK, this value may hold a SignedPublicKeyAndChallenge - // with a random challenge. The SignedPublicKeyAndChallenge specification is - // here: https://developer.mozilla.org/en-US/docs/HTML/Element/keygen. - optional bytes signed_public_key_and_challenge = 5; - // The identifier of the customer, as defined by the Google Admin SDK at - // https://developers.google.com/admin-sdk/directory/v1/guides/manage-customers - optional string customer_id = 6; -} - -enum KeyProfile { - // Enterprise machine key. - EMK = 0; - // Enterprise user key. - EUK = 1; -}
diff --git a/chrome/browser/enterprise/connectors/device_trust/attestation_protos/google_key.proto b/chrome/browser/enterprise/connectors/device_trust/attestation_protos/google_key.proto deleted file mode 100644 index 8fd316e..0000000 --- a/chrome/browser/enterprise/connectors/device_trust/attestation_protos/google_key.proto +++ /dev/null
@@ -1,29 +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. - -// This file is an exact copy of -// third_party/cros_system_api/dbus/attestation/google_key.proto -// third_party/cros_system_api is only for ChromeOS. - -syntax = "proto2"; - -option optimize_for = LITE_RUNTIME; - -package attestation; - -// The RSA public key of Google key used by attestation service. Only used -// internally for attestation service, this message is specialized to contain a -// RSA key modulus in hex with well known exponent 65537. -message GoogleRsaPublicKey { - optional string modulus_in_hex = 1; - // The key id for the servers to look up the keys for decryption. - optional bytes key_id = 2; -} - -// A key set used with |DEAULT_ACA| and |DEFAULT_VA|. -message DefaultGoogleRsaPublicKeySet { - optional GoogleRsaPublicKey default_ca_encryption_key = 1; - optional GoogleRsaPublicKey default_va_signing_key = 2; - optional GoogleRsaPublicKey default_va_encryption_key = 3; -}
diff --git a/chrome/browser/enterprise/connectors/device_trust/attestation_protos/interface.proto b/chrome/browser/enterprise/connectors/device_trust/attestation_protos/interface.proto deleted file mode 100644 index 150fa5b0..0000000 --- a/chrome/browser/enterprise/connectors/device_trust/attestation_protos/interface.proto +++ /dev/null
@@ -1,500 +0,0 @@ -// Copyright 2021 The Chromium OS Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file is an exact copy of -// third_party/cros_system_api/dbus/attestation/interface.proto -// third_party/cros_system_api is only for ChromeOS. - -syntax = "proto2"; - -option optimize_for = LITE_RUNTIME; - -import "attestation_ca.proto"; -import "keystore.proto"; - -package attestation; -option go_package = "chromiumos/system_api/attestation_proto"; - -enum AttestationStatus { - STATUS_SUCCESS = 0; - STATUS_UNEXPECTED_DEVICE_ERROR = 1; - STATUS_NOT_AVAILABLE = 2; - STATUS_NOT_READY = 3; - STATUS_NOT_ALLOWED = 4; - STATUS_INVALID_PARAMETER = 5; - STATUS_REQUEST_DENIED_BY_CA = 6; - STATUS_CA_NOT_AVAILABLE = 7; - STATUS_NOT_SUPPORTED = 8; - // The error that is translated into by the client to indicate any kind of - // D-Bus error. - STATUS_DBUS_ERROR = 9; -} - -enum ACAType { - DEFAULT_ACA = 0; - TEST_ACA = 1; -} - -enum VAType { - DEFAULT_VA = 0; - TEST_VA = 1; -} - -message GetKeyInfoRequest { - optional string key_label = 1; - optional string username = 2; -} - -message GetKeyInfoReply { - optional AttestationStatus status = 1; - optional KeyType key_type = 2; - optional KeyUsage key_usage = 3; - // The public key (X.509/DER SubjectPublicKeyInfo). - optional bytes public_key = 4; - // The serialized TPM_CERTIFY_INFO or TPM2B_ATTEST for the new key. - optional bytes certify_info = 5; - // The signature of certify_info by the Attestation Key. - optional bytes certify_info_signature = 6; - // The certificate data associated with the key (if any). - optional bytes certificate = 7; - // The payload associated with the key. - optional bytes payload = 8; -} - -message GetEndorsementInfoRequest { - reserved 1; -} - -message GetEndorsementInfoReply { - optional AttestationStatus status = 1; - // The endorsement public key (X.509/DER SubjectPublicKeyInfo). - optional bytes ek_public_key = 2; - // The endorsement certificate (X.509/DER). - optional bytes ek_certificate = 3; - // Human-readable string with EK information. Contains EK certificate in PEM - // format and SHA256 hash of the raw DER encoded certificate. - optional string ek_info = 4; -} - -message GetAttestationKeyInfoRequest { - reserved 1; - // What kind of ACA to use. - optional ACAType aca_type = 2; -} - -message GetAttestationKeyInfoReply { - optional AttestationStatus status = 1; - // The attestation public key (X.509/DER SubjectPublicKeyInfo). - optional bytes public_key = 2; - // The attestation public key in TPM_PUBKEY form. - optional bytes public_key_tpm_format = 3; - // The attestation key certificate. - optional bytes certificate = 4; - // A quote of PCR0 at the time of attestation key creation. - optional Quote pcr0_quote = 5; - // A quote of PCR1 at the time of attestation key creation. - optional Quote pcr1_quote = 6; -} - -message ActivateAttestationKeyRequest { - reserved 1; - optional EncryptedIdentityCredential encrypted_certificate = 2; - // Whether, on success, the decrypted certificate should be retained in - // association with the attestation key. When using an ACA, this is normally - // set to true. Other protocols may use a nonce as the 'certificate' and in - // these cases this field is normally set to false. - optional bool save_certificate = 3; - // What kind of ACA to use. - optional ACAType aca_type = 4; -} - -message ActivateAttestationKeyReply { - optional AttestationStatus status = 1; - // The decrypted attestation key certificate. - optional bytes certificate = 2; -} - -message CreateCertifiableKeyRequest { - // An arbitrary label which can be used to reference the key later. - optional string key_label = 1; - // Provided if the new key should be accessible only by a - // particular user. If this field is not set or is the empty - // string, the key will be accessible system-wide. - optional string username = 2; - optional KeyType key_type = 3; - optional KeyUsage key_usage = 4; -} - -message CreateCertifiableKeyReply { - optional AttestationStatus status = 1; - // The new public key (X.509/DER SubjectPublicKeyInfo). - optional bytes public_key = 2; - // The serialized TPM_CERTIFY_INFO or TPM2B_ATTEST for the new key. - optional bytes certify_info = 3; - // The signature of certify_info by the Attestation Key. - optional bytes certify_info_signature = 4; -} - -message DecryptRequest { - optional string key_label = 1; - optional string username = 2; - optional bytes encrypted_data = 3; -} - -message DecryptReply { - optional AttestationStatus status = 1; - optional bytes decrypted_data = 2; -} - -message SignRequest { - optional string key_label = 1; - optional string username = 2; - optional bytes data_to_sign = 3; -} - -message SignReply { - optional AttestationStatus status = 1; - optional bytes signature = 2; -} - -message RegisterKeyWithChapsTokenRequest { - optional string key_label = 1; - optional string username = 2; - optional bool include_certificates = 3; -} - -message RegisterKeyWithChapsTokenReply { - optional AttestationStatus status = 1; -} - -// Message to check whether attestation is prepared for enrollment or not. -message GetEnrollmentPreparationsRequest { - optional ACAType aca_type = 1; -} - -// Reply to a check of whether attestation is prepared for enrollment or not. -message GetEnrollmentPreparationsReply { - optional AttestationStatus status = 1; - map<int32, bool> enrollment_preparations = 2; -} - -message GetStatusRequest { - // Get extended status (see GetStatusReply below). - optional bool extended_status = 1; -} - -message GetStatusReply { - message Identity { - // The identity features. - optional int32 features = 1; - } - - message IdentityCertificate { - // The identity that is enrolled. - optional int32 identity = 1; - // The Privacy CA that the identity is enrolled with. - optional int32 aca = 2; - } - - optional AttestationStatus status = 1; - // Is prepared for enrollment? True if prepared for *any* CA. - optional bool prepared_for_enrollment = 2; - // Is enrolled (AIK certificate created)? True if enrolled with *any* CA. - optional bool enrolled = 3; - // Is in verified boot mode (according to PCR0 quote)? - // [Only included in reply if extended_status is set] - optional bool verified_boot = 4; - // List of identities and their identity features. - repeated Identity identities = 5; - // List of identity certificates. - map<int32, IdentityCertificate> identity_certificates = 6; - // Map of CA types to whether we are prepared for enrollment with that CA. - map<int32, bool> enrollment_preparations = 7; -} - -// Verify attestation data. -message VerifyRequest { - // Use CrosCore CA to verify that the EK is endorsed. - optional bool cros_core = 1; - // Verify EK only. - // Otherwise, in addition to EK, verify all attestation data as a CA would. - optional bool ek_only = 2; -} - -message VerifyReply { - optional AttestationStatus status = 1; - optional bool verified = 2; -} - -// Create an enrollment request to be sent to the Privacy CA. This request -// is a serialized AttestationEnrollmentRequest protobuf. Attestation -// enrollment is a process by which the Privacy CA verifies the EK certificate -// of a device and issues a certificate for an AIK. The enrollment process can -// be finished by sending FinishEnrollRequest with the response from the CA. -message CreateEnrollRequestRequest { - // What kind of ACA to use. - optional ACAType aca_type = 1; -} - -message CreateEnrollRequestReply { - optional AttestationStatus status = 1; - // AttestationEnrollmentRequest to be sent to CA server. - optional bytes pca_request = 2; -} - -// Finish the enrollment process. -message FinishEnrollRequest { - // AttestationEnrollmentResponse received from CA server. - optional bytes pca_response = 1; - // What kind of ACA to use. - optional ACAType aca_type = 2; -} - -message FinishEnrollReply { - optional AttestationStatus status = 1; -} - -// Goes through the entire enrollment process, including creating enroll -// request, sending the request to the corresponding PCA server, and storing the -// response from PCA server if success. The message field is identical to -// |CreateEnrollRequestRequest|. -message EnrollRequest { - // What kind of ACA to use. - optional ACAType aca_type = 1; - // No matter is the device is enrolled, (re-)enroll the device. - optional bool forced = 2; -} - -message EnrollReply { - optional AttestationStatus status = 1; -} - -// Create an attestation certificate request to be sent to the Privacy CA. -// The request is a serialized AttestationCertificateRequest protobuf. The -// certificate request process generates and certifies a key in the TPM and -// sends the AIK certificate along with information about the certified key to -// the Privacy CA. The PCA verifies the information and issues a certificate -// for the certified key. The certificate request process can be finished by -// sending FinishCertificateRequestRequest with the response from the CA. -message CreateCertificateRequestRequest { - // Type of certificate to be requested. - optional CertificateProfile certificate_profile = 1; - // The canonical username of the active user profile. Leave blank - // if not associated with the current user. - optional string username = 2; - // Some certificate requests require information about the origin - // of the request. If no origin is needed, this can be empty. - optional string request_origin = 3; - // What kind of ACA to use. - optional ACAType aca_type = 4; - // The key algorithm of certified key. - optional KeyType key_type = 5; -} - -message CreateCertificateRequestReply { - optional AttestationStatus status = 1; - // The request to be sent to the Privacy CA. - optional bytes pca_request = 2; -} - -// Finish the certificate request process. The |pca_response| from the PCA -// is a serialized AttestationCertificateResponse protobuf. This final step -// verifies the PCA operation succeeded and extracts the certificate for the -// certified key. The certificate is stored with the key. -message FinishCertificateRequestRequest { - // The Privacy CA's response to a certificate request. - optional bytes pca_response = 1; - // A name for the key. If a key already exists with this name it - // will be destroyed and replaced with this one. - optional string key_label = 2; - // This should match |username| in CreateCertificateRequestRequest. - optional string username = 3; -} - -message FinishCertificateRequestReply { - optional AttestationStatus status = 1; - // The PCA issued certificate chain in PEM format. By - // convention the certified key certificate is listed - // first followed by intermediate CA certificate(s). - // The PCA root certificate is not included. - optional bytes certificate = 2; - // The public key (X.509/DER SubjectPublicKeyInfo). - optional bytes public_key = 3; -} - -// Goes through the entire cert process, including creating cert, sending the -// request to the corresponding PCA server, and storing the response from PCA -// server if success. The message fields are basically the union of -// |CreateCertificateRequestRequest| and |FinishCertificateRequestRequest|. -message GetCertificateRequest { - // Type of certificate to be requested. - optional CertificateProfile certificate_profile = 1; - // The canonical username of the active user profile. Leave blank - // if not associated with the current user. - optional string username = 2; - // Some certificate requests require information about the origin - // of the request. If no origin is needed, this can be empty. - optional string request_origin = 3; - // What kind of ACA to use. - optional ACAType aca_type = 4; - // The key algorithm of certified key. - optional KeyType key_type = 5; - // A name for the key. If a key already exists with this name it - // will be destroyed and replaced with this one. - optional string key_label = 6; - // Ignores the current certificate if any and gets the new certificate. - optional bool forced = 7; - // If set to |true|, this request also triggers enrollment process if the - // device is not enrolled yet. - optional bool shall_trigger_enrollment = 8; -} - -message GetCertificateReply { - optional AttestationStatus status = 1; - // The PCA issued certificate chain in PEM format. By - // convention the certified key certificate is listed - // first followed by intermediate CA certificate(s). - // The PCA root certificate is not included. - optional bytes certificate = 2; - // The public key (X.509/DER SubjectPublicKeyInfo). - optional bytes public_key = 3; -} - -// Sign a challenge for an enterprise device / user. This challenge is -// typically generated by and the response verified by the Enterprise Device -// Verification Server (DVServer). -message SignEnterpriseChallengeRequest { - // The key name. This is the same name previously passed to - // FinishCertificateRequestRequest. - optional string key_label = 1; - // The canonical username of the active user profile. - // When this is set, an EUK challenge will be performed. - // When this is unset or empty, an EMK challenge will be performed. - optional string username = 2; - // A domain value to be included in the challenge response. - // This is supposed to be the user's canonical e-mail address for an EUK - // challenge. Ignored for EMK challenges. - optional string domain = 3; - // A device identifier to be included in the challenge response. - optional bytes device_id = 4; - // Whether the challenge response should include - // a SignedPublicKeyAndChallenge. - optional bool include_signed_public_key = 5; - // The challenge to be signed. - optional bytes challenge = 6; - // The VA server that will handle the challenge. - optional VAType va_type = 7; - // The name of the key used for SignedPublicKeyAndChallenge. If left empty, - // the same key used to sign the challenge response (EMK or EUK) will be used - // for SignedPublicKeyAndChallenge. - optional string key_name_for_spkac = 8; -} - -message SignEnterpriseChallengeReply { - optional AttestationStatus status = 1; - // The challenge response. - optional bytes challenge_response = 2; -} - -// Sign a challenge outside of an enterprise context: generate a random nonce -// and append it to challenge, then sign and return the signature in the -// |challenge_response|. -// This challenge is typically generated by some module running within Chrome. -message SignSimpleChallengeRequest { - // The key name. This is the same name previously passed to - // FinishCertificateRequestRequest. - optional string key_label = 1; - // The canonical username of the active user profile. Leave blank - // if not associated with the current user. - optional string username = 2; - // The challenge to be signed. - optional bytes challenge = 3; -} - -message SignSimpleChallengeReply { - optional AttestationStatus status = 1; - // The challenge response. - optional bytes challenge_response = 2; -} - -// Set a payload for a key; any previous payload will be overwritten. -message SetKeyPayloadRequest { - // The key name. This is the same name previously passed to - // FinishCertificateRequestRequest. - optional string key_label = 1; - // The canonical username of the active user profile. Leave blank - // if not associated with the current user. - optional string username = 2; - optional bytes payload = 3; -} - -message SetKeyPayloadReply { - optional AttestationStatus status = 1; -} - -// Delete keys either by key label prefix or by exact key label. -message DeleteKeysRequest { - enum MatchBehavior { - // Match type not specified. Behavior defaults to |MATCH_TYPE_PREFIX|. - MATCH_BEHAVIOR_UNSPECIFIED = 0; - - // Will delete all keys that start with |key_label_match|. - // If no such key exists, the operation still succeeds. - MATCH_BEHAVIOR_PREFIX = 1; - - // Will delete the key which has a key_label exactly matching - // |key_label_match|. - // If no such key exists, the operation still succeeds. - MATCH_BEHAVIOR_EXACT = 2; - } - // The key label prefix or the exact key label (depends on |match_behavior|). - optional string key_label_match = 1; - // The canonical username of the active user profile. Leave blank - // if not associated with the current user. - optional string username = 2; - // The matching behavior - see comments on the enum values. If omitted, - // defaults to MATCH_BEHAVIOR_PREFIX for backwards compatibility. - optional MatchBehavior match_behavior = 3; -} - -message DeleteKeysReply { - optional AttestationStatus status = 1; -} - -// Create a request to be sent to the PCA which will reset the identity for -// this device on future AIK enrollments. The |reset_token| is put in the -// request protobuf verbatim. -message ResetIdentityRequest { - optional string reset_token = 1; -} - -message ResetIdentityReply { - optional AttestationStatus status = 1; - // Request to be sent to the CA. - optional bytes reset_request = 2; -} - -message GetEnrollmentIdRequest { - optional bool ignore_cache = 1; -} - -message GetEnrollmentIdReply { - optional AttestationStatus status = 1; - optional string enrollment_id = 2; -} - -// Gets a copy of the specific NV data, signed using the key with the specified -// label, eg "attest-ent-machine". -message GetCertifiedNvIndexRequest { - optional int32 nv_index = 1; - optional int32 nv_size = 2; - optional string key_label = 3; -} - -message GetCertifiedNvIndexReply { - optional AttestationStatus status = 1; - optional bytes certified_data = 2; - optional bytes signature = 3; - optional bytes key_certificate = 4; -}
diff --git a/chrome/browser/enterprise/connectors/device_trust/attestation_protos/keystore.proto b/chrome/browser/enterprise/connectors/device_trust/attestation_protos/keystore.proto deleted file mode 100644 index 2caaedbf..0000000 --- a/chrome/browser/enterprise/connectors/device_trust/attestation_protos/keystore.proto +++ /dev/null
@@ -1,26 +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. - -// This file is an exact copy of -// third_party/cros_system_api/dbus/attestation/keystore.proto -// third_party/cros_system_api is only for ChromeOS. - -syntax = "proto2"; - -option optimize_for = LITE_RUNTIME; - -package attestation; -option go_package = "chromiumos/system_api/attestation_proto"; - -// Describes key type. -enum KeyType { - KEY_TYPE_RSA = 1; - KEY_TYPE_ECC = 2; -} - -// Describes allowed key usage. -enum KeyUsage { - KEY_USAGE_SIGN = 1; - KEY_USAGE_DECRYPT = 2; -}
diff --git a/chrome/browser/enterprise/connectors/device_trust/attestation_service.cc b/chrome/browser/enterprise/connectors/device_trust/attestation_service.cc deleted file mode 100644 index 854bb941..0000000 --- a/chrome/browser/enterprise/connectors/device_trust/attestation_service.cc +++ /dev/null
@@ -1,140 +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. - -#include "chrome/browser/enterprise/connectors/device_trust/attestation_service.h" - -#include "base/base64.h" -#include "base/json/json_reader.h" -#include "base/json/json_string_value_serializer.h" -#include "base/json/json_writer.h" -#include "base/logging.h" -#include "base/values.h" -#include "chrome/browser/enterprise/connectors/device_trust/device_trust_key_pair.h" - -namespace attestation { - -AttestationService::AttestationService() { -#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - key_pair_ = std::make_unique<enterprise_connectors::DeviceTrustKeyPair>(); - key_pair_->Init(); -#endif // defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) -} - -AttestationService::~AttestationService() = default; - -std::string AttestationService::JsonChallengeToProtobufChallenge( - const std::string& challenge) { - attestation::SignedData signed_challenge; - // Get challenge and decode it. - base::Optional<base::Value> data = base::JSONReader::Read( - challenge, base::JSONParserOptions::JSON_ALLOW_TRAILING_COMMAS); - - // If json is malformed or it doesn't include the needed fields return - // an empty string. - if (!data || !data.value().FindPath("challenge.data") || - !data.value().FindPath("challenge.signature")) - return std::string(); - - base::Base64Decode(data.value().FindPath("challenge.data")->GetString(), - signed_challenge.mutable_data()); - base::Base64Decode(data.value().FindPath("challenge.signature")->GetString(), - signed_challenge.mutable_signature()); - - std::string serialized_signed_challenge; - if (!signed_challenge.SerializeToString(&serialized_signed_challenge)) { - LOG(ERROR) << __func__ << ": Failed to serialize signed data."; - return std::string(); - } - return serialized_signed_challenge; -} - -std::string AttestationService::ProtobufChallengeToJsonChallenge( - const std::string& challenge_response) { - base::Value signed_data(base::Value::Type::DICTIONARY); - - std::string encoded; - base::Base64Encode(challenge_response, &encoded); - signed_data.SetKey("data", base::Value(encoded)); - -#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - std::string signature; - key_pair_->GetSignatureInBase64(challenge_response, &signature); - signed_data.SetKey("signature", base::Value(signature)); -#endif // defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - - base::Value dict(base::Value::Type::DICTIONARY); - dict.SetKey("challengeResponse", std::move(signed_data)); - - std::string json; - base::JSONWriter::Write(dict, &json); - return json; -} - -#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) -std::string AttestationService::ExportPEMPublicKey() { - return key_pair_->ExportPEMPublicKey(); -} -#endif // defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - -void AttestationService::SignEnterpriseChallenge( - const SignEnterpriseChallengeRequest& request, - SignEnterpriseChallengeReply* result) { - SignEnterpriseChallengeTask(request, result); -} - -void AttestationService::SignEnterpriseChallengeTask( - const SignEnterpriseChallengeRequest& request, - SignEnterpriseChallengeReply* result) { - // Validate that the challenge is coming from the expected source. - SignedData signed_challenge; - if (!signed_challenge.ParseFromString(request.challenge())) { - LOG(ERROR) << __func__ << ": Failed to parse signed challenge."; - result->set_status(STATUS_INVALID_PARAMETER); - return; - } - - KeyInfo key_info; - // Set the public key so VA can verify the client. -#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - key_info.set_signed_public_key_and_challenge(ExportPEMPublicKey()); -#endif // defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - - ChallengeResponse response_pb; - *response_pb.mutable_challenge() = signed_challenge; - // TODO(b/185459013): Encrypt `key_info` and add it to `response_pb`. - - // Serialize and sign the response protobuf. - std::string serialized; - if (!response_pb.SerializeToString(&serialized)) { - result->set_status(STATUS_UNEXPECTED_DEVICE_ERROR); - return; - } - // Sign data using the client generated key pair. - if (!SignChallengeData(serialized, result->mutable_challenge_response())) { - result->clear_challenge_response(); - result->set_status(STATUS_UNEXPECTED_DEVICE_ERROR); - return; - } -} - -bool AttestationService::SignChallengeData(const std::string& data, - std::string* response) { - std::string signature; -#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - if (!key_pair_->GetSignatureInBase64(data, &signature)) { - LOG(ERROR) << __func__ << ": Failed to sign data."; - return false; - } -#endif // defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - SignedData signed_data; - signed_data.set_data(data); - signed_data.set_signature(signature); - if (!signed_data.SerializeToString(response)) { - LOG(ERROR) << __func__ << ": Failed to serialize signed data."; - return false; - } - return true; -} - -} // namespace attestation
diff --git a/chrome/browser/enterprise/connectors/device_trust/attestation_service.h b/chrome/browser/enterprise/connectors/device_trust/attestation_service.h deleted file mode 100644 index 206a5b9..0000000 --- a/chrome/browser/enterprise/connectors/device_trust/attestation_service.h +++ /dev/null
@@ -1,84 +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. - -#ifndef CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_ATTESTATION_SERVICE_H_ -#define CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_ATTESTATION_SERVICE_H_ - -#include "build/build_config.h" -#include "chrome/browser/enterprise/connectors/device_trust/attestation_ca.pb.h" -#include "chrome/browser/enterprise/connectors/device_trust/interface.pb.h" - -namespace enterprise_connectors { - -class DeviceTrustKeyPair; - -} - -namespace attestation { - -// This class is in charge of handling the key pair used for attestation. Also -// provides the methods needed in the handshake between Chrome, an IdP and -// Verified Access. -// The main method is `SignEnterpriseChallenge` which take a challenge request -// and builds a challenge response and wrap it into a -// `SignEnterpriseChallengeReply`. -class AttestationService { - public: - AttestationService(); - ~AttestationService(); - - // Export the public key of `key_pair_`. - std::string ExportPEMPublicKey(); - - void SignEnterpriseChallenge(const SignEnterpriseChallengeRequest& request, - SignEnterpriseChallengeReply* result); - - // Take the challenge that comes from the Idp in json format and generate a - // SignedData proto. - // The expected format of the challenge is the following: - // { - // "challenge": { - // object (SignedData) - // } - // } - // SignedData has the following scheme: - // { - // "data": string (base64 encoded string), - // "signature": string (base64 encoded string), - // } - std::string JsonChallengeToProtobufChallenge(const std::string& challenge); - - // Take a challenge_response proto and return the json version of it. - // The format is the following: - // { - // "challengeResponse": { - // object (SignedData) - // } - // } - // SignedData has the following scheme: - // { - // "data": string (base64 encoded string), - // "signature": string (base64 encoded string), - // } - std::string ProtobufChallengeToJsonChallenge( - const std::string& challenge_response); - - private: - // Sign the challenge and return the challenge response in - // `result.challenge_response`. - void SignEnterpriseChallengeTask( - const SignEnterpriseChallengeRequest& request, - SignEnterpriseChallengeReply* result); - - // Sign `data` using `key_pair_` and store that value in `signature`. - bool SignChallengeData(const std::string& data, std::string* response); - -#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - std::unique_ptr<enterprise_connectors::DeviceTrustKeyPair> key_pair_; -#endif // defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) -}; - -} // namespace attestation - -#endif // CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_ATTESTATION_SERVICE_H_
diff --git a/chrome/browser/enterprise/connectors/device_trust/attestation_service_unittest.cc b/chrome/browser/enterprise/connectors/device_trust/attestation_service_unittest.cc deleted file mode 100644 index 3ffb9bd..0000000 --- a/chrome/browser/enterprise/connectors/device_trust/attestation_service_unittest.cc +++ /dev/null
@@ -1,87 +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. - -#include "chrome/browser/enterprise/connectors/device_trust/attestation_service.h" - -#include "base/base64.h" -#include "base/json/json_reader.h" -#include "base/logging.h" -#include "base/values.h" -#include "chrome/test/base/scoped_testing_local_state.h" -#include "chrome/test/base/testing_browser_process.h" -#include "chrome/test/base/testing_profile.h" -#include "components/os_crypt/os_crypt_mocker.h" -#include "content/public/test/browser_task_environment.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace { - -constexpr char challenge[] = - "{" - "\"challenge\": {" - " \"data\": " - "\"ChZFbnRlcnByaXNlS2V5Q2hhbGxlbmdlEiAXyp394cl5TtKo+yhlQPa+CQMPbFyIoY//" - "CXHxvDqVqhiBktSOgi8=\"," - " \"signature\": " - "\"BRRaR9cKJe6NRBAUtPLjRujd0BawaYaPpHXzaWxSqCbFZcB2ZnDwFskh4qPeO0EganhwrPBj" - "bD1yLXY1uiPM38TjYQgj2LFXyq0RjGehZ7qLDv2zebiIn6TIDvRi4rhEoXDg3bpKczBTDgp9im" - "BQ6QjJS7Pbj0kxPwHzkoVq5UnF9mUUecOAHgKV6ONs4rVjNSpZAPSD/" - "jC39wDlIXR5YDKSPCs46u66koDyjM7DNVig+S8nTdr14sXEGFSiHyeFaZC5kXQo103bB9j+" - "tcSpwa0MfuZJ5QFJlB1HipjpaGSImZbJPfkjtoK3F1rn9AiHz+nIjLWPrg3KnQt2eaTNSw==\"" - "}" - "}"; - -} // namespace - -namespace attestation { - -class AttestationServiceTest : public testing::Test { - public: - AttestationServiceTest() : local_state_(TestingBrowserProcess::GetGlobal()) {} - void SetUp() override { - testing::Test::SetUp(); - OSCryptMocker::SetUp(); - } - - void TearDown() override { - testing::Test::TearDown(); - OSCryptMocker::TearDown(); - } - - private: - ScopedTestingLocalState local_state_; -}; - -TEST_F(AttestationServiceTest, BuildChallengeResponse) { - AttestationService attestation_service_; - SignEnterpriseChallengeRequest request; - SignEnterpriseChallengeReply result; - // Get the challenge from the SignedData json and create request. - request.set_challenge( - attestation_service_.JsonChallengeToProtobufChallenge(challenge)); - // If challenge is equal to empty string, then - // `JsonChallengeToProtobufChallenge()` failed. - EXPECT_NE(request.challenge(), std::string()); - - attestation_service_.SignEnterpriseChallenge(request, &result); - // If challenge is equal to empty string, then - // `JsonChallengeToProtobufChallenge()` failed. - EXPECT_NE(result.challenge_response(), std::string()); - - base::Optional<base::Value> challenge_response = base::JSONReader::Read( - attestation_service_.ProtobufChallengeToJsonChallenge( - result.challenge_response()), - base::JSONParserOptions::JSON_ALLOW_TRAILING_COMMAS); - - EXPECT_NE(challenge_response.value() - .FindPath("challengeResponse.data") - ->GetString(), - std::string()); - EXPECT_NE(challenge_response.value() - .FindPath("challengeResponse.signature") - ->GetString(), - std::string()); -} - -} // namespace attestation
diff --git a/chrome/browser/enterprise/connectors/device_trust/device_trust_key_pair.cc b/chrome/browser/enterprise/connectors/device_trust/device_trust_key_pair.cc index 634e8bf..e0b8bca 100644 --- a/chrome/browser/enterprise/connectors/device_trust/device_trust_key_pair.cc +++ b/chrome/browser/enterprise/connectors/device_trust/device_trust_key_pair.cc
@@ -96,7 +96,7 @@ if (!base::Base64Decode(base64_encrypted_private_key_info, &decoded)) { // TODO(crbug/1176175): Handle error for when it can't get the private // key. - LOG(ERROR) << "[Init] error while decoding the private key"; + LOG(ERROR) << "[DeviceTrust - Init] error while decoding the private key"; return false; } @@ -105,7 +105,7 @@ if (!success) { // TODO(crbug/1176175): Handle error for when it can't get the private // key. - LOG(ERROR) << "[Init] error while decrypting the private key"; + LOG(ERROR) << "[DeviceTrust - Init] error while decrypting the private key"; return false; } @@ -117,7 +117,7 @@ bool DeviceTrustKeyPair::StoreKeyPair() { if (!key_pair_) { - LOG(ERROR) << "[StoreKeyPair] no `key_pair_` member"; + LOG(ERROR) << "[DeviceTrust - StoreKeyPair] no `key_pair_` member"; return false; } @@ -131,7 +131,8 @@ std::string encrypted_key; bool encrypted = OSCrypt::EncryptString(encoded_private_key, &encrypted_key); if (!encrypted) { - LOG(ERROR) << "[StoreKeyPair] error while encrypting the private key."; + LOG(ERROR) << "[DeviceTrust - StoreKeyPair] error while encrypting the " + "private key."; return false; } // The string must be encoded as base64 for storage in local state. @@ -181,20 +182,4 @@ return public_key; } -bool DeviceTrustKeyPair::SignMessage(const std::string& message, - std::vector<uint8_t>& signature) { - std::unique_ptr<crypto::ECSignatureCreator> signer( - crypto::ECSignatureCreator::Create(key_pair_.get())); - return signer->Sign(reinterpret_cast<const uint8_t*>(message.c_str()), - message.size(), &signature); -} -bool DeviceTrustKeyPair::GetSignatureInBase64(const std::string& message, - std::string* signature) { - std::vector<uint8_t> signature_vector; - if (!SignMessage(message, signature_vector)) - return false; - *signature = BytesToEncodedString(signature_vector); - return true; -} - } // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/device_trust/device_trust_key_pair.h b/chrome/browser/enterprise/connectors/device_trust/device_trust_key_pair.h index 667ad7e..82fd0d5 100644 --- a/chrome/browser/enterprise/connectors/device_trust/device_trust_key_pair.h +++ b/chrome/browser/enterprise/connectors/device_trust/device_trust_key_pair.h
@@ -50,13 +50,6 @@ // Return strue on success. bool Init(); - // Sign `message` using elliptic curve (EC) private key. - bool SignMessage(const std::string& message, std::vector<uint8_t>& signature); - - // Sign `message` using `SignMessage` method and return the signature as a - // base64 encode string. - bool GetSignatureInBase64(const std::string& message, std::string* signature); - private: std::unique_ptr<crypto::ECPrivateKey> key_pair_;
diff --git a/chrome/browser/enterprise/connectors/device_trust/device_trust_service.cc b/chrome/browser/enterprise/connectors/device_trust/device_trust_service.cc index d2c28d1..4441370e 100644 --- a/chrome/browser/enterprise/connectors/device_trust/device_trust_service.cc +++ b/chrome/browser/enterprise/connectors/device_trust/device_trust_service.cc
@@ -4,15 +4,9 @@ #include "chrome/browser/enterprise/connectors/device_trust/device_trust_service.h" -#include "base/base64.h" -#include "base/base64url.h" -#include "base/json/json_reader.h" -#include "base/json/json_writer.h" #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/connectors_prefs.h" -#include "chrome/browser/enterprise/connectors/device_trust/attestation_ca.pb.h" -#include "chrome/browser/enterprise/connectors/device_trust/interface.pb.h" #include "chrome/browser/enterprise/connectors/device_trust/signal_reporter.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" @@ -31,7 +25,6 @@ key_pair_ = std::make_unique<DeviceTrustKeyPair>(); #endif // defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - attestation_service_ = std::make_unique<attestation::AttestationService>(); pref_observer_.Init(prefs_); pref_observer_.Add(kContextAwareAccessSignalsAllowlistPref, base::BindRepeating(&DeviceTrustService::OnPolicyUpdated, @@ -132,17 +125,4 @@ } #endif // defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) -std::string DeviceTrustService::BuildChallengeResponse( - const std::string& challenge) { - ::attestation::SignEnterpriseChallengeRequest request; - ::attestation::SignEnterpriseChallengeReply result; - // Get the challenge from the SignedData json and create request. - request.set_challenge( - attestation_service_->JsonChallengeToProtobufChallenge(challenge)); - attestation_service_->SignEnterpriseChallenge(request, &result); - - return attestation_service_->ProtobufChallengeToJsonChallenge( - result.challenge_response()); -} - } // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/device_trust/device_trust_service.h b/chrome/browser/enterprise/connectors/device_trust/device_trust_service.h index 40a0698..2afb6b37 100644 --- a/chrome/browser/enterprise/connectors/device_trust/device_trust_service.h +++ b/chrome/browser/enterprise/connectors/device_trust/device_trust_service.h
@@ -6,7 +6,8 @@ #define CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_DEVICE_TRUST_SERVICE_H_ #include "build/build_config.h" -#include "chrome/browser/enterprise/connectors/device_trust/attestation_service.h" +#include "build/buildflag.h" +#include "build/chromeos_buildflags.h" #include "components/keyed_service/core/keyed_service.h" #include "components/policy/core/browser/configuration_policy_handler.h" #include "components/prefs/pref_change_registrar.h" @@ -46,10 +47,6 @@ std::string GetAttestationCredentialForTesting() const; #endif // defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MAC) - // Starts flow that actually builds a response. This method is called - // from a non_UI thread. - std::string BuildChallengeResponse(const std::string& challenge); - private: friend class DeviceTrustFactory; @@ -76,7 +73,6 @@ std::unique_ptr<enterprise_connectors::DeviceTrustSignalReporter> reporter_; SignalReportCallback signal_report_callback_; - std::unique_ptr<attestation::AttestationService> attestation_service_; base::WeakPtrFactory<DeviceTrustService> weak_factory_{this}; };
diff --git a/chrome/browser/enterprise/connectors/device_trust/navigation_throttle.cc b/chrome/browser/enterprise/connectors/device_trust/navigation_throttle.cc index 09e4182..834bb65 100644 --- a/chrome/browser/enterprise/connectors/device_trust/navigation_throttle.cc +++ b/chrome/browser/enterprise/connectors/device_trust/navigation_throttle.cc
@@ -5,18 +5,13 @@ #include "chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h" #include "base/memory/ptr_util.h" -#include "base/task/task_traits.h" -#include "base/task/thread_pool.h" -#include "base/values.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/connectors_prefs.h" #include "chrome/browser/enterprise/connectors/device_trust/device_trust_factory.h" -#include "chrome/browser/enterprise/connectors/device_trust/device_trust_service.h" -#include "chrome/browser/enterprise/connectors/device_trust/interface.pb.h" +#include "chrome/browser/enterprise/util/managed_browser_utils.h" +#include "chrome/browser/policy/chrome_browser_policy_connector.h" #include "chrome/browser/profiles/profile.h" #include "components/policy/core/browser/url_util.h" #include "components/prefs/pref_service.h" -#include "components/url_matcher/url_matcher.h" #include "components/user_prefs/user_prefs.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/navigation_handle.h" @@ -25,13 +20,6 @@ namespace enterprise_connectors { -// Const headers used in the handshake flow. -constexpr char kDeviceTrustHeader[] = "X-Device-Trust"; -constexpr char kDeviceTrustHeaderValue[] = "VerifiedAccess"; -constexpr char kVerifiedAccessChallengeHeader[] = "X-Verified-Access-Challenge"; -constexpr char kVerifiedAccessResponseHeader[] = - "X-Verified-Access-Challenge-Response"; - // static std::unique_ptr<DeviceTrustNavigationThrottle> DeviceTrustNavigationThrottle::MaybeCreateThrottleFor( @@ -118,57 +106,18 @@ // If we are starting an attestation flow. if (navigation_handle()->GetResponseHeaders() == nullptr) { - navigation_handle()->SetRequestHeader(kDeviceTrustHeader, - kDeviceTrustHeaderValue); + navigation_handle()->SetRequestHeader("X-Device-Trust", "VerifiedAccess"); return PROCEED; } // If a challenge is coming from the Idp. - if (navigation_handle()->GetResponseHeaders()->HasHeader( - kVerifiedAccessChallengeHeader)) { - // Remove request header since is not needed for challenge response. - navigation_handle()->RemoveRequestHeader(kDeviceTrustHeader); - - // Get challenge. - const net::HttpResponseHeaders* headers = - navigation_handle()->GetResponseHeaders(); - std::string challenge; - if (headers->GetNormalizedHeader(kVerifiedAccessChallengeHeader, - &challenge)) { - // Post a task to get the challenge response. It will defer the navigation - // and it will be resumed after it's built. - // `StartSignChallengeAndReplyWithResponse` won't run in the main thread, - // and then reply to `ReplyChallengeResponseAndResume` which makes use of - // `weak_ptr_factory_.GetWeakPtr()` so it won't run in case the object is - // destroyed. - AttestationCallback reply = base::BindOnce( - &DeviceTrustNavigationThrottle::ReplyChallengeResponseAndResume, - weak_ptr_factory_.GetWeakPtr()); - - base::ThreadPool::PostTaskAndReplyWithResult( - FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING}, - base::BindOnce(&DeviceTrustNavigationThrottle:: - StartSignChallengeAndReplyWithResponse, - base::Unretained(this), challenge), - std::move(reply)); - - return DEFER; - } + if (!navigation_handle()->GetRequestHeaders().HasHeader( + "x-verified-access-challenge")) { + navigation_handle()->RemoveRequestHeader("X-Device-Trust"); + return PROCEED; } + return PROCEED; } -std::string -DeviceTrustNavigationThrottle::StartSignChallengeAndReplyWithResponse( - const std::string& challenge) { - return device_trust_service_->BuildChallengeResponse(challenge); -} - -void DeviceTrustNavigationThrottle::ReplyChallengeResponseAndResume( - std::string challenge_response) { - navigation_handle()->SetRequestHeader(kVerifiedAccessResponseHeader, - challenge_response); - Resume(); -} - } // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h b/chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h index ddb946a..5d17aa2 100644 --- a/chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h +++ b/chrome/browser/enterprise/connectors/device_trust/navigation_throttle.h
@@ -5,37 +5,22 @@ #ifndef CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_NAVIGATION_THROTTLE_H_ #define CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_NAVIGATION_THROTTLE_H_ +#include "chrome/browser/enterprise/connectors/device_trust/device_trust_service.h" #include "components/prefs/pref_change_registrar.h" +#include "components/url_matcher/url_matcher.h" #include "content/public/browser/navigation_throttle.h" class GURL; -namespace url_matcher { - -class URLMatcher; - -} - namespace enterprise_connectors { -class DeviceTrustService; - // DeviceTrustNavigationThrottle provides a simple way to start a handshake // base on a list of allowed URLs. -// Handshake is an exchange between Chrome and an IdP. This start when Chrome -// visit one of the allowed list of URLs set in the policy -// `ContextAwareAccessSignalsAllowlist`. Chrome will add a HTTP header -// (X-Device-Trust: VerifiedAccess), when the IdP detect that header it should -// reply with a challenge from Verified Access. Chrome will take this challenge -// and build a challenge response that is sent back to the IdP using another -// HTTP header (X-Verified-Access-Challenge-Response). class DeviceTrustNavigationThrottle : public content::NavigationThrottle { public: static std::unique_ptr<DeviceTrustNavigationThrottle> MaybeCreateThrottleFor( content::NavigationHandle* navigation_handle); - using AttestationCallback = base::OnceCallback<void(std::string)>; - explicit DeviceTrustNavigationThrottle( content::NavigationHandle* navigation_handle); DeviceTrustNavigationThrottle(const DeviceTrustNavigationThrottle&) = delete; @@ -55,26 +40,11 @@ content::NavigationThrottle::ThrottleCheckResult AddHeadersIfNeeded(); - // Not owned. DeviceTrustService* device_trust_service_; - - // Set `challege_response` into the header - // `X-Verified-Access-Challenge-Response` of the redirection request to the - // IdP and resume the navigation. - void ReplyChallengeResponseAndResume(std::string challenge_response); - - // Call `DeviceTrustService::BuildChallengeResponse` which is the method that - // actually builds the challenge response, and return it as a string with the - // format described in `AttestationService::ProtobufChallengeToJsonChallenge`. - std::string StartSignChallengeAndReplyWithResponse( - const std::string& challenge); - // The URL matcher created from the ContextAwareAccessSignalsAllowlist policy. std::unique_ptr<url_matcher::URLMatcher> matcher_; PrefChangeRegistrar pref_change_registrar_; - - base::WeakPtrFactory<DeviceTrustNavigationThrottle> weak_ptr_factory_{this}; }; } // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/device_trust/navigation_throttle_unittest.cc b/chrome/browser/enterprise/connectors/device_trust/navigation_throttle_unittest.cc index 2546dfd8..d73f0b1 100644 --- a/chrome/browser/enterprise/connectors/device_trust/navigation_throttle_unittest.cc +++ b/chrome/browser/enterprise/connectors/device_trust/navigation_throttle_unittest.cc
@@ -1,4 +1,4 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. +// Copyright (c) 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. @@ -20,8 +20,8 @@ namespace { -const base::Value kOrigins[]{base::Value("https://www.example.com"), - base::Value("example2.example.com")}; +const base::Value origins[]{base::Value("https://www.example.com"), + base::Value("example2.example.com")}; } // namespace @@ -47,7 +47,7 @@ Profile::FromBrowserContext(browser_context()) ->GetPrefs() ->Set(kContextAwareAccessSignalsAllowlistPref, - base::ListValue(kOrigins)); + std::move(base::ListValue(origins))); } private:
diff --git a/chrome/browser/enterprise/connectors/file_system/box_api_call_test_helper.cc b/chrome/browser/enterprise/connectors/file_system/box_api_call_test_helper.cc index 948d56fb..d646e8fe 100644 --- a/chrome/browser/enterprise/connectors/file_system/box_api_call_test_helper.cc +++ b/chrome/browser/enterprise/connectors/file_system/box_api_call_test_helper.cc
@@ -115,4 +115,26 @@ // extracted part_size from body above. const size_t kFileSystemBoxChunkedUploadCreateSessionResponsePartSize = 7340032; +void GenerateFileContent(size_t part_size, + size_t total_size, + std::string& txt) { + txt.clear(); + txt.reserve(total_size); + CHECK_LT(total_size, part_size * 26); + for (char c = 'a'; c <= 'z' && (txt.size() + part_size) < total_size; ++c) { + txt += std::string(part_size, c); + } + txt += std::string(total_size - txt.size(), 'z'); + CHECK_EQ(total_size, txt.size()); +} + +size_t CalculateExpectedChunkReadCount(size_t file_size, size_t chunk_size) { + DCHECK_GE(file_size, chunk_size); + size_t expected_read_count = file_size / chunk_size; + if (file_size % chunk_size != 0) { + ++expected_read_count; + } + return expected_read_count; +} + } // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/file_system/box_api_call_test_helper.h b/chrome/browser/enterprise/connectors/file_system/box_api_call_test_helper.h index 93e89208..bf8a642 100644 --- a/chrome/browser/enterprise/connectors/file_system/box_api_call_test_helper.h +++ b/chrome/browser/enterprise/connectors/file_system/box_api_call_test_helper.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_ENTERPRISE_CONNECTORS_FILE_SYSTEM_BOX_API_CALL_TEST_HELPER_H_ #include <cstddef> +#include <string> namespace enterprise_connectors { @@ -46,6 +47,12 @@ // Expected part_size extracted from above. extern const size_t kFileSystemBoxChunkedUploadCreateSessionResponsePartSize; +void GenerateFileContent(size_t fill_part_size, + size_t total_file_size, + std::string& content); + +size_t CalculateExpectedChunkReadCount(size_t file_size, size_t chunk_size); + } // namespace enterprise_connectors #endif // CHROME_BROWSER_ENTERPRISE_CONNECTORS_FILE_SYSTEM_BOX_API_CALL_TEST_HELPER_H_
diff --git a/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler.cc b/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler.cc index 7af5b56..71a82a1 100644 --- a/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler.cc +++ b/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler.cc
@@ -33,7 +33,7 @@ namespace enterprise_connectors { -using FileChunksHandler = BoxUploader::FileChunksHandler; +using FileChunksHandler = BoxChunkedUploader::FileChunksHandler; FileChunksHandler::FileChunksHandler(const base::FilePath& path, const size_t file_size,
diff --git a/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler.h b/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler.h index 9bebb987..54262fb 100644 --- a/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler.h +++ b/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler.h
@@ -24,18 +24,13 @@ // meant for cryptographic security, so the corresponding API requests must be // made via https for security/privacy. It uses SHA-1 only because Box requires // SHA-1 for file integrity check, not to detect MitM attacks. -class BoxUploader::FileChunksHandler { +class BoxChunkedUploader::FileChunksHandler { public: - struct PartInfo { - const std::string content; - size_t byte_from; // Inclusive of 1st byte of the file part. - size_t byte_to; // Inclusive of last byte in the file part. - // Therefore byte_to == byte_from + content.size() - 1. - }; // Arg: PartInfo for the last chunk read. using FilePartiallyReadCallback = base::RepeatingCallback<void(PartInfo)>; // Arg: SHA-1 digest of the entire file. - using FileCompletelyReadCallback = base::OnceCallback<void(std::string)>; + using FileCompletelyReadCallback = + base::OnceCallback<void(const std::string&)>; FileChunksHandler(const base::FilePath& path, const size_t file_size, const size_t chunk_size);
diff --git a/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler_unittest.cc b/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler_unittest.cc index a7c2720..c63a973 100644 --- a/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler_unittest.cc +++ b/chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler_unittest.cc
@@ -19,7 +19,7 @@ namespace enterprise_connectors { const size_t kChunkSize = BoxApiCallFlow::kChunkFileUploadMinSize; -using FileChunksHandler = BoxUploader::FileChunksHandler; +using FileChunksHandler = BoxChunkedUploader::FileChunksHandler; class BoxUploadFileChunksHandlerTest : public testing::Test { public: @@ -63,14 +63,14 @@ base::Unretained(this))); } - void OnFileCompletelyRead(std::string sha1_digest) { + void OnFileCompletelyRead(const std::string& sha1_digest) { file_finished_reading_ = true; file_successfully_read_ = !sha1_digest.empty(); file_sha1_digest_ = sha1_digest; return Quit(); } - void OnFileChunkRead(FileChunksHandler::PartInfo part_info) { + void OnFileChunkRead(BoxChunkedUploader::PartInfo part_info) { file_chunk_successfully_read_ = part_info.content.size(); if (!file_chunk_successfully_read_) { return Quit();
diff --git a/chrome/browser/enterprise/connectors/file_system/box_uploader.cc b/chrome/browser/enterprise/connectors/file_system/box_uploader.cc index 318f20d4..714dbfbe 100644 --- a/chrome/browser/enterprise/connectors/file_system/box_uploader.cc +++ b/chrome/browser/enterprise/connectors/file_system/box_uploader.cc
@@ -9,6 +9,7 @@ #include "base/task/thread_pool.h" #include "chrome/browser/enterprise/connectors/connectors_prefs.h" #include "chrome/browser/enterprise/connectors/file_system/box_api_call_flow.h" +#include "chrome/browser/enterprise/connectors/file_system/box_upload_file_chunks_handler.h" #include "components/prefs/pref_service.h" #include "net/http/http_status_code.h" @@ -39,8 +40,7 @@ BoxApiCallFlow::kChunkFileUploadMinSize) { return std::make_unique<BoxDirectUploader>(download_item); } else { - // TODO(https://crbug.com/1192671) BoxChunkedUploader. - return nullptr; + return std::make_unique<BoxChunkedUploader>(download_item); } } @@ -288,4 +288,161 @@ OnApiCallFlowDone(success); } +//////////////////////////////////////////////////////////////////////////////// +// BoxChunkedUploader +//////////////////////////////////////////////////////////////////////////////// + +BoxChunkedUploader::BoxChunkedUploader(download::DownloadItem* download_item) + : BoxUploader(download_item), + file_size_(download_item->GetTotalBytes()), + uploaded_parts_(base::Value::Type::LIST) {} + +BoxChunkedUploader::~BoxChunkedUploader() = default; + +std::unique_ptr<OAuth2ApiCallFlow> BoxChunkedUploader::MakeFileUploadApiCall() { + return MakeCreateUploadSessionApiCall(); +} + +std::unique_ptr<OAuth2ApiCallFlow> +BoxChunkedUploader::MakeCreateUploadSessionApiCall() { + return std::make_unique<BoxCreateUploadSessionApiCallFlow>( + base::BindOnce(&BoxChunkedUploader::OnCreateUploadSessionResponse, + weak_factory_.GetWeakPtr()), + GetFolderId(), file_size_, GetTargetFileName()); +} + +std::unique_ptr<OAuth2ApiCallFlow> +BoxChunkedUploader::MakePartFileUploadApiCall() { + return std::make_unique<BoxPartFileUploadApiCallFlow>( + base::BindOnce(&BoxChunkedUploader::OnPartFileUploadResponse, + weak_factory_.GetWeakPtr()), + session_endpoints_.FindPath("upload_part")->GetString(), + curr_part_.content, curr_part_.byte_from, curr_part_.byte_to, file_size_); +} + +std::unique_ptr<OAuth2ApiCallFlow> +BoxChunkedUploader::MakeCommitUploadSessionApiCall() { + return std::make_unique<BoxCommitUploadSessionApiCallFlow>( + base::BindOnce(&BoxChunkedUploader::OnCommitUploadSsessionResponse, + weak_factory_.GetWeakPtr()), + session_endpoints_.FindPath("commit")->GetString(), uploaded_parts_, + sha1_digest_); +} + +std::unique_ptr<OAuth2ApiCallFlow> +BoxChunkedUploader::MakeAbortUploadSessionApiCall() { + return std::make_unique<BoxAbortUploadSessionApiCallFlow>( + base::BindOnce(&BoxChunkedUploader::OnAbortUploadSsessionResponse, + weak_factory_.GetWeakPtr()), + session_endpoints_.FindPath("abort")->GetString()); +} + +void BoxChunkedUploader::OnCreateUploadSessionResponse( + bool success, + int response_code, + base::Value session_endpoints, + size_t part_size) { + if (!EnsureSuccessResponse(success, response_code)) { + if (response_code == net::HTTP_NOT_FOUND) { + // Folder not found: clear locally stored folder id. + LOG(ERROR) << "Folder id = " << GetFolderId() << " not found; clearing"; + // TODO(https://crbug.com/1190396): May be removed with Preflight Check? + SetFolderId(std::string()); + } + SetCurrentApiCall(MakeCreateUploadSessionApiCall()); + return; + } + + session_endpoints_ = std::move(session_endpoints); + chunks_handler_ = std::make_unique<FileChunksHandler>(GetLocalFilePath(), + file_size_, part_size); + chunks_handler_->StartReading( + base::BindRepeating(&BoxChunkedUploader::OnFileChunkRead, + weak_factory_.GetWeakPtr()), + base::BindOnce(&BoxChunkedUploader::OnFileCompletelyUploaded, + weak_factory_.GetWeakPtr())); +} + +void BoxChunkedUploader::OnFileChunkRead(PartInfo part_info) { + if (part_info.content.empty()) { + LOG(ERROR) << "Failed to read file chunk"; + OnApiCallFlowFailure(); + return; + } + // Advance to upload the file part. + curr_part_ = std::move(part_info); + SetCurrentApiCall(MakePartFileUploadApiCall()); + TryCurrentApiCall(); +} + +void BoxChunkedUploader::OnPartFileUploadResponse(bool success, + int response_code, + base::Value part_info) { + if (!EnsureSuccessResponse(success, response_code)) { + if (response_code == net::HTTP_UNAUTHORIZED) { + // Setup current_api_call_ to retry upload the file part. + SetCurrentApiCall(MakePartFileUploadApiCall()); + } // else don't overwrite, since OnApiCallFlowFailure() was triggered in + // EnsureSuccessResponse() and abortion is in-progress. + return; + } + uploaded_parts_.Append(std::move(part_info)); + chunks_handler_->ContinueToReadChunk(uploaded_parts_.GetList().size() + 1); +} + +void BoxChunkedUploader::OnFileCompletelyUploaded( + const std::string& sha1_digest) { + if (sha1_digest.empty()) { + OnApiCallFlowFailure(); + } else { + sha1_digest_ = sha1_digest; + SetCurrentApiCall(MakeCommitUploadSessionApiCall()); + TryCurrentApiCall(); + } +} + +void BoxChunkedUploader::OnCommitUploadSsessionResponse( + bool success, + int response_code, + base::TimeDelta retry_after) { + if (!EnsureSuccessResponse(success, response_code)) { + if (response_code == net::HTTP_UNAUTHORIZED) { + SetCurrentApiCall(MakeCommitUploadSessionApiCall()); + } + return; + } + + if (response_code == net::HTTP_ACCEPTED) { + base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( + FROM_HERE, + base::BindOnce(&BoxChunkedUploader::OnFileCompletelyUploaded, + weak_factory_.GetWeakPtr(), sha1_digest_), + retry_after); + } else { + OnApiCallFlowDone(success); + } +} + +void BoxChunkedUploader::OnAbortUploadSsessionResponse(bool success, + int response_code) { + session_endpoints_.DictClear(); // Clear dict here to avoid infinite retry. + if (EnsureSuccessResponse(success, response_code)) { + OnApiCallFlowFailure(); + } else { + // OnApiCallFlowFailure() already triggered in EnsureSuccessResponse(). + LOG(ERROR) << "Unexpected response after aborting upload session for " + << GetTargetFileName(); + } +} + +void BoxChunkedUploader::OnApiCallFlowFailure() { + if (session_endpoints_.is_dict() && !session_endpoints_.DictEmpty()) { + chunks_handler_.reset(); + SetCurrentApiCall(MakeAbortUploadSessionApiCall()); + TryCurrentApiCall(); + } else { + BoxUploader::OnApiCallFlowFailure(); + } +} + } // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/file_system/box_uploader.h b/chrome/browser/enterprise/connectors/file_system/box_uploader.h index ff61656..05f97e9 100644 --- a/chrome/browser/enterprise/connectors/file_system/box_uploader.h +++ b/chrome/browser/enterprise/connectors/file_system/box_uploader.h
@@ -135,7 +135,62 @@ base::WeakPtrFactory<BoxDirectUploader> weak_factory_{this}; }; -// TODO(https://crbug.com/1192671) class BoxChunkedUploader. +// Task Manager extended from BoxUploader specifically to upload the file +// in chunks using API specified at +// https://developer.box.com/guides/uploads/chunked/. +class BoxChunkedUploader : public BoxUploader { + public: + explicit BoxChunkedUploader(download::DownloadItem* download_item); + ~BoxChunkedUploader() override; + + class FileChunksHandler; + + struct PartInfo { + std::string content; + size_t byte_from; // Inclusive of 1st byte of the file part. + size_t byte_to; // Inclusive of last byte in the file part. + // Therefore byte_to == byte_from + content.size() - 1. + }; + + private: + // BoxUploader interface. + void OnApiCallFlowFailure() override; + std::unique_ptr<OAuth2ApiCallFlow> MakeFileUploadApiCall() override; + + // Helper methods to transition between chunked upload steps. + std::unique_ptr<OAuth2ApiCallFlow> MakeCreateUploadSessionApiCall(); + std::unique_ptr<OAuth2ApiCallFlow> MakePartFileUploadApiCall(); + std::unique_ptr<OAuth2ApiCallFlow> MakeCommitUploadSessionApiCall(); + std::unique_ptr<OAuth2ApiCallFlow> MakeAbortUploadSessionApiCall(); + + // Callbacks for chunked file upload. + void OnCreateUploadSessionResponse(bool success, + int response_code, + base::Value session_endpoints, + size_t part_size); + void OnPartFileUploadResponse(bool success, + int response_code, + base::Value part_info); + void OnCommitUploadSsessionResponse(bool success, + int response_code, + base::TimeDelta retry_after); + void OnAbortUploadSsessionResponse(bool success, int response_code); + + // Callbacks for chunks_handler_. + + void OnFileChunkRead(PartInfo part_info); + void OnFileCompletelyUploaded(const std::string& sha1_digest); + + std::unique_ptr<FileChunksHandler> chunks_handler_; + + const size_t file_size_; + base::Value session_endpoints_; + PartInfo curr_part_; + base::Value uploaded_parts_; + std::string sha1_digest_; + base::WeakPtrFactory<BoxChunkedUploader> weak_factory_{this}; +}; + } // namespace enterprise_connectors #endif // CHROME_BROWSER_ENTERPRISE_CONNECTORS_FILE_SYSTEM_BOX_UPLOADER_H_
diff --git a/chrome/browser/enterprise/connectors/file_system/box_uploader_test_helper.cc b/chrome/browser/enterprise/connectors/file_system/box_uploader_test_helper.cc index 8538cb7..5c85725f 100644 --- a/chrome/browser/enterprise/connectors/file_system/box_uploader_test_helper.cc +++ b/chrome/browser/enterprise/connectors/file_system/box_uploader_test_helper.cc
@@ -51,24 +51,27 @@ profile_manager_(TestingBrowserProcess::GetGlobal()) { EXPECT_TRUE(profile_manager_.SetUp()); prefs_ = profile_manager_.CreateTestingProfile("test-user")->GetPrefs(); + SetInterceptorForURLLoader( + base::BindRepeating(&BoxUploaderTestBase::SetNextResponseForURLLoader, + base::Unretained(this))); } BoxUploaderTestBase::~BoxUploaderTestBase() = default; -void BoxUploaderTestBase::AddFetchResult(const std::string& url, - net::HttpStatusCode code, - std::string body) { - test_url_loader_factory_.AddResponse(url, std::move(body), code); -} - base::FilePath BoxUploaderTestBase::GetFilePath() const { return test_item_.GetFullPath(); } void BoxUploaderTestBase::CreateTemporaryFile() { + CreateTemporaryFileWithContent(GetTestName()); +} + +void BoxUploaderTestBase::CreateTemporaryFileWithContent(std::string content) { auto path = test_item_.GetFullPath(); ASSERT_FALSE(path.empty()); - ASSERT_TRUE(base::WriteFile(path, GetTestName())) << path; + ASSERT_TRUE(base::WriteFile(path, content)) << "Failed to create " << path; + test_item_.SetTotalBytes(content.size()); + ASSERT_EQ(test_item_.GetTotalBytes(), static_cast<int64_t>(content.size())); } void BoxUploaderTestBase::InitUploader(BoxUploader* uploader) { @@ -84,6 +87,31 @@ prefs_->SetString(kFileSystemUploadFolderIdPref, folder_id); } +void BoxUploaderTestBase::SetInterceptorForURLLoader( + network::TestURLLoaderFactory::Interceptor interceptor) { + test_url_loader_factory_.SetInterceptor(interceptor); +} + +void BoxUploaderTestBase::AddFetchResult(const std::string& url, + net::HttpStatusCode code, + std::string body) { + test_url_loader_factory_.AddResponse(url, std::move(body), code); +} + +void BoxUploaderTestBase::AddSequentialFetchResult(const std::string& url, + net::HttpStatusCode code, + std::string body) { + auto head = network::CreateURLResponseHead(code); + AddSequentialFetchResult(url, std::move(head), std::move(body)); +} + +void BoxUploaderTestBase::AddSequentialFetchResult( + const std::string& url, + network::mojom::URLResponseHeadPtr head, + std::string body) { + responses_.emplace(GURL(url), HttpResponse(std::move(head), std::move(body))); +} + void BoxUploaderTestBase::RunWithQuitClosure() { run_loop_ = std::make_unique<base::RunLoop>(); quit_closure_ = run_loop_->QuitClosure(); @@ -106,6 +134,33 @@ Quit(); } +void BoxUploaderTestBase::SetNextResponseForURLLoader( + const network::ResourceRequest& request) { + if (!responses_.count(request.url)) { + return; + } + auto iter = responses_.find(request.url); + auto& response = iter->second; + test_url_loader_factory_.AddResponse(request.url, std::move(response.head_), + response.body_, + network::URLLoaderCompletionStatus()); + responses_.erase(iter); +} + +//////////////////////////////////////////////////////////////////////////////// +// BoxUploaderTestBase::HttpResponse +//////////////////////////////////////////////////////////////////////////////// + +BoxUploaderTestBase::HttpResponse::HttpResponse( + network::mojom::URLResponseHeadPtr head, + std::string body) + : head_(std::move(head)), body_(std::move(body)) {} + +BoxUploaderTestBase::HttpResponse::~HttpResponse() = default; + +BoxUploaderTestBase::HttpResponse::HttpResponse(HttpResponse&& response) + : head_(std::move(response.head_)), body_(std::move(response.body_)) {} + //////////////////////////////////////////////////////////////////////////////// // MockApiCallFlow ////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/enterprise/connectors/file_system/box_uploader_test_helper.h b/chrome/browser/enterprise/connectors/file_system/box_uploader_test_helper.h index 2e045ab..6fe250b 100644 --- a/chrome/browser/enterprise/connectors/file_system/box_uploader_test_helper.h +++ b/chrome/browser/enterprise/connectors/file_system/box_uploader_test_helper.h
@@ -46,7 +46,8 @@ base::FilePath GetFilePath() const; protected: - void CreateTemporaryFile(); + virtual void CreateTemporaryFile(); + void CreateTemporaryFileWithContent(std::string content); void InitFolderIdInPrefs(std::string folder_id); void InitUploader(BoxUploader* uploader); @@ -58,6 +59,14 @@ void AddFetchResult(const std::string& url, net::HttpStatusCode code, std::string body = std::string()); + // Add multiple responses for the same url to be consumed in a sequence + // (FIFO). Any response previously added via AddFetchResult() is overwritten. + void AddSequentialFetchResult(const std::string& url, + net::HttpStatusCode code, + std::string body = std::string()); + void AddSequentialFetchResult(const std::string& url, + network::mojom::URLResponseHeadPtr head, + std::string body = std::string()); // Use these wherever possible, instead of base::RunLoop().RunUntilIdle(), // which is flaky in multi-threaded environment. @@ -85,6 +94,19 @@ // For RunWithQuitClosure() and Quit(). std::unique_ptr<base::RunLoop> run_loop_; base::OnceClosure quit_closure_; + + // Helper methods, struct, and member for AddSequentialFetchResult(). + void SetInterceptorForURLLoader(network::TestURLLoaderFactory::Interceptor); + void SetNextResponseForURLLoader(const network::ResourceRequest& request); + struct HttpResponse { + HttpResponse(network::mojom::URLResponseHeadPtr head, std::string body); + ~HttpResponse(); + HttpResponse(HttpResponse&&); + + network::mojom::URLResponseHeadPtr head_; + std::string body_; + }; + std::multimap<GURL, HttpResponse> responses_; }; class MockApiCallFlow : public BoxApiCallFlow {
diff --git a/chrome/browser/enterprise/connectors/file_system/box_uploader_unittest.cc b/chrome/browser/enterprise/connectors/file_system/box_uploader_unittest.cc index 3d89dc50..050f80f 100644 --- a/chrome/browser/enterprise/connectors/file_system/box_uploader_unittest.cc +++ b/chrome/browser/enterprise/connectors/file_system/box_uploader_unittest.cc
@@ -6,17 +6,53 @@ #include "chrome/browser/enterprise/connectors/file_system/box_uploader.h" +#include "base/json/json_writer.h" #include "chrome/browser/enterprise/connectors/file_system/box_api_call_test_helper.h" #include "chrome/browser/enterprise/connectors/file_system/box_uploader_test_helper.h" namespace enterprise_connectors { -class BoxUploaderCreateTest : public BoxUploaderTestBase {}; +class BoxUploaderCreateTest : public BoxUploaderTestBase { + public: + void RunUploader() { + // Assume preflight check passes, which is tested thoroughly separately. + AddFetchResult(kFileSystemBoxPreflightCheckUrl, net::HTTP_OK); + InitFolderIdInPrefs(kFileSystemBoxFolderIdInPref); + uploader_ = BoxUploader::Create(&test_item_); + ASSERT_TRUE(uploader_); + InitUploader(uploader_.get()); + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + } -TEST_F(BoxUploaderCreateTest, TestFileSizes) { - ASSERT_TRUE(BoxUploader::Create(&test_item_)); + std::unique_ptr<BoxUploader> uploader_; +}; + +TEST_F(BoxUploaderCreateTest, TestSmallFile) { + // Upload whole file, fail 404 (empty body since not reading from body): + AddFetchResult(kFileSystemBoxDirectUploadUrl, net::HTTP_UNAUTHORIZED); + + CreateTemporaryFile(); // BoxDirectUploader reads the file. + RunUploader(); + + ASSERT_EQ(authentication_retry_, 1); + EXPECT_FALSE(download_thread_cb_called_); + EXPECT_FALSE(upload_success_); + EXPECT_TRUE(base::PathExists(GetFilePath())); // File not deleted yet. +} + +TEST_F(BoxUploaderCreateTest, TestBigFile) { test_item_.SetTotalBytes(BoxApiCallFlow::kChunkFileUploadMinSize * 2); - ASSERT_FALSE(BoxUploader::Create(&test_item_)); + + // Create upload session, fail 404 (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, + net::HTTP_UNAUTHORIZED); + + RunUploader(); + + ASSERT_EQ(authentication_retry_, 1); + EXPECT_FALSE(download_thread_cb_called_); + EXPECT_FALSE(upload_success_); } //////////////////////////////////////////////////////////////////////////////// @@ -420,4 +456,311 @@ EXPECT_FALSE(upload_success_); } +//////////////////////////////////////////////////////////////////////////////// +// BoxChunkedUploaderTest +//////////////////////////////////////////////////////////////////////////////// + +class BoxChunkedUploaderTest : public BoxUploaderTestBase { + public: + BoxChunkedUploaderTest() + : BoxUploaderTestBase( + FILE_PATH_LITERAL("box_chunked_uploader_test.txt.crdownload")) {} + + void SetUp() override { + testing::Test::SetUp(); + // Assume there is already a folder_id stored. + InitFolderIdInPrefs(kFileSystemBoxFolderIdInPref); + + CreateTemporaryFile(); + uploader_ = BoxUploader::Create(&test_item_); + InitUploader(uploader_.get()); + + // Assume preflight check passes, which is tested thoroughly separately. + AddFetchResult(kFileSystemBoxPreflightCheckUrl, net::HTTP_OK); + } + + void TearDown() override { + EXPECT_TRUE(download_thread_cb_called_); + EXPECT_FALSE(base::PathExists(GetFilePath())); // Ensure file is deleted. + } + + void CreateTemporaryFile() override { + std::string content; + GenerateFileContent(BoxApiCallFlow::kChunkFileUploadMinSize / 10, + BoxApiCallFlow::kChunkFileUploadMinSize * 2, content); + CreateTemporaryFileWithContent(content); + } + + void AddUploadResultForPart(size_t idx, + bool success, + net::HttpStatusCode response_code, + size_t chunk_size, + size_t expected_chunks, + size_t total_size) { + base::Value part(base::Value::Type::DICTIONARY); + + if (success) { + const size_t curr_chunk_size = + (idx + 1 == expected_chunks) ? (total_size % chunk_size) : chunk_size; + part.SetStringKey("part_id", "BFDF5379"); // Placeholder. + part.SetIntKey("offset", chunk_size * idx); + part.SetIntKey("size", curr_chunk_size); + part.SetStringKey("sha1", "65991ed521fcfe4724b7d814ab"); // Placeholder. + } + + base::Value part_body(base::Value::Type::DICTIONARY); + part_body.SetKey("part", std::move(part)); + + std::string body; + base::JSONWriter::Write(part_body, &body); + + AddSequentialFetchResult(kFileSystemBoxChunkedUploadSessionUrl, + response_code, body); + } + + void AddUploadSuccessFetchResults() { + const size_t chunk_size = + kFileSystemBoxChunkedUploadCreateSessionResponsePartSize; + const size_t total_size = test_item_.GetTotalBytes(); + const size_t chunks_count = + CalculateExpectedChunkReadCount(total_size, chunk_size); + ASSERT_LE(total_size, chunk_size * chunks_count); + for (size_t pdx = 0; pdx < chunks_count; ++pdx) { + AddUploadResultForPart(pdx, true, net::HTTP_OK, chunk_size, chunks_count, + total_size); + } + } + + std::unique_ptr<BoxUploader> uploader_; +}; + +TEST_F(BoxChunkedUploaderTest, SuccessfulUpload) { + // Create upload session: + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, net::HTTP_CREATED, + kFileSystemBoxChunkedUploadCreateSessionResponseBody); + // Upload parts: + AddUploadSuccessFetchResults(); + // Commit upload session (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadCommitUrl, net::HTTP_CREATED); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + ASSERT_EQ(authentication_retry_, 0); + ASSERT_TRUE(upload_success_); +} + +TEST_F(BoxChunkedUploaderTest, FailedToCreateSession) { + // Create upload session (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, + net::HTTP_CONFLICT); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + ASSERT_EQ(authentication_retry_, 0); + ASSERT_FALSE(upload_success_); +} + +TEST_F(BoxChunkedUploaderTest, HasFolderIdStoredInPrefs_ButFailedOnBox) { + // Create upload session (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, + net::HTTP_NOT_FOUND); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + EXPECT_TRUE(uploader_->GetFolderIdForTesting().empty()); + + ASSERT_EQ(authentication_retry_, 0); + ASSERT_FALSE(upload_success_); +} + +TEST_F(BoxChunkedUploaderTest, AuthenticationRetry_DuringCreateSession) { + // Create upload session failed (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, + net::HTTP_UNAUTHORIZED); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + ASSERT_EQ(authentication_retry_, 1); + ASSERT_FALSE(upload_success_); + + // Create upload session: + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, net::HTTP_CREATED, + kFileSystemBoxChunkedUploadCreateSessionResponseBody); + // Upload parts: + AddUploadSuccessFetchResults(); + // Commit upload session (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadCommitUrl, net::HTTP_CREATED); + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + ASSERT_EQ(authentication_retry_, 1); + ASSERT_TRUE(upload_success_); +} + +TEST_F(BoxChunkedUploaderTest, AuthenticationRetry_DuringUploadPart) { + // Create upload session: + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, net::HTTP_CREATED, + kFileSystemBoxChunkedUploadCreateSessionResponseBody); + // Upload part failed (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadSessionUrl, net::HTTP_UNAUTHORIZED); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + ASSERT_EQ(authentication_retry_, 1); + ASSERT_FALSE(upload_success_); + + // Upload parts: + AddUploadSuccessFetchResults(); + // Commit upload session (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadCommitUrl, net::HTTP_CREATED); + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + ASSERT_EQ(authentication_retry_, 1); + ASSERT_TRUE(upload_success_); +} + +TEST_F(BoxChunkedUploaderTest, AuthenticationRetry_DuringCommitSession) { + // Create upload session: + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, net::HTTP_CREATED, + kFileSystemBoxChunkedUploadCreateSessionResponseBody); + // Upload parts: + AddUploadSuccessFetchResults(); + // Commit upload session failed (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadCommitUrl, net::HTTP_UNAUTHORIZED); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + ASSERT_EQ(authentication_retry_, 1); + ASSERT_FALSE(upload_success_); + + // Commit upload session (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadCommitUrl, net::HTTP_CREATED); + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + ASSERT_EQ(authentication_retry_, 1); + ASSERT_TRUE(upload_success_); +} + +TEST_F(BoxChunkedUploaderTest, FailedToUploadPart) { + // Create upload session: + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, net::HTTP_CREATED, + kFileSystemBoxChunkedUploadCreateSessionResponseBody); + // Upload part failed (empty body since not reading from body): + AddSequentialFetchResult(kFileSystemBoxChunkedUploadSessionUrl, + net::HTTP_PRECONDITION_FAILED); + // Abort upload session (empty body since not reading from body): + AddSequentialFetchResult(kFileSystemBoxChunkedUploadSessionUrl, + net::HTTP_NO_CONTENT); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + ASSERT_EQ(authentication_retry_, 0); + ASSERT_FALSE(upload_success_); +} + +TEST_F(BoxChunkedUploaderTest, FailedToAbortSession) { + // Create upload session: + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, net::HTTP_CREATED, + kFileSystemBoxChunkedUploadCreateSessionResponseBody); + // Upload part failed (empty body since not reading from body): + AddSequentialFetchResult(kFileSystemBoxChunkedUploadSessionUrl, + net::HTTP_PRECONDITION_FAILED); + // Abort upload session (empty body since not reading from body): + AddSequentialFetchResult(kFileSystemBoxChunkedUploadSessionUrl, + net::HTTP_NOT_FOUND); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + ASSERT_EQ(authentication_retry_, 0); + ASSERT_FALSE(upload_success_); +} + +TEST_F(BoxChunkedUploaderTest, FailedToCommitSession) { + // Create upload session: + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, net::HTTP_CREATED, + kFileSystemBoxChunkedUploadCreateSessionResponseBody); + // Upload parts: + AddUploadSuccessFetchResults(); + // Commit upload session failed (empty body since not reading from body): + AddFetchResult(kFileSystemBoxChunkedUploadCommitUrl, net::HTTP_CONFLICT); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + ASSERT_EQ(authentication_retry_, 0); + ASSERT_FALSE(upload_success_); +} + +TEST_F(BoxChunkedUploaderTest, CommitRetryAfter) { + // Create upload session: + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, net::HTTP_CREATED, + kFileSystemBoxChunkedUploadCreateSessionResponseBody); + // Upload parts: + AddUploadSuccessFetchResults(); + + // Mock a Retry-After header in response to commit upload session: + auto header = network::CreateURLResponseHead(net::HTTP_ACCEPTED); + header->headers->AddHeader("Retry-After", "1"); + AddSequentialFetchResult(kFileSystemBoxChunkedUploadCommitUrl, + std::move(header)); + // Commit upload session succeeded (empty body since not reading from body): + AddSequentialFetchResult(kFileSystemBoxChunkedUploadCommitUrl, + net::HTTP_CREATED); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + ASSERT_EQ(authentication_retry_, 0); + ASSERT_TRUE(upload_success_); +} + +class BoxChunkedUploaderFileFailureTest : public BoxChunkedUploaderTest { + public: + using BoxChunkedUploaderTest::BoxChunkedUploaderTest; + + void SetUp() override { + testing::Test::SetUp(); + // Assume there is already a folder_id stored. + InitFolderIdInPrefs(kFileSystemBoxFolderIdInPref); + + // No CreateTemporaryFile() to fail file open, but mock file size to create + // the correct uploader. + test_item_.SetTotalBytes(BoxApiCallFlow::kChunkFileUploadMinSize * 2); + + uploader_ = BoxUploader::Create(&test_item_); + InitUploader(uploader_.get()); + ASSERT_EQ(uploader_->GetFolderIdForTesting(), kFileSystemBoxFolderIdInPref); + + // Assume preflight check passes, which is tested thoroughly separately. + AddFetchResult(kFileSystemBoxPreflightCheckUrl, net::HTTP_OK); + } + + void TearDown() override { + EXPECT_FALSE(base::PathExists(GetFilePath())) << "No file should exist"; + } +}; + +TEST_F(BoxChunkedUploaderFileFailureTest, FailedToOpen) { + // Create upload session: + AddFetchResult(kFileSystemBoxChunkedUploadCreateSessionUrl, net::HTTP_CREATED, + kFileSystemBoxChunkedUploadCreateSessionResponseBody); + // Abort upload session (empty body since not reading from body): + AddSequentialFetchResult(kFileSystemBoxChunkedUploadSessionUrl, + net::HTTP_NO_CONTENT); + + uploader_->TryTask(url_factory_, "test_token"); + RunWithQuitClosure(); + + ASSERT_EQ(authentication_retry_, 0); + EXPECT_TRUE(download_thread_cb_called_); + ASSERT_FALSE(upload_success_); +} + } // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/file_system/signin_dialog_delegate.cc b/chrome/browser/enterprise/connectors/file_system/signin_dialog_delegate.cc index 385c6dfe..0fd9935 100644 --- a/chrome/browser/enterprise/connectors/file_system/signin_dialog_delegate.cc +++ b/chrome/browser/enterprise/connectors/file_system/signin_dialog_delegate.cc
@@ -22,8 +22,8 @@ #include "google_apis/gaia/oauth2_api_call_flow.h" #include "net/base/url_util.h" #include "services/network/public/cpp/shared_url_loader_factory.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "url/gurl.h" namespace {
diff --git a/chrome/browser/enterprise/connectors/file_system/signin_dialog_delegate.h b/chrome/browser/enterprise/connectors/file_system/signin_dialog_delegate.h index f1811e29..ccb19760 100644 --- a/chrome/browser/enterprise/connectors/file_system/signin_dialog_delegate.h +++ b/chrome/browser/enterprise/connectors/file_system/signin_dialog_delegate.h
@@ -16,8 +16,8 @@ #include "components/web_modal/web_contents_modal_dialog_host.h" #include "content/public/browser/web_contents_observer.h" #include "google_apis/gaia/oauth2_access_token_fetcher_impl.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace enterprise_connectors {
diff --git a/chrome/browser/extensions/active_tab_permission_granter.cc b/chrome/browser/extensions/active_tab_permission_granter.cc index dd60096..e9efbaf0 100644 --- a/chrome/browser/extensions/active_tab_permission_granter.cc +++ b/chrome/browser/extensions/active_tab_permission_granter.cc
@@ -116,12 +116,18 @@ void SetCorsOriginAccessList(content::BrowserContext* browser_context, const Extension& extension, base::OnceClosure closure) { + // To limit how far the new permissions reach, we only apply them to the + // ActiveTab's profile for split-mode extensions. OTOH, spanning-mode + // extensions need to get the new permissions in all profiles (e.g. if the + // ActiveTab is in an incognito window, than the [single/only/spanning] + // background page in the regular profile also needs to get the new + // permissions). std::vector<content::BrowserContext*> target_contexts; if (IncognitoInfo::IsSplitMode(&extension)) { target_contexts = {browser_context}; } else { target_contexts = util::GetAllRelatedProfiles( - Profile::FromBrowserContext(browser_context)); + Profile::FromBrowserContext(browser_context), extension); } util::SetCorsOriginAccessListForExtension(target_contexts, extension,
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.cc b/chrome/browser/extensions/api/input_ime/input_ime_api.cc index 332b5c5a..6e88b26 100644 --- a/chrome/browser/extensions/api/input_ime/input_ime_api.cc +++ b/chrome/browser/extensions/api/input_ime/input_ime_api.cc
@@ -67,7 +67,7 @@ case ui::VKEY_BROWSER_REFRESH: case ui::VKEY_F3: return "BrowserRefresh"; - case ui::VKEY_MEDIA_LAUNCH_APP2: + case ui::VKEY_ZOOM: case ui::VKEY_F4: return "ChromeOSFullscreen"; case ui::VKEY_MEDIA_LAUNCH_APP1:
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc index 3a8b4c4e..24fe99a 100644 --- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc +++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
@@ -68,7 +68,7 @@ using chromeos::input_method::InputMethodUtil; // Number of IMEs that are needed to automatically enable the IME menu option. -const size_t NUM_IMES_TO_AUTO_ENABLE_IME_MENU = 2; +const size_t kNumImesToAutoEnableImeMenu = 2; // Returns the set of IDs of all enabled IMEs. std::unordered_set<std::string> GetEnabledIMEs( @@ -870,7 +870,7 @@ std::unordered_set<std::string> other_input_method_set( GetIMEsFromPref(prefs, other_ime_list_pref_name)); if (input_method_set.size() + other_input_method_set.size() == - NUM_IMES_TO_AUTO_ENABLE_IME_MENU) { + kNumImesToAutoEnableImeMenu) { prefs->SetBoolean(prefs::kLanguageImeMenuActivated, true); } }
diff --git a/chrome/browser/extensions/api/storage/policy_value_store.cc b/chrome/browser/extensions/api/storage/policy_value_store.cc index d65064c..e349670f 100644 --- a/chrome/browser/extensions/api/storage/policy_value_store.cc +++ b/chrome/browser/extensions/api/storage/policy_value_store.cc
@@ -11,7 +11,7 @@ #include "components/policy/core/common/policy_map.h" #include "components/policy/core/common/policy_types.h" #include "extensions/browser/api/storage/backend_task_runner.h" -#include "extensions/browser/value_store/settings_namespace.h" +#include "extensions/browser/api/storage/storage_area_namespace.h" #include "extensions/browser/value_store/value_store_change.h" namespace extensions { @@ -100,7 +100,7 @@ if (!changes.empty()) { observers_->Notify(FROM_HERE, &SettingsObserver::OnSettingsChanged, - extension_id_, settings_namespace::MANAGED, + extension_id_, StorageAreaNamespace::kManaged, ValueStoreChange::ToValue(std::move(changes))); } }
diff --git a/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc b/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc index ed092233..cfc0e71 100644 --- a/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc +++ b/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc
@@ -20,6 +20,7 @@ #include "content/public/test/test_utils.h" #include "extensions/browser/api/storage/backend_task_runner.h" #include "extensions/browser/api/storage/settings_observer.h" +#include "extensions/browser/api/storage/storage_area_namespace.h" #include "extensions/browser/value_store/leveldb_value_store.h" #include "extensions/browser/value_store/value_store_unittest.h" #include "testing/gmock/include/gmock/gmock.h" @@ -51,14 +52,13 @@ public: MOCK_METHOD3(OnSettingsChangedJSON, void(const std::string& extension_id, - settings_namespace::Namespace settings_namespace, + StorageAreaNamespace storage_area, const std::string& changes_json)); void OnSettingsChanged(const std::string& extension_id, - settings_namespace::Namespace settings_namespace, + StorageAreaNamespace storage_area, const base::Value& changes) override { - OnSettingsChangedJSON(extension_id, settings_namespace, - ValueToJson(changes)); + OnSettingsChangedJSON(extension_id, storage_area, ValueToJson(changes)); } }; @@ -195,7 +195,7 @@ ValueStoreChangeList changes; changes.push_back(ValueStoreChange("aaa", base::nullopt, value.Clone())); EXPECT_CALL(observer_, OnSettingsChangedJSON( - kTestExtensionId, settings_namespace::MANAGED, + kTestExtensionId, StorageAreaNamespace::kManaged, ValueStoreChangeToJson(std::move(changes)))); } @@ -210,7 +210,7 @@ ValueStoreChangeList changes; changes.push_back(ValueStoreChange("bbb", base::nullopt, value.Clone())); EXPECT_CALL(observer_, OnSettingsChangedJSON( - kTestExtensionId, settings_namespace::MANAGED, + kTestExtensionId, StorageAreaNamespace::kManaged, ValueStoreChangeToJson(std::move(changes)))); } @@ -226,7 +226,7 @@ changes.push_back( ValueStoreChange("bbb", value.Clone(), new_value.Clone())); EXPECT_CALL(observer_, OnSettingsChangedJSON( - kTestExtensionId, settings_namespace::MANAGED, + kTestExtensionId, StorageAreaNamespace::kManaged, ValueStoreChangeToJson(std::move(changes)))); } @@ -241,7 +241,7 @@ changes.push_back( ValueStoreChange("bbb", new_value.Clone(), base::nullopt)); EXPECT_CALL(observer_, OnSettingsChangedJSON( - kTestExtensionId, settings_namespace::MANAGED, + kTestExtensionId, StorageAreaNamespace::kManaged, ValueStoreChangeToJson(std::move(changes)))); }
diff --git a/chrome/browser/extensions/api/storage/settings_apitest.cc b/chrome/browser/extensions/api/storage/settings_apitest.cc index ed5cbb9..279c301 100644 --- a/chrome/browser/extensions/api/storage/settings_apitest.cc +++ b/chrome/browser/extensions/api/storage/settings_apitest.cc
@@ -35,7 +35,7 @@ #include "components/sync/test/model/sync_error_factory_mock.h" #include "content/public/test/browser_test.h" #include "extensions/browser/api/storage/backend_task_runner.h" -#include "extensions/browser/api/storage/storage_api.h" +#include "extensions/browser/api/storage/storage_area_namespace.h" #include "extensions/browser/api/storage/storage_frontend.h" #include "extensions/browser/extension_system.h" #include "extensions/browser/value_store/settings_namespace.h" @@ -219,22 +219,6 @@ return message_json; } - std::string StorageAreaToString(StorageAreaNamespace storage_area) { - DCHECK(storage_area != StorageAreaNamespace::kInvalid); - switch (storage_area) { - case StorageAreaNamespace::kLocal: - return "local"; - case StorageAreaNamespace::kSync: - return "sync"; - case StorageAreaNamespace::kManaged: - return "managed"; - case StorageAreaNamespace::kSession: - return "session"; - case StorageAreaNamespace::kInvalid: - return std::string(); - } - } - void SendChangesToSyncableService( const syncer::SyncChangeList& change_list, syncer::SyncableService* settings_service) {
diff --git a/chrome/browser/extensions/api/storage/syncable_settings_storage.cc b/chrome/browser/extensions/api/storage/syncable_settings_storage.cc index 9c36ba7..c5b1d4a0 100644 --- a/chrome/browser/extensions/api/storage/syncable_settings_storage.cc +++ b/chrome/browser/extensions/api/storage/syncable_settings_storage.cc
@@ -15,7 +15,7 @@ #include "components/sync/model/sync_error.h" #include "components/sync/protocol/extension_setting_specifics.pb.h" #include "extensions/browser/api/storage/backend_task_runner.h" -#include "extensions/browser/value_store/settings_namespace.h" +#include "extensions/browser/api/storage/storage_area_namespace.h" namespace extensions { @@ -336,7 +336,7 @@ sync_processor_->NotifyChanges(changes); observers_->Notify(FROM_HERE, &SettingsObserver::OnSettingsChanged, - extension_id_, settings_namespace::SYNC, + extension_id_, StorageAreaNamespace::kSync, ValueStoreChange::ToValue(std::move(changes))); // TODO(kalman): Something sensible with multiple errors.
diff --git a/chrome/browser/extensions/content_script_tracker_browsertest.cc b/chrome/browser/extensions/content_script_tracker_browsertest.cc index 8e1223c..0c236e13 100644 --- a/chrome/browser/extensions/content_script_tracker_browsertest.cc +++ b/chrome/browser/extensions/content_script_tracker_browsertest.cc
@@ -626,11 +626,11 @@ EXPECT_EQ("content script has run: 2", content::EvalJs(child_frame, "document.body.innerText")); - // Demonstrate that `document.open` changed the URL of the `child_frame`. + // Demonstrate that `document.open` didn't change the URL of the + // `child_frame`. EXPECT_EQ(another_frame->GetLastCommittedURL(), content::EvalJs(child_frame, "location.href")); - EXPECT_EQ(another_frame->GetLastCommittedURL(), - child_frame->GetLastCommittedURL()); + EXPECT_EQ(GURL(), child_frame->GetLastCommittedURL()); } // Verify that ContentScriptTracker still properly covers both frames. The
diff --git a/chrome/browser/extensions/corb_and_cors_extension_browsertest.cc b/chrome/browser/extensions/corb_and_cors_extension_browsertest.cc index d57df54d..83d7fe4 100644 --- a/chrome/browser/extensions/corb_and_cors_extension_browsertest.cc +++ b/chrome/browser/extensions/corb_and_cors_extension_browsertest.cc
@@ -2346,9 +2346,14 @@ } )"; extension_dir.WriteManifest(kManifest); extension_dir.WriteFile(FILE_PATH_LITERAL("bg_script.js"), ""); - const Extension* extension = LoadExtension(extension_dir.UnpackedPath()); + const Extension* extension = LoadExtension(extension_dir.UnpackedPath(), + {.allow_in_incognito = false}); ASSERT_TRUE(extension); + // This test covers the default incognito mode (spanning mode) where there is + // only a single background page (i.e. no separate incognito background page). + EXPECT_FALSE(IncognitoInfo::IsSplitMode(extension)); + // Set up a test scenario: // - top-level frame: kActiveTabHost constexpr char kActiveTabHost[] = "active-tab.example"; @@ -2358,6 +2363,13 @@ embedded_test_server()->GetURL(kActiveTabHost, "/nosniff.xml")); ui_test_utils::NavigateToURL(browser(), original_document_url); + // Open an incognito window. Since the extension is not enabled for + // incognito, OriginAccessList should not be sent to the incognito-related + // NetworkContext (this is verified by a DCHECK in + // SetCorsOriginAccessListForExtensionHelper in + // //extensions/browser/extension_util.cc. + CreateIncognitoBrowser(); + // CORS exception shouldn't be initially granted based on ActiveTab. { SCOPED_TRACE("TEST STEP 1: Initial fetch.");
diff --git a/chrome/browser/extensions/extension_tabs_apitest.cc b/chrome/browser/extensions/extension_tabs_apitest.cc index 4194696..6f763d64 100644 --- a/chrome/browser/extensions/extension_tabs_apitest.cc +++ b/chrome/browser/extensions/extension_tabs_apitest.cc
@@ -17,6 +17,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "components/prefs/pref_service.h" +#include "content/public/common/content_features.h" #include "content/public/test/browser_test.h" #include "net/dns/mock_host_resolver.h" @@ -34,6 +35,21 @@ } }; +class ExtensionApiTabBackForwardCacheTest : public ExtensionApiTabTest { + public: + ExtensionApiTabBackForwardCacheTest() { + feature_list_.InitWithFeaturesAndParameters( + {{features::kBackForwardCache, + {{"content_injection_supported", "true"}, + {"all_extensions_allowed", "true"}}}}, + {features::kBackForwardCacheMemoryControls}); + } + ~ExtensionApiTabBackForwardCacheTest() override = default; + + private: + base::test::ScopedFeatureList feature_list_; +}; + class ExtensionApiNewTabTest : public ExtensionApiTabTest { public: ExtensionApiNewTabTest() {} @@ -249,6 +265,10 @@ ASSERT_TRUE(RunExtensionTest("tabs/on_updated")) << message_; } +IN_PROC_BROWSER_TEST_F(ExtensionApiTabBackForwardCacheTest, TabsOnUpdated) { + ASSERT_TRUE(RunExtensionTest("tabs/backForwardCache/on_updated")) << message_; +} + // Flaky on Linux. http://crbug.com/657376. #if defined(OS_LINUX) || defined(OS_CHROMEOS) #define MAYBE_TabsNoPermissions DISABLED_TabsNoPermissions
diff --git a/chrome/browser/extensions/extension_util.cc b/chrome/browser/extensions/extension_util.cc index 52856d70..ccef6a6 100644 --- a/chrome/browser/extensions/extension_util.cc +++ b/chrome/browser/extensions/extension_util.cc
@@ -311,15 +311,25 @@ return permissions_to_display; } -std::vector<content::BrowserContext*> GetAllRelatedProfiles(Profile* profile) { - std::vector<Profile*> off_the_record_profiles = - profile->GetAllOffTheRecordProfiles(); - +std::vector<content::BrowserContext*> GetAllRelatedProfiles( + Profile* profile, + const Extension& extension) { std::vector<content::BrowserContext*> related_contexts; - related_contexts.reserve(1 + off_the_record_profiles.size()); related_contexts.push_back(profile->GetOriginalProfile()); - for (Profile* off_the_record_profile : off_the_record_profiles) - related_contexts.push_back(off_the_record_profile); + + // The returned `related_contexts` should include all the related incognito + // profiles if the extension is globally allowed in incognito (this is a + // global, rather than per-profile toggle - this is why we it can be checked + // globally here, rather than once for every incognito profile looped over + // below). + if (IsIncognitoEnabled(extension.id(), profile)) { + std::vector<Profile*> off_the_record_profiles = + profile->GetAllOffTheRecordProfiles(); + related_contexts.reserve(related_contexts.size() + + off_the_record_profiles.size()); + for (Profile* off_the_record_profile : off_the_record_profiles) + related_contexts.push_back(off_the_record_profile); + } return related_contexts; }
diff --git a/chrome/browser/extensions/extension_util.h b/chrome/browser/extensions/extension_util.h index 6ef7af1e..1b7b43abe 100644 --- a/chrome/browser/extensions/extension_util.h +++ b/chrome/browser/extensions/extension_util.h
@@ -109,7 +109,9 @@ // Returns all profiles affected by permissions of an extension running in // "spanning" (rather than "split) mode. -std::vector<content::BrowserContext*> GetAllRelatedProfiles(Profile* profile); +std::vector<content::BrowserContext*> GetAllRelatedProfiles( + Profile* profile, + const Extension& extension); } // namespace util } // namespace extensions
diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc index ca7e90b..5b932100 100644 --- a/chrome/browser/extensions/external_provider_impl.cc +++ b/chrome/browser/extensions/external_provider_impl.cc
@@ -370,8 +370,8 @@ extension->FindStringPath(kWebAppMigrationFlag); bool is_migrating_to_web_app = web_app_migration_flag && - web_app::IsPreinstalledAppInstallFeatureEnabled(*web_app_migration_flag, - *profile_); + web_app::IsPreinstalledAppInstallFeatureEnabled( + *web_app_migration_flag); bool keep_if_present = extension->FindBoolPath(kKeepIfPresent).value_or(false); if (keep_if_present || is_migrating_to_web_app) {
diff --git a/chrome/browser/extensions/permissions_updater.cc b/chrome/browser/extensions/permissions_updater.cc index 80da0d2..aec31e2 100644 --- a/chrome/browser/extensions/permissions_updater.cc +++ b/chrome/browser/extensions/permissions_updater.cc
@@ -128,8 +128,12 @@ 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)), + util::GetAllRelatedProfiles(Profile::FromBrowserContext(browser_context), + extension), extension, std::move(closure)); }
diff --git a/chrome/browser/extensions/preinstalled_apps.cc b/chrome/browser/extensions/preinstalled_apps.cc index 3294fe5..4e03dc8f 100644 --- a/chrome/browser/extensions/preinstalled_apps.cc +++ b/chrome/browser/extensions/preinstalled_apps.cc
@@ -188,8 +188,7 @@ pref.FindStringPath(kWebAppMigrationFlag); if (!web_app_flag) return false; // Isn't migrating. - if (web_app::IsPreinstalledAppInstallFeatureEnabled(*web_app_flag, - *profile)) { + if (web_app::IsPreinstalledAppInstallFeatureEnabled(*web_app_flag)) { // The feature is still enabled; it's responsible for the behavior. return false; }
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index a936eb38..9d9e672 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -1600,7 +1600,7 @@ { "name": "enable-debug-for-secure-payment-confirmation", "owners": [ "rouslan", "web-payments-team@google.com" ], - "expiry_milestone": 90 + "expiry_milestone": 102 }, { "name": "enable-debug-for-store-billing", @@ -1663,7 +1663,12 @@ { "name": "enable-desktop-pwas-link-capturing", "owners": [ "alancutter@chromium.org", "desktop-pwas-team@google.com" ], - "expiry_milestone": 93 + "expiry_milestone": 96 + }, + { + "name": "enable-desktop-pwas-notification-icon-and-title", + "owners": [ "loyso@chromium.org", "desktop-pwas-team@google.com" ], + "expiry_milestone": 98 }, { "name": "enable-desktop-pwas-protocol-handling", @@ -3981,11 +3986,6 @@ "expiry_milestone": 90 }, { - "name": "omnibox-pedal-suggestions", - "owners": [ "orinj", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 95 - }, - { "name": "omnibox-pedals-batch2", "owners": [ "orinj", "chrome-omnibox-team@google.com" ], "expiry_milestone": 95 @@ -4056,11 +4056,6 @@ "expiry_milestone": 92 }, { - "name": "omnibox-suggestion-button-row", - "owners": [ "orinj", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 92 - }, - { "name": "omnibox-tab-switch-suggestions", "owners": [ "orinj", "chrome-omnibox-team@google.com" ], "expiry_milestone": 92 @@ -4568,14 +4563,6 @@ "expiry_milestone": 90 }, { - "name": "safe-browsing-real-time-url-lookup-enterprise-ga-endpoint", - "owners": [ - "xinghuilu", - "chrome-safebrowsing-core@google.com" - ], - "expiry_milestone": 92 - }, - { "name": "safety-check-chrome-cleaner-child", "owners": [ "rainhard",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index ec7b9fd02..e6c98a1 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -753,6 +753,12 @@ "Replaces the origin flash with an app name flash when launching a web app " "window."; +const char kDesktopPWAsNotificationIconAndTitleName[] = + "Desktop PWAs improvements in notification icon and title"; +const char kDesktopPWAsNotificationIconAndTitleDescription[] = + "Replaces the websites origin and the Chrome icon with the web app's name " + "and app icon in notifications."; + const char kDesktopPWAsLinkCapturingName[] = "Desktop PWA declarative link capturing"; const char kDesktopPWAsLinkCapturingDescription[] = @@ -2142,13 +2148,6 @@ "Enables printer status icons and labels for saved printers on the Print " "Preview destination dialog"; -const char kSafeBrowsingRealTimeUrlLookupEnterpriseGaEndpointName[] = - "Use the new GA endpoint to perform enterprise real time URL check."; - -const char kSafeBrowsingRealTimeUrlLookupEnterpriseGaEndpointDescription[] = - "If enabled, the enterprise real time URL check will be sent to the new " - "endpoint."; - const char kSafetyTipName[] = "Show Safety Tip UI when visiting low-reputation websites"; const char kSafetyTipDescription[] = @@ -3172,12 +3171,6 @@ "Enables to share current loaded page as offline page by saving as MHTML " "first."; -const char kOfflinePagesShowAlternateDinoPageName[] = - "Enable alternate dino page with more user capabilities."; -const char kOfflinePagesShowAlternateDinoPageDescription[] = - "Enables the dino page to show more buttons and offer existing offline " - "content."; - const char kOffliningRecentPagesName[] = "Enable offlining of recently visited pages"; const char kOffliningRecentPagesDescription[] = @@ -3641,18 +3634,6 @@ "Enables various experimental features related to keyword mode, its " "suggestions and layout."; -const char kOmniboxSuggestionButtonRowName[] = "Omnibox suggestion button row"; -const char kOmniboxSuggestionButtonRowDescription[] = - "Enable a button row on omnibox suggestions to present actionable items " - "such as keyword search, tab-switch buttons, and Pedals."; - -const char kOmniboxPedalSuggestionsName[] = "Omnibox Pedal suggestions"; -const char kOmniboxPedalSuggestionsDescription[] = - "Enable omnibox Pedal suggestions to accelerate actions within Chrome by " - "detecting user intent and offering direct access to the end goal. This " - "flag has no effect unless \"Omnibox suggestion button row\" is also " - "enabled."; - const char kOmniboxPedalsBatch2Name[] = "Omnibox Pedals batch 2"; const char kOmniboxPedalsBatch2Description[] = "Enable the second batch of Omnibox Pedals (Safety Check, etc.). " @@ -3668,8 +3649,7 @@ const char kOmniboxKeywordSearchButtonName[] = "Omnibox keyword search button"; const char kOmniboxKeywordSearchButtonDescription[] = "Enable the omnibox keyword search button which offers a way to search " - "on specific sites from the omnibox. This flag has no effect unless " - "\"Omnibox suggestion button row\" is also enabled."; + "on specific sites from the omnibox."; const char kOmniboxRefinedFocusStateName[] = "Omnibox refined focus state UI"; const char kOmniboxRefinedFocusStateDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index f076992..f4cee371 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -459,6 +459,9 @@ extern const char kDesktopPWAsFlashAppNameInsteadOfOriginName[]; extern const char kDesktopPWAsFlashAppNameInsteadOfOriginDescription[]; +extern const char kDesktopPWAsNotificationIconAndTitleName[]; +extern const char kDesktopPWAsNotificationIconAndTitleDescription[]; + extern const char kDesktopPWAsLinkCapturingName[]; extern const char kDesktopPWAsLinkCapturingDescription[]; @@ -1238,10 +1241,6 @@ extern const char kPrinterStatusDialogName[]; extern const char kPrinterStatusDialogDescription[]; -extern const char kSafeBrowsingRealTimeUrlLookupEnterpriseGaEndpointName[]; -extern const char - kSafeBrowsingRealTimeUrlLookupEnterpriseGaEndpointDescription[]; - extern const char kSafetyTipName[]; extern const char kSafetyTipDescription[]; @@ -1843,9 +1842,6 @@ extern const char kOfflinePagesLivePageSharingName[]; extern const char kOfflinePagesLivePageSharingDescription[]; -extern const char kOfflinePagesShowAlternateDinoPageName[]; -extern const char kOfflinePagesShowAlternateDinoPageDescription[]; - extern const char kOffliningRecentPagesName[]; extern const char kOffliningRecentPagesDescription[];
diff --git a/chrome/browser/google/google_brand_code_map_chromeos.cc b/chrome/browser/google/google_brand_code_map_chromeos.cc index 8a17643..6d7a3de3 100644 --- a/chrome/browser/google/google_brand_code_map_chromeos.cc +++ b/chrome/browser/google/google_brand_code_map_chromeos.cc
@@ -51,6 +51,7 @@ {"ADID", {"XDMY", "QHTP", "PBND"}}, {"AJIM", {"XQAQ", "WFLV", "AMBR"}}, {"ALRH", {"XDKE", "TDIH", "VLER"}}, + {"ANLW", {"MTZL", "LFDW", "IHRZ"}}, {"AOKF", {"ZKSY", "KRPA", "QAZL"}}, {"AOPA", {"TTBL", "HHHA", "SADO"}}, {"AOPB", {"WFJJ", "ZQCN", "OMBM"}}, @@ -80,6 +81,7 @@ {"BKLL", {"DJXO", "KLUN", "DJNO"}}, {"BMNE", {"HLSA", "WXJQ", "TULR"}}, {"CBUY", {"POUW", "GHJY", "USXU"}}, + {"CDYS", {"CJRA", "BIRA", "NFVP"}}, {"CFUL", {"GIFL", "EDYW", "GOJE"}}, {"CLSF", {"OWOB", "RLJX", "OZWK"}}, {"CPPT", {"CQFF", "PCCZ", "HZEW"}}, @@ -122,6 +124,7 @@ {"FHYR", {"YKUD", "XTKX", "QFMD"}}, {"FIGU", {"VMWP", "SBFY", "IYUS"}}, {"FNVY", {"DLEJ", "DCNV", "XALG"}}, + {"FOBB", {"TRYO", "HAKV", "WKDK"}}, {"FQPJ", {"ZTQG", "ZNEO", "LYMZ"}}, {"FQZI", {"WPBA", "YZDA", "FXCI"}}, {"FRGW", {"ZPJY", "MYPP", "KQFE"}}, @@ -188,6 +191,7 @@ {"JPZQ", {"CCBQ", "ABTW", "KFNE"}}, {"JQUD", {"CUTW", "DLJE", "DOON"}}, {"JRVR", {"WGPS", "YETD", "KBWB"}}, + {"JTFE", {"DNJK", "FJMW", "QBLT"}}, {"JVAN", {"FQPY", "WNTW", "XWXD"}}, {"JWGY", {"GMIM", "ZNPK", "RGAL"}}, {"JXIS", {"ZYZD", "TEIT", "ILLN"}}, @@ -276,8 +280,10 @@ {"LOGH", {"RTVE", "EJJV", "DNTX"}}, {"LOGI", {"OEYI", "IKUX", "TCEI"}}, {"LULQ", {"DEHI", "QYXC", "KAGT"}}, + {"LYFT", {"LMQF", "CYMI", "ZGEF"}}, {"LYLN", {"XXWY", "JEUV", "RSOC"}}, {"MAII", {"EOHR", "XZOT", "VJJS"}}, + {"MBLE", {"KOCV", "ZLFP", "HOVE"}}, {"MCDN", {"BAOV", "GLVV", "XHGO"}}, {"MCOO", {"IPNW", "CRSK", "QTAX"}}, {"MDPZ", {"AHBA", "ENTF", "IIMC"}}, @@ -336,6 +342,7 @@ {"RIKG", {"VRBT", "LEPX", "VWIV"}}, {"RKRB", {"OPOY", "QMZZ", "FAGR"}}, {"RLGE", {"NTKV", "LOTA", "MJVG"}}, + {"RNPH", {"TSIF", "ESCP", "GISR"}}, {"RVRM", {"MZJU", "IGXP", "DSJP"}}, {"RXGN", {"WHNA", "DWVK", "FRWP"}}, {"RYMB", {"ZITN", "TMGX", "HVCV"}}, @@ -396,6 +403,7 @@ {"WCLL", {"DALK", "WPRA", "TPTP"}}, {"WFIQ", {"KKHX", "UTHS", "HDSP"}}, {"WJOZ", {"BASQ", "BRTL", "CQAV"}}, + {"WMMD", {"HBFI", "XBKO", "LCEC"}}, {"WMPI", {"POXG", "VCJD", "WEGX"}}, {"WMVU", {"GMMR", "AVVS", "IMDF"}}, {"WNNA", {"ERXU", "TWMI", "ZOER"}},
diff --git a/chrome/browser/metrics/chrome_android_metrics_provider.cc b/chrome/browser/metrics/chrome_android_metrics_provider.cc index 841793b..586f992 100644 --- a/chrome/browser/metrics/chrome_android_metrics_provider.cc +++ b/chrome/browser/metrics/chrome_android_metrics_provider.cc
@@ -6,10 +6,10 @@ #include "base/metrics/histogram_macros.h" #include "base/optional.h" -#include "chrome/android/chrome_jni_headers/NotificationSystemStatusUtil_jni.h" #include "chrome/browser/android/locale/locale_manager.h" #include "chrome/browser/android/metrics/uma_session_stats.h" #include "chrome/browser/flags/android/chrome_session_state.h" +#include "chrome/browser/notifications/jni_headers/NotificationSystemStatusUtil_jni.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/nearby_sharing/client/nearby_share_api_call_flow_impl.cc b/chrome/browser/nearby_sharing/client/nearby_share_api_call_flow_impl.cc index 2fabc75d..d1b3bbf 100644 --- a/chrome/browser/nearby_sharing/client/nearby_share_api_call_flow_impl.cc +++ b/chrome/browser/nearby_sharing/client/nearby_share_api_call_flow_impl.cc
@@ -148,8 +148,8 @@ error = NearbyShareHttpError::kOffline; } - NS_LOG(ERROR) << "API call failed, error code: " - << net::ErrorToString(net_error); + NS_LOG(ERROR) << "API call failed: " + << NearbyShareHttpStatus(net_error, head).ToString(); if (body) NS_LOG(VERBOSE) << "API failure response body: " << *body;
diff --git a/chrome/browser/notifications/BUILD.gn b/chrome/browser/notifications/BUILD.gn index 2ebbde7..a7a8f5a 100644 --- a/chrome/browser/notifications/BUILD.gn +++ b/chrome/browser/notifications/BUILD.gn
@@ -2,14 +2,178 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -group("notifications") { - deps = [ +if (is_android) { + import("//build/config/android/rules.gni") +} + +source_set("notifications") { + public_deps = [ "//chrome/browser/notifications/proto", "//chrome/browser/notifications/scheduler", ] + + sources = [] + + if (is_android) { + deps = [ + ":jni_headers", + "//base", + "//chrome/common", + "//components/content_settings/core/browser", + "//components/content_settings/core/common", + "//components/keyed_service/core", + "//components/pref_registry", + "//components/prefs", + "//components/search_engines", + "//content/public/browser", + "//url", + ] + + sources += [ + "notification_channels_provider_android.cc", + "notification_channels_provider_android.h", + ] + } } group("unit_tests") { testonly = true deps = [ "//chrome/browser/notifications/scheduler:unit_tests" ] } + +if (is_android) { + android_library("java") { + sources = [ + "android/java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperCompatBuilder.java", + "android/java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperStandardBuilder.java", + "android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationConstants.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptor.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactory.java", + "android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java", + "android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdater.java", + "android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java", + "android/java/src/org/chromium/chrome/browser/notifications/channels/LocaleChangedBroadcastReceiver.java", + "android/java/src/org/chromium/chrome/browser/notifications/channels/SiteChannelsManager.java", + ] + + deps = [ + ":java_resources", + "//base:base_java", + "//chrome/browser/flags:java", + "//chrome/browser/offline_pages/android:java", + "//chrome/browser/preferences:java", + "//chrome/browser/profiles/android:java", + "//components/browser_ui/notifications/android:java", + "//components/browser_ui/settings/android:java", + "//components/browser_ui/site_settings/android:java", + "//components/browser_ui/widget/android:java", + "//components/content_settings/android:content_settings_enums_java", + "//components/embedder_support/android:browser_context_java", + "//components/url_formatter/android:url_formatter_java", + "//third_party/android_deps:android_support_v7_appcompat_java", + "//third_party/androidx:androidx_annotation_annotation_java", + "//ui/android:ui_no_recycler_view_java", + ] + + srcjar_deps = [ ":notifications_java_enum_srcjar" ] + resources_package = "org.chromium.chrome.browser.notifications" + annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] + } + + java_cpp_enum("notifications_java_enum_srcjar") { + sources = [ "notification_channels_provider_android.h" ] + } + + generate_jni("jni_headers") { + sources = [ + "android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java", + ] + } + + android_library("junit_tests") { + # Platform checks are broken for Robolectric. See https://crbug.com/1071638. + bypass_platform_checks = true + testonly = true + + sources = [ + "android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptorTest.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtilUnitTest.java", + "android/java/src/org/chromium/chrome/browser/notifications/PendingIntentProviderTest.java", + "android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitionsTest.java", + ] + + deps = [ + ":java", + "//base:base_java", + "//base:base_java_test_support", + "//base:base_junit_test_support", + "//chrome/test/android:chrome_java_test_support", + "//components/browser_ui/notifications/android:java", + "//third_party/android_deps:robolectric_all_java", + "//third_party/androidx:androidx_test_core_java", + "//third_party/hamcrest:hamcrest_core_java", + "//third_party/hamcrest:hamcrest_library_java", + "//third_party/junit", + "//third_party/mockito:mockito_java", + ] + } + + android_library("javatests") { + testonly = true + + sources = [ + "android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBaseTest.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java", + "android/java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactoryTest.java", + "android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java", + "android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsInitializerTest.java", + "android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdaterTest.java", + ] + + deps = [ + ":java", + "//base:base_java", + "//base:base_java_test_support", + "//chrome/browser/flags:java", + "//chrome/browser/preferences:java", + "//chrome/test/android:chrome_java_test_support", + "//components/browser_ui/notifications/android:java", + "//components/browser_ui/util/android:java", + "//components/browser_ui/widget/android:java", + "//content/public/test/android:content_java_test_support", + "//third_party/android_support_test_runner:runner_java", + "//third_party/androidx:androidx_test_runner_java", + "//third_party/hamcrest:hamcrest_core_java", + "//third_party/hamcrest:hamcrest_library_java", + "//third_party/junit", + "//third_party/mockito:mockito_java", + ] + } + + android_resources("java_resources") { + sources = [ + "android/java/res/layout/web_notification.xml", + "android/java/res/layout/web_notification_big.xml", + "android/java/res/layout/web_notification_button.xml", + "android/java/res/layout/web_notification_icon_frame.xml", + "android/java/res/layout/web_notification_small_icon.xml", + "android/java/res/values-v21/styles.xml", + "android/java/res/values/styles.xml", + ] + + deps = [ + "//chrome/browser/ui/android/strings:ui_strings_grd", + "//components/browser_ui/strings/android:browser_ui_strings_grd", + "//components/browser_ui/styles/android:java_resources", + "//components/browser_ui/widget/android:java_resources", + "//ui/android:ui_java_resources", + ] + } +}
diff --git a/chrome/android/java/res/layout/web_notification.xml b/chrome/browser/notifications/android/java/res/layout/web_notification.xml similarity index 100% rename from chrome/android/java/res/layout/web_notification.xml rename to chrome/browser/notifications/android/java/res/layout/web_notification.xml
diff --git a/chrome/android/java/res/layout/web_notification_big.xml b/chrome/browser/notifications/android/java/res/layout/web_notification_big.xml similarity index 100% rename from chrome/android/java/res/layout/web_notification_big.xml rename to chrome/browser/notifications/android/java/res/layout/web_notification_big.xml
diff --git a/chrome/android/java/res/layout/web_notification_button.xml b/chrome/browser/notifications/android/java/res/layout/web_notification_button.xml similarity index 100% rename from chrome/android/java/res/layout/web_notification_button.xml rename to chrome/browser/notifications/android/java/res/layout/web_notification_button.xml
diff --git a/chrome/android/java/res/layout/web_notification_icon_frame.xml b/chrome/browser/notifications/android/java/res/layout/web_notification_icon_frame.xml similarity index 100% rename from chrome/android/java/res/layout/web_notification_icon_frame.xml rename to chrome/browser/notifications/android/java/res/layout/web_notification_icon_frame.xml
diff --git a/chrome/android/java/res/layout/web_notification_small_icon.xml b/chrome/browser/notifications/android/java/res/layout/web_notification_small_icon.xml similarity index 100% rename from chrome/android/java/res/layout/web_notification_small_icon.xml rename to chrome/browser/notifications/android/java/res/layout/web_notification_small_icon.xml
diff --git a/chrome/browser/notifications/android/java/res/values-v21/styles.xml b/chrome/browser/notifications/android/java/res/values-v21/styles.xml new file mode 100644 index 0000000..fa47a9a --- /dev/null +++ b/chrome/browser/notifications/android/java/res/values-v21/styles.xml
@@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- 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. --> + +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Web Notifications --> + <style name="WebNotificationTitle" + parent="@android:style/TextAppearance.Material.Notification.Title"/> + <style name="WebNotificationBody" + parent="@android:style/TextAppearance.Material.Notification.Line2"/> + <style name="WebNotificationBodyBig" + parent="@android:style/TextAppearance.Material.Notification"/> + <style name="WebNotificationOrigin" + parent="@android:style/TextAppearance.Material.Notification.Info"/> + <style name="WebNotificationTime" + parent="@android:style/TextAppearance.Material.Notification.Time"/> + <style name="WebNotificationDivider"> + <!-- From the non-public Drawable notification_template_divider --> + <item name="android:background">#29000000</item> + </style> + <style name="WebNotificationButtons"> + <item name="android:layout_marginStart">-8dp</item> + </style> + <style name="WebNotificationButton" + parent="@android:style/Widget.DeviceDefault.Light.Button.Borderless.Small"> + <item name="android:background">@drawable/web_notification_button_background</item> + <item name="android:textAppearance">@style/TextAppearance.WebNotificationButton</item> + </style> + <style name="TextAppearance.WebNotificationButton" + parent="android:TextAppearance.DeviceDefault.Widget.Button"> + <item name="android:textColor">@color/secondary_text_default_material_light</item> + </style> + <style name="WebNotificationSettingsButton" + parent="@style/WebNotificationButton"> + <item name="android:textAppearance">@android:style/TextAppearance.Material.Notification.Info</item> + <item name="android:paddingStart">32dp</item> + </style> + <style name="WebNotificationSettingsIcon"> + <!-- This is a blank override of the v17 style. --> + </style> + <style name="WebNotificationLargeIcon"> + <item name="android:padding">12dp</item> + </style> + <style name="WebNotificationSmallIcon"> + <item name="android:background">@drawable/web_notification_small_icon_background</item> + <item name="android:padding">3dp</item> + </style> +</resources>
diff --git a/chrome/browser/notifications/android/java/res/values/styles.xml b/chrome/browser/notifications/android/java/res/values/styles.xml new file mode 100644 index 0000000..6705706a --- /dev/null +++ b/chrome/browser/notifications/android/java/res/values/styles.xml
@@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- 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. --> + +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Web Notifications --> + <style name="TextAppearance.Notification" + parent="@android:style/TextAppearance.StatusBar.EventContent"> + <!-- This style is defined as a workaround for TextAppearance.StatusBar.EventContent.Line2 + not being exposed by the framework and removed from the Support Library. It copies + the pre v26 implementation, and refers to the text size defined in the Support Library. + --> + <item name="android:textSize">@dimen/notification_subtext_size</item> + + </style> + <style name="WebNotificationTitle" + parent="@android:style/TextAppearance.StatusBar.EventContent.Title"> + <item name="android:layout_marginStart">8dp</item> + </style> + <style name="WebNotificationBody" parent="TextAppearance.Notification"> + <item name="android:layout_marginStart">8dp</item> + </style> + <style name="WebNotificationBodyBig" + parent="@android:style/TextAppearance.StatusBar.EventContent"> + <item name="android:layout_marginStart">8dp</item> + </style> + <style name="WebNotificationOrigin" parent="TextAppearance.Notification"> + <item name="android:layout_marginStart">8dp</item> + </style> + <style name="WebNotificationTime" parent="TextAppearance.Notification"/> + <style name="WebNotificationDivider"> + <item name="android:background">?android:dividerHorizontal</item> + </style> + <style name="WebNotificationButtons"> + <item name="android:layout_marginStart">0dp</item> + <item name="android:showDividers">middle</item> + <item name="android:divider">?android:attr/listDivider</item> + <item name="android:dividerPadding">12dp</item> + </style> + <style name="WebNotificationButton" + parent="@android:style/Widget.DeviceDefault.Button.Borderless.Small"> + <item name="android:textAppearance">@style/TextAppearance.WebNotificationButton</item> + </style> + <style name="TextAppearance.WebNotificationButton" + parent="android:TextAppearance.DeviceDefault.Widget.Button"> + <!-- textColor from the 4.4.4 notification_action.xml - no public aliases. --> + <item name="android:textColor">@color/web_notification_text</item> + </style> + <style name="WebNotificationSettingsButton" + parent="@style/WebNotificationButton"> + <item name="android:textAppearance">@style/TextAppearance.Notification</item> + <item name="android:paddingStart">40dp</item> + <!-- Margin at the end to avoid overlap with the small icon. --> + <item name="android:layout_marginEnd">24dp</item> + </style> + <style name="WebNotificationSettingsIcon"> + <item name="android:layout_marginStart">8dp</item> + </style> + <style name="WebNotificationLargeIcon"> + <item name="android:background">@drawable/notification_template_icon_bg</item> + </style> + <style name="WebNotificationSmallIcon"> + <item name="android:alpha">0.6</item> + </style> +</resources>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperCompatBuilder.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperCompatBuilder.java similarity index 100% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperCompatBuilder.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperCompatBuilder.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperStandardBuilder.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperStandardBuilder.java similarity index 100% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperStandardBuilder.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/ChromeNotificationWrapperStandardBuilder.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java similarity index 99% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java index fa063a0..127c8dee 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java
@@ -21,7 +21,6 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.StrictModeContext; -import org.chromium.chrome.R; import org.chromium.components.browser_ui.notifications.NotificationMetadata; import org.chromium.components.browser_ui.notifications.NotificationWrapper; import org.chromium.components.browser_ui.notifications.NotificationWrapperBuilder;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java similarity index 98% rename from chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java index 903bf77..038bc0a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java
@@ -35,7 +35,6 @@ import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.test.util.DisableIf; import org.chromium.base.test.util.Feature; -import org.chromium.chrome.R; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.notifications.channels.ChromeChannelDefinitions; import org.chromium.chrome.test.util.browser.Features; @@ -259,8 +258,8 @@ public void statusBarIconAsBitmapIsIgnoredIfNotSupported() { Context context = InstrumentationRegistry.getTargetContext(); - NotificationBuilderBase notificationBuilder = new CustomNotificationBuilder(context) - .setStatusBarIcon(createIcon(Color.RED)); + NotificationBuilderBase notificationBuilder = + new CustomNotificationBuilder(context).setStatusBarIcon(createIcon(Color.RED)); Assert.assertFalse(notificationBuilder.hasStatusBarIconBitmap()); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java similarity index 97% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java index 6536bb6..9b45e8f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java
@@ -135,15 +135,18 @@ protected Bitmap mImage; protected int mSmallIconId; - @Nullable protected Bitmap mSmallIconBitmapForStatusBar; - @Nullable protected Bitmap mSmallIconBitmapForContent; + @Nullable + protected Bitmap mSmallIconBitmapForStatusBar; + @Nullable + protected Bitmap mSmallIconBitmapForContent; /** * Package name to use for creating remote package context to be passed to NotificationBuilder. * If null, Chrome's context is used. Currently only used as a workaround for a certain issue, * see {@link #setStatusBarIconForRemoteApp}, {@link #deviceSupportsBitmapStatusBarIcons}. */ - @Nullable protected String mRemotePackageForBuilderContext; + @Nullable + protected String mRemotePackageForBuilderContext; protected PendingIntentProvider mContentIntent; protected PendingIntentProvider mDeleteIntent; @@ -280,7 +283,7 @@ // using remote app context: with that context iconId can be used. mRemotePackageForBuilderContext = packageName; setSmallIconId(iconId); - } // else we're out of luck. + } // else we're out of luck. } else { // Pre Android M, the small icon has to be from the resources of the app whose // NotificationManager is used in NotificationManager#notify. @@ -484,9 +487,8 @@ NotificationWrapperBuilder builder = NotificationWrapperBuilderFactory .createNotificationWrapperBuilder(shouldUseCompat(), mChannelId) - .setContentText(context.getString( - org.chromium.chrome.R.string.notification_hidden_text)) - .setSmallIcon(org.chromium.chrome.R.drawable.ic_chrome); + .setContentText(context.getString(R.string.notification_hidden_text)) + .setSmallIcon(R.drawable.ic_chrome); if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { // On N, 'subtext' displays at the top of the notification and this looks better. @@ -560,8 +562,8 @@ // Also, there are crashes on Lenovo M devices: https://crbug.com/894361. These include // Lenovo Zuk devices, which have Build.MANUFACTURER="ZUK": https://crbug.com/927271. // And some more crashes from Hisense and LeEco devices: https://crbug.com/903268. - for (String name : new String[] {"samsung", "yulong", "lenovo", "zuk", "hisense", - "leeco"}) { + for (String name : + new String[] {"samsung", "yulong", "lenovo", "zuk", "hisense", "leeco"}) { if (Build.MANUFACTURER.equalsIgnoreCase(name)) { return false; }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationBuilderBaseTest.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBaseTest.java similarity index 100% rename from chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationBuilderBaseTest.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBaseTest.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationConstants.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationConstants.java similarity index 100% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationConstants.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationConstants.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptor.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptor.java similarity index 99% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptor.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptor.java index 9e3fbc4e..770617ac 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptor.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptor.java
@@ -1,4 +1,4 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. +// 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.
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptorTest.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptorTest.java similarity index 98% rename from chrome/android/junit/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptorTest.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptorTest.java index 44038c53c..9f6b829 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptorTest.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationIntentInterceptorTest.java
@@ -32,7 +32,6 @@ import org.chromium.base.ContextUtils; import org.chromium.base.metrics.test.ShadowRecordHistogram; -import org.chromium.chrome.R; import org.chromium.chrome.browser.notifications.channels.ChromeChannelDefinitions; import org.chromium.components.browser_ui.notifications.NotificationManagerProxyImpl; import org.chromium.components.browser_ui.notifications.NotificationMetadata; @@ -115,7 +114,6 @@ PendingIntentProvider.getBroadcast(mContext, 0, contentIntent, 0); builder.setContentIntent(contentPendingIntent); builder.setContentTitle(title); - builder.setSmallIcon(R.drawable.offline_pin); // Add a button. Intent actionIntent = new Intent(TestReceiver.TEST_ACTION);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java similarity index 100% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java similarity index 100% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtilUnitTest.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtilUnitTest.java similarity index 100% rename from chrome/android/junit/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtilUnitTest.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtilUnitTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java similarity index 100% rename from chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java similarity index 99% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java index ed759de5..504f3a2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java
@@ -1,4 +1,4 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. +// 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.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactory.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactory.java similarity index 98% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactory.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactory.java index cf33525..28bd4b0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactory.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactory.java
@@ -1,4 +1,4 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. +// 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.
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactoryTest.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactoryTest.java similarity index 100% rename from chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactoryTest.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactoryTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/notifications/PendingIntentProviderTest.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/PendingIntentProviderTest.java similarity index 100% rename from chrome/android/junit/src/org/chromium/chrome/browser/notifications/PendingIntentProviderTest.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/PendingIntentProviderTest.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java similarity index 97% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java index 2673af1..8d3924e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java
@@ -1,4 +1,4 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. +// 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.
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java similarity index 100% rename from chrome/android/javatests/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilderTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/channels/ChannelsInitializerTest.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsInitializerTest.java similarity index 100% rename from chrome/android/javatests/src/org/chromium/chrome/browser/notifications/channels/ChannelsInitializerTest.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsInitializerTest.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdater.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdater.java similarity index 99% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdater.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdater.java index 245275b..daab1a4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdater.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdater.java
@@ -18,7 +18,6 @@ * Contains helper methods for checking if we should update channels and updating them if so. */ public class ChannelsUpdater { - private static final Object sLock = new Object(); private final ChannelsInitializer mChannelsInitializer;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdaterTest.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdaterTest.java similarity index 100% rename from chrome/android/javatests/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdaterTest.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChannelsUpdaterTest.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java similarity index 97% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java index bc6ad68..b3709ef6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java
@@ -11,8 +11,7 @@ import androidx.annotation.StringDef; -import org.chromium.chrome.R; -import org.chromium.chrome.browser.webapps.WebApkServiceClient; +import org.chromium.chrome.browser.notifications.R; import org.chromium.components.browser_ui.notifications.channels.ChannelDefinitions; import java.lang.annotation.Retention; @@ -57,6 +56,12 @@ private ChromeChannelDefinitions() {} /** + * Keeps the value consistent with {@link + * org.chromium.webapk.shell_apk.WebApkServiceImplWrapper#DEFAULT_NOTIFICATION_CHANNEL_ID}. + */ + public static final String CHANNEL_ID_WEBAPKS = "default_channel_id"; + + /** * To define a new channel, add the channel ID to this StringDef and add a new entry to * PredefinedChannels.MAP below with the appropriate channel parameters. To remove an existing * channel, remove the ID from this StringDef, remove its entry from Predefined Channels.MAP, @@ -290,6 +295,6 @@ @Override public boolean isValidNonPredefinedChannelId(String channelId) { return SiteChannelsManager.isValidSiteChannelId(channelId) - || TextUtils.equals(channelId, WebApkServiceClient.CHANNEL_ID_WEBAPKS); + || TextUtils.equals(channelId, ChromeChannelDefinitions.CHANNEL_ID_WEBAPKS); } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitionsTest.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitionsTest.java similarity index 100% rename from chrome/android/junit/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitionsTest.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitionsTest.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/DIR_METADATA b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/DIR_METADATA similarity index 100% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/DIR_METADATA rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/DIR_METADATA
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/LocaleChangedBroadcastReceiver.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/LocaleChangedBroadcastReceiver.java similarity index 100% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/LocaleChangedBroadcastReceiver.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/LocaleChangedBroadcastReceiver.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS similarity index 100% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/OWNERS b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/OWNERS similarity index 66% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/OWNERS rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/OWNERS index 99846068..03fbc6c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/OWNERS +++ b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/OWNERS
@@ -2,4 +2,4 @@ # added or removed lightly, and the proper deprecation and versioning steps must be taken when doing # so. Please read the README and speak to one of us when adding/removing a channel. per-file ChromeChannelDefinitions.java=set noparent -per-file ChromeChannelDefinitions.java=file://chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS +per-file ChromeChannelDefinitions.java=file://chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/NOTIFICATION_CHANNEL_OWNERS
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/README.md b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/README.md similarity index 100% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/README.md rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/README.md
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/SiteChannelsManager.java b/chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/SiteChannelsManager.java similarity index 100% rename from chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/SiteChannelsManager.java rename to chrome/browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/channels/SiteChannelsManager.java
diff --git a/chrome/browser/notifications/notification_channels_provider_android.cc b/chrome/browser/notifications/notification_channels_provider_android.cc index 8b22ba0..8b5385b 100644 --- a/chrome/browser/notifications/notification_channels_provider_android.cc +++ b/chrome/browser/notifications/notification_channels_provider_android.cc
@@ -17,8 +17,7 @@ #include "base/strings/string_util.h" #include "base/time/default_clock.h" #include "base/values.h" -#include "chrome/android/chrome_jni_headers/NotificationSettingsBridge_jni.h" -#include "chrome/browser/content_settings/host_content_settings_map_factory.h" +#include "chrome/browser/notifications/jni_headers/NotificationSettingsBridge_jni.h" #include "chrome/common/pref_names.h" #include "components/content_settings/core/browser/content_settings_details.h" #include "components/content_settings/core/browser/content_settings_pref_provider.h"
diff --git a/chrome/browser/performance_manager/observers/metrics_collector.cc b/chrome/browser/performance_manager/observers/metrics_collector.cc index 545f731..a6bf31f 100644 --- a/chrome/browser/performance_manager/observers/metrics_collector.cc +++ b/chrome/browser/performance_manager/observers/metrics_collector.cc
@@ -8,6 +8,7 @@ #include "base/metrics/field_trial_params.h" #include "base/metrics/histogram_macros.h" +#include "base/time/time.h" #include "components/performance_manager/public/graph/graph_operations.h" #include "components/performance_manager/public/graph/node_attached_data.h" @@ -95,6 +96,22 @@ graph_->GetUkmRecorder()); } +void MetricsCollector::OnBeforeProcessNodeRemoved( + const ProcessNode* process_node) { + const base::TimeDelta lifetime = + base::Time::Now() - process_node->GetLaunchTime(); + if (lifetime > base::TimeDelta()) { + // Do not record in the rare case system time was adjusted and now < launch + // time. + UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.ProcessLifetime.HighResolution", + lifetime, base::TimeDelta::FromSeconds(1), + base::TimeDelta::FromMinutes(5), 100); + UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.ProcessLifetime.LowResolution", + lifetime, base::TimeDelta::FromSeconds(1), + base::TimeDelta::FromDays(1), 100); + } +} + void MetricsCollector::OnTitleUpdated(const PageNode* page_node) { // Only record metrics while it is backgrounded. if (page_node->IsVisible() || !ShouldReportMetrics(page_node))
diff --git a/chrome/browser/performance_manager/observers/metrics_collector.h b/chrome/browser/performance_manager/observers/metrics_collector.h index 54678ad..eb7104d 100644 --- a/chrome/browser/performance_manager/observers/metrics_collector.h +++ b/chrome/browser/performance_manager/observers/metrics_collector.h
@@ -47,6 +47,9 @@ void OnFaviconUpdated(const PageNode* page_node) override; void OnTitleUpdated(const PageNode* page_node) override; + // ProcessNodeObserver implementation: + void OnBeforeProcessNodeRemoved(const ProcessNode* process_node) override; + protected: friend class MetricsReportRecordHolder; friend class UkmCollectionStateHolder;
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index b1cbd89..b20cdcdc 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -467,6 +467,9 @@ { key::kCECPQ2Enabled, prefs::kCECPQ2Enabled, base::Value::Type::BOOLEAN }, + { key::kTripleDESEnabled, + prefs::kTripleDESEnabled, + base::Value::Type::BOOLEAN }, { key::kSSLErrorOverrideAllowed, prefs::kSSLErrorOverrideAllowed, base::Value::Type::BOOLEAN },
diff --git a/chrome/browser/policy/file_selection_dialogs_policy_handler_unittest.cc b/chrome/browser/policy/file_selection_dialogs_policy_handler_unittest.cc index 4db1b4b..148fc2e0 100644 --- a/chrome/browser/policy/file_selection_dialogs_policy_handler_unittest.cc +++ b/chrome/browser/policy/file_selection_dialogs_policy_handler_unittest.cc
@@ -50,10 +50,8 @@ const base::Value* value = NULL; EXPECT_TRUE(prefs_.GetValue(prefs::kPromptForDownload, &value)); ASSERT_TRUE(value); - bool prompt_for_download = true; - bool result = value->GetAsBoolean(&prompt_for_download); - EXPECT_TRUE(result); - EXPECT_FALSE(prompt_for_download); + ASSERT_TRUE(value->is_bool()); + EXPECT_FALSE(value->GetBool()); } } // namespace policy
diff --git a/chrome/browser/policy/javascript_policy_handler.cc b/chrome/browser/policy/javascript_policy_handler.cc index 7b2626c..0e1f6828 100644 --- a/chrome/browser/policy/javascript_policy_handler.cc +++ b/chrome/browser/policy/javascript_policy_handler.cc
@@ -56,10 +56,8 @@ } else { const base::Value* javascript_enabled = policies.GetValue(key::kJavascriptEnabled); - bool enabled = true; - if (javascript_enabled && - javascript_enabled->GetAsBoolean(&enabled) && - !enabled) { + if (javascript_enabled && javascript_enabled->is_bool() && + !javascript_enabled->GetBool()) { setting = CONTENT_SETTING_BLOCK; } }
diff --git a/chrome/browser/policy/policy_network_browsertest.cc b/chrome/browser/policy/policy_network_browsertest.cc index e2139019..3c91ddc 100644 --- a/chrome/browser/policy/policy_network_browsertest.cc +++ b/chrome/browser/policy/policy_network_browsertest.cc
@@ -41,11 +41,13 @@ #include "content/public/browser/network_service_instance.h" #include "content/public/browser/storage_partition.h" #include "content/public/common/network_service_util.h" +#include "content/public/common/page_type.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_mock_cert_verifier.h" #include "net/base/features.h" #include "net/dns/mock_host_resolver.h" +#include "net/ssl/ssl_server_config.h" #include "net/test/cert_test_util.h" #include "net/test/quic_simple_test_server.h" #include "net/test/test_data_directory.h" @@ -584,80 +586,143 @@ EXPECT_FALSE(IsQuicEnabled(profile_2())); } -class CECPQ2PolicyTest : public PolicyTest { +class SSLPolicyTest : public PolicyTest { + public: + SSLPolicyTest() : https_server_(net::EmbeddedTestServer::TYPE_HTTPS) {} + + protected: + struct LoadResult { + bool success; + std::u16string title; + }; + + bool StartTestServer(const net::SSLServerConfig ssl_config) { + https_server_.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config); + https_server_.ServeFilesFromSourceDirectory("chrome/test/data"); + return https_server_.Start(); + } + + bool GetBooleanPref(const std::string& pref_name) { + return g_browser_process->local_state()->GetBoolean(pref_name); + } + + LoadResult LoadPage(const std::string& path) { + ui_test_utils::NavigateToURL(browser(), https_server_.GetURL(path)); + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + if (web_contents->GetController().GetLastCommittedEntry()->GetPageType() == + content::PAGE_TYPE_ERROR) { + return LoadResult{false, u""}; + } + return LoadResult{true, web_contents->GetTitle()}; + } + + private: + net::EmbeddedTestServer https_server_; +}; + +class CECPQ2PolicyTest : public SSLPolicyTest { public: CECPQ2PolicyTest() { scoped_feature_list_.InitAndEnableFeature( net::features::kPostQuantumCECPQ2); } - protected: - // RunTest checks that CECPQ2 works initially but stops working after - // |update_policy| has run. - void RunTest(base::OnceCallback<void(PolicyMap*)> update_policy) { - // A test server is configured with support for only CECPQ2. - net::EmbeddedTestServer https_server_ok( - net::EmbeddedTestServer::TYPE_HTTPS); - net::SSLServerConfig ssl_config; - ssl_config.curves_for_testing = {NID_CECPQ2}; - https_server_ok.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config); - https_server_ok.ServeFilesFromSourceDirectory("chrome/test/data"); - ASSERT_TRUE(https_server_ok.Start()); - - PrefService* const prefs = g_browser_process->local_state(); - EXPECT_TRUE(prefs->GetBoolean(prefs::kCECPQ2Enabled)); - - // Should be able to load a page from the test server because CECPQ2 is - // enabled. - ui_test_utils::NavigateToURL(browser(), - https_server_ok.GetURL("/title2.html")); - content::WebContents* web_contents = - browser()->tab_strip_model()->GetActiveWebContents(); - EXPECT_EQ(u"Title Of Awesomeness", web_contents->GetTitle()); - EXPECT_NE( - web_contents->GetController().GetLastCommittedEntry()->GetPageType(), - content::PAGE_TYPE_ERROR); - - PolicyMap policies; - std::move(update_policy).Run(&policies); - UpdateProviderPolicy(policies); - content::FlushNetworkServiceInstanceForTesting(); - - // Page loads should now fail. - const GURL fail_url = https_server_ok.GetURL("/title3.html"); - ui_test_utils::NavigateToURL(browser(), fail_url); - web_contents = browser()->tab_strip_model()->GetActiveWebContents(); - EXPECT_EQ( - web_contents->GetController().GetLastCommittedEntry()->GetPageType(), - content::PAGE_TYPE_ERROR); - } - + private: base::test::ScopedFeatureList scoped_feature_list_; }; IN_PROC_BROWSER_TEST_F(CECPQ2PolicyTest, CECPQ2EnabledPolicy) { - RunTest(base::BindOnce([](PolicyMap* policies) { - SetPolicy(policies, key::kCECPQ2Enabled, base::Value(false)); - })); + net::SSLServerConfig ssl_config; + ssl_config.curves_for_testing = {NID_CECPQ2}; + ASSERT_TRUE(StartTestServer(ssl_config)); + + // Should be able to load a page from the test server because CECPQ2 is + // enabled. + EXPECT_TRUE(GetBooleanPref(prefs::kCECPQ2Enabled)); + LoadResult result = LoadPage("/title2.html"); + EXPECT_TRUE(result.success); + EXPECT_EQ(u"Title Of Awesomeness", result.title); + + // Disable the policy. + PolicyMap policies; + SetPolicy(&policies, key::kCECPQ2Enabled, base::Value(false)); + UpdateProviderPolicy(policies); + content::FlushNetworkServiceInstanceForTesting(); + + // Page loads should now fail. + EXPECT_FALSE(GetBooleanPref(prefs::kCECPQ2Enabled)); + result = LoadPage("/title3.html"); + EXPECT_FALSE(result.success); } #if !BUILDFLAG(IS_CHROMEOS_LACROS) IN_PROC_BROWSER_TEST_F(CECPQ2PolicyTest, ChromeVariations) { + net::SSLServerConfig ssl_config; + ssl_config.curves_for_testing = {NID_CECPQ2}; + ASSERT_TRUE(StartTestServer(ssl_config)); + + // Should be able to load a page from the test server because CECPQ2 is + // enabled. + EXPECT_TRUE(GetBooleanPref(prefs::kCECPQ2Enabled)); + LoadResult result = LoadPage("/title2.html"); + EXPECT_TRUE(result.success); + EXPECT_EQ(u"Title Of Awesomeness", result.title); + // Setting ChromeVariations to a non-zero value should also disable // CECPQ2. - RunTest(base::BindOnce([](PolicyMap* policies) { - const auto* const variations_key = + const auto* const variations_key = #if BUILDFLAG(IS_CHROMEOS_ASH) - // On Chrome OS the ChromeVariations policy doesn't exist and is - // replaced by DeviceChromeVariations. - key::kDeviceChromeVariations; + // On Chrome OS the ChromeVariations policy doesn't exist and is + // replaced by DeviceChromeVariations. + key::kDeviceChromeVariations; #else - key::kChromeVariations; + key::kChromeVariations; #endif + PolicyMap policies; + SetPolicy(&policies, variations_key, base::Value(1)); + UpdateProviderPolicy(policies); + content::FlushNetworkServiceInstanceForTesting(); - SetPolicy(policies, variations_key, base::Value(1)); - })); + // Page loads should now fail. + result = LoadPage("/title3.html"); + EXPECT_FALSE(result.success); } #endif // !BUILDFLAG(IS_CHROMEOS_LACROS) +IN_PROC_BROWSER_TEST_F(SSLPolicyTest, TripleDESEnabledPolicy) { + // Start a server that only supports TLS_RSA_WITH_3DES_EDE_CBC_SHA. + net::SSLServerConfig ssl_config; + ssl_config.cipher_suite_for_testing = 0x000a; + ASSERT_TRUE(StartTestServer(ssl_config)); + + // 3DES is enabled by default, for now. + EXPECT_TRUE(GetBooleanPref(prefs::kTripleDESEnabled)); + LoadResult result = LoadPage("/title2.html"); + EXPECT_TRUE(result.success); + EXPECT_EQ(u"Title Of Awesomeness", result.title); + + // Enable 3DES by policy. + PolicyMap policies; + SetPolicy(&policies, key::kTripleDESEnabled, base::Value(true)); + UpdateProviderPolicy(policies); + content::FlushNetworkServiceInstanceForTesting(); + + // 3DES is still enabled. + EXPECT_TRUE(GetBooleanPref(prefs::kTripleDESEnabled)); + result = LoadPage("/title3.html"); + EXPECT_TRUE(result.success); + EXPECT_EQ(u"Title Of More Awesomeness", result.title); + + // Disable 3DES by policy. + SetPolicy(&policies, key::kTripleDESEnabled, base::Value(false)); + UpdateProviderPolicy(policies); + content::FlushNetworkServiceInstanceForTesting(); + + // 3DES is now disabled. + EXPECT_FALSE(GetBooleanPref(prefs::kTripleDESEnabled)); + result = LoadPage("/title.html"); + EXPECT_FALSE(result.success); +} + } // namespace policy
diff --git a/chrome/browser/policy/test/autoplay_policy_browsertest.cc b/chrome/browser/policy/test/autoplay_policy_browsertest.cc index f321f37..0d275ab 100644 --- a/chrome/browser/policy/test/autoplay_policy_browsertest.cc +++ b/chrome/browser/policy/test/autoplay_policy_browsertest.cc
@@ -208,7 +208,7 @@ } // Flaky on Linux. See: crbug.com/1172978. -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) #define MAYBE_AutoplayDeniedAllowedWithURL DISABLED_AutoplayDeniedAllowedWithURL #else #define MAYBE_AutoplayDeniedAllowedWithURL AutoplayDeniedAllowedWithURL
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java index 3da345b..bb7651f 100644 --- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java +++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
@@ -641,6 +641,13 @@ "Chrome.OfflineMeasurements.IsRoaming"; /** + * Comma separated list of the user states from the OfflineMeasurementsBackgroundTask. When + * possible, values will be recorded to UMA then cleared. + */ + public static final String OFFLINE_MEASUREMENTS_USER_STATE_LIST = + "Chrome.OfflineMeasurements.UserStateList"; + + /** * Prefix of the preferences to persist pushed notifications when native is not initialized. * Each suffix pertains to a specific OptimizationType. All entries are cleared when native is * initialized. @@ -1034,9 +1041,10 @@ OFFLINE_MEASUREMENTS_HTTP_PROBE_RESULTS_LIST, OFFLINE_MEASUREMENTS_IS_AIRPLANE_MODE_ENABLED_LIST, OFFLINE_MEASUREMENTS_IS_ROAMING_LIST, - OFFLINE_MEASUREMENTS_USER_AGENT_STRING, OFFLINE_MEASUREMENTS_LAST_CHECK_MILLIS, OFFLINE_MEASUREMENTS_TIME_BETWEEN_CHECKS_MILLIS_LIST, + OFFLINE_MEASUREMENTS_USER_AGENT_STRING, + OFFLINE_MEASUREMENTS_USER_STATE_LIST, OPTIMIZATION_GUIDE_PUSH_NOTIFICATION_CACHE.pattern(), PERSISTENT_OFFLINE_CONTENT_AVAILABILITY_STATUS, PRICE_TRACKING_PRICE_ALERTS_MESSAGE_CARD,
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 83d16cf0..64711d2 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
@@ -14,6 +14,7 @@ #include "components/shared_highlighting/core/common/disabled_sites.h" #include "components/shared_highlighting/core/common/shared_highlighting_features.h" #include "components/shared_highlighting/core/common/shared_highlighting_metrics.h" +#include "components/shared_highlighting/core/common/text_fragments_utils.h" #include "content/public/browser/context_menu_params.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" @@ -51,7 +52,7 @@ void LinkToTextMenuObserver::InitMenu( const content::ContextMenuParams& params) { - highlight_exists_ = params.opened_from_highlight; + link_needs_generation_ = !params.selection_text.empty(); raw_url_ = params.page_url; if (params.page_url.has_ref()) { GURL::Replacements replacements; @@ -97,8 +98,8 @@ DCHECK(IsCommandIdSupported(command_id)); if (command_id == IDC_CONTENT_CONTEXT_COPYLINKTOTEXT) { - if (highlight_exists_) { - CopyPageURLToClipboard(); + if (!link_needs_generation_) { + ReshareLink(); } else { if (ShouldPreemptivelyGenerateLink()) { CopyLinkToClipboard(); @@ -140,7 +141,7 @@ bool LinkToTextMenuObserver::ShouldPreemptivelyGenerateLink() { return base::FeatureList::IsEnabled( shared_highlighting::kPreemptiveLinkToTextGeneration) && - !highlight_exists_; + link_needs_generation_; } void LinkToTextMenuObserver::RequestLinkGeneration() { @@ -209,7 +210,14 @@ OnRequestLinkGenerationCompleted(std::string()); } -void LinkToTextMenuObserver::CopyPageURLToClipboard() { +void LinkToTextMenuObserver::ReshareLink() { + GetRemote()->GetExistingSelectors( + base::BindOnce(&LinkToTextMenuObserver::OnGetExistingSelectorsComplete, + weak_ptr_factory_.GetWeakPtr())); +} + +void LinkToTextMenuObserver::OnGetExistingSelectorsComplete( + const std::vector<std::string>& selectors) { content::RenderFrameHost* main_frame = proxy_->GetWebContents()->GetMainFrame(); @@ -220,8 +228,11 @@ ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste, std::move(data_transfer_endpoint)); - scw.WriteText( - base::UTF8ToUTF16(raw_url_.is_empty() ? std::string() : raw_url_.spec())); + + GURL url_to_share = shared_highlighting::RemoveTextFragments(url_); + url_to_share = shared_highlighting::AppendSelectors(url_to_share, selectors); + + scw.WriteText(base::UTF8ToUTF16(url_to_share.spec())); } void LinkToTextMenuObserver::RemoveHighlight() {
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 5f41420..83bd9ce 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
@@ -50,9 +50,14 @@ // Copies the generated link to the user's clipboard. void CopyLinkToClipboard(); - // Copies the current URL to the clipboard. Used to reshare an + // Make a request to the renderer to retrieve the selector for an // existing highlight. - void CopyPageURLToClipboard(); + void ReshareLink(); + + // Callback after the request to retrieve an existing selector + // is complete. + void OnGetExistingSelectorsComplete( + const std::vector<std::string>& selectors); // Removes the highlight from the page and updates the URL. void RemoveHighlight(); @@ -67,7 +72,10 @@ RenderViewContextMenuProxy* proxy_; GURL url_; GURL raw_url_; - bool highlight_exists_ = false; + + // True when the context menu was opened with text selected. + bool link_needs_generation_ = false; + base::Optional<std::string> generated_link_; base::Optional<std::string> generated_selector_for_testing_;
diff --git a/chrome/browser/renderer_context_menu/link_to_text_menu_observer_interactive_uitest.cc b/chrome/browser/renderer_context_menu/link_to_text_menu_observer_interactive_uitest.cc index 1a17a04..26fb37a 100644 --- a/chrome/browser/renderer_context_menu/link_to_text_menu_observer_interactive_uitest.cc +++ b/chrome/browser/renderer_context_menu/link_to_text_menu_observer_interactive_uitest.cc
@@ -251,6 +251,23 @@ } } +IN_PROC_BROWSER_TEST_P(LinkToTextMenuObserverTest, + SelectionOverlappingHighlightCopiesNewLinkToText) { + content::BrowserTestClipboardScope test_clipboard_scope; + content::ContextMenuParams params; + params.page_url = GURL("http://foo.com/"); + params.selection_text = u"hello world"; + params.opened_from_highlight = true; + observer()->OverrideGeneratedSelectorForTesting("hello%20world"); + InitMenu(params); + menu()->ExecuteCommand(IDC_CONTENT_CONTEXT_COPYLINKTOTEXT, 0); + + ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); + std::u16string text; + clipboard->ReadText(ui::ClipboardBuffer::kCopyPaste, nullptr, &text); + EXPECT_EQ(u"http://foo.com/#:~:text=hello%20world", text); +} + INSTANTIATE_TEST_SUITE_P(All, LinkToTextMenuObserverTest, ::testing::Values(true, false));
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn b/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn index 69b27590..3edb7d6 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn
@@ -364,6 +364,7 @@ "background/phonetic_data_test.js", "braille/expanding_braille_translator_test.js", "braille/pan_strategy_test.js", + "common/editable_text_base_test.js", "common/key_sequence_test.js", "common/spannable_test.js", "testing/mock_feedback_test.js", @@ -380,9 +381,12 @@ "braille/spans.js", "braille/liblouis.js", "common/abstract_earcons.js", + "common/abstract_tts.js", "common/braille_interface.js", "common/chromevox.js", + "common/editable_text_base.js", "common/key_sequence.js", + "common/msgs.js", "common/spannable.js", "common/tts_interface.js", "testing/fake_dom.js",
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/background.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/background.js index 72257c5..82e5775 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/background.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/background.js
@@ -115,6 +115,9 @@ (enabled) => { this.talkBackEnabled = enabled; }); + chrome.accessibilityPrivate.onShowChromeVoxTutorial.addListener(() => { + (new PanelCommand(PanelCommandType.TUTORIAL)).send(); + }); // Set the darkScreen state to false, since the display will be on whenever // ChromeVox starts.
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/common/editable_text_base_test.js b/chrome/browser/resources/chromeos/accessibility/chromevox/common/editable_text_base_test.js new file mode 100644 index 0000000..0a37756 --- /dev/null +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/common/editable_text_base_test.js
@@ -0,0 +1,462 @@ +// 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. + +/** + * A TTS class implementing speak and stop methods intended only for testing. + * @constructor + * @implements TtsInterface + */ +class TestTts { + constructor() { + /** + * The strings that were spoken since the last call to get(). + * @type {Array<string>} + */ + this.strings = []; + } + + /** + * Returns the list of strings spoken since the last time this method was + * called, and then clears the list. + * @return {Array<string>} The list of strings. + */ + get() { + var result = this.strings; + this.strings = []; + return result; + } + + /** @override */ + speak(text, queueMode, properties) { + this.strings.push(text); + } + + /** @override */ + isSpeaking() { + return false; + } + + /** @override */ + stop() { + // Do nothing. + } + + /** @override */ + increaseOrDecreaseProperty(propertyName, increase) { + // Do nothing. + } +} + +/** + * Stores the last braille content. + * @constructor + * @implements BrailleInterface + */ +class TestBraille { + constructor() { + this.content = null; + } + + /** @override */ + write(params) { + this.content = params; + } +} + +/** + * Asserts the current braille content. + * + * @param {string} text Braille text. + * @param {number=} opt_start Selection start. + * @param {number=} opt_end Selection end. + */ +TestBraille.assertContent = function(text, opt_start, opt_end) { + var c = ChromeVox.braille.content; + assertTrue(c != null); + opt_start = opt_start !== undefined ? opt_start : -1; + opt_end = opt_end !== undefined ? opt_end : opt_start; + assertEquals(text, c.text.toString()); + assertEquals(opt_start, c.startIndex); + assertEquals(opt_end, c.endIndex); +}; + +/** + * Test fixture. + * @constructor + * @extends {ChromeVoxUnitTestBase} + */ +ChromeVoxEditableTextUnitTest = class extends testing.Test { + /** @override */ + setUp() { + // TODO: These tests are all assuming we used the IBeam cursor. + // We need to add coverage for block cursor. + ChromeVoxEditableTextBase.useIBeamCursor = true; + ChromeVox.typingEcho = TypingEcho.CHARACTER_AND_WORD; + ChromeVoxEditableTextBase.eventTypingEcho = false; + ChromeVoxEditableTextBase.shouldSpeakInsertions = true; + ChromeVox.braille = new TestBraille(); + + /** Simple mock. */ + Msgs = {}; + + /** + * Simply return the message id. + * @param {string} msg Message id. + * @return {string} Message id. + */ + Msgs.getMsg = function(msg) { + return msg; + }; + } +}; + +ChromeVoxEditableTextUnitTest.prototype.extraLibraries = [ + '../../common/testing/assert_additions.js', + '../../common/closure_shim.js', + 'abstract_tts.js', + 'chromevox.js', + 'editable_text_base.js', + 'msgs.js', + 'tts_interface.js', +]; + + +TEST_F('ChromeVoxEditableTextUnitTest', 'CursorNavigation', function() { + var tts = new TestTts(); + var obj = new ChromeVoxEditableTextBase('Hello', 0, 0, false, tts); + + obj.changed(new TextChangeEvent('Hello', 1, 1)); + obj.changed(new TextChangeEvent('Hello', 2, 2)); + obj.changed(new TextChangeEvent('Hello', 3, 3)); + obj.changed(new TextChangeEvent('Hello', 4, 4)); + obj.changed(new TextChangeEvent('Hello', 5, 5)); + obj.changed(new TextChangeEvent('Hello', 4, 4)); + obj.changed(new TextChangeEvent('Hello', 3, 3)); + assertEqualStringArrays(['H', 'e', 'l', 'l', 'o', 'o', 'l'], tts.get()); + obj.changed(new TextChangeEvent('Hello', 0, 0)); + obj.changed(new TextChangeEvent('Hello', 5, 5)); + assertEqualStringArrays(['Hel', 'Hello'], tts.get()); +}); + +/** Test typing words. */ +TEST_F('ChromeVoxEditableTextUnitTest', 'TypingWords', function() { + var tts = new TestTts(); + var obj = new ChromeVoxEditableTextBase('', 0, 0, false, tts); + obj.changed(new TextChangeEvent('H', 1, 1)); + obj.changed(new TextChangeEvent('He', 2, 2)); + obj.changed(new TextChangeEvent('Hel', 3, 3)); + obj.changed(new TextChangeEvent('Hell', 4, 4)); + obj.changed(new TextChangeEvent('Hello', 5, 5)); + obj.changed(new TextChangeEvent('Hello,', 6, 6)); + obj.changed(new TextChangeEvent('Hello, ', 7, 7)); + obj.changed(new TextChangeEvent('Hello, W', 8, 8)); + obj.changed(new TextChangeEvent('Hello, Wo', 9, 9)); + obj.changed(new TextChangeEvent('Hello, Wor', 10, 10)); + obj.changed(new TextChangeEvent('Hello, Worl', 11, 11)); + obj.changed(new TextChangeEvent('Hello, World', 12, 12)); + obj.changed(new TextChangeEvent('Hello, World.', 13, 13)); + assertEqualStringArrays( + [ + 'H', 'e', 'l', 'l', 'o', 'Hello,', ' ', 'W', 'o', 'r', 'l', 'd', + 'World.' + ], + tts.get()); + + // Backspace + obj.changed(new TextChangeEvent('Hello, World', 12, 12)); + obj.changed(new TextChangeEvent('Hello, Worl', 11, 11)); + obj.changed(new TextChangeEvent('Hello, Wor', 10, 10)); + assertEqualStringArrays(['.', 'd', 'l'], tts.get()); + + // Forward-delete + ChromeVoxEditableTextBase.useIBeamCursor = true; + obj.changed(new TextChangeEvent('Hello, Wor', 9, 9)); + obj.changed(new TextChangeEvent('Hello, Wor', 8, 8)); + obj.changed(new TextChangeEvent('Hello, Wor', 7, 7)); + obj.changed(new TextChangeEvent('Hello, or', 7, 7)); + obj.changed(new TextChangeEvent('Hello, r', 7, 7)); + obj.changed(new TextChangeEvent('Hello, ', 7, 7)); + assertEqualStringArrays(['r', 'o', 'W', 'W', 'o', 'r'], tts.get()); + + obj.changed(new TextChangeEvent('Hello, Wor', 10, 10)); + ChromeVoxEditableTextBase.useIBeamCursor = false; + obj.changed(new TextChangeEvent('Hello, Wor', 9, 9)); + obj.changed(new TextChangeEvent('Hello, Wor', 8, 8)); + obj.changed(new TextChangeEvent('Hello, Wor', 7, 7)); + obj.changed(new TextChangeEvent('Hello, or', 7, 7)); + obj.changed(new TextChangeEvent('Hello, r', 7, 7)); + obj.changed(new TextChangeEvent('Hello, ', 7, 7)); + assertEqualStringArrays(['Wor', 'r', 'o', 'W', 'o', 'r'], tts.get()); + + // Clear all + obj.changed(new TextChangeEvent('', 0, 0)); + assertEqualStringArrays(['Hello, , deleted'], tts.get()); + + // Paste / insert a whole word + obj.changed(new TextChangeEvent('Hello', 5, 5)); + assertEqualStringArrays(['Hello'], tts.get()); + obj.changed(new TextChangeEvent('Hello, World', 12, 12)); + assertEqualStringArrays([', World'], tts.get()); +}); + +/** Test selection. */ +TEST_F('ChromeVoxEditableTextUnitTest', 'Selection', function() { + var tts = new TestTts(); + var obj = new ChromeVoxEditableTextBase('Hello, world.', 0, 0, false, tts); + obj.changed(new TextChangeEvent('Hello, world.', 0, 1)); + obj.changed(new TextChangeEvent('Hello, world.', 0, 2)); + obj.changed(new TextChangeEvent('Hello, world.', 0, 3)); + obj.changed(new TextChangeEvent('Hello, world.', 0, 4)); + obj.changed(new TextChangeEvent('Hello, world.', 0, 5)); + obj.changed(new TextChangeEvent('Hello, world.', 0, 6)); + assertEqualStringArrays( + [ + 'H', 'selected', 'e', 'added_to_selection', 'l', 'added_to_selection', + 'l', 'added_to_selection', 'o', 'added_to_selection', ',', + 'added_to_selection' + ], + tts.get()); + obj.changed(new TextChangeEvent('Hello, world.', 0, 12)); + assertEqualStringArrays([' world', 'added_to_selection'], tts.get()); + obj.changed(new TextChangeEvent('Hello, world.', 1, 12)); + assertEqualStringArrays(['H', 'removed_from_selection'], tts.get()); + obj.changed(new TextChangeEvent('Hello, world.', 2, 5)); + assertEqualStringArrays(['llo', 'selected'], tts.get()); + obj.changed(new TextChangeEvent('Hello, world.', 2, 2)); + assertEqualStringArrays(['Unselected'], tts.get()); +}); + + +/** + * Test autocomplete; suppose a user is typing "google.com/firefox" into an + * address bar, and it's being autocompleted. Sometimes it's autocompleted + * as they type, sometimes there's a short delay. + */ +TEST_F('ChromeVoxEditableTextUnitTest', 'Autocomplete', function() { + var tts = new TestTts(); + var obj = new ChromeVoxEditableTextBase('', 0, 0, false, tts); + + // User types 'g' + obj.changed(new TextChangeEvent('g', 1, 1)); + assertEqualStringArrays(['g'], tts.get()); + + // The rest of 'google.com' is autocompleted and automatically selected. + obj.changed(new TextChangeEvent('google.com', 1, 10)); + assertEqualStringArrays(['oogle.com, oogle.com'], tts.get()); + + // The user doesn't realize it and types a few more characters of 'google.com' + // and this changes the selection (unselecting) as the user types them. + obj.changed(new TextChangeEvent('google.com', 2, 10)); + assertEqualStringArrays(['o', 'ogle.com'], tts.get()); + obj.changed(new TextChangeEvent('google.com', 3, 10)); + assertEqualStringArrays(['o', 'gle.com'], tts.get()); + obj.changed(new TextChangeEvent('google.com', 4, 10)); + assertEqualStringArrays(['g', 'le.com'], tts.get()); + + // The user presses right-arrow, which fully unselects the remaining text. + obj.changed(new TextChangeEvent('google.com', 10, 10)); + assertEqualStringArrays(['Unselected'], tts.get()); + + // The user types '/' + obj.changed(new TextChangeEvent('google.com/', 11, 11)); + assertEqualStringArrays(['com/'], tts.get()); + + // The user types 'f', and 'finance' is autocompleted + obj.changed(new TextChangeEvent('google.com/finance', 12, 18)); + assertEqualStringArrays(['finance, inance'], tts.get()); + + // The user types 'i' + obj.changed(new TextChangeEvent('google.com/finance', 13, 18)); + assertEqualStringArrays(['i', 'nance'], tts.get()); + + // The user types 'r', now 'firefox' is autocompleted + obj.changed(new TextChangeEvent('google.com/firefox', 14, 18)); + assertEqualStringArrays(['refox, efox'], tts.get()); + + // The user presses right-arrow to accept the completion. + obj.changed(new TextChangeEvent('google.com/firefox', 18, 18)); + assertEqualStringArrays(['Unselected'], tts.get()); +}); + + +/** + * Test a few common scenarios where text is replaced. + */ +TEST_F('ChromeVoxEditableTextUnitTest', 'ReplacingText', function() { + // Initial value is Alabama. + var tts = new TestTts(); + var obj = new ChromeVoxEditableTextBase('Alabama', 0, 0, false, tts); + + // Entire text replaced with Alaska. + obj.changed(new TextChangeEvent('Alaska', 0, 0)); + assertEqualStringArrays(['Alaska'], tts.get()); + + // Entire text selected. + obj.changed(new TextChangeEvent('Alaska', 0, 6)); + assertEqualStringArrays(['Alaska', 'selected'], tts.get()); + + // Entire text replaced with Arizona. + obj.changed(new TextChangeEvent('Arizona', 7, 7)); + assertEqualStringArrays(['Arizona'], tts.get()); + + // Entire text selected. + obj.changed(new TextChangeEvent('Arizona', 0, 7)); + assertEqualStringArrays(['Arizona', 'selected'], tts.get()); + + // Click between 'r' and 'i'. + obj.changed(new TextChangeEvent('Arizona', 2, 2)); + assertEqualStringArrays(['Unselected'], tts.get()); + + // Next character removed from selection. + obj.changed(new TextChangeEvent('Arizona', 2, 7)); + assertEqualStringArrays(['izona', 'selected'], tts.get()); + + // Selection replaced with "kansas" to make Arkansas. This time it + // says "kansas" because the deleted text was selected. + obj.changed(new TextChangeEvent('Arkansas', 8, 8)); + assertEqualStringArrays(['kansas'], tts.get()); +}); + + +/** + * Test feedback when text changes in a long sentence. + */ +TEST_F('ChromeVoxEditableTextUnitTest', 'ReplacingLongText', function() { + var tts = new TestTts(); + var obj = new ChromeVoxEditableTextBase( + 'I love deadlines. I like the whooshing sound they make as they fly by.', + 0, 0, false, tts); + + // Change the whole sentence without moving the cursor. It should speak + // only the part that changed, but it should speak whole words. + obj.changed(new TextChangeEvent( + 'I love deadlines. I love the whooshing sounds they make as they fly by.', + 0, 0)); + assertEqualStringArrays(['love the whooshing sounds'], tts.get()); +}); + +/** Tests character echo. */ +TEST_F('ChromeVoxEditableTextUnitTest', 'CharacterEcho', function() { + ChromeVox.typingEcho = TypingEcho.CHARACTER; + var tts = new TestTts(); + var obj = new ChromeVoxEditableTextBase('', 0, 0, false, tts); + obj.changed(new TextChangeEvent('H', 1, 1)); + obj.changed(new TextChangeEvent('He', 2, 2)); + obj.changed(new TextChangeEvent('Hel', 3, 3)); + obj.changed(new TextChangeEvent('Hell', 4, 4)); + obj.changed(new TextChangeEvent('Hello', 5, 5)); + obj.changed(new TextChangeEvent('Hello,', 6, 6)); + obj.changed(new TextChangeEvent('Hello, ', 7, 7)); + obj.changed(new TextChangeEvent('Hello, W', 8, 8)); + obj.changed(new TextChangeEvent('Hello, Wo', 9, 9)); + obj.changed(new TextChangeEvent('Hello, Wor', 10, 10)); + obj.changed(new TextChangeEvent('Hello, Worl', 11, 11)); + obj.changed(new TextChangeEvent('Hello, World', 12, 12)); + obj.changed(new TextChangeEvent('Hello, World.', 13, 13)); + assertEqualStringArrays( + ['H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '.'], + tts.get()); +}); + + +/** Tests character echo in auto complete text fields. */ +TEST_F('ChromeVoxEditableTextUnitTest', 'CharEchoInAutoComplete', function() { + var tts = new TestTts(); + var url = 'chromevox.com'; + var obj = new ChromeVoxEditableTextBase(url, 1, 13, false, tts); + + // This simulates a user typing into an auto complete text field one character + // at a time. The selection is the completion and we toggle between various + // typing echo options. + ChromeVox.typingEcho = TypingEcho.CHARACTER; + obj.changed(new TextChangeEvent(url, 2, 13)); + ChromeVox.typingEcho = TypingEcho.NONE; + obj.changed(new TextChangeEvent(url, 3, 13)); + ChromeVox.typingEcho = TypingEcho.CHARACTER_AND_WORD; + obj.changed(new TextChangeEvent(url, 4, 13)); + ChromeVox.typingEcho = TypingEcho.WORD; + obj.changed(new TextChangeEvent(url, 5, 13)); + + // The characters should only be read for the typing echo modes containing a + // character. They are commented out below when unexpected to make the test + // clearer to read. + assertEqualStringArrays( + [ + 'h', url.slice(2), + /* 'r', */ url.slice(3), 'o', url.slice(4), + /* 'm', */ url.slice(5) + ], + tts.get()); +}); + + +/** Tests word echo. */ +TEST_F('ChromeVoxEditableTextUnitTest', 'WordEcho', function() { + ChromeVox.typingEcho = TypingEcho.WORD; + var tts = new TestTts(); + var obj = new ChromeVoxEditableTextBase('', 0, 0, false, tts); + obj.changed(new TextChangeEvent('H', 1, 1)); + obj.changed(new TextChangeEvent('He', 2, 2)); + obj.changed(new TextChangeEvent('Hel', 3, 3)); + obj.changed(new TextChangeEvent('Hell', 4, 4)); + obj.changed(new TextChangeEvent('Hello', 5, 5)); + obj.changed(new TextChangeEvent('Hello,', 6, 6)); + obj.changed(new TextChangeEvent('Hello, ', 7, 7)); + obj.changed(new TextChangeEvent('Hello, W', 8, 8)); + obj.changed(new TextChangeEvent('Hello, Wo', 9, 9)); + obj.changed(new TextChangeEvent('Hello, Wor', 10, 10)); + obj.changed(new TextChangeEvent('Hello, Worl', 11, 11)); + obj.changed(new TextChangeEvent('Hello, World', 12, 12)); + obj.changed(new TextChangeEvent('Hello, World.', 13, 13)); + assertEqualStringArrays(['Hello,', 'World.'], tts.get()); +}); + + +/** Tests no echo. */ +TEST_F('ChromeVoxEditableTextUnitTest', 'NoEcho', function() { + ChromeVox.typingEcho = TypingEcho.NONE; + var tts = new TestTts(); + var obj = new ChromeVoxEditableTextBase('', 0, 0, false, tts); + obj.changed(new TextChangeEvent('H', 1, 1)); + obj.changed(new TextChangeEvent('He', 2, 2)); + obj.changed(new TextChangeEvent('Hel', 3, 3)); + obj.changed(new TextChangeEvent('Hell', 4, 4)); + obj.changed(new TextChangeEvent('Hello', 5, 5)); + obj.changed(new TextChangeEvent('Hello,', 6, 6)); + obj.changed(new TextChangeEvent('Hello, ', 7, 7)); + obj.changed(new TextChangeEvent('Hello, W', 8, 8)); + obj.changed(new TextChangeEvent('Hello, Wo', 9, 9)); + obj.changed(new TextChangeEvent('Hello, Wor', 10, 10)); + obj.changed(new TextChangeEvent('Hello, Worl', 11, 11)); + obj.changed(new TextChangeEvent('Hello, World', 12, 12)); + obj.changed(new TextChangeEvent('Hello, World.', 13, 13)); + assertEqualStringArrays([], tts.get()); +}); + +/** Tests normalization of TextChangeEvent's */ +TEST_F('ChromeVoxEditableTextUnitTest', 'TextChangeEvent', function() { + var event1 = new TextChangeEvent('foo', 0, 1, true); + var event2 = new TextChangeEvent('foo', 1, 0, true); + var event3 = new TextChangeEvent('foo', 1, 1, true); + + assertEquals(0, event1.start); + assertEquals(1, event1.end); + + assertEquals(0, event2.start); + assertEquals(1, event2.end); + + assertEquals(1, event3.start); + assertEquals(1, event3.end); +}); + +TEST_F('ChromeVoxEditableTextUnitTest', 'TypingNonBreakingSpaces', function() { + var tts = new TestTts(); + var obj = new ChromeVoxEditableTextBase('Hello', 0, 0, false, tts); + + obj.changed(new TextChangeEvent('h', 1, 1)); + obj.changed(new TextChangeEvent('hi', 2, 2)); + obj.changed(new TextChangeEvent('hi\u00a0', 3, 3)); + obj.changed(new TextChangeEvent('hi t', 4, 4)); + assertEqualStringArrays(['h', 'i', 'hi ', 't'], tts.get()); +});
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/common/key_util.js b/chrome/browser/resources/chromeos/accessibility/chromevox/common/key_util.js index af45ce79..494296c 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/common/key_util.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/common/key_util.js
@@ -242,7 +242,7 @@ return msg('forward_key'); case KeyCode.BROWSER_REFRESH: return msg('refresh_key'); - case KeyCode.MEDIA_LAUNCH_APP2: + case KeyCode.ZOOM: return msg('toggle_full_screen_key'); case KeyCode.MEDIA_LAUNCH_APP1: return msg('window_overview_key');
diff --git a/chrome/browser/resources/chromeos/accessibility/common/closure_shim.js b/chrome/browser/resources/chromeos/accessibility/common/closure_shim.js index 6554667..ebaac9d 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/closure_shim.js +++ b/chrome/browser/resources/chromeos/accessibility/common/closure_shim.js
@@ -8,6 +8,8 @@ var goog = {}; +goog.addDependency = function() {}; + goog.provide = function(n) { globalThis[n] = {}; };
diff --git a/chrome/browser/resources/chromeos/accessibility/switch_access/action_manager.js b/chrome/browser/resources/chromeos/accessibility/switch_access/action_manager.js index ad5486f..a472e67 100644 --- a/chrome/browser/resources/chromeos/accessibility/switch_access/action_manager.js +++ b/chrome/browser/resources/chromeos/accessibility/switch_access/action_manager.js
@@ -217,7 +217,7 @@ } let actions = this.actionNode_.actions; const possibleActions = this.actionsForType_(this.currentMenuType_); - actions.filter((a) => possibleActions.includes(a)); + actions = actions.filter((a) => possibleActions.includes(a)); if (this.currentMenuType_ === SAConstants.MenuType.MAIN_MENU) { actions = this.addGlobalActions_(actions); }
diff --git a/chrome/browser/resources/chromeos/network_ui/network_ui.html b/chrome/browser/resources/chromeos/network_ui/network_ui.html index a67d813..3123b41 100644 --- a/chrome/browser/resources/chromeos/network_ui/network_ui.html +++ b/chrome/browser/resources/chromeos/network_ui/network_ui.html
@@ -64,6 +64,13 @@ </div> <div> + <h2>$i18n{resetESimCacheLabel}</h2> + <cr-button class="action-button" on-click="onResetESimCacheClick_"> + $i18n{resetESimCacheButtonText} + </cr-button> + </div> + + <div> <h2>$i18n{addNewWifiLabel}</h2> <cr-button class="action-button" id="add-new-wifi-button" on-click="showAddNewWifi_">
diff --git a/chrome/browser/resources/chromeos/network_ui/network_ui.js b/chrome/browser/resources/chromeos/network_ui/network_ui.js index d4c080b..a409992 100644 --- a/chrome/browser/resources/chromeos/network_ui/network_ui.js +++ b/chrome/browser/resources/chromeos/network_ui/network_ui.js
@@ -120,6 +120,11 @@ }, /** @private */ + onResetESimCacheClick_() { + this.browserProxy_.resetESimCache(); + }, + + /** @private */ showAddNewWifi_() { this.browserProxy_.showAddNewWifi(); },
diff --git a/chrome/browser/resources/chromeos/network_ui/network_ui_browser_proxy.js b/chrome/browser/resources/chromeos/network_ui/network_ui_browser_proxy.js index 1ef0e41..ec02c13 100644 --- a/chrome/browser/resources/chromeos/network_ui/network_ui_browser_proxy.js +++ b/chrome/browser/resources/chromeos/network_ui/network_ui_browser_proxy.js
@@ -37,6 +37,8 @@ */ openCellularActivationUi() {} + resetESimCache() {} + /** * @param {string} debugging * @return {Promise<!Array>} @@ -103,6 +105,11 @@ } /** @override */ + resetESimCache() { + chrome.send('resetESimCache'); + } + + /** @override */ setShillDebugging(debugging) { return sendWithPromise('setShillDebugging', debugging); }
diff --git a/chrome/browser/resources/print_preview/BUILD.gn b/chrome/browser/resources/print_preview/BUILD.gn index 790293c..db4cb3e 100644 --- a/chrome/browser/resources/print_preview/BUILD.gn +++ b/chrome/browser/resources/print_preview/BUILD.gn
@@ -97,8 +97,6 @@ "data/destination_policies.js", "data/destination_store.js", "data/document_info.js", - "data/invitation.js", - "data/invitation_store.js", "data/local_parsers.js", "data/margins.js", "data/measurement_system.js", @@ -146,7 +144,6 @@ "ui/duplex_settings.js", "ui/header.js", "ui/icons.js", - "ui/invitation_promo.js", "ui/layout_settings.js", "ui/margin_control.js", "ui/margin_control_container.js", @@ -299,7 +296,6 @@ deps = [ ":native_layer", "data:destination", - "data:invitation", "//ui/webui/resources/js/cr:event_target.m", ] } @@ -310,7 +306,6 @@ ":native_layer_cros", "data:cloud_parsers", "data:destination", - "data:invitation", "//ui/webui/resources/js:assert.m", "//ui/webui/resources/js:cr.m", "//ui/webui/resources/js/cr:event_target.m",
diff --git a/chrome/browser/resources/print_preview/cloud_print_interface.js b/chrome/browser/resources/print_preview/cloud_print_interface.js index a90c3d57..b4981d4e 100644 --- a/chrome/browser/resources/print_preview/cloud_print_interface.js +++ b/chrome/browser/resources/print_preview/cloud_print_interface.js
@@ -4,7 +4,6 @@ import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; import {Destination, DestinationOrigin} from './data/destination.js'; -import {Invitation} from './data/invitation.js'; import {NativeLayer} from './native_layer.js'; /** @@ -53,24 +52,6 @@ */ export let CloudPrintInterfacePrinterFailedDetail; -/** - * @typedef {{ - * invitations: !Array<!Invitation>, - * user: string, - * }} - */ -export let CloudPrintInterfaceInvitesDoneDetail; - -/** - * @typedef {{ - * invitation: !Invitation, - * printer: ?Destination, - * accept: boolean, - * user: string, - * }} - */ -export let CloudPrintInterfaceProcessInviteDetail; - /** @interface */ export class CloudPrintInterface { /** @return {boolean} Whether cookie destinations are disabled. */ @@ -114,19 +95,6 @@ setUsers(users) {} /** - * Sends Google Cloud Print printer sharing invitations API requests. - * @param {string} account Account the request is sent for. - */ - invites(account) {} - - /** - * Accepts or rejects printer sharing invitation. - * @param {!Invitation} invitation Invitation to process. - * @param {boolean} accept Whether to accept this invitation. - */ - processInvite(invitation, accept) {} - - /** * Sends a Google Cloud Print submit API request. * @param {!Destination} destination Cloud destination to * print to.
diff --git a/chrome/browser/resources/print_preview/cloud_print_interface_impl.js b/chrome/browser/resources/print_preview/cloud_print_interface_impl.js index fc2d2202..b86abd5 100644 --- a/chrome/browser/resources/print_preview/cloud_print_interface_impl.js +++ b/chrome/browser/resources/print_preview/cloud_print_interface_impl.js
@@ -7,9 +7,8 @@ import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; import {CloudPrintInterface, CloudPrintInterfaceErrorEventDetail, CloudPrintInterfaceEventType} from './cloud_print_interface.js'; -import {parseCloudDestination, parseInvitation} from './data/cloud_parsers.js'; +import {parseCloudDestination} from './data/cloud_parsers.js'; import {CloudOrigins, DestinationOrigin} from './data/destination.js'; -import {Invitation} from './data/invitation.js'; // <if expr="chromeos"> import {NativeLayerCrosImpl} from './native_layer_cros.js'; // </if> @@ -142,30 +141,6 @@ } /** @override */ - invites(account) { - const params = [ - new HttpParam('client', 'chrome'), - ]; - this.sendOrQueueRequest_(this.buildRequest_( - 'GET', 'invites', params, DestinationOrigin.COOKIES, account, - this.onInvitesDone_.bind(this))); - } - - /** @override */ - processInvite(invitation, accept) { - const params = [ - new HttpParam('printerid', invitation.destination.id), - new HttpParam('email', invitation.scopeId), - new HttpParam('accept', accept ? 'true' : 'false'), - new HttpParam('use_cdd', 'true'), - ]; - this.sendOrQueueRequest_(this.buildRequest_( - 'POST', 'processinvite', params, invitation.destination.origin, - invitation.destination.account, - this.onProcessInviteDone_.bind(this, invitation, accept))); - } - - /** @override */ submit(destination, printTicket, documentTitle, data) { const result = VERSION_REGEXP_.exec(navigator.userAgent); let chromeVersion = 'unknown'; @@ -489,73 +464,6 @@ } /** - * Called when invitations search request completes. - * @param {!CloudPrintRequest} request Request that has been - * completed. - * @private - */ - onInvitesDone_(request) { - const activeUser = (request.result && request.result['request'] && - request.result['request']['user']) || - ''; - if (request.xhr.status === 200 && request.result['success']) { - // Extract invitations. - const invitationListJson = request.result['invites'] || []; - const invitationList = []; - invitationListJson.forEach(function(invitationJson) { - try { - invitationList.push(parseInvitation(invitationJson, activeUser)); - } catch (e) { - console.warn('Unable to parse invitation: ' + e); - } - }); - // Dispatch INVITES_DONE event. - this.eventTarget_.dispatchEvent( - new CustomEvent(CloudPrintInterfaceEventType.INVITES_DONE, { - detail: { - invitations: invitationList, - user: activeUser, - } - })); - } else { - this.eventTarget_.dispatchEvent(new CustomEvent( - CloudPrintInterfaceEventType.INVITES_FAILED, {detail: activeUser})); - } - } - - /** - * Called when invitation processing request completes. - * @param {!Invitation} invitation Processed invitation. - * @param {boolean} accept Whether this invitation was accepted or rejected. - * @param {!CloudPrintRequest} request Request that has been - * completed. - * @private - */ - onProcessInviteDone_(invitation, accept, request) { - const activeUser = (request.result && request.result['request'] && - request.result['request']['user']) || - ''; - let printer = null; - if (request.xhr.status === 200 && request.result['success'] && accept) { - try { - printer = parseCloudDestination( - request.result['printer'], request.origin, activeUser); - } catch (e) { - console.warn('Failed to parse cloud print destination: ' + e); - } - } - this.eventTarget_.dispatchEvent( - new CustomEvent(CloudPrintInterfaceEventType.PROCESS_INVITE_DONE, { - detail: { - printer: printer, - invitation: invitation, - accept: accept, - user: activeUser, - } - })); - } - - /** * Called when the submit request completes. * @param {!CloudPrintRequest} request Request that has been * completed.
diff --git a/chrome/browser/resources/print_preview/data/BUILD.gn b/chrome/browser/resources/print_preview/data/BUILD.gn index 605131b..2374f58 100644 --- a/chrome/browser/resources/print_preview/data/BUILD.gn +++ b/chrome/browser/resources/print_preview/data/BUILD.gn
@@ -17,8 +17,6 @@ ":destination_policies", ":destination_store", ":document_info", - ":invitation", - ":invitation_store", ":local_parsers", ":margins", ":measurement_system", @@ -60,15 +58,6 @@ ] } -js_library("invitation_store") { - deps = [ - ":invitation", - "..:cloud_print_interface", - "//ui/webui/resources/js:event_tracker.m", - "//ui/webui/resources/js/cr:event_target.m", - ] -} - if (is_chromeos_ash) { js_library("print_server_store") { deps = [ @@ -99,15 +88,10 @@ js_library("cloud_parsers") { deps = [ ":destination", - ":invitation", "//ui/webui/resources/js:assert.m", ] } -js_library("invitation") { - deps = [ ":destination" ] -} - js_library("destination") { deps = [ "//ui/webui/resources/js:assert.m", @@ -184,7 +168,6 @@ deps = [ ":destination", ":destination_store", - ":invitation_store", "..:cloud_print_interface", "//ui/webui/resources/js:assert.m", "//ui/webui/resources/js:event_tracker.m",
diff --git a/chrome/browser/resources/print_preview/data/cloud_parsers.js b/chrome/browser/resources/print_preview/data/cloud_parsers.js index a0c08b5..94b68ed3 100644 --- a/chrome/browser/resources/print_preview/data/cloud_parsers.js +++ b/chrome/browser/resources/print_preview/data/cloud_parsers.js
@@ -5,7 +5,6 @@ import {assert} from 'chrome://resources/js/assert.m.js'; import {Cdd} from './cdd.js'; import {Destination, DestinationCertificateStatus, DestinationConnectionStatus, DestinationOrigin, DestinationType} from './destination.js'; -import {Invitation} from './invitation.js'; /** * Enumeration of cloud destination field names. @@ -130,64 +129,3 @@ } return cloudDest; } - -/** - * Enumeration of invitation field names. - * @enum {string} - */ -const InvitationField = { - PRINTER: 'printer', - RECEIVER: 'receiver', - SENDER: 'sender' -}; - -/** - * Enumeration of cloud destination types that are supported by print preview. - * @enum {string} - */ -const InvitationAclType = { - DOMAIN: 'DOMAIN', - GROUP: 'GROUP', - PUBLIC: 'PUBLIC', - USER: 'USER' -}; - -/** - * Parses printer sharing invitation from JSON from GCP invite API response. - * @param {!Object} json Object that represents a invitation search response. - * @param {string} account The account this invitation is sent for. - * @return {!Invitation} Parsed invitation. - */ -export function parseInvitation(json, account) { - if (!json.hasOwnProperty(InvitationField.SENDER) || - !json.hasOwnProperty(InvitationField.RECEIVER) || - !json.hasOwnProperty(InvitationField.PRINTER)) { - throw Error('Invitation does not have necessary info.'); - } - - const nameFormatter = function(name, scope) { - return name && scope ? (name + ' (' + scope + ')') : (name || scope); - }; - - const sender = json[InvitationField.SENDER]; - const senderName = nameFormatter(sender['name'], sender['email']); - - const receiver = json[InvitationField.RECEIVER]; - let receiverName = ''; - const receiverType = receiver['type']; - if (receiverType === InvitationAclType.USER) { - // It's a personal invitation, empty name indicates just that. - } else if ( - receiverType === InvitationAclType.GROUP || - receiverType === InvitationAclType.DOMAIN) { - receiverName = nameFormatter(receiver['name'], receiver['scope']); - } else { - throw Error('Invitation of unsupported receiver type'); - } - - const destination = parseCloudDestination( - json[InvitationField.PRINTER], DestinationOrigin.COOKIES, account); - - return new Invitation( - senderName, receiverName, destination, receiver, account); -}
diff --git a/chrome/browser/resources/print_preview/data/destination_store.js b/chrome/browser/resources/print_preview/data/destination_store.js index 84a4a08d..f44f9553 100644 --- a/chrome/browser/resources/print_preview/data/destination_store.js +++ b/chrome/browser/resources/print_preview/data/destination_store.js
@@ -8,7 +8,7 @@ import {EventTracker} from 'chrome://resources/js/event_tracker.m.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; -import {CloudPrintInterface, CloudPrintInterfaceEventType, CloudPrintInterfacePrinterFailedDetail, CloudPrintInterfaceProcessInviteDetail, CloudPrintInterfaceSearchDoneDetail} from '../cloud_print_interface.js'; +import {CloudPrintInterface, CloudPrintInterfaceEventType, CloudPrintInterfacePrinterFailedDetail, CloudPrintInterfaceSearchDoneDetail} from '../cloud_print_interface.js'; import {Metrics, MetricsContext} from '../metrics.js'; import {CapabilitiesResponse, NativeLayer, NativeLayerImpl} from '../native_layer.js'; // <if expr="chromeos"> @@ -390,10 +390,6 @@ this.createLocalDrivePrintDestination_(); } // </if> - // <if expr="not chromeos"> - // Start cloud printers, so that we can determine whether to show Drive. - this.startLoadCloudDestinations(); - // </if> // Nothing recent, no system default ==> try to get a fallback printer as // destinationsInserted_ may never be called. @@ -405,7 +401,9 @@ // Load all possible printers. for (const printerType of this.typesToSearch_) { if (printerType === PrinterType.CLOUD_PRINTER) { - this.startLoadCloudDestinations(); + // Accounts are not known on startup. Send an initial search query to + // get tokens and user accounts. + this.cloudPrintInterface_.search(); } else if ( printerType !== PrinterType.PRIVET_PRINTER || loadTimeData.getBoolean('forceEnablePrivetPrinting')) { @@ -659,10 +657,6 @@ this.cloudPrintInterface_.getEventTarget(), CloudPrintInterfaceEventType.PRINTER_FAILED, this.onCloudPrintPrinterFailed_.bind(this)); - this.tracker_.add( - this.cloudPrintInterface_.getEventTarget(), - CloudPrintInterfaceEventType.PROCESS_INVITE_DONE, - this.onCloudPrintProcessInviteDone_.bind(this)); } /** @param {string} key Key identifying the destination to select */ @@ -1204,19 +1198,6 @@ } /** - * Called when printer sharing invitation was processed successfully. - * @param {!CustomEvent<!CloudPrintInterfaceProcessInviteDetail>} - * event Contains detailed information about the invite and newly - * accepted destination (if known). - * @private - */ - onCloudPrintProcessInviteDone_(event) { - if (event.detail.accept && event.detail.printer) { - this.insertDestination_(event.detail.printer); - } - } - - /** * Called when a printer or printers are detected after sending getPrinters * from the native layer. * @param {!PrinterType} type The type of printer(s) added.
diff --git a/chrome/browser/resources/print_preview/data/invitation.js b/chrome/browser/resources/print_preview/data/invitation.js deleted file mode 100644 index 833bb40..0000000 --- a/chrome/browser/resources/print_preview/data/invitation.js +++ /dev/null
@@ -1,85 +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 {Destination} from './destination.js'; - -export class Invitation { - /** - * Printer sharing invitation data object. - * @param {string} sender Text identifying invitation sender. - * @param {string} receiver Text identifying invitation receiver. Empty in - * case of a personal invitation. Identifies a group or domain in case - * of an invitation received by a group manager. - * @param {!Destination} destination Shared destination. - * @param {!Object} aclEntry JSON representation of the ACL entry this - * invitation was sent to. - * @param {string} account User account this invitation is sent for. - */ - constructor(sender, receiver, destination, aclEntry, account) { - /** - * Text identifying invitation sender. - * @private {string} - */ - this.sender_ = sender; - - /** - * Text identifying invitation receiver. Empty in case of a personal - * invitation. Identifies a group or domain in case of an invitation - * received by a group manager. - * @private {string} - */ - this.receiver_ = receiver; - - /** - * Shared destination. - * @private {!Destination} - */ - this.destination_ = destination; - - /** - * JSON representation of the ACL entry this invitation was sent to. - * @private {!Object} - */ - this.aclEntry_ = aclEntry; - - /** - * Account this invitation is sent for. - * @private {string} - */ - this.account_ = account; - } - - /** @return {string} Text identifying invitation sender. */ - get sender() { - return this.sender_; - } - - /** @return {string} Text identifying invitation receiver. */ - get receiver() { - return this.receiver_; - } - - /** - * @return {boolean} Whether this user acts as a manager for a group of - * users. - */ - get asGroupManager() { - return !!this.receiver_; - } - - /** @return {!Destination} Shared destination. */ - get destination() { - return this.destination_; - } - - /** @return {string} Scope (account) this invitation was sent to. */ - get scopeId() { - return this.aclEntry_['scope'] || ''; - } - - /** @return {string} Account this invitation is sent for. */ - get account() { - return this.account_; - } -}
diff --git a/chrome/browser/resources/print_preview/data/invitation_store.js b/chrome/browser/resources/print_preview/data/invitation_store.js deleted file mode 100644 index fc2a58d6..0000000 --- a/chrome/browser/resources/print_preview/data/invitation_store.js +++ /dev/null
@@ -1,200 +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 {assert} from 'chrome://resources/js/assert.m.js'; -import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; -import {EventTracker} from 'chrome://resources/js/event_tracker.m.js'; - -import {CloudPrintInterface, CloudPrintInterfaceEventType, CloudPrintInterfaceInvitesDoneDetail, CloudPrintInterfaceProcessInviteDetail} from '../cloud_print_interface.js'; - -import {Invitation} from './invitation.js'; - -/** - * @enum {number} - * @private - */ -const InvitationStoreLoadStatus = { - IN_PROGRESS: 1, - DONE: 2, - FAILED: 3, -}; - -export class InvitationStore extends EventTarget { - /** Printer sharing invitations data store. */ - constructor() { - super(); - - /** - * Maps user account to the list of invitations for this account. - * @private {!Object<!Array<!Invitation>>} - */ - this.invitations_ = {}; - - /** - * Maps user account to the flag whether the invitations for this account - * were successfully loaded. - * @private {!Object<InvitationStoreLoadStatus>} - */ - this.loadStatus_ = {}; - - /** - * Event tracker used to track event listeners of the destination store. - * @private {!EventTracker} - */ - this.tracker_ = new EventTracker(); - - /** - * Used to fetch and process invitations. - * @private {CloudPrintInterface} - */ - this.cloudPrintInterface_ = null; - - /** - * Invitation being processed now. Only one invitation can be processed at - * a time. - * @private {Invitation} - */ - this.invitationInProgress_ = null; - } - - /** - * @return {Invitation} Currently processed invitation or - * {@code null}. - */ - get invitationInProgress() { - return this.invitationInProgress_; - } - - /** - * @param {string} account Account to filter invitations by. - * @return {!Array<!Invitation>} List of invitations for the - * {@code account}. - */ - invitations(account) { - return this.invitations_[account] || []; - } - - /** - * Sets the invitation store's Google Cloud Print interface. - * @param {!CloudPrintInterface} cloudPrintInterface Interface - * to set. - */ - setCloudPrintInterface(cloudPrintInterface) { - assert(this.cloudPrintInterface_ === null); - this.cloudPrintInterface_ = cloudPrintInterface; - this.tracker_.add( - this.cloudPrintInterface_.getEventTarget(), - CloudPrintInterfaceEventType.INVITES_DONE, - this.onCloudPrintInvitesDone_.bind(this)); - this.tracker_.add( - this.cloudPrintInterface_.getEventTarget(), - CloudPrintInterfaceEventType.INVITES_FAILED, - this.onCloudPrintInvitesFailed_.bind(this)); - this.tracker_.add( - this.cloudPrintInterface_.getEventTarget(), - CloudPrintInterfaceEventType.PROCESS_INVITE_DONE, - this.onCloudPrintProcessInviteDone_.bind(this)); - } - - /** Removes all events being tracked from the tracker. */ - resetTracker() { - this.tracker_.removeAll(); - } - - /** - * Initiates loading of cloud printer sharing invitations for the user - * account given by |user|. - * @param {string} user The user to load invitations for. - */ - startLoadingInvitations(user) { - if (!this.cloudPrintInterface_) { - return; - } - if (this.loadStatus_.hasOwnProperty(user)) { - if (this.loadStatus_[user] === InvitationStoreLoadStatus.DONE) { - this.dispatchEvent( - new CustomEvent(InvitationStore.EventType.INVITATION_SEARCH_DONE)); - } - return; - } - - this.loadStatus_[user] = InvitationStoreLoadStatus.IN_PROGRESS; - this.cloudPrintInterface_.invites(user); - } - - /** - * Accepts or rejects the {@code invitation}, based on {@code accept} value. - * @param {!Invitation} invitation Invitation to process. - * @param {boolean} accept Whether to accept this invitation. - */ - processInvitation(invitation, accept) { - if (this.invitationInProgress_) { - return; - } - this.invitationInProgress_ = invitation; - this.cloudPrintInterface_.processInvite(invitation, accept); - } - - /** - * Removes processed invitation from the internal storage. - * @param {!Invitation} invitation Processed invitation. - * @private - */ - invitationProcessed_(invitation) { - if (this.invitations_.hasOwnProperty(invitation.account)) { - this.invitations_[invitation.account] = - this.invitations_[invitation.account].filter(function(i) { - return i !== invitation; - }); - } - if (this.invitationInProgress_ === invitation) { - this.invitationInProgress_ = null; - } - } - - /** - * Called when printer sharing invitations are fetched. - * @param {!CustomEvent<!CloudPrintInterfaceInvitesDoneDetail>} - * event Contains the list of invitations. - * @private - */ - onCloudPrintInvitesDone_(event) { - this.loadStatus_[event.detail.user] = InvitationStoreLoadStatus.DONE; - this.invitations_[event.detail.user] = event.detail.invitations; - - this.dispatchEvent( - new CustomEvent(InvitationStore.EventType.INVITATION_SEARCH_DONE)); - } - - /** - * Called when printer sharing invitations fetch has failed. - * @param {!CustomEvent<string>} event Contains the user for whom invite - * fetch failed. - * @private - */ - onCloudPrintInvitesFailed_(event) { - this.loadStatus_[event.detail] = InvitationStoreLoadStatus.FAILED; - } - - /** - * Called when printer sharing invitation was processed successfully. - * @param {!CustomEvent<!CloudPrintInterfaceProcessInviteDetail>} - * event Contains detailed information about the invite. - * @private - */ - onCloudPrintProcessInviteDone_(event) { - this.invitationProcessed_(event.detail.invitation); - this.dispatchEvent( - new CustomEvent(InvitationStore.EventType.INVITATION_PROCESSED)); - } -} - -/** - * Event types dispatched by the data store. - * @enum {string} - */ -InvitationStore.EventType = { - INVITATION_PROCESSED: 'InvitationStore.INVITATION_PROCESSED', - INVITATION_SEARCH_DONE: 'InvitationStore.INVITATION_SEARCH_DONE' -};
diff --git a/chrome/browser/resources/print_preview/data/user_manager.js b/chrome/browser/resources/print_preview/data/user_manager.js index 9826659..d3c7728 100644 --- a/chrome/browser/resources/print_preview/data/user_manager.js +++ b/chrome/browser/resources/print_preview/data/user_manager.js
@@ -12,7 +12,6 @@ import {Destination, DestinationOrigin} from './destination.js'; import {DestinationStore} from './destination_store.js'; -import {InvitationStore} from './invitation_store.js'; /** * @typedef {{ activeUser: string, @@ -41,9 +40,6 @@ /** @type {?DestinationStore} */ destinationStore: Object, - /** @type {?InvitationStore} */ - invitationStore: Object, - /** @type {!Array<string>} */ users: { type: Array, @@ -168,6 +164,5 @@ } this.destinationStore.reloadUserCookieBasedDestinations(user); - this.invitationStore.startLoadingInvitations(user); }, });
diff --git a/chrome/browser/resources/print_preview/metrics.js b/chrome/browser/resources/print_preview/metrics.js index dc889e6..867e4b470 100644 --- a/chrome/browser/resources/print_preview/metrics.js +++ b/chrome/browser/resources/print_preview/metrics.js
@@ -42,12 +42,8 @@ ACCOUNT_CHANGED: 9, // User tried to log into another account. ADD_ACCOUNT_SELECTED: 10, - // Printer sharing invitation was shown to the user. - INVITATION_AVAILABLE: 11, - // User accepted printer sharing invitation. - INVITATION_ACCEPTED: 12, - // User rejected printer sharing invitation. - INVITATION_REJECTED: 13, + // Note: values 11-13 are intentionally unset as these correspond to + // deprecated values in histograms/enums.xml. These enums are append-only. // User clicked on Manage button MANAGE_BUTTON_CLICKED: 14, // Max value.
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js index ed4fc15..e9cc254 100644 --- a/chrome/browser/resources/print_preview/print_preview.js +++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -18,7 +18,6 @@ // </if> export {DestinationErrorType, DestinationStore} from './data/destination_store.js'; export {PageLayoutInfo} from './data/document_info.js'; -export {InvitationStore} from './data/invitation_store.js'; export {LocalDestinationInfo, ProvisionalDestinationInfo} from './data/local_parsers.js'; export {CustomMarginsOrientation, Margins, MarginsSetting, MarginsType} from './data/margins.js'; export {MeasurementSystem, MeasurementSystemUnitType} from './data/measurement_system.js';
diff --git a/chrome/browser/resources/print_preview/ui/BUILD.gn b/chrome/browser/resources/print_preview/ui/BUILD.gn index 8c7a668..2c0ac208 100644 --- a/chrome/browser/resources/print_preview/ui/BUILD.gn +++ b/chrome/browser/resources/print_preview/ui/BUILD.gn
@@ -148,7 +148,6 @@ "..:cloud_print_interface_impl", "../data:destination", "../data:destination_store", - "../data:invitation_store", "../data:state", "../data:user_manager", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", @@ -438,29 +437,16 @@ ] } -js_library("invitation_promo") { - deps = [ - "..:metrics", - "../data:invitation", - "../data:invitation_store", - "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", - "//ui/webui/resources/js:event_tracker.m", - "//ui/webui/resources/js:i18n_behavior.m", - ] -} - if (is_chromeos_ash) { js_library("destination_dialog_cros") { deps = [ ":destination_list", - ":invitation_promo", ":print_preview_search_box", ":provisional_destination_resolver", "..:metrics", "..:native_layer", "../data:destination", "../data:destination_store", - "../data:invitation_store", "../data:print_server_store", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m", @@ -474,13 +460,11 @@ js_library("destination_dialog") { deps = [ ":destination_list", - ":invitation_promo", ":print_preview_search_box", "..:metrics", "..:native_layer", "../data:destination", "../data:destination_store", - "../data:invitation_store", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m", "//ui/webui/resources/js:event_tracker.m", @@ -581,7 +565,6 @@ "duplex_settings.js", "header.js", "icons.js", - "invitation_promo.js", "layout_settings.js", "link_container.js", "margin_control_container.js",
diff --git a/chrome/browser/resources/print_preview/ui/destination_dialog.html b/chrome/browser/resources/print_preview/ui/destination_dialog.html index df85871..920f646f 100644 --- a/chrome/browser/resources/print_preview/ui/destination_dialog.html +++ b/chrome/browser/resources/print_preview/ui/destination_dialog.html
@@ -33,9 +33,4 @@ $i18n{cancel} </cr-button> </div> - <template is="dom-if" if="[[activeUser]]"> - <print-preview-invitation-promo slot="footer" active-user="[[activeUser]]" - invitation-store="[[invitationStore]]" metrics="[[metrics_]]"> - </print-preview-invitation-promo> - </template> </cr-dialog>
diff --git a/chrome/browser/resources/print_preview/ui/destination_dialog.js b/chrome/browser/resources/print_preview/ui/destination_dialog.js index 6086c40..375214db 100644 --- a/chrome/browser/resources/print_preview/ui/destination_dialog.js +++ b/chrome/browser/resources/print_preview/ui/destination_dialog.js
@@ -14,7 +14,6 @@ import '../print_preview_utils.js'; import './destination_dialog_css.js'; import './destination_list.js'; -import './invitation_promo.js'; import './print_preview_search_box.js'; import './print_preview_shared_css.js'; import './print_preview_vars_css.js'; @@ -29,7 +28,6 @@ import {Destination} from '../data/destination.js'; import {DestinationStore} from '../data/destination_store.js'; -import {InvitationStore} from '../data/invitation_store.js'; import {Metrics, MetricsContext} from '../metrics.js'; import {NativeLayerImpl} from '../native_layer.js'; @@ -47,9 +45,6 @@ observer: 'onDestinationStoreSet_', }, - /** @type {?InvitationStore} */ - invitationStore: Object, - activeUser: { type: String, observer: 'onActiveUserChange_',
diff --git a/chrome/browser/resources/print_preview/ui/destination_dialog_cros.html b/chrome/browser/resources/print_preview/ui/destination_dialog_cros.html index 742a53d..47f41d2 100644 --- a/chrome/browser/resources/print_preview/ui/destination_dialog_cros.html +++ b/chrome/browser/resources/print_preview/ui/destination_dialog_cros.html
@@ -66,9 +66,4 @@ $i18n{cancel} </cr-button> </div> - <template is="dom-if" if="[[activeUser]]"> - <print-preview-invitation-promo slot="footer" active-user="[[activeUser]]" - invitation-store="[[invitationStore]]" metrics="[[metrics_]]"> - </print-preview-invitation-promo> - </template> </cr-dialog>
diff --git a/chrome/browser/resources/print_preview/ui/destination_dialog_cros.js b/chrome/browser/resources/print_preview/ui/destination_dialog_cros.js index c651095..6242ca3 100644 --- a/chrome/browser/resources/print_preview/ui/destination_dialog_cros.js +++ b/chrome/browser/resources/print_preview/ui/destination_dialog_cros.js
@@ -15,7 +15,6 @@ import '../print_preview_utils.js'; import './destination_dialog_css.js'; import './destination_list.js'; -import './invitation_promo.js'; import './print_preview_search_box.js'; import './print_preview_shared_css.js'; import './print_preview_vars_css.js'; @@ -32,7 +31,6 @@ import {Destination} from '../data/destination.js'; import {DestinationStore} from '../data/destination_store.js'; -import {InvitationStore} from '../data/invitation_store.js'; import {PrintServerStore} from '../data/print_server_store.js'; import {Metrics, MetricsContext} from '../metrics.js'; import {NativeLayerImpl} from '../native_layer.js'; @@ -55,9 +53,6 @@ observer: 'onDestinationStoreSet_', }, - /** @type {?InvitationStore} */ - invitationStore: Object, - activeUser: { type: String, observer: 'onActiveUserChange_',
diff --git a/chrome/browser/resources/print_preview/ui/destination_select.html b/chrome/browser/resources/print_preview/ui/destination_select.html index 6d3d49c..4769176b9 100644 --- a/chrome/browser/resources/print_preview/ui/destination_select.html +++ b/chrome/browser/resources/print_preview/ui/destination_select.html
@@ -20,10 +20,6 @@ <option value="[[pdfDestinationKey_]]" hidden$="[[pdfPrinterDisabled]]"> $i18n{printToPDF} </option> - <option value="[[driveDestinationKey]]" - hidden$="[[!driveDestinationKey]]"> - $i18n{printToGoogleDrive} - </option> <option value="noDestinations" hidden$="[[!noDestinations]]" selected$="[[noDestinations]]"> $i18n{noDestinationsMessage}
diff --git a/chrome/browser/resources/print_preview/ui/destination_select.js b/chrome/browser/resources/print_preview/ui/destination_select.js index 5ca517f..ebd291ef 100644 --- a/chrome/browser/resources/print_preview/ui/destination_select.js +++ b/chrome/browser/resources/print_preview/ui/destination_select.js
@@ -46,8 +46,6 @@ disabled: Boolean, - driveDestinationKey: String, - loaded: Boolean, noDestinations: Boolean,
diff --git a/chrome/browser/resources/print_preview/ui/destination_settings.html b/chrome/browser/resources/print_preview/ui/destination_settings.html index b8af9cf..4d416935 100644 --- a/chrome/browser/resources/print_preview/ui/destination_settings.html +++ b/chrome/browser/resources/print_preview/ui/destination_settings.html
@@ -8,8 +8,7 @@ <template is="dom-if" if="[[!cloudPrintDisabled_]]"> <print-preview-user-manager id="userManager" active-user="{{activeUser_}}" cloud-print-disabled="[[cloudPrintDisabled_]]" - users="{{users_}}" destination-store="[[destinationStore_]]" - invitation-store="[[invitationStore_]]"> + users="{{users_}}" destination-store="[[destinationStore_]]"> </print-preview-user-manager> </template> <if expr="not chromeos"> @@ -18,7 +17,6 @@ destination="[[destination]]" disabled="[[shouldDisableDropdown_( destinationState, state, disabled)]]" - drive-destination-key="[[driveDestinationKey_]]" loaded="[[loaded_]]" no-destinations="[[noDestinations_]]" pdf-printer-disabled="[[pdfPrinterDisabled_]]" @@ -29,7 +27,6 @@ <template> <print-preview-destination-dialog destination-store="[[destinationStore_]]" - invitation-store="[[invitationStore_]]" recent-destination-list="[[recentDestinationList_]]" active-user="[[activeUser_]]" users="[[users_]]" current-destination-account="[[destination.account]]" @@ -55,7 +52,6 @@ <template> <print-preview-destination-dialog-cros destination-store="[[destinationStore_]]" - invitation-store="[[invitationStore_]]" recent-destination-list="[[recentDestinationList_]]" active-user="[[activeUser_]]" users="[[users_]]" current-destination-account="[[destination.account]]"
diff --git a/chrome/browser/resources/print_preview/ui/destination_settings.js b/chrome/browser/resources/print_preview/ui/destination_settings.js index c0b4bb2..da98d8f 100644 --- a/chrome/browser/resources/print_preview/ui/destination_settings.js +++ b/chrome/browser/resources/print_preview/ui/destination_settings.js
@@ -38,7 +38,6 @@ // </if> import {getPrinterTypeForDestination, PrinterType} from '../data/destination_match.js'; import {DestinationErrorType, DestinationStore} from '../data/destination_store.js'; -import {InvitationStore} from '../data/invitation_store.js'; import {Error, State} from '../data/state.js'; import {SettingsBehavior} from './settings_behavior.js'; @@ -128,13 +127,13 @@ /** @private {!Array<!Destination>} */ displayedDestinations_: Array, + // <if expr="chromeos"> /** @private {string} */ driveDestinationKey_: { type: String, value: '', }, - // <if expr="chromeos"> hasPinSetting_: { type: Boolean, computed: 'computeHasPinSetting_(settings.pin.available)', @@ -142,9 +141,6 @@ }, // </if> - /** @private {?InvitationStore} */ - invitationStore_: Object, - /** @private {boolean} */ isDialogOpen_: { type: Boolean, @@ -221,26 +217,11 @@ /** @override */ detached() { - if (!this.cloudPrintDisabled_) { - this.invitationStore_.resetTracker(); - } this.destinationStore_.resetTracker(); this.tracker_.removeAll(); }, /** @private */ - updateDriveDestination_() { - let key = createDestinationKey( - Destination.GooglePromotedId.DOCS, DestinationOrigin.COOKIES, - this.activeUser_); - // <if expr="chromeos"> - key = SAVE_TO_DRIVE_CROS_DESTINATION_KEY; - // </if> - this.driveDestinationKey_ = - this.destinationStore_.getDestinationByKey(key) ? key : ''; - }, - - /** @private */ onActiveUserChanged_() { this.updateDropdownDestinations_(); @@ -283,6 +264,32 @@ this.destinationStore_.selectDefaultDestination(); }, + filterRecentDestinations_(recentDestinations) { + let filteredDestinations = recentDestinations; + // Remove unsupported privet printers from the sticky settings, + // to free up these spots for supported printers. + // TODO(rbpotter): Remove this logic a milestone after the policy and flag + // have been removed. + if (!loadTimeData.getBoolean('forceEnablePrivetPrinting')) { + filteredDestinations = recentDestinations.filter(d => { + return d.origin !== DestinationOrigin.PRIVET; + }); + } + + // <if expr="chromeos"> + // Remove Cloud Print Drive destination. The Chrome OS version will always + // be shown in the dropdown and is still supported. + filteredDestinations = filteredDestinations.filter(d => { + return d.id !== Destination.GooglePromotedId.DOCS; + }); + // </if> + + if (filteredDestinations.length !== recentDestinations.length) { + this.setSetting('recentDestinations', filteredDestinations); + } + return filteredDestinations; + }, + /** * @param {string} defaultPrinter The system default printer ID. * @param {boolean} pdfPrinterDisabled Whether the PDF printer is disabled. @@ -299,14 +306,17 @@ let recentDestinations = /** @type {!Array<!RecentDestination>} */ ( this.getSettingValue('recentDestinations')); + // <if expr="chromeos"> + this.driveDestinationKey_ = + isDriveMounted ? SAVE_TO_DRIVE_CROS_DESTINATION_KEY : ''; + // </if> if (cloudPrintInterface.isConfigured()) { this.cloudPrintDisabled_ = false; this.destinationStore_.setCloudPrintInterface(cloudPrintInterface); - this.invitationStore_ = new InvitationStore(); - this.invitationStore_.setCloudPrintInterface(cloudPrintInterface); beforeNextRender(this, () => { this.shadowRoot.querySelector('#userManager').initUserAccounts(); + recentDestinations = this.filterRecentDestinations_(recentDestinations); recentDestinations = recentDestinations.slice( 0, this.getRecentDestinationsDisplayCount_(recentDestinations)); this.destinationStore_.init( @@ -316,20 +326,7 @@ return; } - // Remove unsupported privet printers from the sticky settings, - // to free up these spots for supported printers. - // TODO (rbpotter): Remove this logic a milestone after the policy and flag - // have been removed. - if (!loadTimeData.getBoolean('forceEnablePrivetPrinting')) { - const filteredRecentDestinations = recentDestinations.filter(d => { - return d.origin !== DestinationOrigin.PRIVET; - }); - if (filteredRecentDestinations.length !== recentDestinations.length) { - this.setSetting('recentDestinations', filteredRecentDestinations); - recentDestinations = filteredRecentDestinations; - } - } - + recentDestinations = this.filterRecentDestinations_(recentDestinations); recentDestinations = recentDestinations.slice( 0, this.getRecentDestinationsDisplayCount_(recentDestinations)); this.destinationStore_.init( @@ -443,8 +440,7 @@ } // </if> - return destination.id === Destination.GooglePromotedId.SAVE_AS_PDF || - destination.id === Destination.GooglePromotedId.DOCS; + return destination.id === Destination.GooglePromotedId.SAVE_AS_PDF; }, /** @private */ @@ -531,7 +527,6 @@ } this.displayedDestinations_ = updatedDestinations; - this.updateDriveDestination_(); }, /** @@ -573,9 +568,6 @@ const value = e.detail; if (value === 'seeMore') { this.destinationStore_.startLoadAllDestinations(); - if (this.activeUser_) { - this.invitationStore_.startLoadingInvitations(this.activeUser_); - } this.$.destinationDialog.get().show(); this.lastUser_ = this.activeUser_; this.isDialogOpen_ = true; @@ -593,7 +585,6 @@ assert(!this.cloudPrintDisabled_); this.shadowRoot.querySelector('#userManager') .updateActiveUser(e.detail, true); - this.updateDriveDestination_(); }, /** @private */
diff --git a/chrome/browser/resources/print_preview/ui/invitation_promo.html b/chrome/browser/resources/print_preview/ui/invitation_promo.html deleted file mode 100644 index e66707c..0000000 --- a/chrome/browser/resources/print_preview/ui/invitation_promo.html +++ /dev/null
@@ -1,51 +0,0 @@ -<style include="print-preview-shared action-link md-select cr-hidden-style throbber"> - :host { - align-items: center; - background: rgb(248, 249, 250); - color: var(--cr-primary-text-color); - display: flex; - flex-direction: column; - padding: 16px 20px; - text-align: center; - } - - @media (prefers-color-scheme: dark) { - :host { - background: rgb(50, 54, 57); - } - } - - :host([is-hidden_]) { - display: none; - } - - #buttons { - display: flex; - padding: 12px 0; - } - - cr-button { - margin: 0 4px; - } - - @media (prefers-color-scheme: light) { - cr-button { - background-color: white; - } - } - - #details { - color: var(--cr-secondary-text-color); - font-size: calc(10 / 13 * 1em); - font-weight: 500; - } -</style> -<div inner-h-t-m-l="[[getInvitationText_(invitation_)]]"></div> -<div id="buttons"> - <cr-button on-click="onAcceptClick_"> - [[getAcceptButtonText_(invitation_)]] - </cr-button> - <cr-button on-click="onRejectClick_">$i18n{reject}</cr-button> - <div id="invitation-process-throbber" class="throbber" hidden></div> -</div> -<div id="details">$i18nRaw{registerPrinterInformationMessage}</div>
diff --git a/chrome/browser/resources/print_preview/ui/invitation_promo.js b/chrome/browser/resources/print_preview/ui/invitation_promo.js deleted file mode 100644 index 820fba2..0000000 --- a/chrome/browser/resources/print_preview/ui/invitation_promo.js +++ /dev/null
@@ -1,160 +0,0 @@ -// Copyright 2020 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/cr_elements/cr_button/cr_button.m.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; -import 'chrome://resources/cr_elements/shared_vars_css.m.js'; -import 'chrome://resources/js/action_link.js'; -import 'chrome://resources/cr_elements/action_link_css.m.js'; -import './print_preview_shared_css.js'; -import './print_preview_vars_css.js'; -import './throbber_css.js'; -import '../strings.m.js'; - -import {assert} from 'chrome://resources/js/assert.m.js'; -import {EventTracker} from 'chrome://resources/js/event_tracker.m.js'; -import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js'; -import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; - -import {Invitation} from '../data/invitation.js'; -import {InvitationStore} from '../data/invitation_store.js'; -import {Metrics, MetricsContext} from '../metrics.js'; - -Polymer({ - is: 'print-preview-invitation-promo', - - _template: html`{__html_template__}`, - - behaviors: [I18nBehavior], - - properties: { - activeUser: { - type: String, - observer: 'onActiveUserChanged_', - }, - - /** @type {?InvitationStore} */ - invitationStore: Object, - - /** @type {!MetricsContext} */ - metrics: Object, - - /** @private {?Invitation} */ - invitation_: { - type: Object, - value: null, - }, - - /** @private {boolean} */ - isHidden_: { - type: Boolean, - reflectToAttribute: true, - computed: 'computeIsHidden_(invitation_)', - } - }, - - /** @private {!EventTracker} */ - tracker_: new EventTracker(), - - /** @private */ - attached() { - const invitationStore = assert(this.invitationStore); - this.tracker_.add( - invitationStore, InvitationStore.EventType.INVITATION_SEARCH_DONE, - this.updateInvitations_.bind(this)); - this.tracker_.add( - invitationStore, InvitationStore.EventType.INVITATION_PROCESSED, - this.updateInvitations_.bind(this)); - this.updateInvitations_(); - }, - - /** @override */ - detached() { - this.tracker_.removeAll(); - }, - - /** - * @return {boolean} - * @private - */ - computeIsHidden_() { - return !this.invitation_; - }, - - /** @private */ - onActiveUserChanged_() { - if (!this.activeUser) { - return; - } - - this.invitationStore.startLoadingInvitations(this.activeUser); - }, - - /** - * Updates printer sharing invitations UI. - * @private - */ - updateInvitations_() { - const invitations = this.activeUser ? - this.invitationStore.invitations(this.activeUser) : - []; - if (this.invitation_ !== invitations[0]) { - this.metrics.record(Metrics.DestinationSearchBucket.INVITATION_AVAILABLE); - } - this.invitation_ = invitations.length > 0 ? invitations[0] : null; - }, - - /** - * @return {string} The text show show on the "accept" button in the - * invitation promo. 'Accept', 'Accept for group', or empty if there is no - * invitation. - * @private - */ - getAcceptButtonText_() { - if (!this.invitation_) { - return ''; - } - - return this.invitation_.asGroupManager ? this.i18n('acceptForGroup') : - this.i18n('accept'); - }, - - /** - * @return {string} The formatted text to show for the invitation promo. - * @private - */ - getInvitationText_() { - if (!this.invitation_) { - return ''; - } - - if (this.invitation_.asGroupManager) { - return this.i18nAdvanced('groupPrinterSharingInviteText', { - substitutions: [ - this.invitation_.sender, this.invitation_.destination.displayName, - this.invitation_.receiver - ] - }); - } - - return this.i18nAdvanced('printerSharingInviteText', { - substitutions: - [this.invitation_.sender, this.invitation_.destination.displayName] - }); - }, - - /** @private */ - onAcceptClick_() { - this.metrics.record(Metrics.DestinationSearchBucket.INVITATION_ACCEPTED); - this.invitationStore.processInvitation(assert(this.invitation_), true); - this.updateInvitations_(); - }, - - /** @private */ - onRejectClick_() { - this.metrics.record(Metrics.DestinationSearchBucket.INVITATION_REJECTED); - this.invitationStore.processInvitation(assert(this.invitation_), false); - this.updateInvitations_(); - }, -});
diff --git a/chrome/browser/resources/settings/a11y_page/live_caption_section.js b/chrome/browser/resources/settings/a11y_page/live_caption_section.js index 793933f..f67c226 100644 --- a/chrome/browser/resources/settings/a11y_page/live_caption_section.js +++ b/chrome/browser/resources/settings/a11y_page/live_caption_section.js
@@ -161,16 +161,15 @@ * subtitle below the Live Caption toggle. * @param {!string} sodaDownloadProgress The message sent from the webui * to be displayed as download progress for Live Caption. + * @param {!string} languageCode The language code indicating which language + * pack the message applies to. * @private */ - onSodaDownloadProgressChanged_(sodaDownloadProgress) { - if (this.enableLiveCaptionMultiLanguage_ && - this.getPref('accessibility.captions.live_caption_enabled').value) { + onSodaDownloadProgressChanged_(sodaDownloadProgress, languageCode) { + if (this.enableLiveCaptionMultiLanguage_) { for (let i = 0; i < this.liveCaptionLanguages_.length; i++) { const language = this.liveCaptionLanguages_[i]; - if (language.code === - this.getPref('accessibility.captions.live_caption_language') - .value) { + if (language.code === languageCode) { language.downloadProgress = sodaDownloadProgress; this.notifyPath('liveCaptionLanguages_.' + i + '.downloadProgress'); return;
diff --git a/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js b/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js index 8964ea8d..6ca0187 100644 --- a/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js +++ b/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js
@@ -85,6 +85,8 @@ NEARLY_UPDATED: 'nearly_updated', UPDATED: 'updated', FAILED: 'failed', + FAILED_HTTP: 'failed_http', + FAILED_DOWNLOAD: 'failed_download', DISABLED: 'disabled', DISABLED_BY_ADMIN: 'disabled_by_admin', NEED_PERMISSION_TO_UPDATE: 'need_permission_to_update',
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.html b/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.html index 80b4c31..47e27bf 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.html +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.html
@@ -72,6 +72,12 @@ label="$i18n{chromeVoxOptionsLabel}" external> </cr-link-row> </div> + <div class="sub-item"> + <cr-link-row id="chromeVoxTutorialButton" + class="settings-box" on-click="onChromeVoxTutorialTap_" + label="$i18n{chromeVoxTutorialLabel}" external> + </cr-link-row> + </div> </iron-collapse> <settings-toggle-button pref="{{prefs.settings.a11y.select_to_speak}}"
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.js b/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.js index dbc75a9..f2d476f 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.js +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.js
@@ -415,6 +415,11 @@ }, /** @private */ + onChromeVoxTutorialTap_() { + this.manageBrowserProxy_.showChromeVoxTutorial(); + }, + + /** @private */ onCaptionsClick_() { settings.Router.getInstance().navigateTo( settings.routes.MANAGE_CAPTION_SETTINGS);
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page_browser_proxy.js b/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page_browser_proxy.js index 65c5bd8..fc7f14c0 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page_browser_proxy.js +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page_browser_proxy.js
@@ -35,6 +35,11 @@ * is returned by the 'initial-data-ready' WebUI listener event. */ manageA11yPageReady() {} + + /** + * Opens the ChromeVox tutorial. + */ + showChromeVoxTutorial() {} } /** @@ -65,6 +70,11 @@ manageA11yPageReady() { chrome.send('manageA11yPageReady'); } + + /** @override */ + showChromeVoxTutorial() { + chrome.send('showChromeVoxTutorial'); + } } // The singleton instance_ is replaced with a test version of this wrapper
diff --git a/chrome/browser/resources/settings/chromeos/os_about_page/os_about_page.js b/chrome/browser/resources/settings/chromeos/os_about_page/os_about_page.js index e2a905b..5d56f56 100644 --- a/chrome/browser/resources/settings/chromeos/os_about_page/os_about_page.js +++ b/chrome/browser/resources/settings/chromeos/os_about_page/os_about_page.js
@@ -324,9 +324,15 @@ /** @private */ updateShowUpdateStatus_() { - // Do not show the "updated" status if we haven't checked yet or the update - // warning dialog is shown to user. - if (this.currentUpdateStatusEvent_.status === UpdateStatus.UPDATED && + // Do not show the "updated" status or error states from a previous update + // attempt if we haven't checked yet or the update warning dialog is shown + // to user. + if ((this.currentUpdateStatusEvent_.status === UpdateStatus.UPDATED || + this.currentUpdateStatusEvent_.status === + UpdateStatus.FAILED_DOWNLOAD || + this.currentUpdateStatusEvent_.status === UpdateStatus.FAILED_HTTP || + this.currentUpdateStatusEvent_.status === + UpdateStatus.DISABLED_BY_ADMIN) && (!this.hasCheckedForUpdates_ || this.showUpdateWarningDialog_)) { this.showUpdateStatus_ = false; return; @@ -425,6 +431,12 @@ }); } return this.i18nAdvanced('aboutUpgradeUpdating'); + case UpdateStatus.FAILED_HTTP: + return this.i18nAdvanced('aboutUpgradeTryAgain'); + case UpdateStatus.FAILED_DOWNLOAD: + return this.i18nAdvanced('aboutUpgradeDownloadError'); + case UpdateStatus.DISABLED_BY_ADMIN: + return this.i18nAdvanced('aboutUpgradeAdministrator'); default: function formatMessage(msg) { return parseHtmlSubset('<b>' + msg + '</b>', ['br', 'pre']) @@ -457,6 +469,8 @@ switch (this.currentUpdateStatusEvent_.status) { case UpdateStatus.DISABLED_BY_ADMIN: return 'cr20:domain'; + case UpdateStatus.FAILED_DOWNLOAD: + case UpdateStatus.FAILED_HTTP: case UpdateStatus.FAILED: return 'cr:error'; case UpdateStatus.UPDATED: @@ -549,8 +563,10 @@ // update has failed. Disable it otherwise. const staleUpdatedStatus = !this.hasCheckedForUpdates_ && this.checkStatus_(UpdateStatus.UPDATED); - - return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED); + return staleUpdatedStatus || this.checkStatus_(UpdateStatus.FAILED) || + this.checkStatus_(UpdateStatus.FAILED_HTTP) || + this.checkStatus_(UpdateStatus.FAILED_DOWNLOAD) || + this.checkStatus_(UpdateStatus.DISABLED_BY_ADMIN); }, /**
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html index 8278eb356..7c79bf3c 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html
@@ -171,6 +171,8 @@ "$i18n{siteSettingsBackgroundSyncAllowed}" allow-option-icon="cr:sync" block-option-label="$i18n{siteSettingsBackgroundSyncBlocked}" + block-option-sub-label= + "$i18n{siteSettingsBackgroundSyncBlockedSubLabel}" block-option-icon="settings:sync-off"> </settings-category-default-radio-group> <category-setting-exceptions @@ -276,6 +278,8 @@ allow-option-label="$i18n{siteSettingsImagesAllowed}" allow-option-icon="settings:photo" block-option-label="$i18n{siteSettingsImagesBlocked}" + block-option-sub-label= + "$i18n{siteSettingsImagesBlockedSubLabel}" block-option-icon="settings:photo-off"> </settings-category-default-radio-group> <category-setting-exceptions @@ -474,6 +478,7 @@ allow-option-label="$i18n{siteSettingsSoundAllowed}" allow-option-icon="settings:volume-up" block-option-label="$i18n{siteSettingsSoundBlocked}" + block-option-sub-label="$i18n{siteSettingsSoundBlockedSubLabel}" block-option-icon="settings:volume-up-off"> </settings-category-default-radio-group> </template> @@ -1003,6 +1008,8 @@ <settings-collapse-radio-button no-collapse pref="[[prefs.webkit.webprefs.encrypted_media_enabled]]" label="$i18n{siteSettingsProtectedContentBlocked}" + sub-label= + "$i18n{siteSettingsProtectedContentBlockedSubLabel}" name="false" disabled$="[[isGuest_]]" icon="settings:protected-content-off">
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.js b/chrome/browser/resources/settings/privacy_page/privacy_page.js index 62c3879..6ca037df 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.js +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.js
@@ -298,7 +298,7 @@ /** @private */ onDialogClosed_() { - Router.getInstance().navigateTo(assert(routes.CLEAR_BROWSER_DATA.parent)); + Router.getInstance().navigateToPreviousRoute(); setTimeout(() => { // Focus after a timeout to ensure any a11y messages get read before // screen readers read out the newly focused element.
diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js index c93ec1d0..d41d622 100644 --- a/chrome/browser/resources/settings/route.js +++ b/chrome/browser/resources/settings/route.js
@@ -14,6 +14,9 @@ * @param {!SettingsRoutes} r */ function addPrivacyChildRoutes(r) { + r.CLEAR_BROWSER_DATA = r.PRIVACY.createChild('/clearBrowserData'); + r.CLEAR_BROWSER_DATA.isNavigableDialog = true; + r.SITE_SETTINGS = r.PRIVACY.createChild('/content'); r.COOKIES = r.PRIVACY.createChild('/cookies'); r.SECURITY = r.PRIVACY.createChild('/security'); @@ -139,9 +142,6 @@ r.ADDRESSES = r.AUTOFILL.createChild('/addresses'); } - r.CLEAR_BROWSER_DATA = r.BASIC.createChild('/clearBrowserData'); - r.CLEAR_BROWSER_DATA.isNavigableDialog = true; - if (visibility.privacy !== false) { r.PRIVACY = r.BASIC.createSection('/privacy', 'privacy'); addPrivacyChildRoutes(r);
diff --git a/chrome/browser/resources/settings/router.js b/chrome/browser/resources/settings/router.js index a68f0d8..86771d0e 100644 --- a/chrome/browser/resources/settings/router.js +++ b/chrome/browser/resources/settings/router.js
@@ -30,7 +30,7 @@ /** * @type {boolean} Whether this route corresponds to a navigable - * dialog. Those routes don't belong to a "section". + * dialog. Those routes don't always belong to a "section". */ this.isNavigableDialog = false; @@ -103,7 +103,7 @@ * @return {boolean} */ isSubpage() { - return !!this.parent && !!this.section && + return !this.isNavigableDialog && !!this.parent && !!this.section && this.parent.section === this.section; } }
diff --git a/chrome/browser/resources/settings/settings_main/settings_main.html b/chrome/browser/resources/settings/settings_main/settings_main.html index 665ba985b..fdb63425 100644 --- a/chrome/browser/resources/settings/settings_main/settings_main.html +++ b/chrome/browser/resources/settings/settings_main/settings_main.html
@@ -56,11 +56,7 @@ <template is="dom-if" if="[[showPages_.about]]"> <settings-about-page role="main" class="cr-centered-card-container" - in-search-mode="[[inSearchMode_]]" - on-subpage-expand="onShowingSubpage_" - on-showing-main-page="onShowingMainPage_" - prefs="{{prefs}}" - show-crostini="[[showCrostini]]"> + prefs="{{prefs}}"> </settings-about-page> </template> <div id="overscroll" style="padding-bottom: [[overscroll_]]px"></div>
diff --git a/chrome/browser/resources/settings/settings_page/main_page_behavior.js b/chrome/browser/resources/settings/settings_page/main_page_behavior.js index 4d4f03ac..3daaaab 100644 --- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js +++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -90,12 +90,17 @@ [ RouteState.DIALOG, new Set([ RouteState.SECTION, - RouteState.SUBPAGE, RouteState.TOP_LEVEL, ]) ], [RouteState.SECTION, allStates], - [RouteState.SUBPAGE, allStates], + [ + RouteState.SUBPAGE, new Set([ + RouteState.SECTION, + RouteState.SUBPAGE, + RouteState.TOP_LEVEL, + ]) + ], [RouteState.TOP_LEVEL, allStates], ]); })(), @@ -346,10 +351,6 @@ // sub-subpage entry point. } else if (newState === RouteState.TOP_LEVEL) { this.enterMainPage_(oldRoute); - } else if (newState === RouteState.DIALOG) { - // The only known case currently for such a transition is from - // /storage to /clearBrowserData. - this.enterMainPage_(oldRoute); } return; } @@ -364,14 +365,7 @@ return; } - if (oldState === RouteState.DIALOG) { - if (newState === RouteState.SUBPAGE) { - // The only known case currently for such a transition is from - // /clearBrowserData back to /storage. - this.enterSubpage_(newRoute); - } - // Nothing to do for all other cases. - } + // Nothing to do for when oldState === RouteState.DIALOG. }, /**
diff --git a/chrome/browser/safe_browsing/chrome_enterprise_url_lookup_service.cc b/chrome/browser/safe_browsing/chrome_enterprise_url_lookup_service.cc index 22e77592..492c733 100644 --- a/chrome/browser/safe_browsing/chrome_enterprise_url_lookup_service.cc +++ b/chrome/browser/safe_browsing/chrome_enterprise_url_lookup_service.cc
@@ -91,13 +91,9 @@ } GURL ChromeEnterpriseRealTimeUrlLookupService::GetRealTimeLookupUrl() const { - bool is_ga_endpoint_enabled = - base::FeatureList::IsEnabled(kRealTimeUrlLookupEnterpriseGaEndpoint); - std::string endpoint = is_ga_endpoint_enabled - ? "https://enterprise-safebrowsing.googleapis.com/" - "safebrowsing/clientreport/realtime" - : "https://safebrowsing.google.com/safebrowsing/" - "clientreport/realtime"; + std::string endpoint = + "https://enterprise-safebrowsing.googleapis.com/" + "safebrowsing/clientreport/realtime"; return GURL(endpoint); }
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.cc b/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.cc index 6246405..8e1af91 100644 --- a/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.cc +++ b/chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.cc
@@ -32,12 +32,13 @@ case BinaryUploadService::Result::FILE_TOO_LARGE: unscanned_reason = "FILE_TOO_LARGE"; break; + case BinaryUploadService::Result::TOO_MANY_REQUESTS: + unscanned_reason = "TOO_MANY_REQUESTS"; + break; case BinaryUploadService::Result::TIMEOUT: case BinaryUploadService::Result::UNKNOWN: case BinaryUploadService::Result::UPLOAD_FAILURE: case BinaryUploadService::Result::FAILED_TO_GET_TOKEN: - // TODO(crbug.com/1191060): Update this string when the event is supported. - case BinaryUploadService::Result::TOO_MANY_REQUESTS: unscanned_reason = "SERVICE_UNAVAILABLE"; break; case BinaryUploadService::Result::FILE_ENCRYPTED:
diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc index 3facf5f8..112c94f 100644 --- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc
@@ -1176,13 +1176,13 @@ ui_test_utils::NavigateToURL( browser(), embedded_test_server()->GetURL(kSingleFrameTestURL)); GURL initial_url = embedded_test_server()->GetURL(kSingleFrameTestURL); - ClickTestLink("new_tab_download", 3, initial_url); + ClickTestLink("new_tab_download", 2, initial_url); GURL download_url = embedded_test_server()->GetURL(kDownloadItemURL); GURL blank_url = GURL(url::kAboutBlankURL); std::string test_server_ip(embedded_test_server()->host_port_pair().host()); auto* nav_list = navigation_event_list(); ASSERT_TRUE(nav_list); - ASSERT_EQ(5U, nav_list->NavigationEventsSize()); + ASSERT_EQ(4U, nav_list->NavigationEventsSize()); VerifyNavigationEvent(GURL(), // source_url GURL(), // source_main_frame_url initial_url, // original_request_url @@ -1212,54 +1212,32 @@ nav_list->GetNavigationEvent(2)); EXPECT_EQ(nav_list->GetNavigationEvent(2)->source_tab_id, nav_list->GetNavigationEvent(2)->target_tab_id); - // This navigation is done by the document.write() call. - VerifyNavigationEvent(blank_url, // source_url - blank_url, // source_main_frame_url - initial_url, // original_request_url - initial_url, // destination_url - false, // is_user_initiated, - false, // has_committed - false, // has_server_redirect - nav_list->GetNavigationEvent(3)); - VerifyNavigationEvent(initial_url, // source_url - initial_url, // source_main_frame_url + VerifyNavigationEvent(blank_url, // source_url + blank_url, // source_main_frame_url download_url, // original_request_url download_url, // destination_url false, // is_user_initiated, false, // has_committed false, // has_server_redirect - nav_list->GetNavigationEvent(4)); - EXPECT_EQ(nav_list->GetNavigationEvent(4)->source_tab_id, + nav_list->GetNavigationEvent(3)); + EXPECT_EQ(nav_list->GetNavigationEvent(3)->source_tab_id, nav_list->GetNavigationEvent(3)->target_tab_id); VerifyHostToIpMap(); ReferrerChain referrer_chain; IdentifyReferrerChainForDownload(GetDownload(), &referrer_chain); - ASSERT_EQ(4, referrer_chain.size()); + ASSERT_EQ(3, referrer_chain.size()); VerifyReferrerChainEntry( download_url, // url GURL(), // main_frame_url ReferrerChainEntry::EVENT_URL, // type test_server_ip, // ip_address - initial_url, // referrer_url + blank_url, // referrer_url GURL(), // referrer_main_frame_url false, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::RENDERER_INITIATED_WITHOUT_USER_GESTURE, referrer_chain.Get(0)); - // This is the document.write() call, which changes the URL of the new tab to - // be the same as the initial URL. - VerifyReferrerChainEntry( - initial_url, // url - GURL(), // main_frame_url - ReferrerChainEntry::CLIENT_REDIRECT, // type - test_server_ip, // ip_address - blank_url, // referrer_url - GURL(), // referrer_main_frame_url - false, // is_retargeting - std::vector<GURL>(), // server redirects - ReferrerChainEntry::RENDERER_INITIATED_WITHOUT_USER_GESTURE, - referrer_chain.Get(1)); VerifyReferrerChainEntry( blank_url, // url GURL(), // main_frame_url @@ -1270,7 +1248,7 @@ true, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::RENDERER_INITIATED_WITH_USER_GESTURE, - referrer_chain.Get(2)); + referrer_chain.Get(1)); VerifyReferrerChainEntry(initial_url, // url GURL(), // main_frame_url ReferrerChainEntry::LANDING_PAGE, // type @@ -1280,7 +1258,7 @@ false, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::BROWSER_INITIATED, - referrer_chain.Get(3)); + referrer_chain.Get(2)); } // Use javascript to open download in a new tab and download has a data url. @@ -1289,14 +1267,14 @@ ui_test_utils::NavigateToURL( browser(), embedded_test_server()->GetURL(kSingleFrameTestURL)); GURL initial_url = embedded_test_server()->GetURL(kSingleFrameTestURL); - ClickTestLink("new_tab_download_with_data_url", 3, initial_url); + ClickTestLink("new_tab_download_with_data_url", 2, initial_url); GURL download_url = GURL(kDownloadDataURL); GURL short_download_url = GURL(kShortDataURL); GURL blank_url = GURL(url::kAboutBlankURL); std::string test_server_ip(embedded_test_server()->host_port_pair().host()); auto* nav_list = navigation_event_list(); ASSERT_TRUE(nav_list); - ASSERT_EQ(5U, nav_list->NavigationEventsSize()); + ASSERT_EQ(4U, nav_list->NavigationEventsSize()); VerifyNavigationEvent(GURL(), // source_url GURL(), // source_main_frame_url initial_url, // original_request_url @@ -1325,56 +1303,34 @@ false, // has_committed false, // has_server_redirect nav_list->GetNavigationEvent(2)); - // This navigation is done by the document.write() call. - VerifyNavigationEvent(blank_url, // source_url - blank_url, // source_main_frame_url - initial_url, // original_request_url - initial_url, // destination_url - false, // is_user_initiated, - false, // has_committed - false, // has_server_redirect - nav_list->GetNavigationEvent(3)); EXPECT_EQ(nav_list->GetNavigationEvent(2)->source_tab_id, nav_list->GetNavigationEvent(2)->target_tab_id); - VerifyNavigationEvent(initial_url, // source_url - initial_url, // source_main_frame_url + VerifyNavigationEvent(blank_url, // source_url + blank_url, // source_main_frame_url download_url, // original_request_url download_url, // destination_url false, // is_user_initiated, false, // has_committed false, // has_server_redirect - nav_list->GetNavigationEvent(4)); - EXPECT_EQ(nav_list->GetNavigationEvent(4)->source_tab_id, - nav_list->GetNavigationEvent(4)->target_tab_id); + nav_list->GetNavigationEvent(3)); + EXPECT_EQ(nav_list->GetNavigationEvent(3)->source_tab_id, + nav_list->GetNavigationEvent(3)->target_tab_id); VerifyHostToIpMap(); ReferrerChain referrer_chain; IdentifyReferrerChainForDownload(GetDownload(), &referrer_chain); - ASSERT_EQ(4, referrer_chain.size()); + ASSERT_EQ(3, referrer_chain.size()); VerifyReferrerChainEntry( short_download_url, // url GURL(), // main_frame_url ReferrerChainEntry::EVENT_URL, // type "", // ip_address - initial_url, // referrer_url + blank_url, // referrer_url GURL(), // referrer_main_frame_url false, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::RENDERER_INITIATED_WITHOUT_USER_GESTURE, referrer_chain.Get(0)); - // This is the document.write() call, which changes the URL of the new tab to - // be the same as the initial URL. - VerifyReferrerChainEntry( - initial_url, // url - GURL(), // main_frame_url - ReferrerChainEntry::CLIENT_REDIRECT, // type - test_server_ip, // ip_address - blank_url, // referrer_url - GURL(), // referrer_main_frame_url - false, // is_retargeting - std::vector<GURL>(), // server redirects - ReferrerChainEntry::RENDERER_INITIATED_WITHOUT_USER_GESTURE, - referrer_chain.Get(1)); VerifyReferrerChainEntry( blank_url, // url GURL(), // main_frame_url @@ -1385,7 +1341,7 @@ true, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::RENDERER_INITIATED_WITH_USER_GESTURE, - referrer_chain.Get(2)); + referrer_chain.Get(1)); VerifyReferrerChainEntry(initial_url, // url GURL(), // main_frame_url ReferrerChainEntry::LANDING_PAGE, // type @@ -1395,7 +1351,7 @@ false, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::BROWSER_INITIATED, - referrer_chain.Get(3)); + referrer_chain.Get(2)); } // Click a link in a subframe and start download. @@ -1539,13 +1495,13 @@ GURL iframe_url = embedded_test_server()->GetURL(kIframeDirectDownloadURL); GURL iframe_retargeting_url = embedded_test_server()->GetURL(kIframeRetargetingURL); - ClickTestLink("iframe_new_tab_download", 3, iframe_retargeting_url, 1); + ClickTestLink("iframe_new_tab_download", 2, iframe_retargeting_url, 1); GURL blank_url = GURL(url::kAboutBlankURL); GURL download_url = embedded_test_server()->GetURL(kDownloadItemURL); std::string test_server_ip(embedded_test_server()->host_port_pair().host()); auto* nav_list = navigation_event_list(); ASSERT_TRUE(nav_list); - ASSERT_EQ(8U, nav_list->NavigationEventsSize()); + ASSERT_EQ(7U, nav_list->NavigationEventsSize()); VerifyNavigationEvent(GURL(), // source_url GURL(), // source_main_frame_url initial_url, // original_request_url @@ -1615,53 +1571,30 @@ false, // has_committed false, // has_server_redirect nav_list->GetNavigationEvent(5)); - // This navigation is done by the document.write() call. - VerifyNavigationEvent(blank_url, // source_url - blank_url, // source_main_frame_url - iframe_retargeting_url, // original_request_url - iframe_retargeting_url, // destination_url - false, // is_user_initiated, - false, // has_committed - false, // has_server_redirect + VerifyNavigationEvent(blank_url, // source_url + blank_url, // source_main_frame_url + download_url, // original_request_url + download_url, // destination_url + false, // is_user_initiated, + false, // has_committed + false, // has_server_redirect nav_list->GetNavigationEvent(6)); - VerifyNavigationEvent(iframe_retargeting_url, // source_url - iframe_retargeting_url, // source_main_frame_url - download_url, // original_request_url - download_url, // destination_url - false, // is_user_initiated, - false, // has_committed - false, // has_server_redirect - nav_list->GetNavigationEvent(7)); VerifyHostToIpMap(); ReferrerChain referrer_chain; IdentifyReferrerChainForDownload(GetDownload(), &referrer_chain); - EXPECT_EQ(6, referrer_chain.size()); + EXPECT_EQ(5, referrer_chain.size()); VerifyReferrerChainEntry( download_url, // url GURL(), // main_frame_url ReferrerChainEntry::EVENT_URL, // type test_server_ip, // ip_address - iframe_retargeting_url, // referrer_url + blank_url, // referrer_url GURL(), // referrer_main_frame_url false, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::RENDERER_INITIATED_WITHOUT_USER_GESTURE, referrer_chain.Get(0)); - // This is the document.write() call, which changes the URL of the new tab to - // be the same as the URL of the document that called the function, which is - // iframe_retargeting.html. - VerifyReferrerChainEntry( - iframe_retargeting_url, // url - GURL(), // main_frame_url - ReferrerChainEntry::CLIENT_REDIRECT, // type - test_server_ip, // ip_address - blank_url, // referrer_url - GURL(), // referrer_main_frame_url - false, // is_retargeting - std::vector<GURL>(), // server redirects - ReferrerChainEntry::RENDERER_INITIATED_WITHOUT_USER_GESTURE, - referrer_chain.Get(1)); VerifyReferrerChainEntry( blank_url, // url GURL(), // main_frame_url @@ -1672,7 +1605,7 @@ true, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::RENDERER_INITIATED_WITH_USER_GESTURE, - referrer_chain.Get(2)); + referrer_chain.Get(1)); VerifyReferrerChainEntry( iframe_retargeting_url, // url multi_frame_test_url, // main_frame_url @@ -1683,7 +1616,7 @@ false, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::RENDERER_INITIATED_WITHOUT_USER_GESTURE, - referrer_chain.Get(3)); + referrer_chain.Get(2)); VerifyReferrerChainEntry( multi_frame_test_url, // url GURL(), // main_frame_url @@ -1694,7 +1627,7 @@ false, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::RENDERER_INITIATED_WITH_USER_GESTURE, - referrer_chain.Get(4)); + referrer_chain.Get(3)); VerifyReferrerChainEntry(initial_url, // url GURL(), // main_frame_url ReferrerChainEntry::LANDING_REFERRER, // type @@ -1704,7 +1637,7 @@ false, // is_retargeting std::vector<GURL>(), // server redirects ReferrerChainEntry::BROWSER_INITIATED, - referrer_chain.Get(5)); + referrer_chain.Get(4)); } // Click a link which redirects to the landing page, and then click on the
diff --git a/chrome/browser/safety_check/android/BUILD.gn b/chrome/browser/safety_check/android/BUILD.gn index 8711026..d73281f 100644 --- a/chrome/browser/safety_check/android/BUILD.gn +++ b/chrome/browser/safety_check/android/BUILD.gn
@@ -11,10 +11,7 @@ } source_set("android") { - sources = [ - "safety_check_bridge.cc", - "safety_check_bridge.h", - ] + sources = [ "safety_check_bridge.cc" ] deps = [ ":jni_headers", "//chrome/browser/signin:identity_manager_provider",
diff --git a/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckBridge.java b/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckBridge.java index 902679c2..fbbbec8 100644 --- a/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckBridge.java +++ b/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckBridge.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.safety_check; -import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.NativeMethods; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.components.embedder_support.browser_context.BrowserContextHandle; @@ -15,58 +14,20 @@ */ public class SafetyCheckBridge { /** - * Observer for SafetyCheck code common to Desktop, Android, and iOS. - */ - public interface SafetyCheckCommonObserver { - /** - * Gets invoked by the C++ code once the Safe Browsing check has results. - * - * @param status SafetyCheck::SafeBrowsingStatus enum value representing the - * Safe Browsing state (see - * //components/safety_check/safety_check.h). - */ - @CalledByNative("SafetyCheckCommonObserver") - void onSafeBrowsingCheckResult(@SafeBrowsingStatus int status); - } - - /** - * Holds the C++ side of the Bridge class. - */ - private long mNativeSafetyCheckBridge; - - /** - * Initializes the C++ side. - * - * @param safetyCheckCommonObserver An observer instance that will receive the - * result of the check. - */ - public SafetyCheckBridge(SafetyCheckCommonObserver safetyCheckCommonObserver) { - mNativeSafetyCheckBridge = - SafetyCheckBridgeJni.get().init(SafetyCheckBridge.this, safetyCheckCommonObserver); - } - - /** * Returns whether the user is signed in for the purposes of password check. */ - boolean userSignedIn() { + static boolean userSignedIn() { return SafetyCheckBridgeJni.get().userSignedIn(Profile.getLastUsedRegularProfile()); } /** * Triggers the Safe Browsing check on the C++ side. + * + * @return SafetyCheck::SafeBrowsingStatus enum value representing the Safe Browsing state + * (see //components/safety_check/safety_check.h). */ - void checkSafeBrowsing() { - SafetyCheckBridgeJni.get().checkSafeBrowsing(mNativeSafetyCheckBridge, - SafetyCheckBridge.this, Profile.getLastUsedRegularProfile()); - } - - /** - * Destroys the C++ side of the Bridge, freeing up all the associated memory. - */ - void destroy() { - assert mNativeSafetyCheckBridge != 0; - SafetyCheckBridgeJni.get().destroy(mNativeSafetyCheckBridge, SafetyCheckBridge.this); - mNativeSafetyCheckBridge = 0; + static @SafeBrowsingStatus int checkSafeBrowsing() { + return SafetyCheckBridgeJni.get().checkSafeBrowsing(Profile.getLastUsedRegularProfile()); } /** @@ -74,10 +35,7 @@ */ @NativeMethods interface Natives { - long init(SafetyCheckBridge safetyCheckBridge, SafetyCheckCommonObserver observer); boolean userSignedIn(BrowserContextHandle browserContext); - void checkSafeBrowsing(long nativeSafetyCheckBridge, SafetyCheckBridge safetyCheckBridge, - BrowserContextHandle browserContext); - void destroy(long nativeSafetyCheckBridge, SafetyCheckBridge safetyCheckBridge); + int checkSafeBrowsing(BrowserContextHandle browserContext); } }
diff --git a/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java b/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java index 861781c1..cdef2a2 100644 --- a/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java +++ b/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java
@@ -31,7 +31,6 @@ import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.safe_browsing.metrics.SettingsAccessPoint; import org.chromium.chrome.browser.safe_browsing.settings.SafeBrowsingSettingsFragment; -import org.chromium.chrome.browser.safety_check.SafetyCheckBridge.SafetyCheckCommonObserver; import org.chromium.chrome.browser.safety_check.SafetyCheckProperties.PasswordsState; import org.chromium.chrome.browser.safety_check.SafetyCheckProperties.SafeBrowsingState; import org.chromium.chrome.browser.safety_check.SafetyCheckProperties.UpdatesState; @@ -45,19 +44,18 @@ import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; -class SafetyCheckMediator implements PasswordCheck.Observer, SafetyCheckCommonObserver { +class SafetyCheckMediator implements PasswordCheck.Observer { /** * The minimal amount of time to show the checking state. - * This is different from the standard guideline of 500ms because of the UX guidance for - * Safety check on mobile and to be consistent with the Desktop counterpart (also 1s there). + * This needs to be non-zero to make it seem like the browser is doing work. This is different + * from the standard guideline of 500ms because of the UX guidance for Safety check on mobile + * and to be consistent with the Desktop counterpart (also 1s there). */ private static final int CHECKING_MIN_DURATION_MS = 1000; /** Time after which the null-states will be shown: 10 minutes. */ private static final long RESET_TO_NULL_AFTER_MS = 10 * DateUtils.MINUTE_IN_MILLIS; private static final String SAFETY_CHECK_INTERACTIONS = "Settings.SafetyCheck.Interactions"; - /** Bridge to the C++ side for the Safe Browsing and passwords checks. */ - private SafetyCheckBridge mSafetyCheckBridge; /** Model representing the current state of the checks. */ private PropertyModel mModel; /** Client to interact with Omaha for the updates check. */ @@ -129,18 +127,16 @@ * because a {@link WeakReference} needs to be passed (the check is asynchronous). */ private final Callback<Integer> mUpdatesCheckCallback = (status) -> { - mRunnableUpdates = () -> { + if (mHandler == null) return; + + setRunnableUpdates(() -> { if (mModel != null) { RecordHistogram.recordEnumeratedHistogram("Settings.SafetyCheck.UpdatesResult", SafetyCheckProperties.updatesStateToNative(status), UpdateStatus.MAX_VALUE + 1); mModel.set(SafetyCheckProperties.UPDATES_STATE, status); } - }; - if (mHandler != null) { - // Show the checking state for at least 1 second for a smoother UX. - mHandler.postDelayed(mRunnableUpdates, getModelUpdateDelay()); - } + }); }; /** @@ -153,20 +149,17 @@ */ public SafetyCheckMediator(PropertyModel model, SafetyCheckUpdatesDelegate client, SettingsLauncher settingsLauncher, SyncConsentActivityLauncher signinLauncher) { - this(model, client, settingsLauncher, signinLauncher, null, new Handler()); - // Have to initialize this after the constructor call, since a "this" instance is needed. - mSafetyCheckBridge = new SafetyCheckBridge(SafetyCheckMediator.this); + this(model, client, settingsLauncher, signinLauncher, new Handler()); } @VisibleForTesting SafetyCheckMediator(PropertyModel model, SafetyCheckUpdatesDelegate client, SettingsLauncher settingsLauncher, SyncConsentActivityLauncher signinLauncher, - SafetyCheckBridge bridge, Handler handler) { + Handler handler) { mModel = model; mUpdatesClient = client; mSettingsLauncher = settingsLauncher; mSigninLauncher = signinLauncher; - mSafetyCheckBridge = bridge; mHandler = handler; mPreferenceManager = SharedPreferencesManager.getInstance(); // Set the listener for clicking the updates element. @@ -222,7 +215,7 @@ // Rerun the updates and Safe Browsing checks. mModel.set(SafetyCheckProperties.SAFE_BROWSING_STATE, SafeBrowsingState.CHECKING); mModel.set(SafetyCheckProperties.UPDATES_STATE, UpdatesState.CHECKING); - mSafetyCheckBridge.checkSafeBrowsing(); + checkSafeBrowsing(); mUpdatesClient.checkForUpdates(new WeakReference(mUpdatesCheckCallback)); } else { mShowSafePasswordState = false; @@ -236,7 +229,7 @@ mPasswordsLoaded = false; mLeaksLoaded = false; // If the user is not signed in, immediately set the state and do not block on disk loads. - if (!mSafetyCheckBridge.userSignedIn()) { + if (!SafetyCheckBridge.userSignedIn()) { mLoadStage = PasswordCheckLoadStage.IDLE; mModel.set(SafetyCheckProperties.PASSWORDS_STATE, PasswordsState.SIGNED_OUT); // Record the value in UMA. @@ -274,7 +267,7 @@ mModel.set(SafetyCheckProperties.SAFE_BROWSING_STATE, SafeBrowsingState.CHECKING); mModel.set(SafetyCheckProperties.UPDATES_STATE, UpdatesState.CHECKING); // Start all the checks. - mSafetyCheckBridge.checkSafeBrowsing(); + checkSafeBrowsing(); // Start observing the password check events (including data loads). PasswordCheckFactory.getOrCreate(mSettingsLauncher).addObserver(this, false); // This indicates that the results of the initial data load should not be applied even if @@ -285,26 +278,6 @@ } /** - * Gets invoked once the Safe Browsing check is completed. - * - * @param status SafetyCheck::SafeBrowsingStatus enum value representing the Safe Browsing state - * (see //components/safety_check/safety_check.h). - */ - @Override - public void onSafeBrowsingCheckResult(@SafeBrowsingStatus int status) { - mRunnableSafeBrowsing = () -> { - if (mModel != null) { - RecordHistogram.recordEnumeratedHistogram("Settings.SafetyCheck.SafeBrowsingResult", - status, SafeBrowsingStatus.MAX_VALUE + 1); - mModel.set(SafetyCheckProperties.SAFE_BROWSING_STATE, - SafetyCheckProperties.safeBrowsingStateFromNative(status)); - } - }; - // Show the checking state for at least 1 second for a smoother UX. - mHandler.postDelayed(mRunnableSafeBrowsing, getModelUpdateDelay()); - } - - /** * Gets invoked when the compromised credentials are fetched from the disk. * After this call, {@link PasswordCheck#getCompromisedCredentialsCount} returns a valid value. */ @@ -339,7 +312,7 @@ } // Handle error state. if (status != PasswordCheckUIStatus.IDLE) { - mRunnablePasswords = () -> { + setRunnablePasswords(() -> { if (mModel != null) { @SafetyCheckProperties.PasswordsState int state = SafetyCheckProperties.passwordsStatefromErrorState(status); @@ -350,9 +323,7 @@ mModel.set(SafetyCheckProperties.PASSWORDS_STATE, state); updatePasswordElementClickDestination(); } - }; - // Show the checking state for at least 1 second for a smoother UX. - mHandler.postDelayed(mRunnablePasswords, getModelUpdateDelay()); + }); return; } // Hand off the completed state to the method for handling loaded passwords data. @@ -378,8 +349,6 @@ passwordCheck.stopCheck(); passwordCheck.removeObserver(this); } - mSafetyCheckBridge.destroy(); - mSafetyCheckBridge = null; mUpdatesClient = null; mModel = null; mHandler = null; @@ -387,18 +356,64 @@ /** Cancels any delayed show callbacks. */ private void cancelCallbacks() { + setRunnablePasswords(null); + setRunnableSafeBrowsing(null); + setRunnableUpdates(null); + } + + /** + * Sets {@link mRunnablePasswords} and, if non-null, runs it with a delay. + * Will cancel any outstanding callbacks set by previous calls to this method. + */ + private void setRunnablePasswords(Runnable r) { if (mRunnablePasswords != null) { mHandler.removeCallbacks(mRunnablePasswords); - mRunnablePasswords = null; } + mRunnablePasswords = r; + if (mRunnablePasswords != null) { + mHandler.postDelayed(mRunnablePasswords, getModelUpdateDelay()); + } + } + + /** + * Sets {@link mRunnableSafeBrowsing} and, if non-null, runs it with a delay. + * Will cancel any outstanding callbacks set by previous calls to this method. + */ + private void setRunnableSafeBrowsing(Runnable r) { if (mRunnableSafeBrowsing != null) { mHandler.removeCallbacks(mRunnableSafeBrowsing); - mRunnableSafeBrowsing = null; } + mRunnableSafeBrowsing = r; + if (mRunnableSafeBrowsing != null) { + mHandler.postDelayed(mRunnableSafeBrowsing, getModelUpdateDelay()); + } + } + + /** + * Sets {@link mRunnableUpdates} and, if non-null, runs it with a delay. + * Will cancel any outstanding callbacks set by previous calls to this method. + */ + private void setRunnableUpdates(Runnable r) { if (mRunnableUpdates != null) { mHandler.removeCallbacks(mRunnableUpdates); - mRunnableUpdates = null; } + mRunnableUpdates = r; + if (mRunnableUpdates != null) { + mHandler.postDelayed(mRunnableUpdates, getModelUpdateDelay()); + } + } + + private void checkSafeBrowsing() { + setRunnableSafeBrowsing(() -> { + if (mModel != null) { + @SafeBrowsingStatus + int status = SafetyCheckBridge.checkSafeBrowsing(); + RecordHistogram.recordEnumeratedHistogram("Settings.SafetyCheck.SafeBrowsingResult", + status, SafeBrowsingStatus.MAX_VALUE + 1); + mModel.set(SafetyCheckProperties.SAFE_BROWSING_STATE, + SafetyCheckProperties.safeBrowsingStateFromNative(status)); + } + }); } /** Called when all data is loaded. Determines if it needs to update the model. */ @@ -412,9 +427,7 @@ if (mLoadStage == PasswordCheckLoadStage.INITIAL_WAIT_FOR_LOAD) { updatePasswordsStateOnDataLoaded(); } else { - // Show the checking state for at least 1 second for a smoother UX. - mRunnablePasswords = this::updatePasswordsStateOnDataLoaded; - mHandler.postDelayed(mRunnablePasswords, getModelUpdateDelay()); + setRunnablePasswords(this::updatePasswordsStateOnDataLoaded); } }
diff --git a/chrome/browser/safety_check/android/javatests/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediatorTest.java b/chrome/browser/safety_check/android/javatests/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediatorTest.java index f92b2cdc..885fc29 100644 --- a/chrome/browser/safety_check/android/javatests/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediatorTest.java +++ b/chrome/browser/safety_check/android/javatests/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediatorTest.java
@@ -8,6 +8,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.when; import static org.chromium.chrome.browser.safety_check.SafetyCheckProperties.COMPROMISED_PASSWORDS; @@ -30,11 +31,13 @@ import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.metrics.test.ShadowRecordHistogram; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.base.test.util.JniMocker; import org.chromium.chrome.browser.password_check.PasswordCheck; import org.chromium.chrome.browser.password_check.PasswordCheckFactory; import org.chromium.chrome.browser.password_check.PasswordCheckUIStatus; import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.SharedPreferencesManager; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.safety_check.SafetyCheckMediator.SafetyCheckInteractions; import org.chromium.chrome.browser.safety_check.SafetyCheckProperties.PasswordsState; import org.chromium.chrome.browser.safety_check.SafetyCheckProperties.SafeBrowsingState; @@ -42,6 +45,7 @@ import org.chromium.chrome.browser.signin.ui.SyncConsentActivityLauncher; import org.chromium.chrome.test.util.browser.Features; import org.chromium.components.browser_ui.settings.SettingsLauncher; +import org.chromium.components.embedder_support.browser_context.BrowserContextHandle; import org.chromium.ui.modelutil.PropertyModel; import java.lang.ref.WeakReference; @@ -62,7 +66,15 @@ @Rule public TestRule mFeaturesProcessor = new Features.JUnitProcessor(); + @Rule + public JniMocker mJniMocker = new JniMocker(); + private PropertyModel mModel; + + @Mock + private SafetyCheckBridge.Natives mSafetyCheckBridge; + @Mock + private Profile mProfile; @Mock private SafetyCheckUpdatesDelegate mUpdatesDelegate; @Mock @@ -70,8 +82,6 @@ @Mock private SettingsLauncher mSettingsLauncher; @Mock - private SafetyCheckBridge mBridge; - @Mock private Handler mHandler; @Mock private PasswordCheck mPasswordCheck; @@ -93,10 +103,12 @@ @Before public void setUp() { MockitoAnnotations.initMocks(this); + mJniMocker.mock(SafetyCheckBridgeJni.TEST_HOOKS, mSafetyCheckBridge); + Profile.setLastUsedProfileForTesting(mProfile); mModel = SafetyCheckProperties.createSafetyCheckModel(); PasswordCheckFactory.setPasswordCheckForTesting(mPasswordCheck); mMediator = new SafetyCheckMediator( - mModel, mUpdatesDelegate, mSettingsLauncher, mSigninLauncher, mBridge, mHandler); + mModel, mUpdatesDelegate, mSettingsLauncher, mSigninLauncher, mHandler); // Execute any delayed tasks immediately. doAnswer(invocation -> { Runnable runnable = (Runnable) (invocation.getArguments()[0]); @@ -106,7 +118,7 @@ .when(mHandler) .postDelayed(any(Runnable.class), anyLong()); // User is always signed in unless the test specifies otherwise. - when(mBridge.userSignedIn()).thenReturn(true); + doReturn(true).when(mSafetyCheckBridge).userSignedIn(any(BrowserContextHandle.class)); // Reset the histogram count. ShadowRecordHistogram.reset(); } @@ -157,12 +169,9 @@ @Test public void testSafeBrowsingCheckEnabledStandard() { - doAnswer(invocation -> { - mMediator.onSafeBrowsingCheckResult(SafeBrowsingStatus.ENABLED_STANDARD); - return null; - }) - .when(mBridge) - .checkSafeBrowsing(); + doReturn(SafeBrowsingStatus.ENABLED_STANDARD) + .when(mSafetyCheckBridge) + .checkSafeBrowsing(any(BrowserContextHandle.class)); mMediator.performSafetyCheck(); assertEquals(SafeBrowsingState.ENABLED_STANDARD, mModel.get(SAFE_BROWSING_STATE)); @@ -174,12 +183,9 @@ @Test public void testSafeBrowsingCheckDisabled() { - doAnswer(invocation -> { - mMediator.onSafeBrowsingCheckResult(SafeBrowsingStatus.DISABLED); - return null; - }) - .when(mBridge) - .checkSafeBrowsing(); + doReturn(SafeBrowsingStatus.DISABLED) + .when(mSafetyCheckBridge) + .checkSafeBrowsing(any(BrowserContextHandle.class)); mMediator.performSafetyCheck(); assertEquals(SafeBrowsingState.DISABLED, mModel.get(SAFE_BROWSING_STATE)); @@ -276,12 +282,9 @@ preferenceManager.writeLong(ChromePreferenceKeys.SETTINGS_SAFETY_CHECK_LAST_RUN_TIMESTAMP, System.currentTimeMillis()); // Safe Browsing: on. - doAnswer(invocation -> { - mMediator.onSafeBrowsingCheckResult(SafeBrowsingStatus.ENABLED_STANDARD); - return null; - }) - .when(mBridge) - .checkSafeBrowsing(); + doReturn(SafeBrowsingStatus.ENABLED_STANDARD) + .when(mSafetyCheckBridge) + .checkSafeBrowsing(any(BrowserContextHandle.class)); // Passwords: safe state. passwordDiskDataAvailable(); when(mPasswordCheck.getSavedPasswordsCount()).thenReturn(12); @@ -309,12 +312,10 @@ preferenceManager.writeLong(ChromePreferenceKeys.SETTINGS_SAFETY_CHECK_LAST_RUN_TIMESTAMP, System.currentTimeMillis()); // Safe Browsing: disabled by admin. - doAnswer(invocation -> { - mMediator.onSafeBrowsingCheckResult(SafeBrowsingStatus.DISABLED_BY_ADMIN); - return null; - }) - .when(mBridge) - .checkSafeBrowsing(); + doReturn(SafeBrowsingStatus.DISABLED_BY_ADMIN) + .when(mSafetyCheckBridge) + .checkSafeBrowsing(any(BrowserContextHandle.class)); + // Passwords: no passwords. passwordDiskDataAvailable(); when(mPasswordCheck.getSavedPasswordsCount()).thenReturn(0); @@ -342,12 +343,10 @@ preferenceManager.writeLong(ChromePreferenceKeys.SETTINGS_SAFETY_CHECK_LAST_RUN_TIMESTAMP, System.currentTimeMillis()); // Safe Browsing: off. - doAnswer(invocation -> { - mMediator.onSafeBrowsingCheckResult(SafeBrowsingStatus.DISABLED); - return null; - }) - .when(mBridge) - .checkSafeBrowsing(); + doReturn(SafeBrowsingStatus.DISABLED) + .when(mSafetyCheckBridge) + .checkSafeBrowsing(any(BrowserContextHandle.class)); + // Passwords: compromised state. passwordDiskDataAvailable(); when(mPasswordCheck.getSavedPasswordsCount()).thenReturn(20); @@ -375,12 +374,10 @@ preferenceManager.writeLong(ChromePreferenceKeys.SETTINGS_SAFETY_CHECK_LAST_RUN_TIMESTAMP, System.currentTimeMillis() - (20 * 60 * 1000)); // Safe Browsing: on. - doAnswer(invocation -> { - mMediator.onSafeBrowsingCheckResult(SafeBrowsingStatus.ENABLED_STANDARD); - return null; - }) - .when(mBridge) - .checkSafeBrowsing(); + doReturn(SafeBrowsingStatus.ENABLED_STANDARD) + .when(mSafetyCheckBridge) + .checkSafeBrowsing(any(BrowserContextHandle.class)); + // Passwords: safe state. passwordDiskDataAvailable(); when(mPasswordCheck.getSavedPasswordsCount()).thenReturn(13); @@ -408,12 +405,10 @@ preferenceManager.writeLong(ChromePreferenceKeys.SETTINGS_SAFETY_CHECK_LAST_RUN_TIMESTAMP, System.currentTimeMillis() - (20 * 60 * 1000)); // Safe Browsing: off. - doAnswer(invocation -> { - mMediator.onSafeBrowsingCheckResult(SafeBrowsingStatus.DISABLED); - return null; - }) - .when(mBridge) - .checkSafeBrowsing(); + doReturn(SafeBrowsingStatus.DISABLED) + .when(mSafetyCheckBridge) + .checkSafeBrowsing(any(BrowserContextHandle.class)); + // Passwords: compromised state. passwordDiskDataAvailable(); when(mPasswordCheck.getSavedPasswordsCount()).thenReturn(20); @@ -530,7 +525,7 @@ @Test public void testPasswordsInitialLoadUserSignedOut() { // Order: initial state is user signed out -> load ignored. - when(mBridge.userSignedIn()).thenReturn(false); + doReturn(false).when(mSafetyCheckBridge).userSignedIn(any(BrowserContextHandle.class)); mMediator.setInitialState(); assertEquals(PasswordsState.SIGNED_OUT, mModel.get(PASSWORDS_STATE));
diff --git a/chrome/browser/safety_check/android/safety_check_bridge.cc b/chrome/browser/safety_check/android/safety_check_bridge.cc index 2e082afe..40245b5 100644 --- a/chrome/browser/safety_check/android/safety_check_bridge.cc +++ b/chrome/browser/safety_check/android/safety_check_bridge.cc
@@ -2,12 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/safety_check/android/safety_check_bridge.h" - #include <jni.h> -#include <memory> - #include "chrome/browser/safety_check/android/jni_headers/SafetyCheckBridge_jni.h" #include "chrome/browser/signin/identity_manager_provider.h" #include "components/embedder_support/android/browser_context/browser_context_handle.h" @@ -16,14 +12,6 @@ #include "components/user_prefs/user_prefs.h" #include "content/public/browser/browser_context.h" -static jlong JNI_SafetyCheckBridge_Init( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj, - const base::android::JavaParamRef<jobject>& j_safety_check_observer) { - return reinterpret_cast<intptr_t>( - new SafetyCheckBridge(j_safety_check_observer)); -} - static jboolean JNI_SafetyCheckBridge_UserSignedIn( JNIEnv* env, const base::android::JavaParamRef<jobject>& jhandle) { @@ -32,32 +20,10 @@ browser_context::BrowserContextFromJavaHandle(jhandle))); } -SafetyCheckBridge::SafetyCheckBridge( - const base::android::JavaParamRef<jobject>& j_safety_check_observer) - : j_safety_check_observer_(j_safety_check_observer) { - safety_check_ = std::make_unique<safety_check::SafetyCheck>(this); -} - -void SafetyCheckBridge::Destroy( +static jint JNI_SafetyCheckBridge_CheckSafeBrowsing( JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj) { - safety_check_.reset(); - delete this; -} - -void SafetyCheckBridge::CheckSafeBrowsing( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& jobj, const base::android::JavaParamRef<jobject>& jhandle) { - safety_check_->CheckSafeBrowsing(user_prefs::UserPrefs::Get( - browser_context::BrowserContextFromJavaHandle(jhandle))); + return static_cast<int>( + safety_check::CheckSafeBrowsing(user_prefs::UserPrefs::Get( + browser_context::BrowserContextFromJavaHandle(jhandle)))); } - -void SafetyCheckBridge::OnSafeBrowsingCheckResult( - safety_check::SafetyCheck::SafeBrowsingStatus status) { - JNIEnv* env = base::android::AttachCurrentThread(); - Java_SafetyCheckCommonObserver_onSafeBrowsingCheckResult( - env, j_safety_check_observer_, static_cast<int>(status)); -} - -SafetyCheckBridge::~SafetyCheckBridge() = default;
diff --git a/chrome/browser/safety_check/android/safety_check_bridge.h b/chrome/browser/safety_check/android/safety_check_bridge.h deleted file mode 100644 index 3e8168e..0000000 --- a/chrome/browser/safety_check/android/safety_check_bridge.h +++ /dev/null
@@ -1,42 +0,0 @@ -// Copyright 2020 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_SAFETY_CHECK_ANDROID_SAFETY_CHECK_BRIDGE_H_ -#define CHROME_BROWSER_SAFETY_CHECK_ANDROID_SAFETY_CHECK_BRIDGE_H_ - -#include <jni.h> - -#include "base/android/scoped_java_ref.h" -#include "components/safety_check/safety_check.h" - -// Allows the Java code to make use of cross-platform browser safety checks in -// //components/safety_check. -class SafetyCheckBridge - : public safety_check::SafetyCheck::SafetyCheckHandlerInterface { - public: - // Takes an observer object that will get invoked on check results. - explicit SafetyCheckBridge( - const base::android::JavaParamRef<jobject>& j_safety_check_observer); - - // Destroys this bridge. Should only be invoked by the Java side. - void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); - - // Checks the status of Safe Browsing and invokes |OnSafeBrowsingCheckResult| - // on the observer object with the result. - void CheckSafeBrowsing(JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj, - const base::android::JavaParamRef<jobject>& jhandle); - - // safety_check::SafetyCheck::SafetyCheckHandlerInterface implementation. - void OnSafeBrowsingCheckResult( - safety_check::SafetyCheck::SafeBrowsingStatus status) override; - - private: - virtual ~SafetyCheckBridge(); - - std::unique_ptr<safety_check::SafetyCheck> safety_check_; - base::android::ScopedJavaGlobalRef<jobject> j_safety_check_observer_; -}; - -#endif // CHROME_BROWSER_SAFETY_CHECK_ANDROID_SAFETY_CHECK_BRIDGE_H_
diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java index 1e163d4..4bcae1ca 100644 --- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java +++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java
@@ -19,6 +19,8 @@ import org.chromium.base.metrics.RecordUserAction; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; +import org.chromium.chrome.browser.content_creation.notes.NoteCreationCoordinator; +import org.chromium.chrome.browser.content_creation.notes.NoteCreationCoordinatorFactory; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.profiles.Profile; @@ -443,7 +445,11 @@ return new FirstPartyOptionBuilder(ContentType.HIGHLIGHTED_TEXT) .setIcon(R.drawable.webnote, R.string.sharing_webnotes_stylized) .setFeatureNameForMetrics("SharingHubAndroid.WebnotesStylize") - .setOnClickCallback((view) -> {}) + .setOnClickCallback((view) -> { + NoteCreationCoordinator coordinator = NoteCreationCoordinatorFactory.create(); + coordinator.initialize(mActivity); + coordinator.showDialog(); + }) .build(); }
diff --git a/chrome/browser/share/android/java_sources.gni b/chrome/browser/share/android/java_sources.gni index 7b04835..f32f301 100644 --- a/chrome/browser/share/android/java_sources.gni +++ b/chrome/browser/share/android/java_sources.gni
@@ -71,6 +71,8 @@ ] share_java_deps = [ + "//chrome/browser/content_creation/notes/android:factory_java", + "//chrome/browser/content_creation/notes/android:public_java", "//components/feature_engagement/public:public_java", "//components/paint_preview/common/proto:proto_java", ]
diff --git a/chrome/browser/speech/speech_recognition_client_browser_interface.h b/chrome/browser/speech/speech_recognition_client_browser_interface.h index 467a01e..0639a36 100644 --- a/chrome/browser/speech/speech_recognition_client_browser_interface.h +++ b/chrome/browser/speech/speech_recognition_client_browser_interface.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_CLIENT_BROWSER_INTERFACE_H_ #include "components/keyed_service/core/keyed_service.h" +#include "components/soda/constants.h" #include "components/soda/soda_installer.h" #include "media/mojo/mojom/speech_recognition_service.mojom.h" #include "mojo/public/cpp/bindings/receiver_set.h" @@ -44,8 +45,13 @@ // SodaInstaller::Observer: void OnSodaInstalled() override; - void OnSodaProgress(int progress) override {} + void OnSodaLanguagePackInstalled( + speech::LanguageCode language_code) override {} + void OnSodaProgress(int combined_progress) override {} + void OnSodaLanguagePackProgress(int language_progress, + LanguageCode language_code) override {} void OnSodaError() override {} + void OnSodaLanguagePackError(speech::LanguageCode language_code) override {} private: void OnSpeechRecognitionAvailabilityChanged();
diff --git a/chrome/browser/ssl/ssl_config_service_manager_pref.cc b/chrome/browser/ssl/ssl_config_service_manager_pref.cc index be9fab3..ff27331 100644 --- a/chrome/browser/ssl/ssl_config_service_manager_pref.cc +++ b/chrome/browser/ssl/ssl_config_service_manager_pref.cc
@@ -171,6 +171,7 @@ StringPrefMember ssl_version_max_; StringListPrefMember h2_client_cert_coalescing_host_patterns_; BooleanPrefMember cecpq2_enabled_; + BooleanPrefMember triple_des_enabled_; // The cached list of disabled SSL cipher suites. std::vector<uint16_t> disabled_cipher_suites_; @@ -205,6 +206,8 @@ prefs::kH2ClientCertCoalescingHosts, local_state, local_state_callback); cecpq2_enabled_.Init(prefs::kCECPQ2Enabled, local_state, local_state_callback); + triple_des_enabled_.Init(prefs::kTripleDESEnabled, local_state, + local_state_callback); local_state_change_registrar_.Init(local_state); local_state_change_registrar_.Add(prefs::kCipherSuiteBlacklist, @@ -233,6 +236,8 @@ registry->RegisterListPref(prefs::kH2ClientCertCoalescingHosts); registry->RegisterBooleanPref(prefs::kCECPQ2Enabled, default_context_config.cecpq2_enabled); + registry->RegisterBooleanPref(prefs::kTripleDESEnabled, + default_context_config.triple_des_enabled); } void SSLConfigServiceManagerPref::AddToNetworkContextParams( @@ -303,6 +308,7 @@ // is especially conservative. config->cecpq2_enabled = cecpq2_enabled_.GetValue() && variations_unrestricted_; + config->triple_des_enabled = triple_des_enabled_.GetValue(); return config; }
diff --git a/chrome/browser/ssl/typed_navigation_upgrade_throttle.cc b/chrome/browser/ssl/typed_navigation_upgrade_throttle.cc index 572568b..bacd912 100644 --- a/chrome/browser/ssl/typed_navigation_upgrade_throttle.cc +++ b/chrome/browser/ssl/typed_navigation_upgrade_throttle.cc
@@ -59,10 +59,7 @@ return is_using_https_as_default_scheme && handle->IsInMainFrame() && !handle->IsSameDocument() && handle->GetURL().SchemeIs(url::kHttpsScheme) && - !handle->GetWebContents()->IsPortal() && - ui::PageTransitionCoreTypeIs(handle->GetPageTransition(), - ui::PAGE_TRANSITION_TYPED) && - ui::PageTransitionIsNewNavigation(handle->GetPageTransition()); + !handle->GetWebContents()->IsPortal(); } void RecordUMA(TypedNavigationUpgradeThrottle::Event event) {
diff --git a/chrome/browser/ssl/typed_navigation_upgrade_throttle_browsertest.cc b/chrome/browser/ssl/typed_navigation_upgrade_throttle_browsertest.cc index f60ead2..1fbda82 100644 --- a/chrome/browser/ssl/typed_navigation_upgrade_throttle_browsertest.cc +++ b/chrome/browser/ssl/typed_navigation_upgrade_throttle_browsertest.cc
@@ -6,15 +6,18 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" +#include "chrome/app/chrome_command_ids.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/history/history_test_utils.h" #include "chrome/browser/interstitials/security_interstitial_page_test_utils.h" +#include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/location_bar/location_bar.h" #include "chrome/browser/ui/omnibox/omnibox_tab_helper.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/metrics/content/subprocess_metrics_provider.h" #include "components/omnibox/browser/omnibox_edit_model.h" #include "components/omnibox/browser/omnibox_popup_model.h" #include "components/omnibox/common/omnibox_features.h" @@ -31,6 +34,8 @@ #include "services/network/test/test_utils.h" #include "testing/gtest/include/gtest/gtest.h" #include "typed_navigation_upgrade_throttle.h" +#include "ui/base/clipboard/clipboard.h" +#include "ui/base/clipboard/scoped_clipboard_writer.h" namespace { @@ -58,6 +63,10 @@ const char* const kNonUniqueHostname1 = "testpage"; const char* const kNonUniqueHostname2 = "site.test"; +// Hostname of the URL of the search results page when the user types a search +// query in the omnibox. +const char* const kGoogleSearchHost = "www.google.com"; + const char kNetErrorHistogram[] = "Net.ErrorPageCounts"; enum class NavigationExpectation { @@ -119,6 +128,12 @@ return MakeURLWithPort(url_without_scheme, "http", port); } +// Stores the given text to clipboard. +void SetClipboardText(const std::u16string& text) { + ui::ScopedClipboardWriter writer(ui::ClipboardBuffer::kCopyPaste); + writer.WriteText(text); +} + } // namespace class TypedNavigationUpgradeThrottleBrowserTest @@ -151,6 +166,7 @@ feature_list_.InitWithFeaturesAndParameters(enabled_features, disabled_features); } + void SetUpOnMainThread() override { url_loader_interceptor_ = std::make_unique<content::URLLoaderInterceptor>(base::BindRepeating( @@ -202,7 +218,8 @@ params->url_request.url == MakeHttpURL(kSiteWithNetError) || params->url_request.url == MakeHttpURL(kNonUniqueHostname1) || params->url_request.url == MakeHttpURL(kNonUniqueHostname2) || - params->url_request.url == GURL("http://127.0.0.1")) { + params->url_request.url == GURL("http://127.0.0.1") || + params->url_request.url.host() == kGoogleSearchHost) { std::string headers = "HTTP/1.1 200 OK\nContent-Type: text/html; charset=utf-8\n"; std::string body = "<html><title>Success</title>Hello world</html>"; @@ -242,6 +259,29 @@ omnibox()->OnAfterPossibleChange(true); } + // Copies |hostname| to clipboard, pastes it into the omnibox and hits enter. + // Expects |number_of_navigations| to happen. + void PasteHostnameAndWaitForNavigations(content::WebContents* contents, + const std::string& hostname, + int number_of_navigations) { + // Make sure Chrome is in the foreground, otherwise sending input + // won't do anything and the test will hang. + ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); + EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); + // Copy and paste the text. + ui::Clipboard::GetForCurrentThread()->Clear( + ui::ClipboardBuffer::kCopyPaste); + SetClipboardText(base::UTF8ToUTF16(hostname)); + EXPECT_TRUE(chrome::ExecuteCommand(browser(), IDC_PASTE)); + WaitForAutocompleteControllerDone(); + // Hit enter and wait for the navigation(s). + content::TestNavigationObserver navigation_observer(contents, + number_of_navigations); + ASSERT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_RETURN, + false, false, false, false)); + navigation_observer.Wait(); + } + void TypeUrlAndExpectSuccessfulUpgrade( const std::string& url_without_scheme) { ASSERT_TRUE(IsFeatureEnabled()); @@ -299,9 +339,10 @@ num_expected_navigations); } - void PressEnterAndWaitForNavigations(size_t num_navigations) { + void PressEnterAndWaitForNavigations(size_t num_expected_navigations) { content::TestNavigationObserver navigation_observer( - browser()->tab_strip_model()->GetActiveWebContents(), num_navigations); + browser()->tab_strip_model()->GetActiveWebContents(), + num_expected_navigations); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce( @@ -320,7 +361,6 @@ ui_test_utils::WaitForHistoryToLoad(history_service); } - private: void WaitForAutocompleteControllerDone() { AutocompleteController* controller = omnibox()->model()->autocomplete_controller(); @@ -333,6 +373,7 @@ ASSERT_TRUE(controller->done()); } + private: void TypeUrlAndCheckNavigation(const std::string& url_without_scheme, const base::HistogramTester& histograms, NavigationExpectation expectation, @@ -375,6 +416,10 @@ EXPECT_FALSE(base::Contains(enumerator.urls(), https_url)); } + // This is needed to sync histograms recorded in renderers and the browser, + // as kNetErrorHistogram is recorded by the renderer. + metrics::SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); + // Should never hit an error page. histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 0); @@ -525,18 +570,98 @@ } TypeUrlAndExpectSuccessfulUpgrade(kSiteWithGoodHttps); - // Try again. Should directly load the https version this time and not record - // any histograms in the throttle. + // Try again. Omnibox defaults the navigation to https again and marks the + // navigation as upgraded, so the throttle will handle it again as well. + TypeUrlAndExpectSuccessfulUpgrade(kSiteWithGoodHttps); +} + +// Regression test for crbug.com/1202967: Paste a hostname in the omnibox and +// press enter. This should default to HTTPS and the upgrade should succeed. +IN_PROC_BROWSER_TEST_P(TypedNavigationUpgradeThrottleBrowserTest, + PasteUrlWithoutASchemeAndHitEnter_GoodHttps) { + if (!IsFeatureEnabled()) { + return; + } base::HistogramTester histograms; - TypeUrlAndExpectHttps(kSiteWithGoodHttps, histograms, 1); + content::WebContents* contents = + browser()->tab_strip_model()->GetActiveWebContents(); + // Type hostname and navigate. Should successfully load the page over HTTPS + // with a single navigation attempt. + PasteHostnameAndWaitForNavigations(contents, kSiteWithGoodHttps, 1); + + ui_test_utils::HistoryEnumerator enumerator(browser()->profile()); + const GURL http_url = MakeHttpURL(kSiteWithGoodHttps); + const GURL https_url = MakeHttpsURL(kSiteWithGoodHttps); + + EXPECT_EQ(https_url, contents->GetLastCommittedURL()); + EXPECT_TRUE(base::Contains(enumerator.urls(), https_url)); + EXPECT_FALSE(base::Contains(enumerator.urls(), http_url)); + + // This is needed to sync histograms recorded in renderers and the browser, as + // kNetErrorHistogram is recorded by the renderer. + metrics::SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); + + // Should never hit an error page. + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 0); + histograms.ExpectTotalCount(kNetErrorHistogram, 0); + histograms.ExpectTotalCount(TypedNavigationUpgradeThrottle::kHistogramName, - 0); + 2); + histograms.ExpectBucketCount( + TypedNavigationUpgradeThrottle::kHistogramName, + TypedNavigationUpgradeThrottle::Event::kHttpsLoadStarted, 1); + histograms.ExpectBucketCount( + TypedNavigationUpgradeThrottle::kHistogramName, + TypedNavigationUpgradeThrottle::Event::kHttpsLoadSucceeded, 1); +} + +// Regression test for crbug.com/1202967: Paste a hostname in the omnibox and +// press enter. This should hit a bad HTTPS URL and fallback to HTTP, never +// showing an interstitial. +IN_PROC_BROWSER_TEST_P( + TypedNavigationUpgradeThrottleBrowserTest, + PasteUrlWithoutASchemeAndHitEnter_BadHttps_ShouldFallback) { + if (!IsFeatureEnabled()) { + return; + } + base::HistogramTester histograms; + content::WebContents* contents = + browser()->tab_strip_model()->GetActiveWebContents(); + // Type hostname and navigate. Should attempt to load over HTTPS, encounter an + // SSL error and fall back to HTTP. Expect two navigations, one for the HTTPS + // attempt and one for the fallback. + PasteHostnameAndWaitForNavigations(contents, kSiteWithBadHttps, 2); + + ui_test_utils::HistoryEnumerator enumerator(browser()->profile()); + const GURL http_url = MakeHttpURL(kSiteWithBadHttps); + const GURL https_url = MakeHttpsURL(kSiteWithBadHttps); + + EXPECT_EQ(http_url, contents->GetLastCommittedURL()); + EXPECT_FALSE(base::Contains(enumerator.urls(), https_url)); + EXPECT_TRUE(base::Contains(enumerator.urls(), http_url)); + + // This is needed to sync histograms recorded in renderers and the browser, as + // kNetErrorHistogram is recorded by the renderer. + metrics::SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); + + // Should never hit an error page. + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 0); + histograms.ExpectTotalCount(kNetErrorHistogram, 0); + + histograms.ExpectTotalCount(TypedNavigationUpgradeThrottle::kHistogramName, + 2); + histograms.ExpectBucketCount( + TypedNavigationUpgradeThrottle::kHistogramName, + TypedNavigationUpgradeThrottle::Event::kHttpsLoadStarted, 1); + histograms.ExpectBucketCount( + TypedNavigationUpgradeThrottle::kHistogramName, + TypedNavigationUpgradeThrottle::Event::kHttpsLoadFailedWithCertError, 1); } // If the feature is enabled, right clicking and selecting paste & go in the // omnibox without a scheme should load the HTTPS version. IN_PROC_BROWSER_TEST_P(TypedNavigationUpgradeThrottleBrowserTest, - UrlPastedWithoutScheme_GoodHttps) { + PasteAndGoUrlWithoutAScheme_GoodHttps) { if (!IsFeatureEnabled()) { return; } @@ -545,8 +670,9 @@ content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); - content::TestNavigationObserver navigation_observer(contents, - /*num_navigations=*/1); + content::TestNavigationObserver navigation_observer( + contents, + /*number_of_navigations=*/1); OmniboxEditModel* model = omnibox()->model(); model->PasteAndGo(base::UTF8ToUTF16(kSiteWithGoodHttps)); @@ -560,6 +686,10 @@ EXPECT_TRUE(base::Contains(enumerator.urls(), https_url)); EXPECT_FALSE(base::Contains(enumerator.urls(), http_url)); + // This is needed to sync histograms recorded in renderers and the browser, as + // kNetErrorHistogram is recorded by the renderer. + metrics::SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); + // Should never hit an error page. histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 0); histograms.ExpectTotalCount(kNetErrorHistogram, 0); @@ -770,6 +900,10 @@ EXPECT_EQ(expected_final_url, contents->GetLastCommittedURL()); + // This is needed to sync histograms recorded in renderers and the browser, + // as kNetErrorHistogram is recorded by the renderer. + metrics::SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); + // Should never hit an error page. histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 0); @@ -785,7 +919,6 @@ // version which also redirects to the same error page. void TypeUrlAndCheckRedirectToBadHttps( const std::string& url_without_scheme, - const base::HistogramTester& histograms, const GURL& expected_final_url) { SetOmniboxText(url_without_scheme); PressEnterAndWaitForNavigations(2); @@ -877,9 +1010,16 @@ TypedNavigationUpgradeThrottle::Event::kRedirected, 2); } -// Same as UrlTypedWithoutScheme_GoodHttps_Redirected, but this time the -// redirect target is a broken HTTPS page. Should fall back to the HTTP URL -// which will redirect to the broken HTTPS page and show an interstitial +// Similar to UrlTypedWithoutScheme_GoodHttps_Redirected, but this time the +// redirect target is a broken HTTPS page: +// 1. User types a hostname (site-with-good-https-redirect.com). +// 2. Chrome loads the https URL as part of the upgrade. +// 3. The HTTPS URL redirects to a broken HTTPS URL (site-with-bad-https.com). +// 4. Chrome falls back to the http:// URL of the original hostname +// (site-with-good-https-redirect.com). +// 5. The http:// URL of the original hostname also redirects to the broken +// HTTPS URL in step 3. +// 6. The navigation ends up showing an interstitial. IN_PROC_BROWSER_TEST_P( TypedNavigationUpgradeThrottleRedirectBrowserTest, UrlTypedWithoutScheme_BadHttps_Redirected_ShouldFallback) { @@ -895,10 +1035,14 @@ content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); + // Type a hostname and expect a fallback to http. HTTP URL also redirects to + // the broken https site. base::HistogramTester histograms; - TypeUrlAndCheckRedirectToBadHttps(GetURLWithoutScheme(url), histograms, - target_url); + TypeUrlAndCheckRedirectToBadHttps(GetURLWithoutScheme(url), target_url); ASSERT_TRUE(chrome_browser_interstitials::IsShowingInterstitial(contents)); + // This is needed to sync histograms recorded in renderers and the browser, as + // kNetErrorHistogram is recorded by the renderer. + metrics::SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); histograms.ExpectTotalCount(TypedNavigationUpgradeThrottle::kHistogramName, 3); @@ -916,12 +1060,13 @@ // once. The error is encountered first at the end of the upgraded HTTPS // navigation, and then at the end of the fallback. histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 2); - histograms.ExpectTotalCount(kNetErrorHistogram, 0); + // SSL errors also record a net error histogram. + histograms.ExpectTotalCount(kNetErrorHistogram, 1); // Try again, histogram numbers should double. - TypeUrlAndCheckRedirectToBadHttps(GetURLWithoutScheme(url), histograms, - target_url); + TypeUrlAndCheckRedirectToBadHttps(GetURLWithoutScheme(url), target_url); ASSERT_TRUE(chrome_browser_interstitials::IsShowingInterstitial(contents)); + metrics::SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); histograms.ExpectTotalCount(TypedNavigationUpgradeThrottle::kHistogramName, 6); @@ -936,33 +1081,40 @@ TypedNavigationUpgradeThrottle::Event::kRedirected, 2); histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 4); - histograms.ExpectTotalCount(kNetErrorHistogram, 0); + histograms.ExpectTotalCount(kNetErrorHistogram, 2); - // Regression test for crbug.com/1182760: Try again, this time using the - // target URL. This should show an interstitial instead of a net error. + // Regression test for crbug.com/1182760: This time type the hostname of the + // redirect target (site-with-bad-https.com). This should attempt an HTTPS + // load, encounter an SSL error and fall back to HTTP. const std::string url_without_scheme = GetURLWithoutScheme(target_url); SetOmniboxText(url_without_scheme); - PressEnterAndWaitForNavigations(/*num_expected_navigations=*/1); - ASSERT_TRUE(chrome_browser_interstitials::IsShowingInterstitial(contents)); + // Expect two navigations: One for the initial HTTPS load, one for the + // fallback URL. + PressEnterAndWaitForNavigations(/*num_expected_navigations=*/2); + ASSERT_FALSE(chrome_browser_interstitials::IsShowingInterstitial(contents)); + metrics::SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); + ui_test_utils::HistoryEnumerator enumerator(browser()->profile()); - const GURL http_url = MakeHttpURL(url_without_scheme); + const GURL http_url = + embedded_test_server()->GetURL(kSiteWithBadHttps, "/title1.html"); const GURL https_url = MakeHttpsURL(url_without_scheme); - EXPECT_EQ(https_url, contents->GetLastCommittedURL()); - // Since the navigation results in an interstitial, https_url isn't added to + EXPECT_EQ(http_url, contents->GetLastCommittedURL()); + // Since the navigation results in a fallback, https_url isn't added to // history. + EXPECT_TRUE(base::Contains(enumerator.urls(), http_url)); EXPECT_FALSE(base::Contains(enumerator.urls(), https_url)); - EXPECT_FALSE(base::Contains(enumerator.urls(), http_url)); - histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 6); - histograms.ExpectTotalCount(kNetErrorHistogram, 0); - // Throttle histogram numbers shouldn't change: + histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 4); + histograms.ExpectTotalCount(kNetErrorHistogram, 2); + + // Throttle histogram numbers should update for the HTTP fallback: histograms.ExpectTotalCount(TypedNavigationUpgradeThrottle::kHistogramName, - 6); + 8); histograms.ExpectBucketCount( TypedNavigationUpgradeThrottle::kHistogramName, - TypedNavigationUpgradeThrottle::Event::kHttpsLoadStarted, 2); + TypedNavigationUpgradeThrottle::Event::kHttpsLoadStarted, 3); histograms.ExpectBucketCount( TypedNavigationUpgradeThrottle::kHistogramName, - TypedNavigationUpgradeThrottle::Event::kHttpsLoadFailedWithCertError, 2); + TypedNavigationUpgradeThrottle::Event::kHttpsLoadFailedWithCertError, 3); histograms.ExpectBucketCount( TypedNavigationUpgradeThrottle::kHistogramName, TypedNavigationUpgradeThrottle::Event::kRedirected, 2); @@ -985,9 +1137,11 @@ browser()->tab_strip_model()->GetActiveWebContents(); base::HistogramTester histograms; - TypeUrlAndCheckRedirectToBadHttps(GetURLWithoutScheme(url), histograms, - target_url); + TypeUrlAndCheckRedirectToBadHttps(GetURLWithoutScheme(url), target_url); ASSERT_FALSE(chrome_browser_interstitials::IsShowingInterstitial(contents)); + // This is needed to sync histograms recorded in renderers and the browser, as + // kNetErrorHistogram is recorded by the renderer. + metrics::SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); histograms.ExpectTotalCount(TypedNavigationUpgradeThrottle::kHistogramName, 3); @@ -1001,14 +1155,14 @@ TypedNavigationUpgradeThrottle::kHistogramName, TypedNavigationUpgradeThrottle::Event::kRedirected, 1); - // // The first navigation never shows the interstitial or the net error page. + // The navigation ends up on a net error. histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 0); - histograms.ExpectTotalCount(kNetErrorHistogram, 0); + histograms.ExpectTotalCount(kNetErrorHistogram, 1); // Try again, histogram numbers should double. - TypeUrlAndCheckRedirectToBadHttps(GetURLWithoutScheme(url), histograms, - target_url); + TypeUrlAndCheckRedirectToBadHttps(GetURLWithoutScheme(url), target_url); ASSERT_FALSE(chrome_browser_interstitials::IsShowingInterstitial(contents)); + metrics::SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); histograms.ExpectTotalCount(TypedNavigationUpgradeThrottle::kHistogramName, 6); @@ -1023,10 +1177,7 @@ TypedNavigationUpgradeThrottle::Event::kRedirected, 2); histograms.ExpectTotalCount(SSLErrorHandler::GetHistogramNameForTesting(), 0); - // TODO(meacer): This should record 1 instead of zero. However, simulating the - // net error page with a URLLoaderInterceptor doesn't work, probably because - // of the reasons outlined in https://crbug.com/1168371. - histograms.ExpectTotalCount(kNetErrorHistogram, 0); + histograms.ExpectTotalCount(kNetErrorHistogram, 2); } // TODO(crbug.com/1141691): Test the following cases:
diff --git a/chrome/browser/subresource_filter/ad_tagging_browsertest.cc b/chrome/browser/subresource_filter/ad_tagging_browsertest.cc index 3e3ea99..3311bd0 100644 --- a/chrome/browser/subresource_filter/ad_tagging_browsertest.cc +++ b/chrome/browser/subresource_filter/ad_tagging_browsertest.cc
@@ -241,13 +241,9 @@ name.c_str()); // The executed scripts set the title to be the frame name when they have // finished loading. - content::TestNavigationObserver navigation_observer(GetWebContents(), 1); content::TitleWatcher title_watcher(GetWebContents(), base::ASCIIToUTF16(name)); EXPECT_TRUE(content::ExecJs(rfh, script)); - // The document.write() will implicitly call document.open(), which will send - // a same-document navigation notification. Wait for it. - navigation_observer.Wait(); EXPECT_EQ(base::ASCIIToUTF16(name), title_watcher.WaitAndGetTitle()); return content::FrameMatchingPredicate( content::WebContents::FromRenderFrameHost(rfh), @@ -534,18 +530,13 @@ CreateDocWrittenFrame(GetWebContents()); EXPECT_FALSE(observer.GetIsAdSubframe(vanilla_frame->GetFrameTreeNodeId())); - // When the main frame invoked document.write() on |vanilla_frame|, - // |vanilla_frame|'s url was changed to match the main frame's url. Load - // |vanilla_frame|'s child frames with a query to ensure the urls are not - // identical, since outside of document.open() we refuse to navigate an iframe - // to its parent's url. content::RenderFrameHost* vanilla_child_of_vanilla = - CreateSrcFrame(vanilla_frame, GetURL("frame_factory.html?1")); + CreateSrcFrame(vanilla_frame, GetURL("frame_factory.html")); EXPECT_FALSE( observer.GetIsAdSubframe(vanilla_child_of_vanilla->GetFrameTreeNodeId())); content::RenderFrameHost* ad_child_of_vanilla = - CreateSrcFrameFromAdScript(vanilla_frame, GetURL("frame_factory.html?2")); + CreateSrcFrameFromAdScript(vanilla_frame, GetURL("frame_factory.html")); EXPECT_TRUE( observer.GetIsAdSubframe(ad_child_of_vanilla->GetFrameTreeNodeId())); ExpectFrameAdEvidence( @@ -562,7 +553,7 @@ blink::mojom::FrameCreationStackEvidence::kCreatedByAdScript); content::RenderFrameHost* vanilla_child_of_ad = - CreateSrcFrame(ad_frame, GetURL("frame_factory.html?3")); + CreateSrcFrame(ad_frame, GetURL("frame_factory.html")); EXPECT_TRUE( observer.GetIsAdSubframe(vanilla_child_of_ad->GetFrameTreeNodeId())); ExpectFrameAdEvidence( @@ -571,7 +562,7 @@ blink::mojom::FrameCreationStackEvidence::kCreatedByAdScript); content::RenderFrameHost* ad_child_of_ad = - CreateSrcFrameFromAdScript(ad_frame, GetURL("frame_factory.html?4")); + CreateSrcFrameFromAdScript(ad_frame, GetURL("frame_factory.html")); EXPECT_TRUE(observer.GetIsAdSubframe(ad_child_of_ad->GetFrameTreeNodeId())); ExpectFrameAdEvidence( ad_child_of_ad, /*parent_is_ad=*/true, @@ -672,19 +663,13 @@ content::RenderFrameHost* vanilla_frame_with_aborted_load = CreateFrameWithDocWriteAbortedLoad(GetWebContents()); - // When the main frame invoked document.write() on - // |vanilla_frame_with_aborted_load|, |vanilla_frame_with_aborted_load|'s url - // was changed to match the main frame's url. Load - // |vanilla_frame_with_aborted_load|'s child frames with a query to ensure the - // urls are not identical, since outside of document.open() we refuse to - // navigate an iframe to its parent's url. content::RenderFrameHost* vanilla_child_of_vanilla = CreateSrcFrame( - vanilla_frame_with_aborted_load, GetURL("frame_factory.html?1")); + vanilla_frame_with_aborted_load, GetURL("frame_factory.html")); EXPECT_FALSE( observer.GetIsAdSubframe(vanilla_child_of_vanilla->GetFrameTreeNodeId())); content::RenderFrameHost* ad_child_of_vanilla = CreateSrcFrameFromAdScript( - vanilla_frame_with_aborted_load, GetURL("frame_factory.html?2")); + vanilla_frame_with_aborted_load, GetURL("frame_factory.html")); EXPECT_TRUE( observer.GetIsAdSubframe(ad_child_of_vanilla->GetFrameTreeNodeId())); ExpectFrameAdEvidence( @@ -703,8 +688,8 @@ /*parent_is_ad=*/false, blink::mojom::FilterListResult::kNotChecked, blink::mojom::FrameCreationStackEvidence::kCreatedByAdScript); - content::RenderFrameHost* vanilla_child_of_ad = CreateSrcFrame( - ad_frame_with_aborted_load, GetURL("frame_factory.html?3")); + content::RenderFrameHost* vanilla_child_of_ad = + CreateSrcFrame(ad_frame_with_aborted_load, GetURL("frame_factory.html")); EXPECT_TRUE( observer.GetIsAdSubframe(vanilla_child_of_ad->GetFrameTreeNodeId())); ExpectFrameAdEvidence( @@ -713,7 +698,7 @@ blink::mojom::FrameCreationStackEvidence::kCreatedByAdScript); content::RenderFrameHost* ad_child_of_ad = CreateSrcFrameFromAdScript( - ad_frame_with_aborted_load, GetURL("frame_factory.html?4")); + ad_frame_with_aborted_load, GetURL("frame_factory.html")); EXPECT_TRUE(observer.GetIsAdSubframe(ad_child_of_ad->GetFrameTreeNodeId())); ExpectFrameAdEvidence( ad_child_of_ad, /*parent_is_ad=*/true,
diff --git a/chrome/browser/task_manager/providers/crosapi/crosapi_task.cc b/chrome/browser/task_manager/providers/crosapi/crosapi_task.cc index 78c5c35..32c1fea 100644 --- a/chrome/browser/task_manager/providers/crosapi/crosapi_task.cc +++ b/chrome/browser/task_manager/providers/crosapi/crosapi_task.cc
@@ -124,10 +124,12 @@ } void CrosapiTask::Activate() { - crosapi::CrosapiManager::Get() - ->crosapi_ash() - ->task_manager_ash() - ->ActivateTask(mojo_task_->task_uuid); + if (crosapi::CrosapiManager::IsInitialized()) { + crosapi::CrosapiManager::Get() + ->crosapi_ash() + ->task_manager_ash() + ->ActivateTask(mojo_task_->task_uuid); + } } void CrosapiTask::Refresh(const base::TimeDelta& update_interval,
diff --git a/chrome/browser/task_manager/providers/crosapi/crosapi_task_provider_ash.cc b/chrome/browser/task_manager/providers/crosapi/crosapi_task_provider_ash.cc index 784767c..fa5bc542 100644 --- a/chrome/browser/task_manager/providers/crosapi/crosapi_task_provider_ash.cc +++ b/chrome/browser/task_manager/providers/crosapi/crosapi_task_provider_ash.cc
@@ -14,6 +14,7 @@ namespace task_manager { CrosapiTaskProviderAsh::CrosapiTaskProviderAsh() { + DCHECK(crosapi::CrosapiManager::IsInitialized()); crosapi::CrosapiManager::Get() ->crosapi_ash() ->task_manager_ash() @@ -21,10 +22,16 @@ } CrosapiTaskProviderAsh::~CrosapiTaskProviderAsh() { - crosapi::CrosapiManager::Get() - ->crosapi_ash() - ->task_manager_ash() - ->RemoveObserver(); + // When user signs out from ash, CrospaiManager instance owned by + // ChromeBrowserMainPartsChromeos is destroyed before TaskManagerImpl + // instance, which is a lazy instance. We should always make sure + // CrosapiManager::IsInitialized before accessing it. + if (crosapi::CrosapiManager::IsInitialized()) { + crosapi::CrosapiManager::Get() + ->crosapi_ash() + ->task_manager_ash() + ->RemoveObserver(); + } } Task* CrosapiTaskProviderAsh::GetTaskOfUrlRequest(int child_id, int route_id) { @@ -73,10 +80,12 @@ refresh_timer_.Stop(); CleanupCachedData(); - crosapi::CrosapiManager::Get() - ->crosapi_ash() - ->task_manager_ash() - ->OnTaskManagerClosed(); + if (crosapi::CrosapiManager::IsInitialized()) { + crosapi::CrosapiManager::Get() + ->crosapi_ash() + ->task_manager_ash() + ->OnTaskManagerClosed(); + } } void CrosapiTaskProviderAsh::OnTaskManagerProviderDisconnected() { @@ -89,6 +98,9 @@ } void CrosapiTaskProviderAsh::GetCrosapiTaskManagerTasks() { + if (!crosapi::CrosapiManager::IsInitialized()) + return; + // Get lacros tasks if there is any task manager provider registered and ash // task manager has been set up to refresh with a valid refresh interval. auto* task_manager_ash =
diff --git a/chrome/browser/task_manager/task_manager_interface.cc b/chrome/browser/task_manager/task_manager_interface.cc index 9747f4c6..3cf82ad 100644 --- a/chrome/browser/task_manager/task_manager_interface.cc +++ b/chrome/browser/task_manager/task_manager_interface.cc
@@ -165,7 +165,8 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) // Set refresh flags of the remote task manager if lacros is enabled. - if (crosapi::browser_util::IsLacrosEnabled()) { + if (crosapi::browser_util::IsLacrosEnabled() && + crosapi::CrosapiManager::IsInitialized()) { crosapi::CrosapiManager::Get() ->crosapi_ash() ->task_manager_ash()
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index a148d4d1..f5330dcc 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -2094,8 +2094,8 @@ "ash/shelf/shelf_spinner_controller.h", "ash/shelf/shelf_spinner_item_controller.cc", "ash/shelf/shelf_spinner_item_controller.h", - "ash/system_tray_client.cc", - "ash/system_tray_client.h", + "ash/system_tray_client_impl.cc", + "ash/system_tray_client_impl.h", "ash/tab_scrubber.cc", "ash/tab_scrubber.h", "ash/tablet_mode_page_behavior.cc", @@ -3935,8 +3935,6 @@ "views/omnibox/omnibox_row_view.h", "views/omnibox/omnibox_suggestion_button_row_view.cc", "views/omnibox/omnibox_suggestion_button_row_view.h", - "views/omnibox/omnibox_tab_switch_button.cc", - "views/omnibox/omnibox_tab_switch_button.h", "views/omnibox/omnibox_text_view.cc", "views/omnibox/omnibox_text_view.h", "views/omnibox/omnibox_view_views.cc",
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index 408516c..6d751b2 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -1437,9 +1437,6 @@ <message name="IDS_DOWNLOAD_LATER_BLUETOOTH_CONNECTION" desc="Bluetooth connection type."> Bluetooth </message> - <message name="IDS_DOWNLOAD_LATER_WIFI_CONNECTION" desc="WIFI connection type."> - Wi-Fi - </message> <message name="IDS_DOWNLOAD_LATER_LARGE_FILE_SUBTITLE" desc="A subtitle in the download later dialog to inform the user about large download file size."> This file is large (<ph name="FILE_SIZE">%1$s<ex>300MB</ex></ph>) </message> @@ -3342,7 +3339,7 @@ New tab </message> <message name="IDS_ACCESSIBILITY_NEW_TAB_PAGE_SECTION_HAS_UNREAD_CONTENT" desc="Content description for the unread content indicator on a New Tab Page section header"> - Unread content + Unread stories ready </message> <message name="IDS_ACCESSIBILITY_NEW_INCOGNITO_TAB_PAGE" desc="Accessibility text to read aloud when the user focuses the new Incognito tab view."> New Incognito tab
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_DOWNLOAD_LATER_WIFI_CONNECTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_DOWNLOAD_LATER_WIFI_CONNECTION.png.sha1 deleted file mode 100644 index 53587f0..0000000 --- a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_DOWNLOAD_LATER_WIFI_CONNECTION.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -fa6438fd638e91c2db60b57b947b24c1ea9e4332 \ No newline at end of file
diff --git a/chrome/browser/ui/app_list/search/app_list_search_browsertest.cc b/chrome/browser/ui/app_list/search/app_list_search_browsertest.cc index 5b77fb4..b9fdea4 100644 --- a/chrome/browser/ui/app_list/search/app_list_search_browsertest.cc +++ b/chrome/browser/ui/app_list/search/app_list_search_browsertest.cc
@@ -14,6 +14,7 @@ #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" +#include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/threading/thread_restrictions.h" #include "chrome/browser/ash/drive/drive_integration_service.h" @@ -27,6 +28,7 @@ #include "chrome/browser/ui/app_list/search/search_controller.h" #include "chrome/browser/ui/app_list/test/chrome_app_list_test_support.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/web_applications/system_web_app_ui_utils.h" #include "chrome/browser/web_applications/components/web_app_id_constants.h" #include "chrome/browser/web_applications/system_web_apps/system_web_app_manager.h" @@ -40,6 +42,7 @@ #include "chromeos/components/help_app_ui/search/search_handler.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_test.h" +#include "content/public/test/test_navigation_observer.h" namespace app_list { @@ -207,8 +210,8 @@ // Add some searchable content to the help app search handler. std::vector<chromeos::help_app::mojom::SearchConceptPtr> search_concepts; auto concept = chromeos::help_app::mojom::SearchConcept::New( - /*id=*/"test-help-app-id", - /*title=*/u"Title of help app result", + /*id=*/"6318213", + /*title=*/u"Fix connection problems", /*main_category=*/u"Help", /*tags=*/std::vector<std::u16string>{u"verycomplicatedsearchquery"}, /*url_path_with_parameters=*/"help/id/test", @@ -237,11 +240,36 @@ result = FindResult("chrome://help-app/help/id/test"); } - EXPECT_EQ(base::UTF16ToASCII(result->title()), "Title of help app result"); + EXPECT_EQ(base::UTF16ToASCII(result->title()), "Fix connection problems"); EXPECT_EQ(base::UTF16ToASCII(result->details()), "Help"); // No priority for position. EXPECT_EQ(result->position_priority(), 0); EXPECT_EQ(result->display_type(), DisplayType::kList); + + // Open the search result. This should open the help app at the expected url + // and log a metric indicating what content was launched. + const size_t num_browsers = chrome::GetTotalBrowserCount(); + const GURL expected_url("chrome://help-app/help/id/test"); + content::TestNavigationObserver navigation_observer(expected_url); + navigation_observer.StartWatchingNewWebContents(); + base::HistogramTester histogram_tester; + + GetClient()->OpenSearchResult( + result->id(), /*event_flags=*/0, + ash::AppListLaunchedFrom::kLaunchedFromSearchBox, + ash::AppListLaunchType::kAppSearchResult, /*suggestion_index=*/0, + /*launch_as_default=*/false); + navigation_observer.Wait(); + + EXPECT_EQ(num_browsers + 1, chrome::GetTotalBrowserCount()); + EXPECT_EQ(expected_url, chrome::FindLastActive() + ->tab_strip_model() + ->GetActiveWebContents() + ->GetVisibleURL()); + // -20424143 is the hash of the content id. This hash value can be found in + // the enum in the google-internal histogram file. + histogram_tester.ExpectUniqueSample("Discover.LauncherSearch.ContentLaunched", + -20424143, 1); } // Test that Help App shows up normally even when suggestion chip should show.
diff --git a/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider.cc b/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider.cc index 51caf40..33f44028 100644 --- a/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider.cc +++ b/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider.cc
@@ -61,14 +61,6 @@ if (!result.label || result.label->empty()) return true; - // The result doesn't have a valid formatted price. - if (!result.formatted_price || result.formatted_price->empty()) - return true; - - // The result doesn't have a valid review score. - if (result.review_score < 0) - return true; - // The result doesn't have a valid launcher icon. // // TODO(crbug.com/1083331): Remove the checking result.icon_png_data.empty(), @@ -88,6 +80,7 @@ return false; } + } // namespace namespace app_list { @@ -137,10 +130,21 @@ arc::ArcPlayStoreSearchRequestState state, std::vector<arc::mojom::AppDiscoveryResultPtr> results) { if (state != arc::ArcPlayStoreSearchRequestState::SUCCESS) { - DCHECK(results.empty()); + DCHECK( + state == + arc::ArcPlayStoreSearchRequestState::PHONESKY_RESULT_INVALID_DATA || + results.empty()); UMA_HISTOGRAM_ENUMERATION(kAppListPlayStoreQueryStateHistogram, state, arc::ArcPlayStoreSearchRequestState::STATE_COUNT); - return; + + // PHONESKY_RESULT_INVALID_DATA indicates that at least one of the apps + // returned from playstore was invalid. The returned data may still contain + // valid results - display them in the UI if that's the case. + if (state != + arc::ArcPlayStoreSearchRequestState::PHONESKY_RESULT_INVALID_DATA || + results.empty()) { + return; + } } // Play store could have a long latency that when the results come back, @@ -156,13 +160,11 @@ SearchProvider::Results new_results; size_t instant_app_count = 0; + bool has_invalid_result = false; for (auto& result : results) { if (IsInvalidResult(*result)) { - UMA_HISTOGRAM_ENUMERATION( - kAppListPlayStoreQueryStateHistogram, - arc::ArcPlayStoreSearchRequestState::CHROME_GOT_INVALID_RESULT, - arc::ArcPlayStoreSearchRequestState::STATE_COUNT); - return; + has_invalid_result = true; + continue; } if (result->is_instant_app) @@ -177,9 +179,20 @@ SwapResults(&new_results); // Record user metrics. - UMA_HISTOGRAM_ENUMERATION(kAppListPlayStoreQueryStateHistogram, - arc::ArcPlayStoreSearchRequestState::SUCCESS, - arc::ArcPlayStoreSearchRequestState::STATE_COUNT); + if (state == arc::ArcPlayStoreSearchRequestState::SUCCESS) { + if (has_invalid_result) { + UMA_HISTOGRAM_ENUMERATION( + kAppListPlayStoreQueryStateHistogram, + arc::ArcPlayStoreSearchRequestState::CHROME_GOT_INVALID_RESULT, + arc::ArcPlayStoreSearchRequestState::STATE_COUNT); + } else { + UMA_HISTOGRAM_ENUMERATION( + kAppListPlayStoreQueryStateHistogram, + arc::ArcPlayStoreSearchRequestState::SUCCESS, + arc::ArcPlayStoreSearchRequestState::STATE_COUNT); + } + } + UMA_HISTOGRAM_TIMES("Arc.PlayStoreSearch.QueryTime", base::TimeTicks::Now() - query_start_time); if (results.size() > 0) {
diff --git a/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider_unittest.cc b/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider_unittest.cc index b659af0..fc9108a4 100644 --- a/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider_unittest.cc +++ b/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider_unittest.cc
@@ -99,6 +99,122 @@ : ash::AppListSearchResultType::kPlayStoreApp); } } +// Tests that provider reports valid results if the app instance responds with a +// non empty result list and PHONESKY_RESULT_INVALID_DATA status code (which can +// happen if the Play Store returns a list of results that contains some invalid +// items). +TEST_F(ArcPlayStoreSearchProviderTest, PartiallyFailedQuery) { + constexpr size_t kMaxResults = 12; + + std::unique_ptr<ArcPlayStoreSearchProvider> provider = + CreateSearch(kMaxResults); + EXPECT_TRUE(provider->results().empty()); + arc::IconDecodeRequest::DisableSafeDecodingForTesting(); + + AddExtension(CreateExtension(extension_misc::kGmailAppId).get()); + + const std::string kQuery = base::StringPrintf( + "PartiallyFailedQueryWithCode-%d", + arc::ArcPlayStoreSearchRequestState::PHONESKY_RESULT_INVALID_DATA); + + provider->Start(base::UTF8ToUTF16(kQuery)); + + const SearchProvider::Results& results = provider->results(); + ASSERT_GT(results.size(), 0u); + // Play Store returns |kMaxResults / 2| results, but the first one (GMail) + // already has Chrome extension installed, so it will be skipped. + ASSERT_EQ(kMaxResults / 2 - 1, results.size()); + + // Check that information is correctly set in each result. + for (size_t i = 0; i < results.size(); ++i) { + SCOPED_TRACE(base::StringPrintf("Testing result %zu", i)); + EXPECT_EQ(base::UTF16ToUTF8(results[i]->title()), + base::StringPrintf("%s %zu", kQuery.c_str(), i)); + EXPECT_EQ(results[i]->display_type(), ash::SearchResultDisplayType::kTile); + EXPECT_EQ(base::UTF16ToUTF8(results[i]->formatted_price()), + base::StringPrintf("$%zu.22", i)); + EXPECT_EQ(results[i]->rating(), i); + const bool is_instant_app = i % 2 == 0; + EXPECT_EQ(results[i]->result_type(), + is_instant_app ? ash::AppListSearchResultType::kInstantApp + : ash::AppListSearchResultType::kPlayStoreApp); + } +} + +// Tests that the search provider can handle Play Store suggestions without +// rating and formatted price. +TEST_F(ArcPlayStoreSearchProviderTest, ResultsWithoutPriceAndRating) { + constexpr size_t kMaxResults = 12; + + std::unique_ptr<ArcPlayStoreSearchProvider> provider = + CreateSearch(kMaxResults); + EXPECT_TRUE(provider->results().empty()); + arc::IconDecodeRequest::DisableSafeDecodingForTesting(); + + AddExtension(CreateExtension(extension_misc::kGmailAppId).get()); + + const std::string kQuery = "QueryWithoutRatingAndPrice"; + + provider->Start(base::UTF8ToUTF16(kQuery)); + + const SearchProvider::Results& results = provider->results(); + ASSERT_GT(results.size(), 0u); + // Play Store returns |kMaxResults| results, but the first one (GMail) already + // has Chrome extension installed, so it will be skipped. + ASSERT_EQ(kMaxResults - 1, results.size()); + + // Check that information is correctly set in each result. + for (size_t i = 0; i < results.size(); ++i) { + SCOPED_TRACE(base::StringPrintf("Testing result %zu", i)); + EXPECT_EQ(base::UTF16ToUTF8(results[i]->title()), + base::StringPrintf("%s %zu", kQuery.c_str(), i)); + EXPECT_EQ(results[i]->display_type(), ash::SearchResultDisplayType::kTile); + EXPECT_EQ(base::UTF16ToUTF8(results[i]->formatted_price()), ""); + EXPECT_EQ(results[i]->rating(), -1); + const bool is_instant_app = i % 2 == 0; + EXPECT_EQ(results[i]->result_type(), + is_instant_app ? ash::AppListSearchResultType::kInstantApp + : ash::AppListSearchResultType::kPlayStoreApp); + } +} + +// Tests that results without icon are ignored. +TEST_F(ArcPlayStoreSearchProviderTest, IgnoreResultsWithoutIcon) { + constexpr size_t kMaxResults = 12; + + std::unique_ptr<ArcPlayStoreSearchProvider> provider = + CreateSearch(kMaxResults); + EXPECT_TRUE(provider->results().empty()); + arc::IconDecodeRequest::DisableSafeDecodingForTesting(); + + AddExtension(CreateExtension(extension_misc::kGmailAppId).get()); + + const std::string kQuery = "QueryWithSomeResultsMissingIcon"; + + provider->Start(base::UTF8ToUTF16(kQuery)); + + const SearchProvider::Results& results = provider->results(); + ASSERT_GT(results.size(), 0u); + // Play Store returns |kMaxResults| results, but the first one (GMail) already + // has Chrome extension installed, so it will be skipped, and items after + // kMaxResults / 2 are missing the icon and are expected to be ignored. + ASSERT_EQ(kMaxResults / 2, results.size()); + + // Check that information is correctly set in each result. + for (size_t i = 0; i < results.size(); ++i) { + SCOPED_TRACE(base::StringPrintf("Testing result %zu", i)); + EXPECT_EQ(base::UTF16ToUTF8(results[i]->title()), + base::StringPrintf("%s %zu", kQuery.c_str(), i)); + EXPECT_EQ(results[i]->display_type(), ash::SearchResultDisplayType::kTile); + EXPECT_EQ(base::UTF16ToUTF8(results[i]->formatted_price()), + base::StringPrintf("$%zu.22", i)); + EXPECT_EQ(results[i]->rating(), i); + const bool is_instant_app = i % 2 == 0; + EXPECT_EQ(results[i]->result_type(), + is_instant_app ? ash::AppListSearchResultType::kInstantApp + : ash::AppListSearchResultType::kPlayStoreApp); + } +} TEST_F(ArcPlayStoreSearchProviderTest, FailedQuery) { constexpr size_t kMaxResults = 12; @@ -153,4 +269,5 @@ EXPECT_EQ(0u, provider->results().size()); } } + } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/help_app_provider.cc b/chrome/browser/ui/app_list/search/help_app_provider.cc index 715ba680..55c5e32e 100644 --- a/chrome/browser/ui/app_list/search/help_app_provider.cc +++ b/chrome/browser/ui/app_list/search/help_app_provider.cc
@@ -87,7 +87,7 @@ } // namespace HelpAppResult::HelpAppResult(Profile* profile, const gfx::ImageSkia& icon) - : profile_(profile) { + : profile_(profile), url_path_(""), help_app_content_id_("") { DCHECK(profile_); set_id(kHelpAppUpdatesResult); SetTitle(l10n_util::GetStringUTF16(IDS_HELP_APP_WHATS_NEW_SUGGESTION_CHIP)); @@ -107,7 +107,9 @@ const chromeos::help_app::mojom::SearchResultPtr& result, const gfx::ImageSkia& icon, const std::u16string& query) - : profile_(profile), url_path_(result->url_path_with_parameters) { + : profile_(profile), + url_path_(result->url_path_with_parameters), + help_app_content_id_(result->id) { DCHECK(profile_); set_id(chromeos::kChromeUIHelpAppURL + url_path_); set_relevance(relevance); @@ -148,6 +150,10 @@ web_app::LaunchSystemWebAppAsync( profile_, web_app::SystemAppType::HELP, params, apps::MakeWindowInfo(display::kDefaultDisplayId)); + // This is a google-internal histogram. If changing this, also change the + // corresponding histograms file. + base::UmaHistogramSparse("Discover.LauncherSearch.ContentLaunched", + base::PersistentHash(help_app_content_id_)); } HelpAppProvider::HelpAppProvider(Profile* profile)
diff --git a/chrome/browser/ui/app_list/search/help_app_provider.h b/chrome/browser/ui/app_list/search/help_app_provider.h index 5dabe52..720639a 100644 --- a/chrome/browser/ui/app_list/search/help_app_provider.h +++ b/chrome/browser/ui/app_list/search/help_app_provider.h
@@ -60,6 +60,7 @@ private: Profile* const profile_; const std::string url_path_; + const std::string help_app_content_id_; }; // Provides results from the Help App based on the search query. Also provides
diff --git a/chrome/browser/ui/app_list/search/omnibox_provider.cc b/chrome/browser/ui/app_list/search/omnibox_provider.cc index 505a61cde..9eec132 100644 --- a/chrome/browser/ui/app_list/search/omnibox_provider.cc +++ b/chrome/browser/ui/app_list/search/omnibox_provider.cc
@@ -9,10 +9,13 @@ #include "base/metrics/histogram_macros.h" #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" +#include "chrome/browser/favicon/favicon_service_factory.h" +#include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" #include "chrome/browser/ui/app_list/search/omnibox_result.h" +#include "components/favicon/core/favicon_service.h" #include "components/omnibox/browser/autocomplete_classifier.h" #include "components/omnibox/browser/autocomplete_input.h" #include "components/search_engines/omnibox_focus_type.h" @@ -44,7 +47,13 @@ list_controller_(list_controller), controller_(std::make_unique<AutocompleteController>( std::make_unique<ChromeAutocompleteProviderClient>(profile), - ProviderTypes())) { + ProviderTypes())), + favicon_cache_(FaviconServiceFactory::GetForProfile( + profile, + ServiceAccessType::EXPLICIT_ACCESS), + HistoryServiceFactory::GetForProfile( + profile, + ServiceAccessType::EXPLICIT_ACCESS)) { controller_->AddObserver(this); if (base::FeatureList::IsEnabled( app_list_features::kEnableLauncherSearchNormalization)) { @@ -86,17 +95,19 @@ for (const AutocompleteMatch& match : result) { // Do not return a match in any of these cases: // - The URL is invalid. - // - The URL points to Drive Web. The LauncherSearchProvider surfaces Drive - // results. - // - The URL points to a local file. The LauncherSearchProvider also handles - // files results, even if they've been opened in the browser. + // - The URL points to Drive Web. The Drive search and zero-state + // providers surface Drive results. + // - The URL points to a local file. The Local file search and zero-state + // providers handle local file results, even if they've been opened in + // the browser. if (!match.destination_url.is_valid() || IsDriveUrl(match.destination_url) || match.destination_url.SchemeIsFile()) { continue; } + new_results.emplace_back(std::make_unique<OmniboxResult>( - profile_, list_controller_, controller_.get(), match, + profile_, list_controller_, controller_.get(), &favicon_cache_, match, is_zero_state_input_)); }
diff --git a/chrome/browser/ui/app_list/search/omnibox_provider.h b/chrome/browser/ui/app_list/search/omnibox_provider.h index 2cf5281..aa9811d 100644 --- a/chrome/browser/ui/app_list/search/omnibox_provider.h +++ b/chrome/browser/ui/app_list/search/omnibox_provider.h
@@ -12,6 +12,7 @@ #include "chrome/browser/ui/app_list/search/score_normalizer/score_normalizer.h" #include "chrome/browser/ui/app_list/search/search_provider.h" #include "components/omnibox/browser/autocomplete_controller.h" +#include "components/omnibox/browser/favicon_cache.h" class AppListControllerDelegate; class AutocompleteController; @@ -52,6 +53,8 @@ // eliminates the results as they come in. std::unique_ptr<AutocompleteController> controller_; + FaviconCache favicon_cache_; + // The normalizer normalizes the relevance scores of Results base::Optional<ScoreNormalizer> normalizer_;
diff --git a/chrome/browser/ui/app_list/search/omnibox_result.cc b/chrome/browser/ui/app_list/search/omnibox_result.cc index 4f5e0bd..1074abc 100644 --- a/chrome/browser/ui/app_list/search/omnibox_result.cc +++ b/chrome/browser/ui/app_list/search/omnibox_result.cc
@@ -24,6 +24,7 @@ #include "components/bookmarks/browser/bookmark_model.h" #include "components/omnibox/browser/autocomplete_controller.h" #include "components/omnibox/browser/autocomplete_match_type.h" +#include "components/omnibox/browser/favicon_cache.h" #include "components/omnibox/browser/vector_icons.h" #include "components/search_engines/util.h" #include "extensions/common/image_util.h" @@ -69,8 +70,15 @@ "publicly available image." })"); -// AutocompleteMatchType::Type to vector icon, used for app list. -const gfx::VectorIcon& TypeToVectorIcon(AutocompleteMatchType::Type type) { +// Types of generic icon to show with a result. +enum class IconType { + kDomainIcon, + kSearchIcon, + kHistoryIcon, + kEqualIcon, +}; + +const IconType MatchTypeToIconType(AutocompleteMatchType::Type type) { switch (type) { case AutocompleteMatchType::URL_WHAT_YOU_TYPED: case AutocompleteMatchType::HISTORY_URL: @@ -86,7 +94,7 @@ case AutocompleteMatchType::TAB_SEARCH_DEPRECATED: case AutocompleteMatchType::DOCUMENT_SUGGESTION: case AutocompleteMatchType::PEDAL: - return ash::kDomainIcon; + return IconType::kDomainIcon; case AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED: case AutocompleteMatchType::SEARCH_SUGGEST: @@ -98,24 +106,36 @@ case AutocompleteMatchType::VOICE_SUGGEST: case AutocompleteMatchType::CLIPBOARD_TEXT: case AutocompleteMatchType::CLIPBOARD_IMAGE: - return ash::kSearchIcon; + return IconType::kSearchIcon; case AutocompleteMatchType::SEARCH_HISTORY: case AutocompleteMatchType::SEARCH_SUGGEST_PERSONALIZED: - return ash::kHistoryIcon; + return IconType::kHistoryIcon; case AutocompleteMatchType::CALCULATOR: - return ash::kEqualIcon; + return IconType::kEqualIcon; case AutocompleteMatchType::EXTENSION_APP_DEPRECATED: case AutocompleteMatchType::TILE_SUGGESTION: case AutocompleteMatchType::TILE_NAVSUGGEST: case AutocompleteMatchType::NUM_TYPES: NOTREACHED(); - break; + return IconType::kDomainIcon; } - NOTREACHED(); - return ash::kDomainIcon; +} + +// AutocompleteMatchType::Type to vector icon, used for app list. +const gfx::VectorIcon& TypeToVectorIcon(AutocompleteMatchType::Type type) { + switch (MatchTypeToIconType(type)) { + case IconType::kDomainIcon: + return ash::kDomainIcon; + case IconType::kSearchIcon: + return ash::kSearchIcon; + case IconType::kHistoryIcon: + return ash::kHistoryIcon; + case IconType::kEqualIcon: + return ash::kEqualIcon; + } } // Converts AutocompleteMatchType::Type to an answer vector icon. @@ -176,11 +196,13 @@ OmniboxResult::OmniboxResult(Profile* profile, AppListControllerDelegate* list_controller, AutocompleteController* autocomplete_controller, + FaviconCache* favicon_cache, const AutocompleteMatch& match, bool is_zero_suggestion) : profile_(profile), list_controller_(list_controller), autocomplete_controller_(autocomplete_controller), + favicon_cache_(favicon_cache), match_(match), is_zero_suggestion_(is_zero_suggestion) { if (match_.search_terms_args && autocomplete_controller_) { @@ -223,6 +245,7 @@ if (AutocompleteMatch::IsSearchType(match_.type)) SetIsOmniboxSearch(true); + UpdateIcon(); UpdateTitleAndDetails(); @@ -327,6 +350,9 @@ } void OmniboxResult::UpdateIcon() { + // TODO(crbug.com/1201151): Refactor this method once we've decided whether or + // not to use favicons for bookmarks. + if (app_list_features::IsOmniboxRichEntitiesEnabled() && IsRichEntityResult()) { // Determine if we have a local icon. Calculator and non-weather answer @@ -347,6 +373,20 @@ FetchRichEntityImage(match_.image_url); } } else { + if (favicon_cache_ && + MatchTypeToIconType(match_.type) == IconType::kDomainIcon) { + // If we have a favicon available for this URL, use it. Otherwise fall + // back on using a generic icon. + const auto icon = favicon_cache_->GetFaviconForPageUrl( + match_.destination_url, + base::BindOnce(&OmniboxResult::OnFaviconFetched, + weak_factory_.GetWeakPtr())); + if (!icon.IsEmpty()) { + SetIcon(icon.AsImageSkia()); + return; + } + } + BookmarkModel* bookmark_model = BookmarkModelFactory::GetForBrowserContext(profile_); bool is_bookmarked = @@ -437,6 +477,12 @@ bitmap_fetcher_->Start(profile_->GetURLLoaderFactory().get()); } +void OmniboxResult::OnFaviconFetched(const gfx::Image& icon) { + // By contract, this is never called with an empty |icon|. + DCHECK(!icon.IsEmpty()); + SetIcon(icon.AsImageSkia()); +} + void OmniboxResult::SetZeroSuggestionActions() { Actions zero_suggestion_actions;
diff --git a/chrome/browser/ui/app_list/search/omnibox_result.h b/chrome/browser/ui/app_list/search/omnibox_result.h index fb80208..6e95902 100644 --- a/chrome/browser/ui/app_list/search/omnibox_result.h +++ b/chrome/browser/ui/app_list/search/omnibox_result.h
@@ -9,6 +9,7 @@ #include "ash/public/cpp/app_list/app_list_metrics.h" #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_delegate.h" #include "chrome/browser/ui/app_list/search/chrome_search_result.h" #include "components/omnibox/browser/autocomplete_match.h" @@ -16,6 +17,7 @@ class AppListControllerDelegate; class AutocompleteController; +class FaviconCache; class BitmapFetcher; class Profile; @@ -35,10 +37,14 @@ OmniboxResult(Profile* profile, AppListControllerDelegate* list_controller, AutocompleteController* autocomplete_controller, + FaviconCache* favicon_cache, const AutocompleteMatch& match, bool is_zero_suggestion); ~OmniboxResult() override; + OmniboxResult(const OmniboxResult&) = delete; + OmniboxResult& operator=(const OmniboxResult&) = delete; + // ChromeSearchResult: void Open(int event_flags) override; void InvokeAction(int action_index) override; @@ -62,6 +68,8 @@ bool IsRichEntityResult() const; void FetchRichEntityImage(const GURL& url); + void OnFaviconFetched(const gfx::Image& icon); + void SetZeroSuggestionActions(); void RecordOmniboxResultHistogram(); @@ -71,11 +79,12 @@ Profile* profile_; AppListControllerDelegate* list_controller_; AutocompleteController* autocomplete_controller_; + FaviconCache* favicon_cache_; AutocompleteMatch match_; const bool is_zero_suggestion_; std::unique_ptr<BitmapFetcher> bitmap_fetcher_; - DISALLOW_COPY_AND_ASSIGN(OmniboxResult); + base::WeakPtrFactory<OmniboxResult> weak_factory_{this}; }; } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/search_result_ranker/ranking_item_util_unittest.cc b/chrome/browser/ui/app_list/search/search_result_ranker/ranking_item_util_unittest.cc index e44a413..eb60067 100644 --- a/chrome/browser/ui/app_list/search/search_result_ranker/ranking_item_util_unittest.cc +++ b/chrome/browser/ui/app_list/search/search_result_ranker/ranking_item_util_unittest.cc
@@ -49,7 +49,7 @@ match.type = type; return std::make_unique<OmniboxResult>(profile_.get(), app_list_controller_delegate_.get(), - nullptr, match, false); + nullptr, nullptr, match, false); } private:
diff --git a/chrome/browser/ui/app_list/search/tests/omnibox_result_unittest.cc b/chrome/browser/ui/app_list/search/tests/omnibox_result_unittest.cc index 0aaf5f7..8dfccc5 100644 --- a/chrome/browser/ui/app_list/search/tests/omnibox_result_unittest.cc +++ b/chrome/browser/ui/app_list/search/tests/omnibox_result_unittest.cc
@@ -65,7 +65,7 @@ return std::make_unique<OmniboxResult>(profile_.get(), app_list_controller_delegate_.get(), - nullptr, match, false); + nullptr, nullptr, match, false); } const GURL& GetLastOpenedUrl() const {
diff --git a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc index 522bbf8..d45e56c 100644 --- a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc +++ b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.cc
@@ -47,7 +47,7 @@ #include "chrome/browser/ui/ash/session_controller_client_impl.h" #include "chrome/browser/ui/ash/shelf/app_service/exo_app_type_resolver.h" #include "chrome/browser/ui/ash/shelf/chrome_shelf_controller.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/ash/tab_scrubber.h" #include "chrome/browser/ui/ash/tablet_mode_page_behavior.h" #include "chrome/browser/ui/ash/vpn_list_forwarder.h" @@ -179,7 +179,7 @@ session_controller_client_ = std::make_unique<SessionControllerClientImpl>(); session_controller_client_->Init(); - system_tray_client_ = std::make_unique<SystemTrayClient>(); + system_tray_client_ = std::make_unique<SystemTrayClientImpl>(); network_connect_delegate_->SetSystemTrayClient(system_tray_client_.get()); tablet_mode_page_behavior_ = std::make_unique<TabletModePageBehavior>();
diff --git a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.h b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.h index 0db5b9a0..0916cfa 100644 --- a/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.h +++ b/chrome/browser/ui/ash/chrome_browser_main_extra_parts_ash.h
@@ -38,7 +38,7 @@ class QuickAnswersBrowserClientImpl; class ScreenOrientationDelegateChromeos; class SessionControllerClientImpl; -class SystemTrayClient; +class SystemTrayClientImpl; class TabletModePageBehavior; class VpnListForwarder; class WallpaperControllerClientImpl; @@ -91,7 +91,7 @@ std::unique_ptr<ScreenOrientationDelegateChromeos> screen_orientation_delegate_; std::unique_ptr<SessionControllerClientImpl> session_controller_client_; - std::unique_ptr<SystemTrayClient> system_tray_client_; + std::unique_ptr<SystemTrayClientImpl> system_tray_client_; std::unique_ptr<TabletModePageBehavior> tablet_mode_page_behavior_; std::unique_ptr<VpnListForwarder> vpn_list_forwarder_; std::unique_ptr<WallpaperControllerClientImpl> wallpaper_controller_client_;
diff --git a/chrome/browser/ui/ash/chrome_new_window_client.cc b/chrome/browser/ui/ash/chrome_new_window_client.cc index 9f5112f..401f5bd 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client.cc +++ b/chrome/browser/ui/ash/chrome_new_window_client.cc
@@ -355,6 +355,29 @@ : profile); } +void ChromeNewWindowClient::OpenCalculator() { + Profile* const profile = ProfileManager::GetActiveUserProfile(); + const extensions::ExtensionRegistry* registry = + extensions::ExtensionRegistry::Get(profile); + if (!registry) + return; + + const extensions::Extension* extension = + registry->GetInstalledExtension(extension_misc::kCalculatorAppId); + if (!extension) + return; + + auto url = GURL(extensions::Extension::GetBaseURLFromExtensionId( + extension_misc::kCalculatorAppId) + .spec()); + apps::LaunchPlatformAppWithUrl(profile, extension, + /*handler_id=*/std::string(), url, + /*referrer_url=*/GURL()); + + apps::RecordAppLaunch(extension_misc::kCalculatorAppId, + apps::mojom::LaunchSource::kFromKeyboard); +} + void ChromeNewWindowClient::OpenFileManager() { Profile* const profile = ProfileManager::GetActiveUserProfile(); apps::AppServiceProxyChromeOs* proxy =
diff --git a/chrome/browser/ui/ash/chrome_new_window_client.h b/chrome/browser/ui/ash/chrome_new_window_client.h index 92e18a0..12da55e 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client.h +++ b/chrome/browser/ui/ash/chrome_new_window_client.h
@@ -40,6 +40,7 @@ void NewTab() override; void NewTabWithUrl(const GURL& url, bool from_user_interaction) override; void NewWindow(bool incognito) override; + void OpenCalculator() override; void OpenFileManager() override; void OpenDownloadsFolder() override; void OpenCrosh() override;
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc index 6c5b0ad5..70d89ddc 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -10,9 +10,12 @@ #include "ash/public/cpp/ash_features.h" #include "ash/screenshot_delegate.h" #include "base/bind.h" +#include "base/command_line.h" #include "cc/input/touch_action.h" +#include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part_chromeos.h" +#include "chrome/browser/chromeos/file_manager/path_util.h" #include "chrome/browser/chromeos/multidevice_setup/multidevice_setup_service_factory.h" #include "chrome/browser/nearby_sharing/nearby_share_delegate_impl.h" #include "chrome/browser/profiles/profile.h" @@ -37,8 +40,10 @@ #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/webui/tab_strip/tab_strip_ui_util.h" +#include "chrome/common/chrome_switches.h" #include "chromeos/services/multidevice_setup/multidevice_setup_service.h" #include "components/ui_devtools/devtools_server.h" +#include "components/user_manager/user_manager.h" #include "content/public/browser/device_service.h" #include "content/public/browser/media_session_service.h" #include "content/public/browser/render_widget_host.h" @@ -51,6 +56,10 @@ const char kKeyboardShortcutHelpPageUrl[] = "https://support.google.com/chromebook/answer/183101"; +// Browser tests are always started with --disable-logging-redirect, so we need +// independent option here. +base::Optional<bool> disable_logging_redirect_for_testing; + content::WebContents* GetActiveWebContentsForNativeBrowserWindow( gfx::NativeWindow window) { if (!window) @@ -234,3 +243,35 @@ ->GetUiDevToolsServerInstance() ->port(); } + +bool ChromeShellDelegate::IsLoggingRedirectDisabled() const { + if (disable_logging_redirect_for_testing.has_value()) + return disable_logging_redirect_for_testing.value(); + + return base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableLoggingRedirect); +} + +base::FilePath ChromeShellDelegate::GetPrimaryUserDownloadsFolder() const { + const user_manager::User* primary_user = + user_manager::UserManager::Get()->GetPrimaryUser(); + if (!primary_user) + return base::FilePath(); + + Profile* user_profile = ash::ProfileHelper::Get()->GetProfileByUser( + user_manager::UserManager::Get()->GetPrimaryUser()); + if (user_profile) + return file_manager::util::GetDownloadsFolderForProfile(user_profile); + + return base::FilePath(); +} + +// static +void ChromeShellDelegate::SetDisableLoggingRedirectForTesting(bool value) { + disable_logging_redirect_for_testing = value; +} + +// static +void ChromeShellDelegate::ResetDisableLoggingRedirectForTesting() { + disable_logging_redirect_for_testing.reset(); +}
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.h b/chrome/browser/ui/ash/chrome_shell_delegate.h index eb88387..e43b7e4 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.h +++ b/chrome/browser/ui/ash/chrome_shell_delegate.h
@@ -50,6 +50,11 @@ void StartUiDevTools() override; void StopUiDevTools() override; int GetUiDevToolsPort() const override; + bool IsLoggingRedirectDisabled() const override; + base::FilePath GetPrimaryUserDownloadsFolder() const override; + + static void SetDisableLoggingRedirectForTesting(bool value); + static void ResetDisableLoggingRedirectForTesting(); private: DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate);
diff --git a/chrome/browser/ui/ash/crosapi_new_window_delegate.cc b/chrome/browser/ui/ash/crosapi_new_window_delegate.cc index 000cfeee..157fc21 100644 --- a/chrome/browser/ui/ash/crosapi_new_window_delegate.cc +++ b/chrome/browser/ui/ash/crosapi_new_window_delegate.cc
@@ -31,6 +31,10 @@ crosapi::BrowserManager::Get()->NewWindow(incognito); } +void CrosapiNewWindowDelegate::OpenCalculator() { + delegate_->OpenCalculator(); +} + void CrosapiNewWindowDelegate::OpenFileManager() { delegate_->OpenFileManager(); }
diff --git a/chrome/browser/ui/ash/crosapi_new_window_delegate.h b/chrome/browser/ui/ash/crosapi_new_window_delegate.h index 03d38a67..51879317 100644 --- a/chrome/browser/ui/ash/crosapi_new_window_delegate.h +++ b/chrome/browser/ui/ash/crosapi_new_window_delegate.h
@@ -24,6 +24,7 @@ void NewTab() override; void NewTabWithUrl(const GURL& url, bool from_user_interaction) override; void NewWindow(bool incognito) override; + void OpenCalculator() override; void OpenFileManager() override; void OpenDownloadsFolder() override; void OpenCrosh() override;
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 39ff7d9..574b5c2 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
@@ -673,6 +673,9 @@ Show(); ASSERT_TRUE(IsShowing()); + // Let the message loop run so that resize of status tray takes effect. + base::RunLoop().RunUntilIdle(); + std::vector<views::View*> download_chips = GetDownloadChips(); ASSERT_EQ(1u, download_chips.size()); @@ -730,6 +733,9 @@ AddDownloadFile(); ASSERT_TRUE(IsShowingInShelf()); + // Let the message loop run so that resize of status tray takes effect. + base::RunLoop().RunUntilIdle(); + // Bind an observer to watch for updates to the holding space model. testing::NiceMock<MockHoldingSpaceModelObserver> mock; base::ScopedObservation<HoldingSpaceModel, HoldingSpaceModelObserver>
diff --git a/chrome/browser/ui/ash/keyboard_shortcut_viewer_metadata_unittest.cc b/chrome/browser/ui/ash/keyboard_shortcut_viewer_metadata_unittest.cc index a0dfc2a..cbad6d0 100644 --- a/chrome/browser/ui/ash/keyboard_shortcut_viewer_metadata_unittest.cc +++ b/chrome/browser/ui/ash/keyboard_shortcut_viewer_metadata_unittest.cc
@@ -23,9 +23,9 @@ namespace { // The total number of Ash accelerators. -constexpr int kAshAcceleratorsTotalNum = 121; +constexpr int kAshAcceleratorsTotalNum = 122; // The hash of Ash accelerators. -constexpr char kAshAcceleratorsHash[] = "744321abddda944c29ece261a2f6c08d"; +constexpr char kAshAcceleratorsHash[] = "d98f8f70fdb27653e43fca2cafeee1ca"; #if BUILDFLAG(GOOGLE_CHROME_BRANDING) // Internal builds add an extra accelerator for the Feedback app. // The total number of Chrome accelerators (available on Chrome OS).
diff --git a/chrome/browser/ui/ash/network/mobile_data_notifications.cc b/chrome/browser/ui/ash/network/mobile_data_notifications.cc index 889f359..d7605372 100644 --- a/chrome/browser/ui/ash/network/mobile_data_notifications.cc +++ b/chrome/browser/ui/ash/network/mobile_data_notifications.cc
@@ -13,7 +13,7 @@ #include "chrome/browser/notifications/system_notification_helper.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "chromeos/login/login_state/login_state.h" @@ -39,7 +39,7 @@ const char kNotifierMobileData[] = "ash.mobile-data"; void MobileDataNotificationClicked(const std::string& network_id) { - SystemTrayClient::Get()->ShowNetworkSettings(network_id); + SystemTrayClientImpl::Get()->ShowNetworkSettings(network_id); } constexpr int kNotificationCheckDelayInSeconds = 2;
diff --git a/chrome/browser/ui/ash/network/mobile_data_notifications_unittest.cc b/chrome/browser/ui/ash/network/mobile_data_notifications_unittest.cc index 99e47b40..87398ff 100644 --- a/chrome/browser/ui/ash/network/mobile_data_notifications_unittest.cc +++ b/chrome/browser/ui/ash/network/mobile_data_notifications_unittest.cc
@@ -19,10 +19,10 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile_manager.h" -#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/network/network_connect.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state_handler.h" #include "components/prefs/pref_service.h" #include "components/session_manager/core/session_manager.h" @@ -31,7 +31,6 @@ #include "content/public/test/browser_task_environment.h" #include "third_party/cros_system_api/dbus/service_constants.h" -using chromeos::DBusThreadManager; using chromeos::LoginState; namespace { @@ -71,11 +70,9 @@ void SetUp() override { session_manager_.SetSessionState(session_manager::SessionState::ACTIVE); testing::Test::SetUp(); - DBusThreadManager::Initialize(); SetupUserManagerAndProfileManager(); SetupSystemNotifications(); AddUserAndSetActive(kTestUserName); - chromeos::NetworkHandler::Initialize(); SetupNetworkShillState(); base::RunLoop().RunUntilIdle(); network_connect_delegate_ = std::make_unique<NetworkConnectTestDelegate>(); @@ -87,10 +84,8 @@ mobile_data_notifications_.reset(); chromeos::NetworkConnect::Shutdown(); network_connect_delegate_.reset(); - chromeos::NetworkHandler::Shutdown(); profile_manager_.reset(); user_manager_enabler_.reset(); - DBusThreadManager::Shutdown(); testing::Test::TearDown(); } @@ -117,7 +112,7 @@ // Create a cellular device with provider. chromeos::ShillDeviceClient::TestInterface* device_test = - DBusThreadManager::Get()->GetShillDeviceClient()->GetTestInterface(); + network_handler_test_helper_.device_test(); device_test->ClearDevices(); device_test->AddDevice(kCellularDevicePath, shill::kTypeCellular, "stub_cellular_device1"); @@ -130,7 +125,7 @@ // Create a cellular network and activate it. chromeos::ShillServiceClient::TestInterface* service_test = - DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); + network_handler_test_helper_.service_test(); service_test->ClearServices(); service_test->AddService(kCellularServicePath, kCellularGuid, "cellular1" /* name */, shill::kTypeCellular, @@ -157,6 +152,7 @@ } content::BrowserTaskEnvironment task_environment_; + chromeos::NetworkHandlerTestHelper network_handler_test_helper_; session_manager::SessionManager session_manager_; std::unique_ptr<MobileDataNotifications> mobile_data_notifications_; std::unique_ptr<NetworkConnectTestDelegate> network_connect_delegate_;
diff --git a/chrome/browser/ui/ash/network/network_connect_delegate_chromeos.cc b/chrome/browser/ui/ash/network/network_connect_delegate_chromeos.cc index fc46b23..8b7bbc3 100644 --- a/chrome/browser/ui/ash/network/network_connect_delegate_chromeos.cc +++ b/chrome/browser/ui/ash/network/network_connect_delegate_chromeos.cc
@@ -7,7 +7,7 @@ #include "chrome/browser/ash/login/lock/screen_locker.h" #include "chrome/browser/ui/ash/network/enrollment_dialog_view.h" #include "chrome/browser/ui/ash/network/network_state_notifier.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/webui/chromeos/cellular_setup/cellular_setup_dialog_launcher.h" #include "chrome/browser/ui/webui/chromeos/cellular_setup/mobile_setup_dialog.h" @@ -30,14 +30,14 @@ const std::string& network_id) { if (!IsUIAvailable()) return; - SystemTrayClient::Get()->ShowNetworkConfigure(network_id); + SystemTrayClientImpl::Get()->ShowNetworkConfigure(network_id); } void NetworkConnectDelegateChromeOS::ShowNetworkSettings( const std::string& network_id) { if (!IsUIAvailable()) return; - SystemTrayClient::Get()->ShowNetworkSettings(network_id); + SystemTrayClientImpl::Get()->ShowNetworkSettings(network_id); } bool NetworkConnectDelegateChromeOS::ShowEnrollNetwork(
diff --git a/chrome/browser/ui/ash/network/network_state_notifier.cc b/chrome/browser/ui/ash/network/network_state_notifier.cc index 9e934e3..0f9b468 100644 --- a/chrome/browser/ui/ash/network/network_state_notifier.cc +++ b/chrome/browser/ui/ash/network/network_state_notifier.cc
@@ -7,6 +7,7 @@ #include <string> #include "ash/public/cpp/notification_utils.h" +#include "ash/public/cpp/system_tray_client.h" #include "base/bind.h" #include "base/location.h" #include "base/strings/string_util.h" @@ -14,7 +15,6 @@ #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/chromeos/net/shill_error.h" #include "chrome/browser/notifications/system_notification_helper.h" -#include "chrome/browser/ui/ash/system_tray_client.h" #include "chrome/grit/generated_resources.h" #include "chromeos/network/cellular_esim_profile_handler.h" #include "chromeos/network/network_configuration_handler.h"
diff --git a/chrome/browser/ui/ash/network/network_state_notifier_unittest.cc b/chrome/browser/ui/ash/network/network_state_notifier_unittest.cc index 5a99200e..4ac5a6f1 100644 --- a/chrome/browser/ui/ash/network/network_state_notifier_unittest.cc +++ b/chrome/browser/ui/ash/network/network_state_notifier_unittest.cc
@@ -17,11 +17,11 @@ #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/testing_browser_process.h" #include "chromeos/dbus/hermes/hermes_clients.h" -#include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/network/network_connect.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_test_helper.h" #include "chromeos/network/test_cellular_esim_profile_handler.h" @@ -75,10 +75,9 @@ void SetUp() override { BrowserWithTestWindowTest::SetUp(); - shill_clients::InitializeFakes(); - hermes_clients::InitializeFakes(); + network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>(); + SetupDefaultShillState(); - NetworkHandler::Initialize(); base::RunLoop().RunUntilIdle(); auto notifier = std::make_unique<NetworkStateNotifier>(); @@ -93,8 +92,7 @@ void TearDown() override { NetworkConnect::Shutdown(); network_connect_delegate_.reset(); - NetworkHandler::Shutdown(); - shill_clients::Shutdown(); + network_handler_test_helper_.reset(); BrowserWithTestWindowTest::TearDown(); } @@ -128,11 +126,11 @@ } void SetupDefaultShillState() { ShillDeviceClient::TestInterface* device_test = - ShillDeviceClient::Get()->GetTestInterface(); + network_handler_test_helper_->device_test(); device_test->ClearDevices(); ShillServiceClient::TestInterface* service_test = - ShillServiceClient::Get()->GetTestInterface(); + network_handler_test_helper_->service_test(); service_test->ClearServices(); // Set up Wi-Fi device, and add a single network with a passphrase failure. @@ -187,6 +185,7 @@ HermesManagerClient::TestInterface* hermes_manager_test_; HermesEuiccClient::TestInterface* hermes_euicc_test_; ash::TestSystemTrayClient test_system_tray_client_; + std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_; std::unique_ptr<NetworkConnectTestDelegate> network_connect_delegate_; private:
diff --git a/chrome/browser/ui/ash/projector/projector_client_impl.h b/chrome/browser/ui/ash/projector/projector_client_impl.h index fdee81b..16f6821 100644 --- a/chrome/browser/ui/ash/projector/projector_client_impl.h +++ b/chrome/browser/ui/ash/projector/projector_client_impl.h
@@ -11,6 +11,7 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "chrome/browser/speech/speech_recognizer_delegate.h" +#include "components/soda/constants.h" #include "components/soda/soda_installer.h" class OnDeviceSpeechRecognizer; @@ -42,11 +43,17 @@ void OnSpeechRecognitionStateChanged( SpeechRecognizerStatus new_state) override; - // speech::SodaIntaller::Observer: + // speech::SodaInstaller::Observer: void OnSodaInstalled() override; // We are not utilizing the following methods. Mark them as empty overrides. + void OnSodaLanguagePackInstalled( + speech::LanguageCode language_code) override {} void OnSodaError() override {} - void OnSodaProgress(int progress) override {} + void OnSodaLanguagePackError(speech::LanguageCode language_code) override {} + void OnSodaProgress(int combined_progress) override {} + void OnSodaLanguagePackProgress(int language_progress, + speech::LanguageCode language_code) override { + } private: SpeechRecognizerStatus recognizer_status_ =
diff --git a/chrome/browser/ui/ash/security_token_session_restriction_view.cc b/chrome/browser/ui/ash/security_token_session_restriction_view.cc index e812b26..4d14bc7 100644 --- a/chrome/browser/ui/ash/security_token_session_restriction_view.cc +++ b/chrome/browser/ui/ash/security_token_session_restriction_view.cc
@@ -17,13 +17,13 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/time_format.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_types.h" #include "ui/chromeos/devicetype_utils.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/ash/security_token_session_restriction_view.h b/chrome/browser/ui/ash/security_token_session_restriction_view.h index f249a5a0..04302ec 100644 --- a/chrome/browser/ui/ash/security_token_session_restriction_view.h +++ b/chrome/browser/ui/ash/security_token_session_restriction_view.h
@@ -10,7 +10,7 @@ #include "base/timer/timer.h" #include "chrome/browser/ash/login/security_token_session_controller.h" #include "chrome/browser/ui/views/apps/app_dialog/app_dialog_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" // The dialog informing the user they are about to be logged out or locked // because they removed their security token (smart card).
diff --git a/chrome/browser/ui/ash/sharesheet/sharesheet_bubble_view.cc b/chrome/browser/ui/ash/sharesheet/sharesheet_bubble_view.cc index 187f447..a24b4d7 100644 --- a/chrome/browser/ui/ash/sharesheet/sharesheet_bubble_view.cc +++ b/chrome/browser/ui/ash/sharesheet/sharesheet_bubble_view.cc
@@ -30,6 +30,7 @@ #include "extensions/browser/app_window/app_window_registry.h" #include "ui/accessibility/ax_enums.mojom-forward.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/closure_animation_observer.h" #include "ui/compositor/layer.h" @@ -52,7 +53,6 @@ #include "ui/views/controls/styled_label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_observer.h"
diff --git a/chrome/browser/ui/ash/sharesheet/sharesheet_constants.h b/chrome/browser/ui/ash/sharesheet/sharesheet_constants.h index 30b6004..32fdbdca 100644 --- a/chrome/browser/ui/ash/sharesheet/sharesheet_constants.h +++ b/chrome/browser/ui/ash/sharesheet/sharesheet_constants.h
@@ -5,7 +5,9 @@ #ifndef CHROME_BROWSER_UI_ASH_SHARESHEET_SHARESHEET_CONSTANTS_H_ #define CHROME_BROWSER_UI_ASH_SHARESHEET_SHARESHEET_CONSTANTS_H_ +#include "chrome/browser/sharesheet/sharesheet_types.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/gfx/geometry/size.h" namespace ash { namespace sharesheet { @@ -14,7 +16,11 @@ constexpr int kSpacing = 24; constexpr size_t kTextPreviewMaximumLines = 3; +constexpr gfx::Size kImagePreviewSize(::sharesheet::kIconSize, + ::sharesheet::kIconSize); constexpr int kImagePreviewCornerRadius = 4; +constexpr int kImagePreviewPlaceholderIconContentSize = 20; +constexpr SkColor kImagePreviewPlaceholderIconColor = gfx::kGoogleBlue600; constexpr SkColor kImagePreviewPlaceholderBackgroundColor = gfx::kGoogleBlue050; constexpr int kHeaderViewBetweenChildSpacing = 12;
diff --git a/chrome/browser/ui/ash/sharesheet/sharesheet_expand_button.cc b/chrome/browser/ui/ash/sharesheet/sharesheet_expand_button.cc index 39636b2..a626ad6 100644 --- a/chrome/browser/ui/ash/sharesheet/sharesheet_expand_button.cc +++ b/chrome/browser/ui/ash/sharesheet/sharesheet_expand_button.cc
@@ -10,10 +10,10 @@ #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/font_list.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/ash/sharesheet/sharesheet_expand_button.h b/chrome/browser/ui/ash/sharesheet/sharesheet_expand_button.h index 33fa181..315c4323 100644 --- a/chrome/browser/ui/ash/sharesheet/sharesheet_expand_button.h +++ b/chrome/browser/ui/ash/sharesheet/sharesheet_expand_button.h
@@ -6,10 +6,10 @@ #define CHROME_BROWSER_UI_ASH_SHARESHEET_SHARESHEET_EXPAND_BUTTON_H_ #include "chrome/browser/sharesheet/sharesheet_types.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace ash { namespace sharesheet {
diff --git a/chrome/browser/ui/ash/sharesheet/sharesheet_header_view.cc b/chrome/browser/ui/ash/sharesheet/sharesheet_header_view.cc index 988c629..633ff00 100644 --- a/chrome/browser/ui/ash/sharesheet/sharesheet_header_view.cc +++ b/chrome/browser/ui/ash/sharesheet/sharesheet_header_view.cc
@@ -8,7 +8,10 @@ #include <utility> #include "ash/public/cpp/ash_typography.h" +#include "ash/public/cpp/file_icon_util.h" +#include "base/bind.h" #include "base/files/file_util.h" +#include "base/optional.h" #include "base/strings/strcat.h" #include "base/strings/string_util.h" #include "chrome/app/vector_icons/vector_icons.h" @@ -21,9 +24,11 @@ #include "chrome/browser/ui/ash/sharesheet/sharesheet_util.h" #include "chrome/common/chrome_features.h" #include "chrome/grit/generated_resources.h" +#include "chromeos/ui/vector_icons/vector_icons.h" #include "storage/browser/file_system/file_system_context.h" #include "storage/browser/file_system/file_system_url.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/size.h" @@ -33,7 +38,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace { @@ -45,6 +49,14 @@ return base::ASCIIToUTF16(all_file_names); } +gfx::ImageSkia CreatePlaceholderIcon(const gfx::VectorIcon& icon) { + gfx::ImageSkia file_type_icon = gfx::CreateVectorIcon( + icon, ash::sharesheet::kImagePreviewPlaceholderIconContentSize, + ash::sharesheet::kImagePreviewPlaceholderIconColor); + return ash::HoldingSpaceImage::SuperimposeOverEmptyImage( + file_type_icon, ash::sharesheet::kImagePreviewSize); +} + } // namespace namespace ash { @@ -84,10 +96,11 @@ ShowTextPreview(); if (intent_->file_urls.has_value() && !intent_->file_urls.value().empty()) { - LoadImage(); + ResolveImage(); } else { // TODO(crbug.com/2650014): Update to text icon. - image_preview_->SetImage(gfx::CreateVectorIcon(kAddIcon)); + image_preview_->SetImage( + CreatePlaceholderIcon(chromeos::kFiletypeGenericIcon)); } } } @@ -96,8 +109,7 @@ void SharesheetHeaderView::InitaliseImageView() { image_preview_ = AddChildView(std::make_unique<views::ImageView>()); - image_preview_->SetImageSize( - gfx::Size(::sharesheet::kIconSize, ::sharesheet::kIconSize)); + image_preview_->SetImageSize(kImagePreviewSize); image_preview_->SetPaintToLayer(); image_preview_->layer()->SetRoundedCornerRadius( gfx::RoundedCornersF(kImagePreviewCornerRadius)); @@ -213,7 +225,7 @@ } // TODO(crbug.com/2650014) Optimise to load several images. -void SharesheetHeaderView::LoadImage() { +void SharesheetHeaderView::ResolveImage() { base::FilePath file_path; storage::FileSystemContext* fs_context = file_manager::util::GetFileSystemContextForExtensionId( @@ -222,29 +234,30 @@ fs_context->CrackURL(intent_->file_urls.value().front()); file_path = fs_url.path(); + image_ = std::make_unique<HoldingSpaceImage>( + kImagePreviewSize, file_path, + base::BindRepeating(&SharesheetHeaderView::LoadImage, + weak_ptr_factory_.GetWeakPtr()), + base::Optional<gfx::ImageSkia>( + CreatePlaceholderIcon(chromeos::kFiletypeImageIcon))); + image_subscription_ = image_->AddImageSkiaChangedCallback(base::BindRepeating( + &SharesheetHeaderView::OnImageLoaded, weak_ptr_factory_.GetWeakPtr())); + image_preview_->SetImage(image_->GetImageSkia(kImagePreviewSize)); +} + +void SharesheetHeaderView::LoadImage( + const base::FilePath& file_path, + const gfx::Size& size, + HoldingSpaceImage::BitmapCallback callback) { // This works for all shares right now because currently when we share data // that is not from the Files app (web share and ARC), // those files are being temporarily saved to disk before being shared. // If those implementations change, this will need to be updated. - thumbnail_loader_.Load( - {file_path, gfx::Size(::sharesheet::kIconSize, ::sharesheet::kIconSize)}, - base::BindOnce(&SharesheetHeaderView::OnImageLoaded, - weak_ptr_factory_.GetWeakPtr())); + thumbnail_loader_.Load({file_path, size}, std::move(callback)); } -void SharesheetHeaderView::OnImageLoaded(const SkBitmap* bitmap, - base::File::Error error) { - if (error != base::File::FILE_OK) { - // TODO(crbug.com/2650014): Handle error case: - // Add placeholder icons for each mimetype. - image_preview_->SetImage(gfx::CreateVectorIcon(kAddIcon)); - return; - } - - // TODO(crbug.com/1189945): Update to use custom ImageSkiaSource so that - // image will scale with device scale factor. - image_preview_->SetImage( - gfx::Image::CreateFrom1xBitmap(*bitmap).AsImageSkia()); +void SharesheetHeaderView::OnImageLoaded() { + image_preview_->SetImage(image_->GetImageSkia(kImagePreviewSize)); } BEGIN_METADATA(SharesheetHeaderView, views::View)
diff --git a/chrome/browser/ui/ash/sharesheet/sharesheet_header_view.h b/chrome/browser/ui/ash/sharesheet/sharesheet_header_view.h index 8a64780a..e5513818 100644 --- a/chrome/browser/ui/ash/sharesheet/sharesheet_header_view.h +++ b/chrome/browser/ui/ash/sharesheet/sharesheet_header_view.h
@@ -5,9 +5,13 @@ #ifndef CHROME_BROWSER_UI_ASH_SHARESHEET_SHARESHEET_HEADER_VIEW_H_ #define CHROME_BROWSER_UI_ASH_SHARESHEET_SHARESHEET_HEADER_VIEW_H_ +#include <memory> + +#include "ash/public/cpp/holding_space/holding_space_image.h" +#include "base/callback_list.h" #include "chrome/browser/ui/ash/thumbnail_loader.h" #include "components/services/app_service/public/mojom/types.mojom.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class Profile; @@ -49,8 +53,11 @@ // from share_target_utils.h to a common place and reuse the function here. std::vector<std::u16string> ExtractShareText(); - void LoadImage(); - void OnImageLoaded(const SkBitmap* bitmap, base::File::Error error); + void ResolveImage(); + void LoadImage(const base::FilePath& file_path, + const gfx::Size& size, + HoldingSpaceImage::BitmapCallback callback); + void OnImageLoaded(); // Contains the share title and text preview views. views::View* text_view_ = nullptr; @@ -58,7 +65,11 @@ Profile* profile_; apps::mojom::IntentPtr intent_; + ThumbnailLoader thumbnail_loader_; + base::CallbackListSubscription image_subscription_; + // TODO(crbug.com/1156343): Clean up to use our own FileThumbnailImage class. + std::unique_ptr<HoldingSpaceImage> image_; base::WeakPtrFactory<SharesheetHeaderView> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/ui/ash/sharesheet/sharesheet_target_button.cc b/chrome/browser/ui/ash/sharesheet/sharesheet_target_button.cc index 2aab949..25fea428 100644 --- a/chrome/browser/ui/ash/sharesheet/sharesheet_target_button.cc +++ b/chrome/browser/ui/ash/sharesheet/sharesheet_target_button.cc
@@ -10,11 +10,11 @@ #include "base/strings/strcat.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/ash/sharesheet/sharesheet_constants.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/font_list.h" #include "ui/views/controls/color_tracking_icon_view.h" #include "ui/views/controls/image_view.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/ash/sharesheet/sharesheet_target_button.h b/chrome/browser/ui/ash/sharesheet/sharesheet_target_button.h index 5786c65..52626649 100644 --- a/chrome/browser/ui/ash/sharesheet/sharesheet_target_button.h +++ b/chrome/browser/ui/ash/sharesheet/sharesheet_target_button.h
@@ -7,10 +7,10 @@ #include "base/optional.h" #include "chrome/browser/sharesheet/sharesheet_types.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/vector_icon_types.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace ash { namespace sharesheet {
diff --git a/chrome/browser/ui/ash/system_tray_client.cc b/chrome/browser/ui/ash/system_tray_client_impl.cc similarity index 87% rename from chrome/browser/ui/ash/system_tray_client.cc rename to chrome/browser/ui/ash/system_tray_client_impl.cc index dee74d54..6395ee5 100644 --- a/chrome/browser/ui/ash/system_tray_client.cc +++ b/chrome/browser/ui/ash/system_tray_client_impl.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 "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "ash/constants/ash_features.h" #include "ash/public/cpp/locale_update_controller.h" @@ -73,7 +73,7 @@ namespace { -SystemTrayClient* g_system_tray_client_instance = nullptr; +SystemTrayClientImpl* g_system_tray_client_instance = nullptr; void ShowSettingsSubPageForActiveUser(const std::string& sub_page) { chrome::SettingsWindowManager::GetInstance()->ShowOSSettings( @@ -132,12 +132,13 @@ } // namespace -class SystemTrayClient::EnterpriseAccountObserver +class SystemTrayClientImpl::EnterpriseAccountObserver : public user_manager::UserManager::UserSessionStateObserver, public policy::CloudPolicyStore::Observer, public session_manager::SessionManagerObserver { public: - explicit EnterpriseAccountObserver(SystemTrayClient* owner) : owner_(owner) { + explicit EnterpriseAccountObserver(SystemTrayClientImpl* owner) + : owner_(owner) { user_manager::UserManager* manager = user_manager::UserManager::Get(); session_state_observation_.Observe(manager); session_observation_.Observe(session_manager::SessionManager::Get()); @@ -149,7 +150,7 @@ ~EnterpriseAccountObserver() override = default; private: - SystemTrayClient* const owner_; + SystemTrayClientImpl* const owner_; Profile* profile_ = nullptr; base::ScopedObservation< @@ -202,7 +203,7 @@ } }; -SystemTrayClient::SystemTrayClient() +SystemTrayClientImpl::SystemTrayClientImpl() : system_tray_(ash::SystemTray::Get()), update_notification_style_(ash::NotificationStyle::kDefault), enterprise_account_observer_( @@ -234,7 +235,7 @@ UpgradeDetector::GetInstance()->AddObserver(this); } -SystemTrayClient::~SystemTrayClient() { +SystemTrayClientImpl::~SystemTrayClientImpl() { DCHECK_EQ(this, g_system_tray_client_instance); g_system_tray_client_instance = nullptr; @@ -252,11 +253,11 @@ } // static -SystemTrayClient* SystemTrayClient::Get() { +SystemTrayClientImpl* SystemTrayClientImpl::Get() { return g_system_tray_client_instance; } -void SystemTrayClient::SetUpdateNotificationState( +void SystemTrayClientImpl::SetUpdateNotificationState( ash::NotificationStyle style, const std::u16string& notification_title, const std::u16string& notification_body) { @@ -266,45 +267,45 @@ HandleUpdateAvailable(ash::UpdateType::kSystem); } -void SystemTrayClient::SetLacrosUpdateAvailable() { +void SystemTrayClientImpl::SetLacrosUpdateAvailable() { HandleUpdateAvailable(ash::UpdateType::kLacros); } -void SystemTrayClient::SetPrimaryTrayEnabled(bool enabled) { +void SystemTrayClientImpl::SetPrimaryTrayEnabled(bool enabled) { system_tray_->SetPrimaryTrayEnabled(enabled); } -void SystemTrayClient::SetPrimaryTrayVisible(bool visible) { +void SystemTrayClientImpl::SetPrimaryTrayVisible(bool visible) { system_tray_->SetPrimaryTrayVisible(visible); } -void SystemTrayClient::SetPerformanceTracingIconVisible(bool visible) { +void SystemTrayClientImpl::SetPerformanceTracingIconVisible(bool visible) { system_tray_->SetPerformanceTracingIconVisible(visible); } -void SystemTrayClient::SetLocaleList( +void SystemTrayClientImpl::SetLocaleList( std::vector<ash::LocaleInfo> locale_list, const std::string& current_locale_iso_code) { system_tray_->SetLocaleList(std::move(locale_list), current_locale_iso_code); } //////////////////////////////////////////////////////////////////////////////// -// ash::mojom::SystemTrayClient: +// ash::SystemTrayClient: -void SystemTrayClient::ShowSettings(int64_t display_id) { +void SystemTrayClientImpl::ShowSettings(int64_t display_id) { // TODO(jamescook): Use different metric for OS settings. base::RecordAction(base::UserMetricsAction("ShowOptions")); chrome::SettingsWindowManager::GetInstance()->ShowOSSettings( ProfileManager::GetActiveUserProfile(), display_id); } -void SystemTrayClient::ShowBluetoothSettings() { +void SystemTrayClientImpl::ShowBluetoothSettings() { base::RecordAction(base::UserMetricsAction("ShowBluetoothSettingsPage")); ShowSettingsSubPageForActiveUser( chromeos::settings::mojom::kBluetoothDevicesSubpagePath); } -void SystemTrayClient::ShowBluetoothPairingDialog( +void SystemTrayClientImpl::ShowBluetoothPairingDialog( const std::string& address, const std::u16string& name_for_display, bool paired, @@ -316,57 +317,57 @@ } } -void SystemTrayClient::ShowDateSettings() { +void SystemTrayClientImpl::ShowDateSettings() { base::RecordAction(base::UserMetricsAction("ShowDateOptions")); // Everybody can change the time zone (even though it is a device setting). ShowSettingsSubPageForActiveUser( chromeos::settings::mojom::kDateAndTimeSectionPath); } -void SystemTrayClient::ShowSetTimeDialog() { +void SystemTrayClientImpl::ShowSetTimeDialog() { chromeos::SetTimeDialog::ShowDialog(); } -void SystemTrayClient::ShowDisplaySettings() { +void SystemTrayClientImpl::ShowDisplaySettings() { base::RecordAction(base::UserMetricsAction("ShowDisplayOptions")); ShowSettingsSubPageForActiveUser( chromeos::settings::mojom::kDisplaySubpagePath); } -void SystemTrayClient::ShowPowerSettings() { +void SystemTrayClientImpl::ShowPowerSettings() { base::RecordAction(base::UserMetricsAction("Tray_ShowPowerOptions")); ShowSettingsSubPageForActiveUser( chromeos::settings::mojom::kPowerSubpagePath); } -void SystemTrayClient::ShowPrivacyAndSecuritySettings() { +void SystemTrayClientImpl::ShowPrivacyAndSecuritySettings() { ShowSettingsSubPageForActiveUser( chromeos::settings::mojom::kPrivacyAndSecuritySectionPath); } -void SystemTrayClient::ShowChromeSlow() { +void SystemTrayClientImpl::ShowChromeSlow() { chrome::ScopedTabbedBrowserDisplayer displayer( ProfileManager::GetPrimaryUserProfile()); chrome::ShowSlow(displayer.browser()); } -void SystemTrayClient::ShowIMESettings() { +void SystemTrayClientImpl::ShowIMESettings() { base::RecordAction(base::UserMetricsAction("OpenLanguageOptionsDialog")); ShowSettingsSubPageForActiveUser( chromeos::settings::mojom::kInputSubpagePath); } -void SystemTrayClient::ShowConnectedDevicesSettings() { +void SystemTrayClientImpl::ShowConnectedDevicesSettings() { ShowSettingsSubPageForActiveUser( chromeos::settings::mojom::kMultiDeviceFeaturesSubpagePath); } -void SystemTrayClient::ShowTetherNetworkSettings() { +void SystemTrayClientImpl::ShowTetherNetworkSettings() { ShowSettingsSubPageForActiveUser( chromeos::settings::mojom::kMobileDataNetworksSubpagePath); } -void SystemTrayClient::ShowWifiSyncSettings() { +void SystemTrayClientImpl::ShowWifiSyncSettings() { ShowSettingsSubPageForActiveUser( std::string(chromeos::settings::mojom::kMultiDeviceFeaturesSubpagePath) + "?settingId=" + @@ -374,7 +375,7 @@ chromeos::settings::mojom::Setting::kWifiSyncOnOff))); } -void SystemTrayClient::ShowAboutChromeOS() { +void SystemTrayClientImpl::ShowAboutChromeOS() { // We always want to check for updates when showing the about page from the // Ash UI. ShowSettingsSubPageForActiveUser( @@ -382,24 +383,24 @@ "?checkForUpdate=true"); } -void SystemTrayClient::ShowHelp() { +void SystemTrayClientImpl::ShowHelp() { chrome::ShowHelpForProfile(ProfileManager::GetActiveUserProfile(), chrome::HELP_SOURCE_MENU); } -void SystemTrayClient::ShowAccessibilityHelp() { +void SystemTrayClientImpl::ShowAccessibilityHelp() { chrome::ScopedTabbedBrowserDisplayer displayer( ProfileManager::GetActiveUserProfile()); ash::AccessibilityManager::ShowAccessibilityHelp(displayer.browser()); } -void SystemTrayClient::ShowAccessibilitySettings() { +void SystemTrayClientImpl::ShowAccessibilitySettings() { base::RecordAction(base::UserMetricsAction("ShowAccessibilitySettings")); ShowSettingsSubPageForActiveUser( chromeos::settings::mojom::kManageAccessibilitySubpagePath); } -void SystemTrayClient::ShowGestureEducationHelp() { +void SystemTrayClientImpl::ShowGestureEducationHelp() { base::RecordAction(base::UserMetricsAction("ShowGestureEducationHelp")); Profile* profile = ProfileManager::GetActiveUserProfile(); if (!profile) @@ -412,25 +413,25 @@ params); } -void SystemTrayClient::ShowPaletteHelp() { +void SystemTrayClientImpl::ShowPaletteHelp() { chrome::ScopedTabbedBrowserDisplayer displayer( ProfileManager::GetActiveUserProfile()); ShowSingletonTab(displayer.browser(), GURL(chrome::kChromePaletteHelpURL)); } -void SystemTrayClient::ShowPaletteSettings() { +void SystemTrayClientImpl::ShowPaletteSettings() { base::RecordAction(base::UserMetricsAction("ShowPaletteOptions")); ShowSettingsSubPageForActiveUser( chromeos::settings::mojom::kStylusSubpagePath); } -void SystemTrayClient::ShowPublicAccountInfo() { +void SystemTrayClientImpl::ShowPublicAccountInfo() { chrome::ScopedTabbedBrowserDisplayer displayer( ProfileManager::GetActiveUserProfile()); chrome::ShowPolicy(displayer.browser()); } -void SystemTrayClient::ShowEnterpriseInfo() { +void SystemTrayClientImpl::ShowEnterpriseInfo() { // At the login screen, lock screen, etc. show enterprise help in a window. if (SessionManager::Get()->IsUserSessionBlocked()) { scoped_refptr<chromeos::HelpAppLauncher> help_app( @@ -445,7 +446,7 @@ chrome::ShowEnterpriseManagementPageInTabbedBrowser(displayer.browser()); } -void SystemTrayClient::ShowNetworkConfigure(const std::string& network_id) { +void SystemTrayClientImpl::ShowNetworkConfigure(const std::string& network_id) { // UI is not available at the lock screen. if (SessionManager::Get()->IsScreenLocked()) return; @@ -465,7 +466,7 @@ chromeos::InternetConfigDialog::ShowDialogForNetworkId(network_id); } -void SystemTrayClient::ShowNetworkCreate(const std::string& type) { +void SystemTrayClientImpl::ShowNetworkCreate(const std::string& type) { if (type == ::onc::network_type::kCellular) { if (chromeos::features::IsCellularActivationUiEnabled()) { ShowSettingsCellularSetup(/*show_psim_flow=*/false); @@ -483,7 +484,7 @@ chromeos::InternetConfigDialog::ShowDialogForNetworkType(type); } -void SystemTrayClient::ShowSettingsCellularSetup(bool show_psim_flow) { +void SystemTrayClientImpl::ShowSettingsCellularSetup(bool show_psim_flow) { // TODO(crbug.com/1093185) Add metrics action recorder std::string page = chromeos::settings::mojom::kCellularNetworksSubpagePath; page += "&showCellularSetup=true"; @@ -492,7 +493,7 @@ ShowSettingsSubPageForActiveUser(page); } -void SystemTrayClient::ShowThirdPartyVpnCreate( +void SystemTrayClientImpl::ShowThirdPartyVpnCreate( const std::string& extension_id) { Profile* profile = ProfileManager::GetPrimaryUserProfile(); @@ -504,7 +505,7 @@ ->SendShowAddDialogToExtension(extension_id); } -void SystemTrayClient::ShowArcVpnCreate(const std::string& app_id) { +void SystemTrayClientImpl::ShowArcVpnCreate(const std::string& app_id) { Profile* profile = ProfileManager::GetPrimaryUserProfile(); if (!profile || @@ -516,7 +517,7 @@ app_id, ui::EF_NONE, apps::mojom::LaunchSource::kFromParentalControls); } -void SystemTrayClient::ShowSettingsSimUnlock() { +void SystemTrayClientImpl::ShowSettingsSimUnlock() { // TODO(https://crbug.com/1093185) Add metrics action recorder. SessionManager* const session_manager = SessionManager::Get(); DCHECK(session_manager->IsSessionStarted()); @@ -526,12 +527,13 @@ ShowSettingsSubPageForActiveUser(page); } -void SystemTrayClient::ShowNetworkSettings(const std::string& network_id) { +void SystemTrayClientImpl::ShowNetworkSettings(const std::string& network_id) { ShowNetworkSettingsHelper(network_id, false /* show_configure */); } -void SystemTrayClient::ShowNetworkSettingsHelper(const std::string& network_id, - bool show_configure) { +void SystemTrayClientImpl::ShowNetworkSettingsHelper( + const std::string& network_id, + bool show_configure) { SessionManager* const session_manager = SessionManager::Get(); if (session_manager->IsInSecondaryLoginScreen()) return; @@ -587,21 +589,22 @@ ShowSettingsSubPageForActiveUser(page); } -void SystemTrayClient::ShowMultiDeviceSetup() { +void SystemTrayClientImpl::ShowMultiDeviceSetup() { chromeos::multidevice_setup::MultiDeviceSetupDialog::Show(); } -void SystemTrayClient::RequestRestartForUpdate() { +void SystemTrayClientImpl::RequestRestartForUpdate() { browser_shutdown::NotifyAndTerminate(/*fast_path=*/true); } -void SystemTrayClient::SetLocaleAndExit(const std::string& locale_iso_code) { +void SystemTrayClientImpl::SetLocaleAndExit( + const std::string& locale_iso_code) { ProfileManager::GetActiveUserProfile()->ChangeAppLocale( locale_iso_code, Profile::APP_LOCALE_CHANGED_VIA_SYSTEM_TRAY); chrome::AttemptUserExit(); } -void SystemTrayClient::HandleUpdateAvailable(ash::UpdateType update_type) { +void SystemTrayClientImpl::HandleUpdateAvailable(ash::UpdateType update_type) { UpgradeDetector* detector = UpgradeDetector::GetInstance(); if (update_type == ash::UpdateType::kSystem && !detector->notify_upgrade()) { LOG(ERROR) << "Tried to show update notification when no update available"; @@ -624,38 +627,38 @@ //////////////////////////////////////////////////////////////////////////////// // chromeos::system::SystemClockObserver: -void SystemTrayClient::OnSystemClockChanged( +void SystemTrayClientImpl::OnSystemClockChanged( chromeos::system::SystemClock* clock) { system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock()); } //////////////////////////////////////////////////////////////////////////////// // UpgradeDetector::UpgradeObserver: -void SystemTrayClient::OnUpdateOverCellularAvailable() { +void SystemTrayClientImpl::OnUpdateOverCellularAvailable() { // Requests that ash show the update over cellular available icon. system_tray_->SetUpdateOverCellularAvailableIconVisible(true); } -void SystemTrayClient::OnUpdateOverCellularOneTimePermissionGranted() { +void SystemTrayClientImpl::OnUpdateOverCellularOneTimePermissionGranted() { // Requests that ash hide the update over cellular available icon. system_tray_->SetUpdateOverCellularAvailableIconVisible(false); } -void SystemTrayClient::OnUpgradeRecommended() { +void SystemTrayClientImpl::OnUpgradeRecommended() { HandleUpdateAvailable(ash::UpdateType::kSystem); } //////////////////////////////////////////////////////////////////////////////// // policy::CloudPolicyStore::Observer -void SystemTrayClient::OnStoreLoaded(policy::CloudPolicyStore* store) { +void SystemTrayClientImpl::OnStoreLoaded(policy::CloudPolicyStore* store) { UpdateEnterpriseDomainInfo(); } -void SystemTrayClient::OnStoreError(policy::CloudPolicyStore* store) { +void SystemTrayClientImpl::OnStoreError(policy::CloudPolicyStore* store) { UpdateEnterpriseDomainInfo(); } -void SystemTrayClient::UpdateEnterpriseDomainInfo() { +void SystemTrayClientImpl::UpdateEnterpriseDomainInfo() { policy::BrowserPolicyConnectorChromeOS* connector = g_browser_process->platform_part()->browser_policy_connector_chromeos(); const std::string enterprise_domain_manager = @@ -672,7 +675,7 @@ last_active_directory_managed_ = active_directory_managed; } -void SystemTrayClient::UpdateEnterpriseAccountDomainInfo(Profile* profile) { +void SystemTrayClientImpl::UpdateEnterpriseAccountDomainInfo(Profile* profile) { const std::string account_manager = profile ? ManagementUIHandler::GetAccountManager(profile) : std::string(); if (account_manager == last_enterprise_account_domain_manager_)
diff --git a/chrome/browser/ui/ash/system_tray_client.h b/chrome/browser/ui/ash/system_tray_client_impl.h similarity index 89% rename from chrome/browser/ui/ash/system_tray_client.h rename to chrome/browser/ui/ash/system_tray_client_impl.h index 8cc2bda..8980987 100644 --- a/chrome/browser/ui/ash/system_tray_client.h +++ b/chrome/browser/ui/ash/system_tray_client_impl.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 CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ -#define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ +#ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_IMPL_H_ +#define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_IMPL_H_ #include "ash/public/cpp/system_tray_client.h" #include "base/macros.h" @@ -24,15 +24,15 @@ // Handles method calls delegated back to chrome from ash. Also notifies ash of // relevant state changes in chrome. // TODO: Consider renaming this to SystemTrayClientImpl. -class SystemTrayClient : public ash::SystemTrayClient, - public ash::system::SystemClockObserver, - public policy::CloudPolicyStore::Observer, - public UpgradeObserver { +class SystemTrayClientImpl : public ash::SystemTrayClient, + public ash::system::SystemClockObserver, + public policy::CloudPolicyStore::Observer, + public UpgradeObserver { public: - SystemTrayClient(); - ~SystemTrayClient() override; + SystemTrayClientImpl(); + ~SystemTrayClientImpl() override; - static SystemTrayClient* Get(); + static SystemTrayClientImpl* Get(); // Specifies if notification is recommended or required by administrator and // triggers the notification to be shown with the given body and title. @@ -134,7 +134,7 @@ std::unique_ptr<EnterpriseAccountObserver> enterprise_account_observer_; - DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); + DISALLOW_COPY_AND_ASSIGN(SystemTrayClientImpl); }; -#endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ +#endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_IMPL_H_
diff --git a/chrome/browser/ui/ash/system_tray_client_browsertest.cc b/chrome/browser/ui/ash/system_tray_client_impl_browsertest.cc similarity index 99% rename from chrome/browser/ui/ash/system_tray_client_browsertest.cc rename to chrome/browser/ui/ash/system_tray_client_impl_browsertest.cc index f4c1752e..a058362 100644 --- a/chrome/browser/ui/ash/system_tray_client_browsertest.cc +++ b/chrome/browser/ui/ash/system_tray_client_impl_browsertest.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 "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_view_ids.h"
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc index c984ed1..cd7576a 100644 --- a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc +++ b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
@@ -21,6 +21,7 @@ #include "components/autofill/content/browser/content_autofill_driver.h" #include "components/autofill/content/browser/content_autofill_driver_factory.h" #include "components/autofill/core/browser/autofill_external_delegate.h" +#include "components/autofill/core/browser/autofill_manager.h" #include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill/core/browser/browser_autofill_manager.h" #include "components/autofill/core/browser/test_autofill_client.h" @@ -77,11 +78,12 @@ class MockAutofillDriver : public ContentAutofillDriver { public: MockAutofillDriver(content::RenderFrameHost* rfh, MockAutofillClient* client) - : ContentAutofillDriver(rfh, - client, - kAppLocale, - kDownloadState, - nullptr) {} + : ContentAutofillDriver( + rfh, + client, + kAppLocale, + kDownloadState, + AutofillManager::AutofillManagerFactoryCallback()) {} ~MockAutofillDriver() override = default; MOCK_CONST_METHOD0(GetAxTreeId, ui::AXTreeID());
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 7ef1cf9..ddbbb962 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc
@@ -29,6 +29,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/sessions/tab_restore_service_factory.h" +#include "chrome/browser/sharing_hub/sharing_hub_features.h" #include "chrome/browser/shell_integration.h" #include "chrome/browser/signin/signin_promo.h" #include "chrome/browser/sync/profile_sync_service_factory.h" @@ -573,6 +574,9 @@ case IDC_QRCODE_GENERATOR: GenerateQRCodeFromPageAction(browser_); break; + case IDC_SHARING_HUB: + SharingHubFromPageAction(browser_); + break; // Clipboard commands case IDC_CUT: @@ -1063,7 +1067,11 @@ #endif web_app::AppBrowserController::IsWebApp(browser_); // Hosted app browser commands. - command_updater_.UpdateCommandEnabled(IDC_COPY_URL, is_web_app_or_custom_tab); + const bool enable_copy_url = + is_web_app_or_custom_tab || + base::FeatureList::IsEnabled(sharing_hub::kSharingHubDesktopOmnibox) || + base::FeatureList::IsEnabled(sharing_hub::kSharingHubDesktopAppMenu); + command_updater_.UpdateCommandEnabled(IDC_COPY_URL, enable_copy_url); command_updater_.UpdateCommandEnabled(IDC_OPEN_IN_CHROME, is_web_app_or_custom_tab); command_updater_.UpdateCommandEnabled(IDC_SITE_SETTINGS,
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index c6cf69f..64736cb 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc
@@ -62,6 +62,7 @@ #include "chrome/browser/ui/read_later/reading_list_model_factory.h" #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" #include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_bubble_controller.h" +#include "chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h" #include "chrome/browser/ui/status_bubble.h" #include "chrome/browser/ui/tab_contents/core_tab_helper.h" #include "chrome/browser/ui/tab_dialogs.h" @@ -1266,6 +1267,15 @@ controller->ShowBubble(entry->GetURL()); } +void SharingHubFromPageAction(Browser* browser) { + WebContents* web_contents = + browser->tab_strip_model()->GetActiveWebContents(); + sharing_hub::SharingHubBubbleController* controller = + sharing_hub::SharingHubBubbleController::CreateOrGetFromWebContents( + web_contents); + controller->ShowBubble(); +} + void SavePage(Browser* browser) { base::RecordAction(UserMetricsAction("SavePage")); WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents();
diff --git a/chrome/browser/ui/browser_commands.h b/chrome/browser/ui/browser_commands.h index 417598d..ef3e4f2 100644 --- a/chrome/browser/ui/browser_commands.h +++ b/chrome/browser/ui/browser_commands.h
@@ -157,6 +157,7 @@ void ManagePasswordsForPage(Browser* browser); void SendTabToSelfFromPageAction(Browser* browser); void GenerateQRCodeFromPageAction(Browser* browser); +void SharingHubFromPageAction(Browser* browser); void SavePage(Browser* browser); bool CanSavePage(const Browser* browser); void Print(Browser* browser);
diff --git a/chrome/browser/ui/browser_window.h b/chrome/browser/ui/browser_window.h index fcc8665f..49aee0bf 100644 --- a/chrome/browser/ui/browser_window.h +++ b/chrome/browser/ui/browser_window.h
@@ -74,6 +74,11 @@ class SendTabToSelfBubbleView; } // namespace send_tab_to_self +namespace sharing_hub { +class SharingHubBubbleController; +class SharingHubBubbleView; +} // namespace sharing_hub + namespace ui { class NativeTheme; } @@ -388,6 +393,12 @@ send_tab_to_self::SendTabToSelfBubbleController* controller, bool is_user_gesture) = 0; + // Shows the Sharing Hub bubble. + virtual sharing_hub::SharingHubBubbleView* ShowSharingHubBubble( + content::WebContents* contents, + sharing_hub::SharingHubBubbleController* controller, + bool is_user_gesture) = 0; + // Shows the translate bubble. // // |is_user_gesture| is true when the bubble is shown on the user's deliberate
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc index 402ac88..702675f 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -13,6 +13,7 @@ #include "base/command_line.h" #include "base/feature_list.h" #include "base/metrics/user_metrics.h" +#include "base/scoped_observation.h" #include "base/stl_util.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/browser_process.h" @@ -717,9 +718,9 @@ return bubble_content().list_items[index].item_id; } - ScopedObserver<blocked_content::UrlListManager, - blocked_content::UrlListManager::Observer> - url_list_observer_; + base::ScopedObservation<blocked_content::UrlListManager, + blocked_content::UrlListManager::Observer> + url_list_observation_{this}; DISALLOW_COPY_AND_ASSIGN(ContentSettingPopupBubbleModel); }; @@ -729,8 +730,7 @@ WebContents* web_contents) : ContentSettingSingleRadioGroup(delegate, web_contents, - ContentSettingsType::POPUPS), - url_list_observer_(this) { + ContentSettingsType::POPUPS) { set_title(l10n_util::GetStringUTF16(IDS_BLOCKED_POPUPS_TITLE)); // Build blocked popup list. @@ -740,7 +740,7 @@ for (const auto& blocked_popup : blocked_popups) AddListItem(CreateUrlListItem(blocked_popup.first, blocked_popup.second)); - url_list_observer_.Add(helper->manager()); + url_list_observation_.Observe(helper->manager()); content_settings::RecordPopupsAction( content_settings::POPUPS_ACTION_DISPLAYED_BUBBLE); } @@ -1465,8 +1465,7 @@ WebContents* web_contents) : ContentSettingSingleRadioGroup(delegate, web_contents, - ContentSettingsType::POPUPS), - url_list_observer_(this) { + ContentSettingsType::POPUPS) { set_title(l10n_util::GetStringUTF16(IDS_REDIRECT_BLOCKED_MESSAGE)); auto* helper = FramebustBlockTabHelper::FromWebContents(web_contents); @@ -1474,7 +1473,7 @@ for (const auto& blocked_url : helper->blocked_urls()) AddListItem(CreateUrlListItem(0 /* id */, blocked_url)); - url_list_observer_.Add(helper->manager()); + url_list_observation_.Observe(helper->manager()); } ContentSettingFramebustBlockBubbleModel::
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.h b/chrome/browser/ui/content_settings/content_setting_bubble_model.h index d4840a6..2bfba81 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.h +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.h
@@ -14,7 +14,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" -#include "base/scoped_observer.h" +#include "base/scoped_observation.h" #include "build/build_config.h" #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/ui/blocked_content/framebust_block_tab_helper.h" @@ -553,9 +553,9 @@ private: ListItem CreateListItem(const GURL& url); - ScopedObserver<blocked_content::UrlListManager, - blocked_content::UrlListManager::Observer> - url_list_observer_; + base::ScopedObservation<blocked_content::UrlListManager, + blocked_content::UrlListManager::Observer> + url_list_observation_{this}; DISALLOW_COPY_AND_ASSIGN(ContentSettingFramebustBlockBubbleModel); };
diff --git a/chrome/browser/ui/extensions/extension_action_view_controller.cc b/chrome/browser/ui/extensions/extension_action_view_controller.cc index d0f640c..f15dba7 100644 --- a/chrome/browser/ui/extensions/extension_action_view_controller.cc +++ b/chrome/browser/ui/extensions/extension_action_view_controller.cc
@@ -48,8 +48,7 @@ ExtensionActionViewController::Create( const extensions::ExtensionId& extension_id, Browser* browser, - ExtensionsContainer* extensions_container, - bool in_overflow_mode) { + ExtensionsContainer* extensions_container) { DCHECK(browser); DCHECK(extensions_container); @@ -65,7 +64,7 @@ // WrapUnique() because the constructor is private. return base::WrapUnique(new ExtensionActionViewController( std::move(extension), browser, extension_action, registry, - extensions_container, in_overflow_mode)); + extensions_container)); } ExtensionActionViewController::ExtensionActionViewController( @@ -73,11 +72,9 @@ Browser* browser, extensions::ExtensionAction* extension_action, extensions::ExtensionRegistry* extension_registry, - ExtensionsContainer* extensions_container, - bool in_overflow_mode) + ExtensionsContainer* extensions_container) : extension_(std::move(extension)), browser_(browser), - in_overflow_mode_(in_overflow_mode), extension_action_(extension_action), extensions_container_(extensions_container), popup_host_(nullptr), @@ -394,8 +391,6 @@ PopupShowAction show_action, const GURL& popup_url, bool grant_tab_permissions) { - DCHECK(!in_overflow_mode_) - << "Only the main bar's extensions should ever try to show a popup"; if (!ExtensionIsValid()) return false; @@ -479,24 +474,9 @@ image_source->set_grayscale(grayscale); image_source->set_paint_blocked_actions_decoration(was_blocked); - // If the action has an active page action on the web contents and is also - // overflowed, we add a decoration so that the user can see which overflowed - // action wants to run (since they wouldn't be able to see the change from - // grayscale to color). - image_source->set_paint_page_action_decoration( - !was_blocked && in_overflow_mode_ && PageActionWantsToRun(web_contents)); - return image_source; } -bool ExtensionActionViewController::PageActionWantsToRun( - content::WebContents* web_contents) const { - return extension_action_->action_type() == - extensions::ActionInfo::TYPE_PAGE && - extension_action_->GetIsVisible( - sessions::SessionTabHelper::IdForTab(web_contents).id()); -} - bool ExtensionActionViewController::HasActiveTabAndCanAccess( const GURL& url) const { return extension_->permissions_data()->HasAPIPermission(
diff --git a/chrome/browser/ui/extensions/extension_action_view_controller.h b/chrome/browser/ui/extensions/extension_action_view_controller.h index 39d74808..8d950624 100644 --- a/chrome/browser/ui/extensions/extension_action_view_controller.h +++ b/chrome/browser/ui/extensions/extension_action_view_controller.h
@@ -48,8 +48,7 @@ static std::unique_ptr<ExtensionActionViewController> Create( const extensions::ExtensionId& extension_id, Browser* browser, - ExtensionsContainer* extensions_container, - bool in_overflow_mode); + ExtensionsContainer* extensions_container); ~ExtensionActionViewController() override; @@ -110,8 +109,7 @@ Browser* browser, extensions::ExtensionAction* extension_action, extensions::ExtensionRegistry* extension_registry, - ExtensionsContainer* extensions_container, - bool in_overflow_mode); + ExtensionsContainer* extensions_container); // ExtensionActionIconFactory::Observer: void OnIconUpdated() override; @@ -160,10 +158,6 @@ content::WebContents* web_contents, const gfx::Size& size); - // Returns true if this extension has a page action and that page action wants - // to run on the given |web_contents|. - bool PageActionWantsToRun(content::WebContents* web_contents) const; - // Returns true if this extension uses the activeTab permission and would // probably be able to to access the given |url|. The actual checks when an // activeTab extension tries to run are a little more complicated and can be @@ -183,10 +177,6 @@ // The corresponding browser. Browser* const browser_; - // Whether we are displayed in the 3-dot menu or not. - // TODO(pbos): Remove when 3-dot menu no longer contains extensions. - const bool in_overflow_mode_; - // The browser action this view represents. The ExtensionAction is not owned // by this class. extensions::ExtensionAction* const extension_action_;
diff --git a/chrome/browser/ui/extensions/extension_action_view_controller_unittest.cc b/chrome/browser/ui/extensions/extension_action_view_controller_unittest.cc index 2465da86..d163e304 100644 --- a/chrome/browser/ui/extensions/extension_action_view_controller_unittest.cc +++ b/chrome/browser/ui/extensions/extension_action_view_controller_unittest.cc
@@ -155,14 +155,12 @@ std::unique_ptr<IconWithBadgeImageSource> image_source = action->GetIconImageSourceForTesting(web_contents, view_size()); EXPECT_TRUE(image_source->grayscale()); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); SetActionWantsToRunOnTab(action->extension_action(), web_contents, true); image_source = action->GetIconImageSourceForTesting(web_contents, view_size()); EXPECT_FALSE(image_source->grayscale()); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); } @@ -194,7 +192,6 @@ action_controller->GetIconImageSourceForTesting(web_contents, view_size()); EXPECT_FALSE(image_source->grayscale()); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); extensions::ExtensionActionRunner* action_runner = @@ -206,14 +203,12 @@ image_source = action_controller->GetIconImageSourceForTesting(web_contents, view_size()); EXPECT_FALSE(image_source->grayscale()); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_TRUE(image_source->paint_blocked_actions_decoration()); action_runner->RunForTesting(extension.get()); image_source = action_controller->GetIconImageSourceForTesting(web_contents, view_size()); EXPECT_FALSE(image_source->grayscale()); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); } @@ -243,7 +238,6 @@ action_controller->GetIconImageSourceForTesting(web_contents, view_size()); EXPECT_FALSE(image_source->grayscale()); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); extensions::ExtensionActionRunner* action_runner = @@ -254,7 +248,6 @@ image_source = action_controller->GetIconImageSourceForTesting(web_contents, view_size()); EXPECT_FALSE(image_source->grayscale()); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_TRUE(image_source->paint_blocked_actions_decoration()); } @@ -287,7 +280,6 @@ view_size()); EXPECT_TRUE(image_source->grayscale()); EXPECT_FALSE(action_controller->IsEnabled(web_contents)); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); EXPECT_EQ("just hosts", base::UTF16ToUTF8(action_controller->GetTooltip(web_contents))); @@ -300,7 +292,6 @@ view_size()); EXPECT_FALSE(image_source->grayscale()); EXPECT_TRUE(action_controller->IsEnabled(web_contents)); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); EXPECT_EQ("just hosts\nWants access to this site", base::UTF16ToUTF8(action_controller->GetTooltip(web_contents))); @@ -313,7 +304,6 @@ view_size()); EXPECT_FALSE(image_source->grayscale()); EXPECT_FALSE(action_controller->IsEnabled(web_contents)); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); EXPECT_EQ("just hosts\nHas access to this site", base::UTF16ToUTF8(action_controller->GetTooltip(web_contents))); @@ -657,7 +647,6 @@ std::unique_ptr<IconWithBadgeImageSource> image_source = controller->GetIconImageSourceForTesting(web_contents, view_size()); EXPECT_FALSE(image_source->grayscale()); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); EXPECT_EQ(kWantsAccessTooltip, base::UTF16ToUTF8(controller->GetTooltip(web_contents))); @@ -677,7 +666,6 @@ std::unique_ptr<IconWithBadgeImageSource> image_source = controller->GetIconImageSourceForTesting(web_contents, view_size()); EXPECT_FALSE(image_source->grayscale()); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); EXPECT_EQ(kHasAccessTooltip, base::UTF16ToUTF8(controller->GetTooltip(web_contents))); @@ -692,7 +680,6 @@ std::unique_ptr<IconWithBadgeImageSource> image_source = controller->GetIconImageSourceForTesting(web_contents, view_size()); EXPECT_TRUE(image_source->grayscale()); - EXPECT_FALSE(image_source->paint_page_action_decoration()); EXPECT_FALSE(image_source->paint_blocked_actions_decoration()); EXPECT_EQ(kNoAccessTooltip, base::UTF16ToUTF8(controller->GetTooltip(web_contents)));
diff --git a/chrome/browser/ui/extensions/icon_with_badge_image_source.cc b/chrome/browser/ui/extensions/icon_with_badge_image_source.cc index 42d9f696..8da2c38d 100644 --- a/chrome/browser/ui/extensions/icon_with_badge_image_source.cc +++ b/chrome/browser/ui/extensions/icon_with_badge_image_source.cc
@@ -161,9 +161,6 @@ // Draw a badge on the provided browser action icon's canvas. PaintBadge(canvas); - - if (paint_page_action_decoration_) - PaintPageActionDecoration(canvas); } // Paints badge with specified parameters to |canvas|. @@ -197,24 +194,6 @@ badge_text_->Draw(canvas); } -void IconWithBadgeImageSource::PaintPageActionDecoration(gfx::Canvas* canvas) { - const gfx::Rect icon_area = GetIconAreaRect(); - constexpr float kMajorRadius = 4.5; - constexpr float kMinorRadius = 3; - // This decoration is positioned at the bottom left corner of the icon area. - gfx::PointF center_point = gfx::PointF(icon_area.bottom_left()); - center_point.Offset(kMajorRadius + 1, -kMajorRadius - 1); - cc::PaintFlags flags; - flags.setAntiAlias(true); - flags.setStyle(cc::PaintFlags::kFill_Style); - flags.setColor(SK_ColorTRANSPARENT); - flags.setBlendMode(SkBlendMode::kSrc); - canvas->DrawCircle(center_point, kMajorRadius, flags); - constexpr SkColor decoration_color = SkColorSetARGB(255, 70, 142, 226); - flags.setColor(decoration_color); - canvas->DrawCircle(center_point, kMinorRadius, flags); -} - void IconWithBadgeImageSource::PaintBlockedActionDecoration( gfx::Canvas* canvas) { // To match the CSS notion of blur (spread outside the bounding box) to the
diff --git a/chrome/browser/ui/extensions/icon_with_badge_image_source.h b/chrome/browser/ui/extensions/icon_with_badge_image_source.h index e82f794..0210f0df 100644 --- a/chrome/browser/ui/extensions/icon_with_badge_image_source.h +++ b/chrome/browser/ui/extensions/icon_with_badge_image_source.h
@@ -42,16 +42,10 @@ void SetIcon(const gfx::Image& icon); void SetBadge(std::unique_ptr<Badge> badge); void set_grayscale(bool grayscale) { grayscale_ = grayscale; } - void set_paint_page_action_decoration(bool should_paint) { - paint_page_action_decoration_ = should_paint; - } void set_paint_blocked_actions_decoration(bool should_paint) { paint_blocked_actions_decoration_ = should_paint; } bool grayscale() const { return grayscale_; } - bool paint_page_action_decoration() const { - return paint_page_action_decoration_; - } bool paint_blocked_actions_decoration() const { return paint_blocked_actions_decoration_; } @@ -94,10 +88,6 @@ // disabled). bool grayscale_ = false; - // Whether or not to paint a decoration over the base icon to indicate the - // represented action wants to run. - bool paint_page_action_decoration_ = false; - // Whether or not to paint a decoration to indicate that the extension has // had actions blocked. bool paint_blocked_actions_decoration_ = false;
diff --git a/chrome/browser/ui/page_action/page_action_icon_type.h b/chrome/browser/ui/page_action/page_action_icon_type.h index cc26085..bbe2731 100644 --- a/chrome/browser/ui/page_action/page_action_icon_type.h +++ b/chrome/browser/ui/page_action/page_action_icon_type.h
@@ -22,6 +22,7 @@ kSaveCard, kSendTabToSelf, kSharedClipboard, + kSharingHub, kSmsRemoteFetcher, kTranslate, kWebAuthn,
diff --git a/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller.cc b/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller.cc index 2d35e062..c45075c 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller.cc +++ b/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller.cc
@@ -127,18 +127,19 @@ delegate_->OnPasswordsRevealed(); } // The condition for the password reauth: - // If the bubble opened after reauth -> no more reauth necessary, otherwise - // If a password was autofilled -> require reauth to view it, otherwise - // Require reauth iff the user opened the bubble manually and it's not the - // manual saving state. The manual saving state as well as automatic prompt - // are temporary states, therefore, it's better for the sake of convenience - // for the user not to break the UX with the reauth prompt. + // If the bubble opened after reauth -> no more reauth necessary. + // If the bubble opened after successful submission -> no reauth because it's + // a temporary state and we should not complicate that UX flow. + // If a password was autofilled -> require reauth to view it. + // If the bubble opened manually and not a manual fallback -> require reauth. + // The manual fallback is a temporary state and it's better for the sake of + // convenience for the user not to break the UX with the reauth prompt. password_revealing_requires_reauth_ = !are_passwords_revealed_when_bubble_is_opened_ && + display_reason == + PasswordBubbleControllerBase::DisplayReason::kUserAction && (pending_password_.form_has_autofilled_value || - (!delegate_->BubbleIsManualFallbackForSaving() && - display_reason == - PasswordBubbleControllerBase::DisplayReason::kUserAction)); + !delegate_->BubbleIsManualFallbackForSaving()); enable_editing_ = delegate_->GetCredentialSource() != password_manager::metrics_util::CredentialSourceType:: kCredentialManagementAPI;
diff --git a/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller_unittest.cc b/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller_unittest.cc index 68fb603c..a7a1906 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller_unittest.cc +++ b/chrome/browser/ui/passwords/bubble_controllers/save_update_bubble_controller_unittest.cc
@@ -583,24 +583,21 @@ .WillRepeatedly(Return(is_manual_fallback_for_saving)); PretendPasswordWaiting(display_reason); - bool reauth_expected = form_has_autofilled_value; - if (!reauth_expected) { + bool reauth_expected = false; + if (display_reason == + PasswordBubbleControllerBase::DisplayReason::kUserAction) { reauth_expected = - !is_manual_fallback_for_saving && - display_reason == - PasswordBubbleControllerBase::DisplayReason::kUserAction; + form_has_autofilled_value || !is_manual_fallback_for_saving; } EXPECT_EQ(reauth_expected, controller()->password_revealing_requires_reauth()); - // delegate()->AuthenticateUser() is called only when reauth is expected. - EXPECT_CALL(*delegate(), AuthenticateUser()) - .Times(reauth_expected) - .WillOnce(Return(!does_os_support_user_auth)); - if (reauth_expected) { + EXPECT_CALL(*delegate(), AuthenticateUser()) + .WillOnce(Return(!does_os_support_user_auth)); EXPECT_EQ(controller()->RevealPasswords(), !does_os_support_user_auth); } else { + EXPECT_CALL(*delegate(), AuthenticateUser()).Times(0); EXPECT_TRUE(controller()->RevealPasswords()); } }
diff --git a/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller.cc b/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller.cc index 6f0b039..bdf97357 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller.cc +++ b/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller.cc
@@ -125,18 +125,19 @@ delegate_->OnPasswordsRevealed(); } // The condition for the password reauth: - // If the bubble opened after reauth -> no more reauth necessary, otherwise - // If a password was autofilled -> require reauth to view it, otherwise - // Require reauth iff the user opened the bubble manually and it's not the - // manual saving state. The manual saving state as well as automatic prompt - // are temporary states, therefore, it's better for the sake of convenience - // for the user not to break the UX with the reauth prompt. + // If the bubble opened after reauth -> no more reauth necessary. + // If the bubble opened after successful submission -> no reauth because it's + // a temporary state and we should not complicate that UX flow. + // If a password was autofilled -> require reauth to view it. + // If the bubble opened manually and not a manual fallback -> require reauth. + // The manual fallback is a temporary state and it's better for the sake of + // convenience for the user not to break the UX with the reauth prompt. password_revealing_requires_reauth_ = !are_passwords_revealed_when_bubble_is_opened_ && + display_reason == + PasswordBubbleControllerBase::DisplayReason::kUserAction && (pending_password_.form_has_autofilled_value || - (!delegate_->BubbleIsManualFallbackForSaving() && - display_reason == - PasswordBubbleControllerBase::DisplayReason::kUserAction)); + !delegate_->BubbleIsManualFallbackForSaving()); enable_editing_ = delegate_->GetCredentialSource() != password_manager::metrics_util::CredentialSourceType:: kCredentialManagementAPI;
diff --git a/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller.h b/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller.h index b982122..d79831d 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller.h +++ b/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller.h
@@ -110,10 +110,6 @@ #if defined(UNIT_TEST) void set_clock(base::Clock* clock) { clock_ = clock; } - void allow_passwords_revealing() { - password_revealing_requires_reauth_ = false; - } - bool password_revealing_requires_reauth() const { return password_revealing_requires_reauth_; }
diff --git a/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller_unittest.cc b/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller_unittest.cc index 30aed0b..0d4af5e 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller_unittest.cc +++ b/chrome/browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller_unittest.cc
@@ -616,24 +616,21 @@ .WillRepeatedly(Return(is_manual_fallback_for_saving)); PretendPasswordWaiting(display_reason); - bool reauth_expected = form_has_autofilled_value; - if (!reauth_expected) { + bool reauth_expected = false; + if (display_reason == + PasswordBubbleControllerBase::DisplayReason::kUserAction) { reauth_expected = - !is_manual_fallback_for_saving && - display_reason == - PasswordBubbleControllerBase::DisplayReason::kUserAction; + form_has_autofilled_value || !is_manual_fallback_for_saving; } EXPECT_EQ(reauth_expected, controller()->password_revealing_requires_reauth()); - // delegate()->AuthenticateUser() is called only when reauth is expected. - EXPECT_CALL(*delegate(), AuthenticateUser()) - .Times(reauth_expected) - .WillOnce(Return(!does_os_support_user_auth)); - if (reauth_expected) { + EXPECT_CALL(*delegate(), AuthenticateUser()) + .WillOnce(Return(!does_os_support_user_auth)); EXPECT_EQ(controller()->RevealPasswords(), !does_os_support_user_auth); } else { + EXPECT_CALL(*delegate(), AuthenticateUser()).Times(0); EXPECT_TRUE(controller()->RevealPasswords()); } }
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc index 0125cbf..6848b55 100644 --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
@@ -1346,6 +1346,8 @@ EXPECT_CALL(*controller(), OnUpdateBubbleAndIconVisibility()); content::RunAllPendingInMessageLoop(); EXPECT_TRUE(controller()->opened_bubble()); + // That check is important because if reauth fails, we should be requiring it + // again unlike in the automatically shown bubble. EXPECT_FALSE(controller()->opened_automatic_bubble()); EXPECT_TRUE(controller()->are_passwords_revealed_in_opened_bubble()); // Since the bubble is opened, this property is already cleared.
diff --git a/chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.cc b/chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.cc index 794d5bc..1a8a1f1 100644 --- a/chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.cc +++ b/chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.cc
@@ -5,6 +5,9 @@ #include "chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_finder.h" +#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/sharing_hub/sharing_hub_bubble_view.h" #include "chrome/grit/generated_resources.h" #include "content/public/browser/web_contents.h" @@ -36,7 +39,9 @@ } void SharingHubBubbleController::ShowBubble() { - // TODO(1186843): Add omnibox integration. + Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); + sharing_hub_bubble_view_ = + browser->window()->ShowSharingHubBubble(web_contents_, this, true); } SharingHubBubbleView* SharingHubBubbleController::sharing_hub_bubble_view() @@ -52,6 +57,15 @@ return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); } +bool SharingHubBubbleController::ShouldOfferOmniboxIcon() { + if (!web_contents_) + return false; + + // TODO(1186845): Check enterprise policy + + return true; +} + void SharingHubBubbleController::OnBubbleClosed() { sharing_hub_bubble_view_ = nullptr; }
diff --git a/chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h b/chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h index 627f193a..7f1d23a 100644 --- a/chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h +++ b/chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h
@@ -38,6 +38,8 @@ std::u16string GetWindowTitle() const; // Returns the current profile. Profile* GetProfile() const; + // Returns true if the omnibox icon should be shown. + bool ShouldOfferOmniboxIcon(); // Handler for when the bubble is closed. void OnBubbleClosed();
diff --git a/chrome/browser/ui/toolbar/app_menu_model.cc b/chrome/browser/ui/toolbar/app_menu_model.cc index 81e6351..53bf2765 100644 --- a/chrome/browser/ui/toolbar/app_menu_model.cc +++ b/chrome/browser/ui/toolbar/app_menu_model.cc
@@ -1001,10 +1001,14 @@ local_state->GetList(policy::policy_prefs::kSystemFeaturesDisableList); } - bool is_enabled = !system_features_disable_list_pref || - system_features_disable_list_pref->Find( - base::Value(policy::SystemFeature::kBrowserSettings)) == - system_features_disable_list_pref->end(); + bool is_enabled = + !system_features_disable_list_pref || + // TODO(crbug.com/1187106): Use base::Contains once + // |system_features_disable_list_pref| is not a ListValue. + std::find(system_features_disable_list_pref->begin(), + system_features_disable_list_pref->end(), + base::Value(policy::SystemFeature::kBrowserSettings)) == + system_features_disable_list_pref->end(); int index = GetIndexOfCommandId(IDC_OPTIONS); if (index != -1)
diff --git a/chrome/browser/ui/ui_features.cc b/chrome/browser/ui/ui_features.cc index 8f26920..5413bc6 100644 --- a/chrome/browser/ui/ui_features.cc +++ b/chrome/browser/ui/ui_features.cc
@@ -64,6 +64,13 @@ const base::Feature kScrollableTabStripButtons{ "ScrollableTabStripButtons", base::FEATURE_DISABLED_BY_DEFAULT}; +#if !defined(ANDROID) +// Changes the layout of the chrome://settings page to only show one section at +// a time, crbug.com/1204457. +const base::Feature kSettingsLandingPageRedesign{ + "SettingsLandingPageRedesign", base::FEATURE_DISABLED_BY_DEFAULT}; +#endif + // Hosts some content in a side panel. https://crbug.com/1149995 const base::Feature kSidePanel{"SidePanel", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/ui/ui_features.h b/chrome/browser/ui/ui_features.h index 76dbf0a..2d14a13 100644 --- a/chrome/browser/ui/ui_features.h +++ b/chrome/browser/ui/ui_features.h
@@ -48,6 +48,10 @@ extern const base::Feature kScrollableTabStripButtons; +#if !defined(ANDROID) +extern const base::Feature kSettingsLandingPageRedesign; +#endif + extern const base::Feature kSidePanel; extern const base::Feature kSyncConfirmationUpdatedText;
diff --git a/chrome/browser/ui/views/accessibility/caption_bubble_controller_views_browsertest.cc b/chrome/browser/ui/views/accessibility/caption_bubble_controller_views_browsertest.cc index 8e7f4deee..2d1f1ef4 100644 --- a/chrome/browser/ui/views/accessibility/caption_bubble_controller_views_browsertest.cc +++ b/chrome/browser/ui/views/accessibility/caption_bubble_controller_views_browsertest.cc
@@ -20,7 +20,9 @@ #include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/ui_test_utils.h" #include "components/live_caption/views/caption_bubble.h" +#include "content/public/browser/browser_accessibility_state.h" #include "content/public/test/browser_test.h" +#include "ui/base/buildflags.h" #include "ui/events/base_event_utils.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/views/accessibility/view_accessibility.h" @@ -950,6 +952,23 @@ EXPECT_EQ("a ", GetAXLineText()[8]); } +IN_PROC_BROWSER_TEST_F(CaptionBubbleControllerViewsTest, + AccessibleTextIsSometimesFocusable) { + OnPartialTranscription("Capybaras can sleep in water."); + + // The label is not normally focusable. + EXPECT_FALSE(GetLabel()->IsFocusable()); + + // When screen reader mode turns on on Windows, the label is focusable. It + // remains unfocusable on other OS's. + content::BrowserAccessibilityState::GetInstance()->EnableAccessibility(); +#if BUILDFLAG_INTERNAL_HAS_NATIVE_ACCESSIBILITY() && !defined(OS_MAC) + EXPECT_TRUE(GetLabel()->IsFocusable()); +#else + EXPECT_FALSE(GetLabel()->IsFocusable()); +#endif +} + IN_PROC_BROWSER_TEST_F(CaptionBubbleControllerViewsTest, HidesAfterInactivity) { // Use a ScopedMockTimeMessageLoopTaskRunner to test the inactivity timer with // a mock tick clock that replaces the default tick clock with mock time.
diff --git a/chrome/browser/ui/views/accessibility/caret_browsing_dialog_delegate.cc b/chrome/browser/ui/views/accessibility/caret_browsing_dialog_delegate.cc index 525e7b9..a8694c1e 100644 --- a/chrome/browser/ui/views/accessibility/caret_browsing_dialog_delegate.cc +++ b/chrome/browser/ui/views/accessibility/caret_browsing_dialog_delegate.cc
@@ -14,12 +14,12 @@ #include "components/constrained_window/constrained_window_views.h" #include "components/prefs/pref_service.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/text_constants.h" #include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" // static
diff --git a/chrome/browser/ui/views/accessibility/caret_browsing_dialog_delegate.h b/chrome/browser/ui/views/accessibility/caret_browsing_dialog_delegate.h index 397cfe8f..35c63d1 100644 --- a/chrome/browser/ui/views/accessibility/caret_browsing_dialog_delegate.h +++ b/chrome/browser/ui/views/accessibility/caret_browsing_dialog_delegate.h
@@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_CARET_BROWSING_DIALOG_DELEGATE_H_ #define CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_CARET_BROWSING_DIALOG_DELEGATE_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/native_widget_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class PrefService;
diff --git a/chrome/browser/ui/views/accessibility/non_accessible_image_view.cc b/chrome/browser/ui/views/accessibility/non_accessible_image_view.cc index d47e4f54..97801991 100644 --- a/chrome/browser/ui/views/accessibility/non_accessible_image_view.cc +++ b/chrome/browser/ui/views/accessibility/non_accessible_image_view.cc
@@ -6,7 +6,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" NonAccessibleImageView::NonAccessibleImageView() {}
diff --git a/chrome/browser/ui/views/accessibility/non_accessible_image_view.h b/chrome/browser/ui/views/accessibility/non_accessible_image_view.h index fcd435f..32a6038 100644 --- a/chrome/browser/ui/views/accessibility/non_accessible_image_view.h +++ b/chrome/browser/ui/views/accessibility/non_accessible_image_view.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_NON_ACCESSIBLE_IMAGE_VIEW_H_ #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" // ImageView that sets the "invisible" state on AXNodeData so that // the image is not traversed by screen readers.
diff --git a/chrome/browser/ui/views/accessibility/theme_tracking_non_accessible_image_view.cc b/chrome/browser/ui/views/accessibility/theme_tracking_non_accessible_image_view.cc index 39acdd5..61b95040 100644 --- a/chrome/browser/ui/views/accessibility/theme_tracking_non_accessible_image_view.cc +++ b/chrome/browser/ui/views/accessibility/theme_tracking_non_accessible_image_view.cc
@@ -6,7 +6,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" ThemeTrackingNonAccessibleImageView::ThemeTrackingNonAccessibleImageView( const gfx::ImageSkia& light_image,
diff --git a/chrome/browser/ui/views/accessibility/theme_tracking_non_accessible_image_view.h b/chrome/browser/ui/views/accessibility/theme_tracking_non_accessible_image_view.h index e7d8cc95..a6e19922 100644 --- a/chrome/browser/ui/views/accessibility/theme_tracking_non_accessible_image_view.h +++ b/chrome/browser/ui/views/accessibility/theme_tracking_non_accessible_image_view.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_ACCESSIBILITY_THEME_TRACKING_NON_ACCESSIBLE_IMAGE_VIEW_H_ #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/theme_tracking_image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" // ImageView that sets the "invisible" state on AXNodeData so that // the image is not traversed by screen readers. It also tracks the theme to
diff --git a/chrome/browser/ui/views/apps/app_dialog/app_dialog_view.cc b/chrome/browser/ui/views/apps/app_dialog/app_dialog_view.cc index 1548ae5..dd79186c 100644 --- a/chrome/browser/ui/views/apps/app_dialog/app_dialog_view.cc +++ b/chrome/browser/ui/views/apps/app_dialog/app_dialog_view.cc
@@ -7,11 +7,11 @@ #include <memory> #include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/image/image_skia.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" AppDialogView::AppDialogView(const gfx::ImageSkia& image) : BubbleDialogDelegateView(nullptr, views::BubbleBorder::NONE) {
diff --git a/chrome/browser/ui/views/apps/app_dialog/app_dialog_view.h b/chrome/browser/ui/views/apps/app_dialog/app_dialog_view.h index f15b9ad..716ca31 100644 --- a/chrome/browser/ui/views/apps/app_dialog/app_dialog_view.h +++ b/chrome/browser/ui/views/apps/app_dialog/app_dialog_view.h
@@ -7,9 +7,9 @@ #include <string> +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace gfx { class ImageSkia;
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_container.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_container.cc index c32e8027..7c868872 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_container.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_container.cc
@@ -12,6 +12,8 @@ #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/common/buildflags.h" #include "ui/base/accelerators/accelerator.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_types.h" #include "ui/events/event_constants.h" @@ -22,8 +24,6 @@ #include "ui/views/bubble/bubble_border.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/client_view.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc index 51e58a2..0ed40695 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
@@ -34,6 +34,7 @@ #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/manifest.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" @@ -41,7 +42,6 @@ #include "ui/views/border.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.h b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.h index 092d59d..02165872 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.h +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.h
@@ -10,7 +10,7 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "extensions/browser/extension_registry_observer.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h"
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc index 765ff4e..65ce68f 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
@@ -17,11 +17,11 @@ #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h index d38d23c85..3f60d57b 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h
@@ -13,7 +13,7 @@ #include "build/chromeos_buildflags.h" #include "chrome/browser/extensions/extension_uninstall_dialog.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" class Profile;
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.cc index 3b3a964a..d77db309 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.cc
@@ -26,6 +26,7 @@ #include "net/base/url_util.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/image/image.h" @@ -38,7 +39,6 @@ #include "ui/views/controls/link.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" namespace {
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.h b/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.h index fbb0ed9..96f34b5 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.h +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.h
@@ -11,7 +11,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/extensions/chrome_app_icon_delegate.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" class Profile;
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_label.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_label.cc index 6da438f..cb19175 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_label.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_label.cc
@@ -4,8 +4,8 @@ #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_label.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/focus_ring.h" -#include "ui/views/metadata/metadata_impl_macros.h" AppInfoLabel::AppInfoLabel(const std::u16string& text) : AppInfoLabel(text,
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_label.h b/chrome/browser/ui/views/apps/app_info_dialog/app_info_label.h index 32ea5eb..c12c36e 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_label.h +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_label.h
@@ -7,8 +7,8 @@ #include <memory> +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" // Label styled for use in AppInfo dialog so accessible users can step through // and have each line read.
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.cc index 9d2bbda..3db8354 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.cc
@@ -8,11 +8,11 @@ #include "chrome/browser/ui/browser_navigator_params.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_label.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h b/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h index b174ac0a..2a12ad74 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h
@@ -8,7 +8,7 @@ #include <memory> #include "base/macros.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h"
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc index ef121ba..8bd5ee4 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
@@ -23,6 +23,7 @@ #include "extensions/common/permissions/api_permission.h" #include "extensions/common/permissions/permissions_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/text_constants.h" @@ -32,7 +33,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" namespace {
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h index bbf66263..7fda7f5 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h
@@ -11,7 +11,7 @@ #include "base/macros.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" #include "extensions/common/permissions/permission_message_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" class Profile;
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc index 36ac08c..5cdeea4 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc
@@ -25,13 +25,13 @@ #include "extensions/common/manifest_handlers/shared_module_info.h" #include "extensions/common/manifest_url_handlers.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/combobox_model.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/controls/combobox/combobox.h" #include "ui/views/controls/label.h" #include "ui/views/controls/link.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" // A model for a combobox selecting the launch options for a hosted app.
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.h b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.h index b640284..078b95ee 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.h +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.h
@@ -13,7 +13,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" #include "extensions/common/constants.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" class LaunchOptionsComboboxModel;
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.cc index 6faafbfa..c6b52e76 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.cc
@@ -13,12 +13,12 @@ #include "components/arc/intent_helper/arc_intent_helper_bridge.h" #include "components/arc/mojom/app.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/controls/link.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.h b/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.h index 5b11291..f5bd3ed2 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.h +++ b/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.h
@@ -13,7 +13,7 @@ #include "base/scoped_observation.h" #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" class Profile;
diff --git a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc index 42ddc71..7bb80fa 100644 --- a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc +++ b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc
@@ -9,9 +9,9 @@ #include "base/win/windows_version.h" #include "extensions/browser/app_window/native_app_window.h" #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/win/hwnd_metrics.h" #include "ui/display/win/screen_win.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/win/hwnd_util.h"
diff --git a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h index 07f8ffcc..b90e08ab 100644 --- a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h +++ b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_APPS_GLASS_APP_WINDOW_FRAME_VIEW_WIN_H_ #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/insets.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/window/non_client_view.h"
diff --git a/chrome/browser/ui/views/arc_app_dialog_view.cc b/chrome/browser/ui/views/arc_app_dialog_view.cc index bd1c8f2..1872d87d 100644 --- a/chrome/browser/ui/views/arc_app_dialog_view.cc +++ b/chrome/browser/ui/views/arc_app_dialog_view.cc
@@ -19,13 +19,13 @@ #include "components/constrained_window/constrained_window_views.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/arc_data_removal_dialog_view.cc b/chrome/browser/ui/views/arc_data_removal_dialog_view.cc index 17c7dab..8faa313 100644 --- a/chrome/browser/ui/views/arc_data_removal_dialog_view.cc +++ b/chrome/browser/ui/views/arc_data_removal_dialog_view.cc
@@ -15,6 +15,8 @@ #include "components/constrained_window/constrained_window_views.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/geometry/insets.h" @@ -22,8 +24,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc b/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc index 6f069ad..b784c49 100644 --- a/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc +++ b/chrome/browser/ui/views/autofill/autofill_popup_base_view.cc
@@ -23,6 +23,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/platform/ax_platform_node.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/skia_util.h" #include "ui/native_theme/native_theme.h" @@ -31,7 +32,6 @@ #include "ui/views/bubble/bubble_border.h" #include "ui/views/focus/focus_manager.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace autofill {
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_base_view.h b/chrome/browser/ui/views/autofill/autofill_popup_base_view.h index 10316e6..62b71250 100644 --- a/chrome/browser/ui/views/autofill/autofill_popup_base_view.h +++ b/chrome/browser/ui/views/autofill/autofill_popup_base_view.h
@@ -12,8 +12,8 @@ #include "base/time/time.h" #include "build/build_config.h" #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/focus/widget_focus_manager.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_observer.h"
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc b/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc index f3680d84..a29cf53 100644 --- a/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc +++ b/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.cc
@@ -30,6 +30,8 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/favicon_size.h" @@ -51,8 +53,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/style/typography_provider.h" #include "ui/views/view.h"
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.h b/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.h index 3deb681..3789e6c 100644 --- a/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.h +++ b/chrome/browser/ui/views/autofill/autofill_popup_view_native_views.h
@@ -12,9 +12,9 @@ #include "chrome/browser/ui/autofill/autofill_popup_view.h" #include "chrome/browser/ui/views/autofill/autofill_popup_base_view.h" #include "ui/accessibility/ax_action_data.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/font_list.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class BoxLayout;
diff --git a/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.cc b/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.cc index 56a5fcd..128686b2 100644 --- a/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.cc +++ b/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.cc
@@ -23,6 +23,7 @@ #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" @@ -40,7 +41,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.h b/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.h index 586bbe0..5305caa 100644 --- a/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.h +++ b/chrome/browser/ui/views/autofill/payments/card_unmask_prompt_views.h
@@ -10,9 +10,9 @@ #include "base/macros.h" #include "chrome/browser/ui/autofill/payments/autofill_dialog_models.h" #include "components/autofill/core/browser/ui/payments/card_unmask_prompt_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/textfield/textfield_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace content {
diff --git a/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.cc b/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.cc index d727e235..4ead11fa 100644 --- a/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.cc +++ b/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.cc
@@ -32,6 +32,8 @@ #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/insets.h" @@ -47,8 +49,6 @@ #include "ui/views/controls/separator.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view_utils.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.h b/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.h index b955406..24159f9a 100644 --- a/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.h +++ b/chrome/browser/ui/views/autofill/payments/local_card_migration_dialog_view.h
@@ -8,8 +8,8 @@ #include "chrome/browser/ui/autofill/payments/local_card_migration_dialog.h" #include "chrome/browser/ui/views/autofill/payments/dialog_view_ids.h" #include "components/autofill/core/browser/ui/payments/local_card_migration_dialog_controller.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.cc b/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.cc index 6b6c180..0a82842d 100644 --- a/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.cc +++ b/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.cc
@@ -19,6 +19,7 @@ #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" @@ -26,7 +27,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.h b/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.h index 8ab6501..3e496263 100644 --- a/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.h +++ b/chrome/browser/ui/views/autofill/payments/local_card_migration_error_dialog_view.h
@@ -9,9 +9,9 @@ #include "chrome/browser/ui/autofill/payments/local_card_migration_dialog.h" #include "chrome/browser/ui/views/autofill/payments/dialog_view_ids.h" #include "components/autofill/core/browser/ui/payments/local_card_migration_dialog_controller.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/autofill/payments/migratable_card_view.cc b/chrome/browser/ui/views/autofill/payments/migratable_card_view.cc index f4a0f61..6df10c6f 100644 --- a/chrome/browser/ui/views/autofill/payments/migratable_card_view.cc +++ b/chrome/browser/ui/views/autofill/payments/migratable_card_view.cc
@@ -14,6 +14,7 @@ #include "components/strings/grit/components_strings.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/native_theme/native_theme.h" @@ -24,7 +25,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace autofill {
diff --git a/chrome/browser/ui/views/autofill/payments/migratable_card_view.h b/chrome/browser/ui/views/autofill/payments/migratable_card_view.h index f828ae7..b8c6349e 100644 --- a/chrome/browser/ui/views/autofill/payments/migratable_card_view.h +++ b/chrome/browser/ui/views/autofill/payments/migratable_card_view.h
@@ -7,7 +7,7 @@ #include "base/macros.h" #include "components/autofill/core/browser/payments/local_card_migration_manager.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/autofill/payments/payments_view_util.cc b/chrome/browser/ui/views/autofill/payments/payments_view_util.cc index 24b9f00..2e42bfc3 100644 --- a/chrome/browser/ui/views/autofill/payments/payments_view_util.cc +++ b/chrome/browser/ui/views/autofill/payments/payments_view_util.cc
@@ -12,6 +12,7 @@ #include "chrome/browser/ui/views/chrome_typography.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/image/image_skia.h" @@ -27,7 +28,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" namespace autofill {
diff --git a/chrome/browser/ui/views/autofill/payments/payments_view_util.h b/chrome/browser/ui/views/autofill/payments/payments_view_util.h index 8bcab2b..1af11a45 100644 --- a/chrome/browser/ui/views/autofill/payments/payments_view_util.h +++ b/chrome/browser/ui/views/autofill/payments/payments_view_util.h
@@ -12,8 +12,8 @@ #include "components/autofill/core/browser/ui/payments/payments_bubble_closed_reasons.h" #include "content/public/browser/web_contents.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/color_palette.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_view_impl.cc b/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_view_impl.cc index 3a0154f..edf901e 100644 --- a/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_view_impl.cc +++ b/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_view_impl.cc
@@ -11,6 +11,7 @@ #include "chrome/browser/ui/views/chrome_typography.h" #include "components/constrained_window/constrained_window_views.h" #include "components/grit/components_scaled_resources.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/background.h" @@ -19,7 +20,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view.h"
diff --git a/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_view_impl.h b/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_view_impl.h index 15cc1fe..fae235c 100644 --- a/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_view_impl.h +++ b/chrome/browser/ui/views/autofill/payments/virtual_card_selection_dialog_view_impl.h
@@ -7,7 +7,7 @@ #include "base/macros.h" #include "chrome/browser/ui/autofill/payments/virtual_card_selection_dialog_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace autofill {
diff --git a/chrome/browser/ui/views/autofill/payments/webauthn_dialog_view_impl.cc b/chrome/browser/ui/views/autofill/payments/webauthn_dialog_view_impl.cc index 1e70002..2d84a56 100644 --- a/chrome/browser/ui/views/autofill/payments/webauthn_dialog_view_impl.cc +++ b/chrome/browser/ui/views/autofill/payments/webauthn_dialog_view_impl.cc
@@ -14,9 +14,9 @@ #include "components/web_modal/web_contents_modal_dialog_host.h" #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace autofill {
diff --git a/chrome/browser/ui/views/autofill/payments/webauthn_dialog_view_impl.h b/chrome/browser/ui/views/autofill/payments/webauthn_dialog_view_impl.h index 3495602..18bf7ca1 100644 --- a/chrome/browser/ui/views/autofill/payments/webauthn_dialog_view_impl.h +++ b/chrome/browser/ui/views/autofill/payments/webauthn_dialog_view_impl.h
@@ -8,7 +8,7 @@ #include "base/macros.h" #include "chrome/browser/ui/autofill/payments/webauthn_dialog_model_observer.h" #include "chrome/browser/ui/autofill/payments/webauthn_dialog_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class AuthenticatorRequestSheetView;
diff --git a/chrome/browser/ui/views/autofill/save_address_profile_view.cc b/chrome/browser/ui/views/autofill/save_address_profile_view.cc index 18ef7c9..a1c2fad 100644 --- a/chrome/browser/ui/views/autofill/save_address_profile_view.cc +++ b/chrome/browser/ui/views/autofill/save_address_profile_view.cc
@@ -260,7 +260,8 @@ std::u16string email = profile.GetInfo(EMAIL_ADDRESS, locale); if (!email.empty()) - AddAddressSection(/*parent_view=*/address_components_view, kWebIcon, email); + AddAddressSection(/*parent_view=*/address_components_view, + vector_icons::kEmailIcon, email); if (base::FeatureList::IsEnabled( features::kAutofillAddressProfileSavePromptNicknameSupport)) {
diff --git a/chrome/browser/ui/views/autofill/update_address_profile_view.cc b/chrome/browser/ui/views/autofill/update_address_profile_view.cc index f5a20a9..1db963fa 100644 --- a/chrome/browser/ui/views/autofill/update_address_profile_view.cc +++ b/chrome/browser/ui/views/autofill/update_address_profile_view.cc
@@ -7,10 +7,11 @@ #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/autofill/save_update_address_profile_bubble_controller.h" -#include "chrome/browser/ui/views/accessibility/theme_tracking_non_accessible_image_view.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/grit/theme_resources.h" +#include "components/autofill/core/browser/autofill_address_util.h" #include "components/autofill/core/browser/data_model/autofill_profile_comparator.h" +#include "components/autofill/core/browser/field_types.h" #include "components/autofill/core/common/autofill_features.h" #include "components/vector_icons/vector_icons.h" #include "ui/gfx/paint_vector_icon.h" @@ -27,18 +28,6 @@ constexpr int kColumnSetId = 0; constexpr int kIconSize = 16; -// New and old values appear in the update prompt in the same order as the order -// of the types in this array. -const ServerFieldType user_visibe_type[] = {NAME_HONORIFIC_PREFIX, - NAME_FULL, - ADDRESS_HOME_STREET_ADDRESS, - ADDRESS_HOME_CITY, - ADDRESS_HOME_ZIP, - ADDRESS_HOME_COUNTRY, - EMAIL_ADDRESS, - PHONE_HOME_WHOLE_NUMBER, - COMPANY_NAME}; - const gfx::VectorIcon& GetVectorIconForType(ServerFieldType type) { // TODO(crbug.com/1167060): Update icons upon having final mocks. switch (type) { @@ -46,7 +35,7 @@ case NAME_HONORIFIC_PREFIX: return kUserAccountAvatarIcon; case EMAIL_ADDRESS: - return kWebIcon; + return vector_icons::kEmailIcon; case PHONE_HOME_WHOLE_NUMBER: return vector_icons::kCallIcon; default: @@ -65,10 +54,11 @@ return icon_view; } -// Creates a view that displays all values in `differences`. `are_new_values` -// decides which set of values from `differences` are displayed. +// Creates a view that displays all values in `diff_map`. `are_new_values` +// decides which set of values from `diff_map` are displayed. std::unique_ptr<views::View> CreateValuesView( - const std::vector<ProfileValueDifference>& differences, + const base::flat_map<ServerFieldType, + std::pair<std::u16string, std::u16string>>& diff_map, bool are_new_values) { auto view = std::make_unique<views::View>(); view->SetLayoutManager(std::make_unique<views::FlexLayout>()) @@ -83,7 +73,15 @@ DISTANCE_CONTROL_LIST_VERTICAL), /*horizontal=*/0)); - for (const ProfileValueDifference& difference : differences) { + for (ServerFieldType type : kVisibleTypesForProfileDifferences) { + const auto it = diff_map.find(type); + if (it == diff_map.end()) + continue; + const std::u16string& value = + are_new_values ? it->second.first : it->second.second; + // Don't add rows for empty original values. + if (value.empty()) + continue; views::View* value_row = view->AddChildView(std::make_unique<views::View>()); value_row->SetLayoutManager(std::make_unique<views::FlexLayout>()) @@ -97,33 +95,35 @@ /*horizontal=*/ChromeLayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_RELATED_CONTROL_HORIZONTAL))); + value_row->AddChildView(CreateIconViewForType(type, are_new_values)); value_row->AddChildView( - CreateIconViewForType(difference.type, are_new_values)); - value_row->AddChildView(std::make_unique<views::Label>( - are_new_values ? difference.first_value : difference.second_value, - views::style::CONTEXT_LABEL)); + std::make_unique<views::Label>(value, views::style::CONTEXT_LABEL)); } return view; } // Add a row in `layout` that contains a label and a view displays all the -// values in `differences`. `are_new_values` controls the displayed label and -// which set of values from `differences` are displayed. -void AddValuesRow(views::GridLayout* layout, - const std::vector<ProfileValueDifference>& differences, - views::Button::PressedCallback edit_button_callback) { +// values in `values`. Labels are added only if `show_row_label` is true. +void AddValuesRow( + views::GridLayout* layout, + const base::flat_map<ServerFieldType, + std::pair<std::u16string, std::u16string>>& diff_map, + bool show_row_label, + views::Button::PressedCallback edit_button_callback) { bool are_new_values = !!edit_button_callback; layout->StartRow(/*vertical_resize=*/views::GridLayout::kFixedSize, kColumnSetId); // TODO(crbug.com/1167060): Use internationalized string. - std::unique_ptr<views::Label> label(new views::Label( - are_new_values ? u"New" : u"Old", views::style::CONTEXT_LABEL, - views::style::STYLE_PRIMARY)); - layout->AddView(std::move(label), /*col_span=*/1, /*row_span=*/1, - /*h_align=*/views::GridLayout::LEADING, - /*v_align=*/views::GridLayout::LEADING); - layout->AddView(CreateValuesView(differences, are_new_values), + if (show_row_label) { + std::unique_ptr<views::Label> label(new views::Label( + are_new_values ? u"New" : u"Old", views::style::CONTEXT_LABEL, + views::style::STYLE_PRIMARY)); + layout->AddView(std::move(label), /*col_span=*/1, /*row_span=*/1, + /*h_align=*/views::GridLayout::LEADING, + /*v_align=*/views::GridLayout::LEADING); + } + layout->AddView(CreateValuesView(diff_map, are_new_values), /*col_span=*/1, /*row_span=*/1, /*h_align=*/views::GridLayout::FILL, @@ -141,6 +141,19 @@ } } +// Returns true if there is there is at least one entry in `diff_map` with +// non-empty second value. +bool HasNonEmptySecondValues( + const base::flat_map<ServerFieldType, + std::pair<std::u16string, std::u16string>>& diff_map) { + return base::ranges::any_of( + diff_map, + [](const std::pair<autofill::ServerFieldType, + std::pair<std::u16string, std::u16string>>& entry) { + return !entry.second.second.empty(); + }); +} + } // namespace UpdateAddressProfileView::UpdateAddressProfileView( @@ -155,6 +168,9 @@ // would have been a save prompt. DCHECK(controller_->GetOriginalProfile()); + set_fixed_width(views::LayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_BUBBLE_PREFERRED_WIDTH)); + SetAcceptCallback(base::BindOnce( &SaveUpdateAddressProfileBubbleController::OnUserDecision, base::Unretained(controller_), @@ -164,34 +180,54 @@ base::Unretained(controller_), AutofillClient::SaveAddressProfileOfferUserDecision::kDeclined)); + SetLayoutManager(std::make_unique<views::FlexLayout>()) + ->SetOrientation(views::LayoutOrientation::kVertical) + .SetCrossAxisAlignment(views::LayoutAlignment::kStretch) + .SetIgnoreDefaultMainAxisMargins(true) + .SetCollapseMargins(true) + .SetDefault( + views::kMarginsKey, + gfx::Insets( + /*vertical=*/ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_CONTROL_LIST_VERTICAL), + /*horizontal=*/0)); + + views::Label* subtitle_label = AddChildView(std::make_unique<views::Label>( + GetDescriptionForProfileToUpdate( + *controller_->GetOriginalProfile(), + g_browser_process->GetApplicationLocale()), + views::style::CONTEXT_LABEL, views::style::STYLE_SECONDARY)); + subtitle_label->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT); + + views::View* main_content_view = + AddChildView(std::make_unique<views::View>()); + base::flat_map<ServerFieldType, std::pair<std::u16string, std::u16string>> - differences = + profile_diff_map = AutofillProfileComparator::GetSettingsVisibleProfileDifferenceMap( controller_->GetProfileToSave(), *controller_->GetOriginalProfile(), g_browser_process->GetApplicationLocale()); - std::vector<ProfileValueDifference> diff_vector; - for (auto type : user_visibe_type) { - const auto it = differences.find(type); - if (it == differences.end()) - continue; - diff_vector.emplace_back( - ProfileValueDifference{type, it->second.first, it->second.second}); - } + + bool has_non_empty_original_values = + HasNonEmptySecondValues(profile_diff_map); // Build the GridLayout column set. - views::GridLayout* layout = - SetLayoutManager(std::make_unique<views::GridLayout>()); + views::GridLayout* layout = main_content_view->SetLayoutManager( + std::make_unique<views::GridLayout>()); views::ColumnSet* column_set = layout->AddColumnSet(kColumnSetId); const int column_divider = ChromeLayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_RELATED_CONTROL_HORIZONTAL); - column_set->AddColumn( - /*h_align=*/views::GridLayout::LEADING, - /*v_align=*/views::GridLayout::LEADING, - /*resize_percent=*/views::GridLayout::kFixedSize, - /*size_type=*/views::GridLayout::ColumnSize::kUsePreferred, - /*fixed_width=*/0, /*min_width=*/0); - column_set->AddPaddingColumn(views::GridLayout::kFixedSize, column_divider); + if (has_non_empty_original_values) { + // Label column exists only if there is a section for original values. + column_set->AddColumn( + /*h_align=*/views::GridLayout::LEADING, + /*v_align=*/views::GridLayout::LEADING, + /*resize_percent=*/views::GridLayout::kFixedSize, + /*size_type=*/views::GridLayout::ColumnSize::kUsePreferred, + /*fixed_width=*/0, /*min_width=*/0); + column_set->AddPaddingColumn(views::GridLayout::kFixedSize, column_divider); + } column_set->AddColumn( /*h_align=*/views::GridLayout::FILL, /*v_align=*/views::GridLayout::FILL, @@ -206,17 +242,20 @@ /*fixed_width=*/0, /*min_width=*/0); AddValuesRow( - layout, diff_vector, + layout, profile_diff_map, + /*show_row_label=*/has_non_empty_original_values, /*edit_button_callback=*/ base::BindRepeating( &SaveUpdateAddressProfileBubbleController::OnEditButtonClicked, base::Unretained(controller_))); - layout->AddPaddingRow(views::GridLayout::kFixedSize, - ChromeLayoutProvider::Get()->GetDistanceMetric( - DISTANCE_CONTROL_LIST_VERTICAL)); - AddValuesRow(layout, diff_vector, /*edit_button_callback=*/{}); - // TODO(crbug.com/1167060): Add support for dark mode. + if (has_non_empty_original_values) { + layout->AddPaddingRow(views::GridLayout::kFixedSize, + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_CONTROL_LIST_VERTICAL)); + AddValuesRow(layout, profile_diff_map, /*show_row_label=*/true, + /*edit_button_callback=*/{}); + } } bool UpdateAddressProfileView::ShouldShowCloseButton() const {
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index f047cb0..ef558ab 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -80,6 +80,8 @@ #include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/page_transition_types.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/resource/resource_bundle.h" @@ -113,8 +115,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/separator.h" #include "ui/views/drag_utils.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/metrics.h" #include "ui/views/view_constants.h" #include "ui/views/widget/tooltip_manager.h"
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h index d0b60e2..f54ae8f 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h
@@ -19,13 +19,13 @@ #include "components/bookmarks/browser/bookmark_model_observer.h" #include "components/bookmarks/browser/bookmark_node_data.h" #include "components/prefs/pref_change_registrar.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/slide_animation.h" #include "ui/views/accessible_pane_view.h" #include "ui/views/animation/animation_delegate_views.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/menu/menu_types.h" #include "ui/views/drag_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" class BookmarkBarViewObserver;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc index 34e403a..3a80edd 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
@@ -29,6 +29,7 @@ #include "components/user_prefs/user_prefs.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/views/background.h" #include "ui/views/controls/button/md_text_button.h" @@ -39,7 +40,6 @@ #include "ui/views/controls/tree/tree_view.h" #include "ui/views/focus/focus_manager.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h index 1a414cf..a0963e6 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.h
@@ -16,13 +16,13 @@ #include "chrome/browser/ui/bookmarks/bookmark_editor.h" #include "components/bookmarks/browser/bookmark_expanded_state_tracker.h" #include "components/bookmarks/browser/bookmark_model_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/simple_menu_model.h" #include "ui/base/models/tree_node_model.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield_controller.h" #include "ui/views/controls/tree/tree_view_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace views {
diff --git a/chrome/browser/ui/views/borealis/borealis_installer_view.cc b/chrome/browser/ui/views/borealis/borealis_installer_view.cc index 2baac831..2d7efe9 100644 --- a/chrome/browser/ui/views/borealis/borealis_installer_view.cc +++ b/chrome/browser/ui/views/borealis/borealis_installer_view.cc
@@ -28,6 +28,8 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/aura/window.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/geometry/insets.h" #include "ui/strings/grit/ui_strings.h" @@ -36,8 +38,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/progress_bar.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace {
diff --git a/chrome/browser/ui/views/borealis/borealis_installer_view.h b/chrome/browser/ui/views/borealis/borealis_installer_view.h index 123f4ff9..703c6b0 100644 --- a/chrome/browser/ui/views/borealis/borealis_installer_view.h +++ b/chrome/browser/ui/views/borealis/borealis_installer_view.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "chrome/browser/ash/borealis/borealis_installer.h" #include "chrome/browser/ash/borealis/borealis_metrics.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace views {
diff --git a/chrome/browser/ui/views/bubble/webui_bubble_dialog_view.cc b/chrome/browser/ui/views/bubble/webui_bubble_dialog_view.cc index 82535f0..ce3805a 100644 --- a/chrome/browser/ui/views/bubble/webui_bubble_dialog_view.cc +++ b/chrome/browser/ui/views/bubble/webui_bubble_dialog_view.cc
@@ -7,11 +7,11 @@ #include "content/public/browser/keyboard_event_processing_result.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/visibility.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/rounded_corners_f.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace {
diff --git a/chrome/browser/ui/views/bubble/webui_bubble_dialog_view.h b/chrome/browser/ui/views/bubble/webui_bubble_dialog_view.h index 107dc2e..0fc3a4e0 100644 --- a/chrome/browser/ui/views/bubble/webui_bubble_dialog_view.h +++ b/chrome/browser/ui/views/bubble/webui_bubble_dialog_view.h
@@ -7,9 +7,9 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/views/bubble/bubble_contents_wrapper.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_observer.h"
diff --git a/chrome/browser/ui/views/bubble_menu_item_factory.cc b/chrome/browser/ui/views/bubble_menu_item_factory.cc index 089c79d9..559a2b7 100644 --- a/chrome/browser/ui/views/bubble_menu_item_factory.cc +++ b/chrome/browser/ui/views/bubble_menu_item_factory.cc
@@ -6,12 +6,12 @@ #include "chrome/browser/ui/views/hover_button.h" #include "chrome/browser/ui/views/hover_button_controller.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/animation/ink_drop_host_view.h" #include "ui/views/border.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view.h"
diff --git a/chrome/browser/ui/views/bulleted_label_list_view.cc b/chrome/browser/ui/views/bulleted_label_list_view.cc index 993ef50..eab96787 100644 --- a/chrome/browser/ui/views/bulleted_label_list_view.cc +++ b/chrome/browser/ui/views/bulleted_label_list_view.cc
@@ -5,11 +5,11 @@ #include "chrome/browser/ui/views/bulleted_label_list_view.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/views/controls/label.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace { constexpr int kColumnSetId = 0;
diff --git a/chrome/browser/ui/views/bulleted_label_list_view.h b/chrome/browser/ui/views/bulleted_label_list_view.h index 6cb761f..c579463 100644 --- a/chrome/browser/ui/views/bulleted_label_list_view.h +++ b/chrome/browser/ui/views/bulleted_label_list_view.h
@@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_VIEWS_BULLETED_LABEL_LIST_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_BULLETED_LABEL_LIST_VIEW_H_ -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class BulletedLabelListView : public views::View {
diff --git a/chrome/browser/ui/views/certificate_selector.cc b/chrome/browser/ui/views/certificate_selector.cc index ae4a730..f7a9164 100644 --- a/chrome/browser/ui/views/certificate_selector.cc +++ b/chrome/browser/ui/views/certificate_selector.cc
@@ -24,13 +24,13 @@ #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/table_model.h" #include "ui/base/models/table_model_observer.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/controls/table/table_view.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/ui/views/certificate_selector.h b/chrome/browser/ui/views/certificate_selector.h index 8ae2fc2..cd3dcf5 100644 --- a/chrome/browser/ui/views/certificate_selector.h +++ b/chrome/browser/ui/views/certificate_selector.h
@@ -10,8 +10,8 @@ #include "base/macros.h" #include "net/ssl/client_cert_identity.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/table/table_view_observer.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace content {
diff --git a/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc b/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc index 4fd7f22..6fa5e9b 100644 --- a/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc +++ b/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc
@@ -15,6 +15,7 @@ #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_types.h" #include "ui/events/event.h" #include "ui/gfx/geometry/insets.h" @@ -26,7 +27,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace chrome {
diff --git a/chrome/browser/ui/views/chrome_cleaner_dialog_win.h b/chrome/browser/ui/views/chrome_cleaner_dialog_win.h index 9413d12a..5b0cfe9 100644 --- a/chrome/browser/ui/views/chrome_cleaner_dialog_win.h +++ b/chrome/browser/ui/views/chrome_cleaner_dialog_win.h
@@ -7,7 +7,7 @@ #include "base/macros.h" #include "chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_controller_win.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class Browser;
diff --git a/chrome/browser/ui/views/chrome_cleaner_reboot_dialog_win.cc b/chrome/browser/ui/views/chrome_cleaner_reboot_dialog_win.cc index e8faced..a209d489 100644 --- a/chrome/browser/ui/views/chrome_cleaner_reboot_dialog_win.cc +++ b/chrome/browser/ui/views/chrome_cleaner_reboot_dialog_win.cc
@@ -14,6 +14,7 @@ #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_types.h" #include "ui/events/event.h" #include "ui/gfx/geometry/insets.h" @@ -21,7 +22,6 @@ #include "ui/gfx/text_constants.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace chrome {
diff --git a/chrome/browser/ui/views/chrome_cleaner_reboot_dialog_win.h b/chrome/browser/ui/views/chrome_cleaner_reboot_dialog_win.h index d3dac47..29f02b9 100644 --- a/chrome/browser/ui/views/chrome_cleaner_reboot_dialog_win.h +++ b/chrome/browser/ui/views/chrome_cleaner_reboot_dialog_win.h
@@ -6,9 +6,9 @@ #define CHROME_BROWSER_UI_VIEWS_CHROME_CLEANER_REBOOT_DIALOG_WIN_H_ #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class Browser;
diff --git a/chrome/browser/ui/views/collected_cookies_views.cc b/chrome/browser/ui/views/collected_cookies_views.cc index 8a57911f..2c754ae2 100644 --- a/chrome/browser/ui/views/collected_cookies_views.cc +++ b/chrome/browser/ui/views/collected_cookies_views.cc
@@ -34,6 +34,8 @@ #include "content/public/browser/web_contents.h" #include "net/cookies/canonical_cookie.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/insets.h" @@ -48,8 +50,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace {
diff --git a/chrome/browser/ui/views/collected_cookies_views.h b/chrome/browser/ui/views/collected_cookies_views.h index 78fd1105..d4b8d2f9 100644 --- a/chrome/browser/ui/views/collected_cookies_views.h +++ b/chrome/browser/ui/views/collected_cookies_views.h
@@ -11,9 +11,9 @@ #include "base/macros.h" #include "components/content_settings/core/common/content_settings.h" #include "content/public/browser/web_contents_user_data.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" #include "ui/views/controls/tree/tree_view_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class CookieInfoView;
diff --git a/chrome/browser/ui/views/commander_frontend_views.cc b/chrome/browser/ui/views/commander_frontend_views.cc index 2b5c41c..ddca850 100644 --- a/chrome/browser/ui/views/commander_frontend_views.cc +++ b/chrome/browser/ui/views/commander_frontend_views.cc
@@ -21,10 +21,10 @@ #include "chrome/common/webui_url_constants.h" #include "chrome/grit/generated_resources.h" #include "content/public/browser/notification_service.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/chrome/browser/ui/views/confirm_bubble_views.cc b/chrome/browser/ui/views/confirm_bubble_views.cc index 8b76d79d..84fb9e1 100644 --- a/chrome/browser/ui/views/confirm_bubble_views.cc +++ b/chrome/browser/ui/views/confirm_bubble_views.cc
@@ -17,12 +17,12 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/base/buildflags.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/button/image_button_factory.h" #include "ui/views/controls/label.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/confirm_bubble_views.h b/chrome/browser/ui/views/confirm_bubble_views.h index 3ebe63f1..8f16d26 100644 --- a/chrome/browser/ui/views/confirm_bubble_views.h +++ b/chrome/browser/ui/views/confirm_bubble_views.h
@@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class ConfirmBubbleModel;
diff --git a/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc b/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc index 8473f26..0d4ed61 100644 --- a/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc +++ b/chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc
@@ -19,10 +19,10 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc index 553631f7..dd6e56d 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -25,6 +25,8 @@ #include "content/public/browser/web_contents.h" #include "ui/base/cursor/cursor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/combobox_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_utils.h" @@ -46,8 +48,6 @@ #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/native_cursor.h" namespace {
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.h b/chrome/browser/ui/views/content_setting_bubble_contents.h index 87374d1..19d2ab8 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.h +++ b/chrome/browser/ui/views/content_setting_bubble_contents.h
@@ -13,10 +13,10 @@ #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" #include "components/content_settings/core/common/content_settings_types.h" #include "content/public/browser/web_contents_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/button/radio_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class Combobox;
diff --git a/chrome/browser/ui/views/content_setting_domain_list_view.cc b/chrome/browser/ui/views/content_setting_domain_list_view.cc index 7fb91f2..fb9c0cb 100644 --- a/chrome/browser/ui/views/content_setting_domain_list_view.cc +++ b/chrome/browser/ui/views/content_setting_domain_list_view.cc
@@ -7,10 +7,10 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/views/bulleted_label_list_view.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" ContentSettingDomainListView::ContentSettingDomainListView( const std::u16string& title,
diff --git a/chrome/browser/ui/views/content_setting_domain_list_view.h b/chrome/browser/ui/views/content_setting_domain_list_view.h index 7e70bc51..c8353d8 100644 --- a/chrome/browser/ui/views/content_setting_domain_list_view.h +++ b/chrome/browser/ui/views/content_setting_domain_list_view.h
@@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_DOMAIN_LIST_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_CONTENT_SETTING_DOMAIN_LIST_VIEW_H_ -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class ContentSettingDomainListView : public views::View {
diff --git a/chrome/browser/ui/views/cookie_info_view.cc b/chrome/browser/ui/views/cookie_info_view.cc index b121dfa..79e81788 100644 --- a/chrome/browser/ui/views/cookie_info_view.cc +++ b/chrome/browser/ui/views/cookie_info_view.cc
@@ -18,14 +18,14 @@ #include "net/cookies/canonical_cookie.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/native_theme/native_theme.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/dialog_delegate.h" namespace {
diff --git a/chrome/browser/ui/views/cookie_info_view.h b/chrome/browser/ui/views/cookie_info_view.h index df47a395..0b6a31e76 100644 --- a/chrome/browser/ui/views/cookie_info_view.h +++ b/chrome/browser/ui/views/cookie_info_view.h
@@ -12,8 +12,8 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/scroll_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class GridLayout;
diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index c7b44a7..bf0ea0e 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc
@@ -19,10 +19,10 @@ #include "components/prefs/pref_service.h" #include "extensions/common/extension.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/label.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #if defined(OS_WIN) #include "base/win/shortcut.h"
diff --git a/chrome/browser/ui/views/create_application_shortcut_view.h b/chrome/browser/ui/views/create_application_shortcut_view.h index 9f4c4a1..5c88437d 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.h +++ b/chrome/browser/ui/views/create_application_shortcut_view.h
@@ -12,7 +12,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/web_applications/components/web_app_shortcut.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class Profile;
diff --git a/chrome/browser/ui/views/critical_notification_bubble_view.cc b/chrome/browser/ui/views/critical_notification_bubble_view.cc index f4ec642..b1a580fa 100644 --- a/chrome/browser/ui/views/critical_notification_bubble_view.cc +++ b/chrome/browser/ui/views/critical_notification_bubble_view.cc
@@ -21,11 +21,11 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/critical_notification_bubble_view.h b/chrome/browser/ui/views/critical_notification_bubble_view.h index 82cb81af..38cf3ae 100644 --- a/chrome/browser/ui/views/critical_notification_bubble_view.h +++ b/chrome/browser/ui/views/critical_notification_bubble_view.h
@@ -7,8 +7,8 @@ #include "base/macros.h" #include "base/timer/timer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class CriticalNotificationBubbleView : public views::BubbleDialogDelegateView { public:
diff --git a/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.cc b/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.cc index 7e04046..fd02587 100644 --- a/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.cc +++ b/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.cc
@@ -12,11 +12,11 @@ #include "chrome/grit/generated_resources.h" #include "content/public/browser/network_service_instance.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/chromeos/devicetype_utils.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace {
diff --git a/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.h b/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.h index 87c4598f..073f9132 100644 --- a/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.h +++ b/chrome/browser/ui/views/crostini/crostini_ansible_software_config_view.h
@@ -6,11 +6,11 @@ #define CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_ANSIBLE_SOFTWARE_CONFIG_VIEW_H_ #include "chrome/browser/ash/crostini/ansible/ansible_management_service.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/label.h" #include "ui/views/controls/progress_bar.h" -#include "ui/views/metadata/metadata_header_macros.h" class Profile;
diff --git a/chrome/browser/ui/views/crostini/crostini_force_close_view.cc b/chrome/browser/ui/views/crostini/crostini_force_close_view.cc index 372bdc2..755fc3c9 100644 --- a/chrome/browser/ui/views/crostini/crostini_force_close_view.cc +++ b/chrome/browser/ui/views/crostini/crostini_force_close_view.cc
@@ -8,11 +8,11 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace crostini {
diff --git a/chrome/browser/ui/views/crostini/crostini_force_close_view.h b/chrome/browser/ui/views/crostini/crostini_force_close_view.h index 4d14add4..50c68ad 100644 --- a/chrome/browser/ui/views/crostini/crostini_force_close_view.h +++ b/chrome/browser/ui/views/crostini/crostini_force_close_view.h
@@ -6,11 +6,11 @@ #define CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_FORCE_CLOSE_VIEW_H_ #include "base/callback.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include <string>
diff --git a/chrome/browser/ui/views/crostini/crostini_package_install_failure_view.cc b/chrome/browser/ui/views/crostini/crostini_package_install_failure_view.cc index 51c1670..dad1fc0 100644 --- a/chrome/browser/ui/views/crostini/crostini_package_install_failure_view.cc +++ b/chrome/browser/ui/views/crostini/crostini_package_install_failure_view.cc
@@ -10,12 +10,12 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/text_constants.h" #include "ui/views/controls/label.h" #include "ui/views/controls/message_box_view.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace crostini {
diff --git a/chrome/browser/ui/views/crostini/crostini_package_install_failure_view.h b/chrome/browser/ui/views/crostini/crostini_package_install_failure_view.h index 8d2fe59..731a875 100644 --- a/chrome/browser/ui/views/crostini/crostini_package_install_failure_view.h +++ b/chrome/browser/ui/views/crostini/crostini_package_install_failure_view.h
@@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_PACKAGE_INSTALL_FAILURE_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_PACKAGE_INSTALL_FAILURE_VIEW_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" // Displays error information when the user fails to install a package. class CrostiniPackageInstallFailureView
diff --git a/chrome/browser/ui/views/crostini/crostini_recovery_view.cc b/chrome/browser/ui/views/crostini/crostini_recovery_view.cc index 7eafe532..eb6452f 100644 --- a/chrome/browser/ui/views/crostini/crostini_recovery_view.cc +++ b/chrome/browser/ui/views/crostini/crostini_recovery_view.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/chromeos/devicetype_utils.h" #include "ui/strings/grit/ui_strings.h" @@ -21,7 +22,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/crostini/crostini_recovery_view.h b/chrome/browser/ui/views/crostini/crostini_recovery_view.h index 9b205831..728e00a2 100644 --- a/chrome/browser/ui/views/crostini/crostini_recovery_view.h +++ b/chrome/browser/ui/views/crostini/crostini_recovery_view.h
@@ -8,8 +8,8 @@ #include "chrome/browser/chromeos/crostini/crostini_simple_types.h" #include "chrome/browser/chromeos/crostini/crostini_util.h" #include "storage/browser/file_system/file_system_url.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace crostini { enum class CrostiniResult;
diff --git a/chrome/browser/ui/views/crostini/crostini_uninstaller_view.cc b/chrome/browser/ui/views/crostini/crostini_uninstaller_view.cc index 716f506..4f96b6a 100644 --- a/chrome/browser/ui/views/crostini/crostini_uninstaller_view.cc +++ b/chrome/browser/ui/views/crostini/crostini_uninstaller_view.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/chromeos/devicetype_utils.h" #include "ui/strings/grit/ui_strings.h" @@ -22,7 +23,6 @@ #include "ui/views/controls/progress_bar.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/crostini/crostini_uninstaller_view.h b/chrome/browser/ui/views/crostini/crostini_uninstaller_view.h index e633bb9..54c105a 100644 --- a/chrome/browser/ui/views/crostini/crostini_uninstaller_view.h +++ b/chrome/browser/ui/views/crostini/crostini_uninstaller_view.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_UNINSTALLER_VIEW_H_ #include "base/callback_helpers.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class Label;
diff --git a/chrome/browser/ui/views/crostini/crostini_update_component_view.cc b/chrome/browser/ui/views/crostini/crostini_update_component_view.cc index f3ca876..5898771 100644 --- a/chrome/browser/ui/views/crostini/crostini_update_component_view.cc +++ b/chrome/browser/ui/views/crostini/crostini_update_component_view.cc
@@ -13,6 +13,7 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/chromeos/devicetype_utils.h" #include "ui/strings/grit/ui_strings.h" @@ -20,7 +21,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/crostini/crostini_update_component_view.h b/chrome/browser/ui/views/crostini/crostini_update_component_view.h index bb522b3a..18f2e0e 100644 --- a/chrome/browser/ui/views/crostini/crostini_update_component_view.h +++ b/chrome/browser/ui/views/crostini/crostini_update_component_view.h
@@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_UPDATE_COMPONENT_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_UPDATE_COMPONENT_VIEW_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace crostini { enum class CrostiniResult;
diff --git a/chrome/browser/ui/views/crostini/crostini_update_filesystem_view.cc b/chrome/browser/ui/views/crostini/crostini_update_filesystem_view.cc index c02f491..37c12c9 100644 --- a/chrome/browser/ui/views/crostini/crostini_update_filesystem_view.cc +++ b/chrome/browser/ui/views/crostini/crostini_update_filesystem_view.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/chromeos/devicetype_utils.h" #include "ui/strings/grit/ui_strings.h" @@ -22,7 +23,6 @@ #include "ui/views/controls/progress_bar.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/crostini/crostini_update_filesystem_view.h b/chrome/browser/ui/views/crostini/crostini_update_filesystem_view.h index f7a5ac9f..b911b26 100644 --- a/chrome/browser/ui/views/crostini/crostini_update_filesystem_view.h +++ b/chrome/browser/ui/views/crostini/crostini_update_filesystem_view.h
@@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_UPDATE_FILESYSTEM_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_CROSTINI_CROSTINI_UPDATE_FILESYSTEM_VIEW_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class Profile;
diff --git a/chrome/browser/ui/views/crypto_module_password_dialog_view.cc b/chrome/browser/ui/views/crypto_module_password_dialog_view.cc index 28cbb75..1699b2f52 100644 --- a/chrome/browser/ui/views/crypto_module_password_dialog_view.cc +++ b/chrome/browser/ui/views/crypto_module_password_dialog_view.cc
@@ -10,11 +10,11 @@ #include "chrome/grit/generated_resources.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" ////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/views/crypto_module_password_dialog_view.h b/chrome/browser/ui/views/crypto_module_password_dialog_view.h index a4974a6..5362501 100644 --- a/chrome/browser/ui/views/crypto_module_password_dialog_view.h +++ b/chrome/browser/ui/views/crypto_module_password_dialog_view.h
@@ -10,8 +10,8 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "chrome/browser/ui/crypto_module_password_dialog.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/textfield/textfield_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace views {
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_list_controller.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_list_controller.cc index 46baf90..509712f 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_list_controller.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_list_controller.cc
@@ -13,7 +13,7 @@ #include "chrome/common/chrome_switches.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" BEGIN_METADATA(DesktopMediaListController, ListView, views::View) END_METADATA
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc index fb9f50ce..347d8111 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
@@ -34,6 +34,7 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents_delegate.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/insets.h" @@ -41,7 +42,6 @@ #include "ui/views/controls/scroll_view.h" #include "ui/views/controls/tabbed_pane/tabbed_pane.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #if defined(USE_AURA)
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h index 3c03cf1e..2567707 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h
@@ -9,9 +9,9 @@ #include "build/build_config.h" #include "chrome/browser/media/webrtc/desktop_media_picker.h" #include "chrome/browser/ui/views/desktop_capture/desktop_media_list_controller.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/label.h" #include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace views {
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc index ec73536a..ec4b496 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.cc
@@ -9,13 +9,13 @@ #include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/native_theme/native_theme.h" #include "ui/views/background.h" #include "ui/views/controls/focus_ring.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_utils.h" using content::DesktopMediaID;
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h b/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h index a33b907..f457fc1 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h
@@ -6,11 +6,11 @@ #define CHROME_BROWSER_UI_VIEWS_DESKTOP_CAPTURE_DESKTOP_MEDIA_SOURCE_VIEW_H_ #include "content/public/browser/desktop_media_id.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/text_constants.h" #include "ui/views/controls/focus_ring.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_tab_list.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_tab_list.cc index 66a30e3ba..d927c93 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_tab_list.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_tab_list.cc
@@ -6,6 +6,7 @@ #include "base/numerics/ranges.h" #include "base/numerics/safe_conversions.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/favicon_size.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/border.h" @@ -13,7 +14,6 @@ #include "ui/views/controls/table/table_view.h" #include "ui/views/controls/table/table_view_observer.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" namespace {
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_tab_list.h b/chrome/browser/ui/views/desktop_capture/desktop_media_tab_list.h index 414ae07..22886b4 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_tab_list.h +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_tab_list.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_DESKTOP_CAPTURE_DESKTOP_MEDIA_TAB_LIST_H_ #include "chrome/browser/ui/views/desktop_capture/desktop_media_list_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace views { class TableView;
diff --git a/chrome/browser/ui/views/device_chooser_content_view.cc b/chrome/browser/ui/views/device_chooser_content_view.cc index c54d36e6..9bd6238 100644 --- a/chrome/browser/ui/views/device_chooser_content_view.cc +++ b/chrome/browser/ui/views/device_chooser_content_view.cc
@@ -16,6 +16,7 @@ #include "components/strings/grit/components_strings.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/point.h" @@ -35,7 +36,6 @@ #include "ui/views/controls/throbber.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" DeviceChooserContentView::DeviceChooserContentView(
diff --git a/chrome/browser/ui/views/device_chooser_content_view.h b/chrome/browser/ui/views/device_chooser_content_view.h index 12a9752..442d8e52 100644 --- a/chrome/browser/ui/views/device_chooser_content_view.h +++ b/chrome/browser/ui/views/device_chooser_content_view.h
@@ -9,9 +9,9 @@ #include <string> #include "chrome/browser/chooser_controller/chooser_controller.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/table_model.h" #include "ui/gfx/range/range.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/download/download_danger_prompt_views.cc b/chrome/browser/ui/views/download/download_danger_prompt_views.cc index f501cc5..04c613e 100644 --- a/chrome/browser/ui/views/download/download_danger_prompt_views.cc +++ b/chrome/browser/ui/views/download/download_danger_prompt_views.cc
@@ -24,11 +24,11 @@ #include "content/public/browser/web_contents.h" #include "ui/base/buildflags.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/dialog_delegate.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc b/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc index ae2e2f8..e96c12b 100644 --- a/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc +++ b/chrome/browser/ui/views/download/download_in_progress_dialog_view.cc
@@ -11,10 +11,10 @@ #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/size.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" // static void DownloadInProgressDialogView::Show(
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc index bbea8d4..b62168f 100644 --- a/chrome/browser/ui/views/download/download_item_view.cc +++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -60,6 +60,8 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/time_format.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/text/bytes_formatting.h" #include "ui/base/theme_provider.h" #include "ui/base/ui_base_types.h" @@ -92,8 +94,6 @@ #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/controls/label.h" #include "ui/views/controls/styled_label.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/vector_icons.h" #include "ui/views/widget/root_view.h"
diff --git a/chrome/browser/ui/views/download/download_item_view.h b/chrome/browser/ui/views/download/download_item_view.h index 82a1f02a..1706894 100644 --- a/chrome/browser/ui/views/download/download_item_view.h +++ b/chrome/browser/ui/views/download/download_item_view.h
@@ -21,6 +21,7 @@ #include "chrome/browser/download/download_ui_model.h" #include "chrome/browser/icon_loader.h" #include "chrome/browser/ui/views/download/download_shelf_context_menu_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/image_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_types.h" @@ -32,7 +33,6 @@ #include "ui/views/animation/animation_delegate_views.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" class DownloadShelfView;
diff --git a/chrome/browser/ui/views/download/download_shelf_view.cc b/chrome/browser/ui/views/download/download_shelf_view.cc index 7ee21e37..ed3555d 100644 --- a/chrome/browser/ui/views/download/download_shelf_view.cc +++ b/chrome/browser/ui/views/download/download_shelf_view.cc
@@ -28,6 +28,7 @@ #include "components/vector_icons/vector_icons.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/gfx/animation/animation.h" #include "ui/gfx/animation/tween.h" @@ -42,7 +43,6 @@ #include "ui/views/controls/button/md_text_button.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/focus/focus_manager.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/download/download_shelf_view.h b/chrome/browser/ui/views/download/download_shelf_view.h index d2b45aa..91fde2c 100644 --- a/chrome/browser/ui/views/download/download_shelf_view.h +++ b/chrome/browser/ui/views/download/download_shelf_view.h
@@ -9,12 +9,12 @@ #include <vector> #include "chrome/browser/download/download_shelf.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/accessible_pane_view.h" #include "ui/views/animation/animation_delegate_views.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/mouse_watcher.h" #include "ui/views/mouse_watcher_view_host.h"
diff --git a/chrome/browser/ui/views/download/download_started_animation_views.cc b/chrome/browser/ui/views/download/download_started_animation_views.cc index e5714a0..e36cc4b 100644 --- a/chrome/browser/ui/views/download/download_started_animation_views.cc +++ b/chrome/browser/ui/views/download/download_started_animation_views.cc
@@ -8,14 +8,14 @@ #include "base/time/time.h" #include "chrome/app/vector_icons/vector_icons.h" #include "content/public/browser/web_contents.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" // How long to spend moving downwards and fading out after waiting.
diff --git a/chrome/browser/ui/views/extensions/chooser_dialog_view.cc b/chrome/browser/ui/views/extensions/chooser_dialog_view.cc index acfd645..4f1cad4 100644 --- a/chrome/browser/ui/views/extensions/chooser_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/chooser_dialog_view.cc
@@ -16,6 +16,7 @@ #include "components/constrained_window/constrained_window_views.h" #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "content/public/browser/browser_thread.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/background.h" #include "ui/views/border.h" @@ -23,7 +24,6 @@ #include "ui/views/controls/link.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" ChooserDialogView::ChooserDialogView( std::unique_ptr<ChooserController> chooser_controller) {
diff --git a/chrome/browser/ui/views/extensions/chooser_dialog_view.h b/chrome/browser/ui/views/extensions/chooser_dialog_view.h index 6e50908..31b0e0e8 100644 --- a/chrome/browser/ui/views/extensions/chooser_dialog_view.h +++ b/chrome/browser/ui/views/extensions/chooser_dialog_view.h
@@ -8,8 +8,8 @@ #include <memory> #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/table/table_view_observer.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class ChooserController;
diff --git a/chrome/browser/ui/views/extensions/expandable_container_view.cc b/chrome/browser/ui/views/extensions/expandable_container_view.cc index 90da56b9..4365a63 100644 --- a/chrome/browser/ui/views/extensions/expandable_container_view.cc +++ b/chrome/browser/ui/views/extensions/expandable_container_view.cc
@@ -11,11 +11,11 @@ #include "chrome/browser/ui/views/chrome_typography.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/label.h" #include "ui/views/controls/link.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" // ExpandableContainerView::DetailsView ---------------------------------------- ExpandableContainerView::DetailsView::~DetailsView() = default;
diff --git a/chrome/browser/ui/views/extensions/expandable_container_view.h b/chrome/browser/ui/views/extensions/expandable_container_view.h index 45b2e63..609e492 100644 --- a/chrome/browser/ui/views/extensions/expandable_container_view.h +++ b/chrome/browser/ui/views/extensions/expandable_container_view.h
@@ -8,7 +8,7 @@ #include <string> #include <vector> -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/extensions/extension_install_blocked_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_blocked_dialog_view.cc index 885c2594..01387ef 100644 --- a/chrome/browser/ui/views/extensions/extension_install_blocked_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_install_blocked_dialog_view.cc
@@ -21,6 +21,7 @@ #include "content/public/browser/browser_thread.h" #include "extensions/common/constants.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/image/image_skia_operations.h" @@ -32,7 +33,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace chrome {
diff --git a/chrome/browser/ui/views/extensions/extension_install_blocked_dialog_view.h b/chrome/browser/ui/views/extensions/extension_install_blocked_dialog_view.h index f7151f3..7e271a6 100644 --- a/chrome/browser/ui/views/extensions/extension_install_blocked_dialog_view.h +++ b/chrome/browser/ui/views/extensions/extension_install_blocked_dialog_view.h
@@ -10,10 +10,10 @@ #include "base/callback_forward.h" #include "base/optional.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/image/image_skia.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace gfx {
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc index 068cad12b..98ad3a7 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
@@ -33,6 +33,8 @@ #include "extensions/common/extension_urls.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/border.h" @@ -45,8 +47,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" using content::OpenURLParams;
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.h b/chrome/browser/ui/views/extensions/extension_install_dialog_view.h index 4bc74b99..3863db78 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.h +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.h
@@ -15,10 +15,10 @@ #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry_observer.h" #include "extensions/browser/uninstall_reason.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/button/checkbox.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" class Profile;
diff --git a/chrome/browser/ui/views/extensions/extension_install_friction_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_friction_dialog_view.cc index 3742984..97edccb4 100644 --- a/chrome/browser/ui/views/extensions/extension_install_friction_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_install_friction_dialog_view.cc
@@ -21,6 +21,7 @@ #include "extensions/browser/extension_dialog_auto_confirm.h" #include "extensions/common/constants.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/native_theme/native_theme_color_id.h" #include "ui/views/controls/button/label_button.h" @@ -29,7 +30,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace chrome {
diff --git a/chrome/browser/ui/views/extensions/extension_install_friction_dialog_view.h b/chrome/browser/ui/views/extensions/extension_install_friction_dialog_view.h index 643fa61..8f40e99f 100644 --- a/chrome/browser/ui/views/extensions/extension_install_friction_dialog_view.h +++ b/chrome/browser/ui/views/extensions/extension_install_friction_dialog_view.h
@@ -8,8 +8,8 @@ #include <string> #include "base/callback.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace content { class PageNavigator;
diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc index 6ccbad8..212c630 100644 --- a/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc +++ b/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc
@@ -30,13 +30,13 @@ #include "chrome/grit/generated_resources.h" #include "extensions/common/extension.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/label.h" #include "ui/views/controls/link.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #if BUILDFLAG(ENABLE_DICE_SUPPORT) #include "chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.h"
diff --git a/chrome/browser/ui/views/extensions/extension_permissions_view.cc b/chrome/browser/ui/views/extensions/extension_permissions_view.cc index df7267b3..26228a10 100644 --- a/chrome/browser/ui/views/extensions/extension_permissions_view.cc +++ b/chrome/browser/ui/views/extensions/extension_permissions_view.cc
@@ -8,9 +8,9 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/browser/ui/views/chrome_typography.h" #include "chrome/browser/ui/views/extensions/expandable_container_view.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" ExtensionPermissionsView::ExtensionPermissionsView(int available_width) : available_width_(available_width) {
diff --git a/chrome/browser/ui/views/extensions/extension_permissions_view.h b/chrome/browser/ui/views/extensions/extension_permissions_view.h index b096c5c..36e93af 100644 --- a/chrome/browser/ui/views/extensions/extension_permissions_view.h +++ b/chrome/browser/ui/views/extensions/extension_permissions_view.h
@@ -7,7 +7,7 @@ #include <vector> -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace extensions {
diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc index e774d96..bf6ddd4 100644 --- a/chrome/browser/ui/views/extensions/extension_popup.cc +++ b/chrome/browser/ui/views/extensions/extension_popup.cc
@@ -11,12 +11,12 @@ #include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/rounded_corners_f.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/native/native_view_host.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/extensions/extension_popup.h b/chrome/browser/ui/views/extensions/extension_popup.h index ee26ff77..7f5e530 100644 --- a/chrome/browser/ui/views/extensions/extension_popup.h +++ b/chrome/browser/ui/views/extensions/extension_popup.h
@@ -18,8 +18,8 @@ #include "extensions/browser/extension_host_observer.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "url/gurl.h" #if defined(USE_AURA)
diff --git a/chrome/browser/ui/views/extensions/extension_view_views.cc b/chrome/browser/ui/views/extensions/extension_view_views.cc index 71d763c3..f119bb8 100644 --- a/chrome/browser/ui/views/extensions/extension_view_views.cc +++ b/chrome/browser/ui/views/extensions/extension_view_views.cc
@@ -16,9 +16,9 @@ #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" #include "extensions/common/mojom/view_type.mojom.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/views/controls/native/native_view_host.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #if defined(USE_AURA)
diff --git a/chrome/browser/ui/views/extensions/extension_view_views.h b/chrome/browser/ui/views/extensions/extension_view_views.h index d18d1b47..d1c927f 100644 --- a/chrome/browser/ui/views/extensions/extension_view_views.h +++ b/chrome/browser/ui/views/extensions/extension_view_views.h
@@ -9,9 +9,9 @@ #include "base/optional.h" #include "chrome/browser/extensions/extension_view.h" #include "content/public/browser/native_web_keyboard_event.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace extensions { class ExtensionViewHost;
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_button.cc b/chrome/browser/ui/views/extensions/extensions_menu_button.cc index 41ce2c0d..c0f2656 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_button.cc +++ b/chrome/browser/ui/views/extensions/extensions_menu_button.cc
@@ -15,8 +15,8 @@ #include "chrome/browser/ui/views/hover_button.h" #include "chrome/browser/ui/views/hover_button_controller.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" ExtensionsMenuButton::ExtensionsMenuButton(
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_button.h b/chrome/browser/ui/views/extensions/extensions_menu_button.h index 35c105f..73b64c1 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_button.h +++ b/chrome/browser/ui/views/extensions/extensions_menu_button.h
@@ -12,8 +12,8 @@ #include "chrome/browser/ui/views/extensions/extension_context_menu_controller.h" #include "chrome/browser/ui/views/hover_button.h" #include "chrome/browser/ui/views/toolbar/toolbar_action_view_delegate_views.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class Button;
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc b/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc index e44ec0a..573bd99 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc +++ b/chrome/browser/ui/views/extensions/extensions_menu_item_view.cc
@@ -19,6 +19,7 @@ #include "chrome/browser/ui/views/hover_button.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/ink_drop_host_view.h" @@ -26,7 +27,6 @@ #include "ui/views/controls/button/menu_button_controller.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" #include "ui/views/view_class_properties.h" @@ -122,21 +122,9 @@ GetAdjustedIconColor(GetNativeTheme()->GetSystemColor( ui::NativeTheme::kColorId_MenuIconColor)); - if (pin_button_) { + if (pin_button_) pin_button_->SetInkDropBaseColor(icon_color); - SkColor unpinned_icon_color = - GetAdjustedIconColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_MenuIconColor)); - SkColor icon_color = - IsPinned() ? GetAdjustedIconColor(GetNativeTheme()->GetSystemColor( - ui::NativeTheme::kColorId_ProminentButtonColor)) - : unpinned_icon_color; - SetButtonIconWithColor(pin_button_, - IsPinned() ? views::kUnpinIcon : views::kPinIcon, - icon_color); - } - SetButtonIconWithColor(context_menu_button_, kBrowserToolsIcon, icon_color); UpdatePinButton(); @@ -159,6 +147,19 @@ // Extension pinning is not available in Incognito as it leaves a trace of // user activity. pin_button_->SetEnabled(!is_force_pinned && !profile_->IsOffTheRecord()); + + if (!GetWidget()) + return; + SkColor unpinned_icon_color = + GetAdjustedIconColor(GetNativeTheme()->GetSystemColor( + ui::NativeTheme::kColorId_MenuIconColor)); + SkColor icon_color = + IsPinned() ? GetAdjustedIconColor(GetNativeTheme()->GetSystemColor( + ui::NativeTheme::kColorId_ProminentButtonColor)) + : unpinned_icon_color; + SetButtonIconWithColor(pin_button_, + IsPinned() ? views::kUnpinIcon : views::kPinIcon, + icon_color); } bool ExtensionsMenuItemView::IsContextMenuRunningForTesting() const {
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_item_view.h b/chrome/browser/ui/views/extensions/extensions_menu_item_view.h index 661db12..9e267620 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_item_view.h +++ b/chrome/browser/ui/views/extensions/extensions_menu_item_view.h
@@ -7,7 +7,7 @@ #include <memory> -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class Browser;
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_view.cc b/chrome/browser/ui/views/extensions/extensions_menu_view.cc index a514f66e..2d95380 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_view.cc +++ b/chrome/browser/ui/views/extensions/extensions_menu_view.cc
@@ -21,6 +21,7 @@ #include "components/vector_icons/vector_icons.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/animation/ink_drop_host_view.h" @@ -30,7 +31,6 @@ #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/view_utils.h" @@ -287,14 +287,9 @@ void ExtensionsMenuView::CreateAndInsertNewItem( const ToolbarActionsModel::ActionId& id) { - // For the extensions menu UI, we pretend the the overflow menu isn't - // "overflow", because the UI shouldn't react differently. - // TODO(https://crbug.com/1197766): Remove the is_in_overflow_menu bool - // entirely. - constexpr bool kIsInOverflowMenu = false; std::unique_ptr<ExtensionActionViewController> controller = - ExtensionActionViewController::Create(id, browser_, extensions_container_, - kIsInOverflowMenu); + ExtensionActionViewController::Create(id, browser_, + extensions_container_); // The bare `new` is safe here, because InsertMenuItem is guaranteed to // be added to the view hierarchy, which takes ownership.
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_view.h b/chrome/browser/ui/views/extensions/extensions_menu_view.h index b112ad4..87821861 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_view.h +++ b/chrome/browser/ui/views/extensions/extensions_menu_view.h
@@ -14,10 +14,10 @@ #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/size.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class Button;
diff --git a/chrome/browser/ui/views/extensions/extensions_side_panel_controller.cc b/chrome/browser/ui/views/extensions/extensions_side_panel_controller.cc index 94400660..a782370d 100644 --- a/chrome/browser/ui/views/extensions/extensions_side_panel_controller.cc +++ b/chrome/browser/ui/views/extensions/extensions_side_panel_controller.cc
@@ -16,8 +16,8 @@ #include "extensions/browser/view_type_utils.h" #include "extensions/common/extension_id.h" #include "net/base/url_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/extensions/extensions_toolbar_button.cc b/chrome/browser/ui/views/extensions/extensions_toolbar_button.cc index e39c073..986d478 100644 --- a/chrome/browser/ui/views/extensions/extensions_toolbar_button.cc +++ b/chrome/browser/ui/views/extensions/extensions_toolbar_button.cc
@@ -14,12 +14,12 @@ #include "components/vector_icons/vector_icons.h" #include "extensions/browser/extension_registry.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/theme_provider.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/controls/button/button_controller.h" -#include "ui/views/metadata/metadata_impl_macros.h" ExtensionsToolbarButton::ExtensionsToolbarButton( Browser* browser,
diff --git a/chrome/browser/ui/views/extensions/extensions_toolbar_button.h b/chrome/browser/ui/views/extensions/extensions_toolbar_button.h index 17cca9f..fe6f4d7a 100644 --- a/chrome/browser/ui/views/extensions/extensions_toolbar_button.h +++ b/chrome/browser/ui/views/extensions/extensions_toolbar_button.h
@@ -8,8 +8,8 @@ #include <memory> #include "chrome/browser/ui/views/toolbar/toolbar_button.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/menu_button_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_observer.h" class Browser;
diff --git a/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc b/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc index ed64ddd..cfcd7c1 100644 --- a/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc +++ b/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc
@@ -21,10 +21,10 @@ #include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_view.h" #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/animating_layout_manager.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace { @@ -502,9 +502,8 @@ void ExtensionsToolbarContainer::CreateActionForId( const ToolbarActionsModel::ActionId& action_id) { - constexpr bool kIsInOverflowMenu = false; - actions_.push_back(ExtensionActionViewController::Create( - action_id, browser_, this, kIsInOverflowMenu)); + actions_.push_back( + ExtensionActionViewController::Create(action_id, browser_, this)); auto icon = std::make_unique<ToolbarActionView>(actions_.back().get(), this); // Set visibility before adding to prevent extraneous animation. icon->SetVisible(CanShowIconInToolbar() && model_->IsActionPinned(action_id));
diff --git a/chrome/browser/ui/views/extensions/extensions_toolbar_container.h b/chrome/browser/ui/views/extensions/extensions_toolbar_container.h index 8033f5e..d04ca78 100644 --- a/chrome/browser/ui/views/extensions/extensions_toolbar_container.h +++ b/chrome/browser/ui/views/extensions/extensions_toolbar_container.h
@@ -19,7 +19,7 @@ #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" #include "chrome/browser/ui/views/toolbar/toolbar_action_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_icon_container_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_observer.h" class Browser;
diff --git a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc index 30232fb9..84ebd40 100644 --- a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc +++ b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc
@@ -19,6 +19,8 @@ #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/native_theme/native_theme.h" #include "ui/views/border.h" @@ -31,8 +33,6 @@ #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" namespace {
diff --git a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc index 238016f..354fbb69 100644 --- a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc +++ b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc
@@ -7,6 +7,7 @@ #include "chrome/browser/media_galleries/media_galleries_preferences.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/border.h" @@ -15,7 +16,6 @@ #include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h index 67d3a94..f5f44fe 100644 --- a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h +++ b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h
@@ -5,9 +5,9 @@ #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERY_CHECKBOX_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERY_CHECKBOX_VIEW_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/size.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" struct MediaGalleryPrefInfo;
diff --git a/chrome/browser/ui/views/extensions/print_job_confirmation_dialog_view.cc b/chrome/browser/ui/views/extensions/print_job_confirmation_dialog_view.cc index ac23de7..2474ad1 100644 --- a/chrome/browser/ui/views/extensions/print_job_confirmation_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/print_job_confirmation_dialog_view.cc
@@ -18,12 +18,12 @@ #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/screen.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" // static
diff --git a/chrome/browser/ui/views/extensions/print_job_confirmation_dialog_view.h b/chrome/browser/ui/views/extensions/print_job_confirmation_dialog_view.h index afbe372..a052f4a 100644 --- a/chrome/browser/ui/views/extensions/print_job_confirmation_dialog_view.h +++ b/chrome/browser/ui/views/extensions/print_job_confirmation_dialog_view.h
@@ -9,11 +9,11 @@ #include <string> #include "base/callback_forward.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class ToolbarActionView;
diff --git a/chrome/browser/ui/views/extensions/request_file_system_dialog_view.cc b/chrome/browser/ui/views/extensions/request_file_system_dialog_view.cc index af1ed5434..eeb545d2 100644 --- a/chrome/browser/ui/views/extensions/request_file_system_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/request_file_system_dialog_view.cc
@@ -16,11 +16,11 @@ #include "components/constrained_window/constrained_window_views.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/font.h" #include "ui/gfx/range/range.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/extensions/request_file_system_dialog_view.h b/chrome/browser/ui/views/extensions/request_file_system_dialog_view.h index 272a3e0..34f4833 100644 --- a/chrome/browser/ui/views/extensions/request_file_system_dialog_view.h +++ b/chrome/browser/ui/views/extensions/request_file_system_dialog_view.h
@@ -10,8 +10,8 @@ #include "base/callback_forward.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace content {
diff --git a/chrome/browser/ui/views/extensions/settings_overridden_dialog_view.cc b/chrome/browser/ui/views/extensions/settings_overridden_dialog_view.cc index 52ec722..707188a9 100644 --- a/chrome/browser/ui/views/extensions/settings_overridden_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/settings_overridden_dialog_view.cc
@@ -12,11 +12,11 @@ #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" SettingsOverriddenDialogView::SettingsOverriddenDialogView( std::unique_ptr<SettingsOverriddenDialogController> controller)
diff --git a/chrome/browser/ui/views/extensions/settings_overridden_dialog_view.h b/chrome/browser/ui/views/extensions/settings_overridden_dialog_view.h index f9914865..1aa147bf 100644 --- a/chrome/browser/ui/views/extensions/settings_overridden_dialog_view.h +++ b/chrome/browser/ui/views/extensions/settings_overridden_dialog_view.h
@@ -9,8 +9,8 @@ #include "base/optional.h" #include "chrome/browser/ui/extensions/settings_overridden_dialog_controller.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/native_widget_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" // A dialog that displays a warning to the user that their settings have been
diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc index e83a5318..e7535b9 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.cc +++ b/chrome/browser/ui/views/external_protocol_dialog.cc
@@ -24,11 +24,11 @@ #include "components/url_formatter/elide_url.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/text_elider.h" #include "ui/views/controls/label.h" #include "ui/views/controls/message_box_view.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" using content::WebContents;
diff --git a/chrome/browser/ui/views/external_protocol_dialog.h b/chrome/browser/ui/views/external_protocol_dialog.h index 0596250..290dc4f 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.h +++ b/chrome/browser/ui/views/external_protocol_dialog.h
@@ -8,7 +8,7 @@ #include "base/macros.h" #include "chrome/browser/profiles/profile.h" #include "content/public/browser/web_contents_observer.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" #include "url/gurl.h" #include "url/origin.h"
diff --git a/chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc b/chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc index 7ade7563..4bd7d56 100644 --- a/chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc +++ b/chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc
@@ -12,11 +12,11 @@ #include "content/public/browser/render_widget_host.h" #include "content/public/browser/web_contents.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/screen.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/native_widget_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" class EyeDropperView::ViewPositionHandler {
diff --git a/chrome/browser/ui/views/eye_dropper/eye_dropper_view.h b/chrome/browser/ui/views/eye_dropper/eye_dropper_view.h index 4f78ea3..eafbda0 100644 --- a/chrome/browser/ui/views/eye_dropper/eye_dropper_view.h +++ b/chrome/browser/ui/views/eye_dropper/eye_dropper_view.h
@@ -13,8 +13,8 @@ #include "content/public/browser/eye_dropper.h" #include "content/public/browser/eye_dropper_listener.h" #include "content/public/browser/render_frame_host.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/point.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_delegate.h" // EyeDropperView is used on Aura platforms and on the Mac before 10.15.
diff --git a/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.cc b/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.cc index 43400862..b2da00d 100644 --- a/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.cc +++ b/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.cc
@@ -16,7 +16,7 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" FileSystemAccessIconView::FileSystemAccessIconView( IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
diff --git a/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.h b/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.h index 1a495d8..f519e3c 100644 --- a/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.h +++ b/chrome/browser/ui/views/file_system_access/file_system_access_icon_view.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_ICON_VIEW_H_ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" // Page action icon indicating if the current page is using the File System // Access API. Shows different icons for read access to directories and write
diff --git a/chrome/browser/ui/views/file_system_access/file_system_access_permission_view.cc b/chrome/browser/ui/views/file_system_access/file_system_access_permission_view.cc index 32c80a53..a7cfb60f 100644 --- a/chrome/browser/ui/views/file_system_access/file_system_access_permission_view.cc +++ b/chrome/browser/ui/views/file_system_access/file_system_access_permission_view.cc
@@ -15,12 +15,12 @@ #include "components/vector_icons/vector_icons.h" #include "content/public/browser/file_system_access_permission_context.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace { using AccessType = FileSystemAccessPermissionRequestManager::Access;
diff --git a/chrome/browser/ui/views/file_system_access/file_system_access_permission_view.h b/chrome/browser/ui/views/file_system_access/file_system_access_permission_view.h index 5835f7e9..9a0dd58f 100644 --- a/chrome/browser/ui/views/file_system_access/file_system_access_permission_view.h +++ b/chrome/browser/ui/views/file_system_access/file_system_access_permission_view.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "chrome/browser/file_system_access/file_system_access_permission_request_manager.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace content {
diff --git a/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.cc b/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.cc index 91f7456..eb37b6b 100644 --- a/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.cc +++ b/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.cc
@@ -12,10 +12,10 @@ #include "components/constrained_window/constrained_window_views.h" #include "components/url_formatter/elide_url.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" using HandleType = content::FileSystemAccessPermissionContext::HandleType;
diff --git a/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.h b/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.h index b35bcd32d..72a79973 100644 --- a/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.h +++ b/chrome/browser/ui/views/file_system_access/file_system_access_restricted_directory_dialog_view.h
@@ -7,7 +7,7 @@ #include "base/macros.h" #include "content/public/browser/file_system_access_permission_context.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace base {
diff --git a/chrome/browser/ui/views/file_system_access/file_system_access_usage_bubble_view.cc b/chrome/browser/ui/views/file_system_access/file_system_access_usage_bubble_view.cc index 2ed2da15..574e5d0 100644 --- a/chrome/browser/ui/views/file_system_access/file_system_access_usage_bubble_view.cc +++ b/chrome/browser/ui/views/file_system_access/file_system_access_usage_bubble_view.cc
@@ -31,6 +31,8 @@ #include "third_party/icu/source/common/unicode/utypes.h" #include "third_party/icu/source/i18n/unicode/listformatter.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/button/image_button_factory.h" @@ -40,8 +42,6 @@ #include "ui/views/controls/scroll_view.h" #include "ui/views/controls/table/table_view.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc index 6782f205..ec0d3ee1 100644 --- a/chrome/browser/ui/views/find_bar_view.cc +++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -31,6 +31,7 @@ #include "ui/base/ime/input_method.h" #include "ui/base/ime/text_input_flags.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/events/event.h" #include "ui/gfx/color_palette.h" @@ -46,7 +47,6 @@ #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/view_class_properties.h" #include "ui/views/views_features.h"
diff --git a/chrome/browser/ui/views/first_run_dialog.cc b/chrome/browser/ui/views/first_run_dialog.cc index 1670c19..3e2556d 100644 --- a/chrome/browser/ui/views/first_run_dialog.cc +++ b/chrome/browser/ui/views/first_run_dialog.cc
@@ -24,10 +24,10 @@ #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/link.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/first_run_dialog.h b/chrome/browser/ui/views/first_run_dialog.h index 1a81505..a6c525c 100644 --- a/chrome/browser/ui/views/first_run_dialog.h +++ b/chrome/browser/ui/views/first_run_dialog.h
@@ -7,7 +7,7 @@ #include "base/callback.h" #include "base/macros.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class Profile;
diff --git a/chrome/browser/ui/views/folder_upload_confirmation_view.cc b/chrome/browser/ui/views/folder_upload_confirmation_view.cc index ccdcc5e..e38a23a 100644 --- a/chrome/browser/ui/views/folder_upload_confirmation_view.cc +++ b/chrome/browser/ui/views/folder_upload_confirmation_view.cc
@@ -12,10 +12,10 @@ #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" FolderUploadConfirmationView::FolderUploadConfirmationView( const base::FilePath& path,
diff --git a/chrome/browser/ui/views/folder_upload_confirmation_view.h b/chrome/browser/ui/views/folder_upload_confirmation_view.h index 1deddbad..4610620 100644 --- a/chrome/browser/ui/views/folder_upload_confirmation_view.h +++ b/chrome/browser/ui/views/folder_upload_confirmation_view.h
@@ -8,8 +8,8 @@ #include <string> #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/shell_dialogs/selected_file_info.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace base {
diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc index 5f517bef..b2411f4 100644 --- a/chrome/browser/ui/views/frame/browser_frame.cc +++ b/chrome/browser/ui/views/frame/browser_frame.cc
@@ -46,7 +46,6 @@ // of lacros-chrome is complete. #if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) #include "ui/display/screen.h" -#include "ui/views/linux_ui/linux_ui.h" #endif namespace { @@ -355,12 +354,6 @@ } } -#if defined(OS_LINUX) || defined(IS_CHROMEOS_LACROS) - const views::LinuxUI* linux_ui = views::LinuxUI::instance(); - if (linux_ui) - native_theme = linux_ui->GetNativeTheme(GetNativeWindow()); -#endif - SetNativeTheme(native_theme); }
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc index 361cab5..3337528 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.cc
@@ -23,6 +23,7 @@ #include "chrome/grit/theme_resources.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" @@ -31,7 +32,6 @@ #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/scoped_canvas.h" #include "ui/views/background.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/hit_test_utils.h" #if defined(OS_WIN)
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h index 875ba7da..b98f9ae 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view.h +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view.h
@@ -11,7 +11,7 @@ #include "chrome/browser/ui/views/tabs/tab_strip.h" #include "chrome/browser/ui/views/tabs/tab_strip_observer.h" #include "chrome/browser/ui/views/tabs/tab_strip_types.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/non_client_view.h"
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.cc index 05b1a99..f0f8174 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.cc
@@ -43,6 +43,7 @@ #include "ui/aura/env.h" #include "ui/base/hit_test.h" #include "ui/base/layout.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/screen.h" #include "ui/events/gestures/gesture_recognizer.h" #include "ui/gfx/canvas.h" @@ -51,7 +52,6 @@ #include "ui/gfx/scoped_canvas.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/rect_based_targeting_utils.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.h index 4bbc1a59..c65f4f83 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.h +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos.h
@@ -16,9 +16,9 @@ #include "chrome/browser/ui/views/tab_icon_view_model.h" #include "ui/aura/window.h" #include "ui/aura/window_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/display/display_observer.h" #include "ui/display/tablet_state.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace { class WebAppNonClientFrameViewAshTest;
diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc index df02e84..99d16d8 100644 --- a/chrome/browser/ui/views/frame/browser_root_view.cc +++ b/chrome/browser/ui/views/frame/browser_root_view.cc
@@ -38,9 +38,9 @@ #include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/paint_recorder.h" #include "ui/gfx/scoped_canvas.h" -#include "ui/views/metadata/metadata_impl_macros.h" #if BUILDFLAG(ENABLE_PLUGINS) #include "content/public/browser/plugin_service.h"
diff --git a/chrome/browser/ui/views/frame/browser_root_view.h b/chrome/browser/ui/views/frame/browser_root_view.h index 4c70857..e0bc780 100644 --- a/chrome/browser/ui/views/frame/browser_root_view.h +++ b/chrome/browser/ui/views/frame/browser_root_view.h
@@ -8,7 +8,7 @@ #include <memory> #include "chrome/browser/ui/views/frame/browser_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/widget/root_view.h" class ToolbarView;
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 9cca839..ae4faec3b3 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -66,6 +66,7 @@ #include "chrome/browser/ui/recently_audible_helper.h" #include "chrome/browser/ui/sad_tab_helper.h" #include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_bubble_view.h" +#include "chrome/browser/ui/sharing_hub/sharing_hub_bubble_view.h" #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h" #include "chrome/browser/ui/tabs/tab_menu_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -116,6 +117,8 @@ #include "chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_view_impl.h" #include "chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.h" #include "chrome/browser/ui/views/sharing/sharing_dialog_view.h" +#include "chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.h" +#include "chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.h" #include "chrome/browser/ui/views/side_panel.h" #include "chrome/browser/ui/views/status_bubble_views.h" #include "chrome/browser/ui/views/tab_contents/chrome_web_contents_view_focus_helper.h" @@ -179,6 +182,8 @@ #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" #include "ui/base/window_open_disposition.h" @@ -200,8 +205,6 @@ #include "ui/views/controls/webview/webview.h" #include "ui/views/focus/external_focus_tracker.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/native_widget.h" #include "ui/views/widget/root_view.h" @@ -1855,6 +1858,29 @@ return bubble; } +sharing_hub::SharingHubBubbleView* BrowserView::ShowSharingHubBubble( + content::WebContents* web_contents, + sharing_hub::SharingHubBubbleController* controller, + bool is_user_gesture) { + sharing_hub::SharingHubBubbleViewImpl* bubble = + new sharing_hub::SharingHubBubbleViewImpl( + toolbar_button_provider()->GetAnchorView( + PageActionIconType::kSharingHub), + web_contents, controller); + PageActionIconView* icon_view = + toolbar_button_provider()->GetPageActionIconView( + PageActionIconType::kSharingHub); + if (icon_view) + bubble->SetHighlightedButton(icon_view); + + views::BubbleDialogDelegateView::CreateBubble(bubble); + bubble->Show(is_user_gesture + ? sharing_hub::SharingHubBubbleViewImpl::USER_GESTURE + : sharing_hub::SharingHubBubbleViewImpl::AUTOMATIC); + + return bubble; +} + ShowTranslateBubbleResult BrowserView::ShowTranslateBubble( content::WebContents* web_contents, translate::TranslateStep step,
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h index 386fb12..111cc15 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -41,12 +41,12 @@ #include "components/infobars/core/infobar_container.h" #include "components/webapps/browser/banners/app_banner_manager.h" #include "ui/base/accelerators/accelerator.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/simple_menu_model.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_observer.h" #include "ui/views/window/client_view.h" @@ -438,6 +438,10 @@ content::WebContents* contents, send_tab_to_self::SendTabToSelfBubbleController* controller, bool is_user_gesture) override; + sharing_hub::SharingHubBubbleView* ShowSharingHubBubble( + content::WebContents* contents, + sharing_hub::SharingHubBubbleController* controller, + bool is_user_gesture) override; ShowTranslateBubbleResult ShowTranslateBubble( content::WebContents* contents, translate::TranslateStep step,
diff --git a/chrome/browser/ui/views/frame/contents_web_view.cc b/chrome/browser/ui/views/frame/contents_web_view.cc index afa1ad6b..7f88c3f0 100644 --- a/chrome/browser/ui/views/frame/contents_web_view.cc +++ b/chrome/browser/ui/views/frame/contents_web_view.cc
@@ -8,11 +8,11 @@ #include "chrome/browser/ui/views/status_bubble_views.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_tree_owner.h" #include "ui/views/background.h" -#include "ui/views/metadata/metadata_impl_macros.h" #if defined(USE_AURA) #include "ui/aura/window.h"
diff --git a/chrome/browser/ui/views/frame/contents_web_view.h b/chrome/browser/ui/views/frame/contents_web_view.h index d516388b..a81ac41 100644 --- a/chrome/browser/ui/views/frame/contents_web_view.h +++ b/chrome/browser/ui/views/frame/contents_web_view.h
@@ -10,8 +10,8 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "chrome/browser/ui/views/frame/web_contents_close_handler_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_header_macros.h" class StatusBubbleViews;
diff --git a/chrome/browser/ui/views/frame/glass_browser_caption_button_container.cc b/chrome/browser/ui/views/frame/glass_browser_caption_button_container.cc index 6f1bc9f5..ba04855 100644 --- a/chrome/browser/ui/views/frame/glass_browser_caption_button_container.cc +++ b/chrome/browser/ui/views/frame/glass_browser_caption_button_container.cc
@@ -9,9 +9,9 @@ #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" #include "chrome/browser/ui/views/frame/windows_10_caption_button.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace {
diff --git a/chrome/browser/ui/views/frame/glass_browser_caption_button_container.h b/chrome/browser/ui/views/frame/glass_browser_caption_button_container.h index e7e4ffe..fa52766 100644 --- a/chrome/browser/ui/views/frame/glass_browser_caption_button_container.h +++ b/chrome/browser/ui/views/frame/glass_browser_caption_button_container.h
@@ -6,9 +6,9 @@ #define CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_CAPTION_BUTTON_CONTAINER_H_ #include "base/scoped_observation.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_observer.h"
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc index 569e514..2e547cc 100644 --- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -30,6 +30,7 @@ #include "content/public/browser/web_contents.h" #include "skia/ext/image_operations.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle_win.h" #include "ui/base/theme_provider.h" #include "ui/base/win/hwnd_metrics.h" @@ -42,7 +43,6 @@ #include "ui/gfx/image/image.h" #include "ui/gfx/scoped_canvas.h" #include "ui/strings/grit/ui_strings.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/win/hwnd_util.h" #include "ui/views/window/client_view.h"
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.h b/chrome/browser/ui/views/frame/glass_browser_frame_view.h index 7ba4a12..4b54c50 100644 --- a/chrome/browser/ui/views/frame/glass_browser_frame_view.h +++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.h
@@ -12,7 +12,7 @@ #include "chrome/browser/ui/views/frame/windows_10_caption_button.h" #include "chrome/browser/ui/views/tab_icon_view.h" #include "chrome/browser/ui/views/tab_icon_view_model.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/non_client_view.h" class BrowserView;
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 d2c03ecc..ef2ca8c 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -33,6 +33,7 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font_list.h" @@ -44,7 +45,6 @@ #include "ui/gfx/scoped_canvas.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/resources/grit/views_resources.h" #include "ui/views/views_delegate.h" #include "ui/views/window/frame_background.h"
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h index f5c027b..df21c433 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
@@ -13,9 +13,9 @@ #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_delegate.h" #include "chrome/browser/ui/views/tab_icon_view_model.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" #include "ui/views/linux_ui/linux_ui.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/caption_button_types.h" #include "ui/views/window/non_client_view.h"
diff --git a/chrome/browser/ui/views/frame/tab_strip_region_view.cc b/chrome/browser/ui/views/frame/tab_strip_region_view.cc index e7a82d9..8fa4ff9 100644 --- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc +++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
@@ -19,14 +19,14 @@ #include "chrome/grit/generated_resources.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/button/image_button_factory.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view_class_properties.h"
diff --git a/chrome/browser/ui/views/frame/tab_strip_region_view.h b/chrome/browser/ui/views/frame/tab_strip_region_view.h index db193f1..75513d3 100644 --- a/chrome/browser/ui/views/frame/tab_strip_region_view.h +++ b/chrome/browser/ui/views/frame/tab_strip_region_view.h
@@ -6,9 +6,9 @@ #define CHROME_BROWSER_UI_VIEWS_FRAME_TAB_STRIP_REGION_VIEW_H_ #include "chrome/browser/ui/views/tabs/tab_strip.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/views/accessible_pane_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class FlexLayout;
diff --git a/chrome/browser/ui/views/frame/top_container_loading_bar.cc b/chrome/browser/ui/views/frame/top_container_loading_bar.cc index 0935dbf..23fb7fa5 100644 --- a/chrome/browser/ui/views/frame/top_container_loading_bar.cc +++ b/chrome/browser/ui/views/frame/top_container_loading_bar.cc
@@ -7,11 +7,11 @@ #include "chrome/browser/favicon/favicon_utils.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tab_ui_helper.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/animation/tween.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" -#include "ui/views/metadata/metadata_impl_macros.h" LoadingBarView::LoadingBarView() { SetPaintToLayer();
diff --git a/chrome/browser/ui/views/frame/top_container_loading_bar.h b/chrome/browser/ui/views/frame/top_container_loading_bar.h index 0cf5b2b..43786408 100644 --- a/chrome/browser/ui/views/frame/top_container_loading_bar.h +++ b/chrome/browser/ui/views/frame/top_container_loading_bar.h
@@ -7,9 +7,9 @@ #include "chrome/browser/ui/tabs/tab_network_state.h" #include "content/public/browser/web_contents_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/animation/linear_animation.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" class Browser;
diff --git a/chrome/browser/ui/views/frame/top_container_view.cc b/chrome/browser/ui/views/frame/top_container_view.cc index 9085119..3b2c87a 100644 --- a/chrome/browser/ui/views/frame/top_container_view.cc +++ b/chrome/browser/ui/views/frame/top_container_view.cc
@@ -8,7 +8,7 @@ #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/paint_info.h" TopContainerView::TopContainerView(BrowserView* browser_view)
diff --git a/chrome/browser/ui/views/frame/top_container_view.h b/chrome/browser/ui/views/frame/top_container_view.h index d1b62d0..fda0d14 100644 --- a/chrome/browser/ui/views/frame/top_container_view.h +++ b/chrome/browser/ui/views/frame/top_container_view.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_FRAME_TOP_CONTAINER_VIEW_H_ #include "base/compiler_specific.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class BrowserView;
diff --git a/chrome/browser/ui/views/frame/web_footer_experiment_view.cc b/chrome/browser/ui/views/frame/web_footer_experiment_view.cc index d05a33e..0b3562e 100644 --- a/chrome/browser/ui/views/frame/web_footer_experiment_view.cc +++ b/chrome/browser/ui/views/frame/web_footer_experiment_view.cc
@@ -8,7 +8,7 @@ #include "chrome/browser/task_manager/web_contents_tags.h" #include "chrome/common/webui_url_constants.h" #include "components/startup_metric_utils/browser/startup_metric_utils.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" WebFooterExperimentView::WebFooterExperimentView(Profile* profile) : WebView(profile), metrics_collector_(GetWebContents()) {
diff --git a/chrome/browser/ui/views/frame/web_footer_experiment_view.h b/chrome/browser/ui/views/frame/web_footer_experiment_view.h index 2e6f43a..1a456d9 100644 --- a/chrome/browser/ui/views/frame/web_footer_experiment_view.h +++ b/chrome/browser/ui/views/frame/web_footer_experiment_view.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_FRAME_WEB_FOOTER_EXPERIMENT_VIEW_H_ #include "content/public/browser/web_contents_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_header_macros.h" class Profile;
diff --git a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc index caa1dc8..2a8a682a 100644 --- a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc +++ b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc
@@ -63,6 +63,8 @@ #include "ui/base/clipboard/custom_data_helper.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/events/event_handler.h" #include "ui/events/event_target.h" @@ -73,8 +75,6 @@ #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/view_observer.h" #include "ui/views/view_tracker.h"
diff --git a/chrome/browser/ui/views/frame/windows_10_caption_button.cc b/chrome/browser/ui/views/frame/windows_10_caption_button.cc index 290f151..1e57b41 100644 --- a/chrome/browser/ui/views/frame/windows_10_caption_button.cc +++ b/chrome/browser/ui/views/frame/windows_10_caption_button.cc
@@ -10,12 +10,12 @@ #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" #include "chrome/grit/theme_resources.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/gfx/animation/tween.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/scoped_canvas.h" -#include "ui/views/metadata/metadata_impl_macros.h" Windows10CaptionButton::Windows10CaptionButton( PressedCallback callback, @@ -274,5 +274,5 @@ ADD_READONLY_PROPERTY_METADATA(int, ButtonDisplayOrderIndex) ADD_READONLY_PROPERTY_METADATA(SkColor, BaseColor, - views::metadata::SkColorConverter) + ui::metadata::SkColorConverter) END_METADATA
diff --git a/chrome/browser/ui/views/frame/windows_10_caption_button.h b/chrome/browser/ui/views/frame/windows_10_caption_button.h index e13e908f..0ce0a5e 100644 --- a/chrome/browser/ui/views/frame/windows_10_caption_button.h +++ b/chrome/browser/ui/views/frame/windows_10_caption_button.h
@@ -6,9 +6,9 @@ #define CHROME_BROWSER_UI_VIEWS_FRAME_WINDOWS_10_CAPTION_BUTTON_H_ #include "chrome/browser/ui/view_ids.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/canvas.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" class GlassBrowserFrameView;
diff --git a/chrome/browser/ui/views/global_error_bubble_view.cc b/chrome/browser/ui/views/global_error_bubble_view.cc index dfffbf9f..38cc893 100644 --- a/chrome/browser/ui/views/global_error_bubble_view.cc +++ b/chrome/browser/ui/views/global_error_bubble_view.cc
@@ -25,6 +25,7 @@ #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "ui/base/buildflags.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" #include "ui/views/bubble/bubble_frame_view.h" @@ -33,7 +34,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" // GlobalErrorBubbleViewBase ---------------------------------------------------
diff --git a/chrome/browser/ui/views/global_error_bubble_view.h b/chrome/browser/ui/views/global_error_bubble_view.h index 126c0fe..94acb5da 100644 --- a/chrome/browser/ui/views/global_error_bubble_view.h +++ b/chrome/browser/ui/views/global_error_bubble_view.h
@@ -8,8 +8,8 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class Browser; class ElevationIconSetter;
diff --git a/chrome/browser/ui/views/global_media_controls/media_dialog_view.cc b/chrome/browser/ui/views/global_media_controls/media_dialog_view.cc index 2e12253..14266ffb 100644 --- a/chrome/browser/ui/views/global_media_controls/media_dialog_view.cc +++ b/chrome/browser/ui/views/global_media_controls/media_dialog_view.cc
@@ -21,12 +21,14 @@ #include "chrome/browser/ui/views/user_education/new_badge_label.h" #include "chrome/grit/generated_resources.h" #include "components/live_caption/pref_names.h" +#include "components/soda/constants.h" #include "components/sync_preferences/pref_service_syncable.h" #include "components/vector_icons/vector_icons.h" #include "content/public/browser/web_contents.h" #include "media/base/media_switches.h" #include "services/media_session/public/mojom/media_session.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/background.h" #include "ui/views/bubble/bubble_frame_view.h" @@ -35,7 +37,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/views_features.h" using media_session::mojom::MediaSessionAction; @@ -367,9 +368,10 @@ IDS_GLOBAL_MEDIA_CONTROLS_LIVE_CAPTION_DOWNLOAD_ERROR)); } -void MediaDialogView::OnSodaProgress(int progress) { +void MediaDialogView::OnSodaProgress(int combined_progress) { live_caption_title_->SetText(l10n_util::GetStringFUTF16Int( - IDS_GLOBAL_MEDIA_CONTROLS_LIVE_CAPTION_DOWNLOAD_PROGRESS, progress)); + IDS_GLOBAL_MEDIA_CONTROLS_LIVE_CAPTION_DOWNLOAD_PROGRESS, + combined_progress)); } BEGIN_METADATA(MediaDialogView, views::BubbleDialogDelegateView)
diff --git a/chrome/browser/ui/views/global_media_controls/media_dialog_view.h b/chrome/browser/ui/views/global_media_controls/media_dialog_view.h index eeb5f2e8..67d49a5 100644 --- a/chrome/browser/ui/views/global_media_controls/media_dialog_view.h +++ b/chrome/browser/ui/views/global_media_controls/media_dialog_view.h
@@ -14,9 +14,10 @@ #include "chrome/browser/ui/global_media_controls/media_dialog_delegate.h" #include "chrome/browser/ui/global_media_controls/media_notification_container_observer.h" #include "chrome/browser/ui/views/global_media_controls/global_media_controls_types.h" +#include "components/soda/constants.h" #include "components/soda/soda_installer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class MediaDialogViewObserver; class MediaNotificationContainerImplView; @@ -120,8 +121,14 @@ // SodaInstaller::Observer overrides: void OnSodaInstalled() override; + void OnSodaLanguagePackInstalled( + speech::LanguageCode language_code) override {} void OnSodaError() override; - void OnSodaProgress(int progress) override; + void OnSodaLanguagePackError(speech::LanguageCode language_code) override {} + void OnSodaProgress(int combined_progress) override; + void OnSodaLanguagePackProgress(int language_progress, + speech::LanguageCode language_code) override { + } MediaNotificationService* const service_;
diff --git a/chrome/browser/ui/views/global_media_controls/media_dialog_view_interactive_browsertest.cc b/chrome/browser/ui/views/global_media_controls/media_dialog_view_interactive_browsertest.cc index e8ff2b5..79697dd 100644 --- a/chrome/browser/ui/views/global_media_controls/media_dialog_view_interactive_browsertest.cc +++ b/chrome/browser/ui/views/global_media_controls/media_dialog_view_interactive_browsertest.cc
@@ -27,6 +27,7 @@ #include "components/media_message_center/media_notification_view_impl.h" #include "components/media_router/browser/presentation/web_contents_presentation_manager.h" #include "components/media_router/browser/test/mock_media_router.h" +#include "components/soda/constants.h" #include "content/public/browser/presentation_request.h" #include "content/public/browser/web_contents.h" #include "content/public/test/browser_test.h" @@ -556,6 +557,11 @@ MediaDialogView::GetDialogViewForTesting()->OnSodaInstalled(); } + void OnSodaLanguagePackInstalled() { + MediaDialogView::GetDialogViewForTesting()->OnSodaLanguagePackInstalled( + speech::LanguageCode::kEnUs); + } + protected: std::unique_ptr<TestWebContentsPresentationManager> presentation_manager_; TestMediaRouter* media_router_ = nullptr; @@ -968,6 +974,10 @@ EXPECT_EQ("Downloading… 100%", base::UTF16ToUTF8(GetLiveCaptionTitleLabel()->GetText())); + OnSodaLanguagePackInstalled(); + EXPECT_EQ("Downloading… 100%", + base::UTF16ToUTF8(GetLiveCaptionTitleLabel()->GetText())); + OnSodaInstalled(); EXPECT_EQ("Live Caption (English only)", base::UTF16ToUTF8(GetLiveCaptionTitleLabel()->GetText()));
diff --git a/chrome/browser/ui/views/global_media_controls/media_notification_container_impl_view.cc b/chrome/browser/ui/views/global_media_controls/media_notification_container_impl_view.cc index c86c4cca..b49dc00 100644 --- a/chrome/browser/ui/views/global_media_controls/media_notification_container_impl_view.cc +++ b/chrome/browser/ui/views/global_media_controls/media_notification_container_impl_view.cc
@@ -24,6 +24,8 @@ #include "components/vector_icons/vector_icons.h" #include "media/audio/audio_device_description.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/canvas_painter.h" #include "ui/compositor/layer.h" #include "ui/message_center/public/cpp/message_center_constants.h" @@ -35,8 +37,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/global_media_controls/media_notification_container_impl_view.h b/chrome/browser/ui/views/global_media_controls/media_notification_container_impl_view.h index 30d812b7..3fda2bb 100644 --- a/chrome/browser/ui/views/global_media_controls/media_notification_container_impl_view.h +++ b/chrome/browser/ui/views/global_media_controls/media_notification_container_impl_view.h
@@ -17,9 +17,9 @@ #include "components/media_message_center/media_notification_view_impl.h" #include "media/audio/audio_device_description.h" #include "media/base/media_switches.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/animation/slide_out_controller_delegate.h" #include "ui/views/focus/focus_manager.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/unique_widget_ptr.h" namespace media_message_center {
diff --git a/chrome/browser/ui/views/global_media_controls/media_notification_device_entry_ui.cc b/chrome/browser/ui/views/global_media_controls/media_notification_device_entry_ui.cc index 5523058e..aad6238 100644 --- a/chrome/browser/ui/views/global_media_controls/media_notification_device_entry_ui.cc +++ b/chrome/browser/ui/views/global_media_controls/media_notification_device_entry_ui.cc
@@ -6,11 +6,11 @@ #include "base/strings/utf_string_conversions.h" #include "components/vector_icons/vector_icons.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/background.h" #include "ui/views/controls/styled_label.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/global_media_controls/media_notification_device_entry_ui.h b/chrome/browser/ui/views/global_media_controls/media_notification_device_entry_ui.h index 788b92d9..9f1056b 100644 --- a/chrome/browser/ui/views/global_media_controls/media_notification_device_entry_ui.h +++ b/chrome/browser/ui/views/global_media_controls/media_notification_device_entry_ui.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_GLOBAL_MEDIA_CONTROLS_MEDIA_NOTIFICATION_DEVICE_ENTRY_UI_H_ #include "chrome/browser/ui/views/media_router/cast_dialog_sink_button.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" enum class DeviceEntryUIType { kAudio = 0,
diff --git a/chrome/browser/ui/views/global_media_controls/media_notification_device_selector_view.cc b/chrome/browser/ui/views/global_media_controls/media_notification_device_selector_view.cc index f0b9cb16b..777d01f6 100644 --- a/chrome/browser/ui/views/global_media_controls/media_notification_device_selector_view.cc +++ b/chrome/browser/ui/views/global_media_controls/media_notification_device_selector_view.cc
@@ -16,9 +16,9 @@ #include "media/base/media_switches.h" #include "services/media_session/public/mojom/media_session.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/global_media_controls/media_notification_device_selector_view.h b/chrome/browser/ui/views/global_media_controls/media_notification_device_selector_view.h index ba402a5..4d4f5e5 100644 --- a/chrome/browser/ui/views/global_media_controls/media_notification_device_selector_view.h +++ b/chrome/browser/ui/views/global_media_controls/media_notification_device_selector_view.h
@@ -12,7 +12,7 @@ #include "chrome/browser/ui/views/global_media_controls/media_notification_device_entry_ui.h" #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" #include "media/audio/audio_device_description.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace { class ExpandDeviceSelectorButton;
diff --git a/chrome/browser/ui/views/global_media_controls/media_notification_list_view.cc b/chrome/browser/ui/views/global_media_controls/media_notification_list_view.cc index 59f7b5dc9..0873165 100644 --- a/chrome/browser/ui/views/global_media_controls/media_notification_list_view.cc +++ b/chrome/browser/ui/views/global_media_controls/media_notification_list_view.cc
@@ -6,11 +6,11 @@ #include "chrome/browser/ui/views/global_media_controls/media_notification_container_impl_view.h" #include "chrome/browser/ui/views/global_media_controls/overlay_media_notification_view.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/native_theme/native_theme.h" #include "ui/views/border.h" #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/global_media_controls/media_notification_list_view.h b/chrome/browser/ui/views/global_media_controls/media_notification_list_view.h index 859058f4..faeed30 100644 --- a/chrome/browser/ui/views/global_media_controls/media_notification_list_view.h +++ b/chrome/browser/ui/views/global_media_controls/media_notification_list_view.h
@@ -9,8 +9,8 @@ #include <memory> #include "base/optional.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/scroll_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class MediaNotificationContainerImplView; class OverlayMediaNotification;
diff --git a/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.cc b/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.cc index 2d59ac0..f934efc 100644 --- a/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.cc +++ b/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.cc
@@ -24,6 +24,7 @@ #include "components/vector_icons/vector_icons.h" #include "media/base/media_switches.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/theme_provider.h" #include "ui/gfx/paint_vector_icon.h" @@ -31,7 +32,6 @@ #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/controls/button/button_controller.h" -#include "ui/views/metadata/metadata_impl_macros.h" MediaToolbarButtonView::MediaToolbarButtonView(BrowserView* browser_view) : ToolbarButton(base::BindRepeating(&MediaToolbarButtonView::ButtonPressed,
diff --git a/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h b/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h index cc32e4b..a3d5869 100644 --- a/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h +++ b/chrome/browser/ui/views/global_media_controls/media_toolbar_button_view.h
@@ -7,7 +7,7 @@ #include "chrome/browser/ui/global_media_controls/media_toolbar_button_controller_delegate.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class Browser; class BrowserView;
diff --git a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc index cf27e140..89ecf21 100644 --- a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc +++ b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
@@ -29,14 +29,14 @@ #include "content/public/browser/render_frame_host.h" #include "net/base/url_util.h" #include "third_party/blink/public/common/page/page_zoom.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_types.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/webview/web_dialog_view.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/web_dialogs/web_dialog_delegate.h" constexpr gfx::Size HatsNextWebDialog::kMinSize;
diff --git a/chrome/browser/ui/views/hats/hats_next_web_dialog.h b/chrome/browser/ui/views/hats/hats_next_web_dialog.h index 0b3aaa1..ef7d730 100644 --- a/chrome/browser/ui/views/hats/hats_next_web_dialog.h +++ b/chrome/browser/ui/views/hats/hats_next_web_dialog.h
@@ -7,9 +7,9 @@ #include "chrome/browser/profiles/profile_observer.h" #include "content/public/browser/web_contents_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/webview/web_dialog_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" #include "ui/web_dialogs/web_dialog_delegate.h"
diff --git a/chrome/browser/ui/views/hover_button.cc b/chrome/browser/ui/views/hover_button.cc index 24bed6d..9ab6cbd 100644 --- a/chrome/browser/ui/views/hover_button.cc +++ b/chrome/browser/ui/views/hover_button.cc
@@ -11,6 +11,8 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/browser/ui/views/chrome_typography.h" #include "chrome/browser/ui/views/hover_button_controller.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/compositor/layer.h" #include "ui/events/event_constants.h" @@ -23,8 +25,6 @@ #include "ui/views/focus/focus_manager.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view_class_properties.h" @@ -96,6 +96,7 @@ SetBorder(CreateBorderWithVerticalSpacing(vert_spacing)); SetInkDropMode(InkDropMode::ON); + views::InkDrop::UseInkDropForFloodFillRipple(this); SetTriggerableEventFlags(ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON); @@ -275,10 +276,6 @@ return GetInkDropColor(this); } -std::unique_ptr<views::InkDrop> HoverButton::CreateInkDrop() { - return views::InkDrop::CreateInkDropForFloodFillRipple(this); -} - views::View* HoverButton::GetTooltipHandlerForPoint(const gfx::Point& point) { if (!HitTestPoint(point)) return nullptr;
diff --git a/chrome/browser/ui/views/hover_button.h b/chrome/browser/ui/views/hover_button.h index cd39202..8d8b36e 100644 --- a/chrome/browser/ui/views/hover_button.h +++ b/chrome/browser/ui/views/hover_button.h
@@ -10,9 +10,9 @@ #include "base/gtest_prod_util.h" #include "base/optional.h" #include "base/scoped_observation.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/button/menu_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace media_router { FORWARD_DECLARE_TEST(CastDialogSinkButtonTest, SetTitleLabel); @@ -88,7 +88,6 @@ KeyClickAction GetKeyClickActionForEvent(const ui::KeyEvent& event) override; void StateChanged(ButtonState old_state) override; SkColor GetInkDropBaseColor() const override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; views::View* GetTooltipHandlerForPoint(const gfx::Point& point) override; views::StyledLabel* title() const { return title_; }
diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index ea21f9f..aba2efe 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc
@@ -36,6 +36,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/result_codes.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/views/controls/button/md_text_button.h" @@ -43,7 +44,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" using content::WebContents;
diff --git a/chrome/browser/ui/views/hung_renderer_view.h b/chrome/browser/ui/views/hung_renderer_view.h index a35f2176..9e3ba26 100644 --- a/chrome/browser/ui/views/hung_renderer_view.h +++ b/chrome/browser/ui/views/hung_renderer_view.h
@@ -17,10 +17,10 @@ #include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host_observer.h" #include "content/public/browser/web_contents_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/table_model.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/table/table_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace content {
diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc index 6d26650..3e30faf 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc
@@ -19,10 +19,10 @@ #include "chrome/grit/locale_settings.h" #include "ui/base/buildflags.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" using base::UserMetricsAction;
diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.h b/chrome/browser/ui/views/importer/import_lock_dialog_view.h index 0ad78c9..ae6135d 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view.h +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.h
@@ -8,7 +8,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/macros.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" // ImportLockDialogView asks the user to shut down Firefox before starting the
diff --git a/chrome/browser/ui/views/infobars/infobar_container_view.cc b/chrome/browser/ui/views/infobars/infobar_container_view.cc index d32e1ae..96097f3d 100644 --- a/chrome/browser/ui/views/infobars/infobar_container_view.cc +++ b/chrome/browser/ui/views/infobars/infobar_container_view.cc
@@ -14,12 +14,12 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/gfx/skia_paint_util.h" #include "ui/views/bubble/bubble_border.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/infobars/infobar_container_view.h b/chrome/browser/ui/views/infobars/infobar_container_view.h index cb287f6..1072d1c 100644 --- a/chrome/browser/ui/views/infobars/infobar_container_view.h +++ b/chrome/browser/ui/views/infobars/infobar_container_view.h
@@ -8,8 +8,8 @@ #include <stddef.h> #include "components/infobars/core/infobar_container.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/accessible_pane_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view_targeter_delegate.h" // The views-specific implementation of InfoBarContainer.
diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc index a866774..d6ddde37 100644 --- a/chrome/browser/ui/views/infobars/infobar_view.cc +++ b/chrome/browser/ui/views/infobars/infobar_view.cc
@@ -22,6 +22,7 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/base/class_property.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" @@ -40,7 +41,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/link.h" #include "ui/views/controls/menu/menu_runner.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h" #include "ui/views/window/non_client_view.h"
diff --git a/chrome/browser/ui/views/infobars/infobar_view.h b/chrome/browser/ui/views/infobars/infobar_view.h index d1bf0f5..d851ab5 100644 --- a/chrome/browser/ui/views/infobars/infobar_view.h +++ b/chrome/browser/ui/views/infobars/infobar_view.h
@@ -10,9 +10,9 @@ #include "components/infobars/core/infobar.h" #include "components/infobars/core/infobar_container.h" #include "third_party/skia/include/core/SkPath.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/menu/menu_types.h" #include "ui/views/focus/external_focus_tracker.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/intent_picker_bubble_view.cc b/chrome/browser/ui/views/intent_picker_bubble_view.cc index cfa1911a..37f6f74 100644 --- a/chrome/browser/ui/views/intent_picker_bubble_view.cc +++ b/chrome/browser/ui/views/intent_picker_bubble_view.cc
@@ -26,6 +26,8 @@ #include "content/public/browser/navigation_handle.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/gfx/geometry/insets.h" #include "ui/strings/grit/ui_strings.h" @@ -39,8 +41,6 @@ #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #if BUILDFLAG(IS_CHROMEOS_ASH) #include "components/arc/intent_helper/arc_intent_helper_bridge.h"
diff --git a/chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc b/chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc index 2464b5f..9ba65da 100644 --- a/chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc +++ b/chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.cc
@@ -9,12 +9,12 @@ #include "chrome/browser/ui/views/title_origin_label.h" #include "components/constrained_window/constrained_window_views.h" #include "content/public/browser/javascript_dialog_manager.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/label.h" #include "ui/views/controls/message_box_view.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" JavaScriptTabModalDialogViewViews::~JavaScriptTabModalDialogViewViews() = default;
diff --git a/chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.h b/chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.h index ae9feb20..c01d195 100644 --- a/chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.h +++ b/chrome/browser/ui/views/javascript_tab_modal_dialog_view_views.h
@@ -10,7 +10,7 @@ #include "base/macros.h" #include "components/javascript_dialogs/tab_modal_dialog_view.h" #include "content/public/browser/javascript_dialog_manager.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace views {
diff --git a/chrome/browser/ui/views/location_bar/OWNERS b/chrome/browser/ui/views/location_bar/OWNERS index e004b14..d4256e4 100644 --- a/chrome/browser/ui/views/location_bar/OWNERS +++ b/chrome/browser/ui/views/location_bar/OWNERS
@@ -1,2 +1,6 @@ estade@chromium.org file://components/omnibox/OWNERS + +per-file permission_chip.*=olesiamarukhno@google.com +per-file permission_request_chip.*=olesiamarukhno@google.com +per-file permission_request_chip_browsertest.*=olesiamarukhno@google.com
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc index 568f0ee..e9b86fc 100644 --- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc +++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
@@ -17,6 +17,7 @@ #include "chrome/browser/ui/views/user_education/feature_promo_controller_views.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/events/event_utils.h" #include "ui/gfx/color_palette.h" @@ -26,7 +27,6 @@ #include "ui/views/animation/ink_drop_impl.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace {
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.h b/chrome/browser/ui/views/location_bar/content_setting_image_view.h index 0206d52..7e3cefe7 100644 --- a/chrome/browser/ui/views/location_bar/content_setting_image_view.h +++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.h
@@ -10,9 +10,9 @@ #include "chrome/browser/ui/content_settings/content_setting_image_model.h" #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" #include "components/content_settings/core/common/content_settings_types.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/animation/slide_animation.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/painter.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/location_bar/cookie_controls_icon_view.cc b/chrome/browser/ui/views/location_bar/cookie_controls_icon_view.cc index 7fd94c8e..5428a7a 100644 --- a/chrome/browser/ui/views/location_bar/cookie_controls_icon_view.cc +++ b/chrome/browser/ui/views/location_bar/cookie_controls_icon_view.cc
@@ -16,9 +16,9 @@ #include "components/content_settings/browser/ui/cookie_controls_controller.h" #include "content/public/browser/browser_context.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/views/metadata/metadata_impl_macros.h" CookieControlsIconView::CookieControlsIconView( IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
diff --git a/chrome/browser/ui/views/location_bar/cookie_controls_icon_view.h b/chrome/browser/ui/views/location_bar/cookie_controls_icon_view.h index 898469fd..5b446ce 100644 --- a/chrome/browser/ui/views/location_bar/cookie_controls_icon_view.h +++ b/chrome/browser/ui/views/location_bar/cookie_controls_icon_view.h
@@ -12,7 +12,7 @@ #include "components/content_settings/browser/ui/cookie_controls_controller.h" #include "components/content_settings/browser/ui/cookie_controls_view.h" #include "components/content_settings/core/common/cookie_controls_status.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" // View for the cookie control icon in the Omnibox. class CookieControlsIconView : public PageActionIconView,
diff --git a/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc b/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc index d238a8f..4818c0b 100644 --- a/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc
@@ -28,6 +28,8 @@ #include "content/public/browser/navigation_entry.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/rect.h" @@ -42,8 +44,6 @@ #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/style/typography_provider.h" #include "ui/views/view_class_properties.h" @@ -197,7 +197,7 @@ ADD_READONLY_PROPERTY_METADATA(int, MinimumWidth) ADD_READONLY_PROPERTY_METADATA(SkColor, LocationColor, - views::metadata::SkColorConverter) + ui::metadata::SkColorConverter) END_METADATA CustomTabBarView::CustomTabBarView(BrowserView* browser_view, @@ -546,7 +546,7 @@ BEGIN_METADATA(CustomTabBarView, views::AccessiblePaneView) ADD_READONLY_PROPERTY_METADATA(SkColor, DefaultFrameColor, - views::metadata::SkColorConverter) + ui::metadata::SkColorConverter) ADD_READONLY_PROPERTY_METADATA(base::Optional<SkColor>, ThemeColor) ADD_READONLY_PROPERTY_METADATA(bool, ShowTitle) END_METADATA
diff --git a/chrome/browser/ui/views/location_bar/custom_tab_bar_view.h b/chrome/browser/ui/views/location_bar/custom_tab_bar_view.h index bf6dbcf..a36abdd 100644 --- a/chrome/browser/ui/views/location_bar/custom_tab_bar_view.h +++ b/chrome/browser/ui/views/location_bar/custom_tab_bar_view.h
@@ -10,10 +10,10 @@ #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/location_bar/location_icon_view.h" #include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/simple_menu_model.h" #include "ui/views/accessible_pane_view.h" #include "ui/views/context_menu_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace gfx { class Rect;
diff --git a/chrome/browser/ui/views/location_bar/find_bar_icon.cc b/chrome/browser/ui/views/location_bar/find_bar_icon.cc index 7ef9864..72f2f70 100644 --- a/chrome/browser/ui/views/location_bar/find_bar_icon.cc +++ b/chrome/browser/ui/views/location_bar/find_bar_icon.cc
@@ -10,8 +10,8 @@ #include "chrome/grit/generated_resources.h" #include "components/omnibox/browser/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/animation/ink_drop.h" -#include "ui/views/metadata/metadata_impl_macros.h" FindBarIcon::FindBarIcon( Browser* browser,
diff --git a/chrome/browser/ui/views/location_bar/find_bar_icon.h b/chrome/browser/ui/views/location_bar/find_bar_icon.h index e201741f..ae3bf7b 100644 --- a/chrome/browser/ui/views/location_bar/find_bar_icon.h +++ b/chrome/browser/ui/views/location_bar/find_bar_icon.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_FIND_BAR_ICON_H_ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class Browser;
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc index 3d4bfab9..c8992474 100644 --- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc +++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
@@ -8,10 +8,12 @@ #include <memory> #include <utility> +#include "base/bind.h" #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/omnibox/omnibox_theme.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/canvas.h" @@ -30,7 +32,6 @@ #include "ui/views/border.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace { @@ -147,6 +148,17 @@ SetInkDropVisibleOpacity(GetOmniboxStateOpacity(OmniboxPartState::SELECTED)); SetInkDropHighlightOpacity(GetOmniboxStateOpacity(OmniboxPartState::HOVERED)); + SetCreateInkDropCallback(base::BindRepeating( + [](IconLabelBubbleView* host) { + std::unique_ptr<views::InkDrop> ink_drop = + views::InkDrop::CreateInkDropForFloodFillRipple( + host, /*highlight_on_hover=*/false, + /*highlight_on_focus=*/!host->focus_ring()); + ink_drop->AddObserver(host); + return ink_drop; + }, + this)); + views::HighlightPathGenerator::Install( this, std::make_unique<HighlightPathGenerator>()); SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); @@ -321,15 +333,6 @@ UpdateLabelColors(); } -std::unique_ptr<views::InkDrop> IconLabelBubbleView::CreateInkDrop() { - std::unique_ptr<views::InkDrop> ink_drop = - views::InkDrop::CreateInkDropForFloodFillRipple( - this, /*highlight_on_hover=*/false, - /*highlight_on_focus=*/!focus_ring()); - ink_drop->AddObserver(this); - return ink_drop; -} - SkColor IconLabelBubbleView::GetInkDropBaseColor() const { return delegate_->GetIconLabelBubbleInkDropColor(); } @@ -578,7 +581,7 @@ BEGIN_METADATA(IconLabelBubbleView, views::LabelButton) ADD_READONLY_PROPERTY_METADATA(SkColor, ForegroundColor, - views::metadata::SkColorConverter) + ui::metadata::SkColorConverter) ADD_READONLY_PROPERTY_METADATA(double, AnimationValue) ADD_READONLY_PROPERTY_METADATA(int, InternalSpacing) ADD_READONLY_PROPERTY_METADATA(int, ExtraInternalSpacing)
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h index 6bdc5e7..e921f46 100644 --- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h +++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
@@ -8,9 +8,11 @@ #include <memory> #include <string> +#include "base/bind.h" #include "base/optional.h" #include "base/scoped_observation.h" #include "third_party/skia/include/core/SkPath.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/size.h" @@ -18,7 +20,6 @@ #include "ui/views/animation/ink_drop_observer.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_observer.h" namespace gfx { @@ -147,7 +148,6 @@ void Layout() override; bool OnMousePressed(const ui::MouseEvent& event) override; void OnThemeChanged() override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; SkColor GetInkDropBaseColor() const override; bool IsTriggerableEvent(const ui::Event& event) override; bool ShouldUpdateInkDropOnClickCanceled() const override;
diff --git a/chrome/browser/ui/views/location_bar/intent_picker_view.cc b/chrome/browser/ui/views/location_bar/intent_picker_view.cc index 6c13254..fe56d607 100644 --- a/chrome/browser/ui/views/location_bar/intent_picker_view.cc +++ b/chrome/browser/ui/views/location_bar/intent_picker_view.cc
@@ -15,7 +15,7 @@ #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" namespace content { class WebContents;
diff --git a/chrome/browser/ui/views/location_bar/intent_picker_view.h b/chrome/browser/ui/views/location_bar/intent_picker_view.h index 66eccc9..924e8d02 100644 --- a/chrome/browser/ui/views/location_bar/intent_picker_view.h +++ b/chrome/browser/ui/views/location_bar/intent_picker_view.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_INTENT_PICKER_VIEW_H_ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class Browser;
diff --git a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc index 8656b079..20a4232 100644 --- a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc +++ b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
@@ -22,6 +22,8 @@ #include "components/search_engines/template_url_service.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/gfx/color_utils.h" #include "ui/strings/grit/ui_strings.h" @@ -31,8 +33,6 @@ #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace {
diff --git a/chrome/browser/ui/views/location_bar/keyword_hint_view.h b/chrome/browser/ui/views/location_bar/keyword_hint_view.h index 8356aed..bf0de2e 100644 --- a/chrome/browser/ui/views/location_bar/keyword_hint_view.h +++ b/chrome/browser/ui/views/location_bar/keyword_hint_view.h
@@ -9,9 +9,9 @@ #include "base/compiler_specific.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/size.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" class Profile;
diff --git a/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc b/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc index 8055a033..5349b36f 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc
@@ -17,10 +17,10 @@ #include "content/public/browser/render_view_host.h" #include "ui/accessibility/ax_role_properties.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/bubble/bubble_frame_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "url/origin.h" LocationBarBubbleDelegateView::WebContentMouseHandler::WebContentMouseHandler(
diff --git a/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h b/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h index 2c5e16fc..bd955dc 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h +++ b/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h
@@ -10,10 +10,10 @@ #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" #include "chrome/browser/ui/exclusive_access/fullscreen_observer.h" #include "content/public/browser/web_contents_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/events/event_observer.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/event_monitor.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace content { class WebContents;
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index c84ad94..09ff427 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -30,6 +30,7 @@ #include "chrome/browser/sharing/features.h" #include "chrome/browser/sharing/shared_clipboard/feature_flags.h" #include "chrome/browser/sharing/sms/sms_flags.h" +#include "chrome/browser/sharing_hub/sharing_hub_features.h" #include "chrome/browser/ssl/security_state_tab_helper.h" #include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/themes/theme_service.h" @@ -63,6 +64,7 @@ #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h" #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h" #include "chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.h" +#include "chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.h" #include "chrome/browser/ui/web_applications/app_browser_controller.h" #include "chrome/common/chrome_features.h" #include "chrome/grit/chromium_strings.h" @@ -101,6 +103,7 @@ #include "ui/base/ime/input_method.h" #include "ui/base/ime/virtual_keyboard_controller.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" #include "ui/base/ui_base_features.h" @@ -123,7 +126,6 @@ #include "ui/views/controls/focus_ring.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view_utils.h" #include "ui/views/widget/widget.h" @@ -269,6 +271,8 @@ params.types_enabled.push_back(PageActionIconType::kQRCodeGenerator); if (base::FeatureList::IsEnabled(kSharedClipboardUI)) params.types_enabled.push_back(PageActionIconType::kSharedClipboard); + if (base::FeatureList::IsEnabled(sharing_hub::kSharingHubDesktopOmnibox)) + params.types_enabled.push_back(PageActionIconType::kSharingHub); if (base::FeatureList::IsEnabled(kWebOTPCrossDevice)) params.types_enabled.push_back(PageActionIconType::kSmsRemoteFetcher); if (!base::FeatureList::IsEnabled( @@ -1348,7 +1352,7 @@ ADD_READONLY_PROPERTY_METADATA(int, BorderRadius) ADD_READONLY_PROPERTY_METADATA(SkColor, OpaqueBorderColor, - views::metadata::SkColorConverter) + ui::metadata::SkColorConverter) ADD_READONLY_PROPERTY_METADATA(gfx::Point, OmniboxViewOrigin) ADD_PROPERTY_METADATA(std::u16string, ImeInlineAutocompletion) ADD_PROPERTY_METADATA(std::u16string, OmniboxAdditionalText) @@ -1356,7 +1360,7 @@ ADD_READONLY_PROPERTY_METADATA(int, MinimumTrailingWidth) ADD_READONLY_PROPERTY_METADATA(SkColor, BorderColor, - views::metadata::SkColorConverter) + ui::metadata::SkColorConverter) ADD_READONLY_PROPERTY_METADATA(gfx::Rect, LocalBoundsWithoutEndcaps) ADD_READONLY_PROPERTY_METADATA(bool, PopupMode) END_METADATA
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h index f85dc6a..6be252e 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.h +++ b/chrome/browser/ui/views/location_bar/location_bar_view.h
@@ -30,6 +30,7 @@ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" #include "components/security_state/core/security_state.h" #include "services/device/public/cpp/geolocation/geolocation_manager.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/font.h" @@ -38,7 +39,6 @@ #include "ui/views/animation/animation_delegate_views.h" #include "ui/views/controls/focus_ring.h" #include "ui/views/drag_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" class CommandUpdater; class ContentSettingBubbleModelDelegate;
diff --git a/chrome/browser/ui/views/location_bar/location_icon_view.cc b/chrome/browser/ui/views/location_bar/location_icon_view.cc index 1aced6ef..464ac353 100644 --- a/chrome/browser/ui/views/location_bar/location_icon_view.cc +++ b/chrome/browser/ui/views/location_bar/location_icon_view.cc
@@ -24,8 +24,8 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_impl_macros.h" using content::WebContents; using security_state::SecurityLevel;
diff --git a/chrome/browser/ui/views/location_bar/location_icon_view.h b/chrome/browser/ui/views/location_bar/location_icon_view.h index 856b678..8fd6bec 100644 --- a/chrome/browser/ui/views/location_bar/location_icon_view.h +++ b/chrome/browser/ui/views/location_bar/location_icon_view.h
@@ -7,7 +7,7 @@ #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" #include "components/omnibox/browser/location_bar_model.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace content { class WebContents;
diff --git a/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc b/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc index eb6b7ce..3d347f15 100644 --- a/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc +++ b/chrome/browser/ui/views/location_bar/omnibox_chip_button.cc
@@ -9,10 +9,10 @@ #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "components/vector_icons/vector_icons.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/native_theme/native_theme.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" OmniboxChipButton::OmniboxChipButton(PressedCallback callback, int button_context)
diff --git a/chrome/browser/ui/views/location_bar/omnibox_chip_button.h b/chrome/browser/ui/views/location_bar/omnibox_chip_button.h index 1bfac23..3c5a1bb 100644 --- a/chrome/browser/ui/views/location_bar/omnibox_chip_button.h +++ b/chrome/browser/ui/views/location_bar/omnibox_chip_button.h
@@ -5,9 +5,9 @@ #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OMNIBOX_CHIP_BUTTON_H_ #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OMNIBOX_CHIP_BUTTON_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/slide_animation.h" #include "ui/views/controls/button/md_text_button.h" -#include "ui/views/metadata/metadata_header_macros.h" // UI component for chip button located in the omnibox. A button with an icon // and text, with rounded corners.
diff --git a/chrome/browser/ui/views/location_bar/permission_chip.cc b/chrome/browser/ui/views/location_bar/permission_chip.cc index 62ba91b..37550a54 100644 --- a/chrome/browser/ui/views/location_bar/permission_chip.cc +++ b/chrome/browser/ui/views/location_bar/permission_chip.cc
@@ -15,11 +15,11 @@ #include "components/permissions/request_type.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/controls/button/button_controller.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace {
diff --git a/chrome/browser/ui/views/location_bar/permission_chip.h b/chrome/browser/ui/views/location_bar/permission_chip.h index 9201f15..bfdb34b9 100644 --- a/chrome/browser/ui/views/location_bar/permission_chip.h +++ b/chrome/browser/ui/views/location_bar/permission_chip.h
@@ -9,8 +9,8 @@ #include "chrome/browser/ui/views/location_bar/omnibox_chip_button.h" #include "components/permissions/permission_prompt.h" #include "components/permissions/permission_request.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/accessible_pane_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_observer.h" namespace views {
diff --git a/chrome/browser/ui/views/location_bar/permission_request_chip.cc b/chrome/browser/ui/views/location_bar/permission_request_chip.cc index 4e3f78a..f096e814d 100644 --- a/chrome/browser/ui/views/location_bar/permission_request_chip.cc +++ b/chrome/browser/ui/views/location_bar/permission_request_chip.cc
@@ -15,12 +15,12 @@ #include "components/permissions/request_type.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/button_controller.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace {
diff --git a/chrome/browser/ui/views/location_bar/selected_keyword_view.cc b/chrome/browser/ui/views/location_bar/selected_keyword_view.cc index f87dc2f..c65b0f7 100644 --- a/chrome/browser/ui/views/location_bar/selected_keyword_view.cc +++ b/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
@@ -12,11 +12,11 @@ #include "components/search_engines/template_url_service.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/views/metadata/metadata_impl_macros.h" // static SelectedKeywordView::KeywordLabelNames
diff --git a/chrome/browser/ui/views/location_bar/selected_keyword_view.h b/chrome/browser/ui/views/location_bar/selected_keyword_view.h index 02f9a9a..3d10627 100644 --- a/chrome/browser/ui/views/location_bar/selected_keyword_view.h +++ b/chrome/browser/ui/views/location_bar/selected_keyword_view.h
@@ -10,8 +10,8 @@ #include "base/compiler_specific.h" #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" class LocationBarView; class TemplateURLService;
diff --git a/chrome/browser/ui/views/location_bar/star_view.cc b/chrome/browser/ui/views/location_bar/star_view.cc index bd0dc8a..8e9527d 100644 --- a/chrome/browser/ui/views/location_bar/star_view.cc +++ b/chrome/browser/ui/views/location_bar/star_view.cc
@@ -35,11 +35,11 @@ #include "components/variations/variations_associated_data.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/controls/menu/menu_runner.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/location_bar/star_view.h b/chrome/browser/ui/views/location_bar/star_view.h index 3644ffe..b36e760 100644 --- a/chrome/browser/ui/views/location_bar/star_view.h +++ b/chrome/browser/ui/views/location_bar/star_view.h
@@ -10,8 +10,8 @@ #include "chrome/browser/ui/user_education/feature_promo_controller.h" #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" #include "components/prefs/pref_member.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/simple_menu_model.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class MenuRunner;
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc index 2025102..f1ae7482 100644 --- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc +++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
@@ -35,6 +35,8 @@ #include "extensions/grit/extensions_browser_resources.h" #include "third_party/blink/public/common/page/page_zoom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/favicon_size.h" #include "ui/gfx/geometry/insets.h" @@ -50,8 +52,6 @@ #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/login_view.cc b/chrome/browser/ui/views/login_view.cc index f6588ba..8ba1b3a 100644 --- a/chrome/browser/ui/views/login_view.cc +++ b/chrome/browser/ui/views/login_view.cc
@@ -11,11 +11,11 @@ #include "chrome/browser/ui/views/textfield_layout.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/login_view.h b/chrome/browser/ui/views/login_view.h index 6140057a..cb59220 100644 --- a/chrome/browser/ui/views/login_view.h +++ b/chrome/browser/ui/views/login_view.h
@@ -9,7 +9,7 @@ #include "chrome/browser/ui/login/login_handler.h" #include "components/password_manager/core/browser/http_auth_observer.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/md_text_button_with_down_arrow.cc b/chrome/browser/ui/views/md_text_button_with_down_arrow.cc index 857bc6f..3a97a65 100644 --- a/chrome/browser/ui/views/md_text_button_with_down_arrow.cc +++ b/chrome/browser/ui/views/md_text_button_with_down_arrow.cc
@@ -5,10 +5,10 @@ #include "chrome/browser/ui/views/md_text_button_with_down_arrow.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" namespace views {
diff --git a/chrome/browser/ui/views/md_text_button_with_down_arrow.h b/chrome/browser/ui/views/md_text_button_with_down_arrow.h index 6d108271..73dd361 100644 --- a/chrome/browser/ui/views/md_text_button_with_down_arrow.h +++ b/chrome/browser/ui/views/md_text_button_with_down_arrow.h
@@ -8,8 +8,8 @@ #include <string> #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/md_text_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views {
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_no_sinks_view.cc b/chrome/browser/ui/views/media_router/cast_dialog_no_sinks_view.cc index cf29344..91c93e1 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_no_sinks_view.cc +++ b/chrome/browser/ui/views/media_router/cast_dialog_no_sinks_view.cc
@@ -25,6 +25,7 @@ #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/page_transition_types.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" @@ -33,7 +34,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/throbber.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_no_sinks_view.h b/chrome/browser/ui/views/media_router/cast_dialog_no_sinks_view.h index 11a9d75..2bc328d 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_no_sinks_view.h +++ b/chrome/browser/ui/views/media_router/cast_dialog_no_sinks_view.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_MEDIA_ROUTER_CAST_DIALOG_NO_SINKS_VIEW_H_ #include "base/timer/timer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" class Profile;
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_sink_button.cc b/chrome/browser/ui/views/media_router/cast_dialog_sink_button.cc index a1348ebc..20bb25f 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_sink_button.cc +++ b/chrome/browser/ui/views/media_router/cast_dialog_sink_button.cc
@@ -28,6 +28,8 @@ #include "components/vector_icons/vector_icons.h" #include "content/public/browser/browser_thread.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" @@ -37,8 +39,6 @@ #include "ui/views/controls/styled_label.h" #include "ui/views/controls/throbber.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_sink_button.h b/chrome/browser/ui/views/media_router/cast_dialog_sink_button.h index 5867e2a..ce79a04 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_sink_button.h +++ b/chrome/browser/ui/views/media_router/cast_dialog_sink_button.h
@@ -10,7 +10,7 @@ #include "base/bind.h" #include "chrome/browser/ui/media_router/ui_media_sink.h" #include "chrome/browser/ui/views/hover_button.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace ui { class MouseEvent;
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_view.cc b/chrome/browser/ui/views/media_router/cast_dialog_view.cc index 3ccf266d..9489a63 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_view.cc +++ b/chrome/browser/ui/views/media_router/cast_dialog_view.cc
@@ -30,6 +30,7 @@ #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/vector_icon_types.h" @@ -38,7 +39,6 @@ #include "ui/views/controls/scroll_view.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" namespace media_router {
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_view.h b/chrome/browser/ui/views/media_router/cast_dialog_view.h index e5b85596..5b9ae9f 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_view.h +++ b/chrome/browser/ui/views/media_router/cast_dialog_view.h
@@ -12,12 +12,12 @@ #include "base/observer_list.h" #include "chrome/browser/ui/media_router/cast_dialog_controller.h" #include "chrome/browser/ui/views/media_router/cast_dialog_metrics.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/simple_menu_model.h" #include "ui/shell_dialogs/selected_file_info.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/menu/menu_runner.h" -#include "ui/views/metadata/metadata_header_macros.h" class Browser; class Profile;
diff --git a/chrome/browser/ui/views/media_router/cast_toolbar_button.cc b/chrome/browser/ui/views/media_router/cast_toolbar_button.cc index d1543f4..3fb2fd5 100644 --- a/chrome/browser/ui/views/media_router/cast_toolbar_button.cc +++ b/chrome/browser/ui/views/media_router/cast_toolbar_button.cc
@@ -15,6 +15,7 @@ #include "components/media_router/browser/media_router_metrics.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/menu_model.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/theme_provider.h" @@ -23,7 +24,6 @@ #include "ui/gfx/vector_icon_types.h" #include "ui/native_theme/native_theme.h" #include "ui/views/controls/button/button_controller.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace media_router {
diff --git a/chrome/browser/ui/views/media_router/cast_toolbar_button.h b/chrome/browser/ui/views/media_router/cast_toolbar_button.h index d02d0f5c..f1a709ae 100644 --- a/chrome/browser/ui/views/media_router/cast_toolbar_button.h +++ b/chrome/browser/ui/views/media_router/cast_toolbar_button.h
@@ -9,8 +9,8 @@ #include "chrome/browser/ui/toolbar/media_router_contextual_menu.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" #include "components/media_router/browser/issues_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/events/event.h" -#include "ui/views/metadata/metadata_header_macros.h" class Browser;
diff --git a/chrome/browser/ui/views/media_router/media_remoting_dialog_view.cc b/chrome/browser/ui/views/media_router/media_remoting_dialog_view.cc index 04ac2b5..d04b445 100644 --- a/chrome/browser/ui/views/media_router/media_remoting_dialog_view.cc +++ b/chrome/browser/ui/views/media_router/media_remoting_dialog_view.cc
@@ -14,9 +14,9 @@ #include "components/media_router/common/pref_names.h" #include "components/prefs/pref_service.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/checkbox.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" namespace media_router {
diff --git a/chrome/browser/ui/views/media_router/media_remoting_dialog_view.h b/chrome/browser/ui/views/media_router/media_remoting_dialog_view.h index a6a0f25..c7c2c2db 100644 --- a/chrome/browser/ui/views/media_router/media_remoting_dialog_view.h +++ b/chrome/browser/ui/views/media_router/media_remoting_dialog_view.h
@@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_MEDIA_ROUTER_MEDIA_REMOTING_DIALOG_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_MEDIA_ROUTER_MEDIA_REMOTING_DIALOG_VIEW_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class MediaRouterActionController; class PrefService;
diff --git a/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc b/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc index dbc92ed..7c65867 100644 --- a/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc +++ b/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc
@@ -36,12 +36,12 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/content_constants.h" #include "ui/base/accelerators/accelerator_manager.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/screen.h" #include "ui/gfx/geometry/point.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/focus/focus_manager.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #if defined(OS_MAC)
diff --git a/chrome/browser/ui/views/media_router/presentation_receiver_window_view.h b/chrome/browser/ui/views/media_router/presentation_receiver_window_view.h index 870cb55..598b45a 100644 --- a/chrome/browser/ui/views/media_router/presentation_receiver_window_view.h +++ b/chrome/browser/ui/views/media_router/presentation_receiver_window_view.h
@@ -19,7 +19,7 @@ #include "chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.h" #include "chrome/browser/ui/views/exclusive_access_bubble_views_context.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_delegate.h" class ExclusiveAccessBubbleViews;
diff --git a/chrome/browser/ui/views/network_profile_bubble_view.cc b/chrome/browser/ui/views/network_profile_bubble_view.cc index cf2432437..dc371ea3 100644 --- a/chrome/browser/ui/views/network_profile_bubble_view.cc +++ b/chrome/browser/ui/views/network_profile_bubble_view.cc
@@ -16,12 +16,12 @@ #include "components/prefs/pref_service.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/label.h" #include "ui/views/controls/link.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.cc b/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.cc index 40fc97c5..1a4eeea 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.cc
@@ -19,6 +19,8 @@ #include "components/omnibox/browser/vector_icons.h" #include "extensions/common/image_util.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" @@ -30,8 +32,6 @@ #include "ui/views/border.h" #include "ui/views/controls/image_view.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.h b/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.h index 27f55939..d24e087 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.h +++ b/chrome/browser/ui/views/omnibox/omnibox_match_cell_view.h
@@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_MATCH_CELL_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_MATCH_CELL_VIEW_H_ -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc index ebeb185..207dc55 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
@@ -24,13 +24,13 @@ #include "components/omnibox/browser/omnibox_prefs.h" #include "components/omnibox/common/omnibox_features.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/closure_animation_observer.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/image/image.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" class OmniboxPopupContentsView::AutocompletePopupWidget
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h index b4eaee7..e794c247 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h +++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h
@@ -11,10 +11,10 @@ #include "components/omnibox/browser/omnibox_popup_model.h" #include "components/omnibox/browser/omnibox_popup_view.h" #include "components/prefs/pref_change_registrar.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/window_open_disposition.h" #include "ui/gfx/font_list.h" #include "ui/gfx/image/image.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget_observer.h"
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc index 1e858ab..072ebbe 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
@@ -20,7 +20,6 @@ #include "chrome/browser/ui/views/omnibox/omnibox_match_cell_view.h" #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" #include "chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.h" -#include "chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h" #include "chrome/browser/ui/views/omnibox/omnibox_text_view.h" #include "chrome/browser/ui/views/omnibox/remove_suggestion_bubble.h" #include "chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h" @@ -35,6 +34,8 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/events/event.h" #include "ui/gfx/paint_vector_icon.h" @@ -44,8 +45,6 @@ #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/metadata/type_conversion.h" #include "ui/views/view_class_properties.h" @@ -187,20 +186,6 @@ .WithWeight(4)); const gfx::Insets child_insets(0, 0, 0, OmniboxMatchCellView::kMarginRight); - suggestion_tab_switch_button_ = suggestion_button_container->AddChildView( - std::make_unique<OmniboxTabSwitchButton>( - base::BindRepeating(&OmniboxResultView::ButtonPressed, - base::Unretained(this), - OmniboxPopupModel::FOCUSED_BUTTON_TAB_SWITCH), - popup_contents_view_, this, - l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_HINT), - l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_SHORT_HINT), - omnibox::kSwitchIcon)); - suggestion_tab_switch_button_->SetProperty(views::kMarginsKey, child_insets); - suggestion_tab_switch_button_->SetProperty( - views::kFlexBehaviorKey, - views::FlexSpecification(OmniboxTabSwitchButton::GetFlexRule()) - .WithWeight(1)); // This is intentionally not in the tab order by default, but should be if the // user has full-acessibility mode on. This is because this is a tertiary @@ -223,15 +208,13 @@ OmniboxPopupModel::FOCUSED_BUTTON_REMOVE_SUGGESTION); }); - if (OmniboxFieldTrial::IsSuggestionButtonRowEnabled()) { - button_row_ = AddChildView(std::make_unique<OmniboxSuggestionButtonRowView>( - popup_contents_view_, model_index)); + button_row_ = AddChildView(std::make_unique<OmniboxSuggestionButtonRowView>( + popup_contents_view_, model_index)); - // Quickly mouse-exiting through the suggestion button row sometimes leaves - // the whole row highlighted. This fixes that. It doesn't seem necessary to - // further observe the child controls of |button_row_|. - mouse_enter_exit_handler_.ObserveMouseEnterExitOn(button_row_); - } + // Quickly mouse-exiting through the suggestion button row sometimes leaves + // the whole row highlighted. This fixes that. It doesn't seem necessary to + // further observe the child controls of |button_row_|. + mouse_enter_exit_handler_.ObserveMouseEnterExitOn(button_row_); keyword_view_ = suggestion_button_container->AddChildView( std::make_unique<OmniboxMatchCellView>(this)); @@ -274,7 +257,6 @@ suggestion_view_->OnMatchUpdate(this, match_); keyword_view_->OnMatchUpdate(this, match_); - suggestion_tab_switch_button_->SetVisible(ShouldShowTabMatchButtonInline()); UpdateRemoveSuggestionVisibility(); suggestion_view_->content()->SetTextWithStyling(match_.contents, @@ -303,9 +285,7 @@ keyword_match->description, keyword_match->description_class); } } - if (OmniboxFieldTrial::IsSuggestionButtonRowEnabled()) { - button_row_->UpdateFromModel(); - } + button_row_->UpdateFromModel(); ApplyThemeAndRefreshIcons(); SetWidths(); @@ -325,8 +305,6 @@ suggestion_view_->separator()->ApplyTextColor( OmniboxPart::RESULTS_TEXT_DIMMED); keyword_view_->separator()->ApplyTextColor(OmniboxPart::RESULTS_TEXT_DIMMED); - if (suggestion_tab_switch_button_->GetVisible()) - suggestion_tab_switch_button_->UpdateBackground(); if (remove_suggestion_button_->GetVisible()) remove_suggestion_focus_ring_->SchedulePaint(); @@ -374,10 +352,8 @@ OmniboxPart::RESULTS_TEXT_DIMMED); } - if (OmniboxFieldTrial::IsSuggestionButtonRowEnabled()) { - button_row_->OnOmniboxBackgroundChange(GetOmniboxColor( - GetThemeProvider(), OmniboxPart::RESULTS_BACKGROUND, GetThemeState())); - } + button_row_->OnOmniboxBackgroundChange(GetOmniboxColor( + GetThemeProvider(), OmniboxPart::RESULTS_BACKGROUND, GetThemeState())); if (OmniboxFieldTrial::IsRefinedFocusStateEnabled()) { // The focus bar indicates when the suggestion is focused. Do not show the @@ -434,14 +410,7 @@ return remove_suggestion_button_; } - if (OmniboxFieldTrial::IsSuggestionButtonRowEnabled()) { - return button_row_->GetActiveButton(); - } else if (popup_contents_view_->model()->selected_line_state() == - OmniboxPopupModel::FOCUSED_BUTTON_TAB_SWITCH) { - return suggestion_tab_switch_button_; - } - - return nullptr; + return button_row_->GetActiveButton(); } OmniboxPartState OmniboxResultView::GetThemeState() const { @@ -450,10 +419,8 @@ // If we don't highlight the whole row when the user has the mouse over the // remove suggestion button, it's unclear which suggestion is being removed. - // That does not apply to the tab switch button, which is much larger. - bool highlight_row = - IsMouseHovered() && !suggestion_tab_switch_button_->IsMouseHovered(); - return highlight_row ? OmniboxPartState::HOVERED : OmniboxPartState::NORMAL; + return IsMouseHovered() ? OmniboxPartState::HOVERED + : OmniboxPartState::NORMAL; } void OmniboxResultView::OnMatchIconUpdated() { @@ -485,17 +452,8 @@ // When the drag enters or remains within the bounds of this view, either // set the state to be selected or hovered, depending on the mouse button. if (event.IsOnlyLeftMouseButton()) { - if (!GetMatchSelected()) + if (!GetMatchSelected()) { popup_contents_view_->SetSelectedIndex(model_index_); - if (suggestion_tab_switch_button_) { - gfx::Point point_in_child_coords(event.location()); - View::ConvertPointToTarget(this, suggestion_tab_switch_button_, - &point_in_child_coords); - if (suggestion_tab_switch_button_->HitTestPoint( - point_in_child_coords)) { - SetMouseAndGestureHandler(suggestion_tab_switch_button_); - return false; - } } } else { UpdateHoverState(); @@ -534,9 +492,6 @@ // The positional info is provided via // ax::mojom::IntAttribute::kPosInSet/SET_SIZE and providing it via text as // well would result in duplicate announcements. - // Pass false for |is_tab_switch_button_focused|, because the button will - // receive its own label in the case that a screen reader is listening to - // selection events on items rather than announcements or value change events. // TODO(tommycli): We re-fetch the original match from the popup model, // because |match_| already has its contents and description swapped by this @@ -606,13 +561,6 @@ ApplyThemeAndRefreshIcons(); } -bool OmniboxResultView::ShouldShowTabMatchButtonInline() { - return !OmniboxFieldTrial::IsSuggestionButtonRowEnabled() && - popup_contents_view_->model()->IsControlPresentOnMatch( - OmniboxPopupModel::Selection( - model_index_, OmniboxPopupModel::FOCUSED_BUTTON_TAB_SWITCH)); -} - void OmniboxResultView::UpdateRemoveSuggestionVisibility() { bool old_visibility = remove_suggestion_button_->GetVisible(); bool new_visibility =
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.h b/chrome/browser/ui/views/omnibox/omnibox_result_view.h index 54c2d48..6179d18 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.h +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.h
@@ -15,6 +15,7 @@ #include "components/omnibox/browser/omnibox_popup_model.h" #include "components/omnibox/browser/suggestion_answer.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/window_open_disposition.h" #include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/font_list.h" @@ -22,13 +23,11 @@ #include "ui/views/animation/animation_delegate_views.h" #include "ui/views/background.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" class OmniboxMatchCellView; class OmniboxPopupContentsView; class OmniboxSuggestionButtonRowView; -class OmniboxTabSwitchButton; class OmniboxResultSelectionIndicator; enum class OmniboxPart; enum class OmniboxPartState; @@ -113,13 +112,6 @@ // controls that are only visible on row hover. void UpdateHoverState(); - // This returns true if the match has a matching tab and will use a - // switch-to-tab button inline in Result View. It returns false, for - // example, when the switch button is not shown because a keyword match is - // taking precedence or when Suggestion Button Row is enabled, as the - // Switch-to-tab button will appear in the button row. - bool ShouldShowTabMatchButtonInline(); - // Sets the visibility of the |remove_suggestion_button_| based on the current // state. void UpdateRemoveSuggestionVisibility(); @@ -154,7 +146,6 @@ // Weak pointers for easy reference. OmniboxMatchCellView* suggestion_view_; // The leading (or left) view. OmniboxMatchCellView* keyword_view_; // The trailing (or right) view. - OmniboxTabSwitchButton* suggestion_tab_switch_button_; // The blue bar used to indicate selection. This is currently only used if // omnibox-refined-focus-state flag is enabled. @@ -164,8 +155,8 @@ views::ImageButton* remove_suggestion_button_; views::FocusRing* remove_suggestion_focus_ring_ = nullptr; - // The row of buttons, only assigned and used if OmniboxSuggestionButtonRow - // feature is enabled. It is owned by the base view, not this raw pointer. + // The row of buttons that appears when actions such as tab switch or Pedals + // are on the suggestion. It is owned by the base view, not this raw pointer. OmniboxSuggestionButtonRowView* button_row_ = nullptr; // Keeps track of mouse-enter and mouse-exit events of child Views.
diff --git a/chrome/browser/ui/views/omnibox/omnibox_row_view.cc b/chrome/browser/ui/views/omnibox/omnibox_row_view.cc index 6a2d720d..e5ff3e2 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_row_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_row_view.cc
@@ -20,6 +20,8 @@ #include "components/strings/grit/components_strings.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/paint_vector_icon.h" @@ -31,8 +33,6 @@ #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/metadata/type_conversion.h" #include "ui/views/style/typography.h" @@ -270,19 +270,19 @@ u"FOCUSED_BUTTON_REMOVE_SUGGESTION"}) template <> -struct views::metadata::TypeConverter<OmniboxPopupModel::Selection> - : public views::metadata::BaseTypeConverter<true> { +struct ui::metadata::TypeConverter<OmniboxPopupModel::Selection> + : public ui::metadata::BaseTypeConverter<true> { static std::u16string ToString( - views::metadata::ArgType<OmniboxPopupModel::Selection> source_value); + ui::metadata::ArgType<OmniboxPopupModel::Selection> source_value); static base::Optional<OmniboxPopupModel::Selection> FromString( const std::u16string& source_value); - static views::metadata::ValidStrings GetValidStrings() { return {}; } + static ui::metadata::ValidStrings GetValidStrings() { return {}; } }; // static std::u16string -views::metadata::TypeConverter<OmniboxPopupModel::Selection>::ToString( - views::metadata::ArgType<OmniboxPopupModel::Selection> source_value) { +ui::metadata::TypeConverter<OmniboxPopupModel::Selection>::ToString( + ui::metadata::ArgType<OmniboxPopupModel::Selection> source_value) { return u"{" + base::NumberToString16(source_value.line) + u"," + TypeConverter<OmniboxPopupModel::LineState>::ToString( source_value.state) + @@ -291,7 +291,7 @@ // static base::Optional<OmniboxPopupModel::Selection> -views::metadata::TypeConverter<OmniboxPopupModel::Selection>::FromString( +ui::metadata::TypeConverter<OmniboxPopupModel::Selection>::FromString( const std::u16string& source_value) { const auto values = base::SplitString( source_value, u"{,}", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
diff --git a/chrome/browser/ui/views/omnibox/omnibox_row_view.h b/chrome/browser/ui/views/omnibox/omnibox_row_view.h index d86dd7d..a20ce1c8 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_row_view.h +++ b/chrome/browser/ui/views/omnibox/omnibox_row_view.h
@@ -8,7 +8,7 @@ #include <string> #include "base/optional.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class OmniboxPopupModel;
diff --git a/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_browsertest.cc b/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_browsertest.cc index cfac0a2..7c97e43 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_browsertest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_browsertest.cc
@@ -33,10 +33,7 @@ class OmniboxSuggestionButtonRowBrowserTest : public DialogBrowserTest { public: OmniboxSuggestionButtonRowBrowserTest() { - feature_list_.InitWithFeatures({omnibox::kOmniboxSuggestionButtonRow, - omnibox::kOmniboxPedalSuggestions, - omnibox::kOmniboxKeywordSearchButton}, - {}); + feature_list_.InitWithFeatures({omnibox::kOmniboxKeywordSearchButton}, {}); } OmniboxSuggestionButtonRowBrowserTest(
diff --git a/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc b/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc index d1da6df1..5e0735a 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.cc
@@ -19,6 +19,8 @@ #include "third_party/metrics_proto/omnibox_event.pb.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/accessibility/view_accessibility.h" @@ -29,8 +31,6 @@ #include "ui/views/controls/focus_ring.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/view_class_properties.h"
diff --git a/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.h b/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.h index e0c6309..072d37c 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.h +++ b/chrome/browser/ui/views/omnibox/omnibox_suggestion_button_row_view.h
@@ -7,7 +7,7 @@ #include "components/omnibox/browser/autocomplete_match.h" #include "components/omnibox/browser/omnibox_popup_model.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class OmniboxPopupContentsView;
diff --git a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc b/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc deleted file mode 100644 index 6a7ff7d..0000000 --- a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc +++ /dev/null
@@ -1,151 +0,0 @@ -// Copyright (c) 2018 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/views/omnibox/omnibox_tab_switch_button.h" - -#include "base/strings/utf_string_conversions.h" -#include "chrome/browser/ui/layout_constants.h" -#include "chrome/browser/ui/omnibox/omnibox_theme.h" -#include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" -#include "chrome/browser/ui/views/omnibox/omnibox_result_view.h" -#include "components/omnibox/browser/omnibox_field_trial.h" -#include "components/omnibox/browser/vector_icons.h" -#include "components/strings/grit/components_strings.h" -#include "ui/accessibility/ax_node_data.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/gfx/animation/slide_animation.h" -#include "ui/gfx/color_palette.h" -#include "ui/gfx/color_utils.h" -#include "ui/gfx/paint_vector_icon.h" -#include "ui/views/accessibility/view_accessibility.h" -#include "ui/views/animation/ink_drop_mask.h" -#include "ui/views/controls/button/md_text_button.h" -#include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" - -// static -bool OmniboxTabSwitchButton::calculated_widths_ = false; -int OmniboxTabSwitchButton::icon_only_width_; -int OmniboxTabSwitchButton::short_text_width_; -int OmniboxTabSwitchButton::full_text_width_; - -OmniboxTabSwitchButton::OmniboxTabSwitchButton( - PressedCallback callback, - OmniboxPopupContentsView* popup_contents_view, - OmniboxResultView* result_view, - const std::u16string& hint, - const std::u16string& hint_short, - const gfx::VectorIcon& icon) - : MdTextButton(std::move(callback), - std::u16string(), - views::style::CONTEXT_BUTTON_MD), - popup_contents_view_(popup_contents_view), - result_view_(result_view), - hint_(hint), - hint_short_(hint_short) { - views::InstallPillHighlightPathGenerator(this); - SetImage(STATE_NORMAL, gfx::CreateVectorIcon( - icon, GetLayoutConstant(LOCATION_BAR_ICON_SIZE), - gfx::kChromeIconGrey)); - SetImageLabelSpacing(8); - if (!calculated_widths_) { - icon_only_width_ = MdTextButton::CalculatePreferredSize().width(); - SetText(hint_short_); - short_text_width_ = MdTextButton::CalculatePreferredSize().width(); - SetText(hint_); - full_text_width_ = MdTextButton::CalculatePreferredSize().width(); - calculated_widths_ = true; - } else { - SetText(hint_); - } - SetPreferredSize({full_text_width_, 32}); - SetCornerRadius(views::LayoutProvider::Get()->GetCornerRadiusMetric( - views::Emphasis::kMaximum, GetPreferredSize())); - SetTooltipText(hint_); - SetElideBehavior(gfx::FADE_TAIL); - - SetInstallFocusRingOnFocus(true); - focus_ring()->SetHasFocusPredicate([](View* view) { - auto* button = static_cast<OmniboxTabSwitchButton*>(view); - return button->IsSelected(); - }); -} - -OmniboxTabSwitchButton::~OmniboxTabSwitchButton() = default; - -void OmniboxTabSwitchButton::OnBoundsChanged(const gfx::Rect& previous_bounds) { - MdTextButton::OnBoundsChanged(previous_bounds); - - std::u16string text = hint_; - if (width() <= icon_only_width_) - text = std::u16string(); - else if (width() <= short_text_width_) - text = hint_short_; - SetText(text); -} - -void OmniboxTabSwitchButton::StateChanged(ButtonState old_state) { - MdTextButton::StateChanged(old_state); - if (GetState() == STATE_NORMAL && old_state == STATE_PRESSED) { - SetMouseAndGestureHandler(parent()); - if (popup_contents_view_->model()->selected_line_state() == - OmniboxPopupModel::FOCUSED_BUTTON_TAB_SWITCH) - popup_contents_view_->UnselectButton(); - } -} - -void OmniboxTabSwitchButton::OnThemeChanged() { - views::MdTextButton::OnThemeChanged(); - SetBgColorOverride(GetOmniboxColor(GetThemeProvider(), - OmniboxPart::RESULTS_BACKGROUND, - OmniboxPartState::NORMAL)); -} - -void OmniboxTabSwitchButton::GetAccessibleNodeData(ui::AXNodeData* node_data) { - node_data->SetName(l10n_util::GetStringUTF8(IDS_ACC_TAB_SWITCH_BUTTON)); - // Although this appears visually as a button, expose as a list box option so - // that it matches the other options within its list box container. - node_data->role = ax::mojom::Role::kListBoxOption; - node_data->AddBoolAttribute(ax::mojom::BoolAttribute::kSelected, - IsSelected()); -} - -// static -views::FlexRule OmniboxTabSwitchButton::GetFlexRule() { - // The rule below snaps between full, short, icon-only, and zero widths. - return base::BindRepeating( - [](const views::View* view, const views::SizeBounds& maximum_size) { - gfx::Size preferred_size = view->GetPreferredSize(); - int width; - if (!maximum_size.width().is_bounded()) { - // Until width is bounded, return 0 to allocate flex excess correctly. - width = 0; - } else if (full_text_width_ <= maximum_size.width()) { - width = full_text_width_; - } else if (short_text_width_ <= maximum_size.width()) { - width = short_text_width_; - } else if (icon_only_width_ < maximum_size.width()) { - width = icon_only_width_; - } else { - // Available width is too small to fit even the icon only. So don't - // show button at all. - width = 0; - } - return gfx::Size(width, preferred_size.height()); - }); -} - -void OmniboxTabSwitchButton::UpdateBackground() { - focus_ring()->SchedulePaint(); -} - -bool OmniboxTabSwitchButton::IsSelected() const { - // Is this result selected and is button selected? - return result_view_->GetMatchSelected() && - popup_contents_view_->model()->selected_line_state() == - OmniboxPopupModel::FOCUSED_BUTTON_TAB_SWITCH; -} - -BEGIN_METADATA(OmniboxTabSwitchButton, views::MdTextButton) -END_METADATA
diff --git a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h b/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h deleted file mode 100644 index 330dbd9..0000000 --- a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h +++ /dev/null
@@ -1,61 +0,0 @@ -// Copyright (c) 2018 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_VIEWS_OMNIBOX_OMNIBOX_TAB_SWITCH_BUTTON_H_ -#define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_TAB_SWITCH_BUTTON_H_ - -#include "ui/views/controls/button/md_text_button.h" -#include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" - -class OmniboxPopupContentsView; -class OmniboxResultView; - -class OmniboxTabSwitchButton : public views::MdTextButton { - public: - METADATA_HEADER(OmniboxTabSwitchButton); - - OmniboxTabSwitchButton(PressedCallback callback, - OmniboxPopupContentsView* popup_contents_view, - OmniboxResultView* result_view, - const std::u16string& hint, - const std::u16string& hint_short, - const gfx::VectorIcon& icon); - OmniboxTabSwitchButton(const OmniboxTabSwitchButton&) = delete; - OmniboxTabSwitchButton& operator=(const OmniboxTabSwitchButton&) = delete; - ~OmniboxTabSwitchButton() override; - - // views::MdTextButton: - void OnBoundsChanged(const gfx::Rect& previous_bounds) override; - void StateChanged(ButtonState old_state) override; - void OnThemeChanged() override; - void GetAccessibleNodeData(ui::AXNodeData* node_data) override; - - // Returns the FlexRule that should be used to size this button. - static views::FlexRule GetFlexRule(); - - // Called by parent views to change background on external (not mouse related) - // event (tab key). - void UpdateBackground(); - - private: - // Consults the parent views to see if the button is selected. - bool IsSelected() const; - - // The ancestor views. - OmniboxPopupContentsView* const popup_contents_view_; - OmniboxResultView* const result_view_; - - // Only calculate the width of various contents once. - static bool calculated_widths_; - static int icon_only_width_; - static int short_text_width_; - static int full_text_width_; - - // Label strings for hint text and its short version (may be same). - std::u16string hint_; - std::u16string hint_short_; -}; - -#endif // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_TAB_SWITCH_BUTTON_H_
diff --git a/chrome/browser/ui/views/omnibox/omnibox_text_view.cc b/chrome/browser/ui/views/omnibox/omnibox_text_view.cc index 0c8659a8..43e2113 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_text_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_text_view.cc
@@ -17,13 +17,13 @@ #include "chrome/browser/ui/views/chrome_typography.h" #include "components/omnibox/browser/omnibox_field_trial.h" #include "components/omnibox/common/omnibox_features.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/range/range.h" #include "ui/gfx/render_text.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/omnibox/omnibox_text_view.h b/chrome/browser/ui/views/omnibox/omnibox_text_view.h index 0a001d29..b025e71 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_text_view.h +++ b/chrome/browser/ui/views/omnibox/omnibox_text_view.h
@@ -12,8 +12,8 @@ #include "chrome/browser/ui/views/omnibox/omnibox_result_view.h" #include "components/omnibox/browser/autocomplete_match.h" #include "components/omnibox/browser/suggestion_answer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/font_list.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace gfx {
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc index ff0086e..af6ab3eb 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -83,6 +83,7 @@ #include "ui/base/ime/text_input_type.h" #include "ui/base/ime/virtual_keyboard_controller.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/base/models/simple_menu_model.h" #include "ui/compositor/layer.h" @@ -100,7 +101,6 @@ #include "ui/views/border.h" #include "ui/views/button_drag_utils.h" #include "ui/views/controls/textfield/textfield.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/views_features.h" #include "ui/views/widget/widget.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.h b/chrome/browser/ui/views/omnibox/omnibox_view_views.h index 28070f75..796e9e5 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.h +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.h
@@ -22,6 +22,7 @@ #include "components/search_engines/template_url_service_observer.h" #include "content/public/browser/web_contents_observer.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/window_open_disposition.h" #include "ui/compositor/compositor.h" #include "ui/compositor/compositor_observer.h" @@ -30,7 +31,6 @@ #include "ui/views/animation/animation_delegate_views.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ui/base/ime/chromeos/input_method_manager.h"
diff --git a/chrome/browser/ui/views/omnibox/remove_suggestion_bubble.cc b/chrome/browser/ui/views/omnibox/remove_suggestion_bubble.cc index 6ac3a4dc..9b9ec972 100644 --- a/chrome/browser/ui/views/omnibox/remove_suggestion_bubble.cc +++ b/chrome/browser/ui/views/omnibox/remove_suggestion_bubble.cc
@@ -13,11 +13,11 @@ #include "components/search_engines/template_url_service.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc index 4cab697e..c13784b 100644 --- a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc +++ b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc
@@ -9,14 +9,14 @@ #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/omnibox/omnibox_theme.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/compositor/layer.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/rounded_corners_f.h" #include "ui/views/bubble/bubble_border.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #if defined(USE_AURA) #include "ui/aura/window.h"
diff --git a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h index 7057931f..84579df 100644 --- a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h +++ b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h
@@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_ROUNDED_OMNIBOX_RESULTS_FRAME_H_ #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_ROUNDED_OMNIBOX_RESULTS_FRAME_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/insets.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/omnibox/webui_omnibox_popup_view.cc b/chrome/browser/ui/views/omnibox/webui_omnibox_popup_view.cc index f551aa8..2f72a01 100644 --- a/chrome/browser/ui/views/omnibox/webui_omnibox_popup_view.cc +++ b/chrome/browser/ui/views/omnibox/webui_omnibox_popup_view.cc
@@ -6,7 +6,7 @@ #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" #include "chrome/common/webui_url_constants.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" WebUIOmniboxPopupView::WebUIOmniboxPopupView( content::BrowserContext* browser_context)
diff --git a/chrome/browser/ui/views/omnibox/webui_omnibox_popup_view.h b/chrome/browser/ui/views/omnibox/webui_omnibox_popup_view.h index e59d6770..b1ecb809 100644 --- a/chrome/browser/ui/views/omnibox/webui_omnibox_popup_view.h +++ b/chrome/browser/ui/views/omnibox/webui_omnibox_popup_view.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_WEBUI_OMNIBOX_POPUP_VIEW_H_ #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_header_macros.h" class OmniboxPopupHandler;
diff --git a/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc b/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc index 9c86114..3afa0d3 100644 --- a/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc +++ b/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc
@@ -7,9 +7,9 @@ #include "chrome/browser/ui/views/overlay/constants.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" namespace {
diff --git a/chrome/browser/ui/views/overlay/back_to_tab_image_button.h b/chrome/browser/ui/views/overlay/back_to_tab_image_button.h index 9d7bffc..1aed665 100644 --- a/chrome/browser/ui/views/overlay/back_to_tab_image_button.h +++ b/chrome/browser/ui/views/overlay/back_to_tab_image_button.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_OVERLAY_BACK_TO_TAB_IMAGE_BUTTON_H_ #include "chrome/browser/ui/views/overlay/overlay_window_views.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views {
diff --git a/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc b/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc index 9268a0c..59f3c76 100644 --- a/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc +++ b/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc
@@ -8,11 +8,11 @@ #include "chrome/grit/generated_resources.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/background.h" #include "ui/views/border.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" namespace {
diff --git a/chrome/browser/ui/views/overlay/back_to_tab_label_button.h b/chrome/browser/ui/views/overlay/back_to_tab_label_button.h index d1e9da9..5cf9fdd1 100644 --- a/chrome/browser/ui/views/overlay/back_to_tab_label_button.h +++ b/chrome/browser/ui/views/overlay/back_to_tab_label_button.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_OVERLAY_BACK_TO_TAB_LABEL_BUTTON_H_ #include "base/optional.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_header_macros.h" // A button representing a back-to-tab button. class BackToTabLabelButton : public views::LabelButton {
diff --git a/chrome/browser/ui/views/overlay/close_image_button.cc b/chrome/browser/ui/views/overlay/close_image_button.cc index 28c00fd..b40d96b 100644 --- a/chrome/browser/ui/views/overlay/close_image_button.cc +++ b/chrome/browser/ui/views/overlay/close_image_button.cc
@@ -8,9 +8,9 @@ #include "chrome/browser/ui/views/overlay/constants.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" namespace {
diff --git a/chrome/browser/ui/views/overlay/close_image_button.h b/chrome/browser/ui/views/overlay/close_image_button.h index c1312267..4e50571 100644 --- a/chrome/browser/ui/views/overlay/close_image_button.h +++ b/chrome/browser/ui/views/overlay/close_image_button.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_OVERLAY_CLOSE_IMAGE_BUTTON_H_ #include "chrome/browser/ui/views/overlay/overlay_window_views.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views {
diff --git a/chrome/browser/ui/views/overlay/playback_image_button.cc b/chrome/browser/ui/views/overlay/playback_image_button.cc index b146450..ab1717bd 100644 --- a/chrome/browser/ui/views/overlay/playback_image_button.cc +++ b/chrome/browser/ui/views/overlay/playback_image_button.cc
@@ -9,8 +9,8 @@ #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" namespace views {
diff --git a/chrome/browser/ui/views/overlay/playback_image_button.h b/chrome/browser/ui/views/overlay/playback_image_button.h index 7a6a648c..6bf1de4f1 100644 --- a/chrome/browser/ui/views/overlay/playback_image_button.h +++ b/chrome/browser/ui/views/overlay/playback_image_button.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_OVERLAY_PLAYBACK_IMAGE_BUTTON_H_ #include "chrome/browser/ui/views/overlay/overlay_window_views.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views {
diff --git a/chrome/browser/ui/views/overlay/resize_handle_button.cc b/chrome/browser/ui/views/overlay/resize_handle_button.cc index a3236fd..375efc8f 100644 --- a/chrome/browser/ui/views/overlay/resize_handle_button.cc +++ b/chrome/browser/ui/views/overlay/resize_handle_button.cc
@@ -9,11 +9,11 @@ #include "chrome/grit/generated_resources.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/skbitmap_operations.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" namespace {
diff --git a/chrome/browser/ui/views/overlay/resize_handle_button.h b/chrome/browser/ui/views/overlay/resize_handle_button.h index 42efeca..1e58cea 100644 --- a/chrome/browser/ui/views/overlay/resize_handle_button.h +++ b/chrome/browser/ui/views/overlay/resize_handle_button.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_OVERLAY_RESIZE_HANDLE_BUTTON_H_ #include "chrome/browser/ui/views/overlay/overlay_window_views.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views {
diff --git a/chrome/browser/ui/views/overlay/skip_ad_label_button.cc b/chrome/browser/ui/views/overlay/skip_ad_label_button.cc index e803c1d..8153a0b 100644 --- a/chrome/browser/ui/views/overlay/skip_ad_label_button.cc +++ b/chrome/browser/ui/views/overlay/skip_ad_label_button.cc
@@ -7,10 +7,10 @@ #include "chrome/browser/ui/views/overlay/constants.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/views/background.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/overlay/skip_ad_label_button.h b/chrome/browser/ui/views/overlay/skip_ad_label_button.h index a280f79..b71db1f2 100644 --- a/chrome/browser/ui/views/overlay/skip_ad_label_button.h +++ b/chrome/browser/ui/views/overlay/skip_ad_label_button.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_OVERLAY_SKIP_AD_LABEL_BUTTON_H_ #include "chrome/browser/ui/views/overlay/overlay_window_views.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views {
diff --git a/chrome/browser/ui/views/overlay/track_image_button.cc b/chrome/browser/ui/views/overlay/track_image_button.cc index 8b9911c..4fceb3f5 100644 --- a/chrome/browser/ui/views/overlay/track_image_button.cc +++ b/chrome/browser/ui/views/overlay/track_image_button.cc
@@ -9,8 +9,8 @@ #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" namespace {
diff --git a/chrome/browser/ui/views/overlay/track_image_button.h b/chrome/browser/ui/views/overlay/track_image_button.h index f68070c5..9fc3ad1 100644 --- a/chrome/browser/ui/views/overlay/track_image_button.h +++ b/chrome/browser/ui/views/overlay/track_image_button.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_OVERLAY_TRACK_IMAGE_BUTTON_H_ #include "chrome/browser/ui/views/overlay/overlay_window_views.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace gfx { struct VectorIcon;
diff --git a/chrome/browser/ui/views/page_action/page_action_icon_container.cc b/chrome/browser/ui/views/page_action/page_action_icon_container.cc index ce96a0a..a484f63 100644 --- a/chrome/browser/ui/views/page_action/page_action_icon_container.cc +++ b/chrome/browser/ui/views/page_action/page_action_icon_container.cc
@@ -6,8 +6,8 @@ #include "chrome/browser/ui/views/page_action/page_action_icon_controller.h" #include "chrome/browser/ui/views/page_action/page_action_icon_params.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" PageActionIconContainerView::PageActionIconContainerView( const PageActionIconParams& params)
diff --git a/chrome/browser/ui/views/page_action/page_action_icon_container.h b/chrome/browser/ui/views/page_action/page_action_icon_container.h index 6d26090..fb659ab 100644 --- a/chrome/browser/ui/views/page_action/page_action_icon_container.h +++ b/chrome/browser/ui/views/page_action/page_action_icon_container.h
@@ -7,8 +7,8 @@ #include <memory> +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/layout/box_layout_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" class PageActionIconController;
diff --git a/chrome/browser/ui/views/page_action/page_action_icon_controller.cc b/chrome/browser/ui/views/page_action/page_action_icon_controller.cc index 8923430..ae9cba0 100644 --- a/chrome/browser/ui/views/page_action/page_action_icon_controller.cc +++ b/chrome/browser/ui/views/page_action/page_action_icon_controller.cc
@@ -32,6 +32,7 @@ #include "chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.h" #include "chrome/browser/ui/views/sharing/sharing_dialog_view.h" #include "chrome/browser/ui/views/sharing/sharing_icon_view.h" +#include "chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_icon_container_view.h" #include "chrome/browser/ui/views/translate/translate_icon_view.h" #include "chrome/browser/ui/views/webauthn/webauthn_icon_view.h" @@ -181,6 +182,12 @@ }), base::BindRepeating(SharingDialogView::GetAsBubble))); break; + case PageActionIconType::kSharingHub: + add_page_action_icon( + type, std::make_unique<sharing_hub::SharingHubIconView>( + params.command_updater, params.icon_label_bubble_delegate, + params.page_action_icon_delegate)); + break; case PageActionIconType::kSmsRemoteFetcher: add_page_action_icon( type,
diff --git a/chrome/browser/ui/views/page_action/page_action_icon_loading_indicator_view.cc b/chrome/browser/ui/views/page_action/page_action_icon_loading_indicator_view.cc index 580da74..5e76f52 100644 --- a/chrome/browser/ui/views/page_action/page_action_icon_loading_indicator_view.cc +++ b/chrome/browser/ui/views/page_action/page_action_icon_loading_indicator_view.cc
@@ -8,11 +8,11 @@ #include "base/time/default_tick_clock.h" #include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_throbber.h" -#include "ui/views/metadata/metadata_impl_macros.h" PageActionIconLoadingIndicatorView::PageActionIconLoadingIndicatorView( PageActionIconView* parent)
diff --git a/chrome/browser/ui/views/page_action/page_action_icon_loading_indicator_view.h b/chrome/browser/ui/views/page_action/page_action_icon_loading_indicator_view.h index 670ca05..0aac425a 100644 --- a/chrome/browser/ui/views/page_action/page_action_icon_loading_indicator_view.h +++ b/chrome/browser/ui/views/page_action/page_action_icon_loading_indicator_view.h
@@ -6,9 +6,9 @@ #define CHROME_BROWSER_UI_VIEWS_PAGE_ACTION_PAGE_ACTION_ICON_LOADING_INDICATOR_VIEW_H_ #include "base/time/time.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/animation/throb_animation.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/view_observer.h"
diff --git a/chrome/browser/ui/views/page_action/page_action_icon_view.cc b/chrome/browser/ui/views/page_action/page_action_icon_view.cc index 9b92da03..1234ebfa1 100644 --- a/chrome/browser/ui/views/page_action/page_action_icon_view.cc +++ b/chrome/browser/ui/views/page_action/page_action_icon_view.cc
@@ -13,6 +13,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/paint_vector_icon.h" @@ -24,7 +25,6 @@ #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/button_controller.h" #include "ui/views/controls/focus_ring.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" float PageActionIconView::Delegate::GetPageActionInkDropVisibleOpacity() const { @@ -263,6 +263,6 @@ } BEGIN_METADATA(PageActionIconView, IconLabelBubbleView) -ADD_PROPERTY_METADATA(SkColor, IconColor, views::metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, IconColor, ui::metadata::SkColorConverter) ADD_PROPERTY_METADATA(bool, Active) END_METADATA
diff --git a/chrome/browser/ui/views/page_action/page_action_icon_view.h b/chrome/browser/ui/views/page_action/page_action_icon_view.h index eb70ba8..fa0b73c 100644 --- a/chrome/browser/ui/views/page_action/page_action_icon_view.h +++ b/chrome/browser/ui/views/page_action/page_action_icon_view.h
@@ -11,11 +11,11 @@ #include "chrome/browser/ui/omnibox/omnibox_theme.h" #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image_skia.h" #include "ui/views/animation/ink_drop_host_view.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class CommandUpdater; class OmniboxView;
diff --git a/chrome/browser/ui/views/page_action/pwa_install_view.cc b/chrome/browser/ui/views/page_action/pwa_install_view.cc index de5c478..781b4dd 100644 --- a/chrome/browser/ui/views/page_action/pwa_install_view.cc +++ b/chrome/browser/ui/views/page_action/pwa_install_view.cc
@@ -32,7 +32,7 @@ #include "components/webapps/browser/banners/app_banner_manager.h" #include "components/webapps/browser/installable/installable_metrics.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/page_action/pwa_install_view.h b/chrome/browser/ui/views/page_action/pwa_install_view.h index b8d66d4..831939e3 100644 --- a/chrome/browser/ui/views/page_action/pwa_install_view.h +++ b/chrome/browser/ui/views/page_action/pwa_install_view.h
@@ -7,7 +7,7 @@ #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class Browser;
diff --git a/chrome/browser/ui/views/page_action/zoom_view.cc b/chrome/browser/ui/views/page_action/zoom_view.cc index 5a2cab4..fba0a8c 100644 --- a/chrome/browser/ui/views/page_action/zoom_view.cc +++ b/chrome/browser/ui/views/page_action/zoom_view.cc
@@ -13,9 +13,9 @@ #include "components/zoom/zoom_controller.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/gfx/geometry/size.h" -#include "ui/views/metadata/metadata_impl_macros.h" ZoomView::ZoomView(IconLabelBubbleView::Delegate* icon_label_bubble_delegate, PageActionIconView::Delegate* page_action_icon_delegate)
diff --git a/chrome/browser/ui/views/page_action/zoom_view.h b/chrome/browser/ui/views/page_action/zoom_view.h index 9f20e8d0..1a6a5ad2 100644 --- a/chrome/browser/ui/views/page_action/zoom_view.h +++ b/chrome/browser/ui/views/page_action/zoom_view.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_PAGE_ACTION_ZOOM_VIEW_H_ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" // View for the zoom icon in the Omnibox. class ZoomView : public PageActionIconView {
diff --git a/chrome/browser/ui/views/page_info/OWNERS b/chrome/browser/ui/views/page_info/OWNERS index 9566653..98400ac 100644 --- a/chrome/browser/ui/views/page_info/OWNERS +++ b/chrome/browser/ui/views/page_info/OWNERS
@@ -1,2 +1,6 @@ file://chrome/browser/ui/page_info/OWNERS per-file safety_tip*=jdeblasio@chromium.org + +per-file page_info_main_view.*=olesiamarukhno@google.com +per-file page_info_new_bubble_view.*=olesiamarukhno@google.com +per-file page_switcher_view.*=olesiamarukhno@google.com
diff --git a/chrome/browser/ui/views/page_info/chosen_object_view.cc b/chrome/browser/ui/views/page_info/chosen_object_view.cc index 1f067c40..e639e168 100644 --- a/chrome/browser/ui/views/page_info/chosen_object_view.cc +++ b/chrome/browser/ui/views/page_info/chosen_object_view.cc
@@ -15,6 +15,7 @@ #include "components/page_info/page_info_delegate.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_utils.h" #include "ui/resources/grit/ui_resources.h" @@ -23,7 +24,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" ChosenObjectView::ChosenObjectView( std::unique_ptr<PageInfoUI::ChosenObjectInfo> info,
diff --git a/chrome/browser/ui/views/page_info/chosen_object_view.h b/chrome/browser/ui/views/page_info/chosen_object_view.h index efcb25b..1d802418 100644 --- a/chrome/browser/ui/views/page_info/chosen_object_view.h +++ b/chrome/browser/ui/views/page_info/chosen_object_view.h
@@ -8,7 +8,7 @@ #include <string> #include "components/page_info/page_info_ui.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc index 8cda4fc..bd432423 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
@@ -58,6 +58,8 @@ #include "device/vr/buildflags/buildflags.h" #include "extensions/common/constants.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/simple_menu_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/window_open_disposition.h" @@ -81,8 +83,6 @@ #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_manager.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view_base.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view_base.cc index d442530d..797a73a 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view_base.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view_base.cc
@@ -11,7 +11,7 @@ #include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" #include "ui/base/buildflags.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view_base.h b/chrome/browser/ui/views/page_info/page_info_bubble_view_base.h index ce04c44a..541a537 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view_base.h +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view_base.h
@@ -7,9 +7,9 @@ #include "components/page_info/page_info_ui.h" #include "content/public/browser/web_contents_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace content { class WebContents;
diff --git a/chrome/browser/ui/views/page_info/page_info_hover_button.cc b/chrome/browser/ui/views/page_info/page_info_hover_button.cc index e2b536a4d..09e47745 100644 --- a/chrome/browser/ui/views/page_info/page_info_hover_button.cc +++ b/chrome/browser/ui/views/page_info/page_info_hover_button.cc
@@ -12,6 +12,7 @@ #include "chrome/browser/ui/views/chrome_typography.h" #include "components/page_info/features.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/compositor/layer.h" #include "ui/views/animation/ink_drop.h" @@ -20,7 +21,6 @@ #include "ui/views/controls/styled_label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" namespace {
diff --git a/chrome/browser/ui/views/page_info/security_information_view.cc b/chrome/browser/ui/views/page_info/security_information_view.cc index 82526c0..c208ff4 100644 --- a/chrome/browser/ui/views/page_info/security_information_view.cc +++ b/chrome/browser/ui/views/page_info/security_information_view.cc
@@ -12,11 +12,11 @@ #include "components/strings/grit/components_chromium_strings.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" SecurityInformationView::SecurityInformationView(int side_margin) { ChromeLayoutProvider* layout_provider = ChromeLayoutProvider::Get();
diff --git a/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc b/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc index ae29d81d..04f7338 100644 --- a/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc +++ b/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc
@@ -23,6 +23,7 @@ #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/geometry/insets.h" #include "ui/strings/grit/ui_strings.h" @@ -33,7 +34,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/passwords/account_chooser_dialog_view.h b/chrome/browser/ui/views/passwords/account_chooser_dialog_view.h index d438121..31bd322 100644 --- a/chrome/browser/ui/views/passwords/account_chooser_dialog_view.h +++ b/chrome/browser/ui/views/passwords/account_chooser_dialog_view.h
@@ -7,8 +7,8 @@ #include "base/macros.h" #include "chrome/browser/ui/passwords/password_dialog_prompts.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace content { class WebContents;
diff --git a/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc b/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc index 3c6c3d74..f446c22 100644 --- a/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc +++ b/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.cc
@@ -13,10 +13,10 @@ #include "components/constrained_window/constrained_window_views.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" AutoSigninFirstRunDialogView::AutoSigninFirstRunDialogView(
diff --git a/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.h b/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.h index 8ae1aa8..19a7915 100644 --- a/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.h +++ b/chrome/browser/ui/views/passwords/auto_signin_first_run_dialog_view.h
@@ -7,7 +7,7 @@ #include "base/macros.h" #include "chrome/browser/ui/passwords/password_dialog_prompts.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class AutoSigninFirstRunDialogView : public views::DialogDelegateView,
diff --git a/chrome/browser/ui/views/passwords/credential_leak_dialog_view.cc b/chrome/browser/ui/views/passwords/credential_leak_dialog_view.cc index 65c3f028..1091e17 100644 --- a/chrome/browser/ui/views/passwords/credential_leak_dialog_view.cc +++ b/chrome/browser/ui/views/passwords/credential_leak_dialog_view.cc
@@ -12,6 +12,7 @@ #include "components/constrained_window/constrained_window_views.h" #include "components/password_manager/core/browser/leak_detection_dialog_utils.h" #include "content/public/browser/web_contents.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/border.h" @@ -19,7 +20,6 @@ #include "ui/views/bubble/tooltip_icon.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/passwords/credential_leak_dialog_view.h b/chrome/browser/ui/views/passwords/credential_leak_dialog_view.h index 7903612..8b991cc 100644 --- a/chrome/browser/ui/views/passwords/credential_leak_dialog_view.h +++ b/chrome/browser/ui/views/passwords/credential_leak_dialog_view.h
@@ -7,7 +7,7 @@ #include "base/macros.h" #include "chrome/browser/ui/passwords/password_dialog_prompts.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace content {
diff --git a/chrome/browser/ui/views/passwords/credentials_item_view.cc b/chrome/browser/ui/views/passwords/credentials_item_view.cc index 4de9f2b..ce70f7b2 100644 --- a/chrome/browser/ui/views/passwords/credentials_item_view.cc +++ b/chrome/browser/ui/views/passwords/credentials_item_view.cc
@@ -17,6 +17,8 @@ #include "chrome/grit/theme_resources.h" #include "components/vector_icons/vector_icons.h" #include "third_party/skia/include/core/SkPath.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/insets.h" @@ -27,8 +29,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace {
diff --git a/chrome/browser/ui/views/passwords/credentials_item_view.h b/chrome/browser/ui/views/passwords/credentials_item_view.h index 7688e3e3..d6dd809 100644 --- a/chrome/browser/ui/views/passwords/credentials_item_view.h +++ b/chrome/browser/ui/views/passwords/credentials_item_view.h
@@ -11,8 +11,8 @@ #include "build/buildflag.h" #include "chrome/browser/ui/passwords/account_avatar_fetcher.h" #include "components/password_manager/core/browser/password_form.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/style/typography.h" namespace gfx {
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc index 11ddbc39..4a2a61f 100644 --- a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc +++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc
@@ -12,8 +12,8 @@ #include "components/password_manager/core/common/password_manager_ui.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/views/metadata/metadata_impl_macros.h" ManagePasswordsIconViews::ManagePasswordsIconViews( CommandUpdater* updater,
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.h b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.h index 48c76ab..75132230 100644 --- a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.h +++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.h
@@ -8,8 +8,8 @@ #include "chrome/browser/ui/passwords/manage_passwords_icon_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class CommandUpdater;
diff --git a/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc b/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc index dedff01..0a0e47e 100644 --- a/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc +++ b/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc
@@ -17,6 +17,8 @@ #include "chrome/grit/theme_resources.h" #include "components/password_manager/core/common/password_manager_features.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/favicon_size.h" @@ -30,8 +32,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view_class_properties.h"
diff --git a/chrome/browser/ui/views/passwords/password_generation_popup_view_views.cc b/chrome/browser/ui/views/passwords/password_generation_popup_view_views.cc index 09bf3e9..2ed0a04 100644 --- a/chrome/browser/ui/views/passwords/password_generation_popup_view_views.cc +++ b/chrome/browser/ui/views/passwords/password_generation_popup_view_views.cc
@@ -14,6 +14,8 @@ #include "chrome/browser/ui/views/chrome_typography.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" @@ -24,8 +26,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace {
diff --git a/chrome/browser/ui/views/passwords/password_sign_in_promo_view.cc b/chrome/browser/ui/views/passwords/password_sign_in_promo_view.cc index ea5bdd65..652c25631 100644 --- a/chrome/browser/ui/views/passwords/password_sign_in_promo_view.cc +++ b/chrome/browser/ui/views/passwords/password_sign_in_promo_view.cc
@@ -18,9 +18,9 @@ #include "components/signin/public/base/signin_metrics.h" #include "components/signin/public/identity_manager/account_info.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" PasswordSignInPromoView::DiceSyncPromoDelegate::DiceSyncPromoDelegate( SignInPromoBubbleController* controller)
diff --git a/chrome/browser/ui/views/passwords/password_sign_in_promo_view.h b/chrome/browser/ui/views/passwords/password_sign_in_promo_view.h index 7f2ed07..749cff6 100644 --- a/chrome/browser/ui/views/passwords/password_sign_in_promo_view.h +++ b/chrome/browser/ui/views/passwords/password_sign_in_promo_view.h
@@ -7,8 +7,8 @@ #include "chrome/browser/ui/passwords/bubble_controllers/sign_in_promo_bubble_controller.h" #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace content {
diff --git a/chrome/browser/ui/views/payments/payment_credential_enrollment_dialog_view.cc b/chrome/browser/ui/views/payments/payment_credential_enrollment_dialog_view.cc index 6a7f48fa..380798a5 100644 --- a/chrome/browser/ui/views/payments/payment_credential_enrollment_dialog_view.cc +++ b/chrome/browser/ui/views/payments/payment_credential_enrollment_dialog_view.cc
@@ -10,6 +10,7 @@ #include "chrome/browser/ui/views/payments/secure_payment_confirmation_views_util.h" #include "components/constrained_window/constrained_window_views.h" #include "components/payments/content/payment_credential_enrollment_model.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/border.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" @@ -17,7 +18,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace payments {
diff --git a/chrome/browser/ui/views/payments/payment_credential_enrollment_dialog_view.h b/chrome/browser/ui/views/payments/payment_credential_enrollment_dialog_view.h index 1ec578a..df432e5d 100644 --- a/chrome/browser/ui/views/payments/payment_credential_enrollment_dialog_view.h +++ b/chrome/browser/ui/views/payments/payment_credential_enrollment_dialog_view.h
@@ -9,7 +9,7 @@ #include "base/memory/weak_ptr.h" #include "components/payments/content/payment_credential_enrollment_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/style/typography.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.cc b/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.cc index 0ad7747..20baf08e 100644 --- a/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.cc +++ b/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.cc
@@ -34,6 +34,8 @@ #include "content/public/browser/web_contents.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/image/image_skia.h" @@ -47,8 +49,6 @@ #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace payments { namespace {
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc index b1534e61..9076f37 100644 --- a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc +++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
@@ -37,12 +37,12 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/content_features.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/background.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace payments {
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.h b/chrome/browser/ui/views/payments/payment_request_dialog_view.h index 02bba36e..195941b 100644 --- a/chrome/browser/ui/views/payments/payment_request_dialog_view.h +++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.h
@@ -16,8 +16,8 @@ #include "components/payments/content/payment_request_dialog.h" #include "components/payments/content/payment_request_spec.h" #include "components/payments/content/payment_request_state.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/throbber.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace autofill {
diff --git a/chrome/browser/ui/views/payments/payment_request_row_view.cc b/chrome/browser/ui/views/payments/payment_request_row_view.cc index cd8c043..c9492de 100644 --- a/chrome/browser/ui/views/payments/payment_request_row_view.cc +++ b/chrome/browser/ui/views/payments/payment_request_row_view.cc
@@ -6,10 +6,10 @@ #include "chrome/browser/ui/views/payments/payment_request_views_util.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/native_theme/native_theme.h" #include "ui/views/background.h" #include "ui/views/border.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace payments {
diff --git a/chrome/browser/ui/views/payments/payment_request_row_view.h b/chrome/browser/ui/views/payments/payment_request_row_view.h index 21599b89..d60ea82d 100644 --- a/chrome/browser/ui/views/payments/payment_request_row_view.h +++ b/chrome/browser/ui/views/payments/payment_request_row_view.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ROW_VIEW_H_ #include "base/memory/weak_ptr.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace payments {
diff --git a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc index e71f742a..aef1d55 100644 --- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc +++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
@@ -12,6 +12,8 @@ #include "components/payments/content/payment_request.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/insets.h" @@ -23,8 +25,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" namespace payments {
diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc index 3a14129..41553b44e 100644 --- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc +++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
@@ -39,6 +39,8 @@ #include "components/vector_icons/vector_icons.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" @@ -57,8 +59,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" namespace payments {
diff --git a/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.cc b/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.cc index a6202592..a67a9d4d 100644 --- a/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.cc +++ b/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.cc
@@ -12,13 +12,13 @@ #include "components/constrained_window/constrained_window_views.h" #include "components/payments/content/payment_ui_observer.h" #include "components/payments/content/secure_payment_confirmation_model.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/controls/progress_bar.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace payments { namespace {
diff --git a/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.h b/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.h index 43727a6..a2b8e9a 100644 --- a/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.h +++ b/chrome/browser/ui/views/payments/secure_payment_confirmation_dialog_view.h
@@ -7,8 +7,8 @@ #include "base/memory/weak_ptr.h" #include "components/payments/content/secure_payment_confirmation_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace payments {
diff --git a/chrome/browser/ui/views/payments/validating_textfield.cc b/chrome/browser/ui/views/payments/validating_textfield.cc index 07b8ee56..64e614e 100644 --- a/chrome/browser/ui/views/payments/validating_textfield.cc +++ b/chrome/browser/ui/views/payments/validating_textfield.cc
@@ -3,7 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ui/views/payments/validating_textfield.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include <utility>
diff --git a/chrome/browser/ui/views/payments/validating_textfield.h b/chrome/browser/ui/views/payments/validating_textfield.h index f13e90c..6f67607d 100644 --- a/chrome/browser/ui/views/payments/validating_textfield.h +++ b/chrome/browser/ui/views/payments/validating_textfield.h
@@ -9,8 +9,8 @@ #include "base/macros.h" #include "chrome/browser/ui/views/payments/validation_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/textfield/textfield.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace payments {
diff --git a/chrome/browser/ui/views/payments/view_stack.cc b/chrome/browser/ui/views/payments/view_stack.cc index d52aff68..9d02a8b 100644 --- a/chrome/browser/ui/views/payments/view_stack.cc +++ b/chrome/browser/ui/views/payments/view_stack.cc
@@ -7,9 +7,9 @@ #include <memory> #include <utility> +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" ViewStack::ViewStack() : slide_in_animator_(std::make_unique<views::BoundsAnimator>(this)),
diff --git a/chrome/browser/ui/views/payments/view_stack.h b/chrome/browser/ui/views/payments/view_stack.h index a5d4361..1498e87 100644 --- a/chrome/browser/ui/views/payments/view_stack.h +++ b/chrome/browser/ui/views/payments/view_stack.h
@@ -7,9 +7,9 @@ #include <vector> +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/animation/bounds_animator.h" #include "ui/views/animation/bounds_animator_observer.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace payments {
diff --git a/chrome/browser/ui/views/permission_bubble/chooser_bubble_ui.cc b/chrome/browser/ui/views/permission_bubble/chooser_bubble_ui.cc index 2153a2b..aa486ea 100644 --- a/chrome/browser/ui/views/permission_bubble/chooser_bubble_ui.cc +++ b/chrome/browser/ui/views/permission_bubble/chooser_bubble_ui.cc
@@ -14,13 +14,13 @@ #include "chrome/browser/ui/views/device_chooser_content_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h" #include "chrome/browser/ui/views/title_origin_label.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/styled_label.h" #include "ui/views/controls/table/table_view_observer.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" using bubble_anchor_util::AnchorConfiguration;
diff --git a/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc b/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc index 02defde..882edbb 100644 --- a/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc +++ b/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc
@@ -29,6 +29,7 @@ #include "components/vector_icons/vector_icons.h" #include "extensions/common/constants.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/text_constants.h" @@ -42,7 +43,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.h b/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.h index 07398e61..30a6b1e 100644 --- a/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.h +++ b/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.h
@@ -10,8 +10,8 @@ #include "base/macros.h" #include "chrome/browser/ui/views/permission_bubble/permission_prompt_style.h" #include "components/permissions/permission_prompt.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace permissions { enum class RequestType;
diff --git a/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.cc b/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.cc index c07172e..e4ac632 100644 --- a/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.cc +++ b/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.cc
@@ -27,6 +27,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/aura/window.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/text/bytes_formatting.h" #include "ui/chromeos/devicetype_utils.h" @@ -38,7 +39,6 @@ #include "ui/views/controls/link.h" #include "ui/views/controls/progress_bar.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" // This file contains VLOG logging to aid debugging tast tests.
diff --git a/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.h b/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.h index 1084973..97d2536 100644 --- a/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.h +++ b/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.h
@@ -8,8 +8,8 @@ #include "base/callback.h" #include "base/macros.h" #include "chrome/browser/ash/plugin_vm/plugin_vm_installer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class BoxLayout;
diff --git a/chrome/browser/ui/views/policy/enterprise_startup_dialog_view.cc b/chrome/browser/ui/views/policy/enterprise_startup_dialog_view.cc index 1374499..e27a6986 100644 --- a/chrome/browser/ui/views/policy/enterprise_startup_dialog_view.cc +++ b/chrome/browser/ui/views/policy/enterprise_startup_dialog_view.cc
@@ -19,6 +19,7 @@ #include "chrome/grit/theme_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" @@ -30,7 +31,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/throbber.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #if defined(OS_MAC) #include "base/task/current_thread.h"
diff --git a/chrome/browser/ui/views/policy/enterprise_startup_dialog_view.h b/chrome/browser/ui/views/policy/enterprise_startup_dialog_view.h index 23dfd16..4736413f 100644 --- a/chrome/browser/ui/views/policy/enterprise_startup_dialog_view.h +++ b/chrome/browser/ui/views/policy/enterprise_startup_dialog_view.h
@@ -12,8 +12,8 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/enterprise_startup_dialog.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_observer.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc b/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc index b0ecae10..0fe7f9b6 100644 --- a/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc +++ b/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc
@@ -31,6 +31,7 @@ #include "components/feature_engagement/public/feature_constants.h" #include "components/feature_engagement/public/tracker.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/menu_model.h" #include "ui/base/theme_provider.h" #include "ui/gfx/color_palette.h" @@ -39,7 +40,6 @@ #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/controls/button/button_controller.h" #include "ui/views/controls/button/label_button_border.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/profiles/avatar_toolbar_button.h b/chrome/browser/ui/views/profiles/avatar_toolbar_button.h index 2b25a26..be7f038 100644 --- a/chrome/browser/ui/views/profiles/avatar_toolbar_button.h +++ b/chrome/browser/ui/views/profiles/avatar_toolbar_button.h
@@ -10,8 +10,8 @@ #include "base/scoped_observation.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" #include "chrome/browser/ui/views/toolbar/toolbar_icon_container_view.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/events/event.h" -#include "ui/views/metadata/metadata_header_macros.h" class AvatarToolbarButtonDelegate; class Browser;
diff --git a/chrome/browser/ui/views/profiles/badged_profile_photo.cc b/chrome/browser/ui/views/profiles/badged_profile_photo.cc index e5cdfa6..27f0fa91 100644 --- a/chrome/browser/ui/views/profiles/badged_profile_photo.cc +++ b/chrome/browser/ui/views/profiles/badged_profile_photo.cc
@@ -6,14 +6,14 @@ #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/profiles/profile_avatar_icon_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/native_theme/native_theme.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/profiles/badged_profile_photo.h b/chrome/browser/ui/views/profiles/badged_profile_photo.h index 14469e8..cda35d4f 100644 --- a/chrome/browser/ui/views/profiles/badged_profile_photo.h +++ b/chrome/browser/ui/views/profiles/badged_profile_photo.h
@@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_BADGED_PROFILE_PHOTO_H_ #define CHROME_BROWSER_UI_VIEWS_PROFILES_BADGED_PROFILE_PHOTO_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/image/image.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" // Creates a bagded profile photo for the current profile card in the
diff --git a/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.cc b/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.cc index 6201ca9..235991f 100644 --- a/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.cc +++ b/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.cc
@@ -26,10 +26,10 @@ #include "components/signin/public/identity_manager/identity_manager.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace {
diff --git a/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.h b/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.h index e24ecc7..d02969e 100644 --- a/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.h +++ b/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.h
@@ -12,7 +12,7 @@ #include "base/gtest_prod_util.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/signin/dice_web_signin_interceptor.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace views { class View;
diff --git a/chrome/browser/ui/views/profiles/profile_customization_bubble_view.cc b/chrome/browser/ui/views/profiles/profile_customization_bubble_view.cc index c3577d2..93a4dcc 100644 --- a/chrome/browser/ui/views/profiles/profile_customization_bubble_view.cc +++ b/chrome/browser/ui/views/profiles/profile_customization_bubble_view.cc
@@ -15,10 +15,10 @@ #include "chrome/common/webui_url_constants.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/profiles/profile_customization_bubble_view.h b/chrome/browser/ui/views/profiles/profile_customization_bubble_view.h index 23652b3..b1a85047 100644 --- a/chrome/browser/ui/views/profiles/profile_customization_bubble_view.h +++ b/chrome/browser/ui/views/profiles/profile_customization_bubble_view.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CUSTOMIZATION_BUBBLE_VIEW_H_ #include "base/gtest_prod_util.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class View;
diff --git a/chrome/browser/ui/views/profiles/profile_indicator_icon.cc b/chrome/browser/ui/views/profiles/profile_indicator_icon.cc index f8d04cfb..7e77812 100644 --- a/chrome/browser/ui/views/profiles/profile_indicator_icon.cc +++ b/chrome/browser/ui/views/profiles/profile_indicator_icon.cc
@@ -5,8 +5,8 @@ #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" #include "chrome/browser/profiles/profile_avatar_icon_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" -#include "ui/views/metadata/metadata_impl_macros.h" ProfileIndicatorIcon::ProfileIndicatorIcon() { // In RTL mode, the incognito icon should be looking the opposite direction.
diff --git a/chrome/browser/ui/views/profiles/profile_indicator_icon.h b/chrome/browser/ui/views/profiles/profile_indicator_icon.h index 7a6fdbdf..5c6fa4b 100644 --- a/chrome/browser/ui/views/profiles/profile_indicator_icon.h +++ b/chrome/browser/ui/views/profiles/profile_indicator_icon.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_INDICATOR_ICON_H_ #include "base/compiler_specific.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/image/image.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace gfx {
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view.cc b/chrome/browser/ui/views/profiles/profile_menu_view.cc index febbd68..810913f 100644 --- a/chrome/browser/ui/views/profiles/profile_menu_view.cc +++ b/chrome/browser/ui/views/profiles/profile_menu_view.cc
@@ -59,13 +59,13 @@ #include "components/vector_icons/vector_icons.h" #include "net/base/url_util.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/canvas_image_source.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/native_theme/native_theme.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/accessibility/view_accessibility.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view_base.cc b/chrome/browser/ui/views/profiles/profile_menu_view_base.cc index b4f56811..30b9ebd7 100644 --- a/chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ b/chrome/browser/ui/views/profiles/profile_menu_view_base.cc
@@ -29,6 +29,8 @@ #include "chrome/browser/ui/views/profiles/profile_menu_view.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/display/display.h" #include "ui/display/screen.h" @@ -48,8 +50,6 @@ #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #if !BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view_base.h b/chrome/browser/ui/views/profiles/profile_menu_view_base.h index 99468f8..9cd5dba 100644 --- a/chrome/browser/ui/views/profiles/profile_menu_view_base.h +++ b/chrome/browser/ui/views/profiles/profile_menu_view_base.h
@@ -17,10 +17,10 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/views/close_bubble_on_tab_activation_helper.h" #include "content/public/browser/web_contents_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/style/typography.h" class Browser;
diff --git a/chrome/browser/ui/views/profiles/profile_picker_force_signin_dialog_delegate.cc b/chrome/browser/ui/views/profiles/profile_picker_force_signin_dialog_delegate.cc index a2e5b07..1f23c7c 100644 --- a/chrome/browser/ui/views/profiles/profile_picker_force_signin_dialog_delegate.cc +++ b/chrome/browser/ui/views/profiles/profile_picker_force_signin_dialog_delegate.cc
@@ -12,11 +12,11 @@ #include "chrome/grit/generated_resources.h" #include "components/web_modal/modal_dialog_host.h" #include "components/web_modal/web_contents_modal_dialog_manager.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/size.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" ProfilePickerForceSigninDialogDelegate::ProfilePickerForceSigninDialogDelegate( ProfilePickerForceSigninDialogHost* host,
diff --git a/chrome/browser/ui/views/profiles/profile_picker_force_signin_dialog_delegate.h b/chrome/browser/ui/views/profiles/profile_picker_force_signin_dialog_delegate.h index 3a8af42..92728ab8 100644 --- a/chrome/browser/ui/views/profiles/profile_picker_force_signin_dialog_delegate.h +++ b/chrome/browser/ui/views/profiles/profile_picker_force_signin_dialog_delegate.h
@@ -9,9 +9,9 @@ #include "chrome/browser/ui/profile_picker.h" #include "components/web_modal/web_contents_modal_dialog_host.h" #include "content/public/browser/web_contents_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/native_widget_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class GURL;
diff --git a/chrome/browser/ui/views/profiles/profile_picker_view.cc b/chrome/browser/ui/views/profiles/profile_picker_view.cc index bdf166b..f931015 100644 --- a/chrome/browser/ui/views/profiles/profile_picker_view.cc +++ b/chrome/browser/ui/views/profiles/profile_picker_view.cc
@@ -48,13 +48,13 @@ #include "content/public/browser/web_contents.h" #include "net/base/url_util.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/background.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/profiles/profile_picker_view.h b/chrome/browser/ui/views/profiles/profile_picker_view.h index 0ae98c6..55effed3 100644 --- a/chrome/browser/ui/views/profiles/profile_picker_view.h +++ b/chrome/browser/ui/views/profiles/profile_picker_view.h
@@ -17,9 +17,9 @@ #include "components/signin/public/identity_manager/identity_manager.h" #include "components/web_modal/web_contents_modal_dialog_host.h" #include "content/public/browser/web_contents_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc b/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc index 70a7447..ee43cd2744 100644 --- a/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc +++ b/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc
@@ -30,10 +30,10 @@ #include "content/public/browser/web_contents.h" #include "google_apis/gaia/core_account_id.h" #include "google_apis/gaia/gaia_urls.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_types.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/webview/webview.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h b/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h index df0603a..72b9b7c 100644 --- a/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h +++ b/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h
@@ -10,8 +10,8 @@ #include "chrome/browser/ui/profile_chooser_constants.h" #include "chrome/browser/ui/signin_view_controller_delegate.h" #include "content/public/browser/web_contents_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class GURL;
diff --git a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.cc b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.cc index 8b4e9c51..7b784fa 100644 --- a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.cc +++ b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.cc
@@ -26,6 +26,7 @@ #include "content/public/browser/web_contents.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/base/webui/web_ui_util.h" #include "ui/events/event.h" @@ -44,7 +45,6 @@ #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.h b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.h index f36cec00..b8821334 100644 --- a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.h +++ b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.h
@@ -11,9 +11,9 @@ #include "chrome/browser/ui/qrcode_generator/qrcode_generator_bubble_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h" #include "chrome/services/qrcode_generator/public/cpp/qrcode_generator_service.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "url/gurl.h" namespace content {
diff --git a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_icon_view.cc b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_icon_view.cc index 4f6ec563..24a98dd1 100644 --- a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_icon_view.cc +++ b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_icon_view.cc
@@ -14,7 +14,7 @@ #include "components/omnibox/browser/omnibox_view.h" #include "content/public/browser/browser_context.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" namespace qrcode_generator {
diff --git a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_icon_view.h b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_icon_view.h index f6461d3..19ef193 100644 --- a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_icon_view.h +++ b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_icon_view.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_QRCODE_GENERATOR_QRCODE_GENERATOR_ICON_VIEW_H_ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class CommandUpdater;
diff --git a/chrome/browser/ui/views/read_later/read_later_button.cc b/chrome/browser/ui/views/read_later/read_later_button.cc index 5e19d744..a549385c 100644 --- a/chrome/browser/ui/views/read_later/read_later_button.cc +++ b/chrome/browser/ui/views/read_later/read_later_button.cc
@@ -30,6 +30,7 @@ #include "components/feature_engagement/public/tracker.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" @@ -44,7 +45,6 @@ #include "ui/views/controls/button/button_controller.h" #include "ui/views/controls/dot_indicator.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "url/gurl.h" namespace {
diff --git a/chrome/browser/ui/views/read_later/read_later_button.h b/chrome/browser/ui/views/read_later/read_later_button.h index 66d64b0..17e5fbdb 100644 --- a/chrome/browser/ui/views/read_later/read_later_button.h +++ b/chrome/browser/ui/views/read_later/read_later_button.h
@@ -11,10 +11,10 @@ #include "components/reading_list/core/reading_list_model.h" #include "components/reading_list/core/reading_list_model_observer.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/animation/multi_animation.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_observer.h" #include "ui/views/widget/widget_utils.h"
diff --git a/chrome/browser/ui/views/reader_mode/reader_mode_icon_view.cc b/chrome/browser/ui/views/reader_mode/reader_mode_icon_view.cc index ae5f160..288ae456 100644 --- a/chrome/browser/ui/views/reader_mode/reader_mode_icon_view.cc +++ b/chrome/browser/ui/views/reader_mode/reader_mode_icon_view.cc
@@ -18,7 +18,7 @@ #include "services/metrics/public/cpp/ukm_builders.h" #include "services/metrics/public/cpp/ukm_recorder.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" using dom_distiller::UMAHelper; using dom_distiller::url_utils::IsDistilledPage;
diff --git a/chrome/browser/ui/views/reader_mode/reader_mode_icon_view.h b/chrome/browser/ui/views/reader_mode/reader_mode_icon_view.h index 2a97a96..e3505d7 100644 --- a/chrome/browser/ui/views/reader_mode/reader_mode_icon_view.h +++ b/chrome/browser/ui/views/reader_mode/reader_mode_icon_view.h
@@ -10,8 +10,8 @@ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" #include "components/dom_distiller/content/browser/distillable_page_utils.h" #include "content/public/browser/web_contents_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/vector_icon_types.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace content { class NavigationHandle;
diff --git a/chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller_platform_impl_chromeos.cc b/chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller_platform_impl_chromeos.cc index 3ad4de60..ffc2ec0 100644 --- a/chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller_platform_impl_chromeos.cc +++ b/chrome/browser/ui/views/relaunch_notification/relaunch_notification_controller_platform_impl_chromeos.cc
@@ -11,7 +11,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/views/relaunch_notification/relaunch_required_timer.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" @@ -52,7 +52,7 @@ } void RelaunchNotificationControllerPlatformImpl::CloseRelaunchNotification() { - SystemTrayClient::Get()->SetUpdateNotificationState( + SystemTrayClientImpl::Get()->SetUpdateNotificationState( ash::NotificationStyle::kDefault, std::u16string(), std::u16string()); relaunch_required_timer_.reset(); on_visible_.Reset(); @@ -72,14 +72,14 @@ ->browser_policy_connector_chromeos() ->GetEnterpriseDomainManager(); if (past_deadline) { - SystemTrayClient::Get()->SetUpdateNotificationState( + SystemTrayClientImpl::Get()->SetUpdateNotificationState( ash::NotificationStyle::kAdminRecommended, l10n_util::GetStringUTF16(IDS_RELAUNCH_RECOMMENDED_OVERDUE_TITLE), l10n_util::GetStringFUTF16(IDS_RELAUNCH_RECOMMENDED_OVERDUE_BODY, base::UTF8ToUTF16(enterprise_domain_manager), ui::GetChromeOSDeviceName())); } else { - SystemTrayClient::Get()->SetUpdateNotificationState( + SystemTrayClientImpl::Get()->SetUpdateNotificationState( ash::NotificationStyle::kAdminRecommended, l10n_util::GetStringUTF16(IDS_RELAUNCH_RECOMMENDED_TITLE), l10n_util::GetStringFUTF16(IDS_RELAUNCH_RECOMMENDED_BODY, @@ -95,11 +95,11 @@ void RelaunchNotificationControllerPlatformImpl:: RefreshRelaunchRequiredTitle() { - // SystemTrayClient may not exist in unit tests. - if (SystemTrayClient::Get()) { + // SystemTrayClientImpl may not exist in unit tests. + if (SystemTrayClientImpl::Get()) { policy::BrowserPolicyConnectorChromeOS* connector = g_browser_process->platform_part()->browser_policy_connector_chromeos(); - SystemTrayClient::Get()->SetUpdateNotificationState( + SystemTrayClientImpl::Get()->SetUpdateNotificationState( ash::NotificationStyle::kAdminRequired, relaunch_required_timer_->GetWindowTitle(), l10n_util::GetStringFUTF16(
diff --git a/chrome/browser/ui/views/sad_tab_view.cc b/chrome/browser/ui/views/sad_tab_view.cc index 322eadf..cbb9550 100644 --- a/chrome/browser/ui/views/sad_tab_view.cc +++ b/chrome/browser/ui/views/sad_tab_view.cc
@@ -19,6 +19,7 @@ #include "content/public/browser/web_contents.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" @@ -32,7 +33,6 @@ #include "ui/views/controls/link.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace {
diff --git a/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.cc b/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.cc index aa80d85..b62f963 100644 --- a/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.cc +++ b/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.cc
@@ -10,10 +10,10 @@ #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_types.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/dialog_delegate.h" namespace safe_browsing {
diff --git a/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.h b/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.h index 98d70f7..4f3ba96d 100644 --- a/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.h +++ b/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.h
@@ -7,9 +7,9 @@ #include "base/callback.h" #include "base/callback_forward.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace content {
diff --git a/chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.cc b/chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.cc index f7fd63c..6f55f4d 100644 --- a/chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.cc +++ b/chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.cc
@@ -20,6 +20,7 @@ #include "components/vector_icons/vector_icons.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image.h" @@ -29,7 +30,6 @@ #include "ui/views/controls/styled_label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" using views::BoxLayout;
diff --git a/chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.h b/chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.h index 5f4a8d9..04150f78 100644 --- a/chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.h +++ b/chrome/browser/ui/views/safe_browsing/password_reuse_modal_warning_dialog.h
@@ -9,8 +9,8 @@ #include "chrome/browser/safe_browsing/chrome_password_protection_service.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" #include "content/public/browser/web_contents_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace content {
diff --git a/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.cc b/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.cc index 940c358..61d39a6 100644 --- a/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.cc +++ b/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.cc
@@ -18,13 +18,13 @@ #include "components/strings/grit/components_strings.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/page_transition_types.h" #include "ui/base/ui_base_types.h" #include "ui/base/window_open_disposition.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/dialog_delegate.h" namespace safe_browsing {
diff --git a/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.h b/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.h index fe08c090..5bd336f 100644 --- a/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.h +++ b/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.h
@@ -7,9 +7,9 @@ #include "base/callback.h" #include "base/callback_forward.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" #include "ui/views/controls/styled_label.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace content {
diff --git a/chrome/browser/ui/views/screen_capture_notification_ui_views.cc b/chrome/browser/ui/views/screen_capture_notification_ui_views.cc index f073ab04..ab54153 100644 --- a/chrome/browser/ui/views/screen_capture_notification_ui_views.cc +++ b/chrome/browser/ui/views/screen_capture_notification_ui_views.cc
@@ -15,6 +15,8 @@ #include "chrome/grit/theme_resources.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/display/display.h" #include "ui/display/screen.h" @@ -24,8 +26,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/link.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_device_button.cc b/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_device_button.cc index 7de949d6..0b45413 100644 --- a/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_device_button.cc +++ b/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_device_button.cc
@@ -15,9 +15,9 @@ #include "components/send_tab_to_self/target_device_info.h" #include "components/sync/protocol/sync.pb.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/color_tracking_icon_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace send_tab_to_self {
diff --git a/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_device_button.h b/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_device_button.h index 50012ea..bee5fe62 100644 --- a/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_device_button.h +++ b/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_bubble_device_button.h
@@ -10,7 +10,7 @@ #include "base/bind.h" #include "chrome/browser/ui/views/hover_button.h" #include "components/sync/protocol/sync.pb.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace send_tab_to_self {
diff --git a/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.cc b/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.cc index e67802aa..975f1da 100644 --- a/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.cc +++ b/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.cc
@@ -15,9 +15,9 @@ #include "components/omnibox/browser/omnibox_view.h" #include "components/send_tab_to_self/features.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/strings/grit/ui_strings.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace send_tab_to_self {
diff --git a/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.h b/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.h index 9c7f0e73..eff365e 100644 --- a/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.h +++ b/chrome/browser/ui/views/send_tab_to_self/send_tab_to_self_icon_view.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_SEND_TAB_TO_SELF_SEND_TAB_TO_SELF_ICON_VIEW_H_ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class CommandUpdater;
diff --git a/chrome/browser/ui/views/settings_reset_prompt_dialog.cc b/chrome/browser/ui/views/settings_reset_prompt_dialog.cc index 8e4a902f..c582316 100644 --- a/chrome/browser/ui/views/settings_reset_prompt_dialog.cc +++ b/chrome/browser/ui/views/settings_reset_prompt_dialog.cc
@@ -15,12 +15,12 @@ #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/font.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/controls/label.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/settings_reset_prompt_dialog.h b/chrome/browser/ui/views/settings_reset_prompt_dialog.h index 59454b2..342c2d8f 100644 --- a/chrome/browser/ui/views/settings_reset_prompt_dialog.h +++ b/chrome/browser/ui/views/settings_reset_prompt_dialog.h
@@ -8,9 +8,9 @@ #include <string> #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/geometry/size.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class Browser;
diff --git a/chrome/browser/ui/views/sharing/sharing_icon_view.cc b/chrome/browser/ui/views/sharing/sharing_icon_view.cc index 607366e..1954c8cd 100644 --- a/chrome/browser/ui/views/sharing/sharing_icon_view.cc +++ b/chrome/browser/ui/views/sharing/sharing_icon_view.cc
@@ -7,13 +7,13 @@ #include "chrome/app/vector_icons/vector_icons.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/scoped_canvas.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace { // Progress state when the full length of the animation text is visible.
diff --git a/chrome/browser/ui/views/sharing/sharing_icon_view.h b/chrome/browser/ui/views/sharing/sharing_icon_view.h index 15e086c..c3261ff 100644 --- a/chrome/browser/ui/views/sharing/sharing_icon_view.h +++ b/chrome/browser/ui/views/sharing/sharing_icon_view.h
@@ -8,7 +8,7 @@ #include "chrome/browser/sharing/sharing_ui_controller.h" #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace views { // TODO(ellyjones): Remove this.
diff --git a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.cc b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.cc index f59104d..a010acea 100644 --- a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.cc +++ b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.cc
@@ -8,6 +8,7 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "ui/views/controls/scroll_view.h" +#include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" namespace sharing_hub { @@ -63,13 +64,35 @@ } void SharingHubBubbleViewImpl::Init() { + auto* provider = ChromeLayoutProvider::Get(); + set_margins( + gfx::Insets(provider->GetDistanceMetric( + views::DISTANCE_DIALOG_CONTENT_MARGIN_TOP_CONTROL), + 0, + provider->GetDistanceMetric( + views::DISTANCE_DIALOG_CONTENT_MARGIN_BOTTOM_CONTROL), + 0)); SetLayoutManager(std::make_unique<views::FillLayout>()); - CreateScrollView(); + scroll_view_ = AddChildView(std::make_unique<views::ScrollView>()); + + PopulateScrollView(); } -void SharingHubBubbleViewImpl::CreateScrollView() { - scroll_view_ = AddChildView(std::make_unique<views::ScrollView>()); +void SharingHubBubbleViewImpl::PopulateScrollView() { + auto* action_list_view = + scroll_view_->SetContents(std::make_unique<views::View>()); + action_list_view->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kVertical)); + + MaybeSizeToContents(); + Layout(); +} + +void SharingHubBubbleViewImpl::MaybeSizeToContents() { + // The widget may be null if this is called while the dialog is opening. + if (GetWidget()) + SizeToContents(); } } // namespace sharing_hub
diff --git a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.h b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.h index af6d75e..59798299 100644 --- a/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.h +++ b/chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.h
@@ -53,8 +53,12 @@ // views::BubbleDialogDelegateView: void Init() override; - // Creates the scroll view. - void CreateScrollView(); + // Populates the scroll view containing sharing actions. + void PopulateScrollView(); + + // Resizes and potentially moves the bubble to fit the content's preferred + // size. + void MaybeSizeToContents(); // A raw pointer is safe since our controller will outlive us (the bubble is // lazily created with the controller).
diff --git a/chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.cc b/chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.cc index 44ef046f..782ab51 100644 --- a/chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.cc +++ b/chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.cc
@@ -9,8 +9,10 @@ #include "chrome/browser/ui/browser_command_controller.h" #include "chrome/browser/ui/sharing_hub/sharing_hub_bubble_controller.h" #include "chrome/browser/ui/views/sharing_hub/sharing_hub_bubble_view_impl.h" +#include "chrome/grit/generated_resources.h" #include "components/omnibox/browser/omnibox_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" namespace sharing_hub { @@ -43,12 +45,12 @@ return; } - const OmniboxView* omnibox_view = delegate()->GetOmniboxView(); - if (!omnibox_view) { - return; - } + // |controller| may be nullptr due to lazy initialization. + SharingHubBubbleController* controller = GetController(); + bool enabled = controller && controller->ShouldOfferOmniboxIcon(); - SetVisible(true); + SetCommandEnabled(enabled); + SetVisible(enabled); } void SharingHubIconView::OnExecuting( @@ -63,6 +65,10 @@ return false; } +std::u16string SharingHubIconView::GetTextForTooltipAndAccessibleName() const { + return l10n_util::GetStringUTF16(IDS_SHARING_HUB_TOOLTIP); +} + SharingHubBubbleController* SharingHubIconView::GetController() const { content::WebContents* web_contents = GetWebContents(); if (!web_contents) {
diff --git a/chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.h b/chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.h index fc883911..2d895db 100644 --- a/chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.h +++ b/chrome/browser/ui/views/sharing_hub/sharing_hub_icon_view.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_SHARING_HUB_SHARING_HUB_ICON_VIEW_H_ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class CommandUpdater; @@ -31,6 +31,7 @@ views::BubbleDialogDelegate* GetBubble() const override; void UpdateImpl() override; bool ShouldShowLabel() const override; + std::u16string GetTextForTooltipAndAccessibleName() const override; protected: // PageActionIconView:
diff --git a/chrome/browser/ui/views/side_panel.cc b/chrome/browser/ui/views/side_panel.cc index b8444f0..25a11b2 100644 --- a/chrome/browser/ui/views/side_panel.cc +++ b/chrome/browser/ui/views/side_panel.cc
@@ -6,10 +6,10 @@ #include "base/stl_util.h" #include "chrome/browser/themes/theme_properties.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/gfx/color_utils.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/side_panel.h b/chrome/browser/ui/views/side_panel.h index 2d214aa..cd175bf6 100644 --- a/chrome/browser/ui/views/side_panel.h +++ b/chrome/browser/ui/views/side_panel.h
@@ -7,8 +7,8 @@ #include <memory> +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/view_observer.h"
diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc index 066461a..661202b 100644 --- a/chrome/browser/ui/views/status_bubble_views.cc +++ b/chrome/browser/ui/views/status_bubble_views.cc
@@ -23,6 +23,8 @@ #include "components/url_formatter/url_formatter.h" #include "third_party/skia/include/core/SkPath.h" #include "third_party/skia/include/pathops/SkPathOps.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/display/display.h" #include "ui/display/screen.h" @@ -41,8 +43,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/scrollbar/scroll_bar_views.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/widget/root_view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/status_icons/status_icon_button_linux.cc b/chrome/browser/ui/views/status_icons/status_icon_button_linux.cc index f88bc1e..b857eb2 100644 --- a/chrome/browser/ui/views/status_icons/status_icon_button_linux.cc +++ b/chrome/browser/ui/views/status_icons/status_icon_button_linux.cc
@@ -10,13 +10,13 @@ #include "chrome/browser/shell_integration_linux.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/wm_role_names_linux.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/scoped_canvas.h" #include "ui/gfx/transform.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/status_icons/status_icon_button_linux.h b/chrome/browser/ui/views/status_icons/status_icon_button_linux.h index e996ec7..0c1d4ea 100644 --- a/chrome/browser/ui/views/status_icons/status_icon_button_linux.h +++ b/chrome/browser/ui/views/status_icons/status_icon_button_linux.h
@@ -8,11 +8,11 @@ #include <memory> #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/linux_ui/status_icon_linux.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget.h" namespace aura {
diff --git a/chrome/browser/ui/views/storage/storage_pressure_bubble_view.cc b/chrome/browser/ui/views/storage/storage_pressure_bubble_view.cc index c85f682..3f714c55 100644 --- a/chrome/browser/ui/views/storage/storage_pressure_bubble_view.cc +++ b/chrome/browser/ui/views/storage/storage_pressure_bubble_view.cc
@@ -16,8 +16,8 @@ #include "components/url_formatter/url_formatter.h" #include "content/public/common/content_features.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/storage/storage_pressure_bubble_view.h b/chrome/browser/ui/views/storage/storage_pressure_bubble_view.h index 1276ff55..48a9ae77 100644 --- a/chrome/browser/ui/views/storage/storage_pressure_bubble_view.h +++ b/chrome/browser/ui/views/storage/storage_pressure_bubble_view.h
@@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_STORAGE_STORAGE_PRESSURE_BUBBLE_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_STORAGE_STORAGE_PRESSURE_BUBBLE_VIEW_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "url/origin.h" class Browser;
diff --git a/chrome/browser/ui/views/supervised_user/extension_install_blocked_by_parent_dialog_view.cc b/chrome/browser/ui/views/supervised_user/extension_install_blocked_by_parent_dialog_view.cc index 4cfcfaa..52e3c70b 100644 --- a/chrome/browser/ui/views/supervised_user/extension_install_blocked_by_parent_dialog_view.cc +++ b/chrome/browser/ui/views/supervised_user/extension_install_blocked_by_parent_dialog_view.cc
@@ -23,13 +23,13 @@ #include "extensions/common/extension.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace chrome {
diff --git a/chrome/browser/ui/views/supervised_user/extension_install_blocked_by_parent_dialog_view.h b/chrome/browser/ui/views/supervised_user/extension_install_blocked_by_parent_dialog_view.h index 3f750119..0a20053 100644 --- a/chrome/browser/ui/views/supervised_user/extension_install_blocked_by_parent_dialog_view.h +++ b/chrome/browser/ui/views/supervised_user/extension_install_blocked_by_parent_dialog_view.h
@@ -9,9 +9,9 @@ #include "base/callback_forward.h" #include "chrome/browser/ui/browser_dialogs.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/image/image_skia.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace extensions {
diff --git a/chrome/browser/ui/views/supervised_user/parent_permission_dialog_view.cc b/chrome/browser/ui/views/supervised_user/parent_permission_dialog_view.cc index 6f8a2e3..6254ea5 100644 --- a/chrome/browser/ui/views/supervised_user/parent_permission_dialog_view.cc +++ b/chrome/browser/ui/views/supervised_user/parent_permission_dialog_view.cc
@@ -40,6 +40,8 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/color_palette.h" @@ -56,8 +58,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace { constexpr int kPermissionSectionPaddingTop = 20;
diff --git a/chrome/browser/ui/views/supervised_user/parent_permission_dialog_view.h b/chrome/browser/ui/views/supervised_user/parent_permission_dialog_view.h index 14c4a78..dd0b3b6 100644 --- a/chrome/browser/ui/views/supervised_user/parent_permission_dialog_view.h +++ b/chrome/browser/ui/views/supervised_user/parent_permission_dialog_view.h
@@ -13,9 +13,9 @@ #include "chrome/browser/ui/supervised_user/parent_permission_dialog.h" #include "components/signin/public/identity_manager/access_token_info.h" #include "google_apis/gaia/gaia_auth_consumer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/image/image.h" #include "ui/gfx/native_widget_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc b/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc index 3be87f8..eea1a4a8 100644 --- a/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc +++ b/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc
@@ -17,10 +17,10 @@ #include "chrome/browser/ui/views/chrome_typography.h" #include "chrome/browser/ui/views/sync/dice_signin_button_view.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" DiceBubbleSyncPromoView::DiceBubbleSyncPromoView( Profile* profile,
diff --git a/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.h b/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.h index 183c6be..62229ea 100644 --- a/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.h +++ b/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.h
@@ -7,7 +7,7 @@ #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h" #include "components/signin/public/base/signin_metrics.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view.h"
diff --git a/chrome/browser/ui/views/sync/dice_signin_button_view.cc b/chrome/browser/ui/views/sync/dice_signin_button_view.cc index 5779d9b1..fcc4b40f 100644 --- a/chrome/browser/ui/views/sync/dice_signin_button_view.cc +++ b/chrome/browser/ui/views/sync/dice_signin_button_view.cc
@@ -13,6 +13,7 @@ #include "chrome/browser/ui/views/profiles/badged_profile_photo.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/image.h" #include "ui/gfx/paint_vector_icon.h" @@ -21,7 +22,6 @@ #include "ui/views/controls/button/md_text_button.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" DiceSigninButtonView::DiceSigninButtonView( views::Button::PressedCallback callback,
diff --git a/chrome/browser/ui/views/sync/dice_signin_button_view.h b/chrome/browser/ui/views/sync/dice_signin_button_view.h index 730a0f1f..cf26571 100644 --- a/chrome/browser/ui/views/sync/dice_signin_button_view.h +++ b/chrome/browser/ui/views/sync/dice_signin_button_view.h
@@ -8,8 +8,8 @@ #include "base/optional.h" #include "chrome/browser/ui/views/hover_button.h" #include "components/signin/public/identity_manager/account_info.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" // Sign-in button view used for Desktop Identity Consistency that presents the
diff --git a/chrome/browser/ui/views/sync/one_click_signin_dialog_view.cc b/chrome/browser/ui/views/sync/one_click_signin_dialog_view.cc index c229da1..5906398 100644 --- a/chrome/browser/ui/views/sync/one_click_signin_dialog_view.cc +++ b/chrome/browser/ui/views/sync/one_click_signin_dialog_view.cc
@@ -18,6 +18,7 @@ #include "components/google/core/common/google_util.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/views/controls/button/image_button.h" @@ -26,7 +27,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/link.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" // static
diff --git a/chrome/browser/ui/views/sync/one_click_signin_dialog_view.h b/chrome/browser/ui/views/sync/one_click_signin_dialog_view.h index bd7d777e..0f6ba3b 100644 --- a/chrome/browser/ui/views/sync/one_click_signin_dialog_view.h +++ b/chrome/browser/ui/views/sync/one_click_signin_dialog_view.h
@@ -14,8 +14,8 @@ #include "base/macros.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/sync/one_click_signin_links_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" // This class allows users to confirm sync signin in cases where signin is
diff --git a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc index ddc73b165..989f7c7 100644 --- a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc +++ b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc
@@ -29,6 +29,7 @@ #include "google_apis/gaia/gaia_auth_util.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/window_open_disposition.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/font.h" @@ -43,7 +44,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.h b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.h index 730dfd8..3b4de3b 100644 --- a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.h +++ b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.h
@@ -10,7 +10,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class Browser;
diff --git a/chrome/browser/ui/views/tab_icon_view.cc b/chrome/browser/ui/views/tab_icon_view.cc index ad7969e..55ad8a8a 100644 --- a/chrome/browser/ui/views/tab_icon_view.cc +++ b/chrome/browser/ui/views/tab_icon_view.cc
@@ -17,13 +17,13 @@ #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/ui/views/tab_icon_view_model.h" #include "chrome/grit/theme_resources.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/favicon_size.h" #include "ui/gfx/paint_throbber.h" #include "ui/native_theme/native_theme.h" -#include "ui/views/metadata/metadata_impl_macros.h" #if defined(OS_WIN) #include "chrome/browser/win/app_icon.h"
diff --git a/chrome/browser/ui/views/tab_icon_view.h b/chrome/browser/ui/views/tab_icon_view.h index 3e990c4..b76eb7f 100644 --- a/chrome/browser/ui/views/tab_icon_view.h +++ b/chrome/browser/ui/views/tab_icon_view.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_H_ #include "base/time/time.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/menu_button.h" -#include "ui/views/metadata/metadata_header_macros.h" class TabIconViewModel;
diff --git a/chrome/browser/ui/views/tabs/alert_indicator.cc b/chrome/browser/ui/views/tabs/alert_indicator.cc index 2f712c51..4ed92ee 100644 --- a/chrome/browser/ui/views/tabs/alert_indicator.cc +++ b/chrome/browser/ui/views/tabs/alert_indicator.cc
@@ -10,13 +10,13 @@ #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/views/tabs/tab.h" #include "components/vector_icons/vector_icons.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/gfx/animation/multi_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/image.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/animation_delegate_views.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/tabs/alert_indicator.h b/chrome/browser/ui/views/tabs/alert_indicator.h index 364fef52..b582f83 100644 --- a/chrome/browser/ui/views/tabs/alert_indicator.h +++ b/chrome/browser/ui/views/tabs/alert_indicator.h
@@ -9,8 +9,8 @@ #include "base/optional.h" #include "chrome/browser/ui/tabs/tab_utils.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/image_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class Tab;
diff --git a/chrome/browser/ui/views/tabs/color_picker_view.cc b/chrome/browser/ui/views/tabs/color_picker_view.cc index 7b54ea7..2e92d795 100644 --- a/chrome/browser/ui/views/tabs/color_picker_view.cc +++ b/chrome/browser/ui/views/tabs/color_picker_view.cc
@@ -16,6 +16,8 @@ #include "components/tab_groups/tab_group_color.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/theme_provider.h" #include "ui/gfx/animation/tween.h" @@ -29,8 +31,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace {
diff --git a/chrome/browser/ui/views/tabs/color_picker_view.h b/chrome/browser/ui/views/tabs/color_picker_view.h index 7bfeb4a..4c1dd2b 100644 --- a/chrome/browser/ui/views/tabs/color_picker_view.h +++ b/chrome/browser/ui/views/tabs/color_picker_view.h
@@ -13,8 +13,8 @@ #include "base/optional.h" #include "chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.h" #include "components/tab_groups/tab_group_color.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/tabs/new_tab_button.cc b/chrome/browser/ui/views/tabs/new_tab_button.cc index 110405ce..0c6ca12 100644 --- a/chrome/browser/ui/views/tabs/new_tab_button.cc +++ b/chrome/browser/ui/views/tabs/new_tab_button.cc
@@ -19,6 +19,7 @@ #include "chrome/browser/ui/views/tabs/tab_strip.h" #include "chrome/grit/generated_resources.h" #include "components/variations/variations_associated_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/theme_provider.h" #include "ui/gfx/color_utils.h" @@ -28,7 +29,6 @@ #include "ui/views/animation/ink_drop_impl.h" #include "ui/views/animation/ink_drop_mask.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #if defined(OS_WIN)
diff --git a/chrome/browser/ui/views/tabs/new_tab_button.h b/chrome/browser/ui/views/tabs/new_tab_button.h index 036774a..1572541 100644 --- a/chrome/browser/ui/views/tabs/new_tab_button.h +++ b/chrome/browser/ui/views/tabs/new_tab_button.h
@@ -9,8 +9,8 @@ #include "base/scoped_observation.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/tabs/tab_strip.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc index 02fd74b..2fbb322 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -57,6 +57,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/list_selection_model.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/resource/resource_bundle.h" @@ -77,7 +78,6 @@ #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/rect_based_targeting_utils.h" #include "ui/views/view.h" #include "ui/views/view_class_properties.h"
diff --git a/chrome/browser/ui/views/tabs/tab.h b/chrome/browser/ui/views/tabs/tab.h index 41032cb..70c0dbdc 100644 --- a/chrome/browser/ui/views/tabs/tab.h +++ b/chrome/browser/ui/views/tabs/tab.h
@@ -17,6 +17,7 @@ #include "components/performance_manager/public/freezing/freezing.h" #include "components/tab_groups/tab_group_id.h" #include "ui/base/layout.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/geometry/point.h" @@ -25,7 +26,6 @@ #include "ui/views/controls/button/button.h" #include "ui/views/controls/focus_ring.h" #include "ui/views/masked_targeter_delegate.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view_observer.h" class AlertIndicator;
diff --git a/chrome/browser/ui/views/tabs/tab_close_button.cc b/chrome/browser/ui/views/tabs/tab_close_button.cc index f75a805d..8f64b0c 100644 --- a/chrome/browser/ui/views/tabs/tab_close_button.cc +++ b/chrome/browser/ui/views/tabs/tab_close_button.cc
@@ -17,6 +17,7 @@ #include "chrome/browser/ui/views/tabs/tab_controller.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" @@ -27,7 +28,6 @@ #include "ui/views/animation/ink_drop.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/rect_based_targeting_utils.h" #include "ui/views/view_class_properties.h"
diff --git a/chrome/browser/ui/views/tabs/tab_close_button.h b/chrome/browser/ui/views/tabs/tab_close_button.h index dce4685f..a501ec4 100644 --- a/chrome/browser/ui/views/tabs/tab_close_button.h +++ b/chrome/browser/ui/views/tabs/tab_close_button.h
@@ -7,9 +7,9 @@ #include "base/callback_forward.h" #include "chrome/browser/ui/views/tabs/tab_style_views.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/masked_targeter_delegate.h" -#include "ui/views/metadata/metadata_header_macros.h" // This is a Button subclass that shows the tab closed icon. //
diff --git a/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc b/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc index bd5f309..934174e 100644 --- a/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc +++ b/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.cc
@@ -37,6 +37,7 @@ #include "components/tab_groups/tab_group_visual_data.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/events/types/event_type.h" #include "ui/gfx/geometry/insets.h" @@ -50,7 +51,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/layout_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" // static
diff --git a/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.h b/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.h index efdee74..704d40d 100644 --- a/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.h +++ b/chrome/browser/ui/views/tabs/tab_group_editor_bubble_view.h
@@ -10,10 +10,10 @@ #include "base/optional.h" #include "chrome/browser/ui/views/tabs/tab_group_header.h" #include "components/tab_groups/tab_group_color.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" class Browser;
diff --git a/chrome/browser/ui/views/tabs/tab_group_header.cc b/chrome/browser/ui/views/tabs/tab_group_header.cc index afd2394..507e32c 100644 --- a/chrome/browser/ui/views/tabs/tab_group_header.cc +++ b/chrome/browser/ui/views/tabs/tab_group_header.cc
@@ -30,6 +30,7 @@ #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/insets.h" @@ -43,7 +44,6 @@ #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/view_class_properties.h"
diff --git a/chrome/browser/ui/views/tabs/tab_group_header.h b/chrome/browser/ui/views/tabs/tab_group_header.h index 39fc76e..afd0f34 100644 --- a/chrome/browser/ui/views/tabs/tab_group_header.h +++ b/chrome/browser/ui/views/tabs/tab_group_header.h
@@ -7,9 +7,9 @@ #include "chrome/browser/ui/views/tabs/tab_slot_view.h" #include "components/tab_groups/tab_group_id.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/focus_ring.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view_targeter_delegate.h" #include "ui/views/widget/widget_observer.h"
diff --git a/chrome/browser/ui/views/tabs/tab_group_highlight.cc b/chrome/browser/ui/views/tabs/tab_group_highlight.cc index 4946477..14f3595 100644 --- a/chrome/browser/ui/views/tabs/tab_group_highlight.cc +++ b/chrome/browser/ui/views/tabs/tab_group_highlight.cc
@@ -8,9 +8,9 @@ #include "chrome/browser/ui/tabs/tab_style.h" #include "chrome/browser/ui/views/tabs/tab_group_views.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/views/background.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" TabGroupHighlight::TabGroupHighlight(TabGroupViews* tab_group_views,
diff --git a/chrome/browser/ui/views/tabs/tab_group_highlight.h b/chrome/browser/ui/views/tabs/tab_group_highlight.h index 20b9980..f500cbd 100644 --- a/chrome/browser/ui/views/tabs/tab_group_highlight.h +++ b/chrome/browser/ui/views/tabs/tab_group_highlight.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_GROUP_HIGHLIGHT_H_ #include "components/tab_groups/tab_group_id.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class TabGroupViews;
diff --git a/chrome/browser/ui/views/tabs/tab_group_underline.cc b/chrome/browser/ui/views/tabs/tab_group_underline.cc index c17171d..f6e7554 100644 --- a/chrome/browser/ui/views/tabs/tab_group_underline.cc +++ b/chrome/browser/ui/views/tabs/tab_group_underline.cc
@@ -15,9 +15,9 @@ #include "components/tab_groups/tab_group_id.h" #include "components/tab_groups/tab_group_visual_data.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/views/background.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" constexpr int TabGroupUnderline::kStrokeThickness;
diff --git a/chrome/browser/ui/views/tabs/tab_group_underline.h b/chrome/browser/ui/views/tabs/tab_group_underline.h index 033efe1..84f1f89 100644 --- a/chrome/browser/ui/views/tabs/tab_group_underline.h +++ b/chrome/browser/ui/views/tabs/tab_group_underline.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_GROUP_UNDERLINE_H_ #include "components/tab_groups/tab_group_id.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class TabGroupViews;
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc index 8225a52a..fc7baad 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc +++ b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc
@@ -24,6 +24,8 @@ #include "components/url_formatter/url_formatter.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/animation/slide_animation.h" @@ -40,8 +42,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.h b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.h index db79fc3d..7d3ea02 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.h +++ b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.h
@@ -10,8 +10,8 @@ #include "base/time/time.h" #include "build/chromeos_buildflags.h" #include "chrome/browser/ui/tabs/tab_utils.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/public/cpp/metrics_util.h"
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_controller.cc b/chrome/browser/ui/views/tabs/tab_hover_card_controller.cc index 1cffdf7..65cb15d 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_controller.cc +++ b/chrome/browser/ui/views/tabs/tab_hover_card_controller.cc
@@ -324,7 +324,7 @@ MaybeStartThumbnailObservation(target_tab_, is_initial); if (!is_initial || !UseAnimations()) { - metrics_->CardFullyVisibleOnTab(target_tab_, target_tab_->IsActive()); + OnCardFullyVisible(); hover_card_->GetWidget()->Show(); return; } @@ -381,10 +381,6 @@ return static_cast<bool>(thumbnail_observer_); } -bool TabHoverCardController::HasPreviewImage() const { - return ArePreviewsEnabled() && hover_card_ && !waiting_for_preview_; -} - views::Widget* TabHoverCardController::GetHoverCardWidget() { return hover_card_ ? hover_card_->GetWidget() : nullptr; } @@ -511,6 +507,12 @@ return hover_card_->GetAnchorView(); } +void TabHoverCardController::OnCardFullyVisible() { + const bool has_preview = + ArePreviewsEnabled() && !target_tab_->IsActive() && !waiting_for_preview_; + metrics_->CardFullyVisibleOnTab(target_tab_, has_preview); +} + void TabHoverCardController::OnFadeAnimationEnded( views::WidgetFadeAnimator* animator, views::WidgetFadeAnimator::FadeType fade_type) { @@ -518,7 +520,7 @@ // just as we've decided to fade out, so check for null. // See: crbug.com/1192451 if (target_tab_ && fade_type == views::WidgetFadeAnimator::FadeType::kFadeIn) - metrics_->CardFullyVisibleOnTab(target_tab_, target_tab_->IsActive()); + OnCardFullyVisible(); metrics_->CardFadeComplete(); if (fade_type == views::WidgetFadeAnimator::FadeType::kFadeOut) @@ -545,7 +547,7 @@ if (waiting_for_preview_) hover_card_->ClearPreviewImage(); - metrics_->CardFullyVisibleOnTab(target_tab_, target_tab_->IsActive()); + OnCardFullyVisible(); } void TabHoverCardController::OnPreviewImageAvaialble(
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_controller.h b/chrome/browser/ui/views/tabs/tab_hover_card_controller.h index bdf1840..c582b6e 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_controller.h +++ b/chrome/browser/ui/views/tabs/tab_hover_card_controller.h
@@ -62,7 +62,6 @@ // TabHoverCardMetrics::Delegate: size_t GetTabCount() const override; bool ArePreviewsEnabled() const override; - bool HasPreviewImage() const override; views::Widget* GetHoverCardWidget() override; void CreateHoverCard(Tab* tab); @@ -79,6 +78,9 @@ const views::View* GetTargetAnchorView() const; + // Helper for recording metrics when a card becomes fully visible to the user. + void OnCardFullyVisible(); + // Animator events: void OnFadeAnimationEnded(views::WidgetFadeAnimator* animator, views::WidgetFadeAnimator::FadeType fade_type);
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_metrics.cc b/chrome/browser/ui/views/tabs/tab_hover_card_metrics.cc index 2290308..e10e506 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_metrics.cc +++ b/chrome/browser/ui/views/tabs/tab_hover_card_metrics.cc
@@ -80,11 +80,13 @@ constexpr base::TimeDelta kMaxHoverCardReshowTimeDelta = base::TimeDelta::FromSeconds(5); const base::TimeDelta elapsed_time = base::TimeTicks::Now() - last_seen_time; - if (elapsed_time > kMaxHoverCardReshowTimeDelta) - return; - constexpr base::TimeDelta kMinHoverCardReshowTimeDelta = base::TimeDelta::FromMilliseconds(1); + if (elapsed_time < kMinHoverCardReshowTimeDelta || + elapsed_time > kMaxHoverCardReshowTimeDelta) { + return; + } + constexpr int kHoverCardHistogramBucketCount = 50; UMA_HISTOGRAM_CUSTOM_TIMES( TabHoverCardMetrics::kHistogramTimeSinceLastVisible, elapsed_time, @@ -187,7 +189,8 @@ #endif } -void TabHoverCardMetrics::CardFullyVisibleOnTab(TabHandle tab, bool is_active) { +void TabHoverCardMetrics::CardFullyVisibleOnTab(TabHandle tab, + bool has_preview) { if (tab == last_tab_) return; @@ -202,7 +205,7 @@ // If the tab isn't active and we're done waiting for a preview image, mark // the image as seen now. - if (!is_active && delegate_->HasPreviewImage()) { + if (has_preview) { ImageLoadedForTab(tab); last_image_time_ = base::TimeTicks::Now(); } else { @@ -273,10 +276,8 @@ bucket); } - if (delegate_->ArePreviewsEnabled()) { - if (!last_image_time_.is_null()) { - RECORD_TIME_METRIC(kHistogramPrefixTabPreviewTime, last_image_time_, - bucket); - } + if (delegate_->ArePreviewsEnabled() && !last_image_time_.is_null()) { + RECORD_TIME_METRIC(kHistogramPrefixTabPreviewTime, last_image_time_, + bucket); } }
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_metrics.h b/chrome/browser/ui/views/tabs/tab_hover_card_metrics.h index 600df25..2e6b7f7 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_metrics.h +++ b/chrome/browser/ui/views/tabs/tab_hover_card_metrics.h
@@ -34,10 +34,6 @@ // Returns true if preview images are enabled. virtual bool ArePreviewsEnabled() const = 0; - // Returns true if the current hover card is visible and displaying a valid - // preview image. - virtual bool HasPreviewImage() const = 0; - // Returns the hover card widget, or nullptr if none. Can be stubbed to // return nullptr for tests (low-level performance metrics may not be // recorded). @@ -70,9 +66,10 @@ void CardFadeComplete(); void CardFadeCanceled(); - // Notes that a card becomes fully visible or lands on|tab|. Set - // |has_thumbnail| to true if the thumbnail for the tab is already loaded. - void CardFullyVisibleOnTab(TabHandle tab, bool is_active); + // Notes that a card becomes fully visible or lands on `tab`. Set + // `has_preview` to true if there is already a preview image loaded for the + // tab. + void CardFullyVisibleOnTab(TabHandle tab, bool has_preview); // Note that an image was shown for |tab|. void ImageLoadedForTab(TabHandle tab);
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_metrics_unittest.cc b/chrome/browser/ui/views/tabs/tab_hover_card_metrics_unittest.cc index 66b128a..2d62be5 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_metrics_unittest.cc +++ b/chrome/browser/ui/views/tabs/tab_hover_card_metrics_unittest.cc
@@ -27,24 +27,16 @@ void set_previews_enabled(bool previews_enabled) { previews_enabled_ = previews_enabled; - thumbnail_loaded_ &= previews_enabled_; - } - - void set_thumbnail_loaded(bool thumbnail_loaded) { - DCHECK(previews_enabled_); - thumbnail_loaded_ = thumbnail_loaded; } // TabHoverCardMetrics::Delegate: size_t GetTabCount() const override { return tab_count_; } bool ArePreviewsEnabled() const override { return previews_enabled_; } - bool HasPreviewImage() const override { return thumbnail_loaded_; } views::Widget* GetHoverCardWidget() override { return nullptr; } private: size_t tab_count_ = 1U; bool previews_enabled_ = false; - bool thumbnail_loaded_ = false; }; // Create some sample tab handles that don't correspond to real tabs, but which @@ -128,7 +120,7 @@ TEST_F(TabHoverCardMetricsTest, SimpleSequenceWithoutPreviews) { metrics_->InitialCardBeingShown(); - metrics_->CardFullyVisibleOnTab(kTabHandle1, true); + metrics_->CardFullyVisibleOnTab(kTabHandle1, false); task_environment_.AdvanceClock(kShortDelay); metrics_->CardFullyVisibleOnTab(kTabHandle2, false); task_environment_.AdvanceClock(kMediumDelay); @@ -147,7 +139,7 @@ TEST_F(TabHoverCardMetricsTest, HideSignalFollowsSelection) { metrics_->InitialCardBeingShown(); - metrics_->CardFullyVisibleOnTab(kTabHandle1, true); + metrics_->CardFullyVisibleOnTab(kTabHandle1, false); task_environment_.AdvanceClock(kShortDelay); metrics_->CardFullyVisibleOnTab(kTabHandle2, false); task_environment_.AdvanceClock(kMediumDelay); @@ -168,7 +160,7 @@ delegate_->set_previews_enabled(true); metrics_->InitialCardBeingShown(); - metrics_->CardFullyVisibleOnTab(kTabHandle1, true); + metrics_->CardFullyVisibleOnTab(kTabHandle1, false); task_environment_.AdvanceClock(kShortDelay); metrics_->CardFullyVisibleOnTab(kTabHandle2, false); task_environment_.AdvanceClock(kShortDelay); @@ -209,8 +201,7 @@ delegate_->set_previews_enabled(true); metrics_->InitialCardBeingShown(); - delegate_->set_thumbnail_loaded(true); - metrics_->CardFullyVisibleOnTab(kTabHandle1, false); + metrics_->CardFullyVisibleOnTab(kTabHandle1, true); task_environment_.AdvanceClock(kShortDelay); metrics_->CardWillBeHidden(); metrics_->TabSelectedViaMouse(kTabHandle1); @@ -257,7 +248,7 @@ TEST_F(TabHoverCardMetricsTest, RepeatingSequence) { metrics_->InitialCardBeingShown(); - metrics_->CardFullyVisibleOnTab(kTabHandle1, true); + metrics_->CardFullyVisibleOnTab(kTabHandle1, false); task_environment_.AdvanceClock(kShortDelay); metrics_->CardFullyVisibleOnTab(kTabHandle2, false); task_environment_.AdvanceClock(kMediumDelay); @@ -276,7 +267,7 @@ TEST_F(TabHoverCardMetricsTest, MultipleSequences) { metrics_->InitialCardBeingShown(); - metrics_->CardFullyVisibleOnTab(kTabHandle1, true); + metrics_->CardFullyVisibleOnTab(kTabHandle1, false); task_environment_.AdvanceClock(kMediumDelay); metrics_->CardFullyVisibleOnTab(kTabHandle2, false); task_environment_.AdvanceClock(kShortDelay); @@ -286,7 +277,7 @@ metrics_->InitialCardBeingShown(); metrics_->CardFullyVisibleOnTab(kTabHandle1, false); task_environment_.AdvanceClock(kLongDelay); - metrics_->CardFullyVisibleOnTab(kTabHandle2, true); + metrics_->CardFullyVisibleOnTab(kTabHandle2, false); task_environment_.AdvanceClock(kShortDelay); metrics_->CardFullyVisibleOnTab(kTabHandle3, false); task_environment_.AdvanceClock(kMediumDelay); @@ -302,7 +293,7 @@ TEST_F(TabHoverCardMetricsTest, ResumeSequenceFromSameTab) { metrics_->InitialCardBeingShown(); - metrics_->CardFullyVisibleOnTab(kTabHandle1, true); + metrics_->CardFullyVisibleOnTab(kTabHandle1, false); task_environment_.AdvanceClock(kShortDelay); metrics_->CardFullyVisibleOnTab(kTabHandle2, false); task_environment_.AdvanceClock(kMediumDelay); @@ -327,7 +318,7 @@ TEST_F(TabHoverCardMetricsTest, ResumeSequenceFromDifferentTab) { metrics_->InitialCardBeingShown(); - metrics_->CardFullyVisibleOnTab(kTabHandle1, true); + metrics_->CardFullyVisibleOnTab(kTabHandle1, false); task_environment_.AdvanceClock(kShortDelay); metrics_->CardFullyVisibleOnTab(kTabHandle2, false); task_environment_.AdvanceClock(kMediumDelay);
diff --git a/chrome/browser/ui/views/tabs/tab_icon.cc b/chrome/browser/ui/views/tabs/tab_icon.cc index 82cc753..8eac9dc 100644 --- a/chrome/browser/ui/views/tabs/tab_icon.cc +++ b/chrome/browser/ui/views/tabs/tab_icon.cc
@@ -16,6 +16,7 @@ #include "chrome/common/webui_url_constants.h" #include "components/grit/components_scaled_resources.h" #include "content/public/common/url_constants.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" #include "ui/compositor/layer.h" @@ -32,7 +33,6 @@ #include "ui/native_theme/native_theme.h" #include "ui/resources/grit/ui_resources.h" #include "ui/views/border.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "url/gurl.h" namespace {
diff --git a/chrome/browser/ui/views/tabs/tab_icon.h b/chrome/browser/ui/views/tabs/tab_icon.h index 435fefc..76a6c5fb 100644 --- a/chrome/browser/ui/views/tabs/tab_icon.h +++ b/chrome/browser/ui/views/tabs/tab_icon.h
@@ -7,11 +7,11 @@ #include "base/time/time.h" #include "chrome/browser/ui/tabs/tab_network_state.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/paint_throbber.h" #include "ui/views/animation/animation_delegate_views.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace base {
diff --git a/chrome/browser/ui/views/tabs/tab_search_button.cc b/chrome/browser/ui/views/tabs/tab_search_button.cc index 870e9ee..92489b4 100644 --- a/chrome/browser/ui/views/tabs/tab_search_button.cc +++ b/chrome/browser/ui/views/tabs/tab_search_button.cc
@@ -10,10 +10,10 @@ #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" #include "chrome/common/webui_url_constants.h" #include "chrome/grit/generated_resources.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/compositor.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/presentation_feedback.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace {
diff --git a/chrome/browser/ui/views/tabs/tab_search_button.h b/chrome/browser/ui/views/tabs/tab_search_button.h index 91ca232d..818ab99c 100644 --- a/chrome/browser/ui/views/tabs/tab_search_button.h +++ b/chrome/browser/ui/views/tabs/tab_search_button.h
@@ -9,8 +9,8 @@ #include "chrome/browser/ui/views/bubble/webui_bubble_manager.h" #include "chrome/browser/ui/views/tabs/new_tab_button.h" #include "chrome/browser/ui/webui/tab_search/tab_search_ui.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/menu_button_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_observer.h" #include "ui/views/widget/widget_utils.h"
diff --git a/chrome/browser/ui/views/tabs/tab_slot_view.cc b/chrome/browser/ui/views/tabs/tab_slot_view.cc index 7e41076..d0efb7fb 100644 --- a/chrome/browser/ui/views/tabs/tab_slot_view.cc +++ b/chrome/browser/ui/views/tabs/tab_slot_view.cc
@@ -3,7 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ui/views/tabs/tab_slot_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" TabSlotView::TabSlotView() = default; TabSlotView::~TabSlotView() = default;
diff --git a/chrome/browser/ui/views/tabs/tab_slot_view.h b/chrome/browser/ui/views/tabs/tab_slot_view.h index fc2651ab..48acfbba 100644 --- a/chrome/browser/ui/views/tabs/tab_slot_view.h +++ b/chrome/browser/ui/views/tabs/tab_slot_view.h
@@ -7,7 +7,7 @@ #include "chrome/browser/ui/views/tabs/tab_strip_layout.h" #include "components/tab_groups/tab_group_id.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" // View that can be laid out in the tabstrip.
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 6e8cddb..1aa4eb27 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -72,6 +72,7 @@ #include "third_party/skia/include/pathops/SkPathOps.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/list_selection_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" @@ -90,7 +91,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/masked_targeter_delegate.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/mouse_watcher_view_host.h" #include "ui/views/rect_based_targeting_utils.h" #include "ui/views/view_model_utils.h" @@ -3901,10 +3901,10 @@ ADD_READONLY_PROPERTY_METADATA(int, StrokeThickness) ADD_READONLY_PROPERTY_METADATA(SkColor, ToolbarTopSeparatorColor, - views::metadata::SkColorConverter) + ui::metadata::SkColorConverter) ADD_READONLY_PROPERTY_METADATA(SkColor, TabSeparatorColor, - views::metadata::SkColorConverter) + ui::metadata::SkColorConverter) ADD_READONLY_PROPERTY_METADATA(float, HoverOpacityForRadialHighlight) ADD_READONLY_PROPERTY_METADATA(int, ActiveTabWidth) ADD_READONLY_PROPERTY_METADATA(int, InactiveTabWidth)
diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h index dffb175..8049075 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.h +++ b/chrome/browser/ui/views/tabs/tab_strip.h
@@ -28,6 +28,7 @@ #include "chrome/browser/ui/views/tabs/tab_group_header.h" #include "chrome/browser/ui/views/tabs/tab_group_views.h" #include "components/tab_groups/tab_group_visual_data.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/point.h" @@ -35,7 +36,6 @@ #include "ui/views/animation/bounds_animator.h" #include "ui/views/animation/bounds_animator_observer.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/mouse_watcher.h" #include "ui/views/view.h" #include "ui/views/view_model.h"
diff --git a/chrome/browser/ui/views/tabs/tab_style_views.cc b/chrome/browser/ui/views/tabs/tab_style_views.cc index 6a99225b..7a8aefdd 100644 --- a/chrome/browser/ui/views/tabs/tab_style_views.cc +++ b/chrome/browser/ui/views/tabs/tab_style_views.cc
@@ -955,8 +955,8 @@ } // namespace // static -std::u16string views::metadata::TypeConverter<TabStyle::TabColors>::ToString( - views::metadata::ArgType<TabStyle::TabColors> source_value) { +std::u16string ui::metadata::TypeConverter<TabStyle::TabColors>::ToString( + ui::metadata::ArgType<TabStyle::TabColors> source_value) { return base::ASCIIToUTF16(base::StringPrintf( "{%s,%s}", color_utils::SkColorToRgbaString(source_value.foreground_color).c_str(), @@ -964,7 +964,7 @@ } // static -base::Optional<TabStyle::TabColors> views::metadata::TypeConverter< +base::Optional<TabStyle::TabColors> ui::metadata::TypeConverter< TabStyle::TabColors>::FromString(const std::u16string& source_value) { std::u16string trimmed_string; base::TrimString(source_value, u"{ }", &trimmed_string); @@ -980,8 +980,8 @@ } // static -views::metadata::ValidStrings -views::metadata::TypeConverter<TabStyle::TabColors>::GetValidStrings() { +ui::metadata::ValidStrings +ui::metadata::TypeConverter<TabStyle::TabColors>::GetValidStrings() { return ValidStrings(); }
diff --git a/chrome/browser/ui/views/tabs/tab_style_views.h b/chrome/browser/ui/views/tabs/tab_style_views.h index 1b433b49..abe8e2d2 100644 --- a/chrome/browser/ui/views/tabs/tab_style_views.h +++ b/chrome/browser/ui/views/tabs/tab_style_views.h
@@ -9,17 +9,17 @@ #include "chrome/browser/ui/tabs/tab_style.h" #include "chrome/browser/ui/views/tabs/glow_hover_controller.h" +#include "ui/base/metadata/base_type_conversion.h" #include "ui/gfx/geometry/rect_f.h" -#include "ui/views/metadata/type_conversion.h" template <> -struct views::metadata::TypeConverter<TabStyle::TabColors> - : BaseTypeConverter<true> { +struct ui::metadata::TypeConverter<TabStyle::TabColors> + : ui::metadata::BaseTypeConverter<true> { static std::u16string ToString( - views::metadata::ArgType<TabStyle::TabColors> source_value); + ui::metadata::ArgType<TabStyle::TabColors> source_value); static base::Optional<TabStyle::TabColors> FromString( const std::u16string& source_value); - static views::metadata::ValidStrings GetValidStrings(); + static ui::metadata::ValidStrings GetValidStrings(); }; class Tab;
diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc index 5e2b3794..e8ef6b8 100644 --- a/chrome/browser/ui/views/task_manager_view.cc +++ b/chrome/browser/ui/views/task_manager_view.cc
@@ -26,13 +26,13 @@ #include "chrome/grit/generated_resources.h" #include "components/prefs/pref_service.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/table_model_observer.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/controls/table/table_view.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/task_manager_view.h b/chrome/browser/ui/views/task_manager_view.h index 5da2be85..861bfa3 100644 --- a/chrome/browser/ui/views/task_manager_view.h +++ b/chrome/browser/ui/views/task_manager_view.h
@@ -9,13 +9,13 @@ #include "base/macros.h" #include "chrome/browser/ui/task_manager/task_manager_table_model.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/simple_menu_model.h" #include "ui/base/models/table_model.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/controls/table/table_grouper.h" #include "ui/views/controls/table/table_view_observer.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" class Browser;
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc index 1e5f580..6edffaa0 100644 --- a/chrome/browser/ui/views/toolbar/app_menu.cc +++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -50,6 +50,8 @@ #include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/layout.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" @@ -72,8 +74,6 @@ #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/controls/menu/menu_scroll_view_container.h" #include "ui/views/controls/menu/submenu_view.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" using base::UserMetricsAction;
diff --git a/chrome/browser/ui/views/toolbar/back_forward_button.cc b/chrome/browser/ui/views/toolbar/back_forward_button.cc index b15b929..a7c7db64 100644 --- a/chrome/browser/ui/views/toolbar/back_forward_button.cc +++ b/chrome/browser/ui/views/toolbar/back_forward_button.cc
@@ -12,8 +12,8 @@ #include "components/strings/grit/components_strings.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/accessibility/view_accessibility.h" -#include "ui/views/metadata/metadata_impl_macros.h" BackForwardButton::BackForwardButton(Direction direction, PressedCallback callback,
diff --git a/chrome/browser/ui/views/toolbar/back_forward_button.h b/chrome/browser/ui/views/toolbar/back_forward_button.h index bf5b2fc..73eb5fa1 100644 --- a/chrome/browser/ui/views/toolbar/back_forward_button.h +++ b/chrome/browser/ui/views/toolbar/back_forward_button.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BACK_FORWARD_BUTTON_H_ #include "chrome/browser/ui/views/toolbar/toolbar_button.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class Browser;
diff --git a/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc b/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc index 867b7d09..d41fdf2 100644 --- a/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc +++ b/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
@@ -26,6 +26,7 @@ #include "chrome/grit/generated_resources.h" #include "components/feature_engagement/public/feature_constants.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_features.h" #include "ui/gfx/animation/throb_animation.h" @@ -38,7 +39,6 @@ #include "ui/views/animation/ink_drop_highlight.h" #include "ui/views/animation/ink_drop_state.h" #include "ui/views/controls/button/label_button_border.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/metrics.h" #include "ui/views/view.h" #include "ui/views/view_class_properties.h"
diff --git a/chrome/browser/ui/views/toolbar/browser_app_menu_button.h b/chrome/browser/ui/views/toolbar/browser_app_menu_button.h index 13f8c50..24744a33 100644 --- a/chrome/browser/ui/views/toolbar/browser_app_menu_button.h +++ b/chrome/browser/ui/views/toolbar/browser_app_menu_button.h
@@ -14,7 +14,7 @@ #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" #include "chrome/browser/ui/user_education/feature_promo_controller.h" #include "chrome/browser/ui/views/frame/app_menu_button.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class ToolbarView;
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.cc b/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.cc index cda88161d..ec6ae0b 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.cc +++ b/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.cc
@@ -17,6 +17,8 @@ #include "components/flags_ui/pref_service_flags_storage.h" #include "components/version_info/channel.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/background.h" @@ -25,8 +27,6 @@ #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.h b/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.h index d7e4338c..b80a6e2 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.h +++ b/chrome/browser/ui/views/toolbar/chrome_labs_bubble_view.h
@@ -10,9 +10,9 @@ #include "components/flags_ui/feature_entry.h" #include "components/flags_ui/flags_state.h" #include "components/flags_ui/flags_storage.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/layout/flex_layout_view.h" -#include "ui/views/metadata/metadata_header_macros.h" class Browser;
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs_button.cc b/chrome/browser/ui/views/toolbar/chrome_labs_button.cc index 4fc0531..f662d78 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs_button.cc +++ b/chrome/browser/ui/views/toolbar/chrome_labs_button.cc
@@ -10,9 +10,9 @@ #include "chrome/common/channel_info.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/controls/button/button_controller.h" -#include "ui/views/metadata/metadata_impl_macros.h" ChromeLabsButton::ChromeLabsButton(Browser* browser, const ChromeLabsBubbleViewModel* model)
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs_button.h b/chrome/browser/ui/views/toolbar/chrome_labs_button.h index c0d3f524..693beedf 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs_button.h +++ b/chrome/browser/ui/views/toolbar/chrome_labs_button.h
@@ -7,7 +7,7 @@ #include "chrome/browser/ui/views/toolbar/chrome_labs_bubble_view_model.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class Browser;
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs_item_view.cc b/chrome/browser/ui/views/toolbar/chrome_labs_item_view.cc index a8514f4..efc5d27 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs_item_view.cc +++ b/chrome/browser/ui/views/toolbar/chrome_labs_item_view.cc
@@ -11,6 +11,7 @@ #include "chrome/grit/generated_resources.h" #include "extensions/browser/api/feedback_private/feedback_private_api.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/combobox_model.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/controls/button/md_text_button.h" @@ -19,7 +20,6 @@ #include "ui/views/layout/flex_layout_types.h" #include "ui/views/layout/flex_layout_view.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/toolbar/chrome_labs_item_view.h b/chrome/browser/ui/views/toolbar/chrome_labs_item_view.h index 5b6c4c5..6bf1627 100644 --- a/chrome/browser/ui/views/toolbar/chrome_labs_item_view.h +++ b/chrome/browser/ui/views/toolbar/chrome_labs_item_view.h
@@ -7,8 +7,8 @@ #include "base/callback.h" #include "components/flags_ui/feature_entry.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/combobox/combobox.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" class Browser;
diff --git a/chrome/browser/ui/views/toolbar/home_button.cc b/chrome/browser/ui/views/toolbar/home_button.cc index c01e235..04ce8293 100644 --- a/chrome/browser/ui/views/toolbar/home_button.cc +++ b/chrome/browser/ui/views/toolbar/home_button.cc
@@ -19,12 +19,12 @@ #include "components/user_prefs/user_prefs.h" #include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/menu_model.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" // HomePageUndoBubble --------------------------------------------------------
diff --git a/chrome/browser/ui/views/toolbar/home_button.h b/chrome/browser/ui/views/toolbar/home_button.h index d92b84a0..e2b021b 100644 --- a/chrome/browser/ui/views/toolbar/home_button.h +++ b/chrome/browser/ui/views/toolbar/home_button.h
@@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" class Browser;
diff --git a/chrome/browser/ui/views/toolbar/reload_button.cc b/chrome/browser/ui/views/toolbar/reload_button.cc index 69926323..fd2b95048 100644 --- a/chrome/browser/ui/views/toolbar/reload_button.cc +++ b/chrome/browser/ui/views/toolbar/reload_button.cc
@@ -17,13 +17,13 @@ #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/simple_menu_model.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/theme_provider.h" #include "ui/base/window_open_disposition.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/metrics.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/toolbar/reload_button.h b/chrome/browser/ui/views/toolbar/reload_button.h index 092d026b..366eb99b 100644 --- a/chrome/browser/ui/views/toolbar/reload_button.h +++ b/chrome/browser/ui/views/toolbar/reload_button.h
@@ -8,8 +8,8 @@ #include "base/timer/timer.h" #include "chrome/browser/ui/views/chrome_views_export.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/simple_menu_model.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" class CommandUpdater;
diff --git a/chrome/browser/ui/views/toolbar/toolbar_account_icon_container_view.cc b/chrome/browser/ui/views/toolbar/toolbar_account_icon_container_view.cc index 1999e5f..096ad87 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_account_icon_container_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_account_icon_container_view.cc
@@ -20,10 +20,10 @@ #include "chrome/browser/ui/views/profiles/avatar_toolbar_button.h" #include "chrome/browser/ui/views/toolbar/toolbar_ink_drop_util.h" #include "components/autofill/core/common/autofill_features.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/toolbar/toolbar_account_icon_container_view.h b/chrome/browser/ui/views/toolbar/toolbar_account_icon_container_view.h index 05d77f4..b33d9ad 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_account_icon_container_view.h +++ b/chrome/browser/ui/views/toolbar/toolbar_account_icon_container_view.h
@@ -9,7 +9,7 @@ #include "chrome/browser/ui/views/page_action/page_action_icon_container.h" #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_icon_container_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class AvatarToolbarButton; class Browser;
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc index 729c68b..9f95cec 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
@@ -22,6 +22,7 @@ #include "components/sessions/content/session_tab_helper.h" #include "content/public/browser/notification_source.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" #include "ui/compositor/paint_recorder.h" @@ -37,7 +38,6 @@ #include "ui/views/controls/menu/menu_controller.h" #include "ui/views/controls/menu/menu_model_adapter.h" #include "ui/views/controls/menu/menu_runner.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/mouse_constants.h" using views::LabelButtonBorder;
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.h b/chrome/browser/ui/views/toolbar/toolbar_action_view.h index c6703488..e8dba0b 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_action_view.h +++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.h
@@ -7,12 +7,12 @@ #include "base/callback.h" #include "chrome/browser/ui/views/toolbar/toolbar_action_view_delegate_views.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/button/menu_button.h" #include "ui/views/controls/button/menu_button_controller.h" #include "ui/views/controls/menu/menu_model_adapter.h" #include "ui/views/drag_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" class ExtensionContextMenuController;
diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc index a3d51140..11da2679 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
@@ -9,6 +9,7 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/grit/locale_settings.h" #include "components/vector_icons/vector_icons.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/insets.h" @@ -20,7 +21,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/link.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace { const int kBubbleExtraIconSize = 16;
diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h index 5007e15..6ff72df 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h +++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h
@@ -8,8 +8,8 @@ #include <memory> #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_observer.h" class ToolbarActionsBarBubbleViewsTest;
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc index dcb36dd..96036144 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_button.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc
@@ -28,6 +28,7 @@ #include "chrome/browser/ui/views/user_education/feature_promo_colors.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/base/models/menu_model.h" #include "ui/compositor/paint_recorder.h" @@ -46,7 +47,6 @@ #include "ui/views/controls/menu/menu_item_view.h" #include "ui/views/controls/menu/menu_model_adapter.h" #include "ui/views/controls/menu/menu_runner.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h" @@ -165,6 +165,15 @@ if (base::FeatureList::IsEnabled(views::kInstallableInkDropFeature)) { installable_ink_drop_ = std::make_unique<views::InstallableInkDrop>(this); installable_ink_drop_->SetConfig(GetToolbarInstallableInkDropConfig(this)); + SetCreateInkDropCallback(base::BindRepeating( + [](InkDropHostView* host) -> std::unique_ptr<views::InkDrop> { + // Ensure this doesn't get called when InstallableInkDrops are + // enabled. + DCHECK( + !base::FeatureList::IsEnabled(views::kInstallableInkDropFeature)); + return views::InkDrop::CreateInkDropForFloodFillRipple(host); + }, + this)); } // Make sure icons are flipped by default so that back, forward, etc. follows @@ -554,12 +563,6 @@ : views::LabelButton::GetTooltipText(p); } -std::unique_ptr<views::InkDrop> ToolbarButton::CreateInkDrop() { - // Ensure this doesn't get called when InstallableInkDrops are enabled. - DCHECK(!base::FeatureList::IsEnabled(views::kInstallableInkDropFeature)); - return views::LabelButton::CreateInkDrop(); -} - std::unique_ptr<views::InkDropMask> ToolbarButton::CreateInkDropMask() const { if (has_in_product_help_promo_) { // This gets the latest ink drop insets. |SetTrailingMargin()| is called
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.h b/chrome/browser/ui/views/toolbar/toolbar_button.h index 2213449a..383d32d 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_button.h +++ b/chrome/browser/ui/views/toolbar/toolbar_button.h
@@ -7,8 +7,10 @@ #include <memory> +#include "base/bind.h" #include "base/optional.h" #include "chrome/browser/ui/views/chrome_views_export.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/base/theme_provider.h" #include "ui/gfx/animation/animation_delegate.h" @@ -17,7 +19,6 @@ #include "ui/gfx/vector_icon_types.h" #include "ui/views/context_menu_controller.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" class TabStripModel; @@ -115,7 +116,6 @@ void OnGestureEvent(ui::GestureEvent* event) override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; std::u16string GetTooltipText(const gfx::Point& p) const override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override; views::InkDrop* GetInkDrop() override; SkColor GetInkDropBaseColor() const override;
diff --git a/chrome/browser/ui/views/toolbar/toolbar_icon_container_view.cc b/chrome/browser/ui/views/toolbar/toolbar_icon_container_view.cc index f380e9e8..ef44b4c 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_icon_container_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_icon_container_view.cc
@@ -13,6 +13,7 @@ #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" #include "chrome/browser/ui/views/toolbar/toolbar_ink_drop_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/paint_recorder.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/canvas.h" @@ -20,7 +21,6 @@ #include "ui/views/background.h" #include "ui/views/layout/animating_layout_manager.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/view_observer.h" @@ -283,6 +283,6 @@ } BEGIN_METADATA(ToolbarIconContainerView, views::View) -ADD_PROPERTY_METADATA(SkColor, IconColor, views::metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, IconColor, ui::metadata::SkColorConverter) ADD_READONLY_PROPERTY_METADATA(bool, Highlighted) END_METADATA
diff --git a/chrome/browser/ui/views/toolbar/toolbar_icon_container_view.h b/chrome/browser/ui/views/toolbar/toolbar_icon_container_view.h index 34d7911..27a15bd6 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_icon_container_view.h +++ b/chrome/browser/ui/views/toolbar/toolbar_icon_container_view.h
@@ -8,12 +8,12 @@ #include <list> #include "base/observer_list.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_delegate.h" #include "ui/views/controls/button/button.h" #include "ui/views/layout/animating_layout_manager.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" // A general view container for any type of toolbar icons.
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc index a753bb4..acfc14c3 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -78,6 +78,7 @@ #include "media/base/media_switches.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/base/window_open_disposition.h" #include "ui/compositor/layer.h" @@ -89,7 +90,6 @@ #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/tooltip_manager.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.h b/chrome/browser/ui/views/toolbar/toolbar_view.h index fd9e929d..03bd572 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_view.h +++ b/chrome/browser/ui/views/toolbar/toolbar_view.h
@@ -26,11 +26,11 @@ #include "chrome/browser/upgrade_detector/upgrade_observer.h" #include "components/prefs/pref_member.h" #include "ui/base/accelerators/accelerator.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/pointer/touch_ui_controller.h" #include "ui/views/accessible_pane_view.h" #include "ui/views/animation/animation_delegate_views.h" #include "ui/views/controls/button/menu_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "url/origin.h"
diff --git a/chrome/browser/ui/views/toolbar/webui_tab_counter_button.cc b/chrome/browser/ui/views/toolbar/webui_tab_counter_button.cc index 5b7d8c4..aa0e7a9 100644 --- a/chrome/browser/ui/views/toolbar/webui_tab_counter_button.cc +++ b/chrome/browser/ui/views/toolbar/webui_tab_counter_button.cc
@@ -29,6 +29,8 @@ #include "components/vector_icons/vector_icons.h" #include "ui/aura/window.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/base/models/menu_separator_types.h" #include "ui/base/models/simple_menu_model.h" @@ -54,8 +56,6 @@ #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/native_widget.h"
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chrome/browser/ui/views/translate/translate_bubble_view.cc index 1fcb2d15..0093e1f 100644 --- a/chrome/browser/ui/views/translate/translate_bubble_view.cc +++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc
@@ -45,6 +45,8 @@ #include "components/vector_icons/vector_icons.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/combobox_model.h" #include "ui/base/models/simple_combobox_model.h" #include "ui/base/resource/resource_bundle.h" @@ -69,8 +71,6 @@ #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/translate/translate_icon_view.cc b/chrome/browser/ui/views/translate/translate_icon_view.cc index 5313f10..0c5bc29 100644 --- a/chrome/browser/ui/views/translate/translate_icon_view.cc +++ b/chrome/browser/ui/views/translate/translate_icon_view.cc
@@ -18,8 +18,8 @@ #include "components/translate/core/browser/translate_manager.h" #include "components/translate/core/browser/translate_metrics_logger.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/views/metadata/metadata_impl_macros.h" TranslateIconView::TranslateIconView( CommandUpdater* command_updater,
diff --git a/chrome/browser/ui/views/translate/translate_icon_view.h b/chrome/browser/ui/views/translate/translate_icon_view.h index 696040ac..d081afcf 100644 --- a/chrome/browser/ui/views/translate/translate_icon_view.h +++ b/chrome/browser/ui/views/translate/translate_icon_view.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_ICON_VIEW_H_ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" class CommandUpdater;
diff --git a/chrome/browser/ui/views/try_chrome_dialog_win/try_chrome_dialog.cc b/chrome/browser/ui/views/try_chrome_dialog_win/try_chrome_dialog.cc index 31e9a1f0..32d6ca2 100644 --- a/chrome/browser/ui/views/try_chrome_dialog_win/try_chrome_dialog.cc +++ b/chrome/browser/ui/views/try_chrome_dialog_win/try_chrome_dialog.cc
@@ -34,6 +34,8 @@ #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/display/win/screen_win.h" @@ -64,8 +66,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_removals_observer.h"
diff --git a/chrome/browser/ui/views/uninstall_view.cc b/chrome/browser/ui/views/uninstall_view.cc index a7fe0631..9b0aa417 100644 --- a/chrome/browser/ui/views/uninstall_view.cc +++ b/chrome/browser/ui/views/uninstall_view.cc
@@ -14,11 +14,11 @@ #include "chrome/grit/chromium_strings.h" #include "chrome/installer/util/shell_util.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/combobox/combobox.h" #include "ui/views/controls/label.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" UninstallView::UninstallView(int* user_selection,
diff --git a/chrome/browser/ui/views/uninstall_view.h b/chrome/browser/ui/views/uninstall_view.h index 1d03889a..3b7ab11 100644 --- a/chrome/browser/ui/views/uninstall_view.h +++ b/chrome/browser/ui/views/uninstall_view.h
@@ -11,8 +11,8 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/combobox_model.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace views {
diff --git a/chrome/browser/ui/views/user_education/feature_promo_bubble_view.cc b/chrome/browser/ui/views/user_education/feature_promo_bubble_view.cc index 1c05af46..489f0d9 100644 --- a/chrome/browser/ui/views/user_education/feature_promo_bubble_view.cc +++ b/chrome/browser/ui/views/user_education/feature_promo_bubble_view.cc
@@ -18,6 +18,8 @@ #include "chrome/grit/generated_resources.h" #include "components/variations/variations_associated_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/theme_provider.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" @@ -36,8 +38,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/style/typography.h" #include "ui/views/view_class_properties.h"
diff --git a/chrome/browser/ui/views/user_education/feature_promo_bubble_view.h b/chrome/browser/ui/views/user_education/feature_promo_bubble_view.h index 4f88f0f..ab90d53f 100644 --- a/chrome/browser/ui/views/user_education/feature_promo_bubble_view.h +++ b/chrome/browser/ui/views/user_education/feature_promo_bubble_view.h
@@ -11,9 +11,9 @@ #include "base/optional.h" #include "chrome/browser/ui/views/user_education/feature_promo_bubble_params.h" #include "chrome/browser/ui/views/user_education/feature_promo_bubble_timeout.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace ui { class MouseEvent;
diff --git a/chrome/browser/ui/views/user_education/feature_promo_controller_views.cc b/chrome/browser/ui/views/user_education/feature_promo_controller_views.cc index a241169..55c77026 100644 --- a/chrome/browser/ui/views/user_education/feature_promo_controller_views.cc +++ b/chrome/browser/ui/views/user_education/feature_promo_controller_views.cc
@@ -165,7 +165,8 @@ DCHECK_EQ(&iph_feature, current_iph_feature_); DCHECK(promo_bubble_); - widget_observer_.Remove(promo_bubble_->GetWidget()); + DCHECK(widget_observation_.IsObservingSource(promo_bubble_->GetWidget())); + widget_observation_.Reset(); promo_bubble_->GetWidget()->Close(); promo_bubble_ = nullptr; @@ -314,7 +315,7 @@ promo_bubble_ = FeaturePromoBubbleView::Create(std::move(create_params)); - widget_observer_.Add(promo_bubble_->GetWidget()); + widget_observation_.Observe(promo_bubble_->GetWidget()); } void FeaturePromoControllerViews::HandleBubbleClosed() { @@ -326,7 +327,8 @@ DCHECK_NE(current_iph_feature_ != nullptr, current_critical_promo_.has_value()); - widget_observer_.Remove(promo_bubble_->GetWidget()); + DCHECK(widget_observation_.IsObservingSource(promo_bubble_->GetWidget())); + widget_observation_.Reset(); promo_bubble_ = nullptr; if (anchor_view_tracker_.view())
diff --git a/chrome/browser/ui/views/user_education/feature_promo_controller_views.h b/chrome/browser/ui/views/user_education/feature_promo_controller_views.h index d2ff890..187e5d6 100644 --- a/chrome/browser/ui/views/user_education/feature_promo_controller_views.h +++ b/chrome/browser/ui/views/user_education/feature_promo_controller_views.h
@@ -9,7 +9,7 @@ #include "base/memory/weak_ptr.h" #include "base/optional.h" -#include "base/scoped_observer.h" +#include "base/scoped_observation.h" #include "base/token.h" #include "chrome/browser/ui/user_education/feature_promo_controller.h" #include "ui/views/view_tracker.h" @@ -154,7 +154,8 @@ bool promos_blocked_for_testing_ = false; - ScopedObserver<views::Widget, views::WidgetObserver> widget_observer_{this}; + base::ScopedObservation<views::Widget, views::WidgetObserver> + widget_observation_{this}; base::WeakPtrFactory<FeaturePromoControllerViews> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/ui/views/user_education/new_badge_label.cc b/chrome/browser/ui/views/user_education/new_badge_label.cc index a2c042f..90d90e0b 100644 --- a/chrome/browser/ui/views/user_education/new_badge_label.cc +++ b/chrome/browser/ui/views/user_education/new_badge_label.cc
@@ -5,10 +5,10 @@ #include "chrome/browser/ui/views/user_education/new_badge_label.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/text_utils.h" #include "ui/views/border.h" #include "ui/views/controls/menu/new_badge.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/metadata/type_conversion.h" #include "ui/views/view.h" #include "ui/views/view_class_properties.h"
diff --git a/chrome/browser/ui/views/user_education/tip_marquee_view.cc b/chrome/browser/ui/views/user_education/tip_marquee_view.cc index a8d544c..788d87d 100644 --- a/chrome/browser/ui/views/user_education/tip_marquee_view.cc +++ b/chrome/browser/ui/views/user_education/tip_marquee_view.cc
@@ -13,6 +13,8 @@ #include "chrome/grit/theme_resources.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/theme_provider.h" #include "ui/gfx/geometry/insets.h" @@ -28,8 +30,6 @@ #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" #include "ui/views/layout/layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view_class_properties.h"
diff --git a/chrome/browser/ui/views/user_education/tip_marquee_view.h b/chrome/browser/ui/views/user_education/tip_marquee_view.h index e82fc10..3dbc3223 100644 --- a/chrome/browser/ui/views/user_education/tip_marquee_view.h +++ b/chrome/browser/ui/views/user_education/tip_marquee_view.h
@@ -8,9 +8,9 @@ #include "base/callback.h" #include "base/callback_forward.h" #include "base/scoped_observation.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/canvas.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view.h" #include "ui/views/view_observer.h"
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.cc b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.cc index b299343..d7a6d7f1 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.cc +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.cc
@@ -5,10 +5,10 @@ #include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.h" #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/custom_frame_view.h" #include "ui/views/window/hit_test_utils.h"
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.h b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.h index d7e495e46..502ae15a 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.h +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_content_settings_container.h
@@ -10,7 +10,7 @@ #include "chrome/browser/ui/views/location_bar/content_setting_image_view.h" #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class WebAppContentSettingsContainer : public views::View {
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_view.cc b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_view.cc index d2924108..36693874 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_view.cc +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_view.cc
@@ -19,8 +19,8 @@ #include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.h" #include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.h" #include "chrome/browser/ui/web_applications/app_browser_controller.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_utils.h" WebAppFrameToolbarView::WebAppFrameToolbarView(views::Widget* widget,
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_view.h b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_view.h index d62af4b..7912499f 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_view.h +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_view.h
@@ -12,9 +12,9 @@ #include "build/build_config.h" #include "chrome/browser/ui/views/frame/toolbar_button_provider.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/color_palette.h" #include "ui/views/accessible_pane_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view_targeter_delegate.h" namespace views {
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.cc b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.cc index c924e36..0c63c5fe9 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.cc +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.cc
@@ -18,12 +18,12 @@ #include "chrome/grit/generated_resources.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/border.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/window/hit_test_utils.h" @@ -109,5 +109,5 @@ } BEGIN_METADATA(WebAppMenuButton, AppMenuButton) -ADD_PROPERTY_METADATA(SkColor, Color, views::metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, Color, ui::metadata::SkColorConverter) END_METADATA
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.h b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.h index 2910d272..70810009 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.h +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_menu_button.h
@@ -11,8 +11,8 @@ #include "chrome/browser/ui/views/frame/app_menu_button.h" #include "chrome/browser/ui/web_applications/web_app_menu_model.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/color_palette.h" -#include "ui/views/metadata/metadata_header_macros.h" class BrowserView;
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.cc b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.cc index c9fcd10..b1e83cd 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.cc +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.cc
@@ -17,11 +17,11 @@ #include "chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_utils.h" #include "chrome/browser/ui/web_applications/system_web_app_ui_utils.h" #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/vector_icon_types.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/hit_test_utils.h" #if defined(OS_WIN)
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.h b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.h index fbe0c09..cd3a857 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.h +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.h
@@ -7,7 +7,7 @@ #include "chrome/browser/command_observer.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace {
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_origin_text.cc b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_origin_text.cc index ee95048..0697d95 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_origin_text.cc +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_origin_text.cc
@@ -12,13 +12,13 @@ #include "chrome/browser/ui/web_applications/app_browser_controller.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_element.h" #include "ui/compositor/layer_animation_sequence.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_origin_text.h b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_origin_text.h index b339b5a3..41514bf 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_origin_text.h +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_origin_text.h
@@ -8,7 +8,7 @@ #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class Browser;
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.cc b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.cc index a9e0538..1a03b27 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.cc +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.cc
@@ -22,8 +22,8 @@ #include "chrome/browser/ui/web_applications/system_web_app_ui_utils.h" #include "chrome/common/chrome_features.h" #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/hit_test_utils.h" namespace {
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.h b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.h index 2fd6a673..6032b5c 100644 --- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.h +++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.h
@@ -13,8 +13,8 @@ #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" #include "chrome/browser/ui/web_applications/web_app_menu_model.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_observer.h"
diff --git a/chrome/browser/ui/views/web_apps/web_app_confirmation_view.cc b/chrome/browser/ui/views/web_apps/web_app_confirmation_view.cc index 9be95d9..e0cb657 100644 --- a/chrome/browser/ui/views/web_apps/web_app_confirmation_view.cc +++ b/chrome/browser/ui/views/web_apps/web_app_confirmation_view.cc
@@ -22,6 +22,7 @@ #include "content/public/browser/web_contents.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image_skia.h" #include "ui/views/controls/button/checkbox.h" @@ -29,7 +30,6 @@ #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace {
diff --git a/chrome/browser/ui/views/web_apps/web_app_confirmation_view.h b/chrome/browser/ui/views/web_apps/web_app_confirmation_view.h index 9eef350..bf2dc70 100644 --- a/chrome/browser/ui/views/web_apps/web_app_confirmation_view.h +++ b/chrome/browser/ui/views/web_apps/web_app_confirmation_view.h
@@ -10,8 +10,8 @@ #include "base/macros.h" #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/web_applications/components/web_application_info.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/textfield/textfield_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace views {
diff --git a/chrome/browser/ui/views/web_apps/web_app_protocol_handler_intent_picker_dialog_view.cc b/chrome/browser/ui/views/web_apps/web_app_protocol_handler_intent_picker_dialog_view.cc index 9ca5657..fee1e6e 100644 --- a/chrome/browser/ui/views/web_apps/web_app_protocol_handler_intent_picker_dialog_view.cc +++ b/chrome/browser/ui/views/web_apps/web_app_protocol_handler_intent_picker_dialog_view.cc
@@ -27,6 +27,7 @@ #include "components/url_formatter/elide_url.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/size.h" #include "ui/views/border.h" #include "ui/views/controls/button/checkbox.h" @@ -34,7 +35,6 @@ #include "ui/views/controls/separator.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/web_apps/web_app_protocol_handler_intent_picker_dialog_view.h b/chrome/browser/ui/views/web_apps/web_app_protocol_handler_intent_picker_dialog_view.h index 541450d9..e37a948 100644 --- a/chrome/browser/ui/views/web_apps/web_app_protocol_handler_intent_picker_dialog_view.h +++ b/chrome/browser/ui/views/web_apps/web_app_protocol_handler_intent_picker_dialog_view.h
@@ -12,8 +12,8 @@ #include "base/callback_forward.h" #include "base/command_line.h" #include "components/keep_alive_registry/scoped_keep_alive.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/size.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_view.cc b/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_view.cc index 98625a2..0bef2dc 100644 --- a/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_view.cc +++ b/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_view.cc
@@ -28,13 +28,13 @@ #include "content/public/browser/clear_site_data_utils.h" #include "extensions/browser/extension_dialog_auto_confirm.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/image/image_skia.h" #include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_view.h b/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_view.h index d713d057..28d3e32a 100644 --- a/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_view.h +++ b/chrome/browser/ui/views/web_apps/web_app_uninstall_dialog_view.h
@@ -18,9 +18,9 @@ #include "chrome/browser/web_applications/components/app_registrar_observer.h" #include "chrome/browser/web_applications/components/web_app_id.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/native_widget_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/views/webauthn/authenticator_client_pin_entry_view.cc b/chrome/browser/ui/views/webauthn/authenticator_client_pin_entry_view.cc index d36b2d0..b6eac01 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_client_pin_entry_view.cc +++ b/chrome/browser/ui/views/webauthn/authenticator_client_pin_entry_view.cc
@@ -12,13 +12,13 @@ #include "chrome/browser/ui/views/chrome_typography.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" namespace {
diff --git a/chrome/browser/ui/views/webauthn/authenticator_client_pin_entry_view.h b/chrome/browser/ui/views/webauthn/authenticator_client_pin_entry_view.h index 376e234b3..339f6e9 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_client_pin_entry_view.h +++ b/chrome/browser/ui/views/webauthn/authenticator_client_pin_entry_view.h
@@ -8,8 +8,8 @@ #include <string> #include "base/optional.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/textfield/textfield_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/webauthn/authenticator_qr_sheet_view.cc b/chrome/browser/ui/views/webauthn/authenticator_qr_sheet_view.cc index 17e301f..c54035a 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_qr_sheet_view.cc +++ b/chrome/browser/ui/views/webauthn/authenticator_qr_sheet_view.cc
@@ -9,10 +9,10 @@ #include "base/strings/string_piece.h" #include "components/qr_code_generator/dino_image.h" #include "components/qr_code_generator/qr_code_generator.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" using QRCode = QRCodeGenerator;
diff --git a/chrome/browser/ui/views/webauthn/authenticator_request_dialog_view.cc b/chrome/browser/ui/views/webauthn/authenticator_request_dialog_view.cc index d336733..cc948a8 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_request_dialog_view.cc +++ b/chrome/browser/ui/views/webauthn/authenticator_request_dialog_view.cc
@@ -19,12 +19,12 @@ #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/border.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" // static
diff --git a/chrome/browser/ui/views/webauthn/authenticator_request_dialog_view.h b/chrome/browser/ui/views/webauthn/authenticator_request_dialog_view.h index a8156a3..1023f83 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_request_dialog_view.h +++ b/chrome/browser/ui/views/webauthn/authenticator_request_dialog_view.h
@@ -11,8 +11,8 @@ #include "base/macros.h" #include "chrome/browser/webauthn/authenticator_request_dialog_model.h" #include "content/public/browser/web_contents_observer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/menu/menu_runner.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace content {
diff --git a/chrome/browser/ui/views/webauthn/authenticator_request_sheet_view.cc b/chrome/browser/ui/views/webauthn/authenticator_request_sheet_view.cc index 356dbac..021cf9b 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_request_sheet_view.cc +++ b/chrome/browser/ui/views/webauthn/authenticator_request_sheet_view.cc
@@ -15,6 +15,7 @@ #include "components/strings/grit/components_strings.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/native_theme/native_theme.h" @@ -24,7 +25,6 @@ #include "ui/views/controls/progress_bar.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/webauthn/authenticator_request_sheet_view.h b/chrome/browser/ui/views/webauthn/authenticator_request_sheet_view.h index fca5726..8028933 100644 --- a/chrome/browser/ui/views/webauthn/authenticator_request_sheet_view.h +++ b/chrome/browser/ui/views/webauthn/authenticator_request_sheet_view.h
@@ -10,8 +10,8 @@ #include <utility> #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/chrome/browser/ui/views/webauthn/hover_list_view.cc b/chrome/browser/ui/views/webauthn/hover_list_view.cc index a770a86e..6076af8 100644 --- a/chrome/browser/ui/views/webauthn/hover_list_view.cc +++ b/chrome/browser/ui/views/webauthn/hover_list_view.cc
@@ -12,6 +12,7 @@ #include "chrome/browser/ui/views/chrome_typography.h" #include "chrome/browser/ui/views/webauthn/webauthn_hover_button.h" #include "components/vector_icons/vector_icons.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/insets.h" @@ -24,7 +25,6 @@ #include "ui/views/controls/throbber.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace {
diff --git a/chrome/browser/ui/views/webauthn/hover_list_view.h b/chrome/browser/ui/views/webauthn/hover_list_view.h index 9feb5d0..efcf12db 100644 --- a/chrome/browser/ui/views/webauthn/hover_list_view.h +++ b/chrome/browser/ui/views/webauthn/hover_list_view.h
@@ -11,8 +11,8 @@ #include "base/optional.h" #include "chrome/browser/ui/webauthn/hover_list_model.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/scroll_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace gfx {
diff --git a/chrome/browser/ui/views/webauthn/ring_progress_bar.cc b/chrome/browser/ui/views/webauthn/ring_progress_bar.cc index df89660..6e6ea4b 100644 --- a/chrome/browser/ui/views/webauthn/ring_progress_bar.cc +++ b/chrome/browser/ui/views/webauthn/ring_progress_bar.cc
@@ -8,12 +8,12 @@ #include "third_party/skia/include/core/SkPath.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/skia_util.h" #include "ui/native_theme/native_theme.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace { constexpr float kStrokeWidth = 4;
diff --git a/chrome/browser/ui/views/webauthn/ring_progress_bar.h b/chrome/browser/ui/views/webauthn/ring_progress_bar.h index 910fa00..0dec287f 100644 --- a/chrome/browser/ui/views/webauthn/ring_progress_bar.h +++ b/chrome/browser/ui/views/webauthn/ring_progress_bar.h
@@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_WEBAUTHN_RING_PROGRESS_BAR_H_ #define CHROME_BROWSER_UI_VIEWS_WEBAUTHN_RING_PROGRESS_BAR_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/animation/animation_delegate.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace gfx {
diff --git a/chrome/browser/ui/views/webauthn/webauthn_hover_button.cc b/chrome/browser/ui/views/webauthn/webauthn_hover_button.cc index ca815a6..feb8929 100644 --- a/chrome/browser/ui/views/webauthn/webauthn_hover_button.cc +++ b/chrome/browser/ui/views/webauthn/webauthn_hover_button.cc
@@ -6,13 +6,13 @@ #include "base/strings/string_util.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" namespace {
diff --git a/chrome/browser/ui/views/webauthn/webauthn_hover_button.h b/chrome/browser/ui/views/webauthn/webauthn_hover_button.h index 20292e062..3eee4f0 100644 --- a/chrome/browser/ui/views/webauthn/webauthn_hover_button.h +++ b/chrome/browser/ui/views/webauthn/webauthn_hover_button.h
@@ -9,7 +9,7 @@ #include <string> #include "chrome/browser/ui/views/hover_button.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" namespace views { class ImageView;
diff --git a/chrome/browser/ui/views/webauthn/webauthn_icon_view.cc b/chrome/browser/ui/views/webauthn/webauthn_icon_view.cc index 84fff04..8842a77a 100644 --- a/chrome/browser/ui/views/webauthn/webauthn_icon_view.cc +++ b/chrome/browser/ui/views/webauthn/webauthn_icon_view.cc
@@ -18,8 +18,8 @@ #include "components/vector_icons/vector_icons.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" -#include "ui/views/metadata/metadata_impl_macros.h" WebAuthnIconView::WebAuthnIconView( CommandUpdater* command_updater,
diff --git a/chrome/browser/ui/views/webauthn/webauthn_icon_view.h b/chrome/browser/ui/views/webauthn/webauthn_icon_view.h index b55b05c..19ab710 100644 --- a/chrome/browser/ui/views/webauthn/webauthn_icon_view.h +++ b/chrome/browser/ui/views/webauthn/webauthn_icon_view.h
@@ -8,7 +8,7 @@ #include "base/containers/flat_map.h" #include "chrome/browser/ui/views/page_action/page_action_icon_view.h" #include "chrome/browser/webauthn/authenticator_request_dialog_model.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_observer.h" class WebAuthnBubbleView;
diff --git a/chrome/browser/ui/views/webid/webid_dialog_views.cc b/chrome/browser/ui/views/webid/webid_dialog_views.cc index 8f41f140..2ab6bd8 100644 --- a/chrome/browser/ui/views/webid/webid_dialog_views.cc +++ b/chrome/browser/ui/views/webid/webid_dialog_views.cc
@@ -10,12 +10,12 @@ #include "chrome/browser/ui/views/webid/webid_permission_view.h" #include "chrome/browser/ui/views/webid/webid_signin_page_view.h" #include "components/constrained_window/constrained_window_views.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/views/webid/webid_dialog_views.h b/chrome/browser/ui/views/webid/webid_dialog_views.h index b02b4cf1..f498486 100644 --- a/chrome/browser/ui/views/webid/webid_dialog_views.h +++ b/chrome/browser/ui/views/webid/webid_dialog_views.h
@@ -7,8 +7,8 @@ #include "chrome/browser/ui/webid/webid_dialog.h" #include "content/public/browser/identity_request_dialog_controller.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chrome/browser/ui/views/webid/webid_signin_page_view.cc b/chrome/browser/ui/views/webid/webid_signin_page_view.cc index 4eac851..c3d3240 100644 --- a/chrome/browser/ui/views/webid/webid_signin_page_view.cc +++ b/chrome/browser/ui/views/webid/webid_signin_page_view.cc
@@ -9,6 +9,8 @@ #include "content/public/browser/navigation_entry.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/border.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/bubble/bubble_frame_view.h" @@ -19,8 +21,6 @@ #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/dialog_delegate.h" // Dimensions of the dialog itself.
diff --git a/chrome/browser/ui/views/webid/webid_signin_page_view.h b/chrome/browser/ui/views/webid/webid_signin_page_view.h index fe7f823..50b2515 100644 --- a/chrome/browser/ui/views/webid/webid_signin_page_view.h +++ b/chrome/browser/ui/views/webid/webid_signin_page_view.h
@@ -11,7 +11,7 @@ #include "base/callback.h" #include "chrome/browser/ui/views/webid/webid_dialog_views.h" #include "content/public/browser/web_contents_observer.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" class GURL;
diff --git a/chrome/browser/ui/webauthn/sheet_models.cc b/chrome/browser/ui/webauthn/sheet_models.cc index 33548b91..7c8692cb 100644 --- a/chrome/browser/ui/webauthn/sheet_models.cc +++ b/chrome/browser/ui/webauthn/sheet_models.cc
@@ -582,7 +582,7 @@ if (dialog_model()->cable_should_suggest_usb()) { return l10n_util::GetStringFUTF16( IDS_WEBAUTHN_CABLEV2_SERVERLINK_DESCRIPTION, - GetRelyingPartyIdString(dialog_model()), std::u16string()); + GetRelyingPartyIdString(dialog_model())); } return l10n_util::GetStringUTF16(IDS_WEBAUTHN_CABLE_ACTIVATE_DESCRIPTION);
diff --git a/chrome/browser/ui/webui/chromeos/add_supervision/confirm_signout_dialog.cc b/chrome/browser/ui/webui/chromeos/add_supervision/confirm_signout_dialog.cc index e13d1ae..b66aef2 100644 --- a/chrome/browser/ui/webui/chromeos/add_supervision/confirm_signout_dialog.cc +++ b/chrome/browser/ui/webui/chromeos/add_supervision/confirm_signout_dialog.cc
@@ -12,13 +12,13 @@ #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/resources/grit/ui_resources.h" #include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/chrome/browser/ui/webui/chromeos/add_supervision/confirm_signout_dialog.h b/chrome/browser/ui/webui/chromeos/add_supervision/confirm_signout_dialog.h index 8e969c4..7ed7cf2 100644 --- a/chrome/browser/ui/webui/chromeos/add_supervision/confirm_signout_dialog.h +++ b/chrome/browser/ui/webui/chromeos/add_supervision/confirm_signout_dialog.h
@@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_ADD_SUPERVISION_CONFIRM_SIGNOUT_DIALOG_H_ #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/dialog_delegate.h" namespace views {
diff --git a/chrome/browser/ui/webui/chromeos/cellular_setup/cellular_setup_dialog_launcher.cc b/chrome/browser/ui/webui/chromeos/cellular_setup/cellular_setup_dialog_launcher.cc index c212f68c..74b535582 100644 --- a/chrome/browser/ui/webui/chromeos/cellular_setup/cellular_setup_dialog_launcher.cc +++ b/chrome/browser/ui/webui/chromeos/cellular_setup/cellular_setup_dialog_launcher.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/ui/webui/chromeos/cellular_setup/cellular_setup_dialog_launcher.h" #include "ash/constants/ash_features.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/browser/ui/webui/chromeos/cellular_setup/mobile_setup_dialog.h" namespace chromeos { @@ -14,7 +14,8 @@ void OpenCellularSetupDialog(const std::string& cellular_network_guid) { if (chromeos::features::IsCellularActivationUiEnabled()) - SystemTrayClient::Get()->ShowSettingsCellularSetup(/*show_psim_flow=*/true); + SystemTrayClientImpl::Get()->ShowSettingsCellularSetup( + /*show_psim_flow=*/true); else MobileSetupDialog::ShowByNetworkId(cellular_network_guid); }
diff --git a/chrome/browser/ui/webui/chromeos/edu_account_login_handler_unittest.cc b/chrome/browser/ui/webui/chromeos/edu_account_login_handler_unittest.cc index 8b17f94a..f74989ab 100644 --- a/chrome/browser/ui/webui/chromeos/edu_account_login_handler_unittest.cc +++ b/chrome/browser/ui/webui/chromeos/edu_account_login_handler_unittest.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" #include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state_handler.h" #include "components/image_fetcher/core/mock_image_fetcher.h" #include "components/image_fetcher/core/request_metadata.h" @@ -168,8 +169,7 @@ EduAccountLoginHandlerTest() = default; void SetUp() override { - shill_clients::InitializeFakes(); - NetworkHandler::Initialize(); + network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>(); base::RunLoop().RunUntilIdle(); } @@ -203,8 +203,7 @@ void TearDown() override { handler_.reset(); network_portal_detector::InitializeForTesting(nullptr); - chromeos::NetworkHandler::Shutdown(); - chromeos::shill_clients::Shutdown(); + network_handler_test_helper_.reset(); } void VerifyJavascriptCallbackResolved( @@ -235,6 +234,7 @@ std::unique_ptr<image_fetcher::MockImageFetcher> mock_image_fetcher_; std::unique_ptr<MockEduAccountLoginHandler> handler_; content::TestWebUI web_ui_; + std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_; }; TEST_F(EduAccountLoginHandlerTest, HandleGetParentsSuccess) {
diff --git a/chrome/browser/ui/webui/chromeos/login/supervision_transition_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/supervision_transition_screen_handler.cc index c1ac2f3..563f96c 100644 --- a/chrome/browser/ui/webui/chromeos/login/supervision_transition_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/supervision_transition_screen_handler.cc
@@ -15,7 +15,7 @@ #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/ash/system_tray_client.h" +#include "chrome/browser/ui/ash/system_tray_client_impl.h" #include "chrome/grit/generated_resources.h" #include "components/arc/arc_prefs.h" #include "components/login/localized_values_builder.h" @@ -102,7 +102,7 @@ // Disable system tray, shutdown button and prevent login as guest when // supervision transition screen is shown. - SystemTrayClient::Get()->SetPrimaryTrayEnabled(false); + SystemTrayClientImpl::Get()->SetPrimaryTrayEnabled(false); ash::LoginScreen::Get()->EnableShutdownButton(false); ash::LoginScreen::Get()->SetAllowLoginAsGuest(false); ash::LoginScreen::Get()->SetIsFirstSigninStep(false); @@ -148,7 +148,7 @@ // RegisterMessages()). Once this screen exits, user session will be started, // so there's no need to re-enable shutdown button from login screen, only the // system tray. - SystemTrayClient::Get()->SetPrimaryTrayEnabled(true); + SystemTrayClientImpl::Get()->SetPrimaryTrayEnabled(true); if (screen_) screen_->OnSupervisionTransitionFinished();
diff --git a/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc b/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc index fd288f1..a7170a60 100644 --- a/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc
@@ -72,6 +72,10 @@ IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_MANAGED_WITH_CONNECTION_STATUS}, {"networkListItemLabelCellularManagedWithConnectionStatusAndProviderName", IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_MANAGED_WITH_CONNECTION_STATUS_AND_PROVIDER_NAME}, + {"networkListItemLabelCellularUnactivated", + IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_UNACTIVATED}, + {"networkListItemLabelCellularUnactivatedWithConnectionStatus", + IDS_NETWORK_LIST_ITEM_LABEL_CELLULAR_UNACTIVATED_WITH_CONNECTION_STATUS}, {"networkListItemLabelWifiWithConnectionStatus", IDS_NETWORK_LIST_ITEM_LABEL_WIFI_WITH_CONNECTION_STATUS}, {"networkListItemLabelWifiManagedWithConnectionStatus",
diff --git a/chrome/browser/ui/webui/chromeos/network_ui.cc b/chrome/browser/ui/webui/chromeos/network_ui.cc index 324fc48..b98873e 100644 --- a/chrome/browser/ui/webui/chromeos/network_ui.cc +++ b/chrome/browser/ui/webui/chromeos/network_ui.cc
@@ -32,6 +32,7 @@ #include "chrome/grit/network_ui_resources_map.h" #include "chromeos/components/network_ui/network_diagnostics_resource_provider.h" #include "chromeos/components/network_ui/network_health_resource_provider.h" +#include "chromeos/network/cellular_esim_profile_handler_impl.h" #include "chromeos/network/device_state.h" #include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_device_handler.h" @@ -62,6 +63,7 @@ constexpr char kGetDeviceProperties[] = "getShillDeviceProperties"; constexpr char kGetEthernetEAP[] = "getShillEthernetEAP"; constexpr char kOpenCellularActivationUi[] = "openCellularActivationUi"; +constexpr char kResetESimCache[] = "resetESimCache"; constexpr char kShowNetworkDetails[] = "showNetworkDetails"; constexpr char kShowNetworkConfig[] = "showNetworkConfig"; constexpr char kShowAddNewWifiNetworkDialog[] = "showAddNewWifi"; @@ -101,6 +103,31 @@ dictionary->SetKey(shill::kDeviceProperty, std::move(device_dictionary)); } +class NetworkDiagnosticsMessageHandler : public content::WebUIMessageHandler { + public: + NetworkDiagnosticsMessageHandler() = default; + ~NetworkDiagnosticsMessageHandler() override = default; + + void RegisterMessages() override { + web_ui()->RegisterMessageCallback( + "OpenFeedbackDialog", + base::BindRepeating( + &NetworkDiagnosticsMessageHandler::OpenFeedbackDialog, + base::Unretained(this))); + } + + private: + void OpenFeedbackDialog(const base::ListValue* value) { + const std::string result = value->GetList()[0].GetString(); + chrome::ShowFeedbackPage(nullptr, chrome::kFeedbackSourceNetworkHealthPage, + "" /*description_template*/, + "" /*description_template_placeholder*/, + "network-health", result); + } +}; + +} // namespace + class NetworkConfigMessageHandler : public content::WebUIMessageHandler { public: NetworkConfigMessageHandler() {} @@ -132,6 +159,10 @@ &NetworkConfigMessageHandler::OpenCellularActivationUi, base::Unretained(this))); web_ui()->RegisterMessageCallback( + kResetESimCache, + base::BindRepeating(&NetworkConfigMessageHandler::ResetESimCache, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( kShowNetworkDetails, base::BindRepeating(&NetworkConfigMessageHandler::ShowNetworkDetails, base::Unretained(this))); @@ -256,6 +287,17 @@ Respond(callback_id, response); } + void ResetESimCache(const base::ListValue* arg_list) { + CellularESimProfileHandler* handler = + NetworkHandler::Get()->cellular_esim_profile_handler(); + if (!handler) + return; + + CellularESimProfileHandlerImpl* handler_impl = + static_cast<CellularESimProfileHandlerImpl*>(handler); + handler_impl->ResetESimProfileCache(); + } + void ShowNetworkDetails(const base::ListValue* arg_list) { CHECK_EQ(1u, arg_list->GetSize()); std::string guid; @@ -346,31 +388,6 @@ DISALLOW_COPY_AND_ASSIGN(NetworkConfigMessageHandler); }; -class NetworkDiagnosticsMessageHandler : public content::WebUIMessageHandler { - public: - NetworkDiagnosticsMessageHandler() = default; - ~NetworkDiagnosticsMessageHandler() override = default; - - void RegisterMessages() override { - web_ui()->RegisterMessageCallback( - "OpenFeedbackDialog", - base::BindRepeating( - &NetworkDiagnosticsMessageHandler::OpenFeedbackDialog, - base::Unretained(this))); - } - - private: - void OpenFeedbackDialog(const base::ListValue* value) { - const std::string result = value->GetList()[0].GetString(); - chrome::ShowFeedbackPage(nullptr, chrome::kFeedbackSourceNetworkHealthPage, - "" /*description_template*/, - "" /*description_template_placeholder*/, - "network-health", result); - } -}; - -} // namespace - // static void NetworkUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) { localized_strings->SetString("titleText", @@ -456,6 +473,15 @@ l10n_util::GetStringUTF16(IDS_NETWORK_UI_NO_CELLULAR_ERROR_TEXT)); localized_strings->SetString( + "resetESimCacheLabel", + l10n_util::GetStringUTF16( + IDS_NETWORK_UI_RESET_ESIM_PROFILES_BUTTON_TEXT)); + localized_strings->SetString( + "resetESimCacheButtonText", + l10n_util::GetStringUTF16( + IDS_NETWORK_UI_RESET_ESIM_PROFILES_BUTTON_TEXT)); + + localized_strings->SetString( "addNewWifiLabel", l10n_util::GetStringUTF16(IDS_NETWORK_UI_ADD_NEW_WIFI_LABEL)); localized_strings->SetString(
diff --git a/chrome/browser/ui/webui/help/version_updater.h b/chrome/browser/ui/webui/help/version_updater.h index e62eeae..61f74c7 100644 --- a/chrome/browser/ui/webui/help/version_updater.h +++ b/chrome/browser/ui/webui/help/version_updater.h
@@ -33,6 +33,8 @@ FAILED, FAILED_OFFLINE, FAILED_CONNECTION_TYPE_DISALLOWED, + FAILED_HTTP, + FAILED_DOWNLOAD, DISABLED, DISABLED_BY_ADMIN };
diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos.cc b/chrome/browser/ui/webui/help/version_updater_chromeos.cc index 2655cf5c7..adf5ee9c 100644 --- a/chrome/browser/ui/webui/help/version_updater_chromeos.cc +++ b/chrome/browser/ui/webui/help/version_updater_chromeos.cc
@@ -296,10 +296,25 @@ case update_engine::Operation::ERROR: case update_engine::Operation::REPORTING_ERROR_EVENT: case update_engine::Operation::ATTEMPTING_ROLLBACK: - // This path previously used the FAILED status and IDS_UPGRADE_ERROR, but - // the update engine reports errors for some conditions that shouldn't - // actually be displayed as errors to users: http://crbug.com/146919. - // Just use the UPDATED status instead. + // Update engine reports errors for some conditions that shouldn't + // actually be displayed as errors to users so leave the status as + // UPDATED. However for some specific errors use the specific FAILED + // statuses. Last attempt error remains when update engine state is + // idle. + + if (status.last_attempt_error() == + static_cast<int32_t>( + update_engine::ErrorCode::kOmahaUpdateIgnoredPerPolicy)) { + my_status = DISABLED_BY_ADMIN; + } else if (status.last_attempt_error() == + static_cast<int32_t>( + update_engine::ErrorCode::kOmahaErrorInHTTPResponse)) { + my_status = FAILED_HTTP; + } else if (status.last_attempt_error() == + static_cast<int32_t>( + update_engine::ErrorCode::kDownloadTransferError)) { + my_status = FAILED_DOWNLOAD; + } break; case update_engine::Operation::CHECKING_FOR_UPDATE: my_status = CHECKING;
diff --git a/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc b/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc index 9a2737b7..4932d720 100644 --- a/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc +++ b/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc
@@ -17,7 +17,7 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_update_engine_client.h" #include "chromeos/dbus/shill/shill_service_client.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/user_manager/scoped_user_manager.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" @@ -66,13 +66,13 @@ .WillRepeatedly(Return(false)); EXPECT_CALL(*mock_user_manager_, Shutdown()).Times(AtLeast(0)); - NetworkHandler::Initialize(); + network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>(); base::RunLoop().RunUntilIdle(); } void SetEthernetService() { ShillServiceClient::TestInterface* service_test = - DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); + network_handler_test_helper_->service_test(); service_test->ClearServices(); service_test->AddService("/service/eth", "eth" /* guid */, @@ -84,7 +84,7 @@ void SetCellularService() { ShillServiceClient::TestInterface* service_test = - DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); + network_handler_test_helper_->service_test(); service_test->ClearServices(); service_test->AddService("/service/cell", "cell" /* guid */, "cell", shill::kTypeCellular, shill::kStateOnline, @@ -92,11 +92,10 @@ base::RunLoop().RunUntilIdle(); } - void TearDown() override { - NetworkHandler::Shutdown(); - } + void TearDown() override { network_handler_test_helper_.reset(); } content::BrowserTaskEnvironment task_environment_; + std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_; std::unique_ptr<VersionUpdater> version_updater_; VersionUpdaterCros* version_updater_cros_ptr_; FakeUpdateEngineClient* fake_update_engine_client_; // Not owned.
diff --git a/chrome/browser/ui/webui/management/management_ui_handler_unittest.cc b/chrome/browser/ui/webui/management/management_ui_handler_unittest.cc index baa4487..edab546 100644 --- a/chrome/browser/ui/webui/management/management_ui_handler_unittest.cc +++ b/chrome/browser/ui/webui/management/management_ui_handler_unittest.cc
@@ -65,6 +65,7 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/power_manager_client.h" #include "chromeos/dbus/shill/shill_service_client.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_metadata_store.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/proxy/proxy_config_handler.h" @@ -405,7 +406,8 @@ crostini_features_ = std::make_unique<crostini::FakeCrostiniFeatures>(); SetUpConnectManager(); - chromeos::NetworkHandler::Initialize(); + network_handler_test_helper_ = + std::make_unique<chromeos::NetworkHandlerTestHelper>(); chromeos::NetworkMetadataStore::RegisterPrefs(user_prefs_.registry()); // The |DeviceSettingsTestBase| setup above instantiates // |FakeShillManagerClient| with a default environment which will post @@ -414,7 +416,7 @@ base::RunLoop().RunUntilIdle(); } void TearDown() override { - chromeos::NetworkHandler::Shutdown(); + network_handler_test_helper_.reset(); TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); DeviceSettingsTestBase::TearDown(); } @@ -586,6 +588,8 @@ std::u16string device_domain_; ContextualManagementSourceUpdate extracted_; #if BUILDFLAG(IS_CHROMEOS_ASH) + std::unique_ptr<chromeos::NetworkHandlerTestHelper> + network_handler_test_helper_; std::unique_ptr<chromeos::ScopedStubInstallAttributes> install_attributes_; std::unique_ptr<crostini::FakeCrostiniFeatures> crostini_features_; TestingPrefServiceSimple local_state_;
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc index 1998e48..c8307a0e5 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
@@ -230,8 +230,6 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { static constexpr webui::LocalizedString kLocalizedStrings[] = { - {"accept", IDS_PRINT_PREVIEW_ACCEPT_INVITE}, - {"acceptForGroup", IDS_PRINT_PREVIEW_ACCEPT_GROUP_INVITE}, {"accountSelectTitle", IDS_PRINT_PREVIEW_ACCOUNT_SELECT_TITLE}, {"addAccountTitle", IDS_PRINT_PREVIEW_ADD_ACCOUNT_TITLE}, {"advancedSettingsDialogConfirm", @@ -256,7 +254,6 @@ {"extensionDestinationIconTooltip", IDS_PRINT_PREVIEW_EXTENSION_DESTINATION_ICON_TOOLTIP}, {"goBackButton", IDS_PRINT_PREVIEW_BUTTON_GO_BACK}, - {"groupPrinterSharingInviteText", IDS_PRINT_PREVIEW_GROUP_INVITE_TEXT}, {"invalidPrinterSettings", IDS_PRINT_PREVIEW_INVALID_PRINTER_SETTINGS}, {"layoutLabel", IDS_PRINT_PREVIEW_LAYOUT_LABEL}, {"learnMore", IDS_LEARN_MORE}, @@ -315,14 +312,14 @@ {"printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON}, {"printDestinationsTitle", IDS_PRINT_PREVIEW_PRINT_DESTINATIONS_TITLE}, {"printPagesLabel", IDS_PRINT_PREVIEW_PRINT_PAGES_LABEL}, +#if BUILDFLAG(IS_CHROMEOS_ASH) {"printToGoogleDrive", IDS_PRINT_PREVIEW_PRINT_TO_GOOGLE_DRIVE}, +#endif {"printToPDF", IDS_PRINT_PREVIEW_PRINT_TO_PDF}, - {"printerSharingInviteText", IDS_PRINT_PREVIEW_INVITE_TEXT}, {"printing", IDS_PRINT_PREVIEW_PRINTING}, {"recentDestinationsTitle", IDS_PRINT_PREVIEW_RECENT_DESTINATIONS_TITLE}, {"registerPrinterInformationMessage", IDS_CLOUD_PRINT_REGISTER_PRINTER_INFORMATION}, - {"reject", IDS_PRINT_PREVIEW_REJECT_INVITE}, {"resolveExtensionUSBDialogTitle", IDS_PRINT_PREVIEW_RESOLVE_EXTENSION_USB_DIALOG_TITLE}, {"resolveExtensionUSBErrorMessage",
diff --git a/chrome/browser/ui/webui/settings/about_handler.cc b/chrome/browser/ui/webui/settings/about_handler.cc index 8f73464..d16782fe 100644 --- a/chrome/browser/ui/webui/settings/about_handler.cc +++ b/chrome/browser/ui/webui/settings/about_handler.cc
@@ -234,6 +234,12 @@ case VersionUpdater::FAILED_CONNECTION_TYPE_DISALLOWED: status_str = "failed"; break; + case VersionUpdater::FAILED_HTTP: + status_str = "failed_http"; + break; + case VersionUpdater::FAILED_DOWNLOAD: + status_str = "failed_download"; + break; case VersionUpdater::DISABLED: status_str = "disabled"; break;
diff --git a/chrome/browser/ui/webui/settings/captions_handler.cc b/chrome/browser/ui/webui/settings/captions_handler.cc index 4952de26..144c91c 100644 --- a/chrome/browser/ui/webui/settings/captions_handler.cc +++ b/chrome/browser/ui/webui/settings/captions_handler.cc
@@ -12,6 +12,7 @@ #include "chrome/grit/generated_resources.h" #include "components/live_caption/pref_names.h" #include "components/prefs/pref_service.h" +#include "components/soda/constants.h" #include "content/public/browser/web_ui.h" #include "media/base/media_switches.h" #include "ui/base/l10n/l10n_util.h" @@ -59,11 +60,12 @@ #endif } -void CaptionsHandler::OnSodaInstalled() { - speech::SodaInstaller::GetInstance()->RemoveObserver(this); +void CaptionsHandler::OnSodaLanguagePackInstalled( + speech::LanguageCode language_code) { FireWebUIListener("soda-download-progress-changed", base::Value(l10n_util::GetStringUTF16( - IDS_SETTINGS_CAPTIONS_LIVE_CAPTION_DOWNLOAD_COMPLETE))); + IDS_SETTINGS_CAPTIONS_LIVE_CAPTION_DOWNLOAD_COMPLETE)), + base::Value(speech::GetLanguageName(language_code))); } void CaptionsHandler::OnSodaError() { @@ -73,14 +75,38 @@ FireWebUIListener("soda-download-progress-changed", base::Value(l10n_util::GetStringUTF16( - IDS_SETTINGS_CAPTIONS_LIVE_CAPTION_DOWNLOAD_ERROR))); + IDS_SETTINGS_CAPTIONS_LIVE_CAPTION_DOWNLOAD_ERROR)), + base::Value()); } -void CaptionsHandler::OnSodaProgress(int progress) { - FireWebUIListener( - "soda-download-progress-changed", - base::Value(l10n_util::GetStringFUTF16Int( - IDS_SETTINGS_CAPTIONS_LIVE_CAPTION_DOWNLOAD_PROGRESS, progress))); +void CaptionsHandler::OnSodaLanguagePackError( + speech::LanguageCode language_code) { + if (!base::FeatureList::IsEnabled(media::kLiveCaptionMultiLanguage)) { + prefs_->SetBoolean(prefs::kLiveCaptionEnabled, false); + } + + FireWebUIListener("soda-download-progress-changed", + base::Value(l10n_util::GetStringUTF16( + IDS_SETTINGS_CAPTIONS_LIVE_CAPTION_DOWNLOAD_ERROR)), + base::Value(speech::GetLanguageName(language_code))); +} + +void CaptionsHandler::OnSodaProgress(int combined_progress) { + FireWebUIListener("soda-download-progress-changed", + base::Value(l10n_util::GetStringFUTF16Int( + IDS_SETTINGS_CAPTIONS_LIVE_CAPTION_DOWNLOAD_PROGRESS, + combined_progress)), + base::Value()); +} + +void CaptionsHandler::OnSodaLanguagePackProgress( + int language_progress, + speech::LanguageCode language_code) { + FireWebUIListener("soda-download-progress-changed", + base::Value(l10n_util::GetStringFUTF16Int( + IDS_SETTINGS_CAPTIONS_LIVE_CAPTION_DOWNLOAD_PROGRESS, + language_progress)), + base::Value(speech::GetLanguageName(language_code))); } } // namespace settings
diff --git a/chrome/browser/ui/webui/settings/captions_handler.h b/chrome/browser/ui/webui/settings/captions_handler.h index 5bc1df6..7a280ba 100644 --- a/chrome/browser/ui/webui/settings/captions_handler.h +++ b/chrome/browser/ui/webui/settings/captions_handler.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CAPTIONS_HANDLER_H_ #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" +#include "components/soda/constants.h" #include "components/soda/soda_installer.h" class PrefService; @@ -31,9 +32,13 @@ void HandleOpenSystemCaptionsDialog(const base::ListValue* args); // SodaInstaller::Observer overrides: - void OnSodaInstalled() override; + void OnSodaInstalled() override {} + void OnSodaLanguagePackInstalled(speech::LanguageCode language_code) override; void OnSodaError() override; - void OnSodaProgress(int progress) override; + void OnSodaLanguagePackError(speech::LanguageCode language_code) override; + void OnSodaProgress(int combined_progress) override; + void OnSodaLanguagePackProgress(int language_progress, + speech::LanguageCode language_code) override; PrefService* prefs_; };
diff --git a/chrome/browser/ui/webui/settings/chromeos/about_section.cc b/chrome/browser/ui/webui/settings/chromeos/about_section.cc index 5533f8e..d4bac0c4 100644 --- a/chrome/browser/ui/webui/settings/chromeos/about_section.cc +++ b/chrome/browser/ui/webui/settings/chromeos/about_section.cc
@@ -281,6 +281,9 @@ {"aboutShowReleaseNotes", IDS_SETTINGS_ABOUT_PAGE_SHOW_RELEASE_NOTES}, {"aboutManagedEndOfLifeSubtitle", IDS_SETTINGS_ABOUT_PAGE_MANAGED_END_OF_LIFE_SUBTITLE}, + {"aboutUpgradeTryAgain", IDS_SETTINGS_UPGRADE_TRY_AGAIN}, + {"aboutUpgradeDownloadError", IDS_SETTINGS_UPGRADE_DOWNLOAD_ERROR}, + {"aboutUpgradeAdministrator", IDS_SETTINGS_UPGRADE_ADMINISTRATOR_ERROR}, }; html_source->AddLocalizedStrings(kLocalizedStrings);
diff --git a/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc b/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc index 6dd9a95f..900b6c4 100644 --- a/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc +++ b/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc
@@ -65,6 +65,10 @@ "manageA11yPageReady", base::BindRepeating(&AccessibilityHandler::HandleManageA11yPageReady, base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "showChromeVoxTutorial", + base::BindRepeating(&AccessibilityHandler::HandleShowChromeVoxTutorial, + base::Unretained(this))); } void AccessibilityHandler::HandleShowChromeVoxSettings( @@ -105,6 +109,11 @@ base::Value(AccessibilityManager::Get()->GetStartupSoundEnabled())); } +void AccessibilityHandler::HandleShowChromeVoxTutorial( + const base::ListValue* args) { + AccessibilityManager::Get()->ShowChromeVoxTutorial(); +} + void AccessibilityHandler::OpenExtensionOptionsPage(const char extension_id[]) { const extensions::Extension* extension = extensions::ExtensionRegistry::Get(profile_)->GetExtensionById(
diff --git a/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h b/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h index 99d6c40b..d6970af 100644 --- a/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h +++ b/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h
@@ -39,6 +39,7 @@ void HandleSetStartupSoundEnabled(const base::ListValue* args); void HandleRecordSelectedShowShelfNavigationButtonsValue( const base::ListValue* args); + void HandleShowChromeVoxTutorial(const base::ListValue* args); void OpenExtensionOptionsPage(const char extension_id[]);
diff --git a/chrome/browser/ui/webui/settings/chromeos/accessibility_section.cc b/chrome/browser/ui/webui/settings/chromeos/accessibility_section.cc index 828604bd..a21c4547 100644 --- a/chrome/browser/ui/webui/settings/chromeos/accessibility_section.cc +++ b/chrome/browser/ui/webui/settings/chromeos/accessibility_section.cc
@@ -444,6 +444,7 @@ {"stickyKeysLabel", IDS_SETTINGS_STICKY_KEYS_LABEL}, {"chromeVoxLabel", IDS_SETTINGS_CHROMEVOX_LABEL}, {"chromeVoxOptionsLabel", IDS_SETTINGS_CHROMEVOX_OPTIONS_LABEL}, + {"chromeVoxTutorialLabel", IDS_SETTINGS_CHROMEVOX_TUTORIAL_LABEL}, {"screenMagnifierLabel", IDS_SETTINGS_SCREEN_MAGNIFIER_LABEL}, {"screenMagnifierHintLabel", IDS_SETTINGS_SCREEN_MAGNIFIER_HINT_LABEL}, {"screenMagnifierMouseFollowingModeContinuous",
diff --git a/chrome/browser/ui/webui/settings/safety_check_handler.cc b/chrome/browser/ui/webui/settings/safety_check_handler.cc index 3687324d..61f31a7 100644 --- a/chrome/browser/ui/webui/settings/safety_check_handler.cc +++ b/chrome/browser/ui/webui/settings/safety_check_handler.cc
@@ -90,6 +90,8 @@ case VersionUpdater::DISABLED: return SafetyCheckHandler::UpdateStatus::kUnknown; case VersionUpdater::FAILED: + case VersionUpdater::FAILED_HTTP: + case VersionUpdater::FAILED_DOWNLOAD: case VersionUpdater::FAILED_CONNECTION_TYPE_DISALLOWED: return SafetyCheckHandler::UpdateStatus::kFailed; case VersionUpdater::FAILED_OFFLINE: @@ -280,8 +282,15 @@ void SafetyCheckHandler::PerformSafetyCheck() { // Checks common to desktop, Android, and iOS are handled by // safety_check::SafetyCheck. - safety_check_ = std::make_unique<safety_check::SafetyCheck>(this); - safety_check_->CheckSafeBrowsing(Profile::FromWebUI(web_ui())->GetPrefs()); + safe_browsing_status_ = + safety_check::CheckSafeBrowsing(Profile::FromWebUI(web_ui())->GetPrefs()); + if (safe_browsing_status_ != SafeBrowsingStatus::kChecking) { + base::UmaHistogramEnumeration("Settings.SafetyCheck.SafeBrowsingResult", + safe_browsing_status_); + } + FireBasicSafetyCheckWebUiListener( + kSafeBrowsingEvent, static_cast<int>(safe_browsing_status_), + GetStringForSafeBrowsing(safe_browsing_status_)); if (!version_updater_) { version_updater_.reset(VersionUpdater::Create(web_ui()->GetWebContents())); @@ -925,19 +934,6 @@ OnUpdateCheckResult(ConvertToUpdateStatus(status)); } -void SafetyCheckHandler::OnSafeBrowsingCheckResult( - SafetyCheckHandler::SafeBrowsingStatus status) { - safe_browsing_status_ = status; - if (safe_browsing_status_ != SafeBrowsingStatus::kChecking) { - base::UmaHistogramEnumeration("Settings.SafetyCheck.SafeBrowsingResult", - safe_browsing_status_); - } - FireBasicSafetyCheckWebUiListener( - kSafeBrowsingEvent, static_cast<int>(safe_browsing_status_), - GetStringForSafeBrowsing(safe_browsing_status_)); - CompleteParentIfChildrenCompleted(); -} - void SafetyCheckHandler::OnStateChanged( password_manager::BulkLeakCheckService::State state) { using password_manager::BulkLeakCheckService; @@ -1067,8 +1063,6 @@ // Destroy the version updater to prevent getting a callback and firing a // WebUI event, which would cause a crash. version_updater_.reset(); - // Stop observing safety check events. - safety_check_.reset(nullptr); #if defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING) // Remove |this| as an observer for the Chrome cleaner. safe_browsing::ChromeCleanerController::GetInstance()->RemoveObserver(this);
diff --git a/chrome/browser/ui/webui/settings/safety_check_handler.h b/chrome/browser/ui/webui/settings/safety_check_handler.h index 63f90a9..cf80b13 100644 --- a/chrome/browser/ui/webui/settings/safety_check_handler.h +++ b/chrome/browser/ui/webui/settings/safety_check_handler.h
@@ -49,12 +49,11 @@ // software. class SafetyCheckHandler : public settings::SettingsPageUIHandler, - public password_manager::BulkLeakCheckServiceInterface::Observer, - public password_manager::InsecureCredentialsManager::Observer, #if defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING) public safe_browsing::ChromeCleanerController::Observer, #endif - public safety_check::SafetyCheck::SafetyCheckHandlerInterface { + public password_manager::BulkLeakCheckServiceInterface::Observer, + public password_manager::InsecureCredentialsManager::Observer { public: // The following enum represent the state of the safety check parent // component and should be kept in sync with the JS frontend @@ -69,9 +68,9 @@ // check and should be kept in sync with the JS frontend // (safety_check_browser_proxy.js) and |SafetyCheck*| metrics enums in // enums.xml. - using PasswordsStatus = safety_check::SafetyCheck::PasswordsStatus; - using SafeBrowsingStatus = safety_check::SafetyCheck::SafeBrowsingStatus; - using UpdateStatus = safety_check::SafetyCheck::UpdateStatus; + using PasswordsStatus = safety_check::PasswordsStatus; + using SafeBrowsingStatus = safety_check::SafeBrowsingStatus; + using UpdateStatus = safety_check::UpdateStatus; enum class ExtensionsStatus { kChecking = 0, kError = 1, @@ -273,9 +272,6 @@ int64_t update_size, const std::u16string& message); - // SafetyCheck::SafetyCheckHandlerInterface implementation. - void OnSafeBrowsingCheckResult(SafeBrowsingStatus status) override; - // BulkLeakCheckService::Observer implementation. void OnStateChanged( password_manager::BulkLeakCheckService::State state) override; @@ -316,7 +312,6 @@ // is_leaked = true. bool compromised_passwords_exist_ = false; - std::unique_ptr<safety_check::SafetyCheck> safety_check_; std::unique_ptr<safety_check::UpdateCheckHelper> update_helper_; std::unique_ptr<VersionUpdater> version_updater_;
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc index 8097e76..f5faf8bb 100644 --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -2098,6 +2098,8 @@ IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOWED}, {"siteSettingsBackgroundSyncBlocked", IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_BLOCKED}, + {"siteSettingsBackgroundSyncBlockedSubLabel", + IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_BLOCKED_SUB_LABEL}, {"siteSettingsBackgroundSyncAllowedExceptions", IDS_SETTINGS_SITE_SETTINGS_BACKGROUND_SYNC_ALLOWED_EXCEPTIONS}, {"siteSettingsBackgroundSyncBlockedExceptions", @@ -2174,6 +2176,8 @@ IDS_SETTINGS_SITE_SETTINGS_IMAGES_DESCRIPTION}, {"siteSettingsImagesAllowed", IDS_SETTINGS_SITE_SETTINGS_IMAGES_ALLOWED}, {"siteSettingsImagesBlocked", IDS_SETTINGS_SITE_SETTINGS_IMAGES_BLOCKED}, + {"siteSettingsImagesBlockedSubLabel", + IDS_SETTINGS_SITE_SETTINGS_IMAGES_BLOCKED_SUB_LABEL}, {"siteSettingsImagesAllowedExceptions", IDS_SETTINGS_SITE_SETTINGS_IMAGES_ALLOWED_EXCEPTIONS}, {"siteSettingsImagedBlockedExceptions", @@ -2279,6 +2283,8 @@ IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_ALLOWED}, {"siteSettingsProtectedContentBlocked", IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_BLOCKED}, + {"siteSettingsProtectedContentBlockedSubLabel", + IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_BLOCKED_SUB_LABEL}, {"siteSettingsProtectedContentAllowedExceptions", IDS_SETTINGS_SITE_SETTINGS_PROTECTED_CONTENT_ALLOWED_EXCEPTIONS}, {"siteSettingsProtectedContentBlockedExceptions", @@ -2301,6 +2307,8 @@ IDS_SETTINGS_SITE_SETTINGS_SOUND_DESCRIPTION}, {"siteSettingsSoundAllowed", IDS_SETTINGS_SITE_SETTINGS_SOUND_ALLOWED}, {"siteSettingsSoundBlocked", IDS_SETTINGS_SITE_SETTINGS_SOUND_BLOCKED}, + {"siteSettingsSoundBlockedSubLabel", + IDS_SETTINGS_SITE_SETTINGS_SOUND_BLOCKED_SUB_LABEL}, {"siteSettingsSoundAllowedExceptions", IDS_SETTINGS_SITE_SETTINGS_SOUND_ALLOWED_EXCEPTIONS}, {"siteSettingsSoundBlockedExceptions",
diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc index c6b9bc6..caf863c 100644 --- a/chrome/browser/ui/webui/settings/settings_ui.cc +++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -255,6 +255,14 @@ std::make_unique<IncompatibleApplicationsHandler>()); #endif // OS_WIN && BUILDFLAG(GOOGLE_CHROME_BRANDING) + bool enable_landing_page_redesign = + base::FeatureList::IsEnabled(features::kSettingsLandingPageRedesign); + html_source->AddString( + "enableLandingPageRedesignAttribute", + enable_landing_page_redesign ? "enable-landing-page-redesign" : ""); + html_source->AddBoolean("enableLandingPageRedesign", + enable_landing_page_redesign); + html_source->AddBoolean("signinAllowed", !profile->IsGuestSession() && profile->GetPrefs()->GetBoolean( prefs::kSigninAllowed));
diff --git a/chrome/browser/web_applications/components/BUILD.gn b/chrome/browser/web_applications/components/BUILD.gn index bbf26dcd6..fa475a9 100644 --- a/chrome/browser/web_applications/components/BUILD.gn +++ b/chrome/browser/web_applications/components/BUILD.gn
@@ -224,7 +224,6 @@ "file_handler_manager_unittest.cc", "install_finalizer_unittest.cc", "os_integration_manager_unittest.cc", - "preinstalled_app_install_features_unittest.cc", "protocol_handler_manager_unittest.cc", "web_app_constants_unittest.cc", "web_app_data_retriever_unittest.cc", @@ -305,10 +304,6 @@ deps += [ "//chrome/browser/chromeos" ] } - if (is_chromeos_ash || is_chromeos_lacros) { - deps += [ "//chromeos/crosapi/cpp" ] - } - if (is_win) { deps += [ "//chrome/browser/web_applications/chrome_pwa_launcher:util" ] }
diff --git a/chrome/browser/web_applications/components/preinstalled_app_install_features.cc b/chrome/browser/web_applications/components/preinstalled_app_install_features.cc index c774c94..ec7a27f 100644 --- a/chrome/browser/web_applications/components/preinstalled_app_install_features.cc +++ b/chrome/browser/web_applications/components/preinstalled_app_install_features.cc
@@ -5,11 +5,6 @@ #include "chrome/browser/web_applications/components/preinstalled_app_install_features.h" #include "base/feature_list.h" -#include "chrome/browser/policy/profile_policy_connector.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/common/channel_info.h" -#include "chrome/common/chrome_features.h" -#include "components/version_info/channel.h" namespace web_app { @@ -29,13 +24,6 @@ bool g_always_enabled_for_testing = false; -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -bool IsMigrationFeature(const base::Feature& feature) { - return &feature == &kMigrateDefaultChromeAppToWebAppsGSuite || - &feature == &kMigrateDefaultChromeAppToWebAppsNonGSuite; -} -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) - } // namespace // Enables migration of default installed GSuite apps over to their replacement @@ -53,38 +41,6 @@ }; #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -// Enables migration of default installed web apps over to their replacement -// web apps for Chrome OS beta channel users. -// This flag overrides the value of the kMigrateDefaultChromeAppToWebAppsGSuite -// and kMigrateDefaultChromeAppToWebAppsNonGSuite for Chrome OS beta users. -// Dev/canary/stable channels continue to use the above flags. -// We do this because: -// - The Chrome OS migration flags used to be default enabled. -// - Chrome OS beta channel got migrated. -// - We changed the flags to be default disabled before it went out to stable. -// - We want to avoid reverse migrating beta users (it will lose icon positions -// in the shelf/launcher). -// - Metrics team has advised us to use client side logic instead of a field -// trial to maintain beta's migrated state. -// Note: This will all go away once the migration is complete. -const base::Feature kMigrateDefaultChromeAppToWebAppsChromeOsBeta{ - "MigrateDefaultChromeAppToWebAppsChromeOsBeta", - base::FEATURE_ENABLED_BY_DEFAULT}; - -// Enables migration of default installed web apps over to their replacement -// web apps for Chrome OS managed users. -// This flag overrides the value of the kMigrateDefaultChromeAppToWebAppsGSuite -// and kMigrateDefaultChromeAppToWebAppsNonGSuite for Chrome OS managed users. -// -// Why have a separate flag? -// Field trials are not able to accurately distinguish managed Chrome OS users. -// Because admin installed Chrome apps conflict with the default web app -// migration we need to maintain separate control over the rollout for mananged -// users. -const base::Feature kMigrateDefaultChromeAppToWebAppsChromeOsManaged{ - "MigrateDefaultChromeAppToWebAppsChromeOsManaged", - base::FEATURE_DISABLED_BY_DEFAULT}; - // Enables default installing the Chat web app. const base::Feature kDefaultChatWebApp{"DefaultChatWebApp", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -94,31 +50,13 @@ base::FEATURE_DISABLED_BY_DEFAULT}; #endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -bool IsPreinstalledAppInstallFeatureEnabled(base::StringPiece feature_name, - const Profile& profile) { +bool IsPreinstalledAppInstallFeatureEnabled(base::StringPiece feature_name) { if (g_always_enabled_for_testing) return true; for (const base::Feature* feature : kPreinstalledAppInstallFeatures) { - if (feature->name == feature_name) { -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) - if (IsMigrationFeature(*feature)) { - // See |kMigrateDefaultChromeAppToWebAppsChromeOsBeta| comment above. - if (chrome::GetChannel() == version_info::Channel::BETA) { - return base::FeatureList::IsEnabled( - kMigrateDefaultChromeAppToWebAppsChromeOsBeta); - } - - // See |kMigrateDefaultChromeAppToWebAppsChromeOsManaged| comment above. - if (profile.GetProfilePolicyConnector()->IsManaged()) { - return base::FeatureList::IsEnabled( - kMigrateDefaultChromeAppToWebAppsChromeOsManaged); - } - } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) - + if (feature->name == feature_name) return base::FeatureList::IsEnabled(*feature); - } } return false;
diff --git a/chrome/browser/web_applications/components/preinstalled_app_install_features.h b/chrome/browser/web_applications/components/preinstalled_app_install_features.h index dfa7c7a7..4365272 100644 --- a/chrome/browser/web_applications/components/preinstalled_app_install_features.h +++ b/chrome/browser/web_applications/components/preinstalled_app_install_features.h
@@ -9,8 +9,6 @@ #include "base/feature_list.h" #include "base/strings/string_piece_forward.h" -class Profile; - namespace web_app { extern const base::Feature kMigrateDefaultChromeAppToWebAppsGSuite; @@ -18,10 +16,6 @@ extern const base::Feature kMigrateDefaultChromeAppToWebAppsNonGSuite; #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -extern const base::Feature kMigrateDefaultChromeAppToWebAppsChromeOsBeta; - -extern const base::Feature kMigrateDefaultChromeAppToWebAppsChromeOsManaged; - extern const base::Feature kDefaultChatWebApp; extern const base::Feature kDefaultMeetWebApp; @@ -30,8 +24,7 @@ // Returns the base::Feature in |kPreinstalledAppInstallFeatures| that // corresponds to |feature_name|. Used by external app install configs to gate // installation on features listed in |kPreinstalledAppInstallFeatures|. -bool IsPreinstalledAppInstallFeatureEnabled(base::StringPiece feature_name, - const Profile& profile); +bool IsPreinstalledAppInstallFeatureEnabled(base::StringPiece feature_name); base::AutoReset<bool> SetPreinstalledAppInstallFeatureAlwaysEnabledForTesting();
diff --git a/chrome/browser/web_applications/components/preinstalled_app_install_features_unittest.cc b/chrome/browser/web_applications/components/preinstalled_app_install_features_unittest.cc deleted file mode 100644 index dd827220..0000000 --- a/chrome/browser/web_applications/components/preinstalled_app_install_features_unittest.cc +++ /dev/null
@@ -1,142 +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. - -#include "chrome/browser/web_applications/components/preinstalled_app_install_features.h" - -#include "base/strings/strcat.h" -#include "base/system/sys_info.h" -#include "build/branding_buildflags.h" -#include "build/build_config.h" -#include "build/chromeos_buildflags.h" -#include "chrome/test/base/testing_profile.h" -#include "content/public/test/browser_task_environment.h" -#include "testing/gtest/include/gtest/gtest.h" - -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chromeos/crosapi/cpp/crosapi_constants.h" -#endif - -namespace web_app { - -struct Migrate { - bool beta; - bool managed; -}; - -class PreinstalledWebAppInstallFeaturesTest - : public testing::Test, - public ::testing::WithParamInterface<Migrate> { - public: - static std::string ParamToString( - const ::testing::TestParamInfo<Migrate> param_info) { - return base::StrCat( - {param_info.param.beta ? "MigrateBeta" : "UnmigrateBeta", "_", - param_info.param.managed ? "MigrateManaged" : "UnmigrateManaged"}); - } - - PreinstalledWebAppInstallFeaturesTest() { - base_migration_.InitWithFeatures( - {kMigrateDefaultChromeAppToWebAppsGSuite, - kMigrateDefaultChromeAppToWebAppsNonGSuite}, - {}); -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) - if (GetMigrate().beta) { - beta_migration_.InitAndEnableFeature( - kMigrateDefaultChromeAppToWebAppsChromeOsBeta); - } else { - beta_migration_.InitAndDisableFeature( - kMigrateDefaultChromeAppToWebAppsChromeOsBeta); - } -#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) - if (GetMigrate().managed) { - managed_migration_.InitAndEnableFeature( - kMigrateDefaultChromeAppToWebAppsChromeOsManaged); - } else { - managed_migration_.InitAndDisableFeature( - kMigrateDefaultChromeAppToWebAppsChromeOsManaged); - } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) - } - - ~PreinstalledWebAppInstallFeaturesTest() override = default; - - const Migrate& GetMigrate() { return GetParam(); } - - void ExpectMigrationEnabled(bool unmanaged_expectation, - bool managed_expectation) { - { - TestingProfile::Builder builder; - builder.OverridePolicyConnectorIsManagedForTesting(false); - std::unique_ptr<TestingProfile> unmanaged_profile = builder.Build(); - EXPECT_EQ( - IsPreinstalledAppInstallFeatureEnabled( - kMigrateDefaultChromeAppToWebAppsGSuite.name, *unmanaged_profile), - unmanaged_expectation); - EXPECT_EQ(IsPreinstalledAppInstallFeatureEnabled( - kMigrateDefaultChromeAppToWebAppsNonGSuite.name, - *unmanaged_profile), - unmanaged_expectation); - } - - { - TestingProfile::Builder builder; - builder.OverridePolicyConnectorIsManagedForTesting(true); - std::unique_ptr<TestingProfile> managed_profile = builder.Build(); - EXPECT_EQ( - IsPreinstalledAppInstallFeatureEnabled( - kMigrateDefaultChromeAppToWebAppsGSuite.name, *managed_profile), - managed_expectation); - EXPECT_EQ(IsPreinstalledAppInstallFeatureEnabled( - kMigrateDefaultChromeAppToWebAppsNonGSuite.name, - *managed_profile), - managed_expectation); - } - } - - protected: - base::test::ScopedFeatureList base_migration_; - base::test::ScopedFeatureList beta_migration_; - base::test::ScopedFeatureList managed_migration_; - - content::BrowserTaskEnvironment task_environment_; -}; - -TEST_P(PreinstalledWebAppInstallFeaturesTest, NonBetaChannel) { - ExpectMigrationEnabled( - /*unmanaged_expectation=*/true, -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) - /*managed_expectation=*/GetMigrate().managed -#else - /*managed_expectation=*/true -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) - ); -} - -#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) -TEST_P(PreinstalledWebAppInstallFeaturesTest, BetaChannel) { - base::SysInfo::SetChromeOSVersionInfoForTest( - base::StrCat( - {crosapi::kChromeOSReleaseTrack, "=", crosapi::kReleaseChannelBeta}), - base::Time::Now()); - - ExpectMigrationEnabled(/*unmanaged_expectation=*/GetMigrate().beta, - /*managed_expectation=*/GetMigrate().beta); - - base::SysInfo::ResetChromeOSVersionInfoForTest(); -} -#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) -#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) - -INSTANTIATE_TEST_SUITE_P( - All, - PreinstalledWebAppInstallFeaturesTest, - testing::Values(Migrate{.beta = false, .managed = false}, - Migrate{.beta = false, .managed = true}, - Migrate{.beta = true, .managed = false}, - Migrate{.beta = true, .managed = true}), - &PreinstalledWebAppInstallFeaturesTest::ParamToString); - -} // namespace web_app
diff --git a/chrome/browser/web_applications/components/url_handler_launch_params.cc b/chrome/browser/web_applications/components/url_handler_launch_params.cc index f6d5b11..2a19c66 100644 --- a/chrome/browser/web_applications/components/url_handler_launch_params.cc +++ b/chrome/browser/web_applications/components/url_handler_launch_params.cc
@@ -11,13 +11,22 @@ UrlHandlerLaunchParams::UrlHandlerLaunchParams( const base::FilePath& profile_path, const AppId& app_id, - const GURL& url) - : profile_path(profile_path), app_id(app_id), url(url) { + const GURL& url, + const UrlHandlerSavedChoice saved_choice, + const base::Time& saved_choice_timestamp) + : profile_path(profile_path), + app_id(app_id), + url(url), + saved_choice(saved_choice), + saved_choice_timestamp(saved_choice_timestamp) { DCHECK(!profile_path.empty()); DCHECK(!app_id.empty()); DCHECK(url.is_valid()); } +UrlHandlerLaunchParams::UrlHandlerLaunchParams( + const UrlHandlerLaunchParams& other) = default; + UrlHandlerLaunchParams::~UrlHandlerLaunchParams() = default; } // namespace web_app
diff --git a/chrome/browser/web_applications/components/url_handler_launch_params.h b/chrome/browser/web_applications/components/url_handler_launch_params.h index 96599446..1c6e695 100644 --- a/chrome/browser/web_applications/components/url_handler_launch_params.h +++ b/chrome/browser/web_applications/components/url_handler_launch_params.h
@@ -6,23 +6,49 @@ #define CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_URL_HANDLER_LAUNCH_PARAMS_H_ #include "base/files/file_path.h" +#include "base/time/time.h" #include "chrome/browser/web_applications/components/web_app_id.h" #include "url/gurl.h" namespace web_app { +// UrlHandlerSavedChoice values represent the possible user preferences for +// similar URL handler launches in the future. +// These values are serialized out to local state prefs. Do not rearrange or +// change the underlying values. +// For matching URL handlers, an in-app choice is preferred to a none choice, +// which is preferred to an in-browser choice. These values are ordered +// intentionally to represent these semantics. +enum class UrlHandlerSavedChoice { + // Similar matches should open in a normal browser tab without prompting. + kInBrowser, + // No preference. User will be prompted again with matches. + kNone, + // Similar matches should open in an app window without prompting. + kInApp, + kMax = kInApp +}; + // |UrlHandlerLaunchParams| contains a profile path, an AppId and the // launch URL needed to launch a web app through commandline arguments. +// |saved_choice| can be used to determine if a UI prompt needs to be shown to +// the user before launch. struct UrlHandlerLaunchParams { UrlHandlerLaunchParams(const base::FilePath& profile_path, const AppId& app_id, - const GURL& url); + const GURL& url, + const UrlHandlerSavedChoice saved_choice, + const base::Time& saved_choice_timestamp); + + UrlHandlerLaunchParams(const UrlHandlerLaunchParams& other); ~UrlHandlerLaunchParams(); base::FilePath profile_path; AppId app_id; GURL url; + UrlHandlerSavedChoice saved_choice = UrlHandlerSavedChoice::kNone; + base::Time saved_choice_timestamp; }; } // namespace web_app
diff --git a/chrome/browser/web_applications/components/url_handler_prefs.cc b/chrome/browser/web_applications/components/url_handler_prefs.cc index 8e0cc53..3de49ba 100644 --- a/chrome/browser/web_applications/components/url_handler_prefs.cc +++ b/chrome/browser/web_applications/components/url_handler_prefs.cc
@@ -10,6 +10,7 @@ #include "base/files/file_path.h" #include "base/optional.h" #include "base/strings/strcat.h" +#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/util/values/values_util.h" #include "base/values.h" @@ -24,11 +25,15 @@ namespace url_handler_prefs { namespace { -constexpr const char* kAppId = "app_id"; -constexpr const char* kExcludePaths = "exclude_paths"; -constexpr const char* kHasOriginWildcard = "has_origin_wildcard"; -constexpr const char* kPaths = "paths"; -constexpr const char* kProfilePath = "profile_path"; +constexpr const char kAppId[] = "app_id"; +constexpr const char kProfilePath[] = "profile_path"; +constexpr const char kIncludePaths[] = "include_paths"; +constexpr const char kExcludePaths[] = "exclude_paths"; +constexpr const char kHasOriginWildcard[] = "has_origin_wildcard"; +constexpr const char kDefaultPath[] = "/*"; +constexpr const char kPath[] = "path"; +constexpr const char kChoice[] = "choice"; +constexpr const char kTimestamp[] = "timestamp"; // Returns true if |url| has the same origin as origin_str. If // |look_for_subdomains| is true, url must have an origin that extends @@ -55,27 +60,100 @@ } } -// Return if |url_path| matches any path in |paths|. A path in |paths| can -// contain one wildcard * at the end. +// Returns true if |url_path| matches |path_pattern|. A prefix match is used if +// |path_pattern| ends with a '*' wildcard character. An exact match is used +// otherwise. |url_path| is a URL path from a fully specified URL. +// |path_pattern| is a URL path that can contain a wildcard postfix. +bool PathMatchesPathPattern(const std::string& url_path, + base::StringPiece path_pattern) { + if (!path_pattern.empty() && path_pattern.back() == '*') { + // Remove the wildcard and check if it's the same as the first several + // characters of |url_path|. + path_pattern = path_pattern.substr(0, path_pattern.length() - 1); + if (base::StartsWith(url_path, path_pattern)) + return true; + } else { + // |path_pattern| doesn't contain a wildcard, check for an exact match. + if (path_pattern == url_path) + return true; + } + return false; +} + +// Return true if |url_path| matches any path in |include_paths|. A path in +// |include_paths| can contain one wildcard '*' at the end. +// If any path matches, returns the best UrlHandlerSavedChoice found and +// its associated timestamp through the |choice| and |time| output parameters. +// "Best" here is defined by this ordering: kInApp > kNone > kInBrowser. // |url_path| always starts with a '/', as it's the result of GURL::path(). -bool UrlPathMatches(const std::string& url_path, const base::Value& paths) { - if (!paths.is_list()) +bool FindBestMatchingIncludePathChoice(const std::string& url_path, + const base::Value& include_paths, + UrlHandlerSavedChoice* choice, + base::Time* time) { + if (!include_paths.is_list()) return false; - for (const auto& path : paths.GetList()) { - std::string path_str = path.GetString(); - if (path_str.back() == '*') { - // Remove the wildcard and check if it's the same as the first several - // characters of |url_path|. - path_str = path_str.substr(0, path_str.length() - 1); - if (base::StartsWith(url_path, path_str)) - return true; - } else { - // |path_str| doesn't contain a wildcard, check for an exact match. - if (path_str == url_path) - return true; + UrlHandlerSavedChoice best_choice = UrlHandlerSavedChoice::kInBrowser; + base::Time most_recent_timestamp; + bool found_match = false; + + for (const auto& include_path_dict : include_paths.GetList()) { + if (!include_path_dict.is_dict()) + continue; + const std::string* include_path = include_path_dict.FindStringKey(kPath); + if (!include_path) + continue; + const base::Optional<int> choice_opt = + include_path_dict.FindIntKey(kChoice); + if (!choice_opt) + continue; + // Check enum. bounds before casting. + if (*choice_opt < 0 || + *choice_opt > static_cast<int>(UrlHandlerSavedChoice::kMax)) + continue; + auto current_choice = static_cast<UrlHandlerSavedChoice>(*choice_opt); + base::Optional<base::Time> current_timestamp = + util::ValueToTime(include_path_dict.FindKey(kTimestamp)); + if (!current_timestamp) + continue; + + if (PathMatchesPathPattern(url_path, *include_path)) { + // If current_choice is better than best_choice, update best choice and + // timestamp. + bool update_best = current_choice > best_choice || + // If current_choice and best_choice are equal, choose + // the one with the latest timestamp. + (best_choice == current_choice && + current_timestamp > most_recent_timestamp); + + if (update_best) { + best_choice = current_choice; + most_recent_timestamp = *current_timestamp; + } + found_match = true; } } + + if (found_match) { + *choice = best_choice; + *time = most_recent_timestamp; + } + return found_match; +} + +// Return true if |url_path| matches any path in |exclude_paths|. A path in +// |exclude_paths| can contain one wildcard '*' at the end. +bool ExcludePathMatches(const std::string& url_path, + const base::Value& exclude_paths) { + if (!exclude_paths.is_list()) + return false; + + for (const auto& exclude_path : exclude_paths.GetList()) { + if (!exclude_path.is_string()) + continue; + if (PathMatchesPathPattern(url_path, exclude_path.GetString())) + return true; + } return false; } @@ -113,29 +191,102 @@ } const std::string& url_path = url.path(); - bool path_matches = true; - const base::Value* const paths = handler.FindListKey(kPaths); + const base::Value* const include_paths = handler.FindListKey(kIncludePaths); - bool paths_exist = paths && paths->is_list() && !paths->GetList().empty(); - if (paths_exist) - path_matches = UrlPathMatches(url_path, *paths); + bool include_paths_exist = include_paths && include_paths->is_list() && + !include_paths->GetList().empty(); + + UrlHandlerSavedChoice best_choice = UrlHandlerSavedChoice::kNone; + base::Time latest_timestamp = base::Time::Min(); + if (include_paths_exist && + !FindBestMatchingIncludePathChoice(url_path, *include_paths, + &best_choice, &latest_timestamp)) { + continue; + } const base::Value* const exclude_paths = handler.FindListKey(kExcludePaths); bool exclude_paths_exist = exclude_paths && exclude_paths->is_list() && !exclude_paths->GetList().empty(); - if (exclude_paths_exist) { - bool match_exclude_path = UrlPathMatches(url_path, *exclude_paths); - // If |paths| and |exclude_paths| are both not empty, only |url_path| - // that matches a path and does not match an exclude path is considered - // a match. - // If |paths| is empty and |exclude_paths| is not, |url_path| that does - // not match any exclude path is considered a match. - path_matches = paths_exist ? (path_matches && !match_exclude_path) - : !match_exclude_path; - } + if (exclude_paths_exist && ExcludePathMatches(url_path, *exclude_paths)) + continue; - if (path_matches) - matches.emplace_back(*profile_path, *app_id, url); + // Do not include a match if it should open in a normal browser tab. + if (best_choice == UrlHandlerSavedChoice::kInBrowser) + continue; + + matches.emplace_back(*profile_path, *app_id, url, best_choice, + latest_timestamp); + } +} + +// If one or more match should open in app, keep the most recent one and remove +// the others. Also remove matches with no saved choice. +// Otherwise, any remaining matches should all have no saved choice. +// Any match that should open in browser have already been removed and should +// not be found in |matches|. +void FilterBySavedChoice(std::vector<UrlHandlerLaunchParams>& matches) { + for (const UrlHandlerLaunchParams& params : matches) + DCHECK(params.saved_choice != UrlHandlerSavedChoice::kInBrowser); + + // Are there matches that open in app? Which is the most recently saved? + bool has_in_app = false; + base::Time most_recent_time = base::Time::Min(); + size_t most_recent_pos = 0; + for (size_t i = 0; i < matches.size(); i++) { + const UrlHandlerLaunchParams& params = matches[i]; + if (params.saved_choice == UrlHandlerSavedChoice::kInApp) { + has_in_app = true; + if (params.saved_choice_timestamp > most_recent_time) { + most_recent_time = params.saved_choice_timestamp; + most_recent_pos = i; + } + } + } + + // Only keep the most recently saved match that opens in app. + if (has_in_app) + matches = {std::move(matches[most_recent_pos])}; + + // Since no matches opened in browser to begin with and now no matches open in + // app, any remaining matches must have no saved choice. +} + +void FindMatchesImpl(const base::Value& pref_value, + const GURL& url, + std::vector<UrlHandlerLaunchParams>& matches, + const std::string& origin_str, + const bool origin_trimmed) { + const base::Value* const all_handlers = pref_value.FindListKey(origin_str); + if (all_handlers) { + DCHECK(UrlMatchesOrigin(url, origin_str, origin_trimmed)); + FilterAndAddMatches(*all_handlers, url, origin_trimmed, matches); + FilterBySavedChoice(matches); + } +} + +// Helper function that runs |op| repeatedly with shorter versions of +// |origin_str|. This helps match URLs to entries keyed by broader origins. +template <typename Operation> +void TryDifferentOriginSubstrings(std::string origin_str, Operation op) { + bool origin_trimmed = false; + while (true) { + op(origin_str, origin_trimmed); + + // Try to shorten origin_str to the next origin suffix by removing 1 + // sub-domain. This enables matching against origins that contain wildcard + // prefixes. As these origins with wildcard prefixes could be of different + // lengths and yet match the initial origin_str, every suffix is processed. + auto found = origin_str.find('.'); + if (found != std::string::npos) { + // Trim origin to after next '.' character if there is one. + origin_str = base::StrCat({"https://", origin_str.substr(found + 1)}); + origin_trimmed = true; + // Do not early return here. There could be other apps that match using + // origin wildcard. + } else { + // There is no more '.'. Stop looking. + break; + } } } @@ -154,38 +305,41 @@ if (origin.scheme() != url::kHttpsScheme) return matches; + // FindMatchesImpl accumulates results to |matches|. std::string origin_str = origin.Serialize(); - bool origin_trimmed(false); - - while (true) { - const base::Value* const all_handlers = pref_value.FindListKey(origin_str); - if (all_handlers) { - DCHECK(UrlMatchesOrigin(url, origin_str, origin_trimmed)); - FilterAndAddMatches(*all_handlers, url, origin_trimmed, matches); - } - - // If a key matching the input URL's origin is not found, shorten the origin - // by sub-domain and try again. This enables matching against manifest - // "url_handlers" origins that contain wildcard prefixes. - auto found = origin_str.find('.'); - if (found != std::string::npos) { - // Trim origin to after next '.' character if there is one. - origin_str = base::StrCat({"https://", origin_str.substr(found + 1)}); - origin_trimmed = true; - } else { - // There is no more '.'. Stop looking. - break; - } - } + TryDifferentOriginSubstrings( + origin_str, [&pref_value, &url, &matches](const std::string& origin_str, + bool origin_trimmed) { + FindMatchesImpl(pref_value, url, matches, origin_str, origin_trimmed); + }); return matches; } -base::Value GetPathsValue(const std::vector<std::string>& paths) { - base::Value paths_value(base::Value::Type::LIST); - for (const auto& path : paths) - paths_value.Append(path); +base::Value GetIncludePathsValue( + const std::vector<std::string>& include_paths) { + base::Value value(base::Value::Type::LIST); + // When no "paths" are specified in web-app-origin-association, all include + // paths are allowed. + for (const auto& include_path : include_paths.empty() + ? std::vector<std::string>({kDefaultPath}) + : include_paths) { + base::Value path_dict(base::Value::Type::DICTIONARY); + path_dict.SetStringKey(kPath, include_path); + path_dict.SetIntKey(kChoice, + static_cast<int>(UrlHandlerSavedChoice::kNone)); + path_dict.SetKey(kTimestamp, util::TimeToValue(base::Time::Min())); + value.Append(std::move(path_dict)); + } + return value; +} - return paths_value; +base::Value GetExcludePathsValue( + const std::vector<std::string>& exclude_paths) { + base::Value value(base::Value::Type::LIST); + for (const auto& exclude_path : exclude_paths) { + value.Append(exclude_path); + } + return value; } base::Value NewHandler(const AppId& app_id, @@ -195,13 +349,9 @@ value.SetStringKey(kAppId, app_id); value.SetKey(kProfilePath, util::FilePathToValue(profile_path)); value.SetBoolKey(kHasOriginWildcard, info.has_origin_wildcard); - - // Set paths and exclude paths from associated app. - value.SetKey(kPaths, GetPathsValue(info.paths)); - value.SetKey(kExcludePaths, GetPathsValue(info.exclude_paths)); - - // TODO(crbug/1072058): Set "user_permission" field when implementing user - // settings in the chrome://settings page. + // Set include_paths and exclude paths from associated app. + value.SetKey(kIncludePaths, GetIncludePathsValue(info.paths)); + value.SetKey(kExcludePaths, GetExcludePathsValue(info.exclude_paths)); return value; } @@ -212,17 +362,17 @@ const base::FilePath& profile_path, bool match_app_id, const base::Value& handler) { - const std::string* const app_id_local = handler.FindStringKey(kAppId); - base::Optional<base::FilePath> profile_path_local = + const std::string* const handler_app_id = handler.FindStringKey(kAppId); + base::Optional<base::FilePath> handler_profile_path = util::ValueToFilePath(handler.FindKey(kProfilePath)); - if (!app_id_local || !profile_path_local) + if (!handler_app_id || !handler_profile_path) return false; - if (*profile_path_local != profile_path) + if (*handler_profile_path != profile_path) return false; - return !match_app_id || *app_id_local == app_id; + return !match_app_id || *handler_app_id == app_id; } // Removes entries that match |profile_path| and |app_id|. @@ -256,6 +406,110 @@ for (const auto& origin_to_remove : origins_to_remove) pref_value.RemoveKey(origin_to_remove); } + +// Sets |choice| on every path in |include_paths| that matches |url|. +void UpdateSavedChoice(base::Value& include_paths, + const GURL& url, + UrlHandlerSavedChoice choice, + const base::Time& time) { + // |include_paths| is a list of include path dicts. Eg: + // [ { + // "choice": 0, + // "path": "/abc", + // "timestamp": "-9223372036854775808" + // } ] + auto include_paths_list = include_paths.TakeList(); + for (base::Value& include_path_dict : include_paths_list) { + if (!include_path_dict.is_dict()) + continue; + const std::string* path = include_path_dict.FindStringKey(kPath); + if (!path) + continue; + + // Any matching path dict. will be updated with the input choice and + // timestamp. + if (PathMatchesPathPattern(url.path(), *path)) { + include_path_dict.SetIntKey(kChoice, static_cast<int>(choice)); + include_path_dict.SetKey(kTimestamp, util::TimeToValue(time)); + } + } + include_paths = base::Value(std::move(include_paths_list)); +} + +void SaveChoiceImpl(const AppId* app_id, + const base::FilePath* profile_path, + const GURL& url, + const UrlHandlerSavedChoice choice, + const base::Time& time, + base::Value& pref_value, + const std::string& origin_str, + const bool origin_trimmed) { + base::Value* const handlers_mutable = pref_value.FindListKey(origin_str); + if (handlers_mutable) { + DCHECK(UrlMatchesOrigin(url, origin_str, origin_trimmed)); + base::Value::ListStorage handlers = handlers_mutable->TakeList(); + for (auto& handler : handlers) { + if (!handler.is_dict()) + continue; + const std::string* const handler_app_id = handler.FindStringKey(kAppId); + base::Optional<base::FilePath> handler_profile_path = + util::ValueToFilePath(handler.FindKey(kProfilePath)); + if (!handler_app_id || !handler_profile_path) + continue; + + if (choice == UrlHandlerSavedChoice::kInApp) { + if (*handler_app_id != *app_id || + *handler_profile_path != *profile_path) { + continue; + } + } + + base::Value* const include_paths = handler.FindListKey(kIncludePaths); + if (include_paths) + UpdateSavedChoice(*include_paths, url, choice, time); + } + *handlers_mutable = base::Value(std::move(handlers)); + } +} + +// Saves |choice| and |time| to all handler include_paths that match |app_id|, +// |profile_path|, and |url|. |url| provides both origin and path for matching. +void SaveChoice(PrefService* local_state, + const AppId* app_id, + const base::FilePath* profile_path, + const GURL& url, + const UrlHandlerSavedChoice choice, + const base::Time& time) { + DCHECK(url.is_valid()); + DCHECK(local_state); + DCHECK(choice != UrlHandlerSavedChoice::kNone); + // |app_id| and |profile_path| are not needed when choice == kInBrowser. + DCHECK(choice != UrlHandlerSavedChoice::kInBrowser || + (app_id == nullptr && profile_path == nullptr)); + + DictionaryPrefUpdate update(local_state, prefs::kWebAppsUrlHandlerInfo); + base::Value* const pref_value = update.Get(); + if (!pref_value || !pref_value->is_dict()) + return; + + url::Origin origin = url::Origin::Create(url); + if (origin.opaque()) + return; + + if (origin.scheme() != url::kHttpsScheme) + return; + + std::string origin_str = origin.Serialize(); + + // SaveChoiceImpl modifies prefs but produces no output. + TryDifferentOriginSubstrings( + origin_str, [app_id, profile_path, &url, choice, &time, pref_value]( + const std::string& origin_str, bool origin_trimmed) { + SaveChoiceImpl(app_id, profile_path, url, choice, time, *pref_value, + origin_str, origin_trimmed); + }); +} + } // namespace void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { @@ -312,8 +566,8 @@ const AppId& app_id, const base::FilePath& profile_path, const apps::UrlHandlers& url_handlers) { - // TODO(crbug/1072058): Handle "user_permission" field when it is - // implemented. + // TODO(crbug/1072058): Retain saved choices where possible if there are + // updates to 'url_handlers'. RemoveWebApp(local_state, app_id, profile_path); AddWebApp(local_state, app_id, profile_path, url_handlers); } @@ -365,5 +619,23 @@ return FindMatches(*pref_value, url); } +void SaveOpenInApp(PrefService* local_state, + const AppId& app_id, + const base::FilePath& profile_path, + const GURL& url, + const base::Time& time) { + DCHECK(!profile_path.empty()); + DCHECK(!app_id.empty()); + SaveChoice(local_state, &app_id, &profile_path, url, + UrlHandlerSavedChoice::kInApp, time); +} + +void SaveOpenInBrowser(PrefService* local_state, + const GURL& url, + const base::Time& time) { + SaveChoice(local_state, /*app_id=*/nullptr, /*profile_path=*/nullptr, url, + UrlHandlerSavedChoice::kInBrowser, time); +} + } // namespace url_handler_prefs } // namespace web_app
diff --git a/chrome/browser/web_applications/components/url_handler_prefs.h b/chrome/browser/web_applications/components/url_handler_prefs.h index 595a1a64..5ab0c343 100644 --- a/chrome/browser/web_applications/components/url_handler_prefs.h +++ b/chrome/browser/web_applications/components/url_handler_prefs.h
@@ -8,7 +8,7 @@ #include <string> #include <vector> -#include "base/files/file_path.h" +#include "base/time/time.h" #include "chrome/browser/web_applications/components/url_handler_launch_params.h" #include "chrome/browser/web_applications/components/web_app_id.h" #include "components/prefs/pref_service.h" @@ -38,9 +38,9 @@ // contained a "url_handlers" field with an "*.contoso.com" origin, an entry // will be added here under the "https://contoso.com" key. The mapped value // contains a list of handlers, each of which identifies the app_id and profile -// of the app that could be launched. It also contains "paths" and -// "exclude_paths" patterns for more specific matches. it also contains -// information about user permissions and saved defaults. +// of the app that could be launched. It also contains "include_paths" and +// "exclude_paths" patterns for more specific matches. It also contains saved +// user preferences. // // An example of the information stored using this model: // { @@ -51,18 +51,23 @@ // "profile_path": "C:\\Users\\alias\\Profile\\Default", // "origin": "https://contoso.com", // "has_origin_wildcard": false, -// "paths": ["/*"], +// "include_paths": [ +// { +// "path": "/*", +// "choice": 2, // kInApp +// // "2000-01-01 00:00:00.000 UTC" +// "timestamp": "12591158400000000" +// } +// ], // "exclude_paths": ["/abc"], -// "user_permission": true // }, // { // "app_id": "qruhrugqrgjdsdfhjghjrghjhdfgaaamenww", // "profile_path": "C:\\Users\\alias\\Profile\\Default", // "origin": "https://contoso.com", // "has_origin_wildcard": true, -// "paths": [], +// "include_paths": [], // "exclude_paths": [], -// "user_permission": false // } // ], // "https://www.en.osotnoc.org": [...] @@ -91,14 +96,33 @@ void Clear(PrefService* local_state); // Search for all (app, profile) combinations that have active URL handlers -// that matches |url|. +// which matches |url|. +// If there are results with saved_choice == kInApp, only the one with the most +// recent timestamp is returned. Otherwise, if there results with saved_choice +// == kNone, all of those will be returned. No results with saved_choiced == +// kInBrowser will be returned in any case. // |url| is a fully specified URL, eg. "https://contoso.com/abc/def". -// TODO(crbug/1072058): Filter out inactive handlers when user permission is -// implemented. std::vector<UrlHandlerLaunchParams> FindMatchingUrlHandlers( PrefService* local_state, const GURL& url); +// Users can save their app choice from the intent picker dialog so that they +// are not prompted again the next time a similar URL matches to the same app. +void SaveOpenInApp(PrefService* local_state, + const AppId& app_id, + const base::FilePath& profile_path, + const GURL& url, + const base::Time& time = base::Time::Now()); + +// Users can save their choice to not launch a web app when a similar URL is +// matched in the future. +void SaveOpenInBrowser(PrefService* local_state, + const GURL& url, + const base::Time& time = base::Time::Now()); + +// TODO(crbug/1072058): Implement methods to list and reset saved choices. These +// will be used to expose saved URL handling app choices to chrome://settings. + } // namespace url_handler_prefs } // namespace web_app
diff --git a/chrome/browser/web_applications/components/url_handler_prefs_unittest.cc b/chrome/browser/web_applications/components/url_handler_prefs_unittest.cc index 4d49cf32..e7d87ef1 100644 --- a/chrome/browser/web_applications/components/url_handler_prefs_unittest.cc +++ b/chrome/browser/web_applications/components/url_handler_prefs_unittest.cc
@@ -8,6 +8,7 @@ #include <vector> #include "base/files/file_path.h" +#include "base/time/time.h" #include "chrome/browser/web_applications/components/web_app_helpers.h" #include "chrome/browser/web_applications/components/web_app_id.h" #include "chrome/browser/web_applications/web_app.h" @@ -27,6 +28,8 @@ constexpr char kAppUrl2[] = "https://web-app2.com/"; constexpr char kOriginUrl1[] = "https://origin-1.com/abc"; constexpr char kOriginUrl2[] = "https://origin-2.com/abc"; +constexpr char kTime1[] = "1 Jan 2000 00:00:00 GMT"; +constexpr char kTime2[] = "2 Jan 2000 00:00:00 GMT"; constexpr base::FilePath::CharType kProfile1[] = FILE_PATH_LITERAL("/profile1"); constexpr base::FilePath::CharType kProfile2[] = FILE_PATH_LITERAL("/profile2"); @@ -44,6 +47,8 @@ origin_2_ = url::Origin::Create(origin_url_2_); profile_1_ = base::FilePath(kProfile1); profile_2_ = base::FilePath(kProfile2); + EXPECT_TRUE(base::Time::FromString(kTime1, &time_1_)); + EXPECT_TRUE(base::Time::FromString(kTime2, &time_2_)); } ~UrlHandlerPrefsTest() override = default; @@ -85,6 +90,8 @@ url::Origin origin_2_; base::FilePath profile_1_; base::FilePath profile_2_; + base::Time time_1_; + base::Time time_2_; private: ScopedTestingLocalState scoped_testing_local_state_; @@ -692,4 +699,229 @@ } } +// Tests that choices can be saved when paths are not specified in +// web-app-origin-association and the default path "/*" is assumed. +TEST_F(UrlHandlerPrefsTest, SaveUserChoice_DefaultPaths) { + const auto web_app = WebAppWithUrlHandlers( + app_url_1_, {apps::UrlHandlerInfo(origin_1_, false, {}, {})}); + url_handler_prefs::AddWebApp(LocalState(), web_app->app_id(), profile_1_, + web_app->url_handlers()); + { + // Check default choice and timestamp. + auto matches = + url_handler_prefs::FindMatchingUrlHandlers(LocalState(), origin_url_1_); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kNone); + EXPECT_EQ(matches[0].saved_choice_timestamp, base::Time::Min()); + } + // Save choice as UrlHandlerSavedChoice::kInApp. + url_handler_prefs::SaveOpenInApp(LocalState(), web_app->app_id(), profile_1_, + origin_url_1_, time_1_); + { + // Check saved choice and timestamp. + auto matches = + url_handler_prefs::FindMatchingUrlHandlers(LocalState(), origin_url_1_); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kInApp); + EXPECT_EQ(matches[0].saved_choice_timestamp, time_1_); + } +} + +// Check for the saved choice and timestamp. +TEST_F(UrlHandlerPrefsTest, SaveUserChoice_InApp) { + const auto web_app = WebAppWithUrlHandlers( + app_url_1_, + {apps::UrlHandlerInfo(origin_1_, false, {"/abc", "/def"}, {})}); + url_handler_prefs::AddWebApp(LocalState(), web_app->app_id(), profile_1_, + web_app->url_handlers()); + // Save choice as UrlHandlerSavedChoice::kInApp to "/abc" path. + url_handler_prefs::SaveOpenInApp(LocalState(), web_app->app_id(), profile_1_, + origin_1_.GetURL().Resolve("abc"), time_1_); + { + // Check saved choice and timestamp. + auto matches = url_handler_prefs::FindMatchingUrlHandlers( + LocalState(), origin_1_.GetURL().Resolve("abc")); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kInApp); + EXPECT_EQ(matches[0].saved_choice_timestamp, time_1_); + } + { + // Check unaffected path. + auto matches = url_handler_prefs::FindMatchingUrlHandlers( + LocalState(), origin_1_.GetURL().Resolve("def")); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kNone); + EXPECT_EQ(matches[0].saved_choice_timestamp, base::Time::Min()); + } +} + +// Saving as UrlHandlerSavedChoice::kInBrowser prevents an app from being +// matched as a URL handler. +TEST_F(UrlHandlerPrefsTest, SaveUserChoice_InBrowser) { + const auto web_app = WebAppWithUrlHandlers( + app_url_1_, {apps::UrlHandlerInfo(origin_1_, false, {"/abc"}, {})}); + url_handler_prefs::AddWebApp(LocalState(), web_app->app_id(), profile_1_, + web_app->url_handlers()); + { + // Expect installed app to be matched with no saved choice. + auto matches = + url_handler_prefs::FindMatchingUrlHandlers(LocalState(), origin_url_1_); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kNone); + } + url_handler_prefs::SaveOpenInBrowser(LocalState(), origin_url_1_, time_1_); + { + // Expect the same URL to not be matched. + auto matches = + url_handler_prefs::FindMatchingUrlHandlers(LocalState(), origin_url_1_); + EXPECT_EQ(0u, matches.size()); + } +} + +TEST_F(UrlHandlerPrefsTest, SaveUserChoice_HasExcludePaths) { + const auto web_app = WebAppWithUrlHandlers( + app_url_1_, + {apps::UrlHandlerInfo(origin_1_, false, {"/a", "/b"}, {"/x"})}); + url_handler_prefs::AddWebApp(LocalState(), web_app->app_id(), profile_1_, + web_app->url_handlers()); + // Save choice as UrlHandlerSavedChoice::kInApp for "/a" path. + url_handler_prefs::SaveOpenInApp(LocalState(), web_app->app_id(), profile_1_, + origin_1_.GetURL().Resolve("a"), time_1_); + { + auto matches = url_handler_prefs::FindMatchingUrlHandlers( + LocalState(), origin_1_.GetURL().Resolve("a")); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kInApp); + } + { + auto matches = url_handler_prefs::FindMatchingUrlHandlers( + LocalState(), origin_1_.GetURL().Resolve("b")); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kNone); + } + { + auto matches = url_handler_prefs::FindMatchingUrlHandlers( + LocalState(), origin_1_.GetURL().Resolve("x")); + EXPECT_EQ(0u, matches.size()); + } +} + +// Saved choices can be get overwritten. +TEST_F(UrlHandlerPrefsTest, SaveUserChoice_Overwrite) { + const auto web_app = WebAppWithUrlHandlers( + app_url_1_, {apps::UrlHandlerInfo(origin_1_, false, {"/*", "/a"}, {})}); + url_handler_prefs::AddWebApp(LocalState(), web_app->app_id(), profile_1_, + web_app->url_handlers()); + + // URL with "/b" path matches and saves to "/*" URL handler path. + url_handler_prefs::SaveOpenInApp(LocalState(), web_app->app_id(), profile_1_, + origin_1_.GetURL().Resolve("b"), time_1_); + // URL with "/a" path matches and saves to both URL handler paths. + url_handler_prefs::SaveOpenInApp(LocalState(), web_app->app_id(), profile_1_, + origin_1_.GetURL().Resolve("a"), time_2_); + { + auto matches = url_handler_prefs::FindMatchingUrlHandlers( + LocalState(), origin_1_.GetURL().Resolve("b")); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kInApp); + EXPECT_EQ(matches[0].saved_choice_timestamp, time_2_); + } + { + auto matches = url_handler_prefs::FindMatchingUrlHandlers( + LocalState(), origin_1_.GetURL().Resolve("a")); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kInApp); + EXPECT_EQ(matches[0].saved_choice_timestamp, time_2_); + } +} + +TEST_F(UrlHandlerPrefsTest, SaveUserChoice_MultipleApps) { + const auto web_app_1 = WebAppWithUrlHandlers( + app_url_1_, {apps::UrlHandlerInfo(origin_1_, false, {"/*"}, {})}); + const auto web_app_2 = WebAppWithUrlHandlers( + app_url_2_, {apps::UrlHandlerInfo(origin_1_, false, {"/*"}, {})}); + + url_handler_prefs::AddWebApp(LocalState(), web_app_1->app_id(), profile_1_, + web_app_1->url_handlers()); + url_handler_prefs::AddWebApp(LocalState(), web_app_2->app_id(), profile_1_, + web_app_2->url_handlers()); + { + // Both apps should match the input URL. + auto matches = + url_handler_prefs::FindMatchingUrlHandlers(LocalState(), origin_url_1_); + ASSERT_EQ(2u, matches.size()); + EXPECT_EQ(matches[0].app_id, web_app_1->app_id()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kNone); + EXPECT_EQ(matches[0].saved_choice_timestamp, base::Time::Min()); + EXPECT_EQ(matches[1].app_id, web_app_2->app_id()); + EXPECT_EQ(matches[1].saved_choice, UrlHandlerSavedChoice::kNone); + EXPECT_EQ(matches[1].saved_choice_timestamp, base::Time::Min()); + } + url_handler_prefs::SaveOpenInApp(LocalState(), web_app_1->app_id(), + profile_1_, origin_url_1_, time_1_); + { + // Only the app with a path saved as UrlHandlerSavedChoice::kInApp is + // returned from matching. + auto matches = + url_handler_prefs::FindMatchingUrlHandlers(LocalState(), origin_url_1_); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].app_id, web_app_1->app_id()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kInApp); + EXPECT_EQ(matches[0].saved_choice_timestamp, time_1_); + } +} + +TEST_F(UrlHandlerPrefsTest, SaveUserChoice_MultipleAppsInBrowser) { + const auto web_app_1 = WebAppWithUrlHandlers( + app_url_1_, {apps::UrlHandlerInfo(origin_1_, false, {"/*"}, {})}); + const auto web_app_2 = WebAppWithUrlHandlers( + app_url_2_, {apps::UrlHandlerInfo(origin_1_, false, {"/*"}, {})}); + + url_handler_prefs::AddWebApp(LocalState(), web_app_1->app_id(), profile_1_, + web_app_1->url_handlers()); + url_handler_prefs::AddWebApp(LocalState(), web_app_2->app_id(), profile_1_, + web_app_2->url_handlers()); + + url_handler_prefs::SaveOpenInBrowser(LocalState(), origin_url_1_, time_1_); + { + auto matches = + url_handler_prefs::FindMatchingUrlHandlers(LocalState(), origin_url_1_); + EXPECT_EQ(0u, matches.size()); + } +} + +TEST_F(UrlHandlerPrefsTest, SaveUserChoice_OriginWildcardMatch) { + const auto web_app = WebAppWithUrlHandlers( + app_url_2_, + {apps::UrlHandlerInfo(origin_1_, /*has_origin_wildcard*/ true)}); + url_handler_prefs::AddWebApp(LocalState(), web_app->app_id(), profile_1_, + web_app->url_handlers()); + + GURL en_origin_url_1("https://en.origin-1.com/abc"); + { + auto matches = url_handler_prefs::FindMatchingUrlHandlers(LocalState(), + en_origin_url_1); + EXPECT_EQ(1u, matches.size()); + CheckMatches(matches, {web_app.get()}, {profile_1_}); + } + // Choice should also be saved successfully to the app that matches because of + // its origin wildcard. + url_handler_prefs::SaveOpenInApp(LocalState(), web_app->app_id(), profile_1_, + en_origin_url_1, time_1_); + { + auto matches = + url_handler_prefs::FindMatchingUrlHandlers(LocalState(), origin_url_1_); + ASSERT_EQ(1u, matches.size()); + EXPECT_EQ(matches[0].saved_choice, UrlHandlerSavedChoice::kInApp); + EXPECT_EQ(matches[0].saved_choice_timestamp, time_1_); + } + + url_handler_prefs::SaveOpenInBrowser(LocalState(), en_origin_url_1, time_1_); + { + auto matches = url_handler_prefs::FindMatchingUrlHandlers(LocalState(), + en_origin_url_1); + EXPECT_EQ(0u, matches.size()); + } +} + } // namespace web_app
diff --git a/chrome/browser/web_applications/components/web_app_utils.cc b/chrome/browser/web_applications/components/web_app_utils.cc index 55594d99..56b7dc8 100644 --- a/chrome/browser/web_applications/components/web_app_utils.cc +++ b/chrome/browser/web_applications/components/web_app_utils.cc
@@ -158,10 +158,18 @@ std::u16string GetFileExtensionsHandledByWebAppDisplayedAsList( Profile* profile, const GURL& url) { + std::vector<std::string> extensions = + GetFileExtensionsHandledByWebApp(profile, url); + + // Convert file types from formats like ".txt" to "TXT". + std::transform(extensions.begin(), extensions.end(), extensions.begin(), + [](const std::string& extension) { + return base::ToUpperASCII(extension.substr(1)); + }); + return base::UTF8ToUTF16(base::JoinString( - GetFileExtensionsHandledByWebApp(profile, url), - l10n_util::GetStringUTF8( - IDS_WEB_APP_FILE_HANDLING_EXTENSION_LIST_SEPARATOR))); + extensions, l10n_util::GetStringUTF8( + IDS_WEB_APP_FILE_HANDLING_EXTENSION_LIST_SEPARATOR))); } } // namespace web_app
diff --git a/chrome/browser/web_applications/manifest_update_manager_browsertest.cc b/chrome/browser/web_applications/manifest_update_manager_browsertest.cc index 0feee0ab..590f3a0 100644 --- a/chrome/browser/web_applications/manifest_update_manager_browsertest.cc +++ b/chrome/browser/web_applications/manifest_update_manager_browsertest.cc
@@ -34,6 +34,7 @@ #include "chrome/browser/web_applications/components/os_integration_manager.h" #include "chrome/browser/web_applications/components/web_app_constants.h" #include "chrome/browser/web_applications/components/web_app_provider_base.h" +#include "chrome/browser/web_applications/components/web_app_utils.h" #include "chrome/browser/web_applications/extensions/bookmark_app_registrar.h" #include "chrome/browser/web_applications/system_web_apps/system_web_app_manager.h" #include "chrome/browser/web_applications/system_web_apps/test/test_system_web_app_installation.h" @@ -1599,6 +1600,97 @@ EXPECT_TRUE(web_app->file_handlers().empty()); } +IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling, + CheckFileExtensionList) { + constexpr char kFileHandlerManifestTemplate[] = R"( + { + "name": "Test app name", + "start_url": ".", + "scope": "/", + "display": "minimal-ui", + "file_handlers": [ + { + "action": "/?plaintext", + "name": "Plain Text", + "accept": { + "text/plain": [".txt"] + } + } + ], + "icons": $1 + } + )"; + + OverrideManifest(kFileHandlerManifestTemplate, {kInstallableIconList}); + InstallWebApp(); + + EXPECT_EQ(u"TXT", GetFileExtensionsHandledByWebAppDisplayedAsList( + browser()->profile(), GetAppURL())); +} + +IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling, + CheckFileExtensionsList) { + constexpr char kFileHandlerManifestTemplate[] = R"( + { + "name": "Test app name", + "start_url": ".", + "scope": "/", + "display": "minimal-ui", + "file_handlers": [ + { + "action": "/?plaintext", + "name": "Plain Text", + "accept": { + "text/plain": [".txt", ".md"] + } + } + ], + "icons": $1 + } + )"; + + OverrideManifest(kFileHandlerManifestTemplate, {kInstallableIconList}); + InstallWebApp(); + + EXPECT_EQ(u"MD, TXT", GetFileExtensionsHandledByWebAppDisplayedAsList( + browser()->profile(), GetAppURL())); +} + +IN_PROC_BROWSER_TEST_F(ManifestUpdateManagerBrowserTestWithFileHandling, + CheckFileExtensionsListWithTwoFileHandlers) { + constexpr char kFileHandlerManifestTemplate[] = R"( + { + "name": "Test app name", + "start_url": ".", + "scope": "/", + "display": "minimal-ui", + "file_handlers": [ + { + "action": "/?plaintext", + "name": "Plain Text", + "accept": { + "text/plain": [".txt"] + } + }, + { + "action": "/?longtype", + "name": "Long Custom type", + "accept": { + "long/type": [".longtype"] + } + } + ], + "icons": $1 + } + )"; + + OverrideManifest(kFileHandlerManifestTemplate, {kInstallableIconList}); + InstallWebApp(); + + EXPECT_EQ(u"LONGTYPE, TXT", GetFileExtensionsHandledByWebAppDisplayedAsList( + browser()->profile(), GetAppURL())); +} + class ManifestUpdateManagerBrowserTestWithShortcutsMenu : public ManifestUpdateManagerBrowserTest { public:
diff --git a/chrome/browser/web_applications/preinstalled_web_app_manager.cc b/chrome/browser/web_applications/preinstalled_web_app_manager.cc index 69f6397..62739da9 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_manager.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_manager.cc
@@ -164,8 +164,8 @@ } // Remove if gated on a disabled feature. - if (options.gate_on_feature && !IsPreinstalledAppInstallFeatureEnabled( - *options.gate_on_feature, *profile)) { + if (options.gate_on_feature && + !IsPreinstalledAppInstallFeatureEnabled(*options.gate_on_feature)) { return options.install_url.spec() + " disabled because feature is disabled: " + *options.gate_on_feature; } @@ -541,11 +541,10 @@ SetMigrationRun(profile_, kMigrateDefaultChromeAppToWebAppsGSuite.name, IsPreinstalledAppInstallFeatureEnabled( - kMigrateDefaultChromeAppToWebAppsGSuite.name, *profile_)); - SetMigrationRun( - profile_, kMigrateDefaultChromeAppToWebAppsNonGSuite.name, - IsPreinstalledAppInstallFeatureEnabled( - kMigrateDefaultChromeAppToWebAppsNonGSuite.name, *profile_)); + kMigrateDefaultChromeAppToWebAppsGSuite.name)); + SetMigrationRun(profile_, kMigrateDefaultChromeAppToWebAppsNonGSuite.name, + IsPreinstalledAppInstallFeatureEnabled( + kMigrateDefaultChromeAppToWebAppsNonGSuite.name)); if (callback) { std::move(callback).Run(std::move(install_results),
diff --git a/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc b/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc index 66e359f..95b8076 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc
@@ -249,8 +249,7 @@ // Set up pre-migration state. { - ASSERT_FALSE( - IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag, *profile())); + ASSERT_FALSE(IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag)); SyncExternalExtensions(); SyncExternalWebApps(/*expect_install=*/false, /*expect_uninstall=*/false); @@ -275,8 +274,7 @@ { base::AutoReset<bool> testing_scope = SetPreinstalledAppInstallFeatureAlwaysEnabledForTesting(); - ASSERT_TRUE( - IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag, *profile())); + ASSERT_TRUE(IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag)); SyncExternalExtensions(); // Extension sticks around to be uninstalled by the replacement web app. @@ -319,8 +317,7 @@ // Revert migration. { - ASSERT_FALSE( - IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag, *profile())); + ASSERT_FALSE(IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag)); SyncExternalExtensions(); SyncExternalWebApps(/*expect_install=*/false, /*expect_uninstall=*/true); @@ -343,8 +340,7 @@ base::HistogramTester histograms; base::AutoReset<bool> testing_scope = SetPreinstalledAppInstallFeatureAlwaysEnabledForTesting(); - ASSERT_TRUE( - IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag, *profile())); + ASSERT_TRUE(IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag)); extensions::TestExtensionRegistryObserver uninstall_observer( extensions::ExtensionRegistry::Get(profile())); @@ -392,8 +388,7 @@ // Set up pre-migration state. { - ASSERT_FALSE( - IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag, *profile())); + ASSERT_FALSE(IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag)); SyncExternalExtensions(); SyncExternalWebApps(/*expect_install=*/false, /*expect_uninstall=*/false); @@ -427,8 +422,7 @@ { base::AutoReset<bool> testing_scope = SetPreinstalledAppInstallFeatureAlwaysEnabledForTesting(); - ASSERT_TRUE( - IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag, *profile())); + ASSERT_TRUE(IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag)); SyncExternalExtensions(); // Extension sticks around to be uninstalled by the replacement web app. @@ -488,8 +482,7 @@ UserUninstalledExtensionApp) { // Set up pre-migration state. { - ASSERT_FALSE( - IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag, *profile())); + ASSERT_FALSE(IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag)); SyncExternalExtensions(); SyncExternalWebApps(/*expect_install=*/false, /*expect_uninstall=*/false); @@ -514,8 +507,7 @@ { base::AutoReset<bool> testing_scope = SetPreinstalledAppInstallFeatureAlwaysEnabledForTesting(); - ASSERT_TRUE( - IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag, *profile())); + ASSERT_TRUE(IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag)); SyncExternalExtensions(); EXPECT_FALSE(IsExtensionAppInstalled()); @@ -548,8 +540,7 @@ { base::HistogramTester histograms; - ASSERT_FALSE( - IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag, *profile())); + ASSERT_FALSE(IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag)); SyncExternalExtensions(); SyncExternalWebApps(/*expect_install=*/false, /*expect_uninstall=*/false, @@ -570,8 +561,7 @@ { base::AutoReset<bool> testing_scope = SetPreinstalledAppInstallFeatureAlwaysEnabledForTesting(); - ASSERT_TRUE( - IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag, *profile())); + ASSERT_TRUE(IsPreinstalledAppInstallFeatureEnabled(kMigrationFlag)); SyncExternalExtensions(); // Extension sticks around to be uninstalled by the replacement web app.
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 4d3e95ac4..2d31a86 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-master-1620129103-cf789b3e5577f92015fd9ee0086609178481d02b.profdata +chrome-mac-master-1620150997-ed31ee9b9b0ddd01ab0f115df51e17035cf45d21.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 9ae2f3ac..687fad9c 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-master-1620118607-6eaa28a3fe7df08ffa690a956cfb082ddf264ada.profdata +chrome-win32-master-1620172529-2e7042d3e0d503f2fbf4b5265e801bd87c4ffdbc.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 15942df..a6fea34 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-master-1620129103-a129e9f0c00ee5a213e8e1c2533ccd303cd05e95.profdata +chrome-win64-master-1620172529-8f86fc13ad1836b1082b9990ba65808c278ad45e.profdata
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 7a67ba88..29b90e0 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -285,6 +285,11 @@ "DesktopPWAsFlashAppNameInsteadOfOrigin", base::FEATURE_DISABLED_BY_DEFAULT}; +// Replaces the origin text flash and the icon in web app notifications with +// the name of the app and the icon of the app. +const base::Feature kDesktopPWAsNotificationIconAndTitle{ + "DesktopPWAsNotificationIconAndTitle", base::FEATURE_DISABLED_BY_DEFAULT}; + // Enables or disables Desktop PWAs to be auto-started on OS login. const base::Feature kDesktopPWAsRunOnOsLogin { "DesktopPWAsRunOnOsLogin", @@ -916,9 +921,9 @@ #endif // Disable downloads of unsafe file types over insecure transports if initiated -// from a secure page +// from a secure page. As of M89, mixed downloads are blocked on all platforms. const base::Feature kTreatUnsafeDownloadsAsActive{ - "TreatUnsafeDownloadsAsActive", base::FEATURE_DISABLED_BY_DEFAULT}; + "TreatUnsafeDownloadsAsActive", base::FEATURE_ENABLED_BY_DEFAULT}; #if BUILDFLAG(IS_CHROMEOS_ASH) // Enable uploading of a zip archive of system logs instead of individual files.
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index d5fa5e41..37c244c 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -200,6 +200,9 @@ extern const base::Feature kDesktopPWAsFlashAppNameInsteadOfOrigin; COMPONENT_EXPORT(CHROME_FEATURES) +extern const base::Feature kDesktopPWAsNotificationIconAndTitle; + +COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kDesktopPWAsRunOnOsLogin; COMPONENT_EXPORT(CHROME_FEATURES)
diff --git a/chrome/common/extensions/api/accessibility_private.json b/chrome/common/extensions/api/accessibility_private.json index 4da0fe23..28ce8df7 100644 --- a/chrome/common/extensions/api/accessibility_private.json +++ b/chrome/common/extensions/api/accessibility_private.json
@@ -782,6 +782,13 @@ } ], "platforms": ["chromeos"] + }, + { + "name": "onShowChromeVoxTutorial", + "type": "function", + "description": "Fired when ChromeVox should show its tutorial.", + "parameters": [], + "platforms": ["chromeos"] } ] }
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_requirements_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_requirements_unittest.cc index bd7e5aa..c5ea861 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_requirements_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_requirements_unittest.cc
@@ -18,21 +18,21 @@ TEST_F(RequirementsManifestTest, RequirementsInvalid) { Testcase testcases[] = { - Testcase("requirements_invalid_requirements.json", - errors::kInvalidRequirements), - Testcase("requirements_invalid_keys.json", errors::kInvalidRequirements), - Testcase("requirements_invalid_3d.json", - ErrorUtils::FormatErrorMessage( - errors::kInvalidRequirement, "3D")), - Testcase("requirements_invalid_3d_features.json", - ErrorUtils::FormatErrorMessage( - errors::kInvalidRequirement, "3D")), - Testcase("requirements_invalid_3d_features_value.json", - ErrorUtils::FormatErrorMessage( - errors::kInvalidRequirement, "3D")), - Testcase("requirements_invalid_3d_no_features.json", - ErrorUtils::FormatErrorMessage( - errors::kInvalidRequirement, "3D")), + Testcase("requirements_invalid_requirements.json", + "Error at key 'requirements'. Type is invalid. Expected " + "dictionary, found boolean."), + Testcase("requirements_invalid_3d.json", + "Error at key 'requirements.3D'. Type is invalid. Expected " + "dictionary, found boolean."), + Testcase("requirements_invalid_3d_features.json", + "Error at key 'requirements.3D.features'. Type is invalid. " + "Expected list, found boolean."), + Testcase("requirements_invalid_3d_features_value.json", + "Error at key 'requirements.3D.features'. Parsing array failed " + "at index 0: Specified value 'foo' is invalid."), + Testcase( + "requirements_invalid_3d_no_features.json", + "Error at key 'requirements.3D.features'. Manifest key is required."), }; RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_ERROR); @@ -53,10 +53,12 @@ // Tests the deprecated plugin requirement. TEST_F(RequirementsManifestTest, RequirementsPlugin) { - // Using the plugins requirement should cause an install warning. RunTestcase({"requirements_invalid_plugins_value.json", - errors::kPluginsRequirementDeprecated}, - EXPECT_TYPE_WARNING); + "Error at key 'requirements.plugins.npapi'. Type is invalid. " + "Expected boolean, found integer."}, + EXPECT_TYPE_ERROR); + + // Using the plugins requirement should cause an install warning. RunTestcase( {"requirements_npapi_false.json", errors::kPluginsRequirementDeprecated}, EXPECT_TYPE_WARNING);
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index d678b622..b824369c 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc
@@ -2161,6 +2161,9 @@ // If false, disable post-quantum key agreement in TLS connections. const char kCECPQ2Enabled[] = "ssl.cecpq2_enabled"; +// Boolean that specifies whether 3DES cipher suites are enabled in TLS. +const char kTripleDESEnabled[] = "ssl.3des_enabled"; + // Boolean that specifies whether the built-in asynchronous DNS client is used. const char kBuiltInDnsClientEnabled[] = "async_dns.enabled";
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 8b810083..74b26db 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h
@@ -829,6 +829,7 @@ extern const char kH2ClientCertCoalescingHosts[]; extern const char kHSTSPolicyBypassList[]; extern const char kCECPQ2Enabled[]; +extern const char kTripleDESEnabled[]; extern const char kBuiltInDnsClientEnabled[]; extern const char kDnsOverHttpsMode[];
diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc index 0ccd581..6a539eb 100644 --- a/chrome/renderer/media/chrome_key_systems.cc +++ b/chrome/renderer/media/chrome_key_systems.cc
@@ -10,7 +10,6 @@ #include <vector> #include "base/containers/contains.h" -#include "base/containers/flat_set.h" #include "base/logging.h" #include "base/strings/string_split.h" #include "base/strings/utf_string_conversions.h" @@ -260,43 +259,13 @@ } // Codecs and encryption schemes. - SupportedCodecs codecs = media::EME_CODEC_NONE; - SupportedCodecs hw_secure_codecs = media::EME_CODEC_NONE; - base::flat_set<::media::EncryptionScheme> encryption_schemes; - base::flat_set<::media::EncryptionScheme> hw_secure_encryption_schemes; - bool cdm_supports_persistent_license = false; - - if (capability->sw_secure_capability) { - codecs = GetSupportedCodecs(capability->sw_secure_capability->video_codecs, - /*is_secure=*/false); - encryption_schemes = capability->sw_secure_capability->encryption_schemes; - if (!base::Contains(capability->sw_secure_capability->session_types, - media::CdmSessionType::kTemporary)) { - DVLOG(1) << "Temporary sessions must be supported."; - return; - } - - cdm_supports_persistent_license = - base::Contains(capability->sw_secure_capability->session_types, - media::CdmSessionType::kPersistentLicense); - } - - if (capability->hw_secure_capability) { - hw_secure_codecs = GetSupportedCodecs( - capability->hw_secure_capability->video_codecs, /*is_secure=*/true); - hw_secure_encryption_schemes = - capability->hw_secure_capability->encryption_schemes; - if (!base::Contains(capability->hw_secure_capability->session_types, - media::CdmSessionType::kTemporary)) { - DVLOG(1) << "Temporary sessions must be supported."; - return; - } - - // TODO(b/186035558): With a single flag we can't distinguish persistent - // session support between software and hardware CDMs. This should be - // fixed so that if there is both a software and a hardware CDM, persistent - // session support can be different between the versions. - } + auto codecs = GetSupportedCodecs(capability->video_codecs, + /*is_secure=*/false); + const auto& encryption_schemes = capability->encryption_schemes; + auto hw_secure_codecs = GetSupportedCodecs(capability->hw_secure_video_codecs, + /*is_secure=*/true); + const auto& hw_secure_encryption_schemes = + capability->hw_secure_encryption_schemes; // Robustness. using Robustness = cdm::WidevineKeySystemProperties::Robustness; @@ -315,6 +284,16 @@ } #endif + // Session types. + bool cdm_supports_temporary_session = base::Contains( + capability->session_types, media::CdmSessionType::kTemporary); + if (!cdm_supports_temporary_session) { + DVLOG(1) << "Temporary session must be supported."; + return; + } + + bool cdm_supports_persistent_license = base::Contains( + capability->session_types, media::CdmSessionType::kPersistentLicense); auto persistent_license_support = GetPersistentLicenseSupport(cdm_supports_persistent_license);
diff --git a/chrome/renderer/subresource_redirect/subresource_redirect_params.cc b/chrome/renderer/subresource_redirect/subresource_redirect_params.cc index fc5a8e9..896b0b2 100644 --- a/chrome/renderer/subresource_redirect/subresource_redirect_params.cc +++ b/chrome/renderer/subresource_redirect/subresource_redirect_params.cc
@@ -41,10 +41,16 @@ } base::TimeDelta GetRobotsRulesReceiveTimeout() { + if (base::FeatureList::IsEnabled(blink::features::kSubresourceRedirect)) { + return base::TimeDelta::FromMilliseconds( + base::GetFieldTrialParamByFeatureAsInt( + blink::features::kSubresourceRedirect, + "robots_rules_receive_timeout_ms", 2000)); + } return base::TimeDelta::FromMilliseconds( base::GetFieldTrialParamByFeatureAsInt( - blink::features::kSubresourceRedirect, "robots_rules_receive_timeout", - 10)); + blink::features::kSubresourceRedirectSrcVideo, + "robots_rules_receive_timeout_ms", 2000)); } size_t GetFirstKSubresourceLimit() { @@ -53,10 +59,16 @@ } base::TimeDelta GetRobotsRulesReceiveFirstKSubresourceTimeout() { + if (base::FeatureList::IsEnabled(blink::features::kSubresourceRedirect)) { + return base::TimeDelta::FromMilliseconds( + base::GetFieldTrialParamByFeatureAsInt( + blink::features::kSubresourceRedirect, + "robots_rules_receive_first_k_timeout_ms", 2000)); + } return base::TimeDelta::FromMilliseconds( base::GetFieldTrialParamByFeatureAsInt( - blink::features::kSubresourceRedirect, - "robots_rules_receive_first_k_timeout_ms", 10)); + blink::features::kSubresourceRedirectSrcVideo, + "robots_rules_receive_first_k_timeout_ms", 2000)); } int MaxRobotsRulesParsersCacheSize() {
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 4951cc34..4f80a29 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2543,6 +2543,7 @@ "../browser/ash/login/app_mode/kiosk_launch_controller_browsertest.cc", "../browser/ash/login/app_mode/web_kiosk_browsertest.cc", "../browser/ash/login/arc_terms_of_service_browsertest.cc", + "../browser/ash/login/ash_hud_login_browsertest.cc", "../browser/ash/login/challenge_response_auth_keys_loader_browsertest.cc", "../browser/ash/login/configuration_based_oobe_browsertest.cc", "../browser/ash/login/crash_restore_browsertest.cc", @@ -2878,7 +2879,7 @@ "../browser/ui/ash/shelf/chrome_shelf_controller_test_util.cc", "../browser/ui/ash/shelf/chrome_shelf_controller_test_util.h", "../browser/ui/ash/shelf_browsertest.cc", - "../browser/ui/ash/system_tray_client_browsertest.cc", + "../browser/ui/ash/system_tray_client_impl_browsertest.cc", "../browser/ui/ash/system_tray_tray_cast_browsertest_media_router_chromeos.cc", "../browser/ui/ash/tab_scrubber_browsertest.cc", "../browser/ui/ash/tablet_mode_page_behavior_browsertest.cc", @@ -5896,7 +5897,6 @@ if (is_linux || is_mac || is_win) { sources += [ - "../browser/enterprise/connectors/device_trust/attestation_service_unittest.cc", "../browser/enterprise/connectors/device_trust/device_trust_key_pair_unittest.cc", "../browser/enterprise/connectors/device_trust/navigation_throttle_unittest.cc", ]
diff --git a/chrome/test/base/test_browser_window.cc b/chrome/test/base/test_browser_window.cc index 8cf6769..1783254 100644 --- a/chrome/test/base/test_browser_window.cc +++ b/chrome/test/base/test_browser_window.cc
@@ -234,6 +234,13 @@ return nullptr; } +sharing_hub::SharingHubBubbleView* TestBrowserWindow::ShowSharingHubBubble( + content::WebContents* contents, + sharing_hub::SharingHubBubbleController* controller, + bool is_user_gesture) { + return nullptr; +} + bool TestBrowserWindow::IsDownloadShelfVisible() const { return false; }
diff --git a/chrome/test/base/test_browser_window.h b/chrome/test/base/test_browser_window.h index f0aa5a90..0edc8a9 100644 --- a/chrome/test/base/test_browser_window.h +++ b/chrome/test/base/test_browser_window.h
@@ -36,6 +36,11 @@ class SendTabToSelfBubbleView; } // namespace send_tab_to_self +namespace sharing_hub { +class SharingHubBubbleController; +class SharingHubBubbleView; +} // namespace sharing_hub + // An implementation of BrowserWindow used for testing. TestBrowserWindow only // contains a valid LocationBar, all other getters return NULL. // However, some of them can be preset to a specific value. @@ -148,6 +153,10 @@ content::WebContents* contents, send_tab_to_self::SendTabToSelfBubbleController* controller, bool is_user_gesture) override; + sharing_hub::SharingHubBubbleView* ShowSharingHubBubble( + content::WebContents* contents, + sharing_hub::SharingHubBubbleController* controller, + bool is_user_gesture) override; ShowTranslateBubbleResult ShowTranslateBubble( content::WebContents* contents, translate::TranslateStep step,
diff --git a/chrome/test/chromedriver/capabilities.cc b/chrome/test/chromedriver/capabilities.cc index 072e667..f9c74ac 100644 --- a/chrome/test/chromedriver/capabilities.cc +++ b/chrome/test/chromedriver/capabilities.cc
@@ -37,8 +37,10 @@ bool* to_set, const base::Value& option, Capabilities* capabilities) { - if (!option.GetAsBoolean(to_set)) + if (!option.is_bool()) return Status(kInvalidArgument, "must be a boolean"); + if (to_set) + *to_set = option.GetBool(); return Status(kOk); } @@ -477,10 +479,9 @@ PerfLoggingPrefs::InspectorDomainStatus* to_set, const base::Value& option, Capabilities* capabilities) { - bool desired_value; - if (!option.GetAsBoolean(&desired_value)) + if (!option.is_bool()) return Status(kInvalidArgument, "must be a boolean"); - if (desired_value) + if (option.GetBool()) *to_set = PerfLoggingPrefs::InspectorDomainStatus::kExplicitlyEnabled; else *to_set = PerfLoggingPrefs::InspectorDomainStatus::kExplicitlyDisabled;
diff --git a/chrome/test/chromedriver/element_commands.cc b/chrome/test/chromedriver/element_commands.cc index ff43fb9..f32fe77 100644 --- a/chrome/test/chromedriver/element_commands.cc +++ b/chrome/test/chromedriver/element_commands.cc
@@ -408,7 +408,7 @@ args, &get_content_editable); if (status.IsError()) return status; - get_content_editable->GetAsBoolean(&is_content_editable); + is_content_editable = get_content_editable->GetIfBool().value_or(false); } std::unique_ptr<base::Value> get_readonly; @@ -418,9 +418,9 @@ params_readOnly.SetString("name", "readOnly"); status = ExecuteGetElementProperty(session, web_view, element_id, params_readOnly, &get_readonly); - get_readonly->GetAsBoolean(&is_readonly); if (status.IsError()) return status; + is_readonly = get_readonly->GetIfBool().value_or(false); } bool is_editable = (is_input_control || is_text || is_content_editable) && !is_readonly; @@ -586,9 +586,7 @@ return status; bool is_text = is_textControlType || is_textarea; - bool is_content_editable; - if (get_content_editable->GetAsBoolean(&is_content_editable) && - is_content_editable) { + if (get_content_editable->is_bool() && get_content_editable->GetBool()) { // If element is contentEditable // check if element is focused bool is_focused = false;
diff --git a/chrome/test/chromedriver/element_util.cc b/chrome/test/chromedriver/element_util.cc index 9fd8929..767567a5 100644 --- a/chrome/test/chromedriver/element_util.cc +++ b/chrome/test/chromedriver/element_util.cc
@@ -678,8 +678,9 @@ args, &result); if (status.IsError()) return status; - if (!result->GetAsBoolean(is_displayed)) + if (!result->is_bool()) return Status(kUnknownError, "IS_DISPLAYED should return a boolean value"); + *is_displayed = result->GetBool(); return Status(kOk); } @@ -699,8 +700,9 @@ args, &result); if (status.IsError()) return status; - if (!result->GetAsBoolean(is_enabled)) + if (!result->is_bool()) return Status(kUnknownError, "IS_ENABLED should return a boolean value"); + *is_enabled = result->GetBool(); return Status(kOk); } @@ -720,8 +722,9 @@ args, &result); if (status.IsError()) return status; - if (!result->GetAsBoolean(is_selected)) + if (!result->is_bool()) return Status(kUnknownError, "IS_SELECTED should return a boolean value"); + *is_selected = result->GetBool(); return Status(kOk); } @@ -741,8 +744,9 @@ args, &result); if (status.IsError()) return status; - if (!result->GetAsBoolean(is_togglable)) + if (!result->is_bool()) return Status(kUnknownError, "failed check if option togglable or not"); + *is_togglable = result->GetBool(); return Status(kOk); }
diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py index f56b20e..ef9fafc 100755 --- a/chrome/test/chromedriver/test/run_py_tests.py +++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -2570,7 +2570,9 @@ def testTakeElementScreenshot(self): self._driver.Load(self.GetHttpUrlForFile( '/chromedriver/page_with_redbox.html')) - analysisResult = 'FAIL' + # Wait for page to stabilize in case of Chrome showing top bars. + # See https://crbug.com/chromedriver/2986 + time.sleep(1) redElement = self._driver.FindElement('css selector', '#box') analysisResult = self.takeScreenshotAndVerifyCorrect(redElement) self.assertEquals('PASS', analysisResult) @@ -2580,7 +2582,9 @@ '/chromedriver/page_with_iframe_redbox.html')) frame = self._driver.FindElement('css selector', '#frm') self._driver.SwitchToFrame(frame) - analysisResult = 'FAIL' + # Wait for page to stabilize in case of Chrome showing top bars. + # See https://crbug.com/chromedriver/2986 + time.sleep(1) redElement = self._driver.FindElement('css selector', '#box') analysisResult = self.takeScreenshotAndVerifyCorrect(redElement) self.assertEquals('PASS', analysisResult)
diff --git a/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/a.html b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/a.html new file mode 100644 index 0000000..ed52c3d --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/a.html
@@ -0,0 +1 @@ +<script src="a.js"></script>
diff --git a/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/a.js b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/a.js new file mode 100644 index 0000000..c514036 --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/a.js
@@ -0,0 +1,15 @@ +// 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. + +onload = function() { + if (window.sessionStorage['redirected'] != 1) { + window.sessionStorage['redirected'] = 1; + // Required so this results in a history entry being created. + setTimeout(function() { + location.href = + "http://b.com:" + location.port + + "/extensions/api_test/tabs/backForwardCache/on_updated/b.html"; + }, 0); + } +};
diff --git a/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/b.html b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/b.html new file mode 100644 index 0000000..f5c7be2 --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/b.html
@@ -0,0 +1 @@ +<script src="b.js"></script>
diff --git a/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/b.js b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/b.js new file mode 100644 index 0000000..970ea93 --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/b.js
@@ -0,0 +1,7 @@ +// 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. + +onload = function() { + history.back(); +};
diff --git a/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/background.html b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/background.html new file mode 100644 index 0000000..ac3f43e --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/background.html
@@ -0,0 +1 @@ +<script src="background.js"></script>
diff --git a/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/background.js b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/background.js new file mode 100644 index 0000000..fceca6dd --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/background.js
@@ -0,0 +1,69 @@ +// 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. + +var expectedEventData; +var capturedEventData; +var shouldIgnore = true; + +function expect(data) { + chrome.tabs.onUpdated.addListener(function(tabId, info, tab) { + // Wait until the first loading of a non-blank url. + if (info.status === 'loading' && info.url != 'about:blank') + shouldIgnore = false; + if (shouldIgnore) + return; + capturedEventData.push(info); + checkExpectations(); + }); + + expectedEventData = data; + capturedEventData = []; +} + +function checkExpectations() { + if (capturedEventData.length < expectedEventData.length) { + return; + } + chrome.test.assertEq(JSON.stringify(expectedEventData), + JSON.stringify(capturedEventData)); + chrome.test.succeed(); +} + +// Helper function. Turns a function returning an object in a callback into a +// promise. It helps keeping the code at the same indentation level. +function promise(fun, ...args) { + return new Promise(function(resolve, reject) { + fun(...args, function(value) { + resolve(value); + }); + }); +} + +onload = async function() { + let tab = await promise(chrome.tabs.create, {"url": "about:blank"}); + let config = await promise(chrome.test.getConfig); + let port = config.testServer.port; + + var URL_A = "http://a.com:" + port + + "/extensions/api_test/tabs/backForwardCache/on_updated/a.html"; + var URL_B = "http://b.com:" + port + + "/extensions/api_test/tabs/backForwardCache/on_updated/b.html"; + + chrome.test.runTests([ + function backForwardNavigation() { + expect([ + { status: 'loading', url: URL_A }, + { status: 'complete' }, + { status: 'loading', url: URL_B }, + + // Asserts that back forward cache restoring A generates loading + // and complete events. + { status: 'loading', url: URL_A }, + { status: 'complete' }, + ]); + + chrome.tabs.update(tab.id, { url: URL_A }); + } + ]); +};
diff --git a/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/manifest.json b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/manifest.json new file mode 100644 index 0000000..5cb2e8f --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/backForwardCache/on_updated/manifest.json
@@ -0,0 +1,10 @@ +{ + "name": "bfCacheTabUpdated", + "version": "1.0", + "manifest_version": 2, + "description": "Tests the tab.onUpdated API events with the back forward cache.", + "background": { + "page": "background.html" + }, + "permissions": ["tabs"] +}
diff --git a/chrome/test/data/extensions/manifest_tests/requirements_invalid_keys.json b/chrome/test/data/extensions/manifest_tests/requirements_invalid_keys.json deleted file mode 100644 index 8ebe239..0000000 --- a/chrome/test/data/extensions/manifest_tests/requirements_invalid_keys.json +++ /dev/null
@@ -1,10 +0,0 @@ -{ - "name": "Requirements Manifest Test", - "version": "1.0", - "manifest_version": 2, - "requirements": { - "foo": { - "bar": false - } - } -}
diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json index 72516db..1bfc887 100644 --- a/chrome/test/data/policy/policy_test_cases.json +++ b/chrome/test/data/policy/policy_test_cases.json
@@ -3266,6 +3266,24 @@ ] }, + "TripleDESEnabled": { + "os": ["win", "linux", "mac", "chromeos", "android"], + "policy_pref_mapping_tests": [ + { + "policies": { "TripleDESEnabled": true }, + "prefs": { + "ssl.3des_enabled": { "value": true, "location": "local_state" } + } + }, + { + "policies": { "TripleDESEnabled": false }, + "prefs": { + "ssl.3des_enabled": { "value": false, "location": "local_state" } + } + } + ] + }, + "CertificateTransparencyEnforcementDisabledForUrls": { "os": ["win", "linux", "mac", "chromeos", "android"], "policy_pref_mapping_tests": [
diff --git a/chrome/test/data/webui/chromeos/diagnostics/fake_network_health_provider_test.js b/chrome/test/data/webui/chromeos/diagnostics/fake_network_health_provider_test.js index a95feb1..0542fca 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/fake_network_health_provider_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/fake_network_health_provider_test.js
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {NetworkListObserver} from 'chrome://diagnostics/diagnostics_types.js'; -import {fakeNetworkGuidInfoList} from 'chrome://diagnostics/fake_data.js'; +import {NetworkListObserver, NetworkStateObserver} from 'chrome://diagnostics/diagnostics_types.js'; +import {fakeCellularNetwork, fakeEthernetNetwork, fakeNetworkGuidInfoList, fakeWifiNetwork} from 'chrome://diagnostics/fake_data.js'; import {FakeNetworkHealthProvider} from 'chrome://diagnostics/fake_network_health_provider.js'; import {PromiseResolver} from 'chrome://resources/js/promise_resolver.m.js'; @@ -57,4 +57,55 @@ return completeResolver.promise; }); }); + + test('ObserveNetwork', () => { + provider.setFakeNetworkGuidInfo(fakeNetworkGuidInfoList); + provider.setFakeNetworkState('cellularGuid', [fakeCellularNetwork]); + let resolver = new PromiseResolver(); + + /** @type {!NetworkStateObserver} */ + const networkStateObserverRemote = + /** @type {!NetworkStateObserver} */ ({ + onNetworkStateChanged: (network) => { + assertDeepEquals(fakeCellularNetwork, network); + resolver.resolve(); + } + }); + + return provider.observeNetwork(networkStateObserverRemote, 'cellularGuid') + .then(() => resolver.promise); + }); + + test('ObserveNetworkSupportsMultipleObservers', () => { + provider.setFakeNetworkGuidInfo(fakeNetworkGuidInfoList); + provider.setFakeNetworkState('wifiGuid', [fakeWifiNetwork]); + provider.setFakeNetworkState('ethernetGuid', [fakeEthernetNetwork]); + let wifiResolver = new PromiseResolver(); + let ethernetResolver = new PromiseResolver(); + + /** @type {!NetworkStateObserver} */ + const wifiNetworkStateObserverRemote = + /** @type {!NetworkStateObserver} */ ({ + onNetworkStateChanged: (network) => { + assertDeepEquals(fakeWifiNetwork, network); + wifiResolver.resolve(); + } + }); + + /** @type {!NetworkStateObserver} */ + const ethernetNetworkStateObserverRemote = + /** @type {!NetworkStateObserver} */ ({ + onNetworkStateChanged: (network) => { + assertDeepEquals(fakeEthernetNetwork, network); + ethernetResolver.resolve(); + } + }); + + return provider.observeNetwork(wifiNetworkStateObserverRemote, 'wifiGuid') + .then(() => wifiResolver.promise) + .then( + () => provider.observeNetwork( + ethernetNetworkStateObserverRemote, 'ethernetGuid')) + .then(() => ethernetResolver.promise); + }); }
diff --git a/chrome/test/data/webui/chromeos/diagnostics/network_info_test.js b/chrome/test/data/webui/chromeos/diagnostics/network_info_test.js index d49aed5..efc740b 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/network_info_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/network_info_test.js
@@ -4,6 +4,11 @@ import 'chrome://diagnostics/network_info.js'; +import {Network} from 'chrome://diagnostics/diagnostics_types.js'; +import {fakeNetworkGuidInfoList, fakeWifiNetwork} from 'chrome://diagnostics/fake_data.js'; +import {FakeNetworkHealthProvider} from 'chrome://diagnostics/fake_network_health_provider.js'; +import {setNetworkHealthProviderForTesting} from 'chrome://diagnostics/mojo_interface_provider.js'; + import {assertFalse, assertTrue} from '../../chai_assert.js'; import {flushTasks} from '../../test_util.m.js'; @@ -13,6 +18,14 @@ /** @type {?NetworkInfoElement} */ let networkInfoElement = null; + /** @type {?FakeNetworkHealthProvider} */ + let provider = null; + + suiteSetup(() => { + provider = new FakeNetworkHealthProvider(); + setNetworkHealthProviderForTesting(provider); + }); + setup(() => { document.body.innerHTML = ''; }); @@ -20,45 +33,32 @@ teardown(() => { networkInfoElement.remove(); networkInfoElement = null; + provider.reset(); }); - function initializeNetworkInfo() { + /** + * @param {string} guid + * @param {!Array<!Network>} networkStateList + */ + function initializeNetworkInfo(guid, networkStateList) { assertFalse(!!networkInfoElement); + provider.setFakeNetworkGuidInfo(fakeNetworkGuidInfoList); + provider.setFakeNetworkState(guid, networkStateList); // Add the network info to the DOM. networkInfoElement = /** @type {!NetworkInfoElement} */ ( document.createElement('network-info')); assertTrue(!!networkInfoElement); + networkInfoElement.guid = guid; document.body.appendChild(networkInfoElement); return flushTasks(); } - test('NetworkInfoPopulated', () => { - return initializeNetworkInfo().then(() => { + test('NetworkStatePopulated', () => { + return initializeNetworkInfo('wifiGuid', [fakeWifiNetwork]).then(() => { dx_utils.assertElementContainsText( - networkInfoElement.$$('#cardTitle'), 'Network'); - }); - }); - - test('WifiInfoPresent', () => { - return initializeNetworkInfo().then(() => { - const wifiInfoElement = networkInfoElement.$$('wifi-info'); - assertTrue(!!wifiInfoElement); - }); - }); - - test('EthernetInfoPresent', () => { - return initializeNetworkInfo().then(() => { - const ethernetInfoElement = networkInfoElement.$$('ethernet-info'); - assertTrue(!!ethernetInfoElement); - }); - }); - - test('CellularInfoPresent', () => { - return initializeNetworkInfo().then(() => { - const cellularInfoElement = networkInfoElement.$$('cellular-info'); - assertTrue(!!cellularInfoElement); + networkInfoElement.$$('#guid'), fakeWifiNetwork.guid); }); }); } \ No newline at end of file
diff --git a/chrome/test/data/webui/chromeos/diagnostics/network_list_test.js b/chrome/test/data/webui/chromeos/diagnostics/network_list_test.js index e345bb97..ccd38c7b 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/network_list_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/network_list_test.js
@@ -5,7 +5,7 @@ import 'chrome://diagnostics/network_list.js'; import {NetworkGuidInfo} from 'chrome://diagnostics/diagnostics_types.js'; -import {fakeNetworkGuidInfoList} from 'chrome://diagnostics/fake_data.js'; +import {fakeCellularNetwork, fakeEthernetNetwork, fakeNetworkGuidInfoList, fakeWifiNetwork} from 'chrome://diagnostics/fake_data.js'; import {FakeNetworkHealthProvider} from 'chrome://diagnostics/fake_network_health_provider.js'; import {setNetworkHealthProviderForTesting} from 'chrome://diagnostics/mojo_interface_provider.js'; @@ -42,6 +42,9 @@ function initializeNetworkList(fakeNetworkGuidInfoList) { assertFalse(!!networkListElement); provider.setFakeNetworkGuidInfo(fakeNetworkGuidInfoList); + provider.setFakeNetworkState('ethernetGuid', [fakeEthernetNetwork]); + provider.setFakeNetworkState('wifiGuid', [fakeWifiNetwork]); + provider.setFakeNetworkState('cellularGuid', [fakeCellularNetwork]); // Add the network list to the DOM. networkListElement = /** @type {!NetworkListElement} */ ( @@ -139,4 +142,18 @@ } }); }); + + test('NetworkInfoElementsPopulated', () => { + let networkInfoElements; + return initializeNetworkList(fakeNetworkGuidInfoList).then(async () => { + networkInfoElements = getNetworkInfoElements(); + // The first network list observation provides guids for Cellular + // and WiFi. The connectivity-card is responsbile for the Ethernet + // guid as it's the currently active guid. + dx_utils.assertElementContainsText( + networkInfoElements[0].$$('#guid'), fakeWifiNetwork.guid); + dx_utils.assertElementContainsText( + networkInfoElements[1].$$('#guid'), fakeCellularNetwork.guid); + }); + }); } \ No newline at end of file
diff --git a/chrome/test/data/webui/chromeos/scanning/scanning_app_test.js b/chrome/test/data/webui/chromeos/scanning/scanning_app_test.js index ccabab10..98e6e36 100644 --- a/chrome/test/data/webui/chromeos/scanning/scanning_app_test.js +++ b/chrome/test/data/webui/chromeos/scanning/scanning_app_test.js
@@ -1113,9 +1113,12 @@ return; } + const selectedPath = {baseName: 'path', filePath: 'valid/scan/to/path'}; + testBrowserProxy.setSavedSettingsSelectedPath(selectedPath); + const savedScanSettings = { lastUsedScannerName: firstScannerName, - scanToPath: 'scan/to/path', + scanToPath: selectedPath.filePath, scanners: [{ name: firstScannerName, lastScanDate: new Date(), @@ -1139,7 +1142,7 @@ assertEquals( ADF_DUPLEX, scanningApp.$$('#sourceSelect').$$('select').value); assertEquals( - loadTimeData.getString('myFilesSelectOption'), + selectedPath.baseName, scanningApp.$$('#scanToSelect').$$('select').value); assertEquals( ash.scanning.mojom.FileType.kPng.toString(), @@ -1162,9 +1165,12 @@ return; } + const selectedPath = {baseName: 'path', filePath: 'valid/scan/to/path'}; + testBrowserProxy.setSavedSettingsSelectedPath(selectedPath); + const savedScanSettings = { lastUsedScannerName: firstScannerName, - scanToPath: 'scan/to/path', + scanToPath: 'this/path/does/not/exist', scanners: [{ name: firstScannerName, lastScanDate: new Date(),
diff --git a/chrome/test/data/webui/chromeos/scanning/test_scanning_browser_proxy.js b/chrome/test/data/webui/chromeos/scanning/test_scanning_browser_proxy.js index 1d5df8c..a3bdd470 100644 --- a/chrome/test/data/webui/chromeos/scanning/test_scanning_browser_proxy.js +++ b/chrome/test/data/webui/chromeos/scanning/test_scanning_browser_proxy.js
@@ -7,6 +7,11 @@ import {assertArrayEquals, assertEquals} from '../../chai_assert.js'; import {TestBrowserProxy} from '../../test_browser_proxy.m.js'; +const EMPTY_SELECTED_PATH = { + baseName: '', + filePath: '' +}; + /** * Test version of ScanningBrowserProxy. * @implements {ScanningBrowserProxy} @@ -25,10 +30,11 @@ 'recordNumScanSettingChanges', 'saveScanSettings', 'getScanSettings', + 'ensureValidFilePath', ]); - /** @private {?SelectedPath} */ - this.selectedPath_ = null; + /** @private {!SelectedPath} */ + this.selectedPath_ = EMPTY_SELECTED_PATH; /** @private {?string} */ this.pathToFile_ = null; @@ -44,6 +50,9 @@ /** @private {string} */ this.savedSettings_ = ''; + + /** @private {!SelectedPath} */ + this.savedSettingsSelectedPath_ = EMPTY_SELECTED_PATH; } /** @override */ @@ -122,6 +131,15 @@ return Promise.resolve(this.savedSettings_); } + /** @override */ + ensureValidFilePath(filePath) { + this.methodCalled('ensureValidFilePath'); + return Promise.resolve( + filePath === this.savedSettingsSelectedPath_.filePath ? + this.savedSettingsSelectedPath_ : + EMPTY_SELECTED_PATH); + } + /** @param {!SelectedPath} selectedPath */ setSelectedPath(selectedPath) { this.selectedPath_ = selectedPath; @@ -151,4 +169,9 @@ setExpectedNumScanSettingChanges(numChanges) { this.expectedNumScanSettingChanges_ = numChanges; } + + /** @param {!SelectedPath} selectedPath */ + setSavedSettingsSelectedPath(selectedPath) { + this.savedSettingsSelectedPath_ = selectedPath; + } }
diff --git a/chrome/test/data/webui/cr_components/chromeos/cellular_setup/activation_code_page_test.js b/chrome/test/data/webui/cr_components/chromeos/cellular_setup/activation_code_page_test.js index c9d41b44..cbd6c29f 100644 --- a/chrome/test/data/webui/cr_components/chromeos/cellular_setup/activation_code_page_test.js +++ b/chrome/test/data/webui/cr_components/chromeos/cellular_setup/activation_code_page_test.js
@@ -74,7 +74,6 @@ const useCameraAgainButton = activationCodePage.$$('#useCameraAgainButton'); const scanSuccessContainer = activationCodePage.$$('#scanSuccessContainer'); const scanFailureContainer = activationCodePage.$$('#scanFailureContainer'); - const spinner = activationCodePage.$$('paper-spinner-lite'); assertTrue(!!qrCodeDetectorContainer); assertTrue(!!activationCodeContainer); @@ -86,7 +85,7 @@ assertTrue(!!useCameraAgainButton); assertTrue(!!scanSuccessContainer); assertTrue(!!scanFailureContainer); - assertTrue(!!spinner); + assertFalse(!!activationCodePage.$$('paper-spinner-lite')); // Initial state should only be showing the start scanning UI. assertFalse(startScanningContainer.hidden); @@ -94,7 +93,7 @@ assertTrue(video.hidden); assertTrue(scanFinishContainer.hidden); assertTrue(switchCameraButton.hidden); - assertTrue(spinner.hidden); + assertFalse(!!activationCodePage.$$('paper-spinner-lite')); // Click the start scanning button. startScanningButton.click(); @@ -167,10 +166,12 @@ assertTrue(video.hidden); assertTrue(scanFinishContainer.hidden); assertTrue(switchCameraButton.hidden); - assertTrue(spinner.hidden); + assertFalse(!!activationCodePage.$$('paper-spinner-lite')); activationCodePage.showBusy = true; - assertFalse(spinner.hidden); + await flushAsync(); + assertTrue(!!activationCodePage.$$('paper-spinner-lite')); + assertTrue(useCameraAgainButton.classList.contains('hidden')); // Mock, no media devices present mediaDevices.removeDevice();
diff --git a/chrome/test/data/webui/cr_components/chromeos/cellular_setup/psim_flow_ui_test.js b/chrome/test/data/webui/cr_components/chromeos/cellular_setup/psim_flow_ui_test.js index 176556b..fcc3183 100644 --- a/chrome/test/data/webui/cr_components/chromeos/cellular_setup/psim_flow_ui_test.js +++ b/chrome/test/data/webui/cr_components/chromeos/cellular_setup/psim_flow_ui_test.js
@@ -14,6 +14,7 @@ // #import {FakeCellularSetupDelegate} from './fake_cellular_setup_delegate.m.js'; // #import {FakeCarrierPortalHandlerRemote, FakeCellularSetupRemote} from './fake_cellular_setup_remote.m.js'; // #import {MockMetricsPrivate} from './mock_metrics_private.m.js'; +// #import {eventToPromise, flushTasks} from 'chrome://test/test_util.m.js'; // clang-format on suite('CrComponentsPsimFlowUiTest', function() { @@ -67,7 +68,7 @@ 0); } - setup(function() { + setup(async function() { cellularCarrierHandler = new cellular_setup.FakeCarrierPortalHandlerRemote(); cellularSetupRemote = @@ -81,7 +82,11 @@ timeoutFunction = fn; return 1; }); + + const focusNextButtonPromise = + test_util.eventToPromise('focus-default-button', pSimPage); pSimPage.initSubflow(); + await focusNextButtonPromise; document.body.appendChild(pSimPage); Polymer.dom.flush(); });
diff --git a/chrome/test/data/webui/print_preview/cloud_print_interface_stub.js b/chrome/test/data/webui/print_preview/cloud_print_interface_stub.js index dcaba4a..6566970 100644 --- a/chrome/test/data/webui/print_preview/cloud_print_interface_stub.js +++ b/chrome/test/data/webui/print_preview/cloud_print_interface_stub.js
@@ -64,9 +64,6 @@ /** @override */ areCookieDestinationsDisabled() {} - /** @override */ - processInvite() {} - /** * @param {!Destination} printer The destination to return * when the printer is requested. @@ -131,9 +128,6 @@ this.eventTarget_.dispatchEvent(searchDoneEvent); } - /** @override */ - invites(account) {} - /** * Dispatches a CloudPrintInterfaceEventType.PRINTER_DONE event with the * printer details if the printer has been added by calling setPrinter().
diff --git a/chrome/test/data/webui/print_preview/destination_dialog_cros_test.js b/chrome/test/data/webui/print_preview/destination_dialog_cros_test.js index 1a6883ad..01be3c5 100644 --- a/chrome/test/data/webui/print_preview/destination_dialog_cros_test.js +++ b/chrome/test/data/webui/print_preview/destination_dialog_cros_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationStore, DestinationType, InvitationStore, LocalDestinationInfo, makeRecentDestination, NativeLayerImpl, RecentDestination} from 'chrome://print/print_preview.js'; +import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationStore, DestinationType, LocalDestinationInfo, makeRecentDestination, NativeLayerImpl, RecentDestination} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {webUIListenerCallback} from 'chrome://resources/js/cr.m.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; @@ -83,7 +83,6 @@ dialog.activeUser = ''; dialog.users = []; dialog.destinationStore = destinationStore; - dialog.invitationStore = new InvitationStore(); }); function finishSetup() {
diff --git a/chrome/test/data/webui/print_preview/destination_dialog_test.js b/chrome/test/data/webui/print_preview/destination_dialog_test.js index 4aaf8542..8b289ee 100644 --- a/chrome/test/data/webui/print_preview/destination_dialog_test.js +++ b/chrome/test/data/webui/print_preview/destination_dialog_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationStore, DestinationType, InvitationStore, LocalDestinationInfo, makeRecentDestination, NativeLayerImpl, RecentDestination} from 'chrome://print/print_preview.js'; +import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationStore, DestinationType, LocalDestinationInfo, makeRecentDestination, NativeLayerImpl, RecentDestination} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {keyEventOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; @@ -75,7 +75,6 @@ dialog.activeUser = ''; dialog.users = []; dialog.destinationStore = destinationStore; - dialog.invitationStore = new InvitationStore(); }); function finishSetup() {
diff --git a/chrome/test/data/webui/print_preview/destination_search_test.js b/chrome/test/data/webui/print_preview/destination_search_test.js index 0f7eba36..a4b2bfd 100644 --- a/chrome/test/data/webui/print_preview/destination_search_test.js +++ b/chrome/test/data/webui/print_preview/destination_search_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationStore, DestinationType, InvitationStore, NativeLayer, NativeLayerImpl} from 'chrome://print/print_preview.js'; +import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationStore, DestinationType, NativeLayer, NativeLayerImpl} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -57,7 +57,6 @@ dialog.users = []; dialog.activeUser = ''; dialog.destinationStore = destinationStore; - dialog.invitationStore = new InvitationStore(); document.body.innerHTML = ''; document.body.appendChild(dialog); return nativeLayer.whenCalled('getPrinterCapabilities').then(function() {
diff --git a/chrome/test/data/webui/print_preview/destination_search_test_chromeos.js b/chrome/test/data/webui/print_preview/destination_search_test_chromeos.js index 6b91a76..e08b1f6 100644 --- a/chrome/test/data/webui/print_preview/destination_search_test_chromeos.js +++ b/chrome/test/data/webui/print_preview/destination_search_test_chromeos.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {ColorModeRestriction, Destination, DestinationConnectionStatus, DestinationOrigin, DestinationStore, DestinationType, DuplexModeRestriction, InvitationStore, NativeLayer, NativeLayerCrosImpl, NativeLayerImpl} from 'chrome://print/print_preview.js'; +import {ColorModeRestriction, Destination, DestinationConnectionStatus, DestinationOrigin, DestinationStore, DestinationType, DuplexModeRestriction, NativeLayer, NativeLayerCrosImpl, NativeLayerImpl} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; import {NativeEventTarget as EventTarget} from 'chrome://resources/js/cr/event_target.m.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -67,7 +67,6 @@ dialog.users = []; dialog.activeUser = ''; dialog.destinationStore = destinationStore; - dialog.invitationStore = new InvitationStore(); document.body.innerHTML = ''; document.body.appendChild(dialog); return nativeLayer.whenCalled('getPrinterCapabilities').then(function() {
diff --git a/chrome/test/data/webui/print_preview/destination_select_test.js b/chrome/test/data/webui/print_preview/destination_select_test.js index 39d9cc1..814674a 100644 --- a/chrome/test/data/webui/print_preview/destination_select_test.js +++ b/chrome/test/data/webui/print_preview/destination_select_test.js
@@ -8,6 +8,7 @@ import {Base} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertEquals, assertFalse, assertTrue} from '../chai_assert.js'; +import {waitAfterNextRender} from '../test_util.m.js'; import {getGoogleDriveDestination, selectOption} from './print_preview_test_utils.js'; @@ -30,10 +31,6 @@ /** @type {!DestinationOrigin} */ const cookieOrigin = DestinationOrigin.COOKIES; - /** @type {string} */ - const driveKey = - `${Destination.GooglePromotedId.DOCS}/${cookieOrigin}/${account}`; - /** @type {!Array<!Destination>} */ let recentDestinationList = []; @@ -55,6 +52,7 @@ destinationSelect.recentDestinationList = recentDestinationList; document.body.appendChild(destinationSelect); + return waitAfterNextRender(destinationSelect); }); // Create three different destinations and use them to populate @@ -64,6 +62,7 @@ new Destination( 'ID1', DestinationType.LOCAL, DestinationOrigin.LOCAL, 'One', DestinationConnectionStatus.ONLINE), + getGoogleDriveDestination(account), new Destination( 'ID2', DestinationType.GOOGLE, cookieOrigin, 'Two', DestinationConnectionStatus.OFFLINE, {account: account}), @@ -100,15 +99,14 @@ destinationSelect.loaded = true; const selectEl = destinationSelect.$$('.md-select'); compareIcon(selectEl, 'print'); - destinationSelect.driveDestinationKey = driveKey; - return selectOption(destinationSelect, driveKey) + return selectOption(destinationSelect, recentDestinationList[1].key) .then(() => { // Icon updates early based on the ID. compareIcon(selectEl, 'save-to-drive'); // Update the destination. - destinationSelect.destination = getGoogleDriveDestination(account); + destinationSelect.destination = recentDestinationList[1]; // Still Save to Drive icon. compareIcon(selectEl, 'save-to-drive'); @@ -122,7 +120,7 @@ compareIcon(selectEl, 'printer-shared'); // Update destination. - destinationSelect.destination = recentDestinationList[1]; + destinationSelect.destination = recentDestinationList[2]; compareIcon(selectEl, 'printer-shared'); // Select a destination with a standard printer icon. @@ -133,7 +131,7 @@ compareIcon(selectEl, 'print'); // Update destination. - destinationSelect.destination = recentDestinationList[2]; + destinationSelect.destination = recentDestinationList[3]; compareIcon(selectEl, 'print'); // Select a destination with the enterprise printer icon. @@ -145,7 +143,7 @@ compareIcon(selectEl, enterpriseIcon); // Update destination. - destinationSelect.destination = recentDestinationList[3]; + destinationSelect.destination = recentDestinationList[4]; compareIcon(selectEl, enterpriseIcon); // Select a destination with the mobile printer icon. @@ -157,7 +155,7 @@ compareIcon(selectEl, mobileIcon); // Update destination. - destinationSelect.destination = recentDestinationList[4]; + destinationSelect.destination = recentDestinationList[5]; compareIcon(selectEl, mobileIcon); }); } @@ -182,8 +180,7 @@ destinationSelect.$$('.destination-additional-info'); const statusEl = destinationSelect.$$('.destination-status'); - destinationSelect.driveDestinationKey = driveKey; - destinationSelect.destination = getGoogleDriveDestination(account); + destinationSelect.destination = recentDestinationList[1]; destinationSelect.updateDestination(); assertTrue(additionalInfoEl.hidden); assertEquals('', statusEl.innerHTML); @@ -193,12 +190,12 @@ assertTrue(additionalInfoEl.hidden); assertEquals('', statusEl.innerHTML); - destinationSelect.destination = recentDestinationList[1]; + destinationSelect.destination = recentDestinationList[2]; destinationSelect.updateDestination(); assertFalse(additionalInfoEl.hidden); assertEquals('offline', statusEl.innerHTML); - destinationSelect.destination = recentDestinationList[2]; + destinationSelect.destination = recentDestinationList[3]; destinationSelect.updateDestination(); assertTrue(additionalInfoEl.hidden); assertEquals('', statusEl.innerHTML);
diff --git a/chrome/test/data/webui/print_preview/destination_settings_test.js b/chrome/test/data/webui/print_preview/destination_settings_test.js index d02fbd68a..b0d1ca8 100644 --- a/chrome/test/data/webui/print_preview/destination_settings_test.js +++ b/chrome/test/data/webui/print_preview/destination_settings_test.js
@@ -61,9 +61,6 @@ /** @type {!Array<!Destination>} */ const extraDestinations = []; - /** @type {!Array<string>} */ - let initialAccounts = []; - /** @type {boolean} */ let pdfPrinterDisabled = false; @@ -74,7 +71,7 @@ const defaultUser = 'foo@chromium.org'; /** @type {string} */ - let dropdownDriveDestination = isChromeOS ? + const driveDestinationKey = isChromeOS ? 'Save to Drive CrOS/local/' : '__google__docs/cookies/foo@chromium.org'; @@ -216,15 +213,6 @@ destinationSettings.disabled = false; } - // Simulates a user being signed in to cloud print. Call before initialize. - function signIn() { - cloudPrintInterface.setPrinter(getGoogleDriveDestination(defaultUser)); - const whenSearchDone = eventToPromise( - CloudPrintInterfaceEventType.SEARCH_DONE, - cloudPrintInterface.getEventTarget()); - return whenSearchDone.then(() => waitBeforeNextRender(destinationSettings)); - } - /** * @param {string} id The id of the local destination. * @return {string} The key corresponding to the local destination, with the @@ -253,28 +241,20 @@ test( assert(destination_settings_test.TestNames.NoRecentDestinations), function() { - const whenCloudPrintDone = signIn(); initialize(); - return Promise - .all([ - nativeLayer.whenCalled('getPrinterCapabilities'), - // <if expr="not chromeos"> - whenCloudPrintDone, - // </if> - ]) - .then(() => { - // This will result in the destination store setting the Save as - // PDF destination. - assertEquals( - Destination.GooglePromotedId.SAVE_AS_PDF, - destinationSettings.destination.id); - assertFalse( - destinationSettings.$$('#destinationSelect').disabled); - assertDropdownItems([ - 'Save as PDF/local/', - dropdownDriveDestination, - ]); - }); + return nativeLayer.whenCalled('getPrinterCapabilities').then(() => { + // This will result in the destination store setting the Save as + // PDF destination. + assertEquals( + Destination.GooglePromotedId.SAVE_AS_PDF, + destinationSettings.destination.id); + assertFalse(destinationSettings.$$('#destinationSelect').disabled); + const dropdownItems = ['Save as PDF/local/']; + if (isChromeOS) { + dropdownItems.push(driveDestinationKey); + } + assertDropdownItems(dropdownItems); + }); }); // Tests that the dropdown contains the appropriate destinations when there @@ -285,12 +265,8 @@ recentDestinations = destinations.slice(0, 5).map( destination => makeRecentDestination(destination)); - const whenCapabilitiesDone = Promise.all([ - // <if expr="not chromeos"> - signIn(), - // </if> - nativeLayer.whenCalled('getPrinterCapabilities'), - ]); + const whenCapabilitiesDone = + nativeLayer.whenCalled('getPrinterCapabilities'); initialize(); // Wait for the destinations to be inserted into the store. @@ -304,13 +280,16 @@ assertEquals('ID1', destinationSettings.destination.id); assertFalse( destinationSettings.$$('#destinationSelect').disabled); - assertDropdownItems([ + const dropdownItems = [ makeLocalDestinationKey('ID1'), makeLocalDestinationKey('ID2'), makeLocalDestinationKey('ID3'), 'Save as PDF/local/', - dropdownDriveDestination, - ]); + ]; + if (isChromeOS) { + dropdownItems.push(driveDestinationKey); + } + assertDropdownItems(dropdownItems); }); }); @@ -345,7 +324,7 @@ 'Save as PDF/local/', ]; if (isChromeOS) { - dropdownItems.push(dropdownDriveDestination); + dropdownItems.push(driveDestinationKey); } assertDropdownItems(dropdownItems); }); @@ -378,7 +357,7 @@ 'Save as PDF/local/', ]; if (isChromeOS) { - dropdownItems.push(dropdownDriveDestination); + dropdownItems.push(driveDestinationKey); } assertDropdownItems(dropdownItems); }); @@ -394,12 +373,9 @@ recentDestinations.splice( 1, 1, makeRecentDestination(getGoogleDriveDestination(defaultUser))); - const whenCapabilitiesDone = Promise.all([ - // <if expr="not chromeos"> - signIn(), - // </if> - nativeLayer.whenCalled('getPrinterCapabilities'), - ]); + cloudPrintInterface.setPrinter(getGoogleDriveDestination(defaultUser)); + const whenCapabilitiesDone = + nativeLayer.whenCalled('getPrinterCapabilities'); initialize(); return whenCapabilitiesDone @@ -413,13 +389,24 @@ assertFalse( destinationSettings.$$('#destinationSelect').disabled); - assertDropdownItems([ - makeLocalDestinationKey('ID1'), - makeLocalDestinationKey('ID3'), - makeLocalDestinationKey('ID4'), - 'Save as PDF/local/', - dropdownDriveDestination, - ]); + let dropdownItems; + if (isChromeOS) { + dropdownItems = [ + makeLocalDestinationKey('ID1'), + makeLocalDestinationKey('ID3'), + makeLocalDestinationKey('ID4'), + 'Save as PDF/local/', + driveDestinationKey, + ]; + } else { + dropdownItems = [ + makeLocalDestinationKey('ID1'), + driveDestinationKey, + makeLocalDestinationKey('ID3'), + 'Save as PDF/local/', + ]; + } + assertDropdownItems(dropdownItems); }); }); @@ -437,7 +424,6 @@ const whenSelected = eventToPromise( DestinationStore.EventType.DESTINATION_SELECT, destinationSettings.getDestinationStoreForTest()); - initialAccounts = [defaultUser]; cloudPrintInterface.setPrinter(getGoogleDriveDestination(defaultUser)); initialize(); @@ -449,17 +435,26 @@ // This will result in the destination store setting the most // recent destination. assertEquals( - '__google__docs', destinationSettings.destination.id); + isChromeOS ? 'ID2' : '__google__docs', + destinationSettings.destination.id); assertFalse( destinationSettings.$$('#destinationSelect').disabled); - assertDropdownItems([ - makeLocalDestinationKey('ID2'), - makeLocalDestinationKey('ID3'), - makeLocalDestinationKey('ID4'), - 'Save as PDF/local/', - dropdownDriveDestination, - ]); + const dropdownItems = isChromeOS ? + [ + makeLocalDestinationKey('ID2'), + makeLocalDestinationKey('ID3'), + makeLocalDestinationKey('ID4'), + 'Save as PDF/local/', + driveDestinationKey, + ] : + [ + driveDestinationKey, + makeLocalDestinationKey('ID2'), + makeLocalDestinationKey('ID3'), + 'Save as PDF/local/', + ]; + assertDropdownItems(dropdownItems); }); }); @@ -493,7 +488,7 @@ 'Save as PDF/local/', ]; if (isChromeOS) { - dropdownItems.push(dropdownDriveDestination); + dropdownItems.push(driveDestinationKey); } assertDropdownItems(dropdownItems); // Most recent destination is selected by default. @@ -526,12 +521,9 @@ recentDestinations.splice( 1, 1, makeRecentDestination(getGoogleDriveDestination(defaultUser))); - const whenCapabilitiesDone = Promise.all([ - // <if expr="not chromeos"> - signIn(), - // </if> - nativeLayer.whenCalled('getPrinterCapabilities'), - ]); + cloudPrintInterface.setPrinter(getGoogleDriveDestination(defaultUser)); + const whenCapabilitiesDone = + nativeLayer.whenCalled('getPrinterCapabilities'); initialize(); const dropdown = destinationSettings.$$('#destinationSelect'); @@ -543,22 +535,31 @@ // This will result in the destination store setting the most // recent destination. assertEquals('ID1', destinationSettings.destination.id); - assertDropdownItems([ - makeLocalDestinationKey('ID1'), - makeLocalDestinationKey('ID3'), - makeLocalDestinationKey('ID4'), - 'Save as PDF/local/', - dropdownDriveDestination, - ]); - - // Most recent destination is still selected. - assertEquals('ID1', destinationSettings.destination.id); + let dropdownItems; + if (isChromeOS) { + dropdownItems = [ + makeLocalDestinationKey('ID1'), + makeLocalDestinationKey('ID3'), + makeLocalDestinationKey('ID4'), + 'Save as PDF/local/', + driveDestinationKey, + ]; + } else { + dropdownItems = [ + makeLocalDestinationKey('ID1'), + driveDestinationKey, + makeLocalDestinationKey('ID3'), + 'Save as PDF/local/', + ]; + } + assertDropdownItems(dropdownItems); + assertFalse(dropdown.disabled); // Simulate selection of Google Drive printer. const whenDestinationSelect = eventToPromise( DestinationStore.EventType.DESTINATION_SELECT, destinationSettings.getDestinationStoreForTest()); - dropdown.fire('selected-option-change', dropdownDriveDestination); + dropdown.fire('selected-option-change', driveDestinationKey); return whenDestinationSelect; }) .then(() => { @@ -598,7 +599,7 @@ 'Save as PDF/local/', ]; if (isChromeOS) { - dropdownItems.push(dropdownDriveDestination); + dropdownItems.push(driveDestinationKey); } assertDropdownItems(dropdownItems); @@ -640,7 +641,7 @@ 'Save as PDF/local/', ]; if (isChromeOS) { - dropdownItems.push(dropdownDriveDestination); + dropdownItems.push(driveDestinationKey); } assertDropdownItems(dropdownItems); @@ -683,7 +684,6 @@ cloudPrinterUser1, cloudPrinterUser2, destinations[0] ].map(destination => makeRecentDestination(destination)); - initialAccounts = [defaultUser, account2]; initialize(); flush(); @@ -699,13 +699,16 @@ // recent destination. assertEquals('FooCloud', destinationSettings.destination.id); assertFalse(dropdown.disabled); - assertDropdownItems([ + const dropdownItems = [ 'FooCloud/cookies/foo@chromium.org', makeLocalDestinationKey('ID1'), 'Save as PDF/local/', - dropdownDriveDestination, - ]); + ]; + if (isChromeOS) { + dropdownItems.push(driveDestinationKey); + } + assertDropdownItems(dropdownItems); dropdown.fire('selected-option-change', 'seeMore'); return waitBeforeNextRender(destinationSettings); }) @@ -724,15 +727,15 @@ return whenAdded; }) .then(() => { - dropdownDriveDestination = isChromeOS ? - 'Save to Drive CrOS/local/' : - '__google__docs/cookies/bar@chromium.org'; - assertDropdownItems([ + const dropdownItems = [ 'BarCloud/cookies/bar@chromium.org', makeLocalDestinationKey('ID1'), 'Save as PDF/local/', - dropdownDriveDestination, - ]); + ]; + if (isChromeOS) { + dropdownItems.push(driveDestinationKey); + } + assertDropdownItems(dropdownItems); }); });
diff --git a/chrome/test/data/webui/print_preview/user_manager_test.js b/chrome/test/data/webui/print_preview/user_manager_test.js index 4976650..492d9fb 100644 --- a/chrome/test/data/webui/print_preview/user_manager_test.js +++ b/chrome/test/data/webui/print_preview/user_manager_test.js
@@ -2,18 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {CloudPrintInterfaceEventType, CloudPrintInterfaceImpl, DestinationStore, InvitationStore, NativeLayer, NativeLayerImpl} from 'chrome://print/print_preview.js'; +import {CloudPrintInterfaceImpl, DestinationStore, NativeLayer, NativeLayerImpl} from 'chrome://print/print_preview.js'; import {assert} from 'chrome://resources/js/assert.m.js'; -import {isChromeOS, webUIListenerCallback} from 'chrome://resources/js/cr.m.js'; +import {webUIListenerCallback} from 'chrome://resources/js/cr.m.js'; import {CloudPrintInterfaceStub} from 'chrome://test/print_preview/cloud_print_interface_stub.js'; import {NativeLayerStub} from 'chrome://test/print_preview/native_layer_stub.js'; import {createDestinationStore, getDestinations, getGoogleDriveDestination, setupTestListenerElement} from 'chrome://test/print_preview/print_preview_test_utils.js'; -import {eventToPromise} from '../test_util.m.js'; - // <if expr="chromeos"> import {setNativeLayerCrosInstance} from './native_layer_cros_stub.js'; - // </if> suite('UserManagerTest', function() { @@ -50,9 +47,6 @@ cloudPrintInterface = new CloudPrintInterfaceStub(); CloudPrintInterfaceImpl.instance_ = cloudPrintInterface; cloudPrintInterface.setPrinter(getGoogleDriveDestination(account1)); - const whenSearchDone = eventToPromise( - CloudPrintInterfaceEventType.SEARCH_DONE, - cloudPrintInterface.getEventTarget()); userManager = document.createElement('print-preview-user-manager'); @@ -66,7 +60,6 @@ // Set up user manager userManager.appKioskMode = false; userManager.destinationStore = destinationStore; - userManager.invitationStore = new InvitationStore(); userManager.shouldReloadCookies = false; userManager.cloudPrintDisabled = false; document.body.appendChild(userManager); @@ -75,25 +68,18 @@ false /* pdfPrinterDisabled */, true /* isDriveMounted */, 'FooDevice' /* printerName */, '' /* serializedDefaultDestinationSelectionRulesStr */, []); - - // <if expr="not chromeos"> - return whenSearchDone; - // </if> }); // Checks that initializing and updating user accounts works as expected. test('update users without sync', function() { - // Destination store will trigger a call to cloud print to determine the - // state of the Drive printer, which will in turn set the account state. - // This doesn't happen on Chrome OS which uses a different Drive. userManager.initUserAccounts(); - assertEquals(isChromeOS ? undefined : account1, userManager.activeUser); - assertEquals(isChromeOS ? 0 : 1, userManager.users.length); - assertEquals( - isChromeOS ? 0 : 2, cloudPrintInterface.getCallCount('search')); + assertEquals(undefined, userManager.activeUser); + assertEquals(0, userManager.users.length); + assertEquals(0, cloudPrintInterface.getCallCount('search')); - // Start reloading everything. This will set up the account on Chrome OS, - // which doesn't use the Google Cloud Print Drive in the dropdown. + // Simulate triggering the dialog since we have set a cloud printer. This + // should update the list of users and the active user and trigger a call to + // search. destinationStore.startLoadAllDestinations(); return cloudPrintInterface.whenCalled('search') .then(() => {
diff --git a/chrome/test/data/webui/settings/chromeos/os_about_page_tests.js b/chrome/test/data/webui/settings/chromeos/os_about_page_tests.js index 2d59c018..5aa535e0 100644 --- a/chrome/test/data/webui/settings/chromeos/os_about_page_tests.js +++ b/chrome/test/data/webui/settings/chromeos/os_about_page_tests.js
@@ -114,7 +114,7 @@ fireStatusChanged(UpdateStatus.DISABLED_BY_ADMIN); assertEquals(null, icon.src); assertEquals('cr20:domain', icon.icon); - assertEquals(0, statusMessageEl.textContent.trim().length); + assertNotEquals(previousMessageText, statusMessageEl.textContent); fireStatusChanged(UpdateStatus.FAILED); assertEquals(null, icon.src); @@ -220,7 +220,8 @@ assertAllHidden(); fireStatusChanged(UpdateStatus.DISABLED_BY_ADMIN); - assertAllHidden(); + assertFalse(checkForUpdates.hidden); + assertTrue(relaunch.hidden); }); /**
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js index a690a86..616650b 100644 --- a/chrome/test/data/webui/settings/cr_settings_browsertest.js +++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -148,6 +148,13 @@ .grep(languages_subpage_details_tests.TestNames.AlwaysTranslateDialog) .run(); }); + +TEST_F( + 'CrSettingsLanguagesSubpageDetailedV3Test', 'NeverTranslateDialog', + function() { + mocha.grep(languages_subpage_details_tests.TestNames.NeverTranslateDialog) + .run(); + }); GEN('#endif'); // eslint-disable-next-line no-var
diff --git a/chrome/test/data/webui/settings/cr_settings_v3_browsertest.js b/chrome/test/data/webui/settings/cr_settings_v3_browsertest.js deleted file mode 100644 index 06809a4..0000000 --- a/chrome/test/data/webui/settings/cr_settings_v3_browsertest.js +++ /dev/null
@@ -1,640 +0,0 @@ -// Copyright 2020 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. - -/** @fileoverview Tests for shared Polymer 3 elements. */ - -// Polymer BrowserTest fixture. -GEN_INCLUDE(['//chrome/test/data/webui/polymer_browser_test_base.js']); - -GEN('#include "build/branding_buildflags.h"'); -GEN('#include "build/chromeos_buildflags.h"'); -GEN('#include "chrome/common/chrome_features.h"'); -GEN('#include "components/autofill/core/common/autofill_features.h"'); -GEN('#include "components/password_manager/core/common/password_manager_features.h"'); -GEN('#include "content/public/test/browser_test.h"'); - -/** Test fixture for shared Polymer 3 elements. */ -// eslint-disable-next-line no-var -var CrSettingsV3BrowserTest = class extends PolymerTest { - /** @override */ - get browsePreload() { - return 'chrome://settings'; - } - - /** @override */ - get featureList() { - if (!this.featureListInternal.enabled && - !this.featureListInternal.disabled) { - return null; - } - return this.featureListInternal; - } - - /** @return {!{enabled: !Array<string>, disabled: !Array<string>}} */ - get featureListInternal() { - return {}; - } -}; - -// eslint-disable-next-line no-var -var CrSettingsAboutPageV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/about_page_tests.js'; - } -}; - -TEST_F('CrSettingsAboutPageV3Test', 'AboutPage', function() { - mocha.grep('AboutPageTest_AllBuilds').run(); -}); - -GEN('#if BUILDFLAG(GOOGLE_CHROME_BRANDING)'); -TEST_F('CrSettingsAboutPageV3Test', 'AboutPage_OfficialBuild', function() { - mocha.grep('AboutPageTest_OfficialBuilds').run(); -}); -GEN('#endif'); - -// eslint-disable-next-line no-var -var CrSettingsAvatarIconV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/avatar_icon_test.js'; - } -}; - -TEST_F('CrSettingsAvatarIconV3Test', 'All', function() { - mocha.run(); -}); - -// eslint-disable-next-line no-var -var CrSettingsLanguagesPageV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/languages_page_tests.js'; - } -}; - -TEST_F('CrSettingsLanguagesPageV3Test', 'Spellcheck', function() { - mocha.grep(languages_page_tests.TestNames.Spellcheck).run(); -}); - -GEN('#if BUILDFLAG(GOOGLE_CHROME_BRANDING)'); -TEST_F('CrSettingsLanguagesPageV3Test', 'SpellcheckOfficialBuild', function() { - mocha.grep(languages_page_tests.TestNames.SpellcheckOfficialBuild).run(); -}); -GEN('#endif'); - -GEN('#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS)'); -TEST_F( - 'CrSettingsLanguagesPageV3Test', 'RestructuredLanguageSettings', - function() { - mocha.grep(languages_page_tests.TestNames.RestructuredLanguageSettings) - .run(); - }); -GEN('#endif'); - -GEN('#if BUILDFLAG(IS_CHROMEOS_ASH)'); -TEST_F( - 'CrSettingsLanguagesPageV3Test', 'ChromeOSLanguagesSettingsUpdate', - function() { - mocha.grep(languages_page_tests.TestNames.ChromeOSLanguagesSettingsUpdate) - .run(); - }); -GEN('#endif'); - -// eslint-disable-next-line no-var -var CrSettingsLanguagesSubpageV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/languages_subpage_tests.js'; - } -}; - -TEST_F('CrSettingsLanguagesSubpageV3Test', 'AddLanguagesDialog', function() { - mocha.grep(languages_subpage_tests.TestNames.AddLanguagesDialog).run(); -}); - -TEST_F('CrSettingsLanguagesSubpageV3Test', 'LanguageMenu', function() { - mocha.grep(languages_subpage_tests.TestNames.LanguageMenu).run(); -}); - -GEN('#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS)'); -// eslint-disable-next-line no-var -var CrSettingsLanguagesSubpageDetailedV3Test = - class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/languages_subpage_details_tests.js'; - } -}; - -TEST_F( - 'CrSettingsLanguagesSubpageDetailedV3Test', 'AlwaysTranslateDialog', - function() { - mocha - .grep(languages_subpage_details_tests.TestNames.AlwaysTranslateDialog) - .run(); - }); - -TEST_F( - 'CrSettingsLanguagesSubpageDetailedV3Test', 'NeverTranslateDialog', - function() { - mocha.grep(languages_subpage_details_tests.TestNames.NeverTranslateDialog) - .run(); - }); - -GEN('#endif'); - -// eslint-disable-next-line no-var -var CrSettingsLanguagesPageMetricsV3Test = - class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/languages_page_metrics_test_browser.js'; - } -}; - -TEST_F( - 'CrSettingsLanguagesPageMetricsV3Test', 'LanguagesPageMetricsBrowser', - function() { - runMochaSuite('LanguagesPageMetricsBrowser'); - }); - -// eslint-disable-next-line no-var -var CrSettingsClearBrowsingDataV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/clear_browsing_data_test.js'; - } -}; - -// TODO(crbug.com/1107652): Flaky on Mac. -GEN('#if defined(OS_MAC)'); -GEN('#define MAYBE_ClearBrowsingDataAllPlatforms DISABLED_ClearBrowsingDataAllPlatforms'); -GEN('#else'); -GEN('#define MAYBE_ClearBrowsingDataAllPlatforms ClearBrowsingDataAllPlatforms'); -GEN('#endif'); -TEST_F( - 'CrSettingsClearBrowsingDataV3Test', 'MAYBE_ClearBrowsingDataAllPlatforms', - function() { - runMochaSuite('ClearBrowsingDataAllPlatforms'); - }); - -TEST_F('CrSettingsClearBrowsingDataV3Test', 'InstalledApps', () => { - runMochaSuite('InstalledApps'); -}); - -GEN('#if !BUILDFLAG(IS_CHROMEOS_ASH)'); -TEST_F( - 'CrSettingsClearBrowsingDataV3Test', 'ClearBrowsingDataDesktop', - function() { - runMochaSuite('ClearBrowsingDataDesktop'); - }); -GEN('#endif'); - - -// eslint-disable-next-line no-var -var CrSettingsMainPageV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/settings_main_test.js'; - } -}; - -// Copied from Polymer 2 version of tests: -// Times out on Windows Tests (dbg). See https://crbug.com/651296. -// Times out / crashes on chromium.linux/Linux Tests (dbg) crbug.com/667882 -// Flaky everywhere crbug.com/1197768 -TEST_F('CrSettingsMainPageV3Test', 'DISABLED_MainPageV3', function() { - mocha.run(); -}); - -// eslint-disable-next-line no-var -var CrSettingsAutofillPageV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/autofill_page_test.js'; - } -}; - -TEST_F('CrSettingsAutofillPageV3Test', 'All', function() { - mocha.run(); -}); - -// eslint-disable-next-line no-var -var CrSettingsAutofillSectionCompanyEnabledV3Test = - class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/autofill_section_test.js'; - } -}; - -TEST_F('CrSettingsAutofillSectionCompanyEnabledV3Test', 'All', function() { - // Use 'EnableCompanyName' to inform tests that the feature is enabled. - const loadTimeDataOverride = {}; - loadTimeDataOverride['EnableCompanyName'] = true; - loadTimeDataOverride['showHonorific'] = true; - loadTimeData.overrideValues(loadTimeDataOverride); - mocha.run(); -}); - -// eslint-disable-next-line no-var -var CrSettingsPasswordsSectionV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/passwords_section_test.js'; - } -}; - -// Flaky on Debug builds https://crbug.com/1090931 -GEN('#if !defined(NDEBUG)'); -GEN('#define MAYBE_All DISABLED_All'); -GEN('#else'); -GEN('#define MAYBE_All All'); -GEN('#endif'); -TEST_F('CrSettingsPasswordsSectionV3Test', 'MAYBE_All', function() { - mocha.run(); -}); -GEN('#undef MAYBE_All'); - -// eslint-disable-next-line no-var -var CrSettingsMultiStorePasswordUiEntryV3Test = - class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/multi_store_password_ui_entry_test.js'; - } -}; - -TEST_F('CrSettingsMultiStorePasswordUiEntryV3Test', 'All', function() { - mocha.run(); -}); - -// eslint-disable-next-line no-var -var CrSettingsPasswordsDeviceSectionV3Test = - class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/passwords_device_section_test.js'; - } - - /** @override */ - get featureListInternal() { - return { - enabled: ['password_manager::features::kEnablePasswordsAccountStorage'] - }; - } -}; - -TEST_F('CrSettingsPasswordsDeviceSectionV3Test', 'All', function() { - mocha.run(); -}); - -// eslint-disable-next-line no-var -var CrSettingsMultiStoreExceptionEntryV3Test = - class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/multi_store_exception_entry_test.js'; - } -}; - -TEST_F('CrSettingsMultiStoreExceptionEntryV3Test', 'All', function() { - mocha.run(); -}); - -// eslint-disable-next-line no-var -var CrSettingsPasswordsCheckV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/password_check_test.js'; - } - - /** @override */ - get featureList() { - return {enabled: ['features::kSafetyCheckWeakPasswords']}; - } -}; - -// Flaky on Mac builds https://crbug.com/1143801 -GEN('#if defined(OS_MAC)'); -GEN('#define MAYBE_All DISABLED_All'); -GEN('#else'); -GEN('#define MAYBE_All All'); -GEN('#endif'); -TEST_F('CrSettingsPasswordsCheckV3Test', 'MAYBE_All', function() { - mocha.run(); -}); -GEN('#undef MAYBE_All'); - -// eslint-disable-next-line no-var -var CrSettingsSafetyCheckPageV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/safety_check_page_test.js'; - } -}; - -TEST_F('CrSettingsSafetyCheckPageV3Test', 'All', function() { - mocha.run(); -}); - -// eslint-disable-next-line no-var -var CrSettingsSafetyCheckChromeCleanerV3Test = - class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/safety_check_chrome_cleaner_test.js'; - } - - /** @override */ - get featureListInternal() { - return { - enabled: [ - 'features::kSafetyCheckChromeCleanerChild', - ], - }; - } -}; - -GEN('#if defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)'); -TEST_F('CrSettingsSafetyCheckChromeCleanerV3Test', 'All', function() { - mocha.run(); -}); -GEN('#endif // defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)'); - -// eslint-disable-next-line no-var -var CrSettingsSiteListV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/site_list_tests.js'; - } -}; - -// Copied from Polymer 2 test: -// TODO(crbug.com/929455): flaky, fix. -TEST_F('CrSettingsSiteListV3Test', 'DISABLED_SiteList', function() { - runMochaSuite('SiteList'); -}); - -// TODO(crbug.com/929455): When the bug is fixed, merge -// SiteListEmbargoedOrigin into SiteList -TEST_F('CrSettingsSiteListV3Test', 'SiteListEmbargoedOrigin', function() { - runMochaSuite('SiteListEmbargoedOrigin'); -}); - -TEST_F('CrSettingsSiteListV3Test', 'EditExceptionDialog', function() { - runMochaSuite('EditExceptionDialog'); -}); - -TEST_F('CrSettingsSiteListV3Test', 'AddExceptionDialog', function() { - runMochaSuite('AddExceptionDialog'); -}); - -// eslint-disable-next-line no-var -var CrSettingsSiteDetailsV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/site_details_tests.js'; - } -}; - -// Disabling on debug due to flaky timeout on Win7 Tests (dbg)(1) bot. -// https://crbug.com/825304 - later for other platforms in crbug.com/1021219. -// Disabling on Linux CFI due to flaky timeout (crbug.com/1031960). -GEN('#if (!defined(NDEBUG)) || ((defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(IS_CFI))'); -GEN('#define MAYBE_SiteDetails DISABLED_SiteDetails'); -GEN('#else'); -GEN('#define MAYBE_SiteDetails SiteDetails'); -GEN('#endif'); - -TEST_F('CrSettingsSiteDetailsV3Test', 'MAYBE_SiteDetails', function() { - mocha.run(); -}); - -// eslint-disable-next-line no-var -var CrSettingsPersonalizationOptionsV3Test = - class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/personalization_options_test.js'; - } -}; - -TEST_F('CrSettingsPersonalizationOptionsV3Test', 'AllBuilds', function() { - runMochaSuite('PersonalizationOptionsTests_AllBuilds'); -}); - -GEN('#if BUILDFLAG(GOOGLE_CHROME_BRANDING)'); -TEST_F('CrSettingsPersonalizationOptionsV3Test', 'OfficialBuild', function() { - runMochaSuite('PersonalizationOptionsTests_OfficialBuild'); -}); -GEN('#endif'); - -// eslint-disable-next-line no-var -var CrSettingsPrivacyPageV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/privacy_page_test.js'; - } -}; - -TEST_F('CrSettingsPrivacyPageV3Test', 'PrivacyPageTests', function() { - runMochaSuite('PrivacyPage'); -}); - -TEST_F('CrSettingsPrivacyPageV3Test', 'ContentSettingsRedesign', function() { - runMochaSuite('ContentSettingsRedesign'); -}); - -TEST_F( - 'CrSettingsPrivacyPageV3Test', 'PrivacySandboxSettingsEnabled', function() { - runMochaSuite('PrivacySandboxSettingsEnabled'); - }); - -// TODO(crbug.com/1043665): flaky crash on Linux Tests (dbg). -TEST_F( - 'CrSettingsPrivacyPageV3Test', 'DISABLED_PrivacyPageSoundTests', - function() { - runMochaSuite('PrivacyPageSound'); - }); - -// TODO(crbug.com/1113912): flaky failure on multiple platforms -TEST_F( - 'CrSettingsPrivacyPageV3Test', 'DISABLED_HappinessTrackingSurveysTests', - function() { - runMochaSuite('HappinessTrackingSurveys'); - }); - -GEN('#if defined(OS_MAC) || defined(OS_WIN)'); -// TODO(crbug.com/1043665): disabling due to failures on several builders. -TEST_F( - 'CrSettingsPrivacyPageV3Test', 'DISABLED_CertificateManagerTests', - function() { - runMochaSuite('NativeCertificateManager'); - }); -GEN('#endif'); - -// eslint-disable-next-line no-var -var CrSettingsRouteV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/route_tests.js'; - } -}; - -TEST_F('CrSettingsRouteV3Test', 'Basic', function() { - runMochaSuite('route'); -}); - -TEST_F('CrSettingsRouteV3Test', 'DynamicParameters', function() { - runMochaSuite('DynamicParameters'); -}); - -// Copied from Polymer 2 test: -// Failing on ChromiumOS dbg. https://crbug.com/709442 -GEN('#if (defined(OS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH)) && !defined(NDEBUG)'); -GEN('#define MAYBE_NonExistentRoute DISABLED_NonExistentRoute'); -GEN('#else'); -GEN('#define MAYBE_NonExistentRoute NonExistentRoute'); -GEN('#endif'); - -TEST_F('CrSettingsRouteV3Test', 'MAYBE_NonExistentRoute', function() { - runMochaSuite('NonExistentRoute'); -}); - -// eslint-disable-next-line no-var -var CrSettingsAdvancedPageV3Test = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return 'chrome://settings/test_loader.html?module=settings/advanced_page_test.js'; - } -}; - -// Copied from Polymer 2 test: -// Times out on debug builders because the Settings page can take several -// seconds to load in a Release build and several times that in a Debug build. -// See https://crbug.com/558434. -GEN('#if !defined(NDEBUG)'); -GEN('#define MAYBE_Load DISABLED_Load'); -GEN('#else'); -GEN('#define MAYBE_Load Load'); -GEN('#endif'); -TEST_F('CrSettingsAdvancedPageV3Test', 'MAYBE_Load', function() { - mocha.run(); -}); - -[['AllSites', 'all_sites_tests.js'], - ['AppearanceFontsPage', 'appearance_fonts_page_test.js'], - ['AppearancePage', 'appearance_page_test.js'], - ['BasicPage', 'basic_page_test.js'], - [ - 'SettingsCategoryDefaultRadioGroup', - 'settings_category_default_radio_group_tests.js' - ], - ['CategoryDefaultSetting', 'category_default_setting_tests.js'], - ['CategorySettingExceptions', 'category_setting_exceptions_tests.js'], - ['Checkbox', 'checkbox_tests.js'], - ['ChooserExceptionList', 'chooser_exception_list_tests.js'], - ['ChooserExceptionListEntry', 'chooser_exception_list_entry_tests.js'], - ['CollapseRadioButton', 'collapse_radio_button_tests.js'], - ['ControlledButton', 'controlled_button_tests.js'], - ['ControlledRadioButton', 'controlled_radio_button_tests.js'], - ['CookiesPage', 'cookies_page_test.js'], - ['DoNotTrackToggle', 'do_not_track_toggle_test.js'], - ['DownloadsPage', 'downloads_page_test.js'], - ['DropdownMenu', 'dropdown_menu_tests.js'], - ['ExtensionControlledIndicator', 'extension_controlled_indicator_tests.js'], - ['HelpPage', 'help_page_v3_test.js'], - ['Languages', 'languages_tests.js'], - ['Menu', 'settings_menu_test.js'], - ['OnStartupPage', 'on_startup_page_tests.js'], - ['PaymentsSection', 'payments_section_test.js'], - ['PeoplePage', 'people_page_test.js'], - ['PeoplePageSyncControls', 'people_page_sync_controls_test.js'], - ['PeoplePageSyncPage', 'people_page_sync_page_test.js'], - ['Prefs', 'prefs_tests.js'], - ['PrefUtil', 'pref_util_tests.js'], - ['ProtocolHandlers', 'protocol_handlers_tests.js'], - ['RecentSitePermissions', 'recent_site_permissions_test.js'], - // Flaky on all OSes. TODO(crbug.com/1127733): Enable the test. - ['ResetPage', 'reset_page_test.js', 'DISABLED_All'], - ['ResetProfileBanner', 'reset_profile_banner_test.js'], - ['SearchEngines', 'search_engines_page_test.js'], - ['SearchPage', 'search_page_test.js'], - ['Search', 'search_settings_test.js'], - ['SecurityKeysSubpage', 'security_keys_subpage_test.js'], - ['SecureDns', 'secure_dns_test.js'], - ['SiteData', 'site_data_test.js'], - ['SiteDataDetails', 'site_data_details_subpage_tests.js'], - ['SiteDetailsPermission', 'site_details_permission_tests.js'], - ['SiteEntry', 'site_entry_tests.js'], - ['SiteFavicon', 'site_favicon_test.js'], - ['SiteListEntry', 'site_list_entry_tests.js'], - ['SiteSettingsPage', 'site_settings_page_test.js'], - ['Slider', 'settings_slider_tests.js'], - ['StartupUrlsPage', 'startup_urls_page_test.js'], - ['Subpage', 'settings_subpage_test.js'], - ['SyncAccountControl', 'sync_account_control_test.js'], - ['Textarea', 'settings_textarea_tests.js'], - ['ToggleButton', 'settings_toggle_button_tests.js'], - ['ZoomLevels', 'zoom_levels_tests.js'], -].forEach(test => registerTest(...test)); - -// Timeout on MacOS dbg bots -// https://crbug.com/1133412 -GEN('#if !defined(OS_MAC) || defined(NDEBUG)'); -[['SecurityPage', 'security_page_test.js'], -].forEach(test => registerTest(...test)); -GEN('#endif // !defined(OS_MAC) || defined(NDEBUG)'); - -GEN('#if BUILDFLAG(IS_CHROMEOS_ASH)'); -[['LanguagesPageMetricsChromeOS', 'languages_page_metrics_test_cros.js'], - ['PasswordsSectionCros', 'passwords_section_test_cros.js'], - ['PeoplePageChromeOS', 'people_page_test_cros.js'], - // Copied from Polymer 2 test. TODO(crbug.com/929455): flaky, fix. - ['SiteListChromeOS', 'site_list_tests_cros.js', 'DISABLED_AndroidSmsInfo'], -].forEach(test => registerTest(...test)); -GEN('#endif // BUILDFLAG(IS_CHROMEOS_ASH)'); - -GEN('#if !defined(OS_MAC)'); -[['EditDictionaryPage', 'edit_dictionary_page_test.js'], -].forEach(test => registerTest(...test)); -GEN('#endif //!defined(OS_MAC)'); - -GEN('#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS)'); -[['DefaultBrowser', 'default_browser_browsertest.js'], - ['SystemPage', 'system_page_tests.js'], -].forEach(test => registerTest(...test)); -GEN('#endif // !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS)'); - -GEN('#if !BUILDFLAG(IS_CHROMEOS_ASH)'); -[['ImportDataDialog', 'import_data_dialog_test.js'], - ['PeoplePageManageProfile', 'people_page_manage_profile_test.js'], -].forEach(test => registerTest(...test)); -GEN('#endif // !BUILDFLAG(IS_CHROMEOS_ASH)'); - -GEN('#if defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)'); -[['ChromeCleanupPage', 'chrome_cleanup_page_test.js'], - ['IncompatibleApplicationsPage', 'incompatible_applications_page_test.js'], -].forEach(test => registerTest(...test)); -GEN('#endif // defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)'); - -GEN('#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !BUILDFLAG(IS_CHROMEOS_ASH)'); -registerTest('MetricsReporting', 'metrics_reporting_tests.js'); -GEN('#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) ' + - '&& !BUILDFLAG(IS_CHROMEOS_ASH)'); - -function registerTest(testName, module, caseName) { - const className = `CrSettings${testName}V3Test`; - this[className] = class extends CrSettingsV3BrowserTest { - /** @override */ - get browsePreload() { - return `chrome://settings/test_loader.html?module=settings/${module}`; - } - }; - - TEST_F(className, caseName || 'All', () => mocha.run()); -}
diff --git a/chrome/test/data/webui/settings/route_tests.js b/chrome/test/data/webui/settings/route_tests.js index b30ad64..074125d 100644 --- a/chrome/test/data/webui/settings/route_tests.js +++ b/chrome/test/data/webui/settings/route_tests.js
@@ -198,6 +198,9 @@ test('isNavigableDialog', function() { assertTrue(routes.CLEAR_BROWSER_DATA.isNavigableDialog); + assertTrue(routes.CLEAR_BROWSER_DATA.parent === routes.PRIVACY); + assertFalse(routes.CLEAR_BROWSER_DATA.isSubpage()); + assertTrue(routes.RESET_DIALOG.isNavigableDialog); assertTrue(routes.SIGN_OUT.isNavigableDialog); assertTrue(routes.TRIGGERED_RESET_DIALOG.isNavigableDialog);
diff --git a/chromecast/browser/cast_web_service.cc b/chromecast/browser/cast_web_service.cc index 1986d0d1..9ae1064 100644 --- a/chromecast/browser/cast_web_service.cc +++ b/chromecast/browser/cast_web_service.cc
@@ -21,7 +21,6 @@ #include "chromecast/browser/webui/cast_webui_controller_factory.h" #include "chromecast/chromecast_buildflags.h" #include "content/public/browser/browser_context.h" -#include "content/public/browser/gpu_utils.h" #include "content/public/browser/media_session.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" @@ -97,10 +96,6 @@ base::Passed(std::move(callback)))); } -void CastWebService::StopGpuProcess(base::OnceClosure callback) const { - content::StopGpuProcess(std::move(callback)); -} - void CastWebService::RegisterWebUiClient( mojo::PendingRemote<mojom::WebUiClient> client, const std::vector<std::string>& hosts) {
diff --git a/chromecast/browser/cast_web_service.h b/chromecast/browser/cast_web_service.h index 92397200..d0bdf2a4 100644 --- a/chromecast/browser/cast_web_service.h +++ b/chromecast/browser/cast_web_service.h
@@ -66,7 +66,6 @@ // |callback| is called when data deletion is done or at least the deletion // is scheduled. void ClearLocalStorage(base::OnceClosure callback); - void StopGpuProcess(base::OnceClosure callback) const; // mojom::CastWebService implementation: void RegisterWebUiClient(mojo::PendingRemote<mojom::WebUiClient> client,
diff --git a/chromecast/graphics/rounded_window_corners_aura.cc b/chromecast/graphics/rounded_window_corners_aura.cc index a17ccf4..efcfd9ad 100644 --- a/chromecast/graphics/rounded_window_corners_aura.cc +++ b/chromecast/graphics/rounded_window_corners_aura.cc
@@ -10,10 +10,10 @@ #include "chromecast/graphics/cast_window_manager.h" #include "chromecast/ui/mojom/ui_service.mojom.h" #include "ui/aura/window.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/chromecast/media/audio/cast_audio_input_stream.cc b/chromecast/media/audio/cast_audio_input_stream.cc index 12c7629..32aa493 100644 --- a/chromecast/media/audio/cast_audio_input_stream.cc +++ b/chromecast/media/audio/cast_audio_input_stream.cc
@@ -28,7 +28,7 @@ DCHECK_CALLED_ON_VALID_THREAD(audio_thread_checker_); } -bool CastAudioInputStream::Open() { +::media::AudioInputStream::OpenOutcome CastAudioInputStream::Open() { DCHECK_CALLED_ON_VALID_THREAD(audio_thread_checker_); DCHECK(!capture_service_receiver_); LOG(INFO) << __func__ << " " << this << "."; @@ -41,7 +41,7 @@ if ((channel_layout != ::media::CHANNEL_LAYOUT_MONO) && (channel_layout != ::media::CHANNEL_LAYOUT_STEREO)) { LOG(WARNING) << "Unsupported channel layout: " << channel_layout; - return false; + return ::media::AudioInputStream::OpenOutcome::kFailed; } DCHECK_GE(audio_params_.channels(), 1); DCHECK_LE(audio_params_.channels(), 2); @@ -56,7 +56,7 @@ audio_params_.frames_per_buffer()}; capture_service_receiver_ = std::make_unique<CaptureServiceReceiver>(stream_info_, this); - return true; + return ::media::AudioInputStream::OpenOutcome::kSuccess; } void CastAudioInputStream::Start(AudioInputCallback* input_callback) {
diff --git a/chromecast/media/audio/cast_audio_input_stream.h b/chromecast/media/audio/cast_audio_input_stream.h index 4f06e1e..72fdf46 100644 --- a/chromecast/media/audio/cast_audio_input_stream.h +++ b/chromecast/media/audio/cast_audio_input_stream.h
@@ -36,7 +36,7 @@ ~CastAudioInputStream() override; // ::media::AudioInputStream implementation: - bool Open() override; + ::media::AudioInputStream::OpenOutcome Open() override; void Start(AudioInputCallback* source_callback) override; void Stop() override; void Close() override;
diff --git a/chromecast/media/cma/backend/proxy/audio_channel_broker_impl.cc b/chromecast/media/cma/backend/proxy/audio_channel_broker_impl.cc index 752cbd2..91f15e59 100644 --- a/chromecast/media/cma/backend/proxy/audio_channel_broker_impl.cc +++ b/chromecast/media/cma/backend/proxy/audio_channel_broker_impl.cc
@@ -21,8 +21,6 @@ auto* endpoint_manager = CastRuntimeAudioChannelEndpointManager::Get(); DCHECK(endpoint_manager); - // TODO(rwkeane): Validate that this is valid at initialization time. If not - // the stub may need to be lazy loaded at the first gRPC call. std::string endpoint = endpoint_manager->GetAudioChannelEndpoint(); DCHECK(!endpoint.empty()); @@ -40,19 +38,22 @@ return std::make_unique<AudioChannelBrokerImpl>(task_runner, handler); } +AudioChannelBrokerImpl::LazyStubFactory::LazyStubFactory() = default; + +AudioChannelBrokerImpl::LazyStubFactory::~LazyStubFactory() = default; + +AudioChannelBrokerImpl::LazyStubFactory::Stub* +AudioChannelBrokerImpl::LazyStubFactory::GetStub() { + if (!stub_) { + stub_ = GetRemoteStub(); + } + + return stub_.get(); +} + AudioChannelBrokerImpl::AudioChannelBrokerImpl(TaskRunner* task_runner, Handler* handler) - : AudioChannelBrokerImpl(GetRemoteStub(), task_runner, handler) {} - -AudioChannelBrokerImpl::AudioChannelBrokerImpl( - std::unique_ptr<cast::media::CastAudioChannelService::StubInterface> stub, - TaskRunner* task_runner, - Handler* handler) - : stub_(std::move(stub)), - handler_(handler), - task_runner_(task_runner), - weak_factory_(this) { - DCHECK(stub_.get()); + : handler_(handler), task_runner_(task_runner), weak_factory_(this) { DCHECK(task_runner_); DCHECK(handler_); }
diff --git a/chromecast/media/cma/backend/proxy/audio_channel_broker_impl.h b/chromecast/media/cma/backend/proxy/audio_channel_broker_impl.h index 84c80c2..8fc197c2 100644 --- a/chromecast/media/cma/backend/proxy/audio_channel_broker_impl.h +++ b/chromecast/media/cma/backend/proxy/audio_channel_broker_impl.h
@@ -178,13 +178,29 @@ std::unique_ptr<Response>, CastRuntimeAudioChannelBroker::StatusCode)) { auto bound_async_call = base::BindOnce( - async_call, base::Unretained(instance->stub_->async())); + async_call, + base::Unretained(instance->stub_factory_.GetStub()->async())); auto bound_callback = base::BindOnce(callback, instance->weak_factory_.GetWeakPtr()); return Request(std::move(bound_async_call), std::move(bound_callback)); } }; + // Helper to initialize the service stub at runtime instead of instance + // creation time. + class LazyStubFactory { + public: + using Stub = cast::media::CastAudioChannelService::StubInterface; + + LazyStubFactory(); + ~LazyStubFactory(); + + Stub* GetStub(); + + private: + std::unique_ptr<Stub> stub_; + }; + // Some aliases to make the code more readable. using InitializeCall = GrpcCall<cast::media::InitializeRequest, cast::media::InitializeResponse>; @@ -202,11 +218,6 @@ // Helper to create the call types used more than once. StateChangeCall::Request CreateStateChangeCallRequest(); - AudioChannelBrokerImpl( - std::unique_ptr<cast::media::CastAudioChannelService::StubInterface> stub, - TaskRunner* task_runner, - Handler* handler); - // Calls PushBuffer if data to push is available. Else, schedule this task to // run again in the future. void TryPushBuffer(); @@ -229,7 +240,7 @@ void OnPushBuffer(std::unique_ptr<PushBufferCall::Response> call_details, CastRuntimeAudioChannelBroker::StatusCode status_code); - std::unique_ptr<GrpcStub> const stub_; + LazyStubFactory stub_factory_; Handler* const handler_; TaskRunner* const task_runner_;
diff --git a/chromecast/ui/media_control_ui.cc b/chromecast/ui/media_control_ui.cc index 452853bc..03b81d4 100644 --- a/chromecast/ui/media_control_ui.cc +++ b/chromecast/ui/media_control_ui.cc
@@ -12,12 +12,12 @@ #include "base/threading/thread_checker.h" #include "chromecast/graphics/cast_window_manager.h" #include "ui/aura/window.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/font_list.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/background.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #define LOG_VIEW(name) DVLOG(1) << #name << ": " << name->bounds().ToString();
diff --git a/chromeos/components/camera_app_ui/resources/js/metrics.js b/chromeos/components/camera_app_ui/resources/js/metrics.js index b1e2b75..0f4782b 100644 --- a/chromeos/components/camera_app_ui/resources/js/metrics.js +++ b/chromeos/components/camera_app_ui/resources/js/metrics.js
@@ -410,10 +410,17 @@ /** * Sends the open ptz panel event. + * @param {{pan: boolean, tilt: boolean, zoom: boolean}} capabilities */ -export function sendOpenPTZPanelEvent() { - sendEvent({ - eventCategory: 'ptz', - eventAction: 'open-panel', - }); +export function sendOpenPTZPanelEvent(capabilities) { + sendEvent( + { + eventCategory: 'ptz', + eventAction: 'open-panel', + }, + new Map([ + [24, capabilities.pan], + [25, capabilities.tilt], + [26, capabilities.zoom], + ])); }
diff --git a/chromeos/components/camera_app_ui/resources/js/views/camera.js b/chromeos/components/camera_app_ui/resources/js/views/camera.js index 68dc26d..dc12b3e 100644 --- a/chromeos/components/camera_app_ui/resources/js/views/camera.js +++ b/chromeos/components/camera_app_ui/resources/js/views/camera.js
@@ -368,7 +368,6 @@ */ initOpenPTZPanel_() { this.openPTZPanel_.addEventListener('click', () => { - metrics.sendOpenPTZPanelEvent(); nav.open(ViewName.PTZ_PANEL, this.preview_.stream); highlight(false); });
diff --git a/chromeos/components/camera_app_ui/resources/js/views/ptz_panel.js b/chromeos/components/camera_app_ui/resources/js/views/ptz_panel.js index 9c484e90..bc3098e 100644 --- a/chromeos/components/camera_app_ui/resources/js/views/ptz_panel.js +++ b/chromeos/components/camera_app_ui/resources/js/views/ptz_panel.js
@@ -4,6 +4,7 @@ import {AsyncJobQueue} from '../async_job_queue.js'; import * as dom from '../dom.js'; +import * as metrics from '../metrics.js'; import * as nav from '../nav.js'; import * as state from '../state.js'; import {ViewName} from '../type.js'; @@ -262,10 +263,16 @@ this.track_ = stream.getVideoTracks()[0]; const {pan, tilt, zoom} = this.track_.getCapabilities(); + const capabilities = { + pan: pan !== undefined, + tilt: tilt !== undefined, + zoom: zoom !== undefined, + }; + metrics.sendOpenPTZPanelEvent(capabilities); - state.set(state.State.HAS_PAN_SUPPORT, pan !== undefined); - state.set(state.State.HAS_TILT_SUPPORT, tilt !== undefined); - state.set(state.State.HAS_ZOOM_SUPPORT, zoom !== undefined); + state.set(state.State.HAS_PAN_SUPPORT, capabilities.pan); + state.set(state.State.HAS_TILT_SUPPORT, capabilities.tilt); + state.set(state.State.HAS_ZOOM_SUPPORT, capabilities.zoom); if (pan !== undefined) { this.bind_('pan', this.panRight_, this.panLeft_, pan);
diff --git a/chromeos/components/diagnostics_ui/resources/diagnostics_types.js b/chromeos/components/diagnostics_ui/resources/diagnostics_types.js index 76c4792..18e30094 100644 --- a/chromeos/components/diagnostics_ui/resources/diagnostics_types.js +++ b/chromeos/components/diagnostics_ui/resources/diagnostics_types.js
@@ -140,6 +140,57 @@ export let SystemRoutineControllerInterface; /** + * TODO(michaelcheco): Add Cellular properties. + * @typedef {!Object} + */ +export let CellularStateProperties; + +/** + * TODO(michaelcheco): Add Ethernet properties. + * @typedef {!Object} + */ +export let EthernetStateProperties; + +/** + * @typedef {{ + * signalStrength: number, + * frequency: number, + * ssid: string, + * bssid: string, + * }} + */ +export let WiFiStateProperties; + +/** + * @typedef {{ + * ipAddress: ?string, + * nameServers: ?Array<string>, + * subnetMask: ?string, + * gateway: ?string, + * }} + */ +export let IPConfigProperties; + +/** + * @typedef {( + * !CellularStateProperties|!EthernetStateProperties|!WiFiStateProperties)} + */ +export let NetworkProperties; + +/** + * @typedef {{ + * state: number, + * type: number, + * networkProperties: !NetworkProperties, + * guid: string, + * name: string, + * macAddress: string, + * ipConfigProperties: ?IPConfigProperties, + * }} + */ +export let Network; + +/** * @typedef {{ * networkGuids: !Array<string>, * activeGuid: ?string, @@ -156,16 +207,54 @@ export let NetworkListObserver; /** + * Type alias for NetworkStateObserver. + * @typedef {{ + * onNetworkStateChanged: !function(!Network) + * }} + */ +export let NetworkStateObserver; + +/** * Type of NetworkHealthProviderInterface.ObserveNetworkListFunction function. * @typedef {!function(!NetworkListObserver): !Promise} */ export let ObserveNetworkListFunction; /** + * Type of NetworkHealthProviderInterface.ObserveNetworkFunction function. + * @typedef {!function(!NetworkStateObserver, !string): !Promise} + */ +export let ObserveNetworkFunction; + +/** * Type alias for the NetworkHealthProviderInterface. * TODO(michaelcheco): Replace with a real mojo type when implemented. * @typedef {{ * observeNetworkList: !ObserveNetworkListFunction, + * observeNetwork: !ObserveNetworkFunction, * }} */ export let NetworkHealthProviderInterface; + +/** + * @enum {number} + */ +export let NetworkState = { + kUninitialized: 0, + kDisabled: 1, + kProhibited: 2, + kNotConnected: 3, + kConnecting: 4, + kPortal: 5, + kConnected: 6, + kOnline: 7, +}; + +/** + * @enum {number} + */ +export let NetworkType = { + kCellular: 0, + kEthernet: 1, + kWiFi: 2, +};
diff --git a/chromeos/components/diagnostics_ui/resources/fake_data.js b/chromeos/components/diagnostics_ui/resources/fake_data.js index 8a0b20e..5ee99598 100644 --- a/chromeos/components/diagnostics_ui/resources/fake_data.js +++ b/chromeos/components/diagnostics_ui/resources/fake_data.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {BatteryChargeStatus, BatteryHealth, BatteryInfo, CpuUsage, ExternalPowerSource, MemoryUsage, NetworkGuidInfo, PowerRoutineResult, RoutineType, StandardRoutineResult, SystemInfo} from './diagnostics_types.js' +import {BatteryChargeStatus, BatteryHealth, BatteryInfo, CpuUsage, ExternalPowerSource, MemoryUsage, Network, NetworkGuidInfo, NetworkState, NetworkType, PowerRoutineResult, RoutineType, StandardRoutineResult, SystemInfo} from './diagnostics_types.js' import {stringToMojoString16} from './mojo_utils.js'; /** @type {!Array<!BatteryChargeStatus>} */ @@ -270,3 +270,47 @@ fakeAllNetworksAvailable, fakeWifiAndCellularNetworksAvailable, ]; + +/** @type {!Network} */ +export let fakeWifiNetwork = { + state: NetworkState.kConnected, + type: NetworkType.kWiFi, + networkProperties: { + signalStrength: 65, + frequency: 5745, + bssid: '44:07:0b:06:2d:85', + ssid: 'Dial Up', + }, + guid: 'wifiGuid', + name: 'Dial Up', + macAddress: '84:C5:A6:30:3F:31', + ipConfigProperties: { + ipAddress: '192.168.86.197', + gateway: '192.168.86.1', + nameServers: ['192.168.86.1'], + subnetMask: '255.255.255.0', + }, +}; + + +/** @type {!Network} */ +export let fakeEthernetNetwork = { + state: NetworkState.kOnline, + type: NetworkType.kEthernet, + networkProperties: {}, + guid: 'ethernetGuid', + name: 'ethernetName', + macAddress: '81:C5:A6:30:3F:31', + ipConfigProperties: null, +}; + +/** @type {!Network} */ +export let fakeCellularNetwork = { + state: NetworkState.kConnected, + type: NetworkType.kCellular, + networkProperties: {}, + guid: 'cellularGuid', + name: 'cellularName', + macAddress: '85:C5:A6:30:3F:31', + ipConfigProperties: null, +};
diff --git a/chromeos/components/diagnostics_ui/resources/fake_network_health_provider.js b/chromeos/components/diagnostics_ui/resources/fake_network_health_provider.js index 0fa53f5..50034adf 100644 --- a/chromeos/components/diagnostics_ui/resources/fake_network_health_provider.js +++ b/chromeos/components/diagnostics_ui/resources/fake_network_health_provider.js
@@ -2,13 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {NetworkGuidInfo, NetworkHealthProviderInterface} from './diagnostics_types.js'; import {FakeObservables} from 'chrome://resources/ash/common/fake_observables.js'; +import {Network, NetworkGuidInfo, NetworkHealthProviderInterface} from './diagnostics_types.js'; + // Method names. -const ON_NETWORK_LIST_CHANGED_METHOD_NAME = +export const ON_NETWORK_LIST_CHANGED_METHOD_NAME = 'NetworkListObserver_onNetworkListChanged'; +const ON_NETWORK_STATE_CHANGED_METHOD_NAME = + 'NetworkStateObserver_onNetworkStateChanged'; + /** * @fileoverview * Implements a fake version of the NetworkHealthProvider mojo interface. @@ -34,6 +38,22 @@ }); } + /* + * Implements NetworkHealthProviderInterface.ObserveNetwork. + * The guid argument is used to observe a specific network identified + * by |guid| within a group of observers. + * @param {!NetworkStateObserver} remote + * @param {string} guid + * @return {!Promise} + */ + observeNetwork(remote, guid) { + return this.observeWithArg_( + ON_NETWORK_STATE_CHANGED_METHOD_NAME, guid, (network) => { + remote.onNetworkStateChanged( + /** @type {!Network} */ (network)); + }); + } + /** * Sets the values that will be observed from observeNetworkList. * @param {!Array<!NetworkGuidInfo>} networkGuidInfoList @@ -44,6 +64,15 @@ } /** + * @param {string} guid + * @param {!Array<!Network>} networkStateList + */ + setFakeNetworkState(guid, networkStateList) { + this.observables_.setObservableDataForArg( + ON_NETWORK_STATE_CHANGED_METHOD_NAME, guid, networkStateList); + } + + /** * Causes the network list observer to fire. */ triggerNetworkListObserver() { @@ -68,6 +97,8 @@ registerObservables() { this.observables_.register(ON_NETWORK_LIST_CHANGED_METHOD_NAME); + this.observables_.registerObservableWithArg( + ON_NETWORK_STATE_CHANGED_METHOD_NAME); } /** @@ -94,4 +125,21 @@ resolve(); }); } + + /* + * Sets up an observer for a methodName that takes an additional arg. + * @template T + * @param {string} methodName + * @param {string} arg + * @param {!function(!T)} callback + * @return {!Promise} + * @private + */ + observeWithArg_(methodName, arg, callback) { + return new Promise((resolve) => { + this.observables_.observeWithArg(methodName, arg, callback); + this.observables_.triggerWithArg(methodName, arg); + resolve(); + }); + } }
diff --git a/chromeos/components/diagnostics_ui/resources/mojo_interface_provider.js b/chromeos/components/diagnostics_ui/resources/mojo_interface_provider.js index eff56e38..ebfab9f2 100644 --- a/chromeos/components/diagnostics_ui/resources/mojo_interface_provider.js +++ b/chromeos/components/diagnostics_ui/resources/mojo_interface_provider.js
@@ -11,7 +11,7 @@ import {assert} from 'chrome://resources/js/assert.m.js'; import {NetworkHealthProviderInterface, PowerRoutineResult, RoutineType, StandardRoutineResult, SystemDataProviderInterface, SystemInfo, SystemRoutineControllerInterface} from './diagnostics_types.js'; -import {fakeAllNetworksAvailable, fakeBatteryChargeStatus, fakeBatteryHealth, fakeBatteryInfo, fakeCpuUsage, fakeMemoryUsage, fakePowerRoutineResults, fakeRoutineResults, fakeSystemInfo} from './fake_data.js'; +import {fakeAllNetworksAvailable, fakeBatteryChargeStatus, fakeBatteryHealth, fakeBatteryInfo, fakeCellularNetwork, fakeCpuUsage, fakeEthernetNetwork, fakeMemoryUsage, fakePowerRoutineResults, fakeRoutineResults, fakeSystemInfo, fakeWifiNetwork} from './fake_data.js'; import {FakeNetworkHealthProvider} from './fake_network_health_provider.js'; import {FakeSystemDataProvider} from './fake_system_data_provider.js'; import {FakeSystemRoutineController} from './fake_system_routine_controller.js'; @@ -88,6 +88,9 @@ const provider = new FakeNetworkHealthProvider(); // The fake provides a stable state with all networks connected. provider.setFakeNetworkGuidInfo([fakeAllNetworksAvailable]); + provider.setFakeNetworkState('ethernetGuid', [fakeEthernetNetwork]); + provider.setFakeNetworkState('wifiGuid', [fakeWifiNetwork]); + provider.setFakeNetworkState('cellularGuid', [fakeCellularNetwork]); setNetworkHealthProviderForTesting(provider); }
diff --git a/chromeos/components/diagnostics_ui/resources/network_info.html b/chromeos/components/diagnostics_ui/resources/network_info.html index c732a45..f08d3a8 100644 --- a/chromeos/components/diagnostics_ui/resources/network_info.html +++ b/chromeos/components/diagnostics_ui/resources/network_info.html
@@ -4,10 +4,10 @@ <diagnostics-card> <!-- TODO(michaelcheco): Add localized strings. --> <div id="cardTitle" slot="title">Network</div> - <div id="guid" slot="body">[[guid]]</div> <!-- TODO(michaelcheco): Conditionally render *-info element when ObserveNetwork is wired up. --> <wifi-info></wifi-info> <ethernet-info></ethernet-info> <cellular-info></cellular-info> + <div id="guid" slot="body">[[network_.guid]]</div> </diagnostics-card>
diff --git a/chromeos/components/diagnostics_ui/resources/network_info.js b/chromeos/components/diagnostics_ui/resources/network_info.js index 5058921..be0bbc5 100644 --- a/chromeos/components/diagnostics_ui/resources/network_info.js +++ b/chromeos/components/diagnostics_ui/resources/network_info.js
@@ -11,6 +11,9 @@ import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {Network, NetworkHealthProviderInterface} from './diagnostics_types.js'; +import {getNetworkHealthProvider} from './mojo_interface_provider.js'; + /** * @fileoverview * 'network-info' is responsible for observing a network guid and @@ -21,11 +24,51 @@ _template: html`{__html_template__}`, + /** + * @private {?NetworkHealthProviderInterface} + */ + networkHealthProvider_: null, + properties: { /** @type {string} */ guid: { type: String, value: '', }, + + /** @private {!Network} */ + network_: { + type: Object, + }, + }, + + observers: ['observeNetwork_(guid)'], + + /** @override */ + created() { + this.networkHealthProvider_ = getNetworkHealthProvider(); + }, + + /** @private */ + observeNetwork_() { + if (!this.guid) { + return; + } + // Calling observeNetwork will trigger onNetworkStateChanged. + this.networkHealthProvider_.observeNetwork(this, this.guid); + }, + + /** + * Implements NetworkStateObserver.onNetworkStateChanged + * @param {!Network} network + */ + onNetworkStateChanged(network) { + this.network_ = network; + }, + + /** @override */ + detached() { + // TODO(michaelcheco): Stop observing guid when the real + // observeNetwork implementation is added. }, });
diff --git a/chromeos/components/tether/tether_host_response_recorder.cc b/chromeos/components/tether/tether_host_response_recorder.cc index 357144b..d83b422 100644 --- a/chromeos/components/tether/tether_host_response_recorder.cc +++ b/chromeos/components/tether/tether_host_response_recorder.cc
@@ -89,19 +89,18 @@ // Create a mutable copy of the stored IDs, or create one if it has yet to be // stored. - std::unique_ptr<base::ListValue> updated_ids = - ids ? ids->CreateDeepCopy() : std::make_unique<base::ListValue>(); + base::Value updated_ids = + ids ? ids->Clone() : base::Value(base::Value::Type::LIST); // Remove the device ID if it was already present in the list. - std::unique_ptr<base::Value> device_id_value = - std::make_unique<base::Value>(device_id); - updated_ids->Remove(*device_id_value, nullptr); + base::Value device_id_value(device_id); + updated_ids.EraseListValue(device_id_value); // Add the device ID to the front of the queue. - updated_ids->Insert(0, std::move(device_id_value)); + updated_ids.Insert(updated_ids.GetList().begin(), std::move(device_id_value)); // Store the updated list back in |pref_service_|. - pref_service_->Set(pref_name, *updated_ids); + pref_service_->Set(pref_name, std::move(updated_ids)); return true; }
diff --git a/chromeos/cryptohome/system_salt_getter.h b/chromeos/cryptohome/system_salt_getter.h index 9b0e9aa..7cff1fc 100644 --- a/chromeos/cryptohome/system_salt_getter.h +++ b/chromeos/cryptohome/system_salt_getter.h
@@ -77,4 +77,10 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source code migration is finished. +namespace ash { +using ::chromeos::SystemSaltGetter; +} + #endif // CHROMEOS_CRYPTOHOME_SYSTEM_SALT_GETTER_H_
diff --git a/chromeos/dbus/BUILD.gn b/chromeos/dbus/BUILD.gn index d4ae2343..42e9d1d 100644 --- a/chromeos/dbus/BUILD.gn +++ b/chromeos/dbus/BUILD.gn
@@ -186,6 +186,8 @@ "//chromeos/dbus/lorgnette_manager:test_support", "//chromeos/dbus/power:power_manager_proto", "//chromeos/dbus/power:test_support", + "//chromeos/dbus/rmad:rmad_proto", + "//chromeos/dbus/rmad:test_support", "//chromeos/dbus/session_manager", "//chromeos/dbus/shill:test_support", "//chromeos/dbus/tpm_manager",
diff --git a/chromeos/dbus/rmad/BUILD.gn b/chromeos/dbus/rmad/BUILD.gn index c615da7..524ec39 100644 --- a/chromeos/dbus/rmad/BUILD.gn +++ b/chromeos/dbus/rmad/BUILD.gn
@@ -24,6 +24,24 @@ ] } +source_set("test_support") { + testonly = true + public_deps = [ ":rmad" ] + deps = [ + ":rmad_proto", + "//base", + "//base/test:test_support", + "//dbus:test_support", + "//testing/gmock", + "//testing/gtest", + ] + + sources = [ + "fake_rmad_client_unittest.cc", + "rmad_client_unittest.cc", + ] +} + proto_library("rmad_proto") { sources = [ "//third_party/cros_system_api/dbus/rmad/rmad.proto" ]
diff --git a/chromeos/dbus/rmad/fake_rmad_client.cc b/chromeos/dbus/rmad/fake_rmad_client.cc index 5f8f6a1..9e81346 100644 --- a/chromeos/dbus/rmad/fake_rmad_client.cc +++ b/chromeos/dbus/rmad/fake_rmad_client.cc
@@ -4,15 +4,127 @@ #include "chromeos/dbus/rmad/fake_rmad_client.h" +#include "base/logging.h" +#include "base/threading/thread_task_runner_handle.h" + namespace chromeos { -FakeRmadClient::FakeRmadClient() = default; +FakeRmadClient::FakeRmadClient() { + abort_rma_reply_.set_error(rmad::RMAD_ERROR_OK); +} FakeRmadClient::~FakeRmadClient() = default; void FakeRmadClient::GetCurrentState( DBusMethodCallback<rmad::GetStateReply> callback) { - // TODO(gavindodd): Implement fake state. - std::move(callback).Run(base::nullopt); + if (NumStates() > 0) { + CHECK(state_index_ < NumStates()); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), GetStateReply())); + } else { + rmad::GetStateReply reply; + reply.set_error(rmad::RMAD_ERROR_RMA_NOT_REQUIRED); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), std::move(reply))); + } +} + +void FakeRmadClient::TransitionNextState( + const rmad::RmadState& state, + DBusMethodCallback<rmad::GetStateReply> callback) { + if (NumStates() == 0) { + rmad::GetStateReply reply; + reply.set_error(rmad::RMAD_ERROR_RMA_NOT_REQUIRED); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), std::move(reply))); + return; + } + CHECK_LT(state_index_, NumStates()); + if (state.state_case() != GetStateCase()) { + rmad::GetStateReply reply; + reply.set_error(rmad::RMAD_ERROR_REQUEST_INVALID); + reply.set_allocated_state(new rmad::RmadState(GetState())); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), std::move(reply))); + return; + } + if (state_index_ >= NumStates() - 1) { + rmad::GetStateReply reply; + reply.set_error(rmad::RMAD_ERROR_TRANSITION_FAILED); + reply.set_allocated_state(new rmad::RmadState(GetState())); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), std::move(reply))); + return; + } + // Update the fake state with the new data. + if (state_index_ < NumStates()) { + // TODO(gavindodd): Maybe the state should not update if the existing state + // has an error? + state_replies_[state_index_].set_allocated_state( + new rmad::RmadState(state)); + } + + state_index_++; + CHECK_LT(state_index_, NumStates()); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), GetStateReply())); +} + +void FakeRmadClient::TransitionPreviousState( + DBusMethodCallback<rmad::GetStateReply> callback) { + if (NumStates() == 0) { + rmad::GetStateReply reply; + reply.set_error(rmad::RMAD_ERROR_RMA_NOT_REQUIRED); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), std::move(reply))); + return; + } + CHECK_LT(state_index_, NumStates()); + if (state_index_ == 0) { + rmad::GetStateReply reply; + reply.set_error(rmad::RMAD_ERROR_TRANSITION_FAILED); + reply.set_allocated_state(new rmad::RmadState(GetState())); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), std::move(reply))); + return; + } + state_index_--; + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), GetStateReply())); +} + +void FakeRmadClient::AbortRma( + DBusMethodCallback<rmad::AbortRmaReply> callback) { + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::BindOnce(std::move(callback), + base::Optional<rmad::AbortRmaReply>(abort_rma_reply_))); +} + +void FakeRmadClient::SetFakeStateReplies( + std::vector<rmad::GetStateReply> fake_states) { + state_replies_ = std::move(fake_states); + state_index_ = 0; +} + +void FakeRmadClient::SetAbortable(bool abortable) { + abort_rma_reply_.set_error(abortable ? rmad::RMAD_ERROR_OK + : rmad::RMAD_ERROR_CANNOT_CANCEL_RMA); +} + +const rmad::GetStateReply& FakeRmadClient::GetStateReply() const { + return state_replies_[state_index_]; +} + +const rmad::RmadState& FakeRmadClient::GetState() const { + return GetStateReply().state(); +} + +rmad::RmadState::StateCase FakeRmadClient::GetStateCase() const { + return GetState().state_case(); +} + +size_t FakeRmadClient::NumStates() const { + return state_replies_.size(); } } // namespace chromeos
diff --git a/chromeos/dbus/rmad/fake_rmad_client.h b/chromeos/dbus/rmad/fake_rmad_client.h index 0c63a71..3b19cb9 100644 --- a/chromeos/dbus/rmad/fake_rmad_client.h +++ b/chromeos/dbus/rmad/fake_rmad_client.h
@@ -5,7 +5,10 @@ #ifndef CHROMEOS_DBUS_RMAD_FAKE_RMAD_CLIENT_H_ #define CHROMEOS_DBUS_RMAD_FAKE_RMAD_CLIENT_H_ +#include <vector> + #include "base/component_export.h" +#include "chromeos/dbus/rmad/rmad.pb.h" #include "chromeos/dbus/rmad/rmad_client.h" namespace chromeos { @@ -19,6 +22,27 @@ void GetCurrentState( DBusMethodCallback<rmad::GetStateReply> callback) override; + void TransitionNextState( + const rmad::RmadState& state, + DBusMethodCallback<rmad::GetStateReply> callback) override; + void TransitionPreviousState( + DBusMethodCallback<rmad::GetStateReply> callback) override; + + void AbortRma(DBusMethodCallback<rmad::AbortRmaReply> callback) override; + + void SetFakeStateReplies(std::vector<rmad::GetStateReply> fake_states); + + void SetAbortable(bool abortable); + + private: + const rmad::GetStateReply& GetStateReply() const; + const rmad::RmadState& GetState() const; + rmad::RmadState::StateCase GetStateCase() const; + size_t NumStates() const; + + std::vector<rmad::GetStateReply> state_replies_; + size_t state_index_; + rmad::AbortRmaReply abort_rma_reply_; }; } // namespace chromeos
diff --git a/chromeos/dbus/rmad/fake_rmad_client_unittest.cc b/chromeos/dbus/rmad/fake_rmad_client_unittest.cc new file mode 100644 index 0000000..53a61878 --- /dev/null +++ b/chromeos/dbus/rmad/fake_rmad_client_unittest.cc
@@ -0,0 +1,357 @@ +// 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. + +#include "chromeos/dbus/rmad/fake_rmad_client.h" + +#include <memory> +#include <string> + +#include "base/bind.h" +#include "base/logging.h" +#include "base/run_loop.h" +#include "base/test/bind.h" +#include "base/test/task_environment.h" +#include "dbus/message.h" +#include "dbus/mock_bus.h" +#include "dbus/mock_object_proxy.h" +#include "dbus/object_path.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/cros_system_api/dbus/service_constants.h" + +using ::testing::_; +using ::testing::Invoke; +using ::testing::Return; + +namespace chromeos { + +namespace { +class FakeRmadClientTest : public testing::Test { + public: + FakeRmadClientTest() = default; + FakeRmadClientTest(const FakeRmadClientTest&) = delete; + FakeRmadClientTest& operator=(const FakeRmadClientTest&) = delete; + + void SetUp() override { + // Create a client with the mock bus. + RmadClient::InitializeFake(); + client_ = RmadClient::Get(); + } + + void TearDown() override { RmadClient::Shutdown(); } + + FakeRmadClient* fake_client_() { + return google::protobuf::down_cast<FakeRmadClient*>(client_); + } + + RmadClient* client_ = nullptr; // Unowned convenience pointer. + // A message loop to emulate asynchronous behavior. + base::test::SingleThreadTaskEnvironment task_environment_; +}; + +rmad::RmadState CreateWelcomeState() { + rmad::RmadState state; + state.set_allocated_welcome(new rmad::WelcomeState()); + return state; +} + +rmad::RmadState CreateSelectComponentsState() { + rmad::RmadState state; + state.set_allocated_select_components(new rmad::ComponentsRepairState()); + return state; +} + +rmad::GetStateReply CreateWelcomeStateReply(rmad::RmadErrorCode error) { + rmad::GetStateReply reply; + reply.set_allocated_state(new rmad::RmadState()); + reply.mutable_state()->set_allocated_welcome(new rmad::WelcomeState()); + reply.set_error(error); + return reply; +} + +rmad::GetStateReply CreateSelectComponentsStateReply( + rmad::RmadErrorCode error) { + rmad::GetStateReply reply; + reply.set_allocated_state(new rmad::RmadState()); + reply.mutable_state()->set_allocated_select_components( + new rmad::ComponentsRepairState()); + reply.set_error(error); + return reply; +} + +TEST_F(FakeRmadClientTest, GetCurrentState_Default_RmaNotRequired) { + base::RunLoop run_loop; + client_->GetCurrentState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_RMA_NOT_REQUIRED); + EXPECT_FALSE(response->has_state()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(FakeRmadClientTest, GetCurrentState_Welcome_Ok) { + std::vector<rmad::GetStateReply> fake_states; + fake_states.push_back(CreateWelcomeStateReply(rmad::RMAD_ERROR_OK)); + fake_client_()->SetFakeStateReplies(std::move(fake_states)); + + base::RunLoop run_loop; + client_->GetCurrentState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_welcome()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(FakeRmadClientTest, GetCurrentState_Welcome_CorrectStateReturned) { + std::vector<rmad::GetStateReply> fake_states; + // Use any error to test. + rmad::GetStateReply state = + CreateWelcomeStateReply(rmad::RMAD_ERROR_MISSING_COMPONENT); + state.mutable_state()->mutable_welcome()->set_choice( + rmad::WelcomeState_FinalizeChoice_RMAD_CHOICE_FINALIZE_REPAIR); + fake_states.push_back(std::move(state)); + fake_client_()->SetFakeStateReplies(std::move(fake_states)); + + base::RunLoop run_loop; + client_->GetCurrentState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_MISSING_COMPONENT); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_welcome()); + EXPECT_EQ( + response->state().welcome().choice(), + rmad::WelcomeState_FinalizeChoice_RMAD_CHOICE_FINALIZE_REPAIR); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(FakeRmadClientTest, TransitionNextState_Default_RmaNotRequired) { + base::RunLoop run_loop; + client_->TransitionNextState( + std::move(CreateWelcomeState()), + base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_RMA_NOT_REQUIRED); + EXPECT_FALSE(response->has_state()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(FakeRmadClientTest, TransitionNextState_NoNextState_Fails) { + std::vector<rmad::GetStateReply> fake_states; + fake_states.push_back( + rmad::GetStateReply(CreateWelcomeStateReply(rmad::RMAD_ERROR_OK))); + fake_client_()->SetFakeStateReplies(std::move(fake_states)); + + base::RunLoop run_loop; + client_->TransitionNextState( + std::move(CreateWelcomeState()), + base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_TRANSITION_FAILED); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_welcome()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(FakeRmadClientTest, TransitionNextState_HasNextState_Ok) { + std::vector<rmad::GetStateReply> fake_states; + fake_states.push_back( + rmad::GetStateReply(CreateWelcomeStateReply(rmad::RMAD_ERROR_OK))); + fake_states.push_back(rmad::GetStateReply( + CreateSelectComponentsStateReply(rmad::RMAD_ERROR_OK))); + fake_client_()->SetFakeStateReplies(std::move(fake_states)); + + base::RunLoop run_loop; + client_->TransitionNextState( + std::move(CreateWelcomeState()), + base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_select_components()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(FakeRmadClientTest, TransitionNextState_WrongCurrentState_Invalid) { + std::vector<rmad::GetStateReply> fake_states; + fake_states.push_back( + rmad::GetStateReply(CreateWelcomeStateReply(rmad::RMAD_ERROR_OK))); + fake_states.push_back(rmad::GetStateReply( + CreateSelectComponentsStateReply(rmad::RMAD_ERROR_OK))); + fake_client_()->SetFakeStateReplies(std::move(fake_states)); + + base::RunLoop run_loop; + client_->TransitionNextState( + std::move(CreateSelectComponentsState()), + base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_REQUEST_INVALID); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_welcome()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(FakeRmadClientTest, TransitionPreviousState_Default_RmaNotRequired) { + base::RunLoop run_loop; + client_->TransitionPreviousState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_RMA_NOT_REQUIRED); + EXPECT_FALSE(response->has_state()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(FakeRmadClientTest, TransitionPreviousState_HasPreviousState_Ok) { + std::vector<rmad::GetStateReply> fake_states; + fake_states.push_back( + rmad::GetStateReply(CreateWelcomeStateReply(rmad::RMAD_ERROR_OK))); + fake_states.push_back(rmad::GetStateReply( + CreateSelectComponentsStateReply(rmad::RMAD_ERROR_OK))); + fake_client_()->SetFakeStateReplies(std::move(fake_states)); + + { + base::RunLoop run_loop; + client_->TransitionNextState( + std::move(CreateWelcomeState()), + base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_select_components()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); + } + { + base::RunLoop run_loop; + client_->TransitionPreviousState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + LOG(ERROR) << "Prev started"; + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_welcome()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); + } +} + +TEST_F(FakeRmadClientTest, + TransitionPreviousState_HasPreviousState_StateUpdated) { + std::vector<rmad::GetStateReply> fake_states; + fake_states.push_back(CreateWelcomeStateReply(rmad::RMAD_ERROR_OK)); + fake_states.push_back(rmad::GetStateReply( + CreateSelectComponentsStateReply(rmad::RMAD_ERROR_OK))); + fake_client_()->SetFakeStateReplies(std::move(fake_states)); + + { + base::RunLoop run_loop; + client_->GetCurrentState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_welcome()); + EXPECT_EQ(response->state().welcome().choice(), + rmad::WelcomeState_FinalizeChoice_RMAD_CHOICE_UNKNOWN); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); + } + { + rmad::RmadState current_state = CreateWelcomeState(); + current_state.mutable_welcome()->set_choice( + rmad::WelcomeState_FinalizeChoice_RMAD_CHOICE_CANCEL); + + base::RunLoop run_loop; + client_->TransitionNextState( + std::move(current_state), + base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_select_components()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); + } + { + base::RunLoop run_loop; + client_->TransitionPreviousState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + LOG(ERROR) << "Prev started"; + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_welcome()); + EXPECT_EQ(response->state().welcome().choice(), + rmad::WelcomeState_FinalizeChoice_RMAD_CHOICE_CANCEL); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); + } +} + +TEST_F(FakeRmadClientTest, Abortable_Default_Ok) { + base::RunLoop run_loop; + client_->AbortRma(base::BindLambdaForTesting( + [&](base::Optional<rmad::AbortRmaReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(FakeRmadClientTest, Abortable_SetFalse_CannotCancel) { + fake_client_()->SetAbortable(false); + base::RunLoop run_loop; + client_->AbortRma(base::BindLambdaForTesting( + [&](base::Optional<rmad::AbortRmaReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_CANNOT_CANCEL_RMA); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(FakeRmadClientTest, Abortable_SetTrue_Ok) { + fake_client_()->SetAbortable(true); + base::RunLoop run_loop; + client_->AbortRma(base::BindLambdaForTesting( + [&](base::Optional<rmad::AbortRmaReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +} // namespace +} // namespace chromeos
diff --git a/chromeos/dbus/rmad/rmad_client.cc b/chromeos/dbus/rmad/rmad_client.cc index 96bc6dec..b207942 100644 --- a/chromeos/dbus/rmad/rmad_client.cc +++ b/chromeos/dbus/rmad/rmad_client.cc
@@ -21,8 +21,16 @@ class RmadClientImpl : public RmadClient { public: void Init(dbus::Bus* bus); + void GetCurrentState( DBusMethodCallback<rmad::GetStateReply> callback) override; + void TransitionNextState( + const rmad::RmadState& state, + DBusMethodCallback<rmad::GetStateReply> callback) override; + void TransitionPreviousState( + DBusMethodCallback<rmad::GetStateReply> callback) override; + + void AbortRma(DBusMethodCallback<rmad::AbortRmaReply> callback) override; RmadClientImpl() = default; RmadClientImpl(const RmadClientImpl&) = delete; @@ -30,8 +38,8 @@ ~RmadClientImpl() override = default; private: - void OnGetCurrentStateMethod(DBusMethodCallback<rmad::GetStateReply> callback, - dbus::Response* response); + template <class T> + void OnProtoReply(DBusMethodCallback<T> callback, dbus::Response* response); dbus::ObjectProxy* rmad_proxy_ = nullptr; @@ -52,23 +60,69 @@ dbus::MessageWriter writer(&method_call); rmad_proxy_->CallMethod( &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, - base::BindOnce(&RmadClientImpl::OnGetCurrentStateMethod, + base::BindOnce(&RmadClientImpl::OnProtoReply<rmad::GetStateReply>, weak_ptr_factory_.GetWeakPtr(), std::move(callback))); } -void RmadClientImpl::OnGetCurrentStateMethod( - DBusMethodCallback<rmad::GetStateReply> callback, - dbus::Response* response) { +void RmadClientImpl::TransitionNextState( + const rmad::RmadState& state, + DBusMethodCallback<rmad::GetStateReply> callback) { + dbus::MethodCall method_call(rmad::kRmadInterfaceName, + rmad::kTransitionNextStateMethod); + dbus::MessageWriter writer(&method_call); + // Create the empty request proto. + rmad::TransitionNextStateRequest protobuf_request; + protobuf_request.set_allocated_state(new rmad::RmadState(state)); + if (!writer.AppendProtoAsArrayOfBytes(protobuf_request)) { + LOG(ERROR) << "Error constructing message for " + << rmad::kTransitionNextStateMethod; + std::move(callback).Run(base::nullopt); + return; + } + rmad_proxy_->CallMethod( + &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, + base::BindOnce(&RmadClientImpl::OnProtoReply<rmad::GetStateReply>, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); +} +void RmadClientImpl::TransitionPreviousState( + DBusMethodCallback<rmad::GetStateReply> callback) { + dbus::MethodCall method_call(rmad::kRmadInterfaceName, + rmad::kTransitionPreviousStateMethod); + dbus::MessageWriter writer(&method_call); + rmad_proxy_->CallMethod( + &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, + base::BindOnce(&RmadClientImpl::OnProtoReply<rmad::GetStateReply>, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); +} + +void RmadClientImpl::AbortRma( + DBusMethodCallback<rmad::AbortRmaReply> callback) { + dbus::MethodCall method_call(rmad::kRmadInterfaceName, rmad::kAbortRmaMethod); + dbus::MessageWriter writer(&method_call); + rmad_proxy_->CallMethod( + &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, + base::BindOnce(&RmadClientImpl::OnProtoReply<rmad::AbortRmaReply>, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); +} + +template <class T> +void RmadClientImpl::OnProtoReply(DBusMethodCallback<T> callback, + dbus::Response* response) { if (!response) { - LOG(ERROR) << "Error calling " << rmad::kGetCurrentStateMethod; + LOG(ERROR) << "Error calling rmad function"; std::move(callback).Run(base::nullopt); return; } dbus::MessageReader reader(response); - rmad::GetStateReply response_proto; - // TODO(gavindodd): pop the proto. + T response_proto; + if (!reader.PopArrayOfBytesAsProto(&response_proto)) { + LOG(ERROR) << "Unable to decode response for " << response->GetMember(); + std::move(callback).Run(base::nullopt); + return; + } + // TODO(gavindodd): Does this need std::move()? std::move(callback).Run(response_proto); }
diff --git a/chromeos/dbus/rmad/rmad_client.h b/chromeos/dbus/rmad/rmad_client.h index e1b09d3..4a4ca2b9 100644 --- a/chromeos/dbus/rmad/rmad_client.h +++ b/chromeos/dbus/rmad/rmad_client.h
@@ -7,20 +7,12 @@ #include "base/component_export.h" #include "chromeos/dbus/dbus_method_call_status.h" +#include "chromeos/dbus/rmad/rmad.pb.h" namespace dbus { class Bus; } -// Temporary to allow code to compile while prototype rmad.proto is replaced. -namespace rmad { -class GetStateReply { - public: - int state() { return 0; } -}; - -} // namespace rmad - namespace chromeos { // RmadClient is responsible for receiving D-bus signals from the RmaDaemon @@ -43,9 +35,27 @@ static RmadClient* Get(); // Asynchronously gets the current RMA state. - // The state contains an error code and the current state of the RMA process. + // The response contains an error code and the current state of the RMA + // process. virtual void GetCurrentState( DBusMethodCallback<rmad::GetStateReply> callback) = 0; + // Asynchronously attempts to transition to the next RMA state. + // The response contains an error code and the current state of the RMA + // process. + virtual void TransitionNextState( + const rmad::RmadState& state, + DBusMethodCallback<rmad::GetStateReply> callback) = 0; + // Asynchronously attempts to transition to the previous RMA state. + // The response contains an error code and the current state of the RMA + // process. + virtual void TransitionPreviousState( + DBusMethodCallback<rmad::GetStateReply> callback) = 0; + + // Request the RMA process be cancelled. + // There is no guarantee the callback is called if abort is successful because + // the device will reboot. + // Returns RMAD_ERROR_OK on success or an error code. + virtual void AbortRma(DBusMethodCallback<rmad::AbortRmaReply> callback) = 0; protected: // Initialize/Shutdown should be used instead.
diff --git a/chromeos/dbus/rmad/rmad_client_unittest.cc b/chromeos/dbus/rmad/rmad_client_unittest.cc new file mode 100644 index 0000000..1aa3049 --- /dev/null +++ b/chromeos/dbus/rmad/rmad_client_unittest.cc
@@ -0,0 +1,346 @@ +// 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. + +#include "chromeos/dbus/rmad/rmad_client.h" + +#include <memory> +#include <string> + +#include "base/bind.h" +#include "base/logging.h" +#include "base/run_loop.h" +#include "base/test/bind.h" +#include "base/test/task_environment.h" +#include "dbus/message.h" +#include "dbus/mock_bus.h" +#include "dbus/mock_object_proxy.h" +#include "dbus/object_path.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/cros_system_api/dbus/service_constants.h" + +using ::testing::_; +using ::testing::Invoke; +using ::testing::Return; + +namespace chromeos { + +namespace { + +// Matcher that verifies that a dbus::Message has member |name|. +MATCHER_P(HasMember, name, "") { + if (arg->GetMember() != name) { + *result_listener << "has member " << arg->GetMember(); + return false; + } + return true; +} + +} // namespace + +class RmadClientTest : public testing::Test { + public: + RmadClientTest() = default; + RmadClientTest(const RmadClientTest&) = delete; + RmadClientTest& operator=(const RmadClientTest&) = delete; + + void SetUp() override { + // Create a mock bus. + dbus::Bus::Options options; + options.bus_type = dbus::Bus::SYSTEM; + mock_bus_ = new dbus::MockBus(options); + + // Create a mock lorgnette daemon proxy. + mock_proxy_ = + new dbus::MockObjectProxy(mock_bus_.get(), rmad::kRmadInterfaceName, + dbus::ObjectPath(rmad::kRmadServicePath)); + + // |client_|'s Init() method should request a proxy for communicating with + // the lorgnette daemon. + EXPECT_CALL(*mock_bus_.get(), + GetObjectProxy(rmad::kRmadInterfaceName, + dbus::ObjectPath(rmad::kRmadServicePath))) + .WillOnce(Return(mock_proxy_.get())); + + // ShutdownAndBlock() will be called in TearDown(). + EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); + + // Create a client with the mock bus. + RmadClient::Initialize(mock_bus_.get()); + client_ = RmadClient::Get(); + } + + void TearDown() override { + mock_bus_->ShutdownAndBlock(); + RmadClient::Shutdown(); + } + + // Responsible for responding to a kListScannersMethod call. + void OnCallDbusMethod(dbus::MethodCall* method_call, + int timeout_ms, + dbus::ObjectProxy::ResponseCallback* callback) { + task_environment_.GetMainThreadTaskRunner()->PostTask( + FROM_HERE, base::BindOnce(std::move(*callback), response_)); + } + + RmadClient* client_ = nullptr; // Unowned convenience pointer. + // A message loop to emulate asynchronous behavior. + base::test::SingleThreadTaskEnvironment task_environment_; + dbus::Response* response_ = nullptr; + // Mock D-Bus objects for |client_| to interact with. + scoped_refptr<dbus::MockBus> mock_bus_; + scoped_refptr<dbus::MockObjectProxy> mock_proxy_; +}; + +TEST_F(RmadClientTest, GetCurrentState) { + std::unique_ptr<dbus::Response> response = dbus::Response::CreateEmpty(); + rmad::GetStateReply expected_proto; + expected_proto.set_error(rmad::RMAD_ERROR_RMA_NOT_REQUIRED); + ASSERT_TRUE(dbus::MessageWriter(response.get()) + .AppendProtoAsArrayOfBytes(expected_proto)); + + response_ = response.get(); + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kGetCurrentStateMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + base::RunLoop run_loop; + client_->GetCurrentState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_RMA_NOT_REQUIRED); + EXPECT_FALSE(response->has_state()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, GetCurrentState_NullResponse) { + response_ = nullptr; + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kGetCurrentStateMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + base::RunLoop run_loop; + client_->GetCurrentState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_FALSE(response.has_value()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, GetCurrentState_EmptyResponse) { + std::unique_ptr<dbus::Response> response = dbus::Response::CreateEmpty(); + + response_ = response.get(); + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kGetCurrentStateMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + base::RunLoop run_loop; + client_->GetCurrentState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_FALSE(response.has_value()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, TransitionNextState) { + std::unique_ptr<dbus::Response> response = dbus::Response::CreateEmpty(); + rmad::GetStateReply expected_proto; + rmad::RmadState* expected_state = new rmad::RmadState(); + expected_state->set_allocated_select_components( + new rmad::ComponentsRepairState()); + expected_proto.set_allocated_state(expected_state); + expected_proto.set_error(rmad::RMAD_ERROR_OK); + ASSERT_TRUE(dbus::MessageWriter(response.get()) + .AppendProtoAsArrayOfBytes(expected_proto)); + + response_ = response.get(); + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kTransitionNextStateMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + rmad::RmadState request; + request.set_allocated_welcome(new rmad::WelcomeState()); + + base::RunLoop run_loop; + client_->TransitionNextState( + request, base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_select_components()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, TransitionNextState_NullResponse) { + response_ = nullptr; + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kTransitionNextStateMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + rmad::RmadState request; + request.set_allocated_welcome(new rmad::WelcomeState()); + base::RunLoop run_loop; + client_->TransitionNextState( + request, base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_FALSE(response.has_value()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, TransitionNextState_EmptyResponse) { + std::unique_ptr<dbus::Response> response = dbus::Response::CreateEmpty(); + + response_ = response.get(); + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kTransitionNextStateMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + rmad::RmadState request; + request.set_allocated_welcome(new rmad::WelcomeState()); + base::RunLoop run_loop; + client_->TransitionNextState( + request, base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_FALSE(response.has_value()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, TransitionPreviousState) { + std::unique_ptr<dbus::Response> response = dbus::Response::CreateEmpty(); + rmad::GetStateReply expected_proto; + rmad::RmadState* expected_state = new rmad::RmadState(); + expected_state->set_allocated_welcome(new rmad::WelcomeState()); + expected_proto.set_allocated_state(expected_state); + expected_proto.set_error(rmad::RMAD_ERROR_TRANSITION_FAILED); + ASSERT_TRUE(dbus::MessageWriter(response.get()) + .AppendProtoAsArrayOfBytes(expected_proto)); + + response_ = response.get(); + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kTransitionPreviousStateMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + base::RunLoop run_loop; + client_->TransitionPreviousState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_TRANSITION_FAILED); + EXPECT_TRUE(response->has_state()); + EXPECT_TRUE(response->state().has_welcome()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, TransitionPreviousState_NullResponse) { + response_ = nullptr; + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kTransitionPreviousStateMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + base::RunLoop run_loop; + client_->TransitionPreviousState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_FALSE(response.has_value()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, TransitionPreviousState_EmptyResponse) { + std::unique_ptr<dbus::Response> response = dbus::Response::CreateEmpty(); + + response_ = response.get(); + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kTransitionPreviousStateMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + base::RunLoop run_loop; + client_->TransitionPreviousState(base::BindLambdaForTesting( + [&](base::Optional<rmad::GetStateReply> response) { + EXPECT_FALSE(response.has_value()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, AbortRma) { + std::unique_ptr<dbus::Response> response = dbus::Response::CreateEmpty(); + rmad::AbortRmaReply expected_proto; + expected_proto.set_error(rmad::RMAD_ERROR_OK); + ASSERT_TRUE(dbus::MessageWriter(response.get()) + .AppendProtoAsArrayOfBytes(expected_proto)); + + response_ = response.get(); + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kAbortRmaMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + base::RunLoop run_loop; + client_->AbortRma(base::BindLambdaForTesting( + [&](base::Optional<rmad::AbortRmaReply> response) { + EXPECT_TRUE(response.has_value()); + EXPECT_EQ(response->error(), rmad::RMAD_ERROR_OK); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, AbortRma_NullResponse) { + response_ = nullptr; + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kAbortRmaMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + base::RunLoop run_loop; + client_->AbortRma(base::BindLambdaForTesting( + [&](base::Optional<rmad::AbortRmaReply> response) { + EXPECT_FALSE(response.has_value()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +TEST_F(RmadClientTest, AbortRma_EmptyResponse) { + std::unique_ptr<dbus::Response> response = dbus::Response::CreateEmpty(); + + response_ = response.get(); + EXPECT_CALL(*mock_proxy_.get(), + DoCallMethod(HasMember(rmad::kAbortRmaMethod), + dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, _)) + .WillOnce(Invoke(this, &RmadClientTest::OnCallDbusMethod)); + + base::RunLoop run_loop; + client_->AbortRma(base::BindLambdaForTesting( + [&](base::Optional<rmad::AbortRmaReply> response) { + EXPECT_FALSE(response.has_value()); + run_loop.Quit(); + })); + run_loop.RunUntilIdle(); +} + +} // namespace chromeos
diff --git a/chromeos/dbus/userdataauth/cryptohome_misc_client.h b/chromeos/dbus/userdataauth/cryptohome_misc_client.h index 762229c..d590df9 100644 --- a/chromeos/dbus/userdataauth/cryptohome_misc_client.h +++ b/chromeos/dbus/userdataauth/cryptohome_misc_client.h
@@ -101,4 +101,10 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source code migration is finished. +namespace ash { +using ::chromeos::CryptohomeMiscClient; +} + #endif // CHROMEOS_DBUS_USERDATAAUTH_CRYPTOHOME_MISC_CLIENT_H_
diff --git a/chromeos/dbus/userdataauth/fake_cryptohome_misc_client.h b/chromeos/dbus/userdataauth/fake_cryptohome_misc_client.h index 22c14a2e..4ac0394 100644 --- a/chromeos/dbus/userdataauth/fake_cryptohome_misc_client.h +++ b/chromeos/dbus/userdataauth/fake_cryptohome_misc_client.h
@@ -131,4 +131,10 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source migration is finished. +namespace ash { +using ::chromeos::FakeCryptohomeMiscClient; +} + #endif // CHROMEOS_DBUS_USERDATAAUTH_FAKE_CRYPTOHOME_MISC_CLIENT_H_
diff --git a/chromeos/dbus/userdataauth/userdataauth_client.h b/chromeos/dbus/userdataauth/userdataauth_client.h index fec83dbb..4808f63f 100644 --- a/chromeos/dbus/userdataauth/userdataauth_client.h +++ b/chromeos/dbus/userdataauth/userdataauth_client.h
@@ -195,4 +195,10 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source migration is finished. +namespace ash { +using ::chromeos::UserDataAuthClient; +} + #endif // CHROMEOS_DBUS_USERDATAAUTH_USERDATAAUTH_CLIENT_H_
diff --git a/chromeos/lacros/BUILD.gn b/chromeos/lacros/BUILD.gn index fbb82100..d4c65b1a 100644 --- a/chromeos/lacros/BUILD.gn +++ b/chromeos/lacros/BUILD.gn
@@ -63,7 +63,9 @@ #"lacros.AudioPlay", "lacros.AppLauncherLaunch", "lacros.Basic", - "lacros.ShelfLaunch", + + # TODO(crbug.com/1205526): Enable this test again. + #"lacros.ShelfLaunch", ] }
diff --git a/chromeos/login/auth/cryptohome_authenticator.h b/chromeos/login/auth/cryptohome_authenticator.h index df662fd..bcf24ab 100644 --- a/chromeos/login/auth/cryptohome_authenticator.h +++ b/chromeos/login/auth/cryptohome_authenticator.h
@@ -24,8 +24,11 @@ class AuthFailure; -namespace chromeos { +namespace ash { +class CryptohomeAuthenticatorTest; +} +namespace chromeos { class AuthStatusConsumer; // Authenticates a Chromium OS user against cryptohome. @@ -173,7 +176,7 @@ ~CryptohomeAuthenticator() override; private: - friend class CryptohomeAuthenticatorTest; + friend class ash::CryptohomeAuthenticatorTest; FRIEND_TEST_ALL_PREFIXES(CryptohomeAuthenticatorTest, ResolveOwnerNeededDirectFailedMount); FRIEND_TEST_ALL_PREFIXES(CryptohomeAuthenticatorTest, @@ -264,4 +267,10 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source migration is finished. +namespace ash { +using ::chromeos::CryptohomeAuthenticator; +} + #endif // CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_
diff --git a/chromeos/login/auth/cryptohome_key_constants.h b/chromeos/login/auth/cryptohome_key_constants.h index 0b433e4..117e7a53 100644 --- a/chromeos/login/auth/cryptohome_key_constants.h +++ b/chromeos/login/auth/cryptohome_key_constants.h
@@ -17,4 +17,10 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source code migration is finished. +namespace ash { +using ::chromeos::kCryptohomeGaiaKeyLabel; +} + #endif // CHROMEOS_LOGIN_AUTH_CRYPTOHOME_KEY_CONSTANTS_H_
diff --git a/chromeos/login/auth/mock_auth_status_consumer.h b/chromeos/login/auth/mock_auth_status_consumer.h index 666ead0..d95d2f5 100644 --- a/chromeos/login/auth/mock_auth_status_consumer.h +++ b/chromeos/login/auth/mock_auth_status_consumer.h
@@ -53,4 +53,10 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source code migration is finished. +namespace ash { +using ::chromeos::MockAuthStatusConsumer; +} + #endif // CHROMEOS_LOGIN_AUTH_MOCK_AUTH_STATUS_CONSUMER_H_
diff --git a/chromeos/login/auth/safe_mode_delegate.h b/chromeos/login/auth/safe_mode_delegate.h index 73d20864..0a40a92 100644 --- a/chromeos/login/auth/safe_mode_delegate.h +++ b/chromeos/login/auth/safe_mode_delegate.h
@@ -46,4 +46,10 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove when the //chrome/browser/chromeos +// source code migration is finished. +namespace ash { +using ::chromeos::SafeModeDelegate; +} + #endif // CHROMEOS_LOGIN_AUTH_SAFE_MODE_DELEGATE_H_
diff --git a/chromeos/login/auth/test_attempt_state.h b/chromeos/login/auth/test_attempt_state.h index dc9d2c0..51e88a4 100644 --- a/chromeos/login/auth/test_attempt_state.h +++ b/chromeos/login/auth/test_attempt_state.h
@@ -40,4 +40,10 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos +// source code migration is finished. +namespace ash { +using ::chromeos::TestAttemptState; +} + #endif // CHROMEOS_LOGIN_AUTH_TEST_ATTEMPT_STATE_H_
diff --git a/chromeos/network/cellular_esim_profile_handler.h b/chromeos/network/cellular_esim_profile_handler.h index f88e12e..d84dad7e 100644 --- a/chromeos/network/cellular_esim_profile_handler.h +++ b/chromeos/network/cellular_esim_profile_handler.h
@@ -68,6 +68,11 @@ // (e.g., if ModemManager is currently pointed to a pSIM slot). virtual std::vector<CellularESimProfile> GetESimProfiles() = 0; + // Returns whether profiles for the EUICC with the given EID have been + // refreshsed. If this function returns true, any known eSIM profiles for the + // associated EUICC should be returned by GetESimProfiles(). + virtual bool HasRefreshedProfilesForEuicc(const std::string& eid) = 0; + virtual void SetDevicePrefs(PrefService* device_prefs) = 0; void AddObserver(Observer* observer);
diff --git a/chromeos/network/cellular_esim_profile_handler_impl.cc b/chromeos/network/cellular_esim_profile_handler_impl.cc index 3c00973..5a2e2003 100644 --- a/chromeos/network/cellular_esim_profile_handler_impl.cc +++ b/chromeos/network/cellular_esim_profile_handler_impl.cc
@@ -4,6 +4,7 @@ #include "chromeos/network/cellular_esim_profile_handler_impl.h" +#include <sstream> #include <vector> #include "ash/constants/ash_pref_names.h" @@ -56,7 +57,7 @@ if (!device_prefs_) return; - RefreshEuiccsIfNecessary(); + AutoRefreshEuiccsIfNecessary(); } void CellularESimProfileHandlerImpl::InitInternal() { @@ -96,6 +97,24 @@ return profiles; } +bool CellularESimProfileHandlerImpl::HasRefreshedProfilesForEuicc( + const std::string& eid) { + base::flat_set<std::string> euicc_paths = + GetAutoRefreshedEuiccPathsFromPrefs(); + + for (const auto& path : euicc_paths) { + HermesEuiccClient::Properties* euicc_properties = + HermesEuiccClient::Get()->GetProperties(dbus::ObjectPath(path)); + if (!euicc_properties) + continue; + + if (eid == euicc_properties->eid().value()) + return true; + } + + return false; +} + void CellularESimProfileHandlerImpl::SetDevicePrefs(PrefService* device_prefs) { device_prefs_ = device_prefs; OnHermesPropertiesUpdated(); @@ -105,62 +124,74 @@ if (!device_prefs_) return; - RefreshEuiccsIfNecessary(); + AutoRefreshEuiccsIfNecessary(); UpdateProfilesFromHermes(); } -void CellularESimProfileHandlerImpl::RefreshEuiccsIfNecessary() { +void CellularESimProfileHandlerImpl::AutoRefreshEuiccsIfNecessary() { if (!CellularDeviceExists()) return; base::flat_set<std::string> euicc_paths_from_hermes = GetEuiccPathsFromHermes(); - base::flat_set<std::string> euicc_paths_from_prefs = GetEuiccPathsFromPrefs(); + base::flat_set<std::string> auto_refreshed_euicc_paths = + GetAutoRefreshedEuiccPaths(); - // If the paths in prefs and Hermes match, we have already tried refreshing - // them both, and there is nothing else to do. - if (euicc_paths_from_hermes == euicc_paths_from_prefs) - return; - - base::flat_set<std::string> paths_in_hermes_but_not_prefs; - for (const auto& hermes_path : euicc_paths_from_hermes) { - if (!base::Contains(euicc_paths_from_prefs, hermes_path)) - paths_in_hermes_but_not_prefs.insert(hermes_path); + base::flat_set<std::string> paths_needing_auto_refresh; + for (const auto& euicc_path : euicc_paths_from_hermes) { + if (!base::Contains(auto_refreshed_euicc_paths, euicc_path)) + paths_needing_auto_refresh.insert(euicc_path); } // We only need to request profiles if we see a new EUICC from Hermes that we // have not yet seen before. If no such EUICCs exist, return early. - if (paths_in_hermes_but_not_prefs.empty()) + if (paths_needing_auto_refresh.empty()) return; - // If there is more than one EUICC, log a warning. This configuration is not - // officially supported, so this may be helpful in feedback reports. - if (paths_in_hermes_but_not_prefs.size() > 1u) - NET_LOG(ERROR) << "Attempting to refresh profiles from multiple EUICCs"; + StartAutoRefresh(paths_needing_auto_refresh); +} - // Combine both sets together and store them to prefs to ensure that we do not - // need to refresh again for the same EUICCs. - base::flat_set<std::string> all_paths; - all_paths.insert(euicc_paths_from_prefs.begin(), - euicc_paths_from_prefs.end()); - all_paths.insert(euicc_paths_from_hermes.begin(), - euicc_paths_from_hermes.end()); - StoreEuiccPathsToPrefs(all_paths); +void CellularESimProfileHandlerImpl::StartAutoRefresh( + const base::flat_set<std::string>& euicc_paths) { + paths_pending_auto_refresh_.insert(euicc_paths.begin(), euicc_paths.end()); + + // If there is more than one EUICC, log an error. This configuration is not + // officially supported, so this log may be helpful in feedback reports. + if (euicc_paths.size() > 1u) + NET_LOG(ERROR) << "Attempting to refresh profiles from multiple EUICCs"; // Refresh profiles from the unknown EUICCs. Note that this will internally // start an inhibit operation, temporarily blocking the user from changing // cellular settings. This operation is only expected to occur when the device // originally boots or after a powerwash. - for (const auto& path : paths_in_hermes_but_not_prefs) { + for (const auto& path : euicc_paths) { NET_LOG(EVENT) << "Found new EUICC whose profiles have not yet been " << "refreshsed. Refreshing profile list for " << path; - RefreshProfileList(dbus::ObjectPath(path), base::DoNothing()); + RefreshProfileList( + dbus::ObjectPath(path), + base::BindOnce( + &CellularESimProfileHandlerImpl::OnAutoRefreshEuiccComplete, + weak_ptr_factory_.GetWeakPtr(), path)); } } base::flat_set<std::string> -CellularESimProfileHandlerImpl::GetEuiccPathsFromPrefs() const { +CellularESimProfileHandlerImpl::GetAutoRefreshedEuiccPaths() const { + // Add all paths stored in prefs. + base::flat_set<std::string> euicc_paths = + GetAutoRefreshedEuiccPathsFromPrefs(); + + // Add paths which are currently pending a refresh. + euicc_paths.insert(paths_pending_auto_refresh_.begin(), + paths_pending_auto_refresh_.end()); + + return euicc_paths; +} + +base::flat_set<std::string> +CellularESimProfileHandlerImpl::GetAutoRefreshedEuiccPathsFromPrefs() const { DCHECK(device_prefs_); + const base::ListValue* euicc_paths_from_prefs = device_prefs_->GetList(prefs::kESimRefreshedEuiccs); if (!euicc_paths_from_prefs) { @@ -168,25 +199,47 @@ return {}; } - base::flat_set<std::string> euicc_paths_from_prefs_set; + base::flat_set<std::string> euicc_paths; for (const auto& euicc : *euicc_paths_from_prefs) { if (!euicc.is_string()) { NET_LOG(ERROR) << "Non-string EUICC path: " << euicc; continue; } - euicc_paths_from_prefs_set.insert(euicc.GetString()); + euicc_paths.insert(euicc.GetString()); } - return euicc_paths_from_prefs_set; + return euicc_paths; } -void CellularESimProfileHandlerImpl::StoreEuiccPathsToPrefs( - const base::flat_set<std::string>& paths) { +void CellularESimProfileHandlerImpl::OnAutoRefreshEuiccComplete( + const std::string& path, + std::unique_ptr<CellularInhibitor::InhibitLock> inhibit_lock) { + paths_pending_auto_refresh_.erase(path); + + if (!inhibit_lock) { + NET_LOG(ERROR) << "Auto-refresh failed due to inhibit error. Path: " + << path; + return; + } + + NET_LOG(EVENT) << "Finished auto-refresh for path: " << path; + AddNewlyRefreshedEuiccPathToPrefs(path); +} + +void CellularESimProfileHandlerImpl::AddNewlyRefreshedEuiccPathToPrefs( + const std::string& new_path) { DCHECK(device_prefs_); + base::flat_set<std::string> auto_refreshed_euicc_paths = + GetAutoRefreshedEuiccPathsFromPrefs(); + + // Keep all paths which were already in prefs. base::Value euicc_paths(base::Value::Type::LIST); - for (const auto& path : paths) + for (const auto& path : auto_refreshed_euicc_paths) euicc_paths.Append(path); + // Add new path. + euicc_paths.Append(new_path); + device_prefs_->Set(prefs::kESimRefreshedEuiccs, std::move(euicc_paths)); } @@ -219,14 +272,21 @@ if (profiles_from_hermes == profiles_before_fetch) return; - NET_LOG(EVENT) << "New set of eSIM profiles have been fetched from Hermes"; + std::stringstream ss; + ss << "New set of eSIM profiles have been fetched from Hermes: "; // Store the updated list of profiles in prefs. base::Value list(base::Value::Type::LIST); - for (const auto& profile : profiles_from_hermes) + for (const auto& profile : profiles_from_hermes) { list.Append(profile.ToDictionaryValue()); + ss << "{iccid: " << profile.iccid() << ", eid: " << profile.eid() << "}, "; + } device_prefs_->Set(prefs::kESimProfiles, std::move(list)); + if (profiles_from_hermes.empty()) + ss << "<empty>"; + NET_LOG(EVENT) << ss.str(); + network_state_handler()->SyncStubCellularNetworks(); NotifyESimProfileListUpdated(); } @@ -236,4 +296,16 @@ NetworkTypePattern::Cellular()) != nullptr; } +void CellularESimProfileHandlerImpl::ResetESimProfileCache() { + DCHECK(device_prefs_); + + device_prefs_->Set(prefs::kESimProfiles, + base::Value(base::Value::Type::LIST)); + device_prefs_->Set(prefs::kESimRefreshedEuiccs, + base::Value(base::Value::Type::LIST)); + + NET_LOG(EVENT) << "Resetting eSIM profile cache"; + OnHermesPropertiesUpdated(); +} + } // namespace chromeos
diff --git a/chromeos/network/cellular_esim_profile_handler_impl.h b/chromeos/network/cellular_esim_profile_handler_impl.h index 548279e..9e10f16 100644 --- a/chromeos/network/cellular_esim_profile_handler_impl.h +++ b/chromeos/network/cellular_esim_profile_handler_impl.h
@@ -7,6 +7,7 @@ #include "base/component_export.h" #include "base/containers/flat_set.h" +#include "base/memory/weak_ptr.h" #include "chromeos/network/cellular_esim_profile_handler.h" #include "chromeos/network/network_state_handler_observer.h" @@ -15,6 +16,21 @@ namespace chromeos { +// CellularESimProfileHandler implementation which utilizes the local state +// PrefService to track eSIM profiles. +// +// eSIM profiles can only be retrieved from the device hardware when an EUICC is +// the "active" slot on the device, and only one slot can be active at a time. +// This means that if the physical SIM slot is active, we cannot fetch an +// updated list of profiles without switching slots, which can be disruptive if +// the user is utilizing a cellular connection from the physical SIM slot. To +// ensure that clients can access eSIM metadata regardless of the active slot, +// this class stores all known eSIM profiles persistently in prefs. +// +// Additionally, this class tracks all known EUICC paths. If it detects a new +// EUICC which it previously had not known about, it automatically refreshes +// profile metadata from that slot. This ensures that after a powerwash, we +// still expose information about installed profiles. class COMPONENT_EXPORT(CHROMEOS_NETWORK) CellularESimProfileHandlerImpl : public CellularESimProfileHandler, public NetworkStateHandlerObserver { @@ -33,21 +49,38 @@ private: friend class CellularESimProfileHandlerImplTest; + friend class NetworkConfigMessageHandler; // CellularESimProfileHandler: void InitInternal() override; std::vector<CellularESimProfile> GetESimProfiles() override; + bool HasRefreshedProfilesForEuicc(const std::string& eid) override; void SetDevicePrefs(PrefService* device_prefs) override; void OnHermesPropertiesUpdated() override; - void RefreshEuiccsIfNecessary(); - base::flat_set<std::string> GetEuiccPathsFromPrefs() const; - void StoreEuiccPathsToPrefs(const base::flat_set<std::string>& paths); + void AutoRefreshEuiccsIfNecessary(); + void StartAutoRefresh(const base::flat_set<std::string>& euicc_paths); + base::flat_set<std::string> GetAutoRefreshedEuiccPaths() const; + base::flat_set<std::string> GetAutoRefreshedEuiccPathsFromPrefs() const; + void OnAutoRefreshEuiccComplete( + const std::string& path, + std::unique_ptr<CellularInhibitor::InhibitLock> inhibit_lock); + void AddNewlyRefreshedEuiccPathToPrefs(const std::string& path); + void UpdateProfilesFromHermes(); + bool CellularDeviceExists() const; + // Used by chrome://network debug page; not meant to be called during normal + // usage. + void ResetESimProfileCache(); + // Initialized to null and set once SetDevicePrefs() is called. PrefService* device_prefs_ = nullptr; + + base::flat_set<std::string> paths_pending_auto_refresh_; + + base::WeakPtrFactory<CellularESimProfileHandlerImpl> weak_ptr_factory_{this}; }; } // namespace chromeos
diff --git a/chromeos/network/cellular_esim_profile_handler_impl_unittest.cc b/chromeos/network/cellular_esim_profile_handler_impl_unittest.cc index d11b810..0455f3e 100644 --- a/chromeos/network/cellular_esim_profile_handler_impl_unittest.cc +++ b/chromeos/network/cellular_esim_profile_handler_impl_unittest.cc
@@ -148,6 +148,10 @@ return handler_->GetESimProfiles(); } + bool HasAutoRefreshedEuicc(int euicc_num) { + return handler_->HasRefreshedProfilesForEuicc(CreateTestEid(euicc_num)); + } + size_t NumObserverEvents() const { return observer_.num_updates(); } std::unique_ptr<CellularInhibitor::InhibitLock> InhibitCellularScanning() { @@ -450,12 +454,21 @@ EXPECT_TRUE(euicc_paths_from_prefs.is_list()); EXPECT_TRUE(euicc_paths_from_prefs.GetList().empty()); + // Set device prefs; a new auto-refresh should have started but not yet + // completed. SetDevicePrefs(); euicc_paths_from_prefs = GetEuiccListFromPrefs(); EXPECT_TRUE(euicc_paths_from_prefs.is_list()); + EXPECT_TRUE(euicc_paths_from_prefs.GetList().empty()); + EXPECT_FALSE(HasAutoRefreshedEuicc(/*euicc_num=*/1)); + + base::RunLoop().RunUntilIdle(); + euicc_paths_from_prefs = GetEuiccListFromPrefs(); + EXPECT_TRUE(euicc_paths_from_prefs.is_list()); EXPECT_EQ(1u, euicc_paths_from_prefs.GetList().size()); EXPECT_EQ(CreateTestEuiccPath(/*euicc_num=*/1), euicc_paths_from_prefs.GetList()[0].GetString()); + EXPECT_TRUE(HasAutoRefreshedEuicc(/*euicc_num=*/1)); } TEST_F(CellularESimProfileHandlerImplTest, IgnoresESimProfilesWithNoIccid) {
diff --git a/chromeos/network/cellular_metrics_logger.cc b/chromeos/network/cellular_metrics_logger.cc index cee82bf..ccce2bdd 100644 --- a/chromeos/network/cellular_metrics_logger.cc +++ b/chromeos/network/cellular_metrics_logger.cc
@@ -4,6 +4,7 @@ #include "chromeos/network/cellular_metrics_logger.h" +#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/task/post_task.h" #include "chromeos/components/feature_usage/feature_usage_metrics.h" @@ -42,6 +43,24 @@ } // namespace // static +const char + CellularMetricsLogger::kESimUserInitiatedConnectionResultHistogram[] = + "Network.Cellular.ESim.ConnectionResult.UserInitiated"; + +// static +const char + CellularMetricsLogger::kPSimUserInitiatedConnectionResultHistogram[] = + "Network.Cellular.PSim.ConnectionResult.UserInitiated"; + +// static +const char CellularMetricsLogger::kESimAllConnectionResultHistogram[] = + "Network.Cellular.ESim.ConnectionResult.All"; + +// static +const char CellularMetricsLogger::kPSimAllConnectionResultHistogram[] = + "Network.Cellular.PSim.ConnectionResult.All"; + +// static const char CellularMetricsLogger::kSimPinLockSuccessHistogram[] = "Network.Cellular.Pin.LockSuccess"; @@ -97,16 +116,16 @@ switch (pin_operation) { case SimPinOperation::kLock: - UMA_HISTOGRAM_ENUMERATION(kSimPinLockSuccessHistogram, result); + base::UmaHistogramEnumeration(kSimPinLockSuccessHistogram, result); return; case SimPinOperation::kUnlock: - UMA_HISTOGRAM_ENUMERATION(kSimPinUnlockSuccessHistogram, result); + base::UmaHistogramEnumeration(kSimPinUnlockSuccessHistogram, result); return; case SimPinOperation::kUnblock: - UMA_HISTOGRAM_ENUMERATION(kSimPinUnblockSuccessHistogram, result); + base::UmaHistogramEnumeration(kSimPinUnblockSuccessHistogram, result); return; case SimPinOperation::kChange: - UMA_HISTOGRAM_ENUMERATION(kSimPinChangeSuccessHistogram, result); + base::UmaHistogramEnumeration(kSimPinChangeSuccessHistogram, result); return; } } @@ -118,6 +137,108 @@ kESimUMAFeatureName); } +// static +void CellularMetricsLogger::LogCellularUserInitiatedConnectionSuccessHistogram( + CellularMetricsLogger::ConnectResult start_connect_result, + SimType sim_type) { + if (sim_type == SimType::kPSim) { + base::UmaHistogramEnumeration(kPSimUserInitiatedConnectionResultHistogram, + start_connect_result); + } else { + base::UmaHistogramEnumeration(kESimUserInitiatedConnectionResultHistogram, + start_connect_result); + } +} + +// static +CellularMetricsLogger::ConnectResult +CellularMetricsLogger::NetworkConnectionErrorToConnectResult( + const std::string& error_name) { + if (error_name == NetworkConnectionHandler::kErrorNotFound) + return CellularMetricsLogger::ConnectResult::kInvalidGuid; + + if (error_name == NetworkConnectionHandler::kErrorConnected || + error_name == NetworkConnectionHandler::kErrorConnecting) { + return CellularMetricsLogger::ConnectResult::kInvalidState; + } + + if (error_name == NetworkConnectionHandler::kErrorConnectCanceled) + return CellularMetricsLogger::ConnectResult::kCanceled; + + if (error_name == NetworkConnectionHandler::kErrorPassphraseRequired || + error_name == NetworkConnectionHandler::kErrorBadPassphrase || + error_name == NetworkConnectionHandler::kErrorCertificateRequired || + error_name == NetworkConnectionHandler::kErrorConfigurationRequired || + error_name == NetworkConnectionHandler::kErrorAuthenticationRequired || + error_name == NetworkConnectionHandler::kErrorCertLoadTimeout || + error_name == NetworkConnectionHandler::kErrorConfigureFailed || + error_name == NetworkConnectionHandler::kErrorHexSsidRequired) { + return CellularMetricsLogger::ConnectResult::kNotConfigured; + } + + if (error_name == NetworkConnectionHandler::kErrorBlockedByPolicy) + return CellularMetricsLogger::ConnectResult::kBlocked; + + if (error_name == NetworkConnectionHandler::kErrorCellularInhibitFailure) + return CellularMetricsLogger::ConnectResult::kCellularInhibitFailure; + + if (error_name == NetworkConnectionHandler::kErrorESimProfileIssue) + return CellularMetricsLogger::ConnectResult::kESimProfileIssue; + + if (error_name == NetworkConnectionHandler::kErrorCellularOutOfCredits) + return CellularMetricsLogger::ConnectResult::kCellularOutOfCredits; + + if (error_name == NetworkConnectionHandler::kErrorSimLocked) + return CellularMetricsLogger::ConnectResult::kSimLocked; + + if (error_name == NetworkConnectionHandler::kErrorConnectFailed) + return CellularMetricsLogger::ConnectResult::kConnectFailed; + + if (error_name == NetworkConnectionHandler::kErrorActivateFailed) + return CellularMetricsLogger::ConnectResult::kActivateFailed; + + if (error_name == + NetworkConnectionHandler::kErrorEnabledOrDisabledWhenNotAvailable) { + return CellularMetricsLogger::ConnectResult:: + kEnabledOrDisabledWhenNotAvailable; + } + + return CellularMetricsLogger::ConnectResult::kUnknown; +} + +// static +CellularMetricsLogger::ShillConnectResult +CellularMetricsLogger::ShillErrorToConnectResult( + const std::string& error_name) { + if (error_name == shill::kErrorBadPassphrase) + return CellularMetricsLogger::ShillConnectResult::kBadPassphrase; + else if (error_name == shill::kErrorBadWEPKey) + return CellularMetricsLogger::ShillConnectResult::kBadWepKey; + else if (error_name == shill::kErrorConnectFailed) + return CellularMetricsLogger::ShillConnectResult::kFailedToConnect; + else if (error_name == shill::kErrorDhcpFailed) + return CellularMetricsLogger::ShillConnectResult::kDhcpFailure; + else if (error_name == shill::kErrorDNSLookupFailed) + return CellularMetricsLogger::ShillConnectResult::kDnsLookupFailure; + else if (error_name == shill::kErrorEapAuthenticationFailed) + return CellularMetricsLogger::ShillConnectResult::kEapAuthentication; + else if (error_name == shill::kErrorEapLocalTlsFailed) + return CellularMetricsLogger::ShillConnectResult::kEapLocalTls; + else if (error_name == shill::kErrorEapRemoteTlsFailed) + return CellularMetricsLogger::ShillConnectResult::kEapRemoteTls; + else if (error_name == shill::kErrorOutOfRange) + return CellularMetricsLogger::ShillConnectResult::kOutOfRange; + else if (error_name == shill::kErrorPinMissing) + return CellularMetricsLogger::ShillConnectResult::kPinMissing; + else if (error_name == shill::kErrorNoFailure) + return CellularMetricsLogger::ShillConnectResult::kNoFailure; + else if (error_name == shill::kErrorNotAssociated) + return CellularMetricsLogger::ShillConnectResult::kNotAssociated; + else if (error_name == shill::kErrorNotAuthenticated) + return CellularMetricsLogger::ShillConnectResult::kNotAuthenticated; + return CellularMetricsLogger::ShillConnectResult::kUnknown; +} + // Reports daily ESim Standard Feature Usage Logging metrics. Note that // if an object of this type is destroyed and created in the same day, // metrics eligibility and enablement will only be reported once. Registers @@ -167,54 +288,24 @@ std::unique_ptr<feature_usage::FeatureUsageMetrics> feature_usage_metrics_; }; -CellularMetricsLogger::ConnectResult -CellularMetricsLogger::NetworkConnectionErrorToConnectResult( - const std::string& error_name) { - if (error_name == NetworkConnectionHandler::kErrorNotFound) - return CellularMetricsLogger::ConnectResult::kInvalidGuid; - - if (error_name == NetworkConnectionHandler::kErrorConnected || - error_name == NetworkConnectionHandler::kErrorConnecting) { - return CellularMetricsLogger::ConnectResult::kInvalidState; - } - - if (error_name == NetworkConnectionHandler::kErrorConnectCanceled) - return CellularMetricsLogger::ConnectResult::kCanceled; - - if (error_name == NetworkConnectionHandler::kErrorPassphraseRequired || - error_name == NetworkConnectionHandler::kErrorBadPassphrase || - error_name == NetworkConnectionHandler::kErrorCertificateRequired || - error_name == NetworkConnectionHandler::kErrorConfigurationRequired || - error_name == NetworkConnectionHandler::kErrorAuthenticationRequired || - error_name == NetworkConnectionHandler::kErrorCertLoadTimeout || - error_name == NetworkConnectionHandler::kErrorConfigureFailed) { - return CellularMetricsLogger::ConnectResult::kNotConfigured; - } - - if (error_name == NetworkConnectionHandler::kErrorBlockedByPolicy) - return CellularMetricsLogger::ConnectResult::kBlocked; - - return CellularMetricsLogger::ConnectResult::kUnknown; -} - -void CellularMetricsLogger::LogCellularConnectionSuccessHistogram( - CellularMetricsLogger::ConnectResult start_connect_result, +void CellularMetricsLogger::LogCellularAllConnectionSuccessHistogram( + CellularMetricsLogger::ShillConnectResult start_connect_result, SimType sim_type) { if (sim_type == SimType::kPSim) { - UMA_HISTOGRAM_ENUMERATION("Network.Cellular.PSim.ConnectionSuccess", - start_connect_result); + base::UmaHistogramEnumeration(kPSimAllConnectionResultHistogram, + start_connect_result); } else { - UMA_HISTOGRAM_ENUMERATION("Network.Cellular.ESim.ConnectionSuccess", - start_connect_result); + base::UmaHistogramEnumeration(kESimAllConnectionResultHistogram, + start_connect_result); // |esim_feature_usage_metrics_| may not have been created yet. if (!esim_feature_usage_metrics_.get()) return; - esim_feature_usage_metrics_ - ->RecordUsage(/*success=*/ - start_connect_result == - CellularMetricsLogger::ConnectResult::kSuccess); + // All initiated connects should be logged as feature usage. + esim_feature_usage_metrics_->RecordUsage( + start_connect_result == + CellularMetricsLogger::ShillConnectResult::kSuccess); } } @@ -411,19 +502,22 @@ connection_info->last_connect_start_time.reset(); } +void CellularMetricsLogger::ConnectSucceeded(const std::string& service_path) { + const NetworkState* network = GetCellularNetwork(service_path); + if (!network) + return; + + LogCellularUserInitiatedConnectionSuccessHistogram(ConnectResult::kSuccess, + GetSimType(network)); +} + void CellularMetricsLogger::ConnectFailed(const std::string& service_path, const std::string& error_name) { - const NetworkState* network = - network_state_handler_->GetNetworkState(service_path); - if (!network || network->type().empty() || - !network->Matches(NetworkTypePattern::Cellular())) { + const NetworkState* network = GetCellularNetwork(service_path); + if (!network) return; - } - // Check for connection failures at chrome layers, instead of connection - // failures triggered by shill which is tracked in - // CheckForShillConnectionFailureMetric(). - LogCellularConnectionSuccessHistogram( + LogCellularUserInitiatedConnectionSuccessHistogram( NetworkConnectionErrorToConnectResult(error_name), GetSimType(network)); } @@ -442,6 +536,16 @@ // correspond to a request received within |kDisconnectRequestTimeout| are // tracked. connection_info->last_disconnect_request_time = base::TimeTicks::Now(); + connection_info->disconnect_requested = true; +} + +const NetworkState* CellularMetricsLogger::GetCellularNetwork( + const std::string& service_path) { + const NetworkState* network = + network_state_handler_->GetNetworkState(service_path); + if (!network || !network->Matches(NetworkTypePattern::Cellular())) + return nullptr; + return network; } CellularMetricsLogger::PSimActivationState @@ -475,15 +579,18 @@ ConnectionInfo* connection_info = GetConnectionInfoForCellularNetwork(network->guid()); - // If the network connection state just failed. - if (!network->IsConnectingOrConnected() && connection_info->is_connecting) { - // Note: Currently all shill errors that result in a connection failure are - // mapped to CellularMetricsLogger::ConnectResult::kUnknown. - LogCellularConnectionSuccessHistogram( - CellularMetricsLogger::ConnectResult::kUnknown, GetSimType(network)); + // If the network connection failed to connect from a connecting state, and no + // disconnection was requested. Note that |network->connection_state()| being + // shill::kStateFailure or an empty |network-GetError()| is unreliable after + // repeated attempts to connect to a network that will fail. + if (!network->IsConnectingOrConnected() && connection_info->is_connecting && + !connection_info->disconnect_requested) { + LogCellularAllConnectionSuccessHistogram( + ShillErrorToConnectResult(network->GetError()), GetSimType(network)); } connection_info->is_connecting = network->IsConnectingState(); + connection_info->disconnect_requested = false; } void CellularMetricsLogger::CheckForConnectionStateMetric( @@ -498,8 +605,9 @@ connection_info->is_connected = new_is_connected; if (new_is_connected) { - LogCellularConnectionSuccessHistogram( - CellularMetricsLogger::ConnectResult::kSuccess, GetSimType(network)); + LogCellularAllConnectionSuccessHistogram( + CellularMetricsLogger::ShillConnectResult::kSuccess, + GetSimType(network)); LogCellularDisconnectionsHistogram(ConnectionState::kConnected, GetSimType(network)); connection_info->last_disconnect_request_time.reset();
diff --git a/chromeos/network/cellular_metrics_logger.h b/chromeos/network/cellular_metrics_logger.h index eacf758..b8602922 100644 --- a/chromeos/network/cellular_metrics_logger.h +++ b/chromeos/network/cellular_metrics_logger.h
@@ -56,6 +56,14 @@ static const char kSimPinUnblockSuccessHistogram[]; static const char kSimPinChangeSuccessHistogram[]; + // Histograms associated with user initiated connection success. + static const char kESimUserInitiatedConnectionResultHistogram[]; + static const char kPSimUserInitiatedConnectionResultHistogram[]; + + // Histograms associated with all connection success. + static const char kESimAllConnectionResultHistogram[]; + static const char kPSimAllConnectionResultHistogram[]; + // PIN operations that are tracked by metrics. enum class SimPinOperation { kLock = 0, @@ -90,6 +98,7 @@ void OnShuttingDown() override; // NetworkConnectionObserver:: + void ConnectSucceeded(const std::string& service_path) override; void ConnectFailed(const std::string& service_path, const std::string& error_name) override; void DisconnectRequested(const std::string& service_path) override; @@ -102,6 +111,10 @@ DuplicateCellularServiceGuids); FRIEND_TEST_ALL_PREFIXES(CellularMetricsLoggerTest, CellularConnectResult); FRIEND_TEST_ALL_PREFIXES(CellularMetricsLoggerTest, + CancellationDuringConnecting); + FRIEND_TEST_ALL_PREFIXES(CellularMetricsLoggerTest, + UserInitiatedConnectionResult); + FRIEND_TEST_ALL_PREFIXES(CellularMetricsLoggerTest, CellularESimProfileStatusAtLoginTest); FRIEND_TEST_ALL_PREFIXES(CellularMetricsLoggerTest, CellularServiceAtLoginTest); @@ -137,6 +150,11 @@ const std::string network_guid; base::Optional<bool> is_connected; bool is_connecting = false; + // Tracks whether a disconnect was requested from chrome on a network that + // was previously in the connecting state. This field is set back to false + // when shill connection failures are checked in + // NetworkConnectionStateChanged(). + bool disconnect_requested = false; base::Optional<base::TimeTicks> last_disconnect_request_time; base::Optional<base::TimeTicks> last_connect_start_time; }; @@ -202,37 +220,85 @@ kMaxValue = kErrorUnknown, }; - // Result of connecting to a cellular network. These values are persisted to - // logs. Entries should not be renumbered and numeric values should never be - // reused. + // This enum is used to track the connection results from + // NetworkConnectionHandler. With the exception of kSuccess and kUnknown, + // these enums are mapped to relevant NetworkConnectionHandler errors + // associated to user initiated connection errors. + // These values are persisted to logs. Entries should not be renumbered + // and numeric values should never be reused. enum class ConnectResult { - kUnknown = 0, - kInvalidGuid = 1, - kInvalidState = 2, - kCanceled = 3, - kNotConfigured = 4, - kBlocked = 5, - kSuccess = 6, - kMaxValue = kSuccess + kSuccess = 0, + kUnknown = 1, + kInvalidGuid = 2, + kInvalidState = 3, + kCanceled = 4, + kNotConfigured = 5, + kBlocked = 6, + kCellularInhibitFailure = 7, + kESimProfileIssue = 8, + kCellularOutOfCredits = 9, + kSimLocked = 10, + kConnectFailed = 11, + kNotConnected = 12, + kActivateFailed = 13, + kEnabledOrDisabledWhenNotAvailable = 14, + kMaxValue = kEnabledOrDisabledWhenNotAvailable, + }; + + // Result of state changes to a cellular network triggered by any connection + // attempt. With the exception of kSuccess and kUnknown, these enums are + // mapped directly to Shill errors. These values are persisted to logs. + // Entries should not be renumbered and numeric values should never be reused. + enum class ShillConnectResult { + kSuccess = 0, + kUnknown = 1, + kFailedToConnect = 2, + kDhcpFailure = 3, + kDnsLookupFailure = 4, + kEapAuthentication = 5, + kEapLocalTls = 6, + kEapRemoteTls = 7, + kOutOfRange = 8, + kPinMissing = 9, + kNoFailure = 10, + kNotAssociated = 11, + kNotAuthenticated = 12, + kTooManySTAs = 13, + kBadPassphrase = 14, + kBadWepKey = 15, + kMaxValue = kBadWepKey, }; // Convert shill error name string to SimPinOperationResult enum. static SimPinOperationResult GetSimPinOperationResultForShillError( const std::string& shill_error_name); + // Converts a NetworkConnectionHandler string error to a ConnectResult enum. + static ConnectResult NetworkConnectionErrorToConnectResult( + const std::string& error_name); + + // Converts a Shill error string to a ShillConnectResult enum. + static ShillConnectResult ShillErrorToConnectResult( + const std::string& error_name); + + static void LogCellularUserInitiatedConnectionSuccessHistogram( + ConnectResult start_connect_result, + SimType sim_type); + + // Returns null if there is no network with the given path or if the + // network is non-cellular. + const NetworkState* GetCellularNetwork(const std::string& service_path); + // Convert shill activation state string to PSimActivationState enum PSimActivationState PSimActivationStateToEnum(const std::string& state); - // Converts a NetworkConnectionHandler string error to a ConnectResult enum. - ConnectResult NetworkConnectionErrorToConnectResult( - const std::string& error_name); - // Helper method to save cellular disconnections histogram. void LogCellularDisconnectionsHistogram(ConnectionState connection_state, SimType sim_type); - void LogCellularConnectionSuccessHistogram(ConnectResult start_connect_result, - SimType sim_type); + void LogCellularAllConnectionSuccessHistogram( + ShillConnectResult start_connect_result, + SimType sim_type); void OnInitializationTimeout(); @@ -251,7 +317,7 @@ // if |is_esim_profile_status_logged_| is false. void CheckForESimProfileStatusMetric(); - // Tracks errors from shill that result in an unsuccessful connection. + // Tracks failed connection attempts. void CheckForShillConnectionFailureMetric(const NetworkState* network); // This checks the state of connected networks and logs
diff --git a/chromeos/network/cellular_metrics_logger_unittest.cc b/chromeos/network/cellular_metrics_logger_unittest.cc index 136daa9..490f74d 100644 --- a/chromeos/network/cellular_metrics_logger_unittest.cc +++ b/chromeos/network/cellular_metrics_logger_unittest.cc
@@ -64,11 +64,6 @@ const char kESimDisconnectionsHistogram[] = "Network.Cellular.ESim.Disconnections"; -const char kPSimConnectionSuccessHistogram[] = - "Network.Cellular.PSim.ConnectionSuccess"; -const char kESimConnectionSuccessHistogram[] = - "Network.Cellular.ESim.ConnectionSuccess"; - } // namespace class CellularMetricsLoggerTest : public testing::Test { @@ -242,8 +237,10 @@ // Only the PSim histogram is logged to because it was the first to be // connected to. - histogram_tester_->ExpectTotalCount(kPSimConnectionSuccessHistogram, 1); - histogram_tester_->ExpectTotalCount(kESimConnectionSuccessHistogram, 0); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kPSimAllConnectionResultHistogram, 1); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimAllConnectionResultHistogram, 0); } TEST_F(CellularMetricsLoggerTest, ActiveProfileExists) { @@ -569,9 +566,10 @@ service_client_test()->SetServiceProperty( kTestESimCellularServicePath, shill::kStateProperty, kAssocStateValue); base::RunLoop().RunUntilIdle(); - histogram_tester_->ExpectTotalCount(kESimConnectionSuccessHistogram, 0); - histogram_tester_->ExpectTotalCount(kPSimConnectionSuccessHistogram, 0); - histogram_tester_->ExpectTotalCount(kESimFeatureUsageMetric, 0); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimAllConnectionResultHistogram, 0); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kPSimAllConnectionResultHistogram, 0); // Set cellular networks to failed state. service_client_test()->SetServiceProperty(kTestPSimCellularServicePath, @@ -581,16 +579,18 @@ shill::kStateProperty, base::Value(shill::kStateFailure)); base::RunLoop().RunUntilIdle(); - histogram_tester_->ExpectTotalCount(kESimConnectionSuccessHistogram, 1); - histogram_tester_->ExpectTotalCount(kPSimConnectionSuccessHistogram, 1); - histogram_tester_->ExpectTotalCount(kESimFeatureUsageMetric, 1); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimAllConnectionResultHistogram, 1); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kPSimAllConnectionResultHistogram, 1); histogram_tester_->ExpectBucketCount( - kESimConnectionSuccessHistogram, - CellularMetricsLogger::ConnectResult::kUnknown, 1); + CellularMetricsLogger::kESimAllConnectionResultHistogram, + CellularMetricsLogger::ShillConnectResult::kUnknown, 1); histogram_tester_->ExpectBucketCount( - kPSimConnectionSuccessHistogram, - CellularMetricsLogger::ConnectResult::kUnknown, 1); + CellularMetricsLogger::kPSimAllConnectionResultHistogram, + CellularMetricsLogger::ShillConnectResult::kUnknown, 1); + histogram_tester_->ExpectBucketCount( kESimFeatureUsageMetric, static_cast<int>( @@ -612,56 +612,24 @@ shill::kStateProperty, base::Value(shill::kStateOnline)); base::RunLoop().RunUntilIdle(); - - histogram_tester_->ExpectTotalCount(kESimConnectionSuccessHistogram, 2); - histogram_tester_->ExpectTotalCount(kPSimConnectionSuccessHistogram, 2); - histogram_tester_->ExpectTotalCount(kESimFeatureUsageMetric, 2); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimAllConnectionResultHistogram, 2); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kPSimAllConnectionResultHistogram, 2); histogram_tester_->ExpectBucketCount( - kESimConnectionSuccessHistogram, - CellularMetricsLogger::ConnectResult::kSuccess, 1); + CellularMetricsLogger::kESimAllConnectionResultHistogram, + CellularMetricsLogger::ShillConnectResult::kSuccess, 1); histogram_tester_->ExpectBucketCount( - kPSimConnectionSuccessHistogram, - CellularMetricsLogger::ConnectResult::kSuccess, 1); + CellularMetricsLogger::kPSimAllConnectionResultHistogram, + CellularMetricsLogger::ShillConnectResult::kSuccess, 1); + histogram_tester_->ExpectBucketCount( kESimFeatureUsageMetric, static_cast<int>( feature_usage::FeatureUsageMetrics::Event::kUsedWithSuccess), 1); - // Simulate chrome connect failure - cellular_metrics_logger()->ConnectFailed( - kTestPSimCellularServicePath, - NetworkConnectionHandler::kErrorConnectCanceled); - cellular_metrics_logger()->ConnectFailed( - kTestESimCellularServicePath, - NetworkConnectionHandler::kErrorConnectCanceled); - - histogram_tester_->ExpectTotalCount(kESimConnectionSuccessHistogram, 3); - histogram_tester_->ExpectTotalCount(kPSimConnectionSuccessHistogram, 3); - histogram_tester_->ExpectTotalCount(kESimFeatureUsageMetric, 3); - - histogram_tester_->ExpectBucketCount( - kESimConnectionSuccessHistogram, - CellularMetricsLogger::ConnectResult::kCanceled, 1); - histogram_tester_->ExpectBucketCount( - kPSimConnectionSuccessHistogram, - CellularMetricsLogger::ConnectResult::kCanceled, 1); - histogram_tester_->ExpectBucketCount( - kESimFeatureUsageMetric, - static_cast<int>( - feature_usage::FeatureUsageMetrics::Event::kUsedWithFailure), - 2); - - // Set cellular networks to connected state. - service_client_test()->SetServiceProperty(kTestPSimCellularServicePath, - shill::kStateProperty, - base::Value(shill::kStateOnline)); - service_client_test()->SetServiceProperty(kTestESimCellularServicePath, - shill::kStateProperty, - base::Value(shill::kStateOnline)); - base::RunLoop().RunUntilIdle(); - // Set cellular networks to disconnected state. service_client_test()->SetServiceProperty(kTestPSimCellularServicePath, shill::kStateProperty, @@ -673,8 +641,136 @@ // A connected to disconnected state change should not impact connection // success. - histogram_tester_->ExpectTotalCount(kESimConnectionSuccessHistogram, 3); - histogram_tester_->ExpectTotalCount(kPSimConnectionSuccessHistogram, 3); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimAllConnectionResultHistogram, 2); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kPSimAllConnectionResultHistogram, 2); + + // Set cellular networks to connected state. + service_client_test()->SetServiceProperty(kTestPSimCellularServicePath, + shill::kStateProperty, + base::Value(shill::kStateOnline)); + service_client_test()->SetServiceProperty(kTestESimCellularServicePath, + shill::kStateProperty, + base::Value(shill::kStateOnline)); + base::RunLoop().RunUntilIdle(); + + // A disconnected to connected state, skipping the connecting state change + // should emit a success. + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimAllConnectionResultHistogram, 3); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kPSimAllConnectionResultHistogram, 3); + histogram_tester_->ExpectBucketCount( + CellularMetricsLogger::kESimAllConnectionResultHistogram, + CellularMetricsLogger::ShillConnectResult::kSuccess, 2); + histogram_tester_->ExpectBucketCount( + CellularMetricsLogger::kPSimAllConnectionResultHistogram, + CellularMetricsLogger::ShillConnectResult::kSuccess, 2); + + // User initiated connection histograms should be 0 the entire time because + // the previous connection state changes occured from Shill. + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimUserInitiatedConnectionResultHistogram, 0); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kPSimUserInitiatedConnectionResultHistogram, 0); +} + +TEST_F(CellularMetricsLoggerTest, CancellationDuringConnecting) { + SetUpMetricsLogger(); + InitCellular(); + ResetHistogramTester(); + base::RunLoop().RunUntilIdle(); + + // Set cellular networks to connecting state. + service_client_test()->SetServiceProperty( + kTestPSimCellularServicePath, shill::kStateProperty, + base::Value(shill::kStateAssociation)); + service_client_test()->SetServiceProperty( + kTestESimCellularServicePath, shill::kStateProperty, + base::Value(shill::kStateAssociation)); + base::RunLoop().RunUntilIdle(); + + // Simulate chrome disconnect request. + cellular_metrics_logger()->DisconnectRequested(kTestESimCellularServicePath); + cellular_metrics_logger()->DisconnectRequested(kTestPSimCellularServicePath); + + // Set cellular networks to failed state via shill. + service_client_test()->SetServiceProperty(kTestPSimCellularServicePath, + shill::kStateProperty, + base::Value(shill::kStateIdle)); + service_client_test()->SetServiceProperty(kTestESimCellularServicePath, + shill::kStateProperty, + base::Value(shill::kStateIdle)); + base::RunLoop().RunUntilIdle(); + + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimUserInitiatedConnectionResultHistogram, 0); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimUserInitiatedConnectionResultHistogram, 0); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimAllConnectionResultHistogram, 0); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kPSimAllConnectionResultHistogram, 0); + + // Set cellular networks to connecting state. + service_client_test()->SetServiceProperty( + kTestPSimCellularServicePath, shill::kStateProperty, + base::Value(shill::kStateAssociation)); + service_client_test()->SetServiceProperty( + kTestESimCellularServicePath, shill::kStateProperty, + base::Value(shill::kStateAssociation)); + base::RunLoop().RunUntilIdle(); + + // Set cellular networks to failed state via shill. + service_client_test()->SetServiceProperty(kTestPSimCellularServicePath, + shill::kStateProperty, + base::Value(shill::kStateIdle)); + service_client_test()->SetServiceProperty(kTestESimCellularServicePath, + shill::kStateProperty, + base::Value(shill::kStateIdle)); + base::RunLoop().RunUntilIdle(); + + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimUserInitiatedConnectionResultHistogram, 0); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimUserInitiatedConnectionResultHistogram, 0); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kESimAllConnectionResultHistogram, 1); + histogram_tester_->ExpectTotalCount( + CellularMetricsLogger::kPSimAllConnectionResultHistogram, 1); +} + +TEST_F(CellularMetricsLoggerTest, UserInitiatedConnectionResult) { + SetUpMetricsLogger(); + InitCellular(); + ResetHistogramTester(); + base::RunLoop().RunUntilIdle(); + + // Simulate chrome connect success + cellular_metrics_logger()->ConnectSucceeded(kTestPSimCellularServicePath); + cellular_metrics_logger()->ConnectSucceeded(kTestESimCellularServicePath); + histogram_tester_->ExpectBucketCount( + CellularMetricsLogger::kESimUserInitiatedConnectionResultHistogram, + CellularMetricsLogger::ConnectResult::kSuccess, 1); + histogram_tester_->ExpectBucketCount( + CellularMetricsLogger::kPSimUserInitiatedConnectionResultHistogram, + CellularMetricsLogger::ConnectResult::kSuccess, 1); + + // Simulate chrome connect failure + cellular_metrics_logger()->ConnectFailed( + kTestESimCellularServicePath, + NetworkConnectionHandler::kErrorConnectCanceled); + cellular_metrics_logger()->ConnectFailed( + kTestPSimCellularServicePath, + NetworkConnectionHandler::kErrorConnectCanceled); + + histogram_tester_->ExpectBucketCount( + CellularMetricsLogger::kESimUserInitiatedConnectionResultHistogram, + CellularMetricsLogger::ConnectResult::kCanceled, 1); + histogram_tester_->ExpectBucketCount( + CellularMetricsLogger::kPSimUserInitiatedConnectionResultHistogram, + CellularMetricsLogger::ConnectResult::kCanceled, 1); } TEST_F(CellularMetricsLoggerTest, CellularTimeToConnectedTest) {
diff --git a/chromeos/network/fast_transition_observer_unittest.cc b/chromeos/network/fast_transition_observer_unittest.cc index 10c293e0..046d852 100644 --- a/chromeos/network/fast_transition_observer_unittest.cc +++ b/chromeos/network/fast_transition_observer_unittest.cc
@@ -6,10 +6,9 @@ #include "ash/constants/ash_pref_names.h" #include "base/test/task_environment.h" -#include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/network/fast_transition_observer.h" -#include "chromeos/network/network_state_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h" @@ -21,9 +20,6 @@ class FastTransitionObserverTest : public ::testing::Test { public: FastTransitionObserverTest() { - shill_clients::InitializeFakes(); - network_state_handler_ = NetworkStateHandler::InitializeForTest(); - NetworkHandler::Initialize(); local_state_ = std::make_unique<TestingPrefServiceSimple>(); local_state_->registry()->RegisterBooleanPref( prefs::kDeviceWiFiFastTransitionEnabled, false); @@ -31,12 +27,8 @@ } ~FastTransitionObserverTest() override { - network_state_handler_->Shutdown(); observer_.reset(); local_state_.reset(); - network_state_handler_.reset(); - NetworkHandler::Shutdown(); - shill_clients::Shutdown(); } TestingPrefServiceSimple* local_state() { return local_state_.get(); } @@ -49,7 +41,7 @@ private: base::test::SingleThreadTaskEnvironment task_environment_; - std::unique_ptr<NetworkStateHandler> network_state_handler_; + NetworkHandlerTestHelper network_handler_test_helper_; std::unique_ptr<TestingPrefServiceSimple> local_state_; std::unique_ptr<FastTransitionObserver> observer_;
diff --git a/chromeos/network/managed_state.cc b/chromeos/network/managed_state.cc index 98bbd608..9bbd845 100644 --- a/chromeos/network/managed_state.cc +++ b/chromeos/network/managed_state.cc
@@ -95,12 +95,12 @@ bool ManagedState::GetBooleanValue(const std::string& key, const base::Value& value, bool* out_value) { - bool new_value; - if (!value.GetAsBoolean(&new_value)) { + if (!value.is_bool()) { NET_LOG(ERROR) << "Error parsing state value: " << NetworkPathId(path_) << "." << key; return false; } + bool new_value = value.GetBool(); if (*out_value == new_value) return false; *out_value = new_value;
diff --git a/chromeos/network/network_connect_unittest.cc b/chromeos/network/network_connect_unittest.cc index 46ef0a6..121ee756 100644 --- a/chromeos/network/network_connect_unittest.cc +++ b/chromeos/network/network_connect_unittest.cc
@@ -10,13 +10,13 @@ #include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/test/task_environment.h" -#include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/login/login_state/login_state.h" #include "chromeos/network/network_connect.h" #include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "testing/gmock/include/gmock/gmock.h" @@ -94,10 +94,8 @@ void SetUp() override { testing::Test::SetUp(); - shill_clients::InitializeFakes(); LoginState::Initialize(); SetupDefaultShillState(); - NetworkHandler::Initialize(); base::RunLoop().RunUntilIdle(); mock_delegate_ = std::make_unique<MockDelegate>(); @@ -114,8 +112,6 @@ NetworkConnect::Shutdown(); mock_delegate_.reset(); LoginState::Shutdown(); - NetworkHandler::Shutdown(); - shill_clients::Shutdown(); testing::Test::TearDown(); } @@ -193,6 +189,7 @@ std::unique_ptr<MockDelegate> mock_delegate_; std::unique_ptr<FakeTetherDelegate> fake_tether_delegate_; base::test::SingleThreadTaskEnvironment task_environment_; + NetworkHandlerTestHelper network_handler_test_helper_; ShillDeviceClient::TestInterface* device_test_; ShillServiceClient::TestInterface* service_test_;
diff --git a/chromeos/network/network_event_log_unittest.cc b/chromeos/network/network_event_log_unittest.cc index 7b2721f..08b47dce 100644 --- a/chromeos/network/network_event_log_unittest.cc +++ b/chromeos/network/network_event_log_unittest.cc
@@ -5,10 +5,10 @@ #include "chromeos/network/network_event_log.h" #include "base/test/task_environment.h" -#include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "testing/gtest/include/gtest/gtest.h" @@ -19,17 +19,10 @@ class NetworkEventLogTest : public testing::Test { public: void SetUp() override { - shill_clients::InitializeFakes(); SetupDefaultShillState(); - NetworkHandler::Initialize(); base::RunLoop().RunUntilIdle(); } - void TearDown() override { - NetworkHandler::Shutdown(); - shill_clients::Shutdown(); - } - const NetworkState* GetNetworkState(const std::string& service_path) { return NetworkHandler::Get()->network_state_handler()->GetNetworkState( service_path); @@ -108,6 +101,7 @@ } base::test::TaskEnvironment environment_; + NetworkHandlerTestHelper network_handler_test_helper_; }; // See FakeShillManagerClient for default fake networks.
diff --git a/chromeos/network/proxy/proxy_config_service_impl_unittest.cc b/chromeos/network/proxy/proxy_config_service_impl_unittest.cc index 396849f..b262854 100644 --- a/chromeos/network/proxy/proxy_config_service_impl_unittest.cc +++ b/chromeos/network/proxy/proxy_config_service_impl_unittest.cc
@@ -9,8 +9,7 @@ #include "base/test/task_environment.h" #include "base/threading/thread_task_runner_handle.h" #include "base/values.h" -#include "chromeos/dbus/shill/shill_clients.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "components/prefs/pref_service.h" #include "components/prefs/testing_pref_service.h" #include "components/proxy_config/pref_proxy_config_tracker_impl.h" @@ -48,18 +47,14 @@ class ProxyConfigServiceImplTest : public testing::Test { void SetUp() override { - shill_clients::InitializeFakes(); - chromeos::NetworkHandler::Initialize(); + network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>(); + // Wait for network initialization events to propagate. base::RunLoop().RunUntilIdle(); } - void TearDown() override { - chromeos::NetworkHandler::Shutdown(); - shill_clients::Shutdown(); - } - protected: base::test::TaskEnvironment environment_; + std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_; }; // By default, ProxyConfigServiceImpl should ignore the state of the nested
diff --git a/chromeos/network/proxy/ui_proxy_config_service_unittest.cc b/chromeos/network/proxy/ui_proxy_config_service_unittest.cc index fb8fff8..9c2b0a2 100644 --- a/chromeos/network/proxy/ui_proxy_config_service_unittest.cc +++ b/chromeos/network/proxy/ui_proxy_config_service_unittest.cc
@@ -13,9 +13,9 @@ #include "base/strings/string_util.h" #include "base/test/task_environment.h" #include "base/values.h" -#include "chromeos/dbus/shill/shill_clients.h" #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/onc/onc_utils.h" #include "components/onc/onc_pref_names.h" #include "components/prefs/testing_pref_service.h" @@ -106,18 +106,11 @@ } void SetUp() override { - shill_clients::InitializeFakes(); - NetworkHandler::Initialize(); ConfigureService(kTestUserWifiConfig); ConfigureService(kTestSharedWifiConfig); ConfigureService(kTestUnconfiguredWifiConfig); } - void TearDown() override { - NetworkHandler::Shutdown(); - shill_clients::Shutdown(); - } - ~UIProxyConfigServiceTest() override = default; void ConfigureService(const std::string& shill_json_string) { @@ -149,6 +142,7 @@ private: base::test::TaskEnvironment task_environment_; + NetworkHandlerTestHelper network_handler_test_helper_; }; TEST_F(UIProxyConfigServiceTest, UnknownNetwork) {
diff --git a/chromeos/network/test_cellular_esim_profile_handler.cc b/chromeos/network/test_cellular_esim_profile_handler.cc index e071bff..fc5360b8 100644 --- a/chromeos/network/test_cellular_esim_profile_handler.cc +++ b/chromeos/network/test_cellular_esim_profile_handler.cc
@@ -13,11 +13,27 @@ TestCellularESimProfileHandler::~TestCellularESimProfileHandler() = default; +void TestCellularESimProfileHandler::SetHasRefreshedProfilesForEuicc( + const std::string& eid, + bool has_refreshed) { + if (has_refreshed) { + refreshed_eids_.insert(eid); + return; + } + + refreshed_eids_.erase(eid); +} + std::vector<CellularESimProfile> TestCellularESimProfileHandler::GetESimProfiles() { return esim_profile_states_; } +bool TestCellularESimProfileHandler::HasRefreshedProfilesForEuicc( + const std::string& eid) { + return base::Contains(refreshed_eids_, eid); +} + void TestCellularESimProfileHandler::SetDevicePrefs(PrefService* device_prefs) { }
diff --git a/chromeos/network/test_cellular_esim_profile_handler.h b/chromeos/network/test_cellular_esim_profile_handler.h index a0759817..5af6b84 100644 --- a/chromeos/network/test_cellular_esim_profile_handler.h +++ b/chromeos/network/test_cellular_esim_profile_handler.h
@@ -5,6 +5,9 @@ #ifndef CHROMEOS_NETWORK_TEST_CELLULAR_ESIM_PROFILE_HANDLER_H_ #define CHROMEOS_NETWORK_TEST_CELLULAR_ESIM_PROFILE_HANDLER_H_ +#include <string> + +#include "base/containers/flat_set.h" #include "chromeos/network/cellular_esim_profile_handler.h" namespace chromeos { @@ -16,13 +19,18 @@ TestCellularESimProfileHandler(); ~TestCellularESimProfileHandler() override; + void SetHasRefreshedProfilesForEuicc(const std::string& eid, + bool has_refreshed); + // CellularESimProfileHandler: std::vector<CellularESimProfile> GetESimProfiles() override; + bool HasRefreshedProfilesForEuicc(const std::string& eid) override; void SetDevicePrefs(PrefService* device_prefs) override; void OnHermesPropertiesUpdated() override; private: std::vector<CellularESimProfile> esim_profile_states_; + base::flat_set<std::string> refreshed_eids_; }; } // namespace chromeos
diff --git a/chromeos/services/cellular_setup/cellular_setup_impl_unittest.cc b/chromeos/services/cellular_setup/cellular_setup_impl_unittest.cc index 49aa6bf..d02e379 100644 --- a/chromeos/services/cellular_setup/cellular_setup_impl_unittest.cc +++ b/chromeos/services/cellular_setup/cellular_setup_impl_unittest.cc
@@ -11,8 +11,7 @@ #include "base/macros.h" #include "base/run_loop.h" #include "base/test/task_environment.h" -#include "chromeos/dbus/shill/shill_clients.h" -#include "chromeos/network/network_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/services/cellular_setup/cellular_setup_base.h" #include "chromeos/services/cellular_setup/cellular_setup_impl.h" #include "chromeos/services/cellular_setup/fake_ota_activator.h" @@ -74,13 +73,9 @@ void SetUp() override { OtaActivatorImpl::Factory::SetFactoryForTesting( &fake_ota_activator_factory_); - shill_clients::InitializeFakes(); - NetworkHandler::Initialize(); } void TearDown() override { - NetworkHandler::Shutdown(); - shill_clients::Shutdown(); OtaActivatorImpl::Factory::SetFactoryForTesting(nullptr); } @@ -113,6 +108,7 @@ } base::test::TaskEnvironment task_environment_; + NetworkHandlerTestHelper network_handler_test_helper_; FakeOtaActivatorFactory fake_ota_activator_factory_; CellularSetupImpl cellular_setup_;
diff --git a/chromeos/services/device_sync/device_sync_service_unittest.cc b/chromeos/services/device_sync/device_sync_service_unittest.cc index 6b0b73e3..512f4bb 100644 --- a/chromeos/services/device_sync/device_sync_service_unittest.cc +++ b/chromeos/services/device_sync/device_sync_service_unittest.cc
@@ -24,6 +24,7 @@ #include "chromeos/components/multidevice/remote_device_test_util.h" #include "chromeos/components/multidevice/secure_message_delegate.h" #include "chromeos/dbus/dbus_thread_manager.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/services/device_sync/cryptauth_device_manager_impl.h" #include "chromeos/services/device_sync/cryptauth_device_registry_impl.h" #include "chromeos/services/device_sync/cryptauth_enroller.h" @@ -744,7 +745,7 @@ scoped_feature_list_.InitWithFeatures(enabled_features, disabled_features); DBusThreadManager::Initialize(); - NetworkHandler::Initialize(); + network_handler_test_helper_ = std::make_unique<NetworkHandlerTestHelper>(); base::RunLoop().RunUntilIdle(); fake_gcm_driver_ = std::make_unique<gcm::FakeGCMDriver>(); @@ -874,7 +875,7 @@ SoftwareFeatureManagerImpl::Factory::SetFactoryForTesting(nullptr); DeviceSyncImpl::Factory::SetCustomFactory(nullptr); - NetworkHandler::Shutdown(); + network_handler_test_helper_.reset(); DBusThreadManager::Shutdown(); } @@ -1577,6 +1578,7 @@ const std::vector<cryptauth::ExternalDeviceInfo> test_device_infos_; const std::vector<cryptauth::IneligibleDevice> test_ineligible_devices_; + std::unique_ptr<NetworkHandlerTestHelper> network_handler_test_helper_; std::unique_ptr<TestingPrefServiceSimple> test_pref_service_; base::MockOneShotTimer* mock_timer_; std::unique_ptr<base::SimpleTestClock> simple_test_clock_;
diff --git a/chromeos/services/ime/decoder/proto_conversion.cc b/chromeos/services/ime/decoder/proto_conversion.cc index e4329370..a31a6e0c 100644 --- a/chromeos/services/ime/decoder/proto_conversion.cc +++ b/chromeos/services/ime/decoder/proto_conversion.cc
@@ -224,11 +224,9 @@ mojo_suggestions_request->mode = ProtoToTextSuggestionMode(suggestions_request.suggestion_mode()); for (const auto& candidate : suggestions_request.completion_candidates()) { - auto mojo_candidate = mojom::CompletionCandidate::New(); - mojo_candidate->text = candidate.text(); - mojo_candidate->normalized_score = candidate.normalized_score(); mojo_suggestions_request->completion_candidates.push_back( - std::move(mojo_candidate)); + TextCompletionCandidate{.text = candidate.text(), + .score = candidate.normalized_score()}); } return mojo_suggestions_request; }
diff --git a/chromeos/services/ime/decoder/proto_conversion_unittest.cc b/chromeos/services/ime/decoder/proto_conversion_unittest.cc index 17506d86..81c23df 100644 --- a/chromeos/services/ime/decoder/proto_conversion_unittest.cc +++ b/chromeos/services/ime/decoder/proto_conversion_unittest.cc
@@ -168,8 +168,8 @@ EXPECT_EQ(result->text, "gday mate"); EXPECT_EQ(result->mode, ime::TextSuggestionMode::kPrediction); EXPECT_EQ(static_cast<int>(result->completion_candidates.size()), 1); - EXPECT_EQ(result->completion_candidates[0]->text, "something"); - EXPECT_FLOAT_EQ(result->completion_candidates[0]->normalized_score, 0.55); + EXPECT_EQ(result->completion_candidates[0].text, "something"); + EXPECT_FLOAT_EQ(result->completion_candidates[0].score, 0.55); } } // namespace ime
diff --git a/chromeos/services/ime/decoder/system_engine_unittest.cc b/chromeos/services/ime/decoder/system_engine_unittest.cc index dc549e1..e49d918 100644 --- a/chromeos/services/ime/decoder/system_engine_unittest.cc +++ b/chromeos/services/ime/decoder/system_engine_unittest.cc
@@ -361,8 +361,8 @@ EXPECT_EQ(request->mode, TextSuggestionMode::kPrediction); EXPECT_EQ(request->text, "hello there!"); EXPECT_EQ(static_cast<int>(request->completion_candidates.size()), 1); - EXPECT_EQ(request->completion_candidates[0]->text, "hello"); - EXPECT_FLOAT_EQ(request->completion_candidates[0]->normalized_score, 0.55); + EXPECT_EQ(request->completion_candidates[0].text, "hello"); + EXPECT_FLOAT_EQ(request->completion_candidates[0].score, 0.55); } TEST_F(SystemEngineTest, SuggestionsRequestReturnsResponseToSharedLib) {
diff --git a/chromeos/services/ime/public/cpp/suggestions.h b/chromeos/services/ime/public/cpp/suggestions.h index b6bec44..aa76acee 100644 --- a/chromeos/services/ime/public/cpp/suggestions.h +++ b/chromeos/services/ime/public/cpp/suggestions.h
@@ -37,6 +37,14 @@ } }; +struct TextCompletionCandidate { + // Text to complete the current word + std::string text; + + // The confidence scoring for the candidate + float score; +}; + } // namespace ime } // namespace chromeos
diff --git a/chromeos/services/ime/public/mojom/BUILD.gn b/chromeos/services/ime/public/mojom/BUILD.gn index 8ab4442..cd96507 100644 --- a/chromeos/services/ime/public/mojom/BUILD.gn +++ b/chromeos/services/ime/public/mojom/BUILD.gn
@@ -17,6 +17,10 @@ { types = [ { + mojom = "chromeos.ime.mojom.CompletionCandidate" + cpp = "::chromeos::ime::TextCompletionCandidate" + }, + { mojom = "chromeos.ime.mojom.SuggestionMode" cpp = "::chromeos::ime::TextSuggestionMode" },
diff --git a/chromeos/services/ime/public/mojom/mojom_traits.cc b/chromeos/services/ime/public/mojom/mojom_traits.cc index 683297b..5197900 100644 --- a/chromeos/services/ime/public/mojom/mojom_traits.cc +++ b/chromeos/services/ime/public/mojom/mojom_traits.cc
@@ -9,10 +9,13 @@ namespace mojo { namespace { +using CompletionCandidateDataView = + chromeos::ime::mojom::CompletionCandidateDataView; using SuggestionMode = chromeos::ime::mojom::SuggestionMode; using SuggestionType = chromeos::ime::mojom::SuggestionType; using SuggestionCandidateDataView = chromeos::ime::mojom::SuggestionCandidateDataView; +using TextCompletionCandidate = chromeos::ime::TextCompletionCandidate; using TextSuggestionMode = chromeos::ime::TextSuggestionMode; using TextSuggestionType = chromeos::ime::TextSuggestionType; using TextSuggestion = chromeos::ime::TextSuggestion; @@ -86,4 +89,13 @@ return true; } +bool StructTraits<CompletionCandidateDataView, TextCompletionCandidate>::Read( + CompletionCandidateDataView input, + TextCompletionCandidate* output) { + if (!input.ReadText(&output->text)) + return false; + output->score = input.normalized_score(); + return true; +} + } // namespace mojo
diff --git a/chromeos/services/ime/public/mojom/mojom_traits.h b/chromeos/services/ime/public/mojom/mojom_traits.h index d39ecbbe..c04740e 100644 --- a/chromeos/services/ime/public/mojom/mojom_traits.h +++ b/chromeos/services/ime/public/mojom/mojom_traits.h
@@ -54,6 +54,26 @@ static bool Read(SuggestionCandidateDataView input, TextSuggestion* output); }; +template <> +struct StructTraits<chromeos::ime::mojom::CompletionCandidateDataView, + chromeos::ime::TextCompletionCandidate> { + using CompletionCandidateDataView = + ::chromeos::ime::mojom::CompletionCandidateDataView; + using TextCompletionCandidate = ::chromeos::ime::TextCompletionCandidate; + + static const std::string& text(const TextCompletionCandidate& candidate) { + return candidate.text; + } + + static const float& normalized_score( + const TextCompletionCandidate& candidate) { + return candidate.score; + } + + static bool Read(CompletionCandidateDataView input, + TextCompletionCandidate* output); +}; + } // namespace mojo #endif // CHROMEOS_SERVICES_IME_PUBLIC_MOJOM_MOJOM_TRAITS_H_
diff --git a/chromeos/services/libassistant/chromium_api_delegate.h b/chromeos/services/libassistant/chromium_api_delegate.h index bb70ee3d..2990b59 100644 --- a/chromeos/services/libassistant/chromium_api_delegate.h +++ b/chromeos/services/libassistant/chromium_api_delegate.h
@@ -23,7 +23,7 @@ class ChromiumHttpConnectionFactory; -class ChromiumApiDelegate : public assistant_client::FuchsiaApiDelegate { +class ChromiumApiDelegate : public assistant_client::ChromeOSApiDelegate { public: explicit ChromiumApiDelegate( std::unique_ptr<network::PendingSharedURLLoaderFactory>
diff --git a/chromeos/services/libassistant/service_controller.cc b/chromeos/services/libassistant/service_controller.cc index 1ca11ba..e452385 100644 --- a/chromeos/services/libassistant/service_controller.cc +++ b/chromeos/services/libassistant/service_controller.cc
@@ -327,7 +327,7 @@ assistant_manager_internal() ->GetFuchsiaApiHelperOrDie() - ->SetFuchsiaApiDelegate(chromium_api_delegate_.get()); + ->SetChromeOSApiDelegate(chromium_api_delegate_.get()); } void ServiceController::CreateChromiumApiDelegate(
diff --git a/chromeos/services/network_config/BUILD.gn b/chromeos/services/network_config/BUILD.gn index cbff7ebd..ef4ea78 100644 --- a/chromeos/services/network_config/BUILD.gn +++ b/chromeos/services/network_config/BUILD.gn
@@ -56,6 +56,7 @@ deps = [ ":network_config", + "//ash/constants:constants", "//base", "//base/test:test_support", "//chromeos/dbus/shill:test_support",
diff --git a/chromeos/services/network_config/cros_network_config_unittest.cc b/chromeos/services/network_config/cros_network_config_unittest.cc index fdefd0a..5caac9e 100644 --- a/chromeos/services/network_config/cros_network_config_unittest.cc +++ b/chromeos/services/network_config/cros_network_config_unittest.cc
@@ -4,6 +4,7 @@ #include "chromeos/services/network_config/cros_network_config.h" +#include "ash/constants/ash_features.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/json/json_reader.h" @@ -11,20 +12,24 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "base/test/bind.h" +#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "chromeos/dbus/shill/fake_shill_device_client.h" #include "chromeos/login/login_state/login_state.h" +#include "chromeos/network/cellular_esim_profile_handler_impl.h" #include "chromeos/network/cellular_inhibitor.h" +#include "chromeos/network/cellular_metrics_logger.h" +#include "chromeos/network/fake_stub_cellular_networks_provider.h" #include "chromeos/network/managed_network_configuration_handler.h" #include "chromeos/network/network_cert_loader.h" #include "chromeos/network/network_certificate_handler.h" #include "chromeos/network/network_configuration_handler.h" #include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_device_handler.h" +#include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_metadata_store.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h" -#include "chromeos/network/network_state_test_helper.h" #include "chromeos/network/network_type_pattern.h" #include "chromeos/network/onc/onc_utils.h" #include "chromeos/network/prohibited_technologies_handler.h" @@ -51,7 +56,6 @@ const int kSimRetriesLeft = 3; const char kCellularDevicePath[] = "/device/stub_cellular_device"; const char kCellularTestIccid[] = "1234567890"; -const char kCellularTestEid[] = "1234567890"; const char kCellularTestApn1[] = "TEST.APN1"; const char kCellularTestApnName1[] = "Test Apn 1"; @@ -76,18 +80,14 @@ class CrosNetworkConfigTest : public testing::Test { public: CrosNetworkConfigTest() { + feature_list.InitAndEnableFeature( + ash::features::kUpdatedCellularActivationUi); LoginState::Initialize(); SystemTokenCertDbStorage::Initialize(); NetworkCertLoader::Initialize(); - NetworkHandler::Initialize(); - network_profile_handler_ = NetworkProfileHandler::InitializeForTesting(); - network_device_handler_ = NetworkDeviceHandler::InitializeForTesting( - helper_.network_state_handler()); - network_configuration_handler_ = - base::WrapUnique<NetworkConfigurationHandler>( - NetworkConfigurationHandler::InitializeForTest( - helper_.network_state_handler(), - network_device_handler_.get())); + helper_ = std::make_unique<NetworkHandlerTestHelper>(); + helper_->AddDefaultProfiles(); + helper_->ResetDevicesAndServices(); PrefProxyConfigTrackerImpl::RegisterProfilePrefs(user_prefs_.registry()); PrefProxyConfigTrackerImpl::RegisterPrefs(local_state_.registry()); @@ -95,59 +95,37 @@ ::onc::RegisterPrefs(local_state_.registry()); NetworkMetadataStore::RegisterPrefs(user_prefs_.registry()); NetworkMetadataStore::RegisterPrefs(local_state_.registry()); + CellularMetricsLogger::RegisterLocalStatePrefs(local_state_.registry()); + CellularESimProfileHandlerImpl::RegisterLocalStatePrefs( + local_state_.registry()); NetworkHandler::Get()->InitializePrefServices(&user_prefs_, &local_state_); - ui_proxy_config_service_ = std::make_unique<chromeos::UIProxyConfigService>( - &user_prefs_, &local_state_, helper_.network_state_handler(), - network_profile_handler_.get()); - - managed_network_configuration_handler_ = - ManagedNetworkConfigurationHandler::InitializeForTesting( - helper_.network_state_handler(), network_profile_handler_.get(), - network_device_handler_.get(), network_configuration_handler_.get(), - ui_proxy_config_service_.get()); - cellular_inhibitor_ = std::make_unique<CellularInhibitor>(); - cellular_inhibitor_->Init(helper_.network_state_handler(), - network_device_handler_.get()); - cellular_esim_profile_handler_ = - std::make_unique<TestCellularESimProfileHandler>(); - cellular_esim_profile_handler_->Init(helper_.network_state_handler(), - cellular_inhibitor_.get()); - network_connection_handler_ = - NetworkConnectionHandler::InitializeForTesting( - helper_.network_state_handler(), - network_configuration_handler_.get(), - managed_network_configuration_handler_.get(), - /*cellular_esim_connection_handler=*/nullptr); - network_certificate_handler_ = - std::make_unique<NetworkCertificateHandler>(); + NetworkHandler* network_handler = NetworkHandler::Get(); cros_network_config_ = std::make_unique<CrosNetworkConfig>( - helper_.network_state_handler(), network_device_handler_.get(), - cellular_inhibitor_.get(), cellular_esim_profile_handler_.get(), - managed_network_configuration_handler_.get(), - network_connection_handler_.get(), network_certificate_handler_.get(), - network_profile_handler_.get()); + network_handler->network_state_handler(), + network_handler->network_device_handler(), + network_handler->cellular_inhibitor(), + network_handler->cellular_esim_profile_handler(), + network_handler->managed_network_configuration_handler(), + network_handler->network_connection_handler(), + network_handler->network_certificate_handler(), + network_handler->network_profile_handler()); SetupPolicy(); SetupNetworks(); } ~CrosNetworkConfigTest() override { cros_network_config_.reset(); - network_certificate_handler_.reset(); - network_connection_handler_.reset(); - managed_network_configuration_handler_.reset(); - network_configuration_handler_.reset(); - network_device_handler_.reset(); - network_profile_handler_.reset(); - ui_proxy_config_service_.reset(); - NetworkHandler::Shutdown(); + helper_.reset(); NetworkCertLoader::Shutdown(); SystemTokenCertDbStorage::Shutdown(); LoginState::Shutdown(); } void SetupPolicy() { - managed_network_configuration_handler_->SetPolicy( + ManagedNetworkConfigurationHandler* managed_network_configuration_handler = + NetworkHandler::Get()->managed_network_configuration_handler(); + managed_network_configuration_handler->SetPolicy( ::onc::ONC_SOURCE_DEVICE_POLICY, /*userhash=*/std::string(), /*network_configs_onc=*/base::ListValue(), @@ -164,8 +142,8 @@ .c_str())); base::ListValue user_policy_onc; user_policy_onc.Append(std::move(wifi2_onc)); - managed_network_configuration_handler_->SetPolicy( - ::onc::ONC_SOURCE_USER_POLICY, helper().UserHash(), user_policy_onc, + managed_network_configuration_handler->SetPolicy( + ::onc::ONC_SOURCE_USER_POLICY, helper()->UserHash(), user_policy_onc, /*global_network_config=*/base::DictionaryValue()); base::RunLoop().RunUntilIdle(); } @@ -184,26 +162,26 @@ void SetupNetworks() { // Wifi device exists by default, add Ethernet and Cellular. - helper().device_test()->AddDevice("/device/stub_eth_device", - shill::kTypeEthernet, "stub_eth_device"); - helper().manager_test()->AddTechnology(shill::kTypeCellular, - true /* enabled */); - helper().device_test()->AddDevice(kCellularDevicePath, shill::kTypeCellular, - "stub_cellular_device"); + helper()->device_test()->AddDevice("/device/stub_eth_device", + shill::kTypeEthernet, "stub_eth_device"); + helper()->manager_test()->AddTechnology(shill::kTypeCellular, + true /* enabled */); + helper()->device_test()->AddDevice( + kCellularDevicePath, shill::kTypeCellular, "stub_cellular_device"); base::Value sim_value(base::Value::Type::DICTIONARY); sim_value.SetKey(shill::kSIMLockEnabledProperty, base::Value(true)); sim_value.SetKey(shill::kSIMLockTypeProperty, base::Value(shill::kSIMLockPin)); sim_value.SetKey(shill::kSIMLockRetriesLeftProperty, base::Value(kSimRetriesLeft)); - helper().device_test()->SetDeviceProperty( + helper()->device_test()->SetDeviceProperty( kCellularDevicePath, shill::kSIMLockStatusProperty, sim_value, /*notify_changed=*/false); - helper().device_test()->SetDeviceProperty(kCellularDevicePath, - shill::kIccidProperty, - base::Value(kCellularTestIccid), - /*notify_changed=*/false); - helper().device_test()->SetDeviceProperty( + helper()->device_test()->SetDeviceProperty(kCellularDevicePath, + shill::kIccidProperty, + base::Value(kCellularTestIccid), + /*notify_changed=*/false); + helper()->device_test()->SetDeviceProperty( kCellularDevicePath, shill::kSIMPresentProperty, base::Value(true), /*notify_changed=*/false); @@ -212,41 +190,41 @@ AddSimSlotInfoToList(ordered_sim_slot_info_list, /*eid=*/"", kCellularTestIccid, /*primary=*/true); - helper().device_test()->SetDeviceProperty( + helper()->device_test()->SetDeviceProperty( kCellularDevicePath, shill::kSIMSlotInfoProperty, base::Value(ordered_sim_slot_info_list), /*notify_changed=*/false); // Note: These are Shill dictionaries, not ONC. - helper().ConfigureService( + helper()->ConfigureService( R"({"GUID": "eth_guid", "Type": "ethernet", "State": "online"})"); - wifi1_path_ = helper().ConfigureService( + wifi1_path_ = helper()->ConfigureService( R"({"GUID": "wifi1_guid", "Type": "wifi", "State": "ready", "Strength": 50, "AutoConnect": true, "WiFi.HiddenSSID": false})"); - helper().ConfigureService( + helper()->ConfigureService( R"({"GUID": "wifi2_guid", "Type": "wifi", "SSID": "wifi2", "State": "idle", "SecurityClass": "psk", "Strength": 100, "Profile": "user_profile_path", "WiFi.HiddenSSID": true})"); - helper().ConfigureService(base::StringPrintf( + helper()->ConfigureService(base::StringPrintf( R"({"GUID": "cellular_guid", "Type": "cellular", "State": "idle", "Strength": 0, "Cellular.NetworkTechnology": "LTE", "Cellular.ActivationState": "activated", "Cellular.ICCID": "%s", - "Cellular.EID": "%s", "Profile": "%s"})", - kCellularTestIccid, kCellularTestEid, + "Profile": "%s"})", + kCellularTestIccid, NetworkProfileHandler::GetSharedProfilePath().c_str())); - vpn_path_ = helper().ConfigureService( + vpn_path_ = helper()->ConfigureService( R"({"GUID": "vpn_guid", "Type": "vpn", "State": "association", "Provider": {"Type": "l2tpipsec"}})"); // Add a non visible configured wifi service. - std::string wifi3_path = helper().ConfigureService( + std::string wifi3_path = helper()->ConfigureService( R"({"GUID": "wifi3_guid", "Type": "wifi", "SecurityClass": "psk", "Visible": false})"); - helper().profile_test()->AddService( + helper()->profile_test()->AddService( NetworkProfileHandler::GetSharedProfilePath(), wifi3_path); // Syncable wifi network: - std::string service_path = helper().ConfigureService( + std::string service_path = helper()->ConfigureService( R"({"GUID": "wifi4_guid", "Type": "wifi", "SSID": "wifi4", "State": "idle", "SecurityClass": "psk", "Strength": 100, "Profile": "user_profile_path", "Connectable": true})"); @@ -276,21 +254,42 @@ apn_entry2.SetStringKey(shill::kApnAttachProperty, kCellularTestApnAttach2); apn_list.Append(std::move(apn_entry2)); - helper().device_test()->SetDeviceProperty( + helper()->device_test()->SetDeviceProperty( kCellularDevicePath, shill::kCellularApnListProperty, apn_list, /*notify_changed=*/true); base::RunLoop().RunUntilIdle(); } void SetupEthernetEAP() { - std::string eap_path = helper().ConfigureService( + std::string eap_path = helper()->ConfigureService( R"({"GUID": "eth_eap_guid", "Type": "etherneteap", "State": "online", "EAP.EAP": "TTLS", "EAP.Identity": "user1"})"); - helper().profile_test()->AddService( + helper()->profile_test()->AddService( NetworkProfileHandler::GetSharedProfilePath(), eap_path); base::RunLoop().RunUntilIdle(); } + void SetupTestESimProfile(const std::string& eid, + const std::string& iccid, + const std::string& service_path, + const std::string& profile_name) { + const char kTestEuiccPath[] = "euicc_path"; + const char kTestESimProfilePath[] = "profile_path"; + + helper()->hermes_manager_test()->AddEuicc(dbus::ObjectPath(kTestEuiccPath), + eid, /*is_active=*/true, + /*physical_slot=*/0); + helper()->hermes_euicc_test()->AddCarrierProfile( + dbus::ObjectPath(kTestESimProfilePath), + dbus::ObjectPath(kTestEuiccPath), iccid, profile_name, + "service_provider", "activation_code", service_path, + hermes::profile::State::kInactive, + hermes::profile::ProfileClass::kOperational, + HermesEuiccClient::TestInterface::AddCarrierProfileBehavior:: + kAddProfileWithService); + base::RunLoop().RunUntilIdle(); + } + void SetupObserver() { observer_ = std::make_unique<CrosNetworkConfigTestObserver>(); cros_network_config_->AddObserver(observer_->GenerateRemote()); @@ -571,7 +570,7 @@ base::RunLoop run_loop; std::unique_ptr<CellularInhibitor::InhibitLock> inhibit_lock; - cellular_inhibitor_->InhibitCellularScanning( + NetworkHandler::Get()->cellular_inhibitor()->InhibitCellularScanning( inhibit_reason, base::BindLambdaForTesting( [&](std::unique_ptr<CellularInhibitor::InhibitLock> result) { @@ -583,16 +582,16 @@ return inhibit_lock; } - NetworkStateTestHelper& helper() { return helper_; } + NetworkHandlerTestHelper* helper() { return helper_.get(); } CrosNetworkConfigTestObserver* observer() { return observer_.get(); } CrosNetworkConfig* cros_network_config() { return cros_network_config_.get(); } ManagedNetworkConfigurationHandler* managed_network_configuration_handler() { - return managed_network_configuration_handler_.get(); + return NetworkHandler::Get()->managed_network_configuration_handler(); } NetworkCertificateHandler* network_certificate_handler() { - return network_certificate_handler_.get(); + return NetworkHandler::Get()->network_certificate_handler(); } std::string wifi1_path() { return wifi1_path_; } std::string vpn_path() { return vpn_path_; } @@ -602,18 +601,8 @@ private: base::test::SingleThreadTaskEnvironment task_environment_; - NetworkStateTestHelper helper_{false /* use_default_devices_and_services */}; - std::unique_ptr<NetworkCertificateHandler> network_certificate_handler_; - std::unique_ptr<NetworkProfileHandler> network_profile_handler_; - std::unique_ptr<NetworkDeviceHandler> network_device_handler_; - std::unique_ptr<NetworkConfigurationHandler> network_configuration_handler_; - std::unique_ptr<ManagedNetworkConfigurationHandler> - managed_network_configuration_handler_; - std::unique_ptr<CellularInhibitor> cellular_inhibitor_; - std::unique_ptr<TestCellularESimProfileHandler> - cellular_esim_profile_handler_; - std::unique_ptr<NetworkConnectionHandler> network_connection_handler_; - std::unique_ptr<chromeos::UIProxyConfigService> ui_proxy_config_service_; + base::test::ScopedFeatureList feature_list; + std::unique_ptr<NetworkHandlerTestHelper> helper_; TestingPrefServiceSimple local_state_; std::unique_ptr<CrosNetworkConfig> cros_network_config_; std::unique_ptr<CrosNetworkConfigTestObserver> observer_; @@ -685,7 +674,6 @@ EXPECT_EQ("LTE", cellular->network_technology); EXPECT_EQ(mojom::ActivationStateType::kActivated, cellular->activation_state); EXPECT_EQ(kCellularTestIccid, cellular->iccid); - EXPECT_EQ(kCellularTestEid, cellular->eid); EXPECT_EQ(mojom::OncSource::kDevice, network->source); EXPECT_TRUE(cellular->sim_locked); @@ -767,10 +755,10 @@ const int32_t esim_2_physical_slot = 3; // Add eSIM 1 and 2 info to Hermes. - helper().hermes_manager_test()->AddEuicc( + helper()->hermes_manager_test()->AddEuicc( dbus::ObjectPath(kTestEuiccPath1), kTestEid1, /*is_active=*/false, /*esim_1_physical_slot=*/esim_1_physical_slot); - helper().hermes_manager_test()->AddEuicc( + helper()->hermes_manager_test()->AddEuicc( dbus::ObjectPath(kTestEuiccPath2), kTestEid2, /*is_active=*/true, /*esim_1_physical_slot=*/esim_2_physical_slot); @@ -787,7 +775,7 @@ // exclude the EID and ICCID; it's expected that Hermes will still fill in // the missing EID. AddSimSlotInfoToList(ordered_sim_slot_info_list, /*eid=*/"", /*iccid=*/""); - helper().device_test()->SetDeviceProperty( + helper()->device_test()->SetDeviceProperty( kCellularDevicePath, shill::kSIMSlotInfoProperty, base::Value(ordered_sim_slot_info_list), /*notify_changed=*/true); @@ -825,10 +813,10 @@ const char kTestNameFromShill[] = "shill_network_name"; // Add a fake eSIM with name kTestProfileName. - helper().hermes_manager_test()->AddEuicc(dbus::ObjectPath(kTestEuiccPath), - "eid", /*is_active=*/true, - /*physical_slot=*/0); - helper().hermes_euicc_test()->AddCarrierProfile( + helper()->hermes_manager_test()->AddEuicc(dbus::ObjectPath(kTestEuiccPath), + "eid", /*is_active=*/true, + /*physical_slot=*/0); + helper()->hermes_euicc_test()->AddCarrierProfile( dbus::ObjectPath(kTestProfileServicePath), dbus::ObjectPath(kTestEuiccPath), kTestIccid, kTestProfileName, "service_provider", "activation_code", kTestProfileServicePath, @@ -840,8 +828,8 @@ // Change the network's name in Shill. Now, Hermes and Shill have different // names associated with the profile. - helper().SetServiceProperty(kTestProfileServicePath, shill::kNameProperty, - base::Value(kTestNameFromShill)); + helper()->SetServiceProperty(kTestProfileServicePath, shill::kNameProperty, + base::Value(kTestNameFromShill)); base::RunLoop().RunUntilIdle(); // Fetch the Cellular network for the eSIM profile. @@ -854,11 +842,15 @@ } TEST_F(CrosNetworkConfigTest, SimAbsentMeansCellularIsDisabled) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature( + ash::features::kUpdatedCellularActivationUi); + mojom::DeviceStatePropertiesPtr cellular = GetDeviceStateFromList(mojom::NetworkType::kCellular); EXPECT_EQ(mojom::DeviceStateType::kEnabled, cellular->device_state); - helper().device_test()->SetDeviceProperty( + helper()->device_test()->SetDeviceProperty( kCellularDevicePath, shill::kSIMPresentProperty, base::Value(false), /*notify_changed=*/true); base::RunLoop().RunUntilIdle(); @@ -900,7 +892,7 @@ EXPECT_EQ(mojom::DeviceStateType::kEnabled, vpn->device_state); // Disable WiFi - helper().network_state_handler()->SetTechnologyEnabled( + NetworkHandler::Get()->network_state_handler()->SetTechnologyEnabled( NetworkTypePattern::WiFi(), false, network_handler::ErrorCallback()); base::RunLoop().RunUntilIdle(); devices = GetDeviceStateList(); @@ -912,7 +904,7 @@ // Tests that no VPN device state is returned by GetDeviceStateList if no VPN // services exist and built-in VPN is not prohibited. TEST_F(CrosNetworkConfigTest, GetDeviceStateListNoVpnServices) { - helper().ClearServices(); + helper()->ClearServices(); std::vector<std::string> prohibited_technologies = NetworkHandler::Get() @@ -926,7 +918,7 @@ // Tests that a VPN device state is returned by GetDeviceStateList if built-in // VPN is not prohibited even if no VPN services exist. TEST_F(CrosNetworkConfigTest, GetDeviceStateListNoVpnServicesAndVpnProhibited) { - helper().ClearServices(); + helper()->ClearServices(); NetworkHandler::Get() ->prohibited_technologies_handler() @@ -1398,7 +1390,7 @@ EXPECT_TRUE(cellular->sim_lock_status->lock_type.empty()); // Lock the sim. (Can not be done via the mojo API). - helper().device_test()->SetSimLocked(kCellularDevicePath, true); + helper()->device_test()->SetSimLocked(kCellularDevicePath, true); base::RunLoop().RunUntilIdle(); cellular = GetDeviceStateFromList(mojom::NetworkType::kCellular); ASSERT_TRUE(cellular && cellular->sim_lock_status); @@ -1455,7 +1447,7 @@ "status": "current"}, {"network_id": "network2", "technology": "GSM", "status": "available"}])")); - helper().device_test()->SetDeviceProperty( + helper()->device_test()->SetDeviceProperty( kCellularDevicePath, shill::kFoundNetworksProperty, *found_networks_list, /*notify_changed=*/true); @@ -1631,7 +1623,7 @@ EXPECT_EQ(0, observer()->network_state_list_changed()); // Add a wifi network. - helper().ConfigureService( + helper()->ConfigureService( R"({"GUID": "wifi3_guid", "Type": "wifi", "State": "ready"})"); base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, observer()->network_state_list_changed()); @@ -1643,7 +1635,7 @@ EXPECT_EQ(0, observer()->device_state_list_changed()); // Disable wifi - helper().network_state_handler()->SetTechnologyEnabled( + NetworkHandler::Get()->network_state_handler()->SetTechnologyEnabled( NetworkTypePattern::WiFi(), false, network_handler::ErrorCallback()); base::RunLoop().RunUntilIdle(); // This will trigger three device list updates. First when wifi is in the @@ -1652,20 +1644,20 @@ EXPECT_EQ(3, observer()->device_state_list_changed()); // Enable Tethering - helper().network_state_handler()->SetTetherTechnologyState( + NetworkHandler::Get()->network_state_handler()->SetTetherTechnologyState( NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED); base::RunLoop().RunUntilIdle(); EXPECT_EQ(4, observer()->device_state_list_changed()); // Tests that observers are notified of device state list change // when a tether scan begins for a device. - helper().network_state_handler()->SetTetherScanState(true); + NetworkHandler::Get()->network_state_handler()->SetTetherScanState(true); base::RunLoop().RunUntilIdle(); EXPECT_EQ(5, observer()->device_state_list_changed()); // Tests that observers are notified of device state list change // when a tether scan completes. - helper().network_state_handler()->SetTetherScanState(false); + NetworkHandler::Get()->network_state_handler()->SetTetherScanState(false); base::RunLoop().RunUntilIdle(); EXPECT_EQ(6, observer()->device_state_list_changed()); } @@ -1676,8 +1668,8 @@ EXPECT_EQ(0, observer()->active_networks_changed()); // Change a network state. - helper().SetServiceProperty(wifi1_path(), shill::kStateProperty, - base::Value(shill::kStateIdle)); + helper()->SetServiceProperty(wifi1_path(), shill::kStateProperty, + base::Value(shill::kStateIdle)); base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, observer()->active_networks_changed()); } @@ -1689,8 +1681,8 @@ EXPECT_EQ(0, observer()->GetNetworkChangedCount("wifi2_guid")); // Change a network state. - helper().SetServiceProperty(wifi1_path(), shill::kSignalStrengthProperty, - base::Value(10)); + helper()->SetServiceProperty(wifi1_path(), shill::kSignalStrengthProperty, + base::Value(10)); base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, observer()->GetNetworkChangedCount("wifi1_guid")); EXPECT_EQ(0, observer()->GetNetworkChangedCount("wifi2_guid")); @@ -1712,32 +1704,38 @@ EXPECT_EQ(network->proxy_mode, mojom::ProxyMode::kDirect); } +TEST_F(CrosNetworkConfigTest, NetworkStateHasIccidAndEid) { + const char kTestIccid[] = "iccid"; + const char kTestEid[] = "eid"; + + // Add a fake eSIM network. + SetupTestESimProfile(kTestEid, kTestIccid, "esim_service_path", + "test_profile_name"); + + // Fetch the Cellular network's managed properties for the eSIM profile. + std::string esim_guid = std::string("esim_guid") + kTestIccid; + mojom::NetworkStatePropertiesPtr network = GetNetworkState(esim_guid); + mojom::CellularStatePropertiesPtr& cellular = + network->type_state->get_cellular(); + EXPECT_EQ(kTestIccid, cellular->iccid); + EXPECT_EQ(kTestEid, cellular->eid); +} + TEST_F(CrosNetworkConfigTest, ESimManagedPropertiesNameComesFromHermes) { - const char kTestEuiccPath[] = "euicc_path"; const char kTestProfileServicePath[] = "esim_service_path"; const char kTestIccid[] = "iccid"; - - const char kTestProfileName[] = "test_profile_name"; + const char kTestEid[] = "eid"; const char kTestNameFromShill[] = "shill_network_name"; + const char kTestProfileName[] = "test_profile_name"; // Add a fake eSIM with name kTestProfileName. - helper().hermes_manager_test()->AddEuicc(dbus::ObjectPath(kTestEuiccPath), - "eid", /*is_active=*/true, - /*physical_slot=*/0); - helper().hermes_euicc_test()->AddCarrierProfile( - dbus::ObjectPath(kTestProfileServicePath), - dbus::ObjectPath(kTestEuiccPath), kTestIccid, kTestProfileName, - "service_provider", "activation_code", kTestProfileServicePath, - hermes::profile::State::kInactive, - hermes::profile::ProfileClass::kOperational, - HermesEuiccClient::TestInterface::AddCarrierProfileBehavior:: - kAddProfileWithService); - base::RunLoop().RunUntilIdle(); + SetupTestESimProfile(kTestEid, kTestIccid, kTestProfileServicePath, + kTestProfileName); // Change the network's name in Shill. Now, Hermes and Shill have different // names associated with the profile. - helper().SetServiceProperty(kTestProfileServicePath, shill::kNameProperty, - base::Value(kTestNameFromShill)); + helper()->SetServiceProperty(kTestProfileServicePath, shill::kNameProperty, + base::Value(kTestNameFromShill)); base::RunLoop().RunUntilIdle(); // Fetch the Cellular network's managed properties for the eSIM profile. @@ -1749,25 +1747,25 @@ TEST_F(CrosNetworkConfigTest, GetAlwaysOnVpn) { mojom::AlwaysOnVpnPropertiesPtr properties; - helper().SetProfileProperty(helper().ProfilePathUser(), - shill::kAlwaysOnVpnModeProperty, - base::Value("off")); - helper().SetProfileProperty(helper().ProfilePathUser(), - shill::kAlwaysOnVpnServiceProperty, - base::Value(vpn_path())); + helper()->SetProfileProperty(helper()->ProfilePathUser(), + shill::kAlwaysOnVpnModeProperty, + base::Value("off")); + helper()->SetProfileProperty(helper()->ProfilePathUser(), + shill::kAlwaysOnVpnServiceProperty, + base::Value(vpn_path())); properties = GetAlwaysOnVpn(); EXPECT_EQ(mojom::AlwaysOnVpnMode::kOff, properties->mode); EXPECT_EQ("vpn_guid", properties->service_guid); - helper().SetProfileProperty(helper().ProfilePathUser(), - shill::kAlwaysOnVpnModeProperty, - base::Value("best-effort")); + helper()->SetProfileProperty(helper()->ProfilePathUser(), + shill::kAlwaysOnVpnModeProperty, + base::Value("best-effort")); properties = GetAlwaysOnVpn(); EXPECT_EQ(mojom::AlwaysOnVpnMode::kBestEffort, properties->mode); - helper().SetProfileProperty(helper().ProfilePathUser(), - shill::kAlwaysOnVpnModeProperty, - base::Value("strict")); + helper()->SetProfileProperty(helper()->ProfilePathUser(), + shill::kAlwaysOnVpnModeProperty, + base::Value("strict")); properties = GetAlwaysOnVpn(); EXPECT_EQ(mojom::AlwaysOnVpnMode::kStrict, properties->mode); } @@ -1779,10 +1777,10 @@ SetAlwaysOnVpn(std::move(properties)); EXPECT_EQ("best-effort", - helper().GetProfileStringProperty(helper().ProfilePathUser(), - shill::kAlwaysOnVpnModeProperty)); - EXPECT_EQ(vpn_path(), helper().GetProfileStringProperty( - helper().ProfilePathUser(), + helper()->GetProfileStringProperty( + helper()->ProfilePathUser(), shill::kAlwaysOnVpnModeProperty)); + EXPECT_EQ(vpn_path(), helper()->GetProfileStringProperty( + helper()->ProfilePathUser(), shill::kAlwaysOnVpnServiceProperty)); properties = mojom::AlwaysOnVpnProperties::New(mojom::AlwaysOnVpnMode::kOff, @@ -1790,10 +1788,10 @@ SetAlwaysOnVpn(std::move(properties)); EXPECT_EQ("off", - helper().GetProfileStringProperty(helper().ProfilePathUser(), - shill::kAlwaysOnVpnModeProperty)); - EXPECT_EQ(vpn_path(), helper().GetProfileStringProperty( - helper().ProfilePathUser(), + helper()->GetProfileStringProperty( + helper()->ProfilePathUser(), shill::kAlwaysOnVpnModeProperty)); + EXPECT_EQ(vpn_path(), helper()->GetProfileStringProperty( + helper()->ProfilePathUser(), shill::kAlwaysOnVpnServiceProperty)); properties = mojom::AlwaysOnVpnProperties::New(mojom::AlwaysOnVpnMode::kOff, @@ -1801,10 +1799,10 @@ SetAlwaysOnVpn(std::move(properties)); EXPECT_EQ("off", - helper().GetProfileStringProperty(helper().ProfilePathUser(), - shill::kAlwaysOnVpnModeProperty)); - EXPECT_EQ(vpn_path(), helper().GetProfileStringProperty( - helper().ProfilePathUser(), + helper()->GetProfileStringProperty( + helper()->ProfilePathUser(), shill::kAlwaysOnVpnModeProperty)); + EXPECT_EQ(vpn_path(), helper()->GetProfileStringProperty( + helper()->ProfilePathUser(), shill::kAlwaysOnVpnServiceProperty)); }
diff --git a/chromeos/ui/frame/caption_buttons/frame_caption_button_container_view.cc b/chromeos/ui/frame/caption_buttons/frame_caption_button_container_view.cc index dbac4d0..4a3d988 100644 --- a/chromeos/ui/frame/caption_buttons/frame_caption_button_container_view.cc +++ b/chromeos/ui/frame/caption_buttons/frame_caption_button_container_view.cc
@@ -17,6 +17,7 @@ #include "ui/aura/window_tree_host.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" #include "ui/events/event_sink.h" #include "ui/gfx/animation/slide_animation.h" @@ -27,7 +28,6 @@ #include "ui/gfx/vector_icon_types.h" #include "ui/strings/grit/ui_strings.h" // Accessibility names #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/window/frame_caption_button.h"
diff --git a/chromeos/ui/frame/caption_buttons/frame_caption_button_container_view.h b/chromeos/ui/frame/caption_buttons/frame_caption_button_container_view.h index b4cf9e6c..7af78f9 100644 --- a/chromeos/ui/frame/caption_buttons/frame_caption_button_container_view.h +++ b/chromeos/ui/frame/caption_buttons/frame_caption_button_container_view.h
@@ -12,9 +12,9 @@ #include "chromeos/ui/frame/caption_buttons/caption_button_model.h" #include "chromeos/ui/frame/caption_buttons/frame_size_button_delegate.h" #include "chromeos/ui/frame/caption_buttons/snap_controller.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/animation/animation_delegate_views.h" #include "ui/views/layout/box_layout_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/window/frame_caption_button.h"
diff --git a/chromeos/ui/frame/frame_header.cc b/chromeos/ui/frame/frame_header.cc index 4590991..bd3b52e2 100644 --- a/chromeos/ui/frame/frame_header.cc +++ b/chromeos/ui/frame/frame_header.cc
@@ -10,6 +10,8 @@ #include "chromeos/ui/frame/frame_utils.h" #include "chromeos/ui/vector_icons/vector_icons.h" #include "ui/base/class_property.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_observer.h" #include "ui/compositor/layer_tree_owner.h" @@ -19,8 +21,6 @@ #include "ui/gfx/font_list.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/scoped_canvas.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/native_widget_aura.h" #include "ui/views/widget/widget.h"
diff --git a/components/arc/ime/arc_ime_service.cc b/components/arc/ime/arc_ime_service.cc index ca37a5d9..c095abd 100644 --- a/components/arc/ime/arc_ime_service.cc +++ b/components/arc/ime/arc_ime_service.cc
@@ -642,7 +642,7 @@ } gfx::Range ArcImeService::GetAutocorrectRange() const { - // TODO(https:://crbug.com/1091088): Implement this method. + // TODO(https://crbug.com/1091088): Implement this method. return gfx::Range(); } @@ -669,7 +669,27 @@ TextInputClient::SubClass::kArcImeService); } } - // TODO(https:://crbug.com/1091088): Implement this method. + // TODO(https://crbug.com/1091088): Implement this method. + NOTIMPLEMENTED_LOG_ONCE(); + return false; +} + +base::Optional<ui::GrammarFragment> ArcImeService::GetGrammarFragment( + const gfx::Range& range) { + // TODO(https://crbug.com/1201454): Implement this method. + NOTIMPLEMENTED_LOG_ONCE(); + return base::nullopt; +} + +bool ArcImeService::ClearGrammarFragments(const gfx::Range& range) { + // TODO(https://crbug.com/1201454): Implement this method. + NOTIMPLEMENTED_LOG_ONCE(); + return false; +} + +bool ArcImeService::AddGrammarFragments( + const std::vector<ui::GrammarFragment>& fragments) { + // TODO(https://crbug.com/1201454): Implement this method. NOTIMPLEMENTED_LOG_ONCE(); return false; }
diff --git a/components/arc/ime/arc_ime_service.h b/components/arc/ime/arc_ime_service.h index c8d8e80..b8da4206 100644 --- a/components/arc/ime/arc_ime_service.h +++ b/components/arc/ime/arc_ime_service.h
@@ -155,6 +155,11 @@ gfx::Range GetAutocorrectRange() const override; gfx::Rect GetAutocorrectCharacterBounds() const override; bool SetAutocorrectRange(const gfx::Range& range) override; + base::Optional<ui::GrammarFragment> GetGrammarFragment( + const gfx::Range& range) override; + bool ClearGrammarFragments(const gfx::Range& range) override; + bool AddGrammarFragments( + const std::vector<ui::GrammarFragment>& fragments) override; void OnDispatchingKeyEventPostIME(ui::KeyEvent* event) override; // Normally, the default device scale factor is used to convert from DPI to
diff --git a/components/arc/test/fake_app_instance.cc b/components/arc/test/fake_app_instance.cc index 85dab619e..623ba805 100644 --- a/components/arc/test/fake_app_instance.cc +++ b/components/arc/test/fake_app_instance.cc
@@ -386,25 +386,45 @@ return; } + const std::string kPartiallyFailedQueryPrefix( + "PartiallyFailedQueryWithCode-"); + if (!query.compare(0, kPartiallyFailedQueryPrefix.size(), + kPartiallyFailedQueryPrefix)) { + state_code = static_cast<ArcPlayStoreSearchRequestState>( + stoi(query.substr(kPartiallyFailedQueryPrefix.size()))); + DCHECK_EQ(state_code, + ArcPlayStoreSearchRequestState::PHONESKY_RESULT_INVALID_DATA); + } + auto icon = GetFakeIcon(mojom::ScaleFactor::SCALE_FACTOR_100P); const auto& fake_icon_png_data = (!icon || !icon->icon_png_data) ? std::vector<uint8_t>() : icon->icon_png_data.value(); + + const int num_results = + (state_code == ArcPlayStoreSearchRequestState::SUCCESS) ? max_results + : max_results / 2; + const bool has_price_and_rating = query != "QueryWithoutRatingAndPrice"; + fake_apps.push_back(mojom::AppDiscoveryResult::New( - std::string("LauncherIntentUri"), // launch_intent_uri - std::string("InstallIntentUri"), // install_intent_uri - std::string(query), // label - false, // is_instant_app - false, // is_recent - std::string("Publisher"), // publisher_name - std::string("$7.22"), // formatted_price - 5, // review_score + std::string("LauncherIntentUri"), // launch_intent_uri + std::string("InstallIntentUri"), // install_intent_uri + std::string(query), // label + false, // is_instant_app + false, // is_recent + std::string("Publisher"), // publisher_name + has_price_and_rating ? std::string("$7.22") + : std::string(), // formatted_price + has_price_and_rating ? 5 : -1, // review_score fake_icon_png_data, // icon_png_data std::string("com.google.android.gm"), // package_name std::move(icon))); // icon - for (int i = 0; i < max_results - 1; ++i) { - auto icon = GetFakeIcon(mojom::ScaleFactor::SCALE_FACTOR_100P); + for (int i = 0; i < num_results - 1; ++i) { + const bool has_icon = + query != "QueryWithSomeResultsMissingIcon" || i < num_results / 2; + auto icon = + has_icon ? GetFakeIcon(mojom::ScaleFactor::SCALE_FACTOR_100P) : nullptr; const auto& fake_icon_png_data = (!icon || !icon->icon_png_data) ? std::vector<uint8_t>() : icon->icon_png_data.value(); @@ -415,11 +435,12 @@ i % 2 == 0, // is_instant_app i % 4 == 0, // is_recent base::StringPrintf("Publisher %d", i), // publisher_name - base::StringPrintf("$%d.22", i), // formatted_price - i, // review_score - fake_icon_png_data, // icon_png_data - base::StringPrintf("test.package.%d", i), // package_name - std::move(icon))); // icon + has_price_and_rating ? base::StringPrintf("$%d.22", i) + : std::string(), // formatted_price + has_price_and_rating ? i : -1, // review_score + fake_icon_png_data, // icon_png_data + base::StringPrintf("test.package.%d", i), // package_name + std::move(icon))); // icon } std::move(callback).Run(state_code, std::move(fake_apps));
diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc index 48e42cfa..7525ba7 100644 --- a/components/autofill/content/browser/content_autofill_driver.cc +++ b/components/autofill/content/browser/content_autofill_driver.cc
@@ -4,6 +4,7 @@ #include "components/autofill/content/browser/content_autofill_driver.h" +#include <memory> #include <tuple> #include <utility> #include <vector> @@ -12,7 +13,6 @@ #include "base/metrics/histogram_macros.h" #include "build/build_config.h" #include "components/autofill/content/browser/content_autofill_driver_factory.h" -#include "components/autofill/core/browser/android_autofill_manager.h" #include "components/autofill/core/browser/autofill_client.h" #include "components/autofill/core/browser/browser_autofill_manager.h" #include "components/autofill/core/browser/form_structure.h" @@ -64,15 +64,21 @@ AutofillClient* client, const std::string& app_locale, AutofillManager::AutofillDownloadManagerState enable_download_manager, - AutofillProvider* provider) + AutofillManager::AutofillManagerFactoryCallback + autofill_manager_factory_callback) : render_frame_host_(render_frame_host), browser_autofill_manager_(nullptr), key_press_handler_manager_(this), log_manager_(client->GetLogManager()) { - // BrowserAutofillManager isn't used if provider is valid, Autofill provider - // is currently used by Android WebView only. - if (provider) { - SetAutofillProvider(provider, client, enable_download_manager); + // AutofillManager isn't used if provider is valid, Autofill provider is + // currently used by Android WebView only. + if (autofill_manager_factory_callback) { + autofill_manager_ = autofill_manager_factory_callback.Run( + this, client, app_locale, enable_download_manager); + GetAutofillAgent()->SetUserGestureRequired(false); + GetAutofillAgent()->SetSecureContextRequired(true); + GetAutofillAgent()->SetFocusRequiresScroll(false); + GetAutofillAgent()->SetQueryPasswordSuggestion(true); } else { SetBrowserAutofillManager(std::make_unique<BrowserAutofillManager>( this, client, app_locale, enable_download_manager)); @@ -171,11 +177,11 @@ void ContentAutofillDriver::PropagateAutofillPredictions( const std::vector<FormStructure*>& forms) { - AutofillManager* handler = browser_autofill_manager_ + AutofillManager* manager = browser_autofill_manager_ ? browser_autofill_manager_ : autofill_manager_.get(); - DCHECK(handler); - handler->PropagateAutofillPredictions(render_frame_host_, forms); + DCHECK(manager); + manager->PropagateAutofillPredictions(render_frame_host_, forms); } void ContentAutofillDriver::HandleParsedForms( @@ -371,7 +377,7 @@ ShowOfferNotificationIfApplicable(navigation_handle); // When IsServedFromBackForwardCache, the form data is not parsed - // again. So, we should keep and use the autofill handler's + // again. So, we should keep and use the autofill manager's // form_structures from BFCache for form submit. if (navigation_handle->IsServedFromBackForwardCache()) return; @@ -429,18 +435,6 @@ view->GetRenderWidgetHost()->RemoveKeyPressEventCallback(handler); } -void ContentAutofillDriver::SetAutofillProvider( - AutofillProvider* provider, - AutofillClient* client, - AutofillManager::AutofillDownloadManagerState enable_download_manager) { - autofill_manager_ = std::make_unique<AndroidAutofillManager>( - this, client, provider, enable_download_manager); - GetAutofillAgent()->SetUserGestureRequired(false); - GetAutofillAgent()->SetSecureContextRequired(true); - GetAutofillAgent()->SetFocusRequiresScroll(false); - GetAutofillAgent()->SetQueryPasswordSuggestion(true); -} - bool ContentAutofillDriver::DocumentUsedWebOTP() const { return render_frame_host_->DocumentUsedWebOTP(); } @@ -481,16 +475,6 @@ static_cast<PhoneCollectionMetricState>(phone_collection_metric_state_)); } -void ContentAutofillDriver::SetAutofillProviderForTesting( - AutofillProvider* provider, - AutofillClient* client) { - SetAutofillProvider(provider, client, - AutofillManager::AutofillDownloadManagerState:: - DISABLE_AUTOFILL_DOWNLOAD_MANAGER); - // BrowserAutofillManager isn't used if provider is valid. - browser_autofill_manager_ = nullptr; -} - void ContentAutofillDriver::ShowOfferNotificationIfApplicable( content::NavigationHandle* navigation_handle) { if (!navigation_handle->IsInMainFrame())
diff --git a/components/autofill/content/browser/content_autofill_driver.h b/components/autofill/content/browser/content_autofill_driver.h index 7c96eb16..ca0f934 100644 --- a/components/autofill/content/browser/content_autofill_driver.h +++ b/components/autofill/content/browser/content_autofill_driver.h
@@ -29,7 +29,6 @@ namespace autofill { class AutofillClient; -class AutofillProvider; class LogManager; // Use <Phone><WebOTP><OTC> as the bit pattern to identify the metrics state. @@ -63,7 +62,8 @@ AutofillClient* client, const std::string& app_locale, AutofillManager::AutofillDownloadManagerState enable_download_manager, - AutofillProvider* provider); + AutofillManager::AutofillManagerFactoryCallback + autofill_manager_factory_callback); ~ContentAutofillDriver() override; // Gets the driver for |render_frame_host|. @@ -159,9 +159,6 @@ const content::RenderWidgetHost::KeyPressEventCallback& handler); void RemoveKeyPressHandler(); - void SetAutofillProviderForTesting(AutofillProvider* provider, - AutofillClient* client); - // Sets the manager to |manager|. Takes ownership of |manager|. void SetBrowserAutofillManager( std::unique_ptr<BrowserAutofillManager> manager); @@ -188,11 +185,6 @@ void RemoveHandler( const content::RenderWidgetHost::KeyPressEventCallback& handler) override; - void SetAutofillProvider( - AutofillProvider* provider, - AutofillClient* client, - AutofillManager::AutofillDownloadManagerState enable_download_manager); - // Returns whether navigator.credentials.get({otp: {transport:"sms"}}) has // been used. bool DocumentUsedWebOTP() const;
diff --git a/components/autofill/content/browser/content_autofill_driver_factory.cc b/components/autofill/content/browser/content_autofill_driver_factory.cc index 780119b..34d4ea9 100644 --- a/components/autofill/content/browser/content_autofill_driver_factory.cc +++ b/components/autofill/content/browser/content_autofill_driver_factory.cc
@@ -30,9 +30,11 @@ const std::string& app_locale, BrowserAutofillManager::AutofillDownloadManagerState enable_download_manager, - AutofillProvider* provider) { + AutofillManager::AutofillManagerFactoryCallback + autofill_manager_factory_callback) { return std::make_unique<ContentAutofillDriver>( - render_frame_host, client, app_locale, enable_download_manager, provider); + render_frame_host, client, app_locale, enable_download_manager, + std::move(autofill_manager_factory_callback)); } } // namespace @@ -50,8 +52,9 @@ const std::string& app_locale, BrowserAutofillManager::AutofillDownloadManagerState enable_download_manager) { - CreateForWebContentsAndDelegate(contents, client, app_locale, - enable_download_manager, nullptr); + CreateForWebContentsAndDelegate( + contents, client, app_locale, enable_download_manager, + AutofillManager::AutofillManagerFactoryCallback()); } void ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( @@ -60,14 +63,16 @@ const std::string& app_locale, BrowserAutofillManager::AutofillDownloadManagerState enable_download_manager, - AutofillProvider* provider) { + AutofillManager::AutofillManagerFactoryCallback + autofill_manager_factory_callback) { if (FromWebContents(contents)) return; contents->SetUserData( kContentAutofillDriverFactoryWebContentsUserDataKey, std::make_unique<ContentAutofillDriverFactory>( - contents, client, app_locale, enable_download_manager, provider)); + contents, client, app_locale, enable_download_manager, + std::move(autofill_manager_factory_callback))); } // static @@ -107,12 +112,14 @@ const std::string& app_locale, BrowserAutofillManager::AutofillDownloadManagerState enable_download_manager, - AutofillProvider* provider) + AutofillManager::AutofillManagerFactoryCallback + autofill_manager_factory_callback) : AutofillDriverFactory(client), content::WebContentsObserver(web_contents), app_locale_(app_locale), enable_download_manager_(enable_download_manager), - provider_(provider) {} + autofill_manager_factory_callback_( + std::move(autofill_manager_factory_callback)) {} ContentAutofillDriver* ContentAutofillDriverFactory::DriverForFrame( content::RenderFrameHost* render_frame_host) { @@ -120,10 +127,10 @@ // ContentAutofillDriver are created on demand here. if (!driver) { - AddForKey( - render_frame_host, - base::BindRepeating(CreateDriver, render_frame_host, client(), - app_locale_, enable_download_manager_, provider_)); + AddForKey(render_frame_host, + base::BindRepeating(CreateDriver, render_frame_host, client(), + app_locale_, enable_download_manager_, + autofill_manager_factory_callback_)); driver = DriverForKey(render_frame_host); }
diff --git a/components/autofill/content/browser/content_autofill_driver_factory.h b/components/autofill/content/browser/content_autofill_driver_factory.h index 186879e..58c3da4 100644 --- a/components/autofill/content/browser/content_autofill_driver_factory.h +++ b/components/autofill/content/browser/content_autofill_driver_factory.h
@@ -10,6 +10,7 @@ #include "base/supports_user_data.h" #include "components/autofill/content/common/mojom/autofill_driver.mojom.h" #include "components/autofill/core/browser/autofill_driver_factory.h" +#include "components/autofill/core/browser/autofill_manager.h" #include "components/autofill/core/browser/browser_autofill_manager.h" #include "content/public/browser/web_contents_observer.h" #include "mojo/public/cpp/bindings/pending_associated_receiver.h" @@ -21,7 +22,6 @@ namespace autofill { class ContentAutofillDriver; -class AutofillProvider; // Manages lifetime of ContentAutofillDriver. One Factory per WebContents // creates one Driver per RenderFrame. @@ -37,7 +37,8 @@ const std::string& app_locale, BrowserAutofillManager::AutofillDownloadManagerState enable_download_manager, - AutofillProvider* provider); + AutofillManager::AutofillManagerFactoryCallback + autofill_manager_factory_callback); ~ContentAutofillDriverFactory() override; @@ -54,7 +55,8 @@ const std::string& app_locale, BrowserAutofillManager::AutofillDownloadManagerState enable_download_manager, - AutofillProvider* provider); + AutofillManager::AutofillManagerFactoryCallback + autofill_manager_factory_callback); static ContentAutofillDriverFactory* FromWebContents( content::WebContents* contents); @@ -80,7 +82,8 @@ private: std::string app_locale_; BrowserAutofillManager::AutofillDownloadManagerState enable_download_manager_; - AutofillProvider* provider_; + AutofillManager::AutofillManagerFactoryCallback + autofill_manager_factory_callback_; }; } // namespace autofill
diff --git a/components/autofill/content/browser/content_autofill_driver_unittest.cc b/components/autofill/content/browser/content_autofill_driver_unittest.cc index 94bb308..ddeafa755 100644 --- a/components/autofill/content/browser/content_autofill_driver_unittest.cc +++ b/components/autofill/content/browser/content_autofill_driver_unittest.cc
@@ -284,11 +284,12 @@ public: TestContentAutofillDriver(content::RenderFrameHost* rfh, AutofillClient* client) - : ContentAutofillDriver(rfh, - client, - kAppLocale, - kDownloadState, - nullptr) { + : ContentAutofillDriver( + rfh, + client, + kAppLocale, + kDownloadState, + AutofillManager::AutofillManagerFactoryCallback()) { std::unique_ptr<BrowserAutofillManager> autofill_manager( new MockBrowserAutofillManager(this, client)); SetBrowserAutofillManager(std::move(autofill_manager));
diff --git a/components/autofill/core/browser/android_autofill_manager.cc b/components/autofill/core/browser/android_autofill_manager.cc index 5710567..43a0106 100644 --- a/components/autofill/core/browser/android_autofill_manager.cc +++ b/components/autofill/core/browser/android_autofill_manager.cc
@@ -4,12 +4,24 @@ #include "components/autofill/core/browser/android_autofill_manager.h" +#include "base/memory/ptr_util.h" #include "components/autofill/core/browser/autofill_provider.h" namespace autofill { using base::TimeTicks; +// static +std::unique_ptr<AutofillManager> AndroidAutofillManager::Create( + AutofillProvider* provider, + AutofillDriver* driver, + AutofillClient* client, + const std::string& /*app_locale*/, + AutofillManager::AutofillDownloadManagerState enable_download_manager) { + return base::WrapUnique(new AndroidAutofillManager(driver, client, provider, + enable_download_manager)); +} + AndroidAutofillManager::AndroidAutofillManager( AutofillDriver* driver, AutofillClient* client, @@ -21,7 +33,7 @@ version_info::Channel::UNKNOWN), provider_(provider) {} -AndroidAutofillManager::~AndroidAutofillManager() {} +AndroidAutofillManager::~AndroidAutofillManager() = default; void AndroidAutofillManager::OnFormSubmittedImpl( const FormData& form,
diff --git a/components/autofill/core/browser/android_autofill_manager.h b/components/autofill/core/browser/android_autofill_manager.h index 71b0c4d..17c7ef8 100644 --- a/components/autofill/core/browser/android_autofill_manager.h +++ b/components/autofill/core/browser/android_autofill_manager.h
@@ -16,11 +16,13 @@ // This class forwards AutofillManager calls to AutofillProvider. class AndroidAutofillManager : public AutofillManager { public: - AndroidAutofillManager( + static std::unique_ptr<AutofillManager> Create( + AutofillProvider* provider, AutofillDriver* driver, AutofillClient* client, - AutofillProvider* provider, + const std::string& app_locale, AutofillManager::AutofillDownloadManagerState enable_download_manager); + ~AndroidAutofillManager() override; void OnFocusNoLongerOnForm(bool had_interacted_form) override; @@ -42,6 +44,12 @@ bool has_server_prediction() const { return has_server_prediction_; } protected: + AndroidAutofillManager( + AutofillDriver* driver, + AutofillClient* client, + AutofillProvider* provider, + AutofillManager::AutofillDownloadManagerState enable_download_manager); + void OnFormSubmittedImpl(const FormData& form, bool known_success, mojom::SubmissionSource source) override;
diff --git a/components/autofill/core/browser/autofill_manager.h b/components/autofill/core/browser/autofill_manager.h index 81553596..963b907 100644 --- a/components/autofill/core/browser/autofill_manager.h +++ b/components/autofill/core/browser/autofill_manager.h
@@ -57,6 +57,15 @@ virtual void OnFormParsed() = 0; }; + // The factory method for the embedder to create the subclass of + // AutofillManager in ContentAutofillDriver. + using AutofillManagerFactoryCallback = + base::RepeatingCallback<std::unique_ptr<AutofillManager>( + AutofillDriver*, + AutofillClient*, + const std::string& app_locale, + AutofillManager::AutofillDownloadManagerState)>; + // Raw metadata uploading enabled iff this Chrome instance is on Canary or Dev // channel. static bool IsRawMetadataUploadingEnabled(version_info::Channel channel);
diff --git a/components/autofill/core/browser/data_model/contact_info.cc b/components/autofill/core/browser/data_model/contact_info.cc index 8155e9f..c85a292 100644 --- a/components/autofill/core/browser/data_model/contact_info.cc +++ b/components/autofill/core/browser/data_model/contact_info.cc
@@ -101,16 +101,21 @@ std::u16string NameInfo::GetRawInfo(ServerFieldType type) const { DCHECK_EQ(FieldTypeGroup::kName, AutofillType(type).group()); + // TODO(crbug.com/1141460): Remove once honorific prefixes are launched. + if (type == NAME_FULL_WITH_HONORIFIC_PREFIX && + !structured_address::HonorificPrefixEnabled()) { + type = NAME_FULL; + } // TODO(crbug.com/1103421): Clean legacy implementation once structured names // are fully launched. if (structured_address::StructuredNamesEnabled()) { // Without the second generation of the structured name tree, honorific // prefixes and the name including the prefix are unsupported types. - if ((type == NAME_HONORIFIC_PREFIX || - type == NAME_FULL_WITH_HONORIFIC_PREFIX) && + if (type == NAME_HONORIFIC_PREFIX && !structured_address::HonorificPrefixEnabled()) { return std::u16string(); } + return name_->GetValueForType(type); } switch (type) {
diff --git a/components/browser_ui/styles/android/BUILD.gn b/components/browser_ui/styles/android/BUILD.gn index 8b4d436..70f450a7 100644 --- a/components/browser_ui/styles/android/BUILD.gn +++ b/components/browser_ui/styles/android/BUILD.gn
@@ -27,6 +27,7 @@ "java/res/color/default_icon_color_secondary_tint_list.xml", "java/res/color/default_icon_color_tint_list.xml", "java/res/drawable-hdpi/btn_star_filled.png", + "java/res/drawable-hdpi/ic_chrome.png", "java/res/drawable-hdpi/ic_delete_white_24dp.png", "java/res/drawable-hdpi/ic_edit_24dp.png", "java/res/drawable-hdpi/ic_folder_blue_24dp.png", @@ -52,6 +53,7 @@ "java/res/drawable-ldrtl-xxhdpi/ic_share_white_24dp.png", "java/res/drawable-ldrtl-xxxhdpi/ic_share_white_24dp.png", "java/res/drawable-mdpi/btn_star_filled.png", + "java/res/drawable-mdpi/ic_chrome.png", "java/res/drawable-mdpi/ic_delete_white_24dp.png", "java/res/drawable-mdpi/ic_edit_24dp.png", "java/res/drawable-mdpi/ic_folder_blue_24dp.png", @@ -72,6 +74,7 @@ "java/res/drawable-mdpi/top_round_foreground.9.png", "java/res/drawable-mdpi/top_round_shadow.9.png", "java/res/drawable-xhdpi/btn_star_filled.png", + "java/res/drawable-xhdpi/ic_chrome.png", "java/res/drawable-xhdpi/ic_delete_white_24dp.png", "java/res/drawable-xhdpi/ic_edit_24dp.png", "java/res/drawable-xhdpi/ic_folder_blue_24dp.png", @@ -92,6 +95,7 @@ "java/res/drawable-xhdpi/top_round_foreground.9.png", "java/res/drawable-xhdpi/top_round_shadow.9.png", "java/res/drawable-xxhdpi/btn_star_filled.png", + "java/res/drawable-xxhdpi/ic_chrome.png", "java/res/drawable-xxhdpi/ic_delete_white_24dp.png", "java/res/drawable-xxhdpi/ic_edit_24dp.png", "java/res/drawable-xxhdpi/ic_folder_blue_24dp.png", @@ -112,6 +116,7 @@ "java/res/drawable-xxhdpi/top_round_foreground.9.png", "java/res/drawable-xxhdpi/top_round_shadow.9.png", "java/res/drawable-xxxhdpi/btn_star_filled.png", + "java/res/drawable-xxxhdpi/ic_chrome.png", "java/res/drawable-xxxhdpi/ic_delete_white_24dp.png", "java/res/drawable-xxxhdpi/ic_edit_24dp.png", "java/res/drawable-xxxhdpi/ic_folder_blue_24dp.png",
diff --git a/chrome/android/java/res/drawable-hdpi/ic_chrome.png b/components/browser_ui/styles/android/java/res/drawable-hdpi/ic_chrome.png similarity index 100% rename from chrome/android/java/res/drawable-hdpi/ic_chrome.png rename to components/browser_ui/styles/android/java/res/drawable-hdpi/ic_chrome.png Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/ic_chrome.png b/components/browser_ui/styles/android/java/res/drawable-mdpi/ic_chrome.png similarity index 100% rename from chrome/android/java/res/drawable-mdpi/ic_chrome.png rename to components/browser_ui/styles/android/java/res/drawable-mdpi/ic_chrome.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/ic_chrome.png b/components/browser_ui/styles/android/java/res/drawable-xhdpi/ic_chrome.png similarity index 100% rename from chrome/android/java/res/drawable-xhdpi/ic_chrome.png rename to components/browser_ui/styles/android/java/res/drawable-xhdpi/ic_chrome.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/ic_chrome.png b/components/browser_ui/styles/android/java/res/drawable-xxhdpi/ic_chrome.png similarity index 100% rename from chrome/android/java/res/drawable-xxhdpi/ic_chrome.png rename to components/browser_ui/styles/android/java/res/drawable-xxhdpi/ic_chrome.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/ic_chrome.png b/components/browser_ui/styles/android/java/res/drawable-xxxhdpi/ic_chrome.png similarity index 100% rename from chrome/android/java/res/drawable-xxxhdpi/ic_chrome.png rename to components/browser_ui/styles/android/java/res/drawable-xxxhdpi/ic_chrome.png Binary files differ
diff --git a/components/content_creation/notes/android/BUILD.gn b/components/content_creation/notes/android/BUILD.gn index e45e09b0..b6711192 100644 --- a/components/content_creation/notes/android/BUILD.gn +++ b/components/content_creation/notes/android/BUILD.gn
@@ -13,7 +13,10 @@ "java/src/org/chromium/components/content_creation/notes/models/NoteTemplate.java", ] - deps = [ "//base:base_java" ] + deps = [ + "//base:base_java", + "//third_party/androidx:androidx_annotation_annotation_java", + ] resources_package = "org.chromium.components.content_creation.notes" annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
diff --git a/components/content_creation/notes/android/java/src/org/chromium/components/content_creation/notes/bridges/NoteServiceBridge.java b/components/content_creation/notes/android/java/src/org/chromium/components/content_creation/notes/bridges/NoteServiceBridge.java index 5d77e72..9c58578 100644 --- a/components/content_creation/notes/android/java/src/org/chromium/components/content_creation/notes/bridges/NoteServiceBridge.java +++ b/components/content_creation/notes/android/java/src/org/chromium/components/content_creation/notes/bridges/NoteServiceBridge.java
@@ -36,7 +36,7 @@ } @Override - public void GetTemplates(Callback<List<NoteTemplate>> callback) { + public void getTemplates(Callback<List<NoteTemplate>> callback) { if (mNativeNoteServiceBridge == 0) return; NoteServiceBridgeJni.get().getTemplates(mNativeNoteServiceBridge, this, callback); }
diff --git a/components/content_creation/notes/android/java/src/org/chromium/components/content_creation/notes/bridges/NoteTemplateConversionBridge.java b/components/content_creation/notes/android/java/src/org/chromium/components/content_creation/notes/bridges/NoteTemplateConversionBridge.java index b8c26b9c..8412679 100644 --- a/components/content_creation/notes/android/java/src/org/chromium/components/content_creation/notes/bridges/NoteTemplateConversionBridge.java +++ b/components/content_creation/notes/android/java/src/org/chromium/components/content_creation/notes/bridges/NoteTemplateConversionBridge.java
@@ -4,6 +4,8 @@ package org.chromium.components.content_creation.notes.bridges; +import androidx.annotation.Nullable; + import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.components.content_creation.notes.models.NoteTemplate;
diff --git a/components/content_creation/notes/android/note_service_bridge.cc b/components/content_creation/notes/android/note_service_bridge.cc index f0e6840..4b2c9da 100644 --- a/components/content_creation/notes/android/note_service_bridge.cc +++ b/components/content_creation/notes/android/note_service_bridge.cc
@@ -8,7 +8,6 @@ #include "base/android/jni_array.h" #include "base/bind.h" #include "components/content_creation/notes/android/jni_headers/NoteServiceBridge_jni.h" -#include "components/content_creation/notes/android/jni_headers/NoteTemplateConversionBridge_jni.h" #include "components/content_creation/notes/android/note_template_conversion_bridge.h" #include "components/content_creation/notes/core/notes_types.h"
diff --git a/components/content_creation/notes/android/note_service_bridge.h b/components/content_creation/notes/android/note_service_bridge.h index 39fea09..6b9ac462 100644 --- a/components/content_creation/notes/android/note_service_bridge.h +++ b/components/content_creation/notes/android/note_service_bridge.h
@@ -18,7 +18,7 @@ class NoteServiceBridge : public base::SupportsUserData::Data { public: - static scopedJavaLocalFed<jobject> GetBridgeForNoteService( + static ScopedJavaLocalRef<jobject> GetBridgeForNoteService( NoteService* note_service); explicit NoteServiceBridge(NoteService* note_service);
diff --git a/components/content_creation/notes/android/note_template_conversion_bridge.cc b/components/content_creation/notes/android/note_template_conversion_bridge.cc index 442edc9..cedbe51 100644 --- a/components/content_creation/notes/android/note_template_conversion_bridge.cc +++ b/components/content_creation/notes/android/note_template_conversion_bridge.cc
@@ -17,9 +17,9 @@ ScopedJavaLocalRef<jobject> CreateJavaTemplateAndMaybeAddToList( JNIEnv* env, ScopedJavaLocalRef<jobject> jlist, - const NoteTemplate& template) { + const NoteTemplate& note_template) { return Java_NoteTemplateConversionBridge_createTemplateAndMaybeAddToList( - env, jlist, ConvertUTF8ToJavaString(template.localized_name)); + env, jlist, ConvertUTF8ToJavaString(env, note_template.localized_name)); } } // namespace @@ -28,12 +28,12 @@ ScopedJavaLocalRef<jobject> NoteTemplateConversionBridge::CreateJavaNoteTemplates( JNIEnv* env, - const std::vector<NoteTemplate>& templates) { + const std::vector<NoteTemplate>& note_templates) { ScopedJavaLocalRef<jobject> jlist = Java_NoteTemplateConversionBridge_createTemplateList(env); - for (const auto& template : templates) { - CreateJavaTemplateAndMaybeAddToList(env, jlist, templates); + for (const auto& note_template : note_templates) { + CreateJavaTemplateAndMaybeAddToList(env, jlist, note_template); } return jlist;
diff --git a/components/content_creation/notes/android/note_template_conversion_bridge.h b/components/content_creation/notes/android/note_template_conversion_bridge.h index d62c0d7..bdc020e 100644 --- a/components/content_creation/notes/android/note_template_conversion_bridge.h +++ b/components/content_creation/notes/android/note_template_conversion_bridge.h
@@ -6,7 +6,7 @@ #define COMPONENTS_CONTENT_CREATION_NOTES_ANDROID_NOTE_TEMPLATE_CONVERSION_BRIDGE_H_ #include "base/android/jni_android.h" -#include "components/content_creation/notes/notes_types.h" +#include "components/content_creation/notes/core/notes_types.h" using base::android::ScopedJavaLocalRef;
diff --git a/components/exo/fullscreen_shell_surface.cc b/components/exo/fullscreen_shell_surface.cc index 12d9d34..8a11409 100644 --- a/components/exo/fullscreen_shell_surface.cc +++ b/components/exo/fullscreen_shell_surface.cc
@@ -13,10 +13,10 @@ #include "ui/aura/window_observer.h" #include "ui/aura/window_occlusion_tracker.h" #include "ui/aura/window_targeter.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/compositor.h" #include "ui/views/accessibility/view_accessibility.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/window_util.h"
diff --git a/components/exo/text_input.cc b/components/exo/text_input.cc index 10c02ea4..8fcfac0f 100644 --- a/components/exo/text_input.cc +++ b/components/exo/text_input.cc
@@ -377,6 +377,26 @@ return false; } +base::Optional<ui::GrammarFragment> TextInput::GetGrammarFragment( + const gfx::Range& range) { + // TODO(https://crbug.com/1201454): Implement this method. + NOTIMPLEMENTED_LOG_ONCE(); + return base::nullopt; +} + +bool TextInput::ClearGrammarFragments(const gfx::Range& range) { + // TODO(https://crbug.com/1201454): Implement this method. + NOTIMPLEMENTED_LOG_ONCE(); + return false; +} + +bool TextInput::AddGrammarFragments( + const std::vector<ui::GrammarFragment>& fragments) { + // TODO(https://crbug.com/1201454): Implement this method. + NOTIMPLEMENTED_LOG_ONCE(); + return false; +} + void TextInput::OnKeyboardVisibilityChanged(bool is_visible) { delegate_->OnVirtualKeyboardVisibilityChanged(is_visible); }
diff --git a/components/exo/text_input.h b/components/exo/text_input.h index 2502bad..12d6b9c6 100644 --- a/components/exo/text_input.h +++ b/components/exo/text_input.h
@@ -146,6 +146,11 @@ gfx::Range GetAutocorrectRange() const override; gfx::Rect GetAutocorrectCharacterBounds() const override; bool SetAutocorrectRange(const gfx::Range& range) override; + base::Optional<ui::GrammarFragment> GetGrammarFragment( + const gfx::Range& range) override; + bool ClearGrammarFragments(const gfx::Range& range) override; + bool AddGrammarFragments( + const std::vector<ui::GrammarFragment>& fragments) override; // ash::KeyboardControllerObserver: void OnKeyboardVisibilityChanged(bool is_visible) override;
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc index f7156bfe..34a80e88 100644 --- a/components/exo/wayland/server.cc +++ b/components/exo/wayland/server.cc
@@ -200,9 +200,15 @@ bind_keyboard_configuration); wl_global_create(wl_display_.get(), &zcr_notification_shell_v1_interface, 1, display_, bind_notification_shell); + + remote_shell_data_ = std::make_unique<WaylandRemoteShellData>( + display_, + WaylandRemoteShellData::OutputResourceProvider(base::BindRepeating( + &Server::GetOutputResource, base::Unretained(this)))); wl_global_create(wl_display_.get(), &zcr_remote_shell_v1_interface, - zcr_remote_shell_v1_interface.version, display_, - bind_remote_shell); + zcr_remote_shell_v1_interface.version, + remote_shell_data_.get(), bind_remote_shell); + wl_global_create(wl_display_.get(), &zcr_stylus_tools_v1_interface, 1, display_, bind_stylus_tools); wl_global_create(wl_display_.get(),
diff --git a/components/exo/wayland/server.h b/components/exo/wayland/server.h index 62baedd7..5bec03a 100644 --- a/components/exo/wayland/server.h +++ b/components/exo/wayland/server.h
@@ -32,6 +32,7 @@ struct WaylandTextInputManager; struct WaylandXdgShell; struct WaylandZxdgShell; +struct WaylandRemoteShellData; // This class is a thin wrapper around a Wayland display server. All Wayland // requests are dispatched into the given Exosphere display. @@ -82,6 +83,7 @@ std::unique_ptr<WaylandTextInputManager> zwp_text_manager_data_; std::unique_ptr<WaylandZxdgShell> zxdg_shell_data_; std::unique_ptr<WaylandXdgShell> xdg_shell_data_; + std::unique_ptr<WaylandRemoteShellData> remote_shell_data_; #endif DISALLOW_COPY_AND_ASSIGN(Server);
diff --git a/components/exo/wayland/wayland_display_observer.cc b/components/exo/wayland/wayland_display_observer.cc index e15cb23..7655505 100644 --- a/components/exo/wayland/wayland_display_observer.cc +++ b/components/exo/wayland/wayland_display_observer.cc
@@ -55,6 +55,11 @@ } } +int64_t WaylandDisplayHandler::id() const { + DCHECK(output_); + return output_->id(); +} + void WaylandDisplayHandler::OnDisplayMetricsChanged( const display::Display& display, uint32_t changed_metrics) {
diff --git a/components/exo/wayland/wayland_display_observer.h b/components/exo/wayland/wayland_display_observer.h index 7ec87fb..bf7ecbc 100644 --- a/components/exo/wayland/wayland_display_observer.h +++ b/components/exo/wayland/wayland_display_observer.h
@@ -41,6 +41,7 @@ wl_resource* output_resource); ~WaylandDisplayHandler() override; void AddObserver(WaylandDisplayObserver* observer); + int64_t id() const; // Overridden from display::DisplayObserver: void OnDisplayMetricsChanged(const display::Display& display,
diff --git a/components/exo/wayland/zcr_remote_shell.cc b/components/exo/wayland/zcr_remote_shell.cc index a64372d..f0457d7 100644 --- a/components/exo/wayland/zcr_remote_shell.cc +++ b/components/exo/wayland/zcr_remote_shell.cc
@@ -662,6 +662,20 @@ GetUserDataAs<ClientControlledShellSurface>(resource)->SetResizeLock(false); } +void remote_surface_set_bounds_in_output(wl_client* client, + wl_resource* resource, + wl_resource* output_resource, + int32_t x, + int32_t y, + int32_t width, + int32_t height) { + WaylandDisplayHandler* display_handler = + GetUserDataAs<WaylandDisplayHandler>(output_resource); + // Bounds are set in pixels, and should not be scaled. + GetUserDataAs<ClientControlledShellSurface>(resource)->SetBounds( + display_handler->id(), gfx::Rect(x, y, width, height)); +} + const struct zcr_remote_surface_v1_interface remote_surface_implementation = { remote_surface_destroy, remote_surface_set_app_id, @@ -713,7 +727,9 @@ remote_surface_unset_pip_original_window, remote_surface_set_system_gesture_exclusion, remote_surface_set_resize_lock, - remote_surface_unset_resize_lock}; + remote_surface_unset_resize_lock, + remote_surface_set_bounds_in_output, +}; //////////////////////////////////////////////////////////////////////////////// // notification_surface_interface: @@ -752,9 +768,25 @@ gfx::Rect(x, y, width, height)); } +void input_method_surface_set_bounds_in_output(wl_client* client, + wl_resource* resource, + wl_resource* output_resource, + int32_t x, + int32_t y, + int32_t width, + int32_t height) { + WaylandDisplayHandler* display_handler = + GetUserDataAs<WaylandDisplayHandler>(output_resource); + GetUserDataAs<InputMethodSurface>(resource)->SetBounds( + display_handler->id(), gfx::Rect(x, y, width, height)); +} + const struct zcr_input_method_surface_v1_interface - input_method_surface_implementation = {input_method_surface_destroy, - input_method_surface_set_bounds}; + input_method_surface_implementation = { + input_method_surface_destroy, + input_method_surface_set_bounds, + input_method_surface_set_bounds_in_output, +}; //////////////////////////////////////////////////////////////////////////////// // toast_surface_interface: @@ -782,10 +814,24 @@ gfx::Size(width, height)); } +void toast_surface_set_bounds_in_output(wl_client* client, + wl_resource* resource, + wl_resource* output_resource, + int32_t x, + int32_t y, + int32_t width, + int32_t height) { + WaylandDisplayHandler* display_handler = + GetUserDataAs<WaylandDisplayHandler>(output_resource); + GetUserDataAs<ToastSurface>(resource)->SetBounds( + display_handler->id(), gfx::Rect(x, y, width, height)); +} + const struct zcr_toast_surface_v1_interface toast_surface_implementation = { toast_surface_destroy, toast_surface_set_position, toast_surface_set_size, + toast_surface_set_bounds_in_output, }; //////////////////////////////////////////////////////////////////////////////// @@ -887,8 +933,13 @@ class WaylandRemoteShell : public ash::TabletModeObserver, public display::DisplayObserver { public: - WaylandRemoteShell(Display* display, wl_resource* remote_shell_resource) - : display_(display), remote_shell_resource_(remote_shell_resource) { + using OutputResourceProvider = base::RepeatingCallback<wl_resource*(int64_t)>; + WaylandRemoteShell(Display* display, + wl_resource* remote_shell_resource, + OutputResourceProvider output_provider) + : display_(display), + remote_shell_resource_(remote_shell_resource), + output_provider_(output_provider) { WMHelperChromeOS* helper = WMHelperChromeOS::GetInstance(); helper->AddTabletModeObserver(this); display::Screen::GetScreen()->AddObserver(this); @@ -1298,6 +1349,13 @@ static_cast<uint32_t>(display_id), bounds_in_display.x(), bounds_in_display.y(), bounds_in_display.width(), bounds_in_display.height(), reason); + if (wl_resource_get_version(resource) >= + ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGED_IN_OUTPUT_SINCE_VERSION) { + zcr_remote_surface_v1_send_bounds_changed_in_output( + resource, output_provider_.Run(display_id), bounds_in_display.x(), + bounds_in_display.y(), bounds_in_display.width(), + bounds_in_display.height(), reason); + } } void OnRemoteSurfaceStateChanged(wl_resource* resource, @@ -1386,6 +1444,9 @@ // The remote shell resource associated with observer. wl_resource* const remote_shell_resource_; + // Callback to get the wl_output resource for a given display_id. + OutputResourceProvider const output_provider_; + // When true, the compositor should use the default_device_scale_factor to // undo the scaling on the client buffers. When false, the compositor should // use the device_scale_factor for the display for this scaling cancellation. @@ -1586,6 +1647,12 @@ } // namespace +WaylandRemoteShellData::WaylandRemoteShellData( + Display* display, + OutputResourceProvider output_provider) + : display(display), output_provider(output_provider) {} +WaylandRemoteShellData::~WaylandRemoteShellData() {} + void bind_remote_shell(wl_client* client, void* data, uint32_t version, @@ -1594,9 +1661,12 @@ client, &zcr_remote_shell_v1_interface, std::min<uint32_t>(version, zcr_remote_shell_v1_interface.version), id); - SetImplementation(resource, &remote_shell_implementation, - std::make_unique<WaylandRemoteShell>( - static_cast<Display*>(data), resource)); + auto* remote_shell_data = static_cast<WaylandRemoteShellData*>(data); + SetImplementation( + resource, &remote_shell_implementation, + std::make_unique<WaylandRemoteShell>( + remote_shell_data->display, resource, + base::BindRepeating(remote_shell_data->output_provider, client))); } gfx::Insets GetWorkAreaInsetsInPixel(const display::Display& display,
diff --git a/components/exo/wayland/zcr_remote_shell.h b/components/exo/wayland/zcr_remote_shell.h index dc8e3ed7..9ab8fc85 100644 --- a/components/exo/wayland/zcr_remote_shell.h +++ b/components/exo/wayland/zcr_remote_shell.h
@@ -7,7 +7,10 @@ #include <stdint.h> +#include "base/callback.h" + struct wl_client; +struct wl_resource; namespace gfx { class Rect; @@ -20,8 +23,28 @@ } namespace exo { + +class Display; + namespace wayland { +struct WaylandRemoteShellData { + using OutputResourceProvider = + base::RepeatingCallback<wl_resource*(wl_client*, int64_t)>; + + explicit WaylandRemoteShellData(Display* display, + OutputResourceProvider output_provider); + ~WaylandRemoteShellData(); + + // Owned by WaylandServerController, which always outlives this. + Display* const display; + + OutputResourceProvider const output_provider; + + WaylandRemoteShellData(const WaylandRemoteShellData&) = delete; + WaylandRemoteShellData& operator=(const WaylandRemoteShellData&) = delete; +}; + void bind_remote_shell(wl_client* client, void* data, uint32_t version,
diff --git a/components/feed/core/v2/BUILD.gn b/components/feed/core/v2/BUILD.gn index 997f4969..0203c3c 100644 --- a/components/feed/core/v2/BUILD.gn +++ b/components/feed/core/v2/BUILD.gn
@@ -25,8 +25,6 @@ "image_fetcher.h", "metrics_reporter.cc", "metrics_reporter.h", - "offline_page_spy.cc", - "offline_page_spy.h", "persistent_key_value_store_impl.cc", "persistent_key_value_store_impl.h", "prefs.cc", @@ -66,8 +64,6 @@ "surface_updater.h", "tasks/clear_all_task.cc", "tasks/clear_all_task.h", - "tasks/get_prefetch_suggestions_task.cc", - "tasks/get_prefetch_suggestions_task.h", "tasks/load_more_task.cc", "tasks/load_more_task.h", "tasks/load_stream_from_store_task.cc", @@ -103,8 +99,6 @@ "//components/feed/core/shared_prefs:feed_shared_prefs", "//components/history/core/browser", "//components/leveldb_proto:leveldb_proto", - "//components/offline_pages/core:core", - "//components/offline_pages/core/prefetch", "//components/offline_pages/task:task", "//components/prefs", "//components/signin/public/identity_manager", @@ -166,7 +160,6 @@ sources = [ "algorithm_unittest.cc", "api_test/feed_api_notice_card_unittest.cc", - "api_test/feed_api_offline_pages_unittest.cc", "api_test/feed_api_stream_unittest.cc", "api_test/feed_api_subscriptions_unittest.cc", "api_test/feed_api_test.cc", @@ -209,10 +202,7 @@ "//components/feed/core/shared_prefs:feed_shared_prefs", "//components/history/core/browser", "//components/leveldb_proto:test_support", - "//components/offline_pages/core:core", "//components/offline_pages/core:test_support", - "//components/offline_pages/core/prefetch", - "//components/offline_pages/core/prefetch:test_support", "//components/prefs:test_support", "//components/signin/public/identity_manager", "//components/signin/public/identity_manager:test_support",
diff --git a/components/feed/core/v2/api_test/feed_api_offline_pages_unittest.cc b/components/feed/core/v2/api_test/feed_api_offline_pages_unittest.cc deleted file mode 100644 index 9521ab3..0000000 --- a/components/feed/core/v2/api_test/feed_api_offline_pages_unittest.cc +++ /dev/null
@@ -1,205 +0,0 @@ -// Copyright 2020 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 "base/callback_helpers.h" -#include "base/test/metrics/histogram_tester.h" -#include "base/test/metrics/user_action_tester.h" -#include "components/feed/core/v2/api_test/feed_api_test.h" -#include "components/feed/core/v2/config.h" -#include "components/feed/core/v2/feed_stream.h" -#include "components/feed/core/v2/test/callback_receiver.h" -#include "components/offline_pages/core/client_namespace_constants.h" -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace feed { -namespace test { -namespace { - -TEST_F(FeedApiTest, ProvidesPrefetchSuggestionsWhenModelLoaded) { - // Setup by triggering a model load. - response_translator_.InjectResponse(MakeTypicalInitialModelState()); - TestForYouSurface surface(stream_.get()); - WaitForIdleTaskQueue(); - - // Because we loaded from the network, - // PrefetchService::NewSuggestionsAvailable() should have been called. - EXPECT_EQ(1, prefetch_service_.NewSuggestionsAvailableCallCount()); - - CallbackReceiver<std::vector<offline_pages::PrefetchSuggestion>> callback; - prefetch_service_.suggestions_provider()->GetCurrentArticleSuggestions( - callback.Bind()); - WaitForIdleTaskQueue(); - - ASSERT_TRUE(callback.GetResult()); - const std::vector<offline_pages::PrefetchSuggestion>& suggestions = - callback.GetResult().value(); - - ASSERT_EQ(2UL, suggestions.size()); - EXPECT_EQ("http://content0/", suggestions[0].article_url); - EXPECT_EQ("title0", suggestions[0].article_title); - EXPECT_EQ("publisher0", suggestions[0].article_attribution); - EXPECT_EQ("snippet0", suggestions[0].article_snippet); - EXPECT_EQ("http://image0/", suggestions[0].thumbnail_url); - EXPECT_EQ("http://favicon0/", suggestions[0].favicon_url); - - EXPECT_EQ("http://content1/", suggestions[1].article_url); -} - -TEST_F(FeedApiTest, ProvidesPrefetchSuggestionsWhenModelNotLoaded) { - store_->OverwriteStream(kForYouStream, MakeTypicalInitialModelState(), - base::DoNothing()); - - CallbackReceiver<std::vector<offline_pages::PrefetchSuggestion>> callback; - prefetch_service_.suggestions_provider()->GetCurrentArticleSuggestions( - callback.Bind()); - WaitForIdleTaskQueue(); - - ASSERT_FALSE(stream_->GetModel(kForYouStream)); - ASSERT_TRUE(callback.GetResult()); - const std::vector<offline_pages::PrefetchSuggestion>& suggestions = - callback.GetResult().value(); - - ASSERT_EQ(2UL, suggestions.size()); - EXPECT_EQ("http://content0/", suggestions[0].article_url); - EXPECT_EQ("http://content1/", suggestions[1].article_url); - EXPECT_EQ(0, prefetch_service_.NewSuggestionsAvailableCallCount()); -} - -TEST_F(FeedApiTest, ScrubsUrlsInProvidedPrefetchSuggestions) { - { - auto initial_state = MakeTypicalInitialModelState(); - initial_state->content[0].mutable_prefetch_metadata(0)->set_uri( - "?notavalidurl?"); - initial_state->content[0].mutable_prefetch_metadata(0)->set_image_url( - "?asdf?"); - initial_state->content[0].mutable_prefetch_metadata(0)->set_favicon_url( - "?hi?"); - initial_state->content[0].mutable_prefetch_metadata(0)->clear_uri(); - store_->OverwriteStream(kForYouStream, std::move(initial_state), - base::DoNothing()); - } - - CallbackReceiver<std::vector<offline_pages::PrefetchSuggestion>> callback; - prefetch_service_.suggestions_provider()->GetCurrentArticleSuggestions( - callback.Bind()); - WaitForIdleTaskQueue(); - - ASSERT_TRUE(callback.GetResult()); - const std::vector<offline_pages::PrefetchSuggestion>& suggestions = - callback.GetResult().value(); - - ASSERT_EQ(2UL, suggestions.size()); - EXPECT_EQ("", suggestions[0].article_url.possibly_invalid_spec()); - EXPECT_EQ("", suggestions[0].thumbnail_url.possibly_invalid_spec()); - EXPECT_EQ("", suggestions[0].favicon_url.possibly_invalid_spec()); -} - -TEST_F(FeedApiTest, OfflineBadgesArePopulatedInitially) { - // Add two offline pages. We exclude tab-bound pages, so only the first is - // used. - offline_page_model_.AddTestPage(GURL("http://content0/")); - offline_page_model_.AddTestPage(GURL("http://content1/")); - offline_page_model_.items()[1].client_id.name_space = - offline_pages::kLastNNamespace; - response_translator_.InjectResponse(MakeTypicalInitialModelState()); - TestForYouSurface surface(stream_.get()); - WaitForIdleTaskQueue(); - - EXPECT_EQ((std::map<std::string, std::string>( - {{"app/badge0", SerializedOfflineBadgeContent()}})), - surface.GetDataStoreEntries()); -} - -TEST_F(FeedApiTest, OfflineBadgesArePopulatedOnNewOfflineItemAdded) { - response_translator_.InjectResponse(MakeTypicalInitialModelState()); - TestForYouSurface surface(stream_.get()); - WaitForIdleTaskQueue(); - - ASSERT_EQ((std::map<std::string, std::string>({})), - surface.GetDataStoreEntries()); - - // Add an offline page. - offline_page_model_.AddTestPage(GURL("http://content1/")); - offline_page_model_.CallObserverOfflinePageAdded( - offline_page_model_.items()[0]); - task_environment_.FastForwardBy(base::TimeDelta::FromMilliseconds(1)); - - EXPECT_EQ((std::map<std::string, std::string>( - {{"app/badge1", SerializedOfflineBadgeContent()}})), - surface.GetDataStoreEntries()); -} - -TEST_F(FeedApiTest, OfflineBadgesAreRemovedWhenOfflineItemRemoved) { - offline_page_model_.AddTestPage(GURL("http://content0/")); - response_translator_.InjectResponse(MakeTypicalInitialModelState()); - TestForYouSurface surface(stream_.get()); - WaitForIdleTaskQueue(); - - ASSERT_EQ((std::map<std::string, std::string>( - {{"app/badge0", SerializedOfflineBadgeContent()}})), - surface.GetDataStoreEntries()); - - // Remove the offline page. - offline_page_model_.CallObserverOfflinePageDeleted( - offline_page_model_.items()[0]); - task_environment_.FastForwardBy(base::TimeDelta::FromMilliseconds(1)); - - EXPECT_EQ((std::map<std::string, std::string>()), - surface.GetDataStoreEntries()); -} - -TEST_F(FeedApiTest, OfflineBadgesAreProvidedToNewSurfaces) { - offline_page_model_.AddTestPage(GURL("http://content0/")); - response_translator_.InjectResponse(MakeTypicalInitialModelState()); - TestForYouSurface surface(stream_.get()); - WaitForIdleTaskQueue(); - - TestForYouSurface surface2(stream_.get()); - WaitForIdleTaskQueue(); - - EXPECT_EQ((std::map<std::string, std::string>( - {{"app/badge0", SerializedOfflineBadgeContent()}})), - surface2.GetDataStoreEntries()); -} - -TEST_F(FeedApiTest, OfflineBadgesAreRemovedWhenModelIsUnloaded) { - offline_page_model_.AddTestPage(GURL("http://content0/")); - response_translator_.InjectResponse(MakeTypicalInitialModelState()); - TestForYouSurface surface(stream_.get()); - WaitForIdleTaskQueue(); - - stream_->UnloadModel(surface.GetStreamType()); - - // Offline badge no longer present. - EXPECT_EQ((std::map<std::string, std::string>()), - surface.GetDataStoreEntries()); -} - -TEST_F(FeedApiTest, MultipleOfflineBadgesWithSameUrl) { - { - std::unique_ptr<StreamModelUpdateRequest> state = - MakeTypicalInitialModelState(); - const feedwire::PrefetchMetadata& prefetch_metadata1 = - state->content[0].prefetch_metadata(0); - feedwire::PrefetchMetadata& prefetch_metadata2 = - *state->content[0].add_prefetch_metadata(); - prefetch_metadata2 = prefetch_metadata1; - prefetch_metadata2.set_badge_id("app/badge0b"); - response_translator_.InjectResponse(std::move(state)); - } - offline_page_model_.AddTestPage(GURL("http://content0/")); - - TestForYouSurface surface(stream_.get()); - WaitForIdleTaskQueue(); - - EXPECT_EQ((std::map<std::string, std::string>( - {{"app/badge0", SerializedOfflineBadgeContent()}, - {"app/badge0b", SerializedOfflineBadgeContent()}})), - surface.GetDataStoreEntries()); -} - -} // namespace -} // namespace test -} // namespace feed
diff --git a/components/feed/core/v2/api_test/feed_api_stream_unittest.cc b/components/feed/core/v2/api_test/feed_api_stream_unittest.cc index e61fadab..944d913 100644 --- a/components/feed/core/v2/api_test/feed_api_stream_unittest.cc +++ b/components/feed/core/v2/api_test/feed_api_stream_unittest.cc
@@ -61,8 +61,6 @@ TestForYouSurface surface(stream_.get()); WaitForIdleTaskQueue(); EXPECT_EQ("loading -> 2 slices", surface.DescribeUpdates()); - // Verify that prefetch service was informed. - EXPECT_EQ(1, prefetch_service_.NewSuggestionsAvailableCallCount()); } TEST_F(FeedApiTest, WebFeedDoesNotBackgroundRefresh) { @@ -567,7 +565,6 @@ EXPECT_EQ(LoadStreamStatus::kProtoTranslationFailed, metrics_reporter_->load_stream_status); - EXPECT_EQ(0, prefetch_service_.NewSuggestionsAvailableCallCount()); } TEST_F(FeedApiTest, DoNotLoadFromNetworkWhenOffline) { is_offline_ = true; @@ -972,11 +969,6 @@ WaitForIdleTaskQueue(); ASSERT_EQ(base::Optional<bool>(true), callback.GetResult()); EXPECT_EQ("4 slices +spinner -> 6 slices", surface.DescribeUpdates()); - if (GetStreamType().IsForYou()) { - EXPECT_EQ(3, prefetch_service_.NewSuggestionsAvailableCallCount()); - } else { - EXPECT_EQ(0, prefetch_service_.NewSuggestionsAvailableCallCount()); - } } TEST_P(FeedStreamTestForAllStreamTypes, LoadMorePersistsData) { @@ -1189,7 +1181,6 @@ // The stream's user attributes are set, so activity logging is enabled. EXPECT_TRUE(stream_->IsActivityLoggingEnabled(kForYouStream)); - EXPECT_EQ(1, prefetch_service_.NewSuggestionsAvailableCallCount()); } TEST_F(FeedApiTest, ClearAllAfterLoadResultsInRefresh) {
diff --git a/components/feed/core/v2/api_test/feed_api_test.cc b/components/feed/core/v2/api_test/feed_api_test.cc index 579b2ad..a7d1deb 100644 --- a/components/feed/core/v2/api_test/feed_api_test.cc +++ b/components/feed/core/v2/api_test/feed_api_test.cc
@@ -36,7 +36,6 @@ #include "components/feed/core/v2/test/test_util.h" #include "components/feed/feed_feature_list.h" #include "components/leveldb_proto/public/proto_database_provider.h" -#include "components/offline_pages/core/client_namespace_constants.h" namespace feed { namespace test { @@ -582,66 +581,6 @@ MetricsReporter::OnUploadActions(status); } -TestPrefetchService::TestPrefetchService() = default; -TestPrefetchService::~TestPrefetchService() = default; -void TestPrefetchService::SetSuggestionProvider( - offline_pages::SuggestionsProvider* suggestions_provider) { - suggestions_provider_ = suggestions_provider; -} -void TestPrefetchService::NewSuggestionsAvailable() { - ++new_suggestions_available_call_count_; -} - -offline_pages::SuggestionsProvider* -TestPrefetchService::suggestions_provider() { - return suggestions_provider_; -} -int TestPrefetchService::NewSuggestionsAvailableCallCount() const { - return new_suggestions_available_call_count_; -} -TestOfflinePageModel::TestOfflinePageModel() = default; -TestOfflinePageModel::~TestOfflinePageModel() = default; -void TestOfflinePageModel::AddObserver(Observer* observer) { - CHECK(observers_.insert(observer).second); -} -void TestOfflinePageModel::RemoveObserver(Observer* observer) { - CHECK_EQ(1UL, observers_.erase(observer)); -} -void TestOfflinePageModel::GetPagesWithCriteria( - const offline_pages::PageCriteria& criteria, - offline_pages::MultipleOfflinePageItemCallback callback) { - std::vector<offline_pages::OfflinePageItem> result; - for (const offline_pages::OfflinePageItem& item : items_) { - if (MeetsCriteria(criteria, item)) { - result.push_back(item); - } - } - base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(std::move(callback), result)); -} - -void TestOfflinePageModel::AddTestPage(const GURL& url) { - offline_pages::OfflinePageItem item; - item.url = url; - item.client_id = - offline_pages::ClientId(offline_pages::kSuggestedArticlesNamespace, ""); - items_.push_back(item); -} - -void TestOfflinePageModel::CallObserverOfflinePageAdded( - const offline_pages::OfflinePageItem& item) { - for (Observer* observer : observers_) { - observer->OfflinePageAdded(this, item); - } -} - -void TestOfflinePageModel::CallObserverOfflinePageDeleted( - const offline_pages::OfflinePageItem& item) { - for (Observer* observer : observers_) { - observer->OfflinePageDeleted(item); - } -} - FeedApiTest::FeedApiTest() = default; FeedApiTest::~FeedApiTest() = default; void FeedApiTest::SetUp() { @@ -724,8 +663,7 @@ stream_ = std::make_unique<FeedStream>( &refresh_scheduler_, metrics_reporter_.get(), this, &profile_prefs_, &network_, image_fetcher_.get(), store_.get(), - persistent_key_value_store_.get(), &prefetch_service_, - &offline_page_model_, chrome_info); + persistent_key_value_store_.get(), chrome_info); stream_->SetWireResponseTranslatorForTesting(&response_translator_); if (wait_for_initialization)
diff --git a/components/feed/core/v2/api_test/feed_api_test.h b/components/feed/core/v2/api_test/feed_api_test.h index 6de270f..025e88acd 100644 --- a/components/feed/core/v2/api_test/feed_api_test.h +++ b/components/feed/core/v2/api_test/feed_api_test.h
@@ -32,8 +32,6 @@ #include "components/feed/core/v2/test/stream_builder.h" #include "components/feed/core/v2/test/test_util.h" #include "components/feed/core/v2/wire_response_translator.h" -#include "components/offline_pages/core/prefetch/stub_prefetch_service.h" -#include "components/offline_pages/core/stub_offline_page_model.h" #include "components/prefs/testing_pref_service.h" #include "services/network/test/test_url_loader_factory.h" #include "testing/gtest/include/gtest/gtest.h" @@ -342,48 +340,6 @@ base::Optional<UploadActionsStatus> upload_action_status; }; -class TestPrefetchService : public offline_pages::StubPrefetchService { - public: - TestPrefetchService(); - ~TestPrefetchService() override; - // offline_pages::StubPrefetchService. - void SetSuggestionProvider( - offline_pages::SuggestionsProvider* suggestions_provider) override; - void NewSuggestionsAvailable() override; - - // Test functionality. - offline_pages::SuggestionsProvider* suggestions_provider(); - int NewSuggestionsAvailableCallCount() const; - - private: - offline_pages::SuggestionsProvider* suggestions_provider_ = nullptr; - int new_suggestions_available_call_count_ = 0; -}; - -class TestOfflinePageModel : public offline_pages::StubOfflinePageModel { - public: - TestOfflinePageModel(); - ~TestOfflinePageModel() override; - // offline_pages::OfflinePageModel - void AddObserver(Observer* observer) override; - void RemoveObserver(Observer* observer) override; - void GetPagesWithCriteria( - const offline_pages::PageCriteria& criteria, - offline_pages::MultipleOfflinePageItemCallback callback) override; - - // Test functions. - - void AddTestPage(const GURL& url); - std::vector<offline_pages::OfflinePageItem>& items() { return items_; } - void CallObserverOfflinePageAdded(const offline_pages::OfflinePageItem& item); - void CallObserverOfflinePageDeleted( - const offline_pages::OfflinePageItem& item); - - private: - std::vector<offline_pages::OfflinePageItem> items_; - std::set<Observer*> observers_; -}; - class FeedApiTest : public testing::Test, public FeedStream::Delegate { public: FeedApiTest(); @@ -443,8 +399,6 @@ task_environment_.GetMainThreadTaskRunner())); FakeRefreshTaskScheduler refresh_scheduler_; - TestPrefetchService prefetch_service_; - TestOfflinePageModel offline_page_model_; std::unique_ptr<FeedStream> stream_; bool is_eula_accepted_ = true; bool is_offline_ = false;
diff --git a/components/feed/core/v2/feed_stream.cc b/components/feed/core/v2/feed_stream.cc index fe74fbd8..507d15dd 100644 --- a/components/feed/core/v2/feed_stream.cc +++ b/components/feed/core/v2/feed_stream.cc
@@ -28,7 +28,6 @@ #include "components/feed/core/v2/feedstore_util.h" #include "components/feed/core/v2/image_fetcher.h" #include "components/feed/core/v2/metrics_reporter.h" -#include "components/feed/core/v2/offline_page_spy.h" #include "components/feed/core/v2/prefs.h" #include "components/feed/core/v2/protocol_translator.h" #include "components/feed/core/v2/public/feed_api.h" @@ -42,7 +41,6 @@ #include "components/feed/core/v2/stream_model.h" #include "components/feed/core/v2/surface_updater.h" #include "components/feed/core/v2/tasks/clear_all_task.h" -#include "components/feed/core/v2/tasks/get_prefetch_suggestions_task.h" #include "components/feed/core/v2/tasks/load_stream_task.h" #include "components/feed/core/v2/tasks/prefetch_images_task.h" #include "components/feed/core/v2/tasks/upload_actions_task.h" @@ -50,7 +48,6 @@ #include "components/feed/core/v2/web_feed_subscription_coordinator.h" #include "components/feed/core/v2/web_feed_subscriptions/web_feed_index.h" #include "components/feed/feed_feature_list.h" -#include "components/offline_pages/core/prefetch/prefetch_service.h" #include "components/offline_pages/task/closure_task.h" #include "components/prefs/pref_service.h" @@ -90,28 +87,6 @@ } // namespace -// offline_pages::SuggestionsProvider. -class FeedStream::OfflineSuggestionsProvider - : public offline_pages::SuggestionsProvider { - public: - explicit OfflineSuggestionsProvider(FeedStream* stream) : stream_(stream) {} - virtual ~OfflineSuggestionsProvider() = default; - OfflineSuggestionsProvider(const OfflineSuggestionsProvider&) = delete; - OfflineSuggestionsProvider& operator=(const OfflineSuggestionsProvider&) = - delete; - void GetCurrentArticleSuggestions( - SuggestionCallback suggestions_callback) override { - stream_->GetPrefetchSuggestions(std::move(suggestions_callback)); - } - - // These signals aren't used for v2. - void ReportArticleListViewed() override {} - void ReportArticleViewed(GURL article_url) override {} - - private: - FeedStream* stream_; -}; - FeedStream::Stream::Stream() = default; FeedStream::Stream::~Stream() = default; @@ -123,11 +98,8 @@ ImageFetcher* image_fetcher, FeedStore* feed_store, PersistentKeyValueStoreImpl* persistent_key_value_store, - offline_pages::PrefetchService* prefetch_service, - offline_pages::OfflinePageModel* offline_page_model, const ChromeInfo& chrome_info) - : prefetch_service_(prefetch_service), - refresh_task_scheduler_(refresh_task_scheduler), + : refresh_task_scheduler_(refresh_task_scheduler), metrics_reporter_(metrics_reporter), delegate_(delegate), profile_prefs_(profile_prefs), @@ -145,16 +117,6 @@ web_feed_subscription_coordinator_ = std::make_unique<WebFeedSubscriptionCoordinator>(profile_prefs, this); - Stream& stream = GetStream(kForYouStream); - offline_page_spy_ = std::make_unique<OfflinePageSpy>( - stream.surface_updater.get(), offline_page_model); - - if (prefetch_service_) { - offline_suggestions_provider_ = - std::make_unique<OfflineSuggestionsProvider>(this); - prefetch_service_->SetSuggestionProvider( - offline_suggestions_provider_.get()); - } // Inserting this task first ensures that |store_| is initialized before // it is used. @@ -487,8 +449,6 @@ for (auto& callback : moved_callbacks) { std::move(callback).Run(success); } - - MaybeReportNewSuggestionsAvailable(result); } void FeedStream::ExecuteOperations( @@ -572,13 +532,6 @@ PopulateDebugStreamData(result, *profile_prefs_); } -void FeedStream::GetPrefetchSuggestions( - base::OnceCallback<void(std::vector<offline_pages::PrefetchSuggestion>)> - suggestions_callback) { - task_queue_.AddTask(std::make_unique<GetPrefetchSuggestionsTask>( - this, std::move(suggestions_callback))); -} - DebugStreamData FeedStream::GetDebugStreamData() { return ::feed::prefs::GetDebugStreamData(*profile_prefs_); } @@ -917,7 +870,6 @@ } MaybeNotifyHasUnreadContent(result.stream_type); - MaybeReportNewSuggestionsAvailable(result); } bool FeedStream::HasUnreadContent(const StreamType& stream_type) { @@ -927,22 +879,6 @@ stream.last_updated_time; } -void FeedStream::MaybeReportNewSuggestionsAvailable( - const LoadStreamTask::Result& result) { - if (result.loaded_new_content_from_network && prefetch_service_ && - result.stream_type.IsForYou()) { - prefetch_service_->NewSuggestionsAvailable(); - } -} - -void FeedStream::MaybeReportNewSuggestionsAvailable( - const LoadMoreTask::Result& result) { - if (result.loaded_new_content_from_network && prefetch_service_ && - result.stream_type.IsForYou()) { - prefetch_service_->NewSuggestionsAvailable(); - } -} - void FeedStream::ClearAll() { metrics_reporter_->OnClearAll(base::Time::Now() - GetLastFetchTime()); clear_all_in_progress_ = true; @@ -1004,9 +940,6 @@ stream.model->SetStoreObserver(this); stream.last_updated_time = stream.model->GetLastAddedTime(); stream.surface_updater->SetModel(stream.model.get()); - if (stream.type.IsForYou()) { - offline_page_spy_->SetModel(stream.model.get()); - } ScheduleModelUnloadIfNoSurfacesAttached(stream_type); MaybeNotifyHasUnreadContent(stream_type); } @@ -1039,9 +972,6 @@ Stream* stream = FindStream(stream_type); if (!stream || !stream->model) return; - if (stream_type.IsForYou()) { - offline_page_spy_->SetModel(nullptr); - } stream->surface_updater->SetModel(nullptr); stream->model.reset(); }
diff --git a/components/feed/core/v2/feed_stream.h b/components/feed/core/v2/feed_stream.h index 3465489a..bdee17d 100644 --- a/components/feed/core/v2/feed_stream.h +++ b/components/feed/core/v2/feed_stream.h
@@ -31,16 +31,10 @@ #include "components/feed/core/v2/web_feed_subscription_coordinator.h" #include "components/feed/core/v2/web_feed_subscriptions/web_feed_index.h" #include "components/feed/core/v2/wire_response_translator.h" -#include "components/offline_pages/core/prefetch/suggestions_provider.h" #include "components/offline_pages/task/task_queue.h" class PrefService; -namespace offline_pages { -class OfflinePageModel; -class PrefetchService; -} // namespace offline_pages - namespace feed { namespace feed_stream { class UnreadContentNotifier; @@ -50,7 +44,6 @@ class WebFeedSubscriptionCoordinator; class ImageFetcher; class MetricsReporter; -class OfflinePageSpy; class RefreshTaskScheduler; class PersistentKeyValueStoreImpl; class StreamModel; @@ -86,8 +79,6 @@ ImageFetcher* image_fetcher, FeedStore* feed_store, PersistentKeyValueStoreImpl* persistent_key_value_store, - offline_pages::PrefetchService* prefetch_service, - offline_pages::OfflinePageModel* offline_page_model, const ChromeInfo& chrome_info); ~FeedStream() override; @@ -281,7 +272,6 @@ } private: - class OfflineSuggestionsProvider; using UnreadContentNotifier = feed_stream::UnreadContentNotifier; struct Stream { @@ -317,10 +307,6 @@ // Re-evaluate whether or not activity logging should currently be enabled. void UpdateIsActivityLoggingEnabled(const StreamType& stream_type); - void GetPrefetchSuggestions( - base::OnceCallback<void(std::vector<offline_pages::PrefetchSuggestion>)> - suggestions_callback); - // A single function task to delete stored feed data and force a refresh. // To only be called from within a |Task|. void ForceRefreshForDebuggingTask(); @@ -335,8 +321,6 @@ void BackgroundRefreshComplete(LoadStreamTask::Result result); void LoadTaskComplete(const LoadStreamTask::Result& result); void UploadActionsComplete(UploadActionsTask::Result result); - void MaybeReportNewSuggestionsAvailable(const LoadStreamTask::Result& result); - void MaybeReportNewSuggestionsAvailable(const LoadMoreTask::Result& result); void ClearAll(); @@ -355,7 +339,6 @@ // Unowned. - offline_pages::PrefetchService* prefetch_service_; RefreshTaskScheduler* refresh_task_scheduler_; MetricsReporter* metrics_reporter_; Delegate* delegate_; @@ -372,8 +355,6 @@ std::map<StreamType, Stream> streams_; - std::unique_ptr<OfflineSuggestionsProvider> offline_suggestions_provider_; - std::unique_ptr<OfflinePageSpy> offline_page_spy_; std::unique_ptr<WebFeedSubscriptionCoordinator> web_feed_subscription_coordinator_;
diff --git a/components/feed/core/v2/offline_page_spy.cc b/components/feed/core/v2/offline_page_spy.cc deleted file mode 100644 index 391bb13f..0000000 --- a/components/feed/core/v2/offline_page_spy.cc +++ /dev/null
@@ -1,172 +0,0 @@ -// Copyright 2020 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 "components/feed/core/v2/offline_page_spy.h" - -#include <algorithm> -#include <tuple> -#include <utility> - -#include "base/bind.h" -#include "base/containers/flat_set.h" -#include "components/feed/core/v2/algorithm.h" -#include "components/feed/core/v2/surface_updater.h" - -namespace feed { - -namespace { - -std::vector<OfflinePageSpy::BadgeInfo> GetBadgesInStream( - StreamModel* stream_model) { - std::vector<OfflinePageSpy::BadgeInfo> badges; - for (ContentRevision content_rev : stream_model->GetContentList()) { - const feedstore::Content* content = stream_model->FindContent(content_rev); - if (!content) - continue; - for (const feedwire::PrefetchMetadata& prefetch_metadata : - content->prefetch_metadata()) { - const std::string& badge_id = prefetch_metadata.badge_id(); - if (badge_id.empty()) - continue; - GURL url(prefetch_metadata.uri()); - if (url.is_empty() || !url.is_valid()) - continue; - - badges.emplace_back(url, badge_id); - } - } - return badges; -} - -base::flat_set<GURL> OfflineItemsToUrlSet( - const std::vector<offline_pages::OfflinePageItem>& items) { - std::vector<GURL> url_list; - for (const auto& item : items) { - url_list.push_back(item.GetOriginalUrl()); - } - return url_list; -} - -} // namespace - -OfflinePageSpy::BadgeInfo::BadgeInfo() = default; -OfflinePageSpy::BadgeInfo::BadgeInfo(const GURL& url, - const std::string& badge_id) - : url(url), badge_id(badge_id) {} - -bool OfflinePageSpy::BadgeInfo::operator<(const BadgeInfo& rhs) const { - return std::tie(url, badge_id) < std::tie(rhs.url, rhs.badge_id); -} - -OfflinePageSpy::OfflinePageSpy( - SurfaceUpdater* surface_updater, - offline_pages::OfflinePageModel* offline_page_model) - : surface_updater_(surface_updater), - offline_page_model_(offline_page_model) { - offline_page_model_->AddObserver(this); -} - -OfflinePageSpy::~OfflinePageSpy() { - offline_page_model_->RemoveObserver(this); -} - -void OfflinePageSpy::SetModel(StreamModel* stream_model) { - if (stream_model_) { - stream_model_->RemoveObserver(this); - stream_model_ = nullptr; - } - if (stream_model) { - stream_model_ = stream_model; - stream_model_->AddObserver(this); - UpdateWatchedPages(); - } else { - for (const BadgeInfo& badge : badges_) { - if (badge.available_offline) { - surface_updater_->SetOfflinePageAvailability(badge.badge_id, false); - } - } - badges_.clear(); - } -} - -void OfflinePageSpy::SetAvailability(const base::flat_set<GURL>& urls, - bool available) { - for (BadgeInfo& badge : badges_) { - if (badge.available_offline != available && urls.contains(badge.url)) { - badge.available_offline = available; - surface_updater_->SetOfflinePageAvailability(badge.badge_id, available); - } - } -} - -void OfflinePageSpy::GetPagesDone( - const std::vector<offline_pages::OfflinePageItem>& items) { - SetAvailability(OfflineItemsToUrlSet(items), true); -} - -void OfflinePageSpy::OfflinePageAdded( - offline_pages::OfflinePageModel* model, - const offline_pages::OfflinePageItem& added_page) { - SetAvailability({added_page.GetOriginalUrl()}, true); -} - -void OfflinePageSpy::OfflinePageDeleted( - const offline_pages::OfflinePageItem& deleted_page) { - SetAvailability({deleted_page.GetOriginalUrl()}, false); -} - -void OfflinePageSpy::OnUiUpdate(const StreamModel::UiUpdate& update) { - DCHECK(stream_model_); - if (update.content_list_changed) - UpdateWatchedPages(); -} - -void OfflinePageSpy::UpdateWatchedPages() { - std::vector<BadgeInfo> badges = GetBadgesInStream(stream_model_); - - // Both lists need to be sorted. |badges_| should already be sorted. - std::sort(badges.begin(), badges.end()); - DCHECK(std::is_sorted(badges_.begin(), badges_.end())); - - // Compare new and old lists. We need to inform SurfaceUpdater of removed - // badges, and collect new URLs. - std::vector<GURL> new_urls; - auto differ = [&](BadgeInfo* new_badge, BadgeInfo* old_badge) { - if (!old_badge) { // Added a page. - new_urls.push_back(new_badge->url); - return; - } - if (!new_badge) { // Removed a page. - surface_updater_->SetOfflinePageAvailability(old_badge->badge_id, false); - return; - } - // Page remains, update |badges|. - new_badge->available_offline = old_badge->available_offline; - }; - - DiffSortedRange(badges.begin(), badges.end(), badges_.begin(), badges_.end(), - differ); - - badges_ = std::move(badges); - RequestOfflinePageStatus(std::move(new_urls)); -} - -void OfflinePageSpy::RequestOfflinePageStatus(std::vector<GURL> new_urls) { - if (new_urls.empty()) - return; - - offline_pages::PageCriteria criteria; - criteria.exclude_tab_bound_pages = true; - criteria.additional_criteria = base::BindRepeating( - [](const base::flat_set<GURL>& url_set, - const offline_pages::OfflinePageItem& item) { - return url_set.count(item.GetOriginalUrl()) > 0; - }, - std::move(new_urls)); - - offline_page_model_->GetPagesWithCriteria( - criteria, base::BindOnce(&OfflinePageSpy::GetPagesDone, GetWeakPtr())); -} - -} // namespace feed
diff --git a/components/feed/core/v2/offline_page_spy.h b/components/feed/core/v2/offline_page_spy.h deleted file mode 100644 index ae5539b..0000000 --- a/components/feed/core/v2/offline_page_spy.h +++ /dev/null
@@ -1,81 +0,0 @@ -// Copyright 2020 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 COMPONENTS_FEED_CORE_V2_OFFLINE_PAGE_SPY_H_ -#define COMPONENTS_FEED_CORE_V2_OFFLINE_PAGE_SPY_H_ - -#include <string> -#include <vector> - -#include "base/containers/flat_set.h" -#include "base/memory/weak_ptr.h" -#include "components/feed/core/v2/stream_model.h" -#include "components/offline_pages/core/offline_page_model.h" -#include "url/gurl.h" - -namespace feed { -class SurfaceUpdater; - -// Watches for availability of offline pages for pages linked on the Feed. -// Offline page availability is sent to -// |SurfaceUpdater::SetOfflinePageAvailability()|. -class OfflinePageSpy : public offline_pages::OfflinePageModel::Observer, - public feed::StreamModel::Observer { - public: - struct BadgeInfo { - BadgeInfo(); - BadgeInfo(const GURL& url, const std::string& badge_id); - // For sorting by (url, badge_id). - bool operator<(const BadgeInfo& rhs) const; - GURL url; - std::string badge_id; - // Initially, this is false until we receive information that indicates - // otherwise. - bool available_offline = false; - }; - - OfflinePageSpy(SurfaceUpdater* surface_updater, - offline_pages::OfflinePageModel* offline_page_model); - ~OfflinePageSpy() override; - OfflinePageSpy(const OfflinePageSpy&) = delete; - OfflinePageSpy& operator=(const OfflinePageSpy&) = delete; - - void SetModel(StreamModel* stream_model); - - private: - // offline_pages::OfflinePageModel::Observer - void OfflinePageAdded( - offline_pages::OfflinePageModel* model, - const offline_pages::OfflinePageItem& added_page) override; - void OfflinePageDeleted( - const offline_pages::OfflinePageItem& deleted_page) override; - void OfflinePageModelLoaded(offline_pages::OfflinePageModel* model) override { - } - - // StreamModel::Observer - void OnUiUpdate(const StreamModel::UiUpdate& update) override; - - void SetAvailability(const base::flat_set<GURL>& urls, bool available); - void GetPagesDone(const std::vector<offline_pages::OfflinePageItem>& items); - void UpdateWatchedPages(); - void RequestOfflinePageStatus(std::vector<GURL> new_urls); - - base::WeakPtr<OfflinePageSpy> GetWeakPtr() { - return weak_ptr_factory_.GetWeakPtr(); - } - - SurfaceUpdater* surface_updater_; // unowned - offline_pages::OfflinePageModel* offline_page_model_; // unowned - // Null when the model is not loaded. - StreamModel* stream_model_ = nullptr; // unowned - - // A list of offline badges for all content in the stream. - std::vector<BadgeInfo> badges_; - - base::WeakPtrFactory<OfflinePageSpy> weak_ptr_factory_{this}; -}; - -} // namespace feed - -#endif // COMPONENTS_FEED_CORE_V2_OFFLINE_PAGE_SPY_H_
diff --git a/components/feed/core/v2/public/feed_service.cc b/components/feed/core/v2/public/feed_service.cc index 112d55ed..40f8186 100644 --- a/components/feed/core/v2/public/feed_service.cc +++ b/components/feed/core/v2/public/feed_service.cc
@@ -209,8 +209,6 @@ key_value_store_database, signin::IdentityManager* identity_manager, history::HistoryService* history_service, - offline_pages::PrefetchService* prefetch_service, - offline_pages::OfflinePageModel* offline_page_model, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, scoped_refptr<base::SequencedTaskRunner> background_task_runner, const std::string& api_key, @@ -234,7 +232,7 @@ refresh_task_scheduler_.get(), metrics_reporter_.get(), stream_delegate_.get(), profile_prefs, feed_network_.get(), image_fetcher_.get(), store_.get(), persistent_key_value_store_.get(), - prefetch_service, offline_page_model, chrome_info); + chrome_info); history_observer_ = std::make_unique<HistoryObserverImpl>( history_service, static_cast<FeedStream*>(stream_.get()),
diff --git a/components/feed/core/v2/public/feed_service.h b/components/feed/core/v2/public/feed_service.h index b50403cd..8d1090d 100644 --- a/components/feed/core/v2/public/feed_service.h +++ b/components/feed/core/v2/public/feed_service.h
@@ -37,10 +37,6 @@ namespace network { class SharedURLLoaderFactory; } // namespace network -namespace offline_pages { -class OfflinePageModel; -class PrefetchService; -} // namespace offline_pages namespace signin { class IdentityManager; } // namespace signin @@ -94,8 +90,6 @@ key_value_store_database, signin::IdentityManager* identity_manager, history::HistoryService* history_service, - offline_pages::PrefetchService* prefetch_service, - offline_pages::OfflinePageModel* offline_page_model, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, scoped_refptr<base::SequencedTaskRunner> background_task_runner, const std::string& api_key,
diff --git a/components/feed/core/v2/tasks/get_prefetch_suggestions_task.cc b/components/feed/core/v2/tasks/get_prefetch_suggestions_task.cc deleted file mode 100644 index 67aa0de..0000000 --- a/components/feed/core/v2/tasks/get_prefetch_suggestions_task.cc +++ /dev/null
@@ -1,111 +0,0 @@ -// Copyright 2020 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 "components/feed/core/v2/tasks/get_prefetch_suggestions_task.h" - -#include <utility> - -#include "base/callback.h" -#include "base/callback_helpers.h" -#include "base/logging.h" -#include "components/feed/core/proto/v2/wire/stream_structure.pb.h" -#include "components/feed/core/v2/feed_store.h" -#include "components/feed/core/v2/feed_stream.h" -#include "components/feed/core/v2/stream_model.h" -#include "components/feed/core/v2/tasks/load_stream_from_store_task.h" - -namespace feed { -namespace { - -// Converts a URL string into a GURL. If the string is not a valid URL, returns -// an empty GURL. Since GURL::spec() asserts on invalid URLs, this is necessary -// to scrub the incoming data from the wire. -GURL SpecToGURL(const std::string& url_string) { - GURL url(url_string); - if (!url.is_valid()) - url = GURL(); - return url; -} - -offline_pages::PrefetchSuggestion ConvertToSuggestion( - const feedwire::PrefetchMetadata& metadata) { - offline_pages::PrefetchSuggestion result; - result.article_url = SpecToGURL(metadata.uri()); - result.article_title = metadata.title(); - result.article_attribution = metadata.publisher(); - result.article_snippet = metadata.snippet(); - result.thumbnail_url = SpecToGURL(metadata.image_url()); - result.favicon_url = SpecToGURL(metadata.favicon_url()); - return result; -} - -} // namespace - -GetPrefetchSuggestionsTask::GetPrefetchSuggestionsTask( - FeedStream* stream, - base::OnceCallback<void(std::vector<offline_pages::PrefetchSuggestion>)> - result_callback) - : stream_(stream), result_callback_(std::move(result_callback)) {} - -GetPrefetchSuggestionsTask::~GetPrefetchSuggestionsTask() = default; - -void GetPrefetchSuggestionsTask::Run() { - if (stream_->ClearAllInProgress()) { - // Abort and return an empty list. - std::move(result_callback_).Run({}); - TaskComplete(); - return; - } - - if (stream_->GetModel(kForYouStream)) { - PullSuggestionsFromModel(*stream_->GetModel(kForYouStream)); - return; - } - - load_from_store_task_ = std::make_unique<LoadStreamFromStoreTask>( - LoadStreamFromStoreTask::LoadType::kFullLoad, stream_, kForYouStream, - stream_->GetStore(), - /*missed_last_refresh=*/false, - base::BindOnce(&GetPrefetchSuggestionsTask::LoadStreamComplete, - base::Unretained(this))); - - load_from_store_task_->Execute(base::DoNothing()); -} - -void GetPrefetchSuggestionsTask::LoadStreamComplete( - LoadStreamFromStoreTask::Result result) { - if (!result.update_request) { - // Give up and return an empty list. - std::move(result_callback_).Run({}); - TaskComplete(); - return; - } - - // It is a bit dangerous to retain the model loaded here. The normal - // LoadStreamTask flow has various considerations for metrics and signalling - // surfaces to update. For this reason, we're not going to retain the loaded - // model for use outside of this task. - StreamModel model; - model.Update(std::move(result.update_request)); - PullSuggestionsFromModel(model); -} - -void GetPrefetchSuggestionsTask::PullSuggestionsFromModel( - const StreamModel& model) { - std::vector<offline_pages::PrefetchSuggestion> suggestions; - for (ContentRevision rev : model.GetContentList()) { - const feedstore::Content* content = model.FindContent(rev); - if (!content) - continue; - for (const feedwire::PrefetchMetadata& metadata : - content->prefetch_metadata()) { - suggestions.push_back(ConvertToSuggestion(metadata)); - } - } - - std::move(result_callback_).Run(std::move(suggestions)); - TaskComplete(); -} - -} // namespace feed
diff --git a/components/feed/core/v2/tasks/get_prefetch_suggestions_task.h b/components/feed/core/v2/tasks/get_prefetch_suggestions_task.h deleted file mode 100644 index 1e4d3b6..0000000 --- a/components/feed/core/v2/tasks/get_prefetch_suggestions_task.h +++ /dev/null
@@ -1,57 +0,0 @@ -// Copyright 2020 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 COMPONENTS_FEED_CORE_V2_TASKS_GET_PREFETCH_SUGGESTIONS_TASK_H_ -#define COMPONENTS_FEED_CORE_V2_TASKS_GET_PREFETCH_SUGGESTIONS_TASK_H_ - -#include <memory> -#include <vector> - -#include "base/memory/weak_ptr.h" -#include "components/feed/core/v2/tasks/load_stream_from_store_task.h" -#include "components/offline_pages/task/task.h" - -namespace offline_pages { -struct PrefetchSuggestion; -} - -namespace feed { -class FeedStream; -class StreamModel; - -// Get the list of prefetch suggestions. -class GetPrefetchSuggestionsTask : public offline_pages::Task { - public: - explicit GetPrefetchSuggestionsTask( - FeedStream* stream, - base::OnceCallback<void(std::vector<offline_pages::PrefetchSuggestion>)> - result_callback); - ~GetPrefetchSuggestionsTask() override; - GetPrefetchSuggestionsTask(const GetPrefetchSuggestionsTask&) = delete; - GetPrefetchSuggestionsTask& operator=(const GetPrefetchSuggestionsTask&) = - delete; - - private: - base::WeakPtr<GetPrefetchSuggestionsTask> GetWeakPtr() { - return weak_ptr_factory_.GetWeakPtr(); - } - - // offline_pages::Task. - void Run() override; - - void LoadStreamComplete(LoadStreamFromStoreTask::Result result); - - void PullSuggestionsFromModel(const StreamModel& model); - - FeedStream* stream_; - base::OnceCallback<void(std::vector<offline_pages::PrefetchSuggestion>)> - result_callback_; - - std::unique_ptr<LoadStreamFromStoreTask> load_from_store_task_; - - base::WeakPtrFactory<GetPrefetchSuggestionsTask> weak_ptr_factory_{this}; -}; -} // namespace feed - -#endif // COMPONENTS_FEED_CORE_V2_TASKS_GET_PREFETCH_SUGGESTIONS_TASK_H_
diff --git a/components/fullscreen_control/fullscreen_control_view.cc b/components/fullscreen_control/fullscreen_control_view.cc index 0d6037c1..45efcd03 100644 --- a/components/fullscreen_control/fullscreen_control_view.cc +++ b/components/fullscreen_control/fullscreen_control_view.cc
@@ -12,6 +12,8 @@ #include "components/vector_icons/vector_icons.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/point_f.h" @@ -21,8 +23,6 @@ #include "ui/views/controls/button/button.h" #include "ui/views/controls/image_view.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/vector_icons.h" namespace {
diff --git a/components/fullscreen_control/fullscreen_control_view.h b/components/fullscreen_control/fullscreen_control_view.h index 7889958b..21cf9a5b 100644 --- a/components/fullscreen_control/fullscreen_control_view.h +++ b/components/fullscreen_control/fullscreen_control_view.h
@@ -6,8 +6,8 @@ #define COMPONENTS_FULLSCREEN_CONTROL_FULLSCREEN_CONTROL_VIEW_H_ #include "base/callback.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" // FullscreenControlView shows a FAB (floating action button from the material
diff --git a/components/fullscreen_control/subtle_notification_view.cc b/components/fullscreen_control/subtle_notification_view.cc index bfb147f..4643b35f 100644 --- a/components/fullscreen_control/subtle_notification_view.cc +++ b/components/fullscreen_control/subtle_notification_view.cc
@@ -11,14 +11,14 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/font_list.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/widget/widget.h"
diff --git a/components/fullscreen_control/subtle_notification_view.h b/components/fullscreen_control/subtle_notification_view.h index b5d4365..4bfb7fa 100644 --- a/components/fullscreen_control/subtle_notification_view.h +++ b/components/fullscreen_control/subtle_notification_view.h
@@ -8,8 +8,8 @@ #include <memory> #include <string> +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/native_widget_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace views {
diff --git a/components/guest_view/browser/guest_view_manager.cc b/components/guest_view/browser/guest_view_manager.cc index 8c49510..789421b 100644 --- a/components/guest_view/browser/guest_view_manager.cc +++ b/components/guest_view/browser/guest_view_manager.cc
@@ -520,8 +520,7 @@ GuestViewManager::ElementInstanceKey::ElementInstanceKey() : embedder_process_id(content::ChildProcessHost::kInvalidUniqueID), - element_instance_id(content::ChildProcessHost::kInvalidUniqueID) { -} + element_instance_id(kInstanceIDNone) {} GuestViewManager::ElementInstanceKey::ElementInstanceKey( int embedder_process_id,
diff --git a/components/invalidation/impl/fake_invalidation_handler.cc b/components/invalidation/impl/fake_invalidation_handler.cc index 1181b361..eb9f68b8 100644 --- a/components/invalidation/impl/fake_invalidation_handler.cc +++ b/components/invalidation/impl/fake_invalidation_handler.cc
@@ -31,6 +31,10 @@ return invalidation_count_; } +const std::string& FakeInvalidationHandler::GetInvalidatorClientId() const { + return client_id_; +} + void FakeInvalidationHandler::OnInvalidatorStateChange(InvalidatorState state) { state_ = state; } @@ -49,4 +53,9 @@ return topic == "PREFERENCE"; } +void FakeInvalidationHandler::OnInvalidatorClientIdChange( + const std::string& client_id) { + client_id_ = client_id; +} + } // namespace invalidation
diff --git a/components/invalidation/impl/fake_invalidation_handler.h b/components/invalidation/impl/fake_invalidation_handler.h index cf4ed98..001abd2c 100644 --- a/components/invalidation/impl/fake_invalidation_handler.h +++ b/components/invalidation/impl/fake_invalidation_handler.h
@@ -24,6 +24,7 @@ InvalidatorState GetInvalidatorState() const; const TopicInvalidationMap& GetLastInvalidationMap() const; int GetInvalidationCount() const; + const std::string& GetInvalidatorClientId() const; // InvalidationHandler implementation. void OnInvalidatorStateChange(InvalidatorState state) override; @@ -31,12 +32,14 @@ const TopicInvalidationMap& invalidation_map) override; std::string GetOwnerName() const override; bool IsPublicTopic(const Topic& topic) const override; + void OnInvalidatorClientIdChange(const std::string& client_id) override; private: InvalidatorState state_; TopicInvalidationMap last_invalidation_map_; int invalidation_count_; std::string owner_name_; + std::string client_id_; }; } // namespace invalidation
diff --git a/components/invalidation/impl/fcm_invalidation_service_base.cc b/components/invalidation/impl/fcm_invalidation_service_base.cc index 381126c..c5626d0 100644 --- a/components/invalidation/impl/fcm_invalidation_service_base.cc +++ b/components/invalidation/impl/fcm_invalidation_service_base.cc
@@ -235,13 +235,27 @@ void FCMInvalidationServiceBase::PopulateClientID() { diagnostic_info_.instance_id_requested = base::Time::Now(); + if (sender_id_ == kInvalidationGCMSenderId) { MigratePrefs(pref_service_, sender_id_); } + + // Retrieve any client ID (aka Instance ID) from a previous run, which was + // cached in prefs. const std::string* client_id_pref = pref_service_->GetDictionary(prefs::kInvalidationClientIDCache) ->FindStringKey(sender_id_); client_id_ = client_id_pref ? *client_id_pref : ""; + + // There might already be clients (handlers) registered, so tell them about + // the client ID. + invalidator_registrar_.UpdateInvalidatorInstanceId(client_id_); + + // Also retrieve a fresh (or validated) client ID. If the |client_id_| just + // retrieved from prefs is non-empty, then the fresh/validated one will + // typically be equal to it, but it's not completely guaranteed. OTOH, if + // |client_id_| is empty, i.e. we didn't have one previously, then this will + // generate/retrieve a new one. instance_id::InstanceID* instance_id = instance_id_driver_->GetInstanceID(GetApplicationName()); instance_id->GetID(
diff --git a/components/invalidation/impl/fcm_invalidation_service_base.h b/components/invalidation/impl/fcm_invalidation_service_base.h index 69249cc..3e7c0d4a 100644 --- a/components/invalidation/impl/fcm_invalidation_service_base.h +++ b/components/invalidation/impl/fcm_invalidation_service_base.h
@@ -50,7 +50,7 @@ per_user_topic_subscription_manager_callback, instance_id::InstanceIDDriver* instance_id_driver, PrefService* pref_service, - const std::string& sender_id = {}); + const std::string& sender_id); FCMInvalidationServiceBase(const FCMInvalidationServiceBase& other) = delete; FCMInvalidationServiceBase& operator=( const FCMInvalidationServiceBase& other) = delete;
diff --git a/components/invalidation/impl/fcm_invalidation_service_unittest.cc b/components/invalidation/impl/fcm_invalidation_service_unittest.cc index 79fc695..110bdee 100644 --- a/components/invalidation/impl/fcm_invalidation_service_unittest.cc +++ b/components/invalidation/impl/fcm_invalidation_service_unittest.cc
@@ -13,12 +13,14 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" +#include "base/strings/strcat.h" #include "base/test/task_environment.h" #include "base/values.h" #include "components/gcm_driver/fake_gcm_driver.h" #include "components/gcm_driver/gcm_driver.h" #include "components/gcm_driver/instance_id/instance_id.h" #include "components/gcm_driver/instance_id/instance_id_driver.h" +#include "components/invalidation/impl/fake_invalidation_handler.h" #include "components/invalidation/impl/fcm_invalidation_listener.h" #include "components/invalidation/impl/fcm_network_handler.h" #include "components/invalidation/impl/fcm_sync_network_channel.h" @@ -27,6 +29,7 @@ #include "components/invalidation/impl/profile_identity_provider.h" #include "components/invalidation/public/topic_invalidation_map.h" #include "components/prefs/pref_registry_simple.h" +#include "components/prefs/scoped_user_pref_update.h" #include "components/prefs/testing_pref_service.h" #include "components/signin/public/identity_manager/identity_test_environment.h" #include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h" @@ -75,6 +78,7 @@ } // namespace const char kApplicationName[] = "com.google.chrome.fcm.invalidations"; +const char kSenderId[] = "invalidations-sender-id"; class MockInstanceID : public InstanceID { public: @@ -140,7 +144,8 @@ mock_instance_id_driver_ = std::make_unique<testing::NiceMock<MockInstanceIDDriver>>(); mock_instance_id_ = std::make_unique<testing::NiceMock<MockInstanceID>>(); - ON_CALL(*mock_instance_id_driver_, GetInstanceID(kApplicationName)) + ON_CALL(*mock_instance_id_driver_, + GetInstanceID(base::StrCat({kApplicationName, "-", kSenderId}))) .WillByDefault(testing::Return(mock_instance_id_.get())); ON_CALL(*mock_instance_id_, GetID(_)) .WillByDefault(testing::WithArg<0>( @@ -155,7 +160,7 @@ base::BindRepeating(&PerUserTopicSubscriptionManager::Create, identity_provider_.get(), &pref_service_, &url_loader_factory_), - mock_instance_id_driver_.get(), &pref_service_); + mock_instance_id_driver_.get(), &pref_service_, kSenderId); } void InitializeInvalidationService() { @@ -199,6 +204,62 @@ InvalidationServiceTest, FCMInvalidationServiceTestDelegate); +TEST(FCMInvalidationServiceTest, NotifiesAboutInstanceID) { + auto delegate = std::make_unique<FCMInvalidationServiceTestDelegate>(); + + // Set up a cached InstanceID aka client ID stored in prefs. + { + DictionaryPrefUpdate update(&delegate->pref_service_, + prefs::kInvalidationClientIDCache); + update->SetStringKey(kSenderId, "InstanceIDFromPrefs"); + } + + // Create the invalidation service, but do not initialize it yet. + delegate->CreateUninitializedInvalidationService(); + FCMInvalidationService* invalidation_service = + delegate->GetInvalidationService(); + ASSERT_TRUE(invalidation_service->GetInvalidatorClientId().empty()); + + // Register a handler *before* initializing the invalidation service. + FakeInvalidationHandler handler; + invalidation_service->RegisterInvalidationHandler(&handler); + + // Because the invalidation service hasn't been initialized, the client ID is + // still empty. + EXPECT_TRUE(handler.GetInvalidatorClientId().empty()); + + // Make sure the MockInstanceID doesn't immediately provide a fresh client ID. + InstanceID::GetIDCallback get_id_callback; + EXPECT_CALL(*delegate->mock_instance_id_, GetID(_)) + .WillOnce([&](InstanceID::GetIDCallback callback) { + get_id_callback = std::move(callback); + }); + + // Initialize the service. It should read the client ID from prefs. + delegate->InitializeInvalidationService(); + // The invalidation service has requested a fresh client ID. + ASSERT_FALSE(get_id_callback.is_null()); + + // The invalidation service should have restored the client ID from prefs, and + // passed it on to the handler. + EXPECT_EQ(handler.GetInvalidatorClientId(), "InstanceIDFromPrefs"); + + // Once the invalidation service receives a fresh client ID, it should notify + // the handler again. (Note that in practice, the fresh ID will almost always + // be identical to the cached one.) + std::move(get_id_callback).Run("FreshInstanceID"); + EXPECT_EQ(handler.GetInvalidatorClientId(), "FreshInstanceID"); + + // Another handler that gets registered should immediately be informed of the + // client ID. + FakeInvalidationHandler handler2; + invalidation_service->RegisterInvalidationHandler(&handler2); + EXPECT_EQ(handler2.GetInvalidatorClientId(), "FreshInstanceID"); + + invalidation_service->UnregisterInvalidationHandler(&handler2); + invalidation_service->UnregisterInvalidationHandler(&handler); +} + TEST(FCMInvalidationServiceTest, ClearsInstanceIDOnSignout) { // Set up an invalidation service and make sure it generated a client ID (aka // InstanceID).
diff --git a/components/live_caption/views/caption_bubble.cc b/components/live_caption/views/caption_bubble.cc index bbe98e99..8a764aa 100644 --- a/components/live_caption/views/caption_bubble.cc +++ b/components/live_caption/views/caption_bubble.cc
@@ -19,8 +19,10 @@ #include "third_party/re2/src/re2/re2.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/buildflags.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/vector2d.h" @@ -39,10 +41,21 @@ #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" #include "ui/views/layout/layout_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h" +// The CaptionBubbleLabel needs to be focusable in order for NVDA to enable +// document navigation. It is suspected that other screen readers on Windows and +// Linux will need this behavior, too. VoiceOver and ChromeVox do not need the +// label to be focusable. +#if BUILDFLAG_INTERNAL_HAS_NATIVE_ACCESSIBILITY() && !defined(OS_MAC) +#define NEED_FOCUS_FOR_ACCESSIBILITY +#endif + +#if defined(NEED_FOCUS_FOR_ACCESSIBILITY) +#include "ui/accessibility/platform/ax_platform_node.h" +#endif + namespace { // Formatting constants @@ -195,6 +208,8 @@ BEGIN_METADATA(CaptionBubbleFrameView, views::BubbleFrameView) END_METADATA +class CaptionBubbleLabelAXModeObserver; + // CaptionBubble implementation of Label. This class takes care of setting up // the accessible virtual views of the label in order to support braille // accessibility. The CaptionBubbleLabel is a readonly document with a paragraph @@ -205,8 +220,15 @@ class CaptionBubbleLabel : public views::Label { public: METADATA_HEADER(CaptionBubbleLabel); +#if defined(NEED_FOCUS_FOR_ACCESSIBILITY) + CaptionBubbleLabel() { + ax_mode_observer_ = + std::make_unique<CaptionBubbleLabelAXModeObserver>(this); + SetFocusBehaviorForAccessibility(); + } +#else CaptionBubbleLabel() = default; - +#endif ~CaptionBubbleLabel() override = default; CaptionBubbleLabel(const CaptionBubbleLabel&) = delete; CaptionBubbleLabel& operator=(const CaptionBubbleLabel&) = delete; @@ -216,10 +238,15 @@ // `ViewAccessibility::IsValidRoleForViews` for more information) but we // make an exception here. The CaptionBubbleLabel is designed to be // interacted with by a braille display in virtual buffer mode. In order to - // activate the virtual buffer in NVDA, we set the top-level virtual view in - // CaptionBubbleLabel to be a readonly document. + // activate the virtual buffer in NVDA, we set the CaptionBubbleLabel to be + // a readonly document. node_data->role = ax::mojom::Role::kDocument; node_data->SetRestriction(ax::mojom::Restriction::kReadOnly); +#if defined(NEED_FOCUS_FOR_ACCESSIBILITY) + // Focusable nodes generally must have a name, but the purpose of focusing + // this document is to let the user read the static text nodes inside. + node_data->SetNameFrom(ax::mojom::NameFrom::kAttributeExplicitlyEmpty); +#endif } void SetText(const std::u16string& text) override { @@ -253,6 +280,20 @@ } } +#if defined(NEED_FOCUS_FOR_ACCESSIBILITY) + // The CaptionBubbleLabel needs to be focusable in order for NVDA to enable + // document navigation. Making the CaptionBubbleLabel focusable means it gets + // a tabstop, so it should only be focusable for screen reader users. + void SetFocusBehaviorForAccessibility() { + if (ui::AXPlatformNode::GetAccessibilityMode().has_mode( + ui::AXMode::kScreenReader)) { + SetFocusBehavior(FocusBehavior::ALWAYS); + } else { + SetFocusBehavior(FocusBehavior::NEVER); + } + } +#endif + private: void UpdateAXLine(const std::u16string& line_text, const size_t line_index, @@ -279,11 +320,47 @@ ax::mojom::Event::kTextChanged); } } + +#if defined(NEED_FOCUS_FOR_ACCESSIBILITY) + std::unique_ptr<CaptionBubbleLabelAXModeObserver> ax_mode_observer_; +#endif }; BEGIN_METADATA(CaptionBubbleLabel, views::Label) END_METADATA +#if defined(NEED_FOCUS_FOR_ACCESSIBILITY) +// A helper class to the CaptionBubbleLabel which observes AXMode changes and +// updates the CaptionBubbleLabel focus behavior in response. +// TODO(crbug.com/1191091): Implement a ui::AXModeObserver::OnAXModeRemoved +// method which observes the removal of AXModes. Without that, the caption +// bubble label will remain focusable once accessibility is enabled, even if +// accessibility is later disabled. +class CaptionBubbleLabelAXModeObserver : public ui::AXModeObserver { + public: + explicit CaptionBubbleLabelAXModeObserver(CaptionBubbleLabel* owner) + : owner_(owner) { + ui::AXPlatformNode::AddAXModeObserver(this); + } + + ~CaptionBubbleLabelAXModeObserver() override { + ui::AXPlatformNode::RemoveAXModeObserver(this); + } + + CaptionBubbleLabelAXModeObserver(const CaptionBubbleLabelAXModeObserver&) = + delete; + CaptionBubbleLabelAXModeObserver& operator=( + const CaptionBubbleLabelAXModeObserver&) = delete; + + void OnAXModeAdded(ui::AXMode mode) override { + owner_->SetFocusBehaviorForAccessibility(); + } + + private: + CaptionBubbleLabel* owner_; +}; +#endif + CaptionBubble::CaptionBubble(base::OnceClosure destroyed_callback, bool hide_on_inactivity) : destroyed_callback_(std::move(destroyed_callback)),
diff --git a/components/live_caption/views/caption_bubble.h b/components/live_caption/views/caption_bubble.h index ac8288f..1248099 100644 --- a/components/live_caption/views/caption_bubble.h +++ b/components/live_caption/views/caption_bubble.h
@@ -11,10 +11,10 @@ #include "base/callback_helpers.h" #include "components/live_caption/views/caption_bubble_model.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/native_theme/caption_style.h" #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace base {
diff --git a/components/media_message_center/media_controls_progress_view.cc b/components/media_message_center/media_controls_progress_view.cc index 0925128..f502ccc 100644 --- a/components/media_message_center/media_controls_progress_view.cc +++ b/components/media_message_center/media_controls_progress_view.cc
@@ -6,6 +6,7 @@ #include "base/i18n/time_formatting.h" #include "services/media_session/public/mojom/media_session.mojom.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/font_list.h" #include "ui/views/border.h" @@ -14,7 +15,6 @@ #include "ui/views/layout/box_layout.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace media_message_center {
diff --git a/components/media_message_center/media_controls_progress_view.h b/components/media_message_center/media_controls_progress_view.h index 1fb22d3c..5bf699b 100644 --- a/components/media_message_center/media_controls_progress_view.h +++ b/components/media_message_center/media_controls_progress_view.h
@@ -6,7 +6,7 @@ #define COMPONENTS_MEDIA_MESSAGE_CENTER_MEDIA_CONTROLS_PROGRESS_VIEW_H_ #include "base/timer/timer.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/view.h" namespace media_session {
diff --git a/components/media_message_center/media_notification_view_impl.cc b/components/media_message_center/media_notification_view_impl.cc index fb7a317..3a06d01d 100644 --- a/components/media_message_center/media_notification_view_impl.cc +++ b/components/media_message_center/media_notification_view_impl.cc
@@ -18,6 +18,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/font.h" #include "ui/gfx/font_list.h" #include "ui/gfx/paint_vector_icon.h" @@ -26,7 +27,6 @@ #include "ui/views/controls/button/image_button_factory.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view_class_properties.h"
diff --git a/components/media_message_center/media_notification_view_impl.h b/components/media_message_center/media_notification_view_impl.h index e758301..3e648b4 100644 --- a/components/media_message_center/media_notification_view_impl.h +++ b/components/media_message_center/media_notification_view_impl.h
@@ -10,9 +10,9 @@ #include "base/optional.h" #include "components/media_message_center/media_notification_view.h" #include "services/media_session/public/mojom/media_session.mojom.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace message_center { class NotificationHeaderView;
diff --git a/components/media_message_center/media_notification_view_modern_impl.cc b/components/media_message_center/media_notification_view_modern_impl.cc index 73fd195..fb4e71c 100644 --- a/components/media_message_center/media_notification_view_modern_impl.cc +++ b/components/media_message_center/media_notification_view_modern_impl.cc
@@ -19,6 +19,8 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/font.h" @@ -29,8 +31,6 @@ #include "ui/views/border.h" #include "ui/views/controls/button/image_button_factory.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view_class_properties.h"
diff --git a/components/media_message_center/media_notification_view_modern_impl.h b/components/media_message_center/media_notification_view_modern_impl.h index 7f00509..126e89a 100644 --- a/components/media_message_center/media_notification_view_modern_impl.h +++ b/components/media_message_center/media_notification_view_modern_impl.h
@@ -12,10 +12,10 @@ #include "base/optional.h" #include "components/media_message_center/media_notification_view.h" #include "services/media_session/public/mojom/media_session.mojom.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class Button;
diff --git a/components/offline_pages/core/BUILD.gn b/components/offline_pages/core/BUILD.gn index e674e792..f686e93 100644 --- a/components/offline_pages/core/BUILD.gn +++ b/components/offline_pages/core/BUILD.gn
@@ -166,7 +166,6 @@ "model/visuals_availability_task_unittest.cc", "offline_event_logger_unittest.cc", "offline_page_client_policy_unittest.cc", - "offline_page_feature_unittest.cc", "offline_page_item_utils_unittest.cc", "offline_page_metadata_store_unittest.cc", "offline_page_model_event_logger_unittest.cc",
diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/offline_pages/core/offline_page_feature.cc index f60cabb..b582556 100644 --- a/components/offline_pages/core/offline_page_feature.cc +++ b/components/offline_pages/core/offline_page_feature.cc
@@ -47,9 +47,6 @@ const base::Feature kOfflinePagesCTSuppressNotificationsFeature{ "OfflinePagesCTSuppressNotifications", base::FEATURE_DISABLED_BY_DEFAULT}; -const base::Feature kOfflinePagesShowAlternateDinoPageFeature{ - "OfflinePagesShowAlternateDinoPage", base::FEATURE_DISABLED_BY_DEFAULT}; - const base::Feature kOfflineIndicatorFeature{"OfflineIndicator", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -103,11 +100,6 @@ kOfflinePagesCTSuppressNotificationsFeature); } -bool ShouldShowAlternateDinoPage() { - return base::FeatureList::IsEnabled( - kOfflinePagesShowAlternateDinoPageFeature); -} - std::string GetPrefetchingOfflinePagesExperimentTag() { return base::GetFieldTrialParamValueByFeature( kPrefetchingOfflinePagesFeature,
diff --git a/components/offline_pages/core/offline_page_feature.h b/components/offline_pages/core/offline_page_feature.h index 23b170c..53d8dd67 100644 --- a/components/offline_pages/core/offline_page_feature.h +++ b/components/offline_pages/core/offline_page_feature.h
@@ -20,7 +20,6 @@ extern const base::Feature kOfflinePagesInDownloadHomeOpenInCctFeature; extern const base::Feature kOfflinePagesDescriptiveFailStatusFeature; extern const base::Feature kOfflinePagesCTSuppressNotificationsFeature; -extern const base::Feature kOfflinePagesShowAlternateDinoPageFeature; extern const base::Feature kOfflineIndicatorFeature; extern const base::Feature kOnTheFlyMhtmlHashComputationFeature; extern const base::Feature kOfflinePagesNetworkStateLikelyUnknown;
diff --git a/components/offline_pages/core/offline_page_feature_unittest.cc b/components/offline_pages/core/offline_page_feature_unittest.cc deleted file mode 100644 index 35362d268..0000000 --- a/components/offline_pages/core/offline_page_feature_unittest.cc +++ /dev/null
@@ -1,88 +0,0 @@ -// Copyright 2017 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 "components/offline_pages/core/offline_page_feature.h" - -#include "base/feature_list.h" -#include "base/test/scoped_feature_list.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace offline_pages { - -TEST(OfflinePageFeatureTest, OffliningRecentPages) { - // Enabled by default. - EXPECT_TRUE(offline_pages::IsOffliningRecentPagesEnabled()); - - // Check if helper method works correctly when the features is disabled. - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndDisableFeature(kOffliningRecentPagesFeature); - EXPECT_FALSE(offline_pages::IsOffliningRecentPagesEnabled()); -} - -TEST(OfflinePageFeatureTest, OfflinePagesLivePageSharing) { - // Disabled by default. - EXPECT_FALSE( - base::FeatureList::IsEnabled(kOfflinePagesLivePageSharingFeature)); - - // Check if helper method works correctly when the feature is disabled. - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature(kOfflinePagesLivePageSharingFeature); - EXPECT_TRUE(offline_pages::IsOfflinePagesLivePageSharingEnabled()); -} - -TEST(OfflinePageFeatureTest, OfflinePagesPrefetching) { - // Enabled by default. - EXPECT_TRUE(offline_pages::IsPrefetchingOfflinePagesEnabled()); - - // Check if helper method works correctly when the features is disabled. - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndDisableFeature(kPrefetchingOfflinePagesFeature); - EXPECT_FALSE(offline_pages::IsPrefetchingOfflinePagesEnabled()); -} - -TEST(OfflinePageFeatureTest, OfflinePagesInDownloadHomeOpenInCct) { - // Enabled by default. - EXPECT_TRUE(offline_pages::ShouldOfflinePagesInDownloadHomeOpenInCct()); - - // Check if helper method works correctly when the features is disabled. - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndDisableFeature( - kOfflinePagesInDownloadHomeOpenInCctFeature); - EXPECT_FALSE(offline_pages::ShouldOfflinePagesInDownloadHomeOpenInCct()); -} - -TEST(OfflinePageFeatureTest, OfflinePagesDescriptiveFailStatus) { - // Disabled by default. - EXPECT_FALSE(offline_pages::IsOfflinePagesDescriptiveFailStatusEnabled()); - - // Check if helper method works correctly when the features is enabled. - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature( - kOfflinePagesDescriptiveFailStatusFeature); - EXPECT_TRUE(offline_pages::IsOfflinePagesDescriptiveFailStatusEnabled()); -} - -TEST(OfflinePageFeatureTest, OfflinePagesDescriptivePendingStatus) { - // Enabled by default. - EXPECT_TRUE(offline_pages::IsOfflinePagesDescriptivePendingStatusEnabled()); - - // Check if helper method works correctly when the features is enabled. - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndDisableFeature( - kOfflinePagesDescriptivePendingStatusFeature); - EXPECT_FALSE(offline_pages::IsOfflinePagesDescriptivePendingStatusEnabled()); -} - -TEST(OfflinePageFeatureTest, AlternateDinoPage) { - // Disabled by default. - EXPECT_FALSE(offline_pages::ShouldShowAlternateDinoPage()); - - // Check if helper method works correctly when the features is enabled. - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature( - kOfflinePagesShowAlternateDinoPageFeature); - EXPECT_TRUE(offline_pages::ShouldShowAlternateDinoPage()); -} - -} // namespace offline_pages
diff --git a/components/offline_pages/core/request_header/offline_page_header.cc b/components/offline_pages/core/request_header/offline_page_header.cc index cfe925e..ae5f120e 100644 --- a/components/offline_pages/core/request_header/offline_page_header.cc +++ b/components/offline_pages/core/request_header/offline_page_header.cc
@@ -37,16 +37,17 @@ if (header_value.empty()) return false; + // TODO(dcheng): Use net::HttpUtil::NameValuePairsIterator instead? bool token_found = false; base::StringTokenizer tokenizer(header_value, ", "); while (tokenizer.GetNext()) { token_found = true; - std::string pair = tokenizer.token(); + base::StringPiece pair = tokenizer.token_piece(); std::size_t pos = pair.find('='); if (pos == std::string::npos) return false; std::string key = base::ToLowerASCII(pair.substr(0, pos)); - std::string value = pair.substr(pos + 1); + base::StringPiece value = pair.substr(pos + 1); std::string lower_value = base::ToLowerASCII(value); if (key == kOfflinePageHeaderPersistKey) { if (lower_value == "1") @@ -77,7 +78,7 @@ else return false; } else if (key == kOfflinePageHeaderIDKey) { - *id = value; + *id = std::string(value); } else if (key == kOfflinePageHeaderIntentUrlKey) { std::string decoded_url; if (!base::Base64Decode(value, &decoded_url))
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc index 69879ff..c162ff5 100644 --- a/components/omnibox/browser/autocomplete_controller.cc +++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -573,10 +573,10 @@ // add for every provider. } - if (OmniboxFieldTrial::IsPedalSuggestionsEnabled()) { - // OmniboxPedalProvider is not a "true" AutocompleteProvider and isn't - // included in the list of providers, though needs to report information for - // its field trial. Manually call AddProviderInfo for pedals. + // OmniboxPedalProvider is not a "true" AutocompleteProvider and isn't + // included in the list of providers, though needs to report information for + // its field trial. Manually call AddProviderInfo for pedals. + if (provider_client_->GetPedalProvider()) { provider_client_->GetPedalProvider()->AddProviderInfo( &logs->providers_info); } @@ -593,9 +593,9 @@ provider->ResetSession(); } - if (OmniboxFieldTrial::IsPedalSuggestionsEnabled()) { - // OmniboxPedalProvider is not included in the list of providers as it's not - // a "true" AutocompleteProvider. Manually call ResetSession() for pedals. + // OmniboxPedalProvider is not included in the list of providers as it's not + // a "true" AutocompleteProvider. Manually call ResetSession() for pedals. + if (provider_client_->GetPedalProvider()) { provider_client_->GetPedalProvider()->ResetSession(); } @@ -714,9 +714,7 @@ } result_.SortAndCull(input_, template_url_service_, preserve_default_match); - if (OmniboxFieldTrial::IsPedalSuggestionsEnabled()) { - result_.AttachPedalsToMatches(input_, *provider_client_); - } + result_.AttachPedalsToMatches(input_, *provider_client_); // Need to validate before invoking CopyOldMatches as the old matches are not // valid against the current input.
diff --git a/components/omnibox/browser/autocomplete_result.cc b/components/omnibox/browser/autocomplete_result.cc index 9075e68..5038063 100644 --- a/components/omnibox/browser/autocomplete_result.cc +++ b/components/omnibox/browser/autocomplete_result.cc
@@ -449,6 +449,10 @@ const AutocompleteInput& input, const AutocompleteProviderClient& client) { OmniboxPedalProvider* provider = client.GetPedalProvider(); + if (!provider) { + return; + } + // Used to ensure we keep only one Pedal of each kind. std::unordered_set<OmniboxPedal*> pedals_found;
diff --git a/components/omnibox/browser/autocomplete_result_unittest.cc b/components/omnibox/browser/autocomplete_result_unittest.cc index 8e18f2f..e8b45e7 100644 --- a/components/omnibox/browser/autocomplete_result_unittest.cc +++ b/components/omnibox/browser/autocomplete_result_unittest.cc
@@ -1925,11 +1925,6 @@ } TEST_F(AutocompleteResultTest, AttachesPedals) { - base::test::ScopedFeatureList feature_list; - feature_list.InitWithFeatures( - {omnibox::kOmniboxPedalSuggestions, omnibox::kOmniboxSuggestionButtonRow}, - {}); - EXPECT_TRUE(OmniboxFieldTrial::IsPedalSuggestionsEnabled()); FakeAutocompleteProviderClient client; EXPECT_NE(nullptr, client.GetPedalProvider());
diff --git a/components/omnibox/browser/omnibox_edit_model.cc b/components/omnibox/browser/omnibox_edit_model.cc index 40a336b9..d698c1e 100644 --- a/components/omnibox/browser/omnibox_edit_model.cc +++ b/components/omnibox/browser/omnibox_edit_model.cc
@@ -767,14 +767,6 @@ } } - // Matches with |pedal| may be opened normally or executed, but when a match - // is a dedicated Pedal suggestion, it should always be executed. This only - // happens when the button row feature is disabled. - if (match.pedal && !OmniboxFieldTrial::IsSuggestionButtonRowEnabled()) { - ExecutePedal(match, match_selection_timestamp); - return; - } - std::u16string input_text(pasted_text); if (input_text.empty()) input_text = user_input_in_progress_ ? user_text_ : url_for_editing_;
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc index 5e4d0fc..dfe921d8 100644 --- a/components/omnibox/browser/omnibox_field_trial.cc +++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -641,19 +641,10 @@ kShortBookmarkSuggestionsByTotalInputLengthThresholdParam, 3); } -bool OmniboxFieldTrial::IsSuggestionButtonRowEnabled() { - return base::FeatureList::IsEnabled(omnibox::kOmniboxSuggestionButtonRow); -} - bool OmniboxFieldTrial::IsTabSwitchSuggestionsEnabled() { return base::FeatureList::IsEnabled(omnibox::kOmniboxTabSwitchSuggestions); } -bool OmniboxFieldTrial::IsPedalSuggestionsEnabled() { - return base::FeatureList::IsEnabled(omnibox::kOmniboxSuggestionButtonRow) && - base::FeatureList::IsEnabled(omnibox::kOmniboxPedalSuggestions); -} - bool OmniboxFieldTrial::IsPedalsBatch2Enabled() { return base::FeatureList::IsEnabled(omnibox::kOmniboxPedalsBatch2); } @@ -664,8 +655,7 @@ } bool OmniboxFieldTrial::IsKeywordSearchButtonEnabled() { - return base::FeatureList::IsEnabled(omnibox::kOmniboxSuggestionButtonRow) && - base::FeatureList::IsEnabled(omnibox::kOmniboxKeywordSearchButton); + return base::FeatureList::IsEnabled(omnibox::kOmniboxKeywordSearchButton); } bool OmniboxFieldTrial::IsExperimentalKeywordModeEnabled() {
diff --git a/components/omnibox/browser/omnibox_field_trial.h b/components/omnibox/browser/omnibox_field_trial.h index 449aace..7de7411 100644 --- a/components/omnibox/browser/omnibox_field_trial.h +++ b/components/omnibox/browser/omnibox_field_trial.h
@@ -364,16 +364,9 @@ // Returns the minimum input length to enable prefix matches. size_t ShortBookmarkSuggestionsByTotalInputLengthThreshold(); -// Whether a single row of buttons is shown on suggestions with actionable -// elements like keywords, tab-switch buttons, and Pedals. -bool IsSuggestionButtonRowEnabled(); - // Returns true if the tab switch suggestions flag is enabled. bool IsTabSwitchSuggestionsEnabled(); -// Returns true if the Pedals and suggestion button row features are enabled. -bool IsPedalSuggestionsEnabled(); - // Returns true if the second batch of Pedals is enabled. bool IsPedalsBatch2Enabled();
diff --git a/components/omnibox/browser/omnibox_pedal_provider.cc b/components/omnibox/browser/omnibox_pedal_provider.cc index 2ee6868..9c868d6 100644 --- a/components/omnibox/browser/omnibox_pedal_provider.cc +++ b/components/omnibox/browser/omnibox_pedal_provider.cc
@@ -137,14 +137,6 @@ field_trial_triggered_ = true; field_trial_triggered_in_session_ = true; - // Some users may be in a counterfactual study arm in which the pedal button - // is not attached to the suggestion, even though it triggered. - if (base::GetFieldTrialParamByFeatureAsBool( - omnibox::kOmniboxPedalSuggestions, - "PedalSuggestionsCounterfactualArm", false)) { - return nullptr; - } - return found; }
diff --git a/components/omnibox/browser/omnibox_popup_model.cc b/components/omnibox/browser/omnibox_popup_model.cc index ef4d8dee..9414075 100644 --- a/components/omnibox/browser/omnibox_popup_model.cc +++ b/components/omnibox/browser/omnibox_popup_model.cc
@@ -361,8 +361,9 @@ } all_states.push_back(FOCUSED_BUTTON_TAB_SWITCH); - if (OmniboxFieldTrial::IsSuggestionButtonRowEnabled()) - all_states.push_back(FOCUSED_BUTTON_PEDAL); +#if !defined(OS_ANDROID) && !defined(OS_IOS) + all_states.push_back(FOCUSED_BUTTON_PEDAL); +#endif all_states.push_back(FOCUSED_BUTTON_REMOVE_SUGGESTION); } DCHECK(std::is_sorted(all_states.begin(), all_states.end())) @@ -513,15 +514,12 @@ return match.pedal != nullptr; case FOCUSED_BUTTON_REMOVE_SUGGESTION: // Remove suggestion buttons are suppressed for matches with an associated - // keyword or tab match, unless the features that move those to the - // button row are enabled. - if (OmniboxFieldTrial::IsKeywordSearchButtonEnabled()) + // keyword, unless the feature that moves it to the button row is enabled. + if (OmniboxFieldTrial::IsKeywordSearchButtonEnabled()) { return match.SupportsDeletion(); - else if (OmniboxFieldTrial::IsSuggestionButtonRowEnabled()) + } else { return !match.associated_keyword && match.SupportsDeletion(); - else - return !match.associated_keyword && !match.has_tab_match && - match.SupportsDeletion(); + } default: break; }
diff --git a/components/omnibox/browser/omnibox_popup_model_unittest.cc b/components/omnibox/browser/omnibox_popup_model_unittest.cc index 76563730..1ae7054 100644 --- a/components/omnibox/browser/omnibox_popup_model_unittest.cc +++ b/components/omnibox/browser/omnibox_popup_model_unittest.cc
@@ -113,21 +113,12 @@ protected: // testing::Test: - void SetUp() override { - scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>(); - scoped_feature_list_->InitAndEnableFeature( - omnibox::kOmniboxSuggestionButtonRow); - OmniboxPopupModelTest::SetUp(); - } - void TearDown() override { scoped_feature_list_.reset(); } void InitKeywordButtonFeature() { scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>(); scoped_feature_list_->InitWithFeatures( - {omnibox::kOmniboxSuggestionButtonRow, - omnibox::kOmniboxKeywordSearchButton}, - {}); + {omnibox::kOmniboxKeywordSearchButton}, {}); } private:
diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc index 09a0605..0201fbe 100644 --- a/components/omnibox/common/omnibox_features.cc +++ b/components/omnibox/common/omnibox_features.cc
@@ -254,15 +254,6 @@ const base::Feature kOmniboxSearchReadyIncognito{ "OmniboxSearchReadyIncognito", base::FEATURE_ENABLED_BY_DEFAULT}; -// Feature that puts a single row of buttons on suggestions with actionable -// elements like keywords, tab-switch buttons, and Pedals. -const base::Feature kOmniboxSuggestionButtonRow{ - "OmniboxSuggestionButtonRow", enabled_by_default_desktop_only}; - -// Feature used to enable Pedal suggestions. -const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions", - enabled_by_default_desktop_only}; - // Feature used to enable the second batch of Pedals (Safety Check, etc.). const base::Feature kOmniboxPedalsBatch2{"OmniboxPedalsBatch2", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/components/omnibox/common/omnibox_features.h b/components/omnibox/common/omnibox_features.h index 9de1f877..b3c3009 100644 --- a/components/omnibox/common/omnibox_features.h +++ b/components/omnibox/common/omnibox_features.h
@@ -68,8 +68,6 @@ extern const base::Feature kMostVisitedTiles; extern const base::Feature kRichAutocompletion; extern const base::Feature kOmniboxSearchReadyIncognito; -extern const base::Feature kOmniboxSuggestionButtonRow; -extern const base::Feature kOmniboxPedalSuggestions; extern const base::Feature kOmniboxPedalsBatch2; extern const base::Feature kOmniboxPedalsDefaultIconColored; extern const base::Feature kOmniboxKeywordSearchButton;
diff --git a/components/omnibox_strings.grdp b/components/omnibox_strings.grdp index 70d6a927..260d81b 100644 --- a/components/omnibox_strings.grdp +++ b/components/omnibox_strings.grdp
@@ -65,9 +65,6 @@ <message name="IDS_OMNIBOX_TAB_SUGGEST_HINT" desc="The button text contents to say that this suggestion will switch to another tab."> Switch to this tab </message> - <message name="IDS_OMNIBOX_TAB_SUGGEST_SHORT_HINT" desc="A shortened, one word version of button text to say that this suggestion will switch to another tab."> - Switch - </message> <message name="IDS_OMNIBOX_FILE" desc="Text shown in the omnibox to indicate a user is viewing a file."> File </message>
diff --git a/components/page_info/android/BUILD.gn b/components/page_info/android/BUILD.gn index d099fce..cce3ee4 100644 --- a/components/page_info/android/BUILD.gn +++ b/components/page_info/android/BUILD.gn
@@ -93,7 +93,6 @@ "java/src/org/chromium/components/page_info/PageInfoView.java", "java/src/org/chromium/components/page_info/PageInfoViewV2.java", "java/src/org/chromium/components/page_info/PermissionParamsListBuilder.java", - "java/src/org/chromium/components/page_info/PermissionParamsListBuilderDelegate.java", "java/src/org/chromium/components/page_info/SystemSettingsActivityRequiredListener.java", "java/src/org/chromium/components/page_info/VrHandler.java", ]
diff --git a/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoController.java b/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoController.java index fb008b28..7e168871 100644 --- a/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoController.java +++ b/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoController.java
@@ -596,7 +596,6 @@ public static void show(final Activity activity, WebContents webContents, final String contentPublisher, @OpenedFromSource int source, PageInfoControllerDelegate delegate, - PermissionParamsListBuilderDelegate permissionParamsListBuilderDelegate, @ContentSettingsType int highlightedPermission) { // If the activity's decor view is not attached to window, we don't show the dialog because // the window manager might have revoked the window token for this activity. See
diff --git a/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilderDelegate.java b/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilderDelegate.java deleted file mode 100644 index caffb6f2..0000000 --- a/components/page_info/android/java/src/org/chromium/components/page_info/PermissionParamsListBuilderDelegate.java +++ /dev/null
@@ -1,38 +0,0 @@ -// Copyright 2020 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.components.page_info; - -import androidx.annotation.Nullable; - -import org.chromium.components.content_settings.ContentSettingsType; -import org.chromium.components.embedder_support.browser_context.BrowserContextHandle; -import org.chromium.components.embedder_support.util.Origin; - -/** - * Delegate class to allow customization of PermissionParamsListBuilderDelegate - * logic. - */ -public class PermissionParamsListBuilderDelegate { - private final BrowserContextHandle mBrowserContextHandle; - public PermissionParamsListBuilderDelegate(BrowserContextHandle browserContextHandle) { - mBrowserContextHandle = browserContextHandle; - } - - /** - * Returns the user visible name of the app that will handle permission delegation for the - * origin. - */ - @Nullable - public String getDelegateAppName(Origin origin, @ContentSettingsType int type) { - return null; - } - - /** - * Returns the BrowserContextHandle to be used by PermissionParamsListBuilder. - */ - public BrowserContextHandle getBrowserContextHandle() { - return mBrowserContextHandle; - } -}
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 22b1106..4705da2 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -25826,6 +25826,49 @@ Setting the policy to True or leaving it unset will show a dialog asking the user to confirm or deny logout when the last window is closed. Setting the policy to False will prevent the dialog from being displayed and therefore also disables auto-logout after closing the last window.''', }, + { + 'name': 'TripleDESEnabled', + 'owners': ['file://net/ssl/OWNERS', 'davidben@chromium.org'], + 'type': 'main', + 'schema': { + 'type': 'boolean', + }, + 'supported_on': [ + 'chrome.*:92-', + 'chrome_os:92-', + 'android:92-', + ], + 'features': { + 'dynamic_refresh': True, + 'per_profile': False, + }, + 'items': [ + { + 'value': True, + 'caption': '3DES cipher suites will be enabled in TLS', + }, + { + 'value': False, + 'caption': '3DES cipher suites will be disabled in TLS', + }, + { + 'value': None, + 'caption': 'Use the default setting for 3DES cipher suites in TLS', + }, + ], + 'default': None, + 'example_value': False, + 'id': 858, + 'caption': '''Enable 3DES cipher suites in TLS''', + # TODO(davidben): Add the 'system-security' tag when we flip the default. + 'tags': [], + 'desc': '''Warning: 3DES will be completely removed from <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> in version 95 (around October 2021) and this policy will stop working then. + + If the policy is set to true, then 3DES cipher suites in TLS will be enabled. If it is set to false, they will be disabled. If the policy is unset, 3DES cipher suites are currently enabled by default. They will be disabled by default in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> 93. + + In <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> 92, this policy may be used to preview the change and test for incompatibilities. In <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> 93 and later, it may be used to temporarily retain compatibility with an outdated server. This is a stopgap measure and the server should be reconfigured. + ''', + }, ], 'messages': { # Messages that are not associated to any policies. @@ -26757,6 +26800,6 @@ 'placeholders': [], 'deleted_policy_ids': [114, 115, 204, 205, 206, 412, 476, 544, 546, 562, 569, 578, 583, 585, 586, 587, 588, 589, 590, 591, 600, 668, 669], 'deleted_atomic_policy_group_ids': [19], - 'highest_id_currently_used': 857, + 'highest_id_currently_used': 858, 'highest_atomic_group_id_currently_used': 40 }
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc b/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc index 0d7848d..3db29d2 100644 --- a/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc +++ b/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc
@@ -186,7 +186,7 @@ {2.22222f, 0.909672f, 0.0903276f, 0.222222f, 0.0812429f, 0, 0}, SkNamedGamut::kRec2020); SkImageInfo bitmap_info = SkImageInfo::Make( - bounds.width(), bounds.height(), SkColorType::kRGBA_8888_SkColorType, + bounds.width(), bounds.height(), SkColorType::kN32_SkColorType, SkAlphaType::kUnpremul_SkAlphaType, rec2020); if (!bitmap_->tryAllocPixels(bitmap_info)) return VisualExtractionFinished(/*success=*/false);
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/scorer_unittest.cc b/components/safe_browsing/content/renderer/phishing_classifier/scorer_unittest.cc index 3b9ae0c..3aa1927 100644 --- a/components/safe_browsing/content/renderer/phishing_classifier/scorer_unittest.cc +++ b/components/safe_browsing/content/renderer/phishing_classifier/scorer_unittest.cc
@@ -91,7 +91,7 @@ {2.22222f, 0.909672f, 0.0903276f, 0.222222f, 0.0812429f, 0, 0}, SkNamedGamut::kRec2020); SkImageInfo bitmap_info = - SkImageInfo::Make(1000, 1000, SkColorType::kRGBA_8888_SkColorType, + SkImageInfo::Make(1000, 1000, SkColorType::kN32_SkColorType, SkAlphaType::kUnpremul_SkAlphaType, rec2020); ASSERT_TRUE(bitmap_.tryAllocPixels(bitmap_info));
diff --git a/components/safe_browsing/core/common/visual_utils.cc b/components/safe_browsing/core/common/visual_utils.cc index a7bc1ff6..c47be97 100644 --- a/components/safe_browsing/core/common/visual_utils.cc +++ b/components/safe_browsing/core/common/visual_utils.cc
@@ -14,6 +14,7 @@ #include "components/safe_browsing/core/proto/csd.pb.h" #include "third_party/opencv/src/emd_wrapper.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "third_party/skia/include/core/SkColorPriv.h" #include "third_party/skia/include/core/SkPixmap.h" #include "ui/gfx/color_utils.h" @@ -169,9 +170,9 @@ std::unordered_map<uint32_t, ColorStats> stats_map; auto it = stats_map.end(); - // The mask that will be applied needs the image in a specific format. - DCHECK_EQ(image.colorType(), SkColorType::kRGBA_8888_SkColorType); - + // This code uses the unsafe getAddr32 function which assumes 32bpp depth. + // Make sure the color type reflects that. + CHECK_EQ(image.colorType(), SkColorType::kN32_SkColorType); for (int x = 0; x < image.width(); x++) { for (int y = 0; y < image.height(); y++) { // The conversions to QuantizedColor are avoided when possible to save @@ -235,9 +236,8 @@ // TODO(drubery): Investigate whether this is necessary for performance or // not. SkImageInfo downsampled_info = - SkImageInfo::Make(kPHashDownsampleWidth, kPHashDownsampleHeight, - SkColorType::kRGBA_8888_SkColorType, - SkAlphaType::kUnpremul_SkAlphaType, rec2020); + SkImageInfo::MakeN32(kPHashDownsampleWidth, kPHashDownsampleHeight, + SkAlphaType::kUnpremul_SkAlphaType, rec2020); SkBitmap downsampled; if (!downsampled.tryAllocPixels(downsampled_info)) return false; @@ -251,15 +251,16 @@ blurred_image->set_width(blurred->width()); blurred_image->set_height(blurred->height()); - const uint32_t* rgba = blurred->getAddr32(0, 0); const int data_size = blurred->width() * blurred->height(); blurred_image->mutable_data()->reserve(data_size); - for (int i = 0; i < data_size; i++) { - // Data is stored in BGR order. - *blurred_image->mutable_data() += static_cast<char>((rgba[i] >> 0) & 0xff); - *blurred_image->mutable_data() += static_cast<char>((rgba[i] >> 8) & 0xff); - *blurred_image->mutable_data() += static_cast<char>((rgba[i] >> 16) & 0xff); + for (int x = 0; x < blurred->width(); ++x) { + for (int y = 0; y < blurred->height(); ++y) { + SkColor color = blurred->getColor(y, x); + *blurred_image->mutable_data() += static_cast<char>(SkColorGetR(color)); + *blurred_image->mutable_data() += static_cast<char>(SkColorGetG(color)); + *blurred_image->mutable_data() += static_cast<char>(SkColorGetB(color)); + } } return true; @@ -274,9 +275,9 @@ int num_blocks_wide = std::ceil(static_cast<float>(image.width()) / block_size); - SkImageInfo target_info = SkImageInfo::Make( - num_blocks_wide, num_blocks_high, SkColorType::kRGBA_8888_SkColorType, - SkAlphaType::kUnpremul_SkAlphaType, image.refColorSpace()); + SkImageInfo target_info = SkImageInfo::MakeN32( + num_blocks_wide, num_blocks_high, SkAlphaType::kUnpremul_SkAlphaType, + image.refColorSpace()); auto target = std::make_unique<SkBitmap>(); if (!target->tryAllocPixels(target_info)) return target; @@ -307,7 +308,7 @@ int b_mean = b_total / sample_count; *target->getAddr32(block_x, block_y) = - (255 << 24) | (b_mean << 16) | (g_mean << 8) | (r_mean << 0); + SkPackARGB32(255, r_mean, g_mean, b_mean); } }
diff --git a/components/safe_browsing/core/common/visual_utils_unittest.cc b/components/safe_browsing/core/common/visual_utils_unittest.cc index deae7e7..7d56fca 100644 --- a/components/safe_browsing/core/common/visual_utils_unittest.cc +++ b/components/safe_browsing/core/common/visual_utils_unittest.cc
@@ -7,40 +7,30 @@ #include "base/test/test_discardable_memory_allocator.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/skia/include/core/SkColorPriv.h" namespace safe_browsing { namespace visual_utils { namespace { -// Pixel value constants, all in BGR order. -const unsigned int kWhite = 0xffffffff; -const unsigned int kBlack = 0xff000000; -const unsigned int kRed = 0xff0000ff; -const unsigned int kGreen = 0xff00ff00; -const unsigned int kBlue = 0xffff0000; +const SkPMColor kSkPMRed = SkPackARGB32(255, 255, 0, 0); +const SkPMColor kSkPMGreen = SkPackARGB32(255, 0, 255, 0); +const SkPMColor kSkPMBlue = SkPackARGB32(255, 0, 0, 255); // Use to add noise to the 5 lower bits of each color component. Use to -// diversify input in tests that cover function that will only look at the most -// significant three bits of each component. |i| is used to get different noise -// that changes in sequence. Any number can be provided. Noise applied can be -// identical for two different values of |i|. -unsigned int AddNoiseToLowerBits(unsigned int color, unsigned int i) { +// introduce values directly into an N32 bitmap's memory. Use to diversify input +// in tests that cover function that will only look at the most significant +// three bits of each component. |i| is used to get different noise that changes +// in sequence. Any number can be provided. Noise applied can be identical for +// two different values of |i|. +SkPMColor AddNoiseToLowerBits(SkColor color, unsigned int i) { // Get a mask between 00000 and 11111 from index. unsigned int mask = i % 0x1f; // Apply noise to each color component separately. - color &= 0xffffffe0; - color |= mask << 0; - - color &= 0xffffe0ff; - color |= mask << 8; - - color &= 0xffe0ffff; - color |= mask << 16; - - color &= 0xe0ffffff; - color |= mask << 24; + color = SkColorSetARGB(SkColorGetA(color) | mask, SkColorGetR(color) | mask, + SkColorGetG(color) | mask, SkColorGetB(color) | mask); return color; } @@ -57,9 +47,8 @@ sk_sp<SkColorSpace> rec2020 = SkColorSpace::MakeRGB( {2.22222f, 0.909672f, 0.0903276f, 0.222222f, 0.0812429f, 0, 0}, SkNamedGamut::kRec2020); - SkImageInfo bitmap_info = - SkImageInfo::Make(1000, 1000, SkColorType::kRGBA_8888_SkColorType, - SkAlphaType::kUnpremul_SkAlphaType, rec2020); + SkImageInfo bitmap_info = SkImageInfo::MakeN32( + 1000, 1000, SkAlphaType::kUnpremul_SkAlphaType, rec2020); ASSERT_TRUE(bitmap_.tryAllocPixels(bitmap_info)); } @@ -127,14 +116,13 @@ TEST_F(VisualUtilsTest, GetHistogramForImageWhite) { VisualFeatures::ColorHistogram histogram; - SkBitmap bitmap; // Draw white over half the image for (int x = 0; x < 1000; x++) for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = AddNoiseToLowerBits(kWhite, x + y); - - *bitmap_.getAddr32(10, 10) = 0xffe0ffff; + // NOTE: getAddr32 used since byte ordering does not matter for white and + // repeated erase() calls might make tests time out. + *bitmap_.getAddr32(x, y) = AddNoiseToLowerBits(SK_ColorWHITE, x + y); ASSERT_TRUE(GetHistogramForImage(bitmap_, &histogram)); ASSERT_EQ(histogram.bins_size(), 1); @@ -154,12 +142,16 @@ // Draw white over half the image for (int x = 0; x < 1000; x++) for (int y = 0; y < 500; y++) - *bitmap_.getAddr32(x, y) = AddNoiseToLowerBits(kWhite, x + y); + // NOTE: getAddr32 used since byte ordering does not matter for white and + // repeated erase() calls might make tests time out. + *bitmap_.getAddr32(x, y) = AddNoiseToLowerBits(SK_ColorWHITE, x + y); // Draw black over half the image. for (int x = 0; x < 1000; x++) for (int y = 500; y < 1000; y++) - *bitmap_.getAddr32(x, y) = AddNoiseToLowerBits(kBlack, x + y); + // NOTE: getAddr32 used since byte ordering does not matter for black and + // repeated erase() calls might make tests time out. + *bitmap_.getAddr32(x, y) = AddNoiseToLowerBits(SK_ColorBLACK, x + y); ASSERT_TRUE(GetHistogramForImage(bitmap_, &histogram)); ASSERT_EQ(histogram.bins_size(), 2); @@ -183,9 +175,7 @@ VisualFeatures::BlurredImage blurred; // Draw white over the image - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1000, 1000)); ASSERT_TRUE(GetBlurredImage(bitmap_, &blurred)); ASSERT_EQ(48, blurred.width()); @@ -204,7 +194,7 @@ // Draw red over the image. for (int x = 0; x < 1000; x++) for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kRed; + *bitmap_.getAddr32(x, y) = kSkPMRed; ASSERT_TRUE(GetBlurredImage(bitmap_, &blurred)); ASSERT_EQ(48, blurred.width()); @@ -221,14 +211,10 @@ VisualFeatures::BlurredImage blurred; // Draw black over half the image. - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 500; y++) - *bitmap_.getAddr32(x, y) = kBlack; + bitmap_.erase(SK_ColorBLACK, SkIRect::MakeXYWH(0, 0, 1000, 500)); // Draw white over half the image - for (int x = 0; x < 1000; x++) - for (int y = 500; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 500, 1000, 1000)); ASSERT_TRUE(GetBlurredImage(bitmap_, &blurred)); ASSERT_EQ(48, blurred.width()); @@ -251,14 +237,10 @@ TEST_F(VisualUtilsTest, BlockMeanAverageOneBlock) { // Draw black over half the image. - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 500; y++) - *bitmap_.getAddr32(x, y) = kBlack; + bitmap_.erase(SK_ColorBLACK, SkIRect::MakeXYWH(0, 0, 1000, 500)); // Draw white over half the image - for (int x = 0; x < 1000; x++) - for (int y = 500; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 500, 1000, 1000)); std::unique_ptr<SkBitmap> blocks = BlockMeanAverage(bitmap_, 1000); ASSERT_EQ(1, blocks->width()); @@ -268,37 +250,34 @@ TEST_F(VisualUtilsTest, BlockMeanAveragePartialBlocks) { // Draw a white, red, green, and blue box with the expected block sizes. - for (int x = 0; x < 600; x++) - for (int y = 0; y < 600; y++) - *bitmap_.getAddr32(x, y) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 600, 600)); for (int x = 600; x < 1000; x++) for (int y = 0; y < 600; y++) - *bitmap_.getAddr32(x, y) = kRed; + *bitmap_.getAddr32(x, y) = kSkPMRed; for (int x = 0; x < 600; x++) for (int y = 600; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kGreen; + *bitmap_.getAddr32(x, y) = kSkPMGreen; for (int x = 600; x < 1000; x++) for (int y = 600; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kBlue; + *bitmap_.getAddr32(x, y) = kSkPMBlue; std::unique_ptr<SkBitmap> blocks = BlockMeanAverage(bitmap_, 600); ASSERT_EQ(2, blocks->width()); ASSERT_EQ(2, blocks->height()); - EXPECT_EQ(*blocks->getAddr32(0, 0), kWhite); - EXPECT_EQ(*blocks->getAddr32(1, 0), kRed); - EXPECT_EQ(*blocks->getAddr32(0, 1), kGreen); - EXPECT_EQ(*blocks->getAddr32(1, 1), kBlue); + EXPECT_EQ(blocks->getColor(0, 0), SK_ColorWHITE); + + EXPECT_EQ(*blocks->getAddr32(1, 0), kSkPMRed); + EXPECT_EQ(*blocks->getAddr32(0, 1), kSkPMGreen); + EXPECT_EQ(*blocks->getAddr32(1, 1), kSkPMBlue); } TEST_F(VisualUtilsTest, IsVisualMatchHash) { { // An all-white image should hash to all 1-bits. - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1000, 1000)); std::vector<unsigned char> target_hash; target_hash.push_back('\x30'); @@ -316,9 +295,7 @@ { // Make the top quarter black, and the corresponding bits of the hash should // be 0. - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 250; y++) - *bitmap_.getAddr32(x, y) = kBlack; + bitmap_.erase(SK_ColorBLACK, SkIRect::MakeXYWH(0, 0, 1000, 250)); std::vector<unsigned char> target_hash; target_hash.push_back('\x30'); @@ -339,12 +316,8 @@ TEST_F(VisualUtilsTest, IsVisualMatchHashPartialMatch) { // Make the top quarter black, and the corresponding bits of the hash should // be 0. - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 250; y++) - *bitmap_.getAddr32(x, y) = kBlack; - for (int x = 0; x < 1000; x++) - for (int y = 250; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kWhite; + bitmap_.erase(SK_ColorBLACK, SkIRect::MakeXYWH(0, 0, 1000, 250)); + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 250, 1000, 1000)); std::vector<unsigned char> target_hash; target_hash.push_back('\x30'); @@ -366,9 +339,7 @@ } TEST_F(VisualUtilsTest, IsVisualMatchHashStrideComparison) { - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1000, 1000)); std::vector<unsigned char> target_hash; target_hash.push_back('\x30'); @@ -392,7 +363,9 @@ TEST_F(VisualUtilsTest, IsVisualMatchHistogramOnly) { for (int x = 0; x < 1000; x++) for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = AddNoiseToLowerBits(kWhite, x + y); + // NOTE: getAddr32 used since byte ordering does not matter for white and + // repeated erase calls might make tests time out. + *bitmap_.getAddr32(x, y) = AddNoiseToLowerBits(SK_ColorWHITE, x + y); { VisualTarget target; @@ -461,10 +434,9 @@ } TEST_F(VisualUtilsTest, IsVisualMatchColorRange) { - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = AddNoiseToLowerBits(kWhite, x + y); - *bitmap_.getAddr32(0, 0) = kBlue; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1000, 1000)); + + *bitmap_.getAddr32(0, 0) = kSkPMBlue; SkScalar hsv[3]; SkColorToHSV(bitmap_.getColor(0, 0), hsv); @@ -495,18 +467,17 @@ .has_value()); // No blue hue present - *bitmap_.getAddr32(0, 0) = AddNoiseToLowerBits(kWhite, 1); + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); EXPECT_FALSE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value()); } TEST_F(VisualUtilsTest, IsVisualMatchMultipleColorRanges) { - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = AddNoiseToLowerBits(kWhite, x + y); - *bitmap_.getAddr32(0, 0) = kBlue; - *bitmap_.getAddr32(1, 0) = kGreen; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1000, 1000)); + + *bitmap_.getAddr32(0, 0) = kSkPMBlue; + *bitmap_.getAddr32(1, 0) = kSkPMGreen; SkScalar hsv[3]; SkColorToHSV(bitmap_.getColor(0, 0), hsv); @@ -529,31 +500,31 @@ .has_value()); // No blue hue present - *bitmap_.getAddr32(0, 0) = AddNoiseToLowerBits(kWhite, 1); + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); EXPECT_FALSE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value()); // No green hue present - *bitmap_.getAddr32(0, 0) = AddNoiseToLowerBits(kBlue, 1); - *bitmap_.getAddr32(1, 0) = AddNoiseToLowerBits(kWhite, 1); + *bitmap_.getAddr32(0, 0) = kSkPMBlue; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(1, 0, 1, 1)); + EXPECT_FALSE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value()); // Neither hue present - *bitmap_.getAddr32(0, 0) = AddNoiseToLowerBits(kWhite, 1); + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); EXPECT_FALSE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value()); } TEST_F(VisualUtilsTest, IsVisualMatchMultipleMatchRules) { - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kWhite; - *bitmap_.getAddr32(0, 0) = kBlue; - *bitmap_.getAddr32(1, 0) = kGreen; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); + + *bitmap_.getAddr32(0, 0) = kSkPMBlue; + *bitmap_.getAddr32(1, 0) = kSkPMGreen; // Create a target with two match rules, one matching blue pixels and one // matching green. @@ -579,33 +550,31 @@ .has_value()); // No blue hue present - *bitmap_.getAddr32(0, 0) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); EXPECT_TRUE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value()); // No green hue present - *bitmap_.getAddr32(0, 0) = kBlue; - *bitmap_.getAddr32(1, 0) = kWhite; + *bitmap_.getAddr32(0, 0) = kSkPMBlue; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(1, 0, 1, 1)); EXPECT_TRUE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value()); // Neither hue present - *bitmap_.getAddr32(0, 0) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); EXPECT_FALSE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value()); } TEST_F(VisualUtilsTest, IsVisualMatchFloatColorRange) { - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); // Adding a little noise in the red component makes the target_hue not an // integer. Testing for this color requires float ranges. - *bitmap_.getAddr32(0, 0) = kBlue | 0x0f; + *bitmap_.getAddr32(0, 0) = kSkPMBlue | 0x0f; SkScalar hsv[3]; SkColorToHSV(bitmap_.getColor(0, 0), hsv); @@ -636,18 +605,17 @@ .has_value()); // No blue hue present - *bitmap_.getAddr32(0, 0) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); EXPECT_FALSE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value()); } TEST_F(VisualUtilsTest, IsVisualMatchMultipleFloatColorRanges) { - for (int x = 0; x < 1000; x++) - for (int y = 0; y < 1000; y++) - *bitmap_.getAddr32(x, y) = kWhite; - *bitmap_.getAddr32(0, 0) = kBlue; - *bitmap_.getAddr32(1, 0) = kGreen; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); + + *bitmap_.getAddr32(0, 0) = kSkPMBlue; + *bitmap_.getAddr32(1, 0) = kSkPMGreen; SkScalar hsv[3]; SkColorToHSV(bitmap_.getColor(0, 0), hsv); @@ -670,20 +638,20 @@ .has_value()); // No blue hue present - *bitmap_.getAddr32(0, 0) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); EXPECT_FALSE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value()); // No green hue present - *bitmap_.getAddr32(0, 0) = kBlue; - *bitmap_.getAddr32(1, 0) = kWhite; + *bitmap_.getAddr32(0, 0) = kSkPMBlue; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(1, 0, 1, 1)); EXPECT_FALSE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value()); // Neither hue present - *bitmap_.getAddr32(0, 0) = kWhite; + bitmap_.erase(SK_ColorWHITE, SkIRect::MakeXYWH(0, 0, 1, 1)); EXPECT_FALSE(IsVisualMatch(bitmap_, GetBlurredBitmapHash(), GetBitmapHistogram(), target) .has_value());
diff --git a/components/safe_browsing/core/features.cc b/components/safe_browsing/core/features.cc index afe99fa..841456e 100644 --- a/components/safe_browsing/core/features.cc +++ b/components/safe_browsing/core/features.cc
@@ -90,14 +90,6 @@ const base::Feature kRealTimeUrlLookupEnabled{ "SafeBrowsingRealTimeUrlLookupEnabled", base::FEATURE_ENABLED_BY_DEFAULT}; -const base::Feature kRealTimeUrlLookupEnabledForEnterprise{ - "SafeBrowsingRealTimeUrlLookupEnabledForEnterprise", - base::FEATURE_ENABLED_BY_DEFAULT}; - -const base::Feature kRealTimeUrlLookupEnterpriseGaEndpoint{ - "SafeBrowsingkRealTimeUrlLookupEnterpriseGaEndpoint", - base::FEATURE_ENABLED_BY_DEFAULT}; - const base::Feature kRealTimeUrlLookupEnabledWithToken{ "SafeBrowsingRealTimeUrlLookupEnabledWithToken", base::FEATURE_ENABLED_BY_DEFAULT}; @@ -152,8 +144,6 @@ {&kPasswordProtectionForSignedInUsers, true}, {&kPasswordProtectionWithToken, true}, {&kRealTimeUrlLookupEnabled, true}, - {&kRealTimeUrlLookupEnabledForEnterprise, true}, - {&kRealTimeUrlLookupEnterpriseGaEndpoint, true}, {&kRealTimeUrlLookupEnabledWithToken, true}, {&kRealTimeUrlLookupReferrerChain, true}, {&kSafeBrowsingSeparateNetworkContexts, true},
diff --git a/components/safe_browsing/core/features.h b/components/safe_browsing/core/features.h index a67558d..0552c9b 100644 --- a/components/safe_browsing/core/features.h +++ b/components/safe_browsing/core/features.h
@@ -88,15 +88,6 @@ // Controls whether the real time URL lookup is enabled. extern const base::Feature kRealTimeUrlLookupEnabled; -// Controls whether to do real time URL lookup for enterprise users. If both -// this feature and the enterprise policies are enabled, the enterprise real -// time URL lookup will be enabled and the consumer real time URL lookup will be -// disabled. -extern const base::Feature kRealTimeUrlLookupEnabledForEnterprise; - -// Controls whether to use the GA endpoint for enterprise real time URL lookup. -extern const base::Feature kRealTimeUrlLookupEnterpriseGaEndpoint; - // Controls whether the GAIA-keyed real time URL lookup is enabled. extern const base::Feature kRealTimeUrlLookupEnabledWithToken;
diff --git a/components/safe_browsing/core/realtime/policy_engine.cc b/components/safe_browsing/core/realtime/policy_engine.cc index 291be557..2fbae58 100644 --- a/components/safe_browsing/core/realtime/policy_engine.cc +++ b/components/safe_browsing/core/realtime/policy_engine.cc
@@ -96,10 +96,6 @@ return false; } - if (!base::FeatureList::IsEnabled(kRealTimeUrlLookupEnabledForEnterprise)) { - return false; - } - if (!has_valid_dm_token) { return false; }
diff --git a/components/safe_browsing/core/realtime/policy_engine_unittest.cc b/components/safe_browsing/core/realtime/policy_engine_unittest.cc index 4022266..28105dd 100644 --- a/components/safe_browsing/core/realtime/policy_engine_unittest.cc +++ b/components/safe_browsing/core/realtime/policy_engine_unittest.cc
@@ -178,29 +178,16 @@ TEST_F(RealTimePolicyEngineTest, TestCanPerformEnterpriseFullURLLookup) { // Is off the record profile. { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(kRealTimeUrlLookupEnabledForEnterprise); EXPECT_FALSE(CanPerformEnterpriseFullURLLookup(/*has_valid_dm_token=*/true, /*is_off_the_record=*/true)); } - // Feature flag disabled. - { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndDisableFeature(kRealTimeUrlLookupEnabledForEnterprise); - EXPECT_FALSE(CanPerformEnterpriseFullURLLookup( - /*has_valid_dm_token=*/true, /*is_off_the_record=*/false)); - } // No valid DM token. { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(kRealTimeUrlLookupEnabledForEnterprise); EXPECT_FALSE(CanPerformEnterpriseFullURLLookup( /*has_valid_dm_token=*/false, /*is_off_the_record=*/false)); } // Policy disabled. { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(kRealTimeUrlLookupEnabledForEnterprise); pref_service_.SetUserPref( prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode, std::make_unique<base::Value>(REAL_TIME_CHECK_DISABLED)); @@ -209,8 +196,6 @@ } // Policy enabled. { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(kRealTimeUrlLookupEnabledForEnterprise); pref_service_.SetUserPref( prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode, std::make_unique<base::Value>(REAL_TIME_CHECK_FOR_MAINFRAME_ENABLED));
diff --git a/components/safety_check/safety_check.cc b/components/safety_check/safety_check.cc index e09f9d7..ea801a28 100644 --- a/components/safety_check/safety_check.cc +++ b/components/safety_check/safety_check.cc
@@ -8,34 +8,23 @@ namespace safety_check { -SafetyCheck::SafetyCheck(SafetyCheckHandlerInterface* handler) - : handler_(handler) { - DCHECK(handler_); -} - -SafetyCheck::~SafetyCheck() = default; - -void SafetyCheck::CheckSafeBrowsing(PrefService* pref_service) { +SafeBrowsingStatus CheckSafeBrowsing(PrefService* pref_service) { const PrefService::Preference* enabled_pref = pref_service->FindPreference(prefs::kSafeBrowsingEnabled); bool is_sb_enabled = pref_service->GetBoolean(prefs::kSafeBrowsingEnabled); bool is_sb_managed = enabled_pref->IsManaged(); - SafeBrowsingStatus status; - if (is_sb_enabled && pref_service->GetBoolean(prefs::kSafeBrowsingEnhanced)) { - status = SafeBrowsingStatus::kEnabledEnhanced; - } else if (is_sb_enabled && is_sb_managed) { - status = SafeBrowsingStatus::kEnabledStandard; - } else if (is_sb_enabled && !is_sb_managed) { - status = SafeBrowsingStatus::kEnabledStandardAvailableEnhanced; - } else if (is_sb_managed) { - status = SafeBrowsingStatus::kDisabledByAdmin; - } else if (enabled_pref->IsExtensionControlled()) { - status = SafeBrowsingStatus::kDisabledByExtension; - } else { - status = SafeBrowsingStatus::kDisabled; - } - handler_->OnSafeBrowsingCheckResult(status); + if (is_sb_enabled && pref_service->GetBoolean(prefs::kSafeBrowsingEnhanced)) + return SafeBrowsingStatus::kEnabledEnhanced; + if (is_sb_enabled && is_sb_managed) + return SafeBrowsingStatus::kEnabledStandard; + if (is_sb_enabled && !is_sb_managed) + return SafeBrowsingStatus::kEnabledStandardAvailableEnhanced; + if (is_sb_managed) + return SafeBrowsingStatus::kDisabledByAdmin; + if (enabled_pref->IsExtensionControlled()) + return SafeBrowsingStatus::kDisabledByExtension; + return SafeBrowsingStatus::kDisabled; } } // namespace safety_check
diff --git a/components/safety_check/safety_check.h b/components/safety_check/safety_check.h index 3aab1c1..6dcf7b3 100644 --- a/components/safety_check/safety_check.h +++ b/components/safety_check/safety_check.h
@@ -9,85 +9,71 @@ #include "base/observer_list_types.h" #include "components/prefs/pref_service.h" +// Utilities for performing browser safety checks common to desktop, Android, +// and iOS. Platform-specific checks, such as updates and extensions, are +// implemented in handlers. namespace safety_check { -// Class for performing browser safety checks common to desktop, Android, and -// iOS. Platform-specific checks, such as updates and extensions, are -// implemented in handlers. -class SafetyCheck { - public: - // The following enums represent the state of each component (common among - // desktop, Android, and iOS) of the safety check and should be kept in sync - // with the JS frontend (safety_check_browser_proxy.js) and |SafetyCheck*| - // metrics enums in enums.xml. - // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.safety_check - enum class PasswordsStatus { - kChecking = 0, - kSafe = 1, - // Indicates that at least one compromised password exists. Weak passwords - // may exist as well. - kCompromisedExist = 2, - kOffline = 3, - kNoPasswords = 4, - kSignedOut = 5, - kQuotaLimit = 6, - kError = 7, - kFeatureUnavailable = 8, - // Indicates that no compromised passwords exist, but at least one weak - // password. - kWeakPasswordsExist = 9, - // New enum values must go above here. - kMaxValue = kWeakPasswordsExist, - }; - - // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.safety_check - enum class SafeBrowsingStatus { - kChecking = 0, - kEnabled = 1, - kDisabled = 2, - kDisabledByAdmin = 3, - kDisabledByExtension = 4, - kEnabledStandard = 5, - kEnabledEnhanced = 6, - kEnabledStandardAvailableEnhanced = 7, - // New enum values must go above here. - kMaxValue = kEnabledStandardAvailableEnhanced, - }; - - // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.safety_check - enum class UpdateStatus { - kChecking = 0, - kUpdated = 1, - kUpdating = 2, - kRelaunch = 3, - kDisabledByAdmin = 4, - kFailedOffline = 5, - kFailed = 6, - // Non-Google branded browsers cannot check for updates using - // VersionUpdater. - kUnknown = 7, - // Only used in Android where the user is directed to the Play Store. - kOutdated = 8, - // New enum values must go above here. - kMaxValue = kOutdated, - }; - - class SafetyCheckHandlerInterface { - public: - virtual void OnSafeBrowsingCheckResult(SafeBrowsingStatus status) = 0; - }; - - explicit SafetyCheck(SafetyCheckHandlerInterface* handler); - ~SafetyCheck(); - - // Gets the status of Safe Browsing from the PrefService and invokes - // OnSafeBrowsingCheckResult on each Observer with results. - void CheckSafeBrowsing(PrefService* pref_service); - - private: - SafetyCheckHandlerInterface* handler_; +// The following enums represent the state of each component (common among +// desktop, Android, and iOS) of the safety check and should be kept in sync +// with the JS frontend (safety_check_browser_proxy.js) and |SafetyCheck*| +// metrics enums in enums.xml. +// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.safety_check +enum class PasswordsStatus { + kChecking = 0, + kSafe = 1, + // Indicates that at least one compromised password exists. Weak passwords + // may exist as well. + kCompromisedExist = 2, + kOffline = 3, + kNoPasswords = 4, + kSignedOut = 5, + kQuotaLimit = 6, + kError = 7, + kFeatureUnavailable = 8, + // Indicates that no compromised passwords exist, but at least one weak + // password. + kWeakPasswordsExist = 9, + // New enum values must go above here. + kMaxValue = kWeakPasswordsExist, }; +// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.safety_check +enum class SafeBrowsingStatus { + kChecking = 0, + kEnabled = 1, + kDisabled = 2, + kDisabledByAdmin = 3, + kDisabledByExtension = 4, + kEnabledStandard = 5, + kEnabledEnhanced = 6, + kEnabledStandardAvailableEnhanced = 7, + // New enum values must go above here. + kMaxValue = kEnabledStandardAvailableEnhanced, +}; + +// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.safety_check +enum class UpdateStatus { + kChecking = 0, + kUpdated = 1, + kUpdating = 2, + kRelaunch = 3, + kDisabledByAdmin = 4, + kFailedOffline = 5, + kFailed = 6, + // Non-Google branded browsers cannot check for updates using + // VersionUpdater. + kUnknown = 7, + // Only used in Android where the user is directed to the Play Store. + kOutdated = 8, + // New enum values must go above here. + kMaxValue = kOutdated, +}; + +// Gets the status of Safe Browsing from the PrefService and invokes +// OnSafeBrowsingCheckResult on each Observer with results. +SafeBrowsingStatus CheckSafeBrowsing(PrefService* pref_service); + } // namespace safety_check #endif // COMPONENTS_SAFETY_CHECK_SAFETY_CHECK_H_
diff --git a/components/services/storage/public/cpp/BUILD.gn b/components/services/storage/public/cpp/BUILD.gn index dcf8e9f..40990fa7 100644 --- a/components/services/storage/public/cpp/BUILD.gn +++ b/components/services/storage/public/cpp/BUILD.gn
@@ -29,7 +29,7 @@ source_set("tests") { testonly = true - sources = [ "storage_keys_unittest.cc" ] + sources = [ "storage_key_unittest.cc" ] deps = [ ":cpp", "//testing/gtest",
diff --git a/components/services/storage/public/cpp/storage_keys_unittest.cc b/components/services/storage/public/cpp/storage_key_unittest.cc similarity index 100% rename from components/services/storage/public/cpp/storage_keys_unittest.cc rename to components/services/storage/public/cpp/storage_key_unittest.cc
diff --git a/components/shared_highlighting/core/common/text_fragments_utils.cc b/components/shared_highlighting/core/common/text_fragments_utils.cc index 0247e88..84d88bc 100644 --- a/components/shared_highlighting/core/common/text_fragments_utils.cc +++ b/components/shared_highlighting/core/common/text_fragments_utils.cc
@@ -108,8 +108,28 @@ fragment_strings.push_back(fragment_string); } } + return AppendFragmentDirectives(base_url, fragment_strings); +} - std::string fragments_string = base::JoinString(fragment_strings, "&"); +GURL AppendSelectors(const GURL& base_url, std::vector<std::string> selectors) { + if (!base_url.is_valid()) { + return GURL(); + } + + std::vector<std::string> fragment_strings; + for (std::string& selector : selectors) { + if (!selector.empty()) { + fragment_strings.push_back(kFragmentParameterName + selector); + } + } + + return AppendFragmentDirectives(base_url, fragment_strings); +} + +GURL AppendFragmentDirectives(const GURL& base_url, + std::vector<std::string> directives) { + std::string fragments_string = base::JoinString(directives, "&"); + if (fragments_string.empty()) { return base_url; }
diff --git a/components/shared_highlighting/core/common/text_fragments_utils.h b/components/shared_highlighting/core/common/text_fragments_utils.h index d68409e94..18c3bdbf 100644 --- a/components/shared_highlighting/core/common/text_fragments_utils.h +++ b/components/shared_highlighting/core/common/text_fragments_utils.h
@@ -32,9 +32,32 @@ // Appends a set of text |fragments| with the correct format to the given // |base_url|. Returns an empty GURL if |base_url| is invalid. +// +// Example input: +// TextFragment test_fragment("only,- start #2"); +// AppendFragmentDirectives(url, {test_fragment}); GURL AppendFragmentDirectives(const GURL& base_url, std::vector<TextFragment> fragments); +// Appends a set of text fragment |directives|, that have already been +// converted to an escaped string, to the given |base_url|. Returns an +// empty GURL if |base_url| is invalid. +// +// Example input: +// TextFragment test_fragment("only,- start #2"); +// AppendFragmentDirectives(url, {test_fragment.ToEscapedString()}); +GURL AppendFragmentDirectives(const GURL& base_url, + std::vector<std::string> directives); + +// Appends a set of text |selectors|, the escaped strings used to identify +// a text fragment, to the given |base_url|. Returns an empty GURL +// if |base_url| is invalid. +// +// Example input: +// std::string test_selector("only%2C%2D%20start%20%232"); +// AppendFragmentDirectives(url, {test_selector}); +GURL AppendSelectors(const GURL& base_url, std::vector<std::string> selectors); + } // namespace shared_highlighting #endif // COMPONENTS_SHARED_HIGHLIGHTING_CORE_COMMON_TEXT_FRAGMENTS_UTILS_H_
diff --git a/components/shared_highlighting/core/common/text_fragments_utils_unittest.cc b/components/shared_highlighting/core/common/text_fragments_utils_unittest.cc index 082cc17..b384155f 100644 --- a/components/shared_highlighting/core/common/text_fragments_utils_unittest.cc +++ b/components/shared_highlighting/core/common/text_fragments_utils_unittest.cc
@@ -164,5 +164,30 @@ created_url.spec()); } +TEST(TextFragmentsUtilsTest, + AppendSelectorsURLWithPoundAndExistingFragmentAndAnchor) { + GURL base_url("https://www.chromium.org/#SomeAnchor:~:text=some%20value"); + std::string test_selector("only%20start"); + + GURL created_url = AppendSelectors(base_url, {test_selector}); + EXPECT_EQ( + "https://www.chromium.org/" + "#SomeAnchor:~:text=only%20start", + created_url.spec()); +} + +TEST(TextFragmentsUtilsTest, AppendSelectorsTwoFragments) { + GURL base_url("https://www.chromium.org"); + std::string first_test_selector("only start"); + std::string second_test_selector("only%2C%2D%20start%20%232"); + + GURL created_url = + AppendSelectors(base_url, {first_test_selector, second_test_selector}); + EXPECT_EQ( + "https://www.chromium.org/" + "#:~:text=only%20start&text=only%2C%2D%20start%20%232", + created_url.spec()); +} + } // namespace } // namespace shared_highlighting
diff --git a/components/signin/ios/browser/account_consistency_service.mm b/components/signin/ios/browser/account_consistency_service.mm index ef9f29f..edd2412 100644 --- a/components/signin/ios/browser/account_consistency_service.mm +++ b/components/signin/ios/browser/account_consistency_service.mm
@@ -348,7 +348,7 @@ // Only processes a single restoration attempt for a given amount of time to // avoid redirect loops. if (last_gaia_cookie_update_time_.is_null() || - base::Time::Now() - last_gaia_cookie_update_time_ < + base::Time::Now() - last_gaia_cookie_update_time_ > GetDelayThresholdToUpdateGaiaCookie()) { gaia_cookies_restored_callbacks_.push_back( std::move(cookies_restored_callback));
diff --git a/components/signin/ios/browser/account_consistency_service_unittest.mm b/components/signin/ios/browser/account_consistency_service_unittest.mm index 0f5282c..6ae0c6d 100644 --- a/components/signin/ios/browser/account_consistency_service_unittest.mm +++ b/components/signin/ios/browser/account_consistency_service_unittest.mm
@@ -223,6 +223,12 @@ /*domain=*/std::string())); } + // Verifies the time that the Gaia cookie was last updated for google.com. + void CheckGaiaCookieWithUpdateTime(base::Time time) { + EXPECT_EQ(time, + account_consistency_service_->last_gaia_cookie_update_time_); + } + // Navigation APIs. void SimulateNavigateToURL(NSURLResponse* response, id<ManageAccountsDelegate> delegate) { @@ -767,3 +773,55 @@ CheckNoChromeConnectedCookies(); EXPECT_OCMOCK_VERIFY(delegate); } + +TEST_F(AccountConsistencyServiceTest, SetGaiaCookieUpdateBeforeDelay) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(signin::kRestoreGaiaCookiesOnUserAction); + + SignIn(); + + NSDictionary* headers = + [NSDictionary dictionaryWithObject:@"action=ADDSESSION" + forKey:@"X-Chrome-Manage-Accounts"]; + NSHTTPURLResponse* response = [[NSHTTPURLResponse alloc] + initWithURL:[NSURL URLWithString:@"https://accounts.google.com/"] + statusCode:200 + HTTPVersion:@"HTTP/1.1" + headerFields:headers]; + + SimulateNavigateToURL(response, nil); + + // Advance clock, but stay within the one-hour Gaia update time. + base::TimeDelta oneMinuteDelta = base::TimeDelta::FromMinutes(1); + task_environment_.FastForwardBy(oneMinuteDelta); + SimulateNavigateToURLWithInterruption(response, nil); + + // Does not process the second Gaia restore event. + CheckGaiaCookieWithUpdateTime(base::Time::Now() - oneMinuteDelta); +} + +TEST_F(AccountConsistencyServiceTest, SetGaiaCookieUpdateAfterDelay) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(signin::kRestoreGaiaCookiesOnUserAction); + + SignIn(); + + NSDictionary* headers = + [NSDictionary dictionaryWithObject:@"action=ADDSESSION" + forKey:@"X-Chrome-Manage-Accounts"]; + NSHTTPURLResponse* response = [[NSHTTPURLResponse alloc] + initWithURL:[NSURL URLWithString:@"https://accounts.google.com/"] + statusCode:200 + HTTPVersion:@"HTTP/1.1" + headerFields:headers]; + + SimulateNavigateToURL(response, nil); + + // Advance clock past the one-hour Gaia update time. + base::TimeDelta twoHourDelta = base::TimeDelta::FromHours(2); + task_environment_.FastForwardBy(twoHourDelta); + SimulateNavigateToURL(response, nil); + + // Will process the second Gaia restore event, since it is past the delay. + CheckGaiaCookieWithUpdateTime(base::Time::Now()); +}
diff --git a/components/soda/BUILD.gn b/components/soda/BUILD.gn index 869c8ef..134f6c3 100644 --- a/components/soda/BUILD.gn +++ b/components/soda/BUILD.gn
@@ -34,6 +34,7 @@ deps = [ "//base", "//components/component_updater", + "//components/crx_file", "//components/strings/", ] }
diff --git a/components/soda/DEPS b/components/soda/DEPS index bba2923..565b349b 100644 --- a/components/soda/DEPS +++ b/components/soda/DEPS
@@ -1,6 +1,7 @@ include_rules = [ "+ash/public/cpp", "+components/component_updater/component_updater_paths.h", + "+components/crx_file", "+components/live_caption", "+components/prefs", "+components/strings/grit/components_strings.h",
diff --git a/components/soda/constants.cc b/components/soda/constants.cc index d40d058e..9f223081 100644 --- a/components/soda/constants.cc +++ b/components/soda/constants.cc
@@ -13,6 +13,7 @@ #include "base/optional.h" #include "base/path_service.h" #include "components/component_updater/component_updater_paths.h" +#include "components/crx_file/id_util.h" namespace speech { @@ -113,4 +114,31 @@ return base::nullopt; } + +LanguageCode GetLanguageCodeByComponentId(const std::string& component_id) { + for (const SodaLanguagePackComponentConfig& config : + kLanguageComponentConfigs) { + if (crx_file::id_util::GenerateIdFromHash(config.public_key_sha, + sizeof(config.public_key_sha)) == + component_id) { + return config.language_code; + } + } + + return LanguageCode::kNone; +} + +std::string GetLanguageName(LanguageCode language_code) { + std::string language_name; + if (language_code != speech::LanguageCode::kNone) { + base::Optional<speech::SodaLanguagePackComponentConfig> language_config = + speech::GetLanguageComponentConfig(language_code); + if (language_config.has_value()) { + language_name = language_config.value().language_name; + } + } + + return language_name; +} + } // namespace speech
diff --git a/components/soda/constants.h b/components/soda/constants.h index af0bd9d..510ef90 100644 --- a/components/soda/constants.h +++ b/components/soda/constants.h
@@ -132,6 +132,10 @@ base::Optional<SodaLanguagePackComponentConfig> GetLanguageComponentConfig( const std::string& language_name); +LanguageCode GetLanguageCodeByComponentId(const std::string& component_id); + +std::string GetLanguageName(LanguageCode language_code); + } // namespace speech #endif // COMPONENTS_SODA_CONSTANTS_H_
diff --git a/components/soda/soda_installer.cc b/components/soda/soda_installer.cc index 9fe046a..64df87d8 100644 --- a/components/soda/soda_installer.cc +++ b/components/soda/soda_installer.cc
@@ -10,6 +10,7 @@ #include "base/feature_list.h" #include "components/live_caption/pref_names.h" #include "components/prefs/pref_service.h" +#include "components/soda/constants.h" #include "components/soda/pref_names.h" #include "media/base/media_switches.h" @@ -70,14 +71,33 @@ observer.OnSodaInstalled(); } +void SodaInstaller::NotifyOnSodaLanguagePackInstalled( + speech::LanguageCode language_code) { + for (Observer& observer : observers_) + observer.OnSodaLanguagePackInstalled(language_code); +} + void SodaInstaller::NotifyOnSodaError() { for (Observer& observer : observers_) observer.OnSodaError(); } -void SodaInstaller::NotifyOnSodaProgress(int percent) { +void SodaInstaller::NotifyOnSodaLanguagePackError( + speech::LanguageCode language_code) { for (Observer& observer : observers_) - observer.OnSodaProgress(percent); + observer.OnSodaLanguagePackError(language_code); +} + +void SodaInstaller::NotifyOnSodaProgress(int combined_progress) { + for (Observer& observer : observers_) + observer.OnSodaProgress(combined_progress); +} + +void SodaInstaller::NotifyOnSodaLanguagePackProgress( + int language_progress, + LanguageCode language_code) { + for (Observer& observer : observers_) + observer.OnSodaLanguagePackProgress(language_progress, language_code); } void SodaInstaller::NotifySodaInstalledForTesting() {
diff --git a/components/soda/soda_installer.h b/components/soda/soda_installer.h index 79c0fa99..7365bf96 100644 --- a/components/soda/soda_installer.h +++ b/components/soda/soda_installer.h
@@ -8,6 +8,7 @@ #include "base/files/file_path.h" #include "base/observer_list.h" #include "components/prefs/pref_registry_simple.h" +#include "components/soda/constants.h" class PrefService; @@ -20,15 +21,30 @@ // Observer of the SODA (Speech On-Device API) installation. class Observer : public base::CheckedObserver { public: - // Called when the SODA installation has completed. + // Called when the SODA binary component and at least one language pack is + // installed. virtual void OnSodaInstalled() = 0; - // Called if there is an error in the SODA installation. + // Called when a SODA language pack component is installed. + virtual void OnSodaLanguagePackInstalled(LanguageCode language_code) = 0; + + // Called if there is an error in the SODA binary or language pack + // installation. virtual void OnSodaError() = 0; + // Called if there is an error in a SODA language pack installation. + virtual void OnSodaLanguagePackError( + speech::LanguageCode language_code) = 0; + + // Called during the SODA installation. Progress is the weighted average of + // the download percentage of the SODA binary and at least one language + // pack. + virtual void OnSodaProgress(int combined_progress) = 0; + // Called during the SODA installation. Progress is the download percentage // out of 100. - virtual void OnSodaProgress(int progress) = 0; + virtual void OnSodaLanguagePackProgress(int language_progress, + LanguageCode language_code) = 0; }; SodaInstaller(); @@ -100,15 +116,31 @@ // space may not be freed immediately. virtual void UninstallSoda(PrefService* global_prefs) = 0; - // Notifies the observers that the SODA installation has completed. + // Notifies the observers that the installation of the SODA binary and at + // least one language pack has completed. void NotifyOnSodaInstalled(); - // Notifies the observers that there is an error in the SODA installation. + // Notifies the observers that a SODA language pack installation has + // completed. + void NotifyOnSodaLanguagePackInstalled(speech::LanguageCode language_code); + + // Notifies the observers that there is an error in the SODA binary + // installation. void NotifyOnSodaError(); - // Notifies the observers of the progress percentage as SODA is installed/ - // Progress is the download percentage out of 100. - void NotifyOnSodaProgress(int progress); + // Notifies the observers that there is an error in a SODA language pack + // installation. + void NotifyOnSodaLanguagePackError(speech::LanguageCode language_code); + + // Notifies the observers of the combined progress as the SODA binary and + // language pack are installed. Progress is the download percentage out of + // 100. + void NotifyOnSodaProgress(int combined_progress); + + // Notifies the observers of the progress percentage the SODA language pack is + // installed. Progress is the download percentage out of 100. + void NotifyOnSodaLanguagePackProgress(int language_progress, + LanguageCode language_code); base::ObserverList<Observer> observers_; bool soda_binary_installed_ = false;
diff --git a/components/sync/driver/sync_session_durations_metrics_recorder.cc b/components/sync/driver/sync_session_durations_metrics_recorder.cc index 5d08d59..dbc25e59 100644 --- a/components/sync/driver/sync_session_durations_metrics_recorder.cc +++ b/components/sync/driver/sync_session_durations_metrics_recorder.cc
@@ -133,6 +133,12 @@ HandleSyncAndAccountChange(); } +void SyncSessionDurationsMetricsRecorder::OnPrimaryAccountChanged( + const signin::PrimaryAccountChangeEvent& event) { + DVLOG(1) << __func__; + HandleSyncAndAccountChange(); +} + void SyncSessionDurationsMetricsRecorder::OnRefreshTokenUpdatedForAccount( const CoreAccountInfo& account_info) { DVLOG(1) << __func__; @@ -182,7 +188,8 @@ void SyncSessionDurationsMetricsRecorder::HandleSyncAndAccountChange() { if (!sync_service_ || !sync_service_->CanSyncFeatureStart()) { // Only the account status needs to be updated when sync is off. - UpdateSyncAndAccountStatus(FeatureState::OFF, DetermineAccountStatus()); + UpdateSyncAndAccountStatus(FeatureState::OFF, + DeterminePrimaryAccountStatus()); return; } @@ -199,12 +206,7 @@ // We don't know yet if sync is going to work. // At least update the account status, so that if we never learn what the // sync state is, we know the signin state. - // - // TODO(msarda): The current code uses the account status for all accounts - // (i.e. it is not scoped to the sync account). Figure out whether this - // should be changed to only capture the status of the sync account when - // the user has opted in to sync. - account_status_ = DetermineAccountStatus(); + account_status_ = DeterminePrimaryAccountStatus(); } } @@ -262,15 +264,17 @@ } SyncSessionDurationsMetricsRecorder::FeatureState -SyncSessionDurationsMetricsRecorder::DetermineAccountStatus() const { - for (const auto& account : - identity_manager_->GetAccountsWithRefreshTokens()) { - if (!identity_manager_->HasAccountWithRefreshTokenInPersistentErrorState( - account.account_id)) { - return SyncSessionDurationsMetricsRecorder::FeatureState::ON; - } - } - return SyncSessionDurationsMetricsRecorder::FeatureState::OFF; +SyncSessionDurationsMetricsRecorder::DeterminePrimaryAccountStatus() const { + if (!identity_manager_->HasPrimaryAccount(signin::ConsentLevel::kSignin)) + return SyncSessionDurationsMetricsRecorder::FeatureState::OFF; + + CoreAccountId primary_account_id = + identity_manager_->GetPrimaryAccountId(signin::ConsentLevel::kSignin); + return (identity_manager_->HasAccountWithRefreshToken(primary_account_id) && + !identity_manager_->HasAccountWithRefreshTokenInPersistentErrorState( + primary_account_id)) + ? SyncSessionDurationsMetricsRecorder::FeatureState::ON + : SyncSessionDurationsMetricsRecorder::FeatureState::OFF; } } // namespace syncer
diff --git a/components/sync/driver/sync_session_durations_metrics_recorder.h b/components/sync/driver/sync_session_durations_metrics_recorder.h index 27d560c..9e382e3 100644 --- a/components/sync/driver/sync_session_durations_metrics_recorder.h +++ b/components/sync/driver/sync_session_durations_metrics_recorder.h
@@ -38,6 +38,8 @@ void OnStateChanged(syncer::SyncService* sync) override; // IdentityManager::Observer: + void OnPrimaryAccountChanged( + const signin::PrimaryAccountChangeEvent& event) override; void OnRefreshTokenUpdatedForAccount( const CoreAccountInfo& account_info) override; void OnRefreshTokenRemovedForAccount( @@ -67,9 +69,9 @@ void HandleSyncAndAccountChange(); - // Returns |FeatureState::ON| iff there is at least one account in - // |identity_manager| that has a valid refresh token. - FeatureState DetermineAccountStatus() const; + // Returns |FeatureState::ON| iff there is a primary account with a valid + // refresh token in the identity manager. + FeatureState DeterminePrimaryAccountStatus() const; SyncService* const sync_service_; signin::IdentityManager* const identity_manager_;
diff --git a/components/ui_devtools/views/ui_element_with_metadata.cc b/components/ui_devtools/views/ui_element_with_metadata.cc index 9f427503..e391c2b 100644 --- a/components/ui_devtools/views/ui_element_with_metadata.cc +++ b/components/ui_devtools/views/ui_element_with_metadata.cc
@@ -9,7 +9,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "components/ui_devtools/views/element_utility.h" -#include "ui/views/metadata/metadata_types.h" +#include "ui/base/metadata/metadata_types.h" namespace ui_devtools { @@ -49,12 +49,12 @@ class_properties.clear(); } - views::metadata::ClassMetaData* metadata = GetClassMetaData(); + ui::metadata::ClassMetaData* metadata = GetClassMetaData(); void* instance = GetClassInstance(); for (auto member = metadata->begin(); member != metadata->end(); member++) { auto flags = (*member)->GetPropertyFlags(); - if (!!(flags & views::metadata::PropertyFlags::kSerializable) || - !!(flags & views::metadata::PropertyFlags::kReadOnly)) { + if (!!(flags & ui::metadata::PropertyFlags::kSerializable) || + !!(flags & ui::metadata::PropertyFlags::kReadOnly)) { class_properties.emplace_back( (*member)->GetMemberNamePrefix() + (*member)->member_name(), base::UTF16ToUTF8((*member)->GetValueAsString(instance))); @@ -86,7 +86,7 @@ if (tokens.size() == 0UL) return false; - views::metadata::ClassMetaData* metadata = GetClassMetaData(); + ui::metadata::ClassMetaData* metadata = GetClassMetaData(); void* instance = GetClassInstance(); for (size_t i = 0; i < tokens.size() - 1; i += 2) { @@ -96,7 +96,7 @@ // Remove any type editor "prefixes" from the property name. StripPrefix(property_name); - views::metadata::MemberMetaDataBase* member = + ui::metadata::MemberMetaDataBase* member = metadata->FindMemberData(property_name); if (!member) { DLOG(ERROR) << "UI DevTools: Can not find property " << property_name @@ -115,9 +115,9 @@ } auto property_flags = member->GetPropertyFlags(); - if (!!(property_flags & views::metadata::PropertyFlags::kReadOnly)) + if (!!(property_flags & ui::metadata::PropertyFlags::kReadOnly)) continue; - DCHECK(!!(property_flags & views::metadata::PropertyFlags::kSerializable)); + DCHECK(!!(property_flags & ui::metadata::PropertyFlags::kSerializable)); member->SetValueAsString(instance, base::UTF8ToUTF16(property_value)); property_set = true; } @@ -129,7 +129,7 @@ if (GetLayer()) AddSource("ui/compositor/layer.h", 0); - for (views::metadata::ClassMetaData* metadata = GetClassMetaData(); + for (ui::metadata::ClassMetaData* metadata = GetClassMetaData(); metadata != nullptr; metadata = metadata->parent_class_meta_data()) { // If class has Metadata properties, add their sources. if (!metadata->members().empty()) {
diff --git a/components/ui_devtools/views/ui_element_with_metadata.h b/components/ui_devtools/views/ui_element_with_metadata.h index e91cf7e0a..d0d43b30 100644 --- a/components/ui_devtools/views/ui_element_with_metadata.h +++ b/components/ui_devtools/views/ui_element_with_metadata.h
@@ -11,9 +11,9 @@ #include <vector> #include "components/ui_devtools/ui_element.h" +#include "ui/base/metadata/metadata_types.h" #include "ui/compositor/layer.h" #include "ui/gfx/geometry/rect.h" -#include "ui/views/metadata/metadata_types.h" namespace ui_devtools { @@ -37,7 +37,7 @@ UIElement* parent); // Returns the metadata for the class instance type for this specific element. - virtual views::metadata::ClassMetaData* GetClassMetaData() const = 0; + virtual ui::metadata::ClassMetaData* GetClassMetaData() const = 0; // Returns an opaque pointer for the actual instance which this element // represents. virtual void* GetClassInstance() const = 0;
diff --git a/components/ui_devtools/views/view_element.cc b/components/ui_devtools/views/view_element.cc index ff2576b..274d3a837 100644 --- a/components/ui_devtools/views/view_element.cc +++ b/components/ui_devtools/views/view_element.cc
@@ -13,9 +13,9 @@ #include "components/ui_devtools/ui_element_delegate.h" #include "components/ui_devtools/views/devtools_event_util.h" #include "components/ui_devtools/views/element_utility.h" +#include "ui/base/metadata/metadata_types.h" #include "ui/gfx/color_utils.h" #include "ui/views/controls/textfield/textfield.h" -#include "ui/views/metadata/metadata_types.h" #include "ui/views/view_utils.h" #include "ui/views/widget/widget.h" @@ -207,7 +207,7 @@ return true; } -views::metadata::ClassMetaData* ViewElement::GetClassMetaData() const { +ui::metadata::ClassMetaData* ViewElement::GetClassMetaData() const { return view_->GetClassMetaData(); }
diff --git a/components/ui_devtools/views/view_element.h b/components/ui_devtools/views/view_element.h index 66cf9fa..b6a769bf 100644 --- a/components/ui_devtools/views/view_element.h +++ b/components/ui_devtools/views/view_element.h
@@ -46,7 +46,7 @@ bool DispatchKeyEvent(protocol::DOM::KeyEvent* event) override; protected: - views::metadata::ClassMetaData* GetClassMetaData() const override; + ui::metadata::ClassMetaData* GetClassMetaData() const override; void* GetClassInstance() const override; ui::Layer* GetLayer() const override;
diff --git a/components/ui_devtools/views/view_element_unittest.cc b/components/ui_devtools/views/view_element_unittest.cc index 92b614ed..1fe39ea 100644 --- a/components/ui_devtools/views/view_element_unittest.cc +++ b/components/ui_devtools/views/view_element_unittest.cc
@@ -9,7 +9,7 @@ #include "base/strings/utf_string_conversions.h" #include "components/ui_devtools/Protocol.h" #include "components/ui_devtools/ui_devtools_unittest_utils.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/test/views_test_base.h" namespace ui_devtools { @@ -94,7 +94,7 @@ BEGIN_METADATA(MockNamedTestView, views::View) ADD_PROPERTY_METADATA(bool, BoolProperty) -ADD_PROPERTY_METADATA(SkColor, ColorProperty, views::metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, ColorProperty, ui::metadata::SkColorConverter) END_METADATA class ViewElementTest : public views::ViewsTestBase {
diff --git a/components/ui_devtools/views/widget_element.cc b/components/ui_devtools/views/widget_element.cc index 6da1a86..d73c69f 100644 --- a/components/ui_devtools/views/widget_element.cc +++ b/components/ui_devtools/views/widget_element.cc
@@ -108,7 +108,7 @@ return true; } -views::metadata::ClassMetaData* WidgetElement::GetClassMetaData() const { +ui::metadata::ClassMetaData* WidgetElement::GetClassMetaData() const { return widget_->GetClassMetaData(); }
diff --git a/components/ui_devtools/views/widget_element.h b/components/ui_devtools/views/widget_element.h index a9b2463..38c75ac 100644 --- a/components/ui_devtools/views/widget_element.h +++ b/components/ui_devtools/views/widget_element.h
@@ -52,7 +52,7 @@ protected: ui::Layer* GetLayer() const override; - views::metadata::ClassMetaData* GetClassMetaData() const override; + ui::metadata::ClassMetaData* GetClassMetaData() const override; void* GetClassInstance() const override; private:
diff --git a/components/upload_list/combining_upload_list.cc b/components/upload_list/combining_upload_list.cc index d6139e8b..cf5cf6b 100644 --- a/components/upload_list/combining_upload_list.cc +++ b/components/upload_list/combining_upload_list.cc
@@ -47,3 +47,9 @@ sublist->ClearUploadList(begin, end); } } + +void CombiningUploadList::RequestSingleUpload(const std::string& local_id) { + for (const scoped_refptr<UploadList>& sublist : sublists_) { + sublist->RequestSingleUpload(local_id); + } +}
diff --git a/components/upload_list/combining_upload_list.h b/components/upload_list/combining_upload_list.h index bba6207e..0550223 100644 --- a/components/upload_list/combining_upload_list.h +++ b/components/upload_list/combining_upload_list.h
@@ -22,6 +22,7 @@ ~CombiningUploadList() override; std::vector<UploadInfo> LoadUploadList() override; void ClearUploadList(const base::Time& begin, const base::Time& end) override; + void RequestSingleUpload(const std::string& local_id) override; private: const std::vector<scoped_refptr<UploadList>> sublists_;
diff --git a/components/upload_list/combining_upload_list_unittest.cc b/components/upload_list/combining_upload_list_unittest.cc index e88d0119..8351fe3 100644 --- a/components/upload_list/combining_upload_list_unittest.cc +++ b/components/upload_list/combining_upload_list_unittest.cc
@@ -12,6 +12,7 @@ #include "base/test/task_environment.h" #include "base/time/time.h" #include "components/upload_list/text_log_upload_list.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -276,4 +277,26 @@ )"); } +class MockUploadList : public UploadList { + public: + MOCK_METHOD0(LoadUploadList, std::vector<UploadInfo>()); + MOCK_METHOD2(ClearUploadList, void(const base::Time&, const base::Time&)); + MOCK_METHOD1(RequestSingleUpload, void(const std::string&)); + + protected: + ~MockUploadList() final = default; +}; + +TEST_F(CombiningUploadListTest, RequestSingleUpload) { + auto mock_list1 = base::MakeRefCounted<MockUploadList>(); + auto mock_list2 = base::MakeRefCounted<MockUploadList>(); + auto combined_lists = base::MakeRefCounted<CombiningUploadList>( + std::vector<scoped_refptr<UploadList>>({mock_list1, mock_list2})); + + constexpr char kLocalId[] = "12345"; + EXPECT_CALL(*mock_list1, RequestSingleUpload(kLocalId)); + EXPECT_CALL(*mock_list2, RequestSingleUpload(kLocalId)); + combined_lists->RequestSingleUploadAsync(kLocalId); +} + } // namespace
diff --git a/components/vector_icons/BUILD.gn b/components/vector_icons/BUILD.gn index c4123667..80047676 100644 --- a/components/vector_icons/BUILD.gn +++ b/components/vector_icons/BUILD.gn
@@ -31,6 +31,7 @@ "description.icon", "devices.icon", "edit.icon", + "email.icon", "error.icon", "error_outline.icon", "ethernet.icon",
diff --git a/components/vector_icons/email.icon b/components/vector_icons/email.icon new file mode 100644 index 0000000..5e2190d --- /dev/null +++ b/components/vector_icons/email.icon
@@ -0,0 +1,23 @@ +// 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. + +CANVAS_DIMENSIONS, 24, +MOVE_TO, 20, 4, +H_LINE_TO, 4, +R_CUBIC_TO, -1.1f, 0, -1.99f, 0.9f, -1.99f, 2, +LINE_TO, 2, 18, +R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, +R_H_LINE_TO, 16, +R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, +V_LINE_TO, 6, +R_CUBIC_TO, 0, -1.1f, -0.9f, -2, -2, -2, +CLOSE, +R_MOVE_TO, 0, 4, +R_LINE_TO, -8, 5, +R_LINE_TO, -8, -5, +V_LINE_TO, 6, +R_LINE_TO, 8, 5, +R_LINE_TO, 8, -5, +R_V_LINE_TO, 2, +CLOSE
diff --git a/components/viz/OWNERS b/components/viz/OWNERS index 7815abbb..db011f8 100644 --- a/components/viz/OWNERS +++ b/components/viz/OWNERS
@@ -49,6 +49,10 @@ magchen@chromium.org petermcneeley@chromium.org +# viz debugger +petermcneeley@chromium.org +sadrul@chromium.org + # scheduling / begin frames sunnyps@chromium.org
diff --git a/components/viz/common/BUILD.gn b/components/viz/common/BUILD.gn index f1d04460..6869f9d 100644 --- a/components/viz/common/BUILD.gn +++ b/components/viz/common/BUILD.gn
@@ -2,15 +2,24 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/buildflag_header.gni") +import("//components/viz/common/debugger/viz_debugger.gni") import("//components/viz/viz.gni") import("//gpu/vulkan/features.gni") import("//skia/features.gni") import("//testing/test.gni") +import("//third_party/inspector_protocol/inspector_protocol.gni") + source_set("resource_format") { sources = [ "resources/resource_format.h" ] } +buildflag_header("buildflags") { + header = "buildflags.h" + flags = [ "USE_VIZ_DEBUGGER=$use_viz_debugger" ] +} + viz_component("resource_format_utils") { output_name = "viz_resource_format_utils" @@ -330,12 +339,14 @@ } public_deps = [ + ":buildflags", ":resource_format_utils", "//gpu/command_buffer/client", "//gpu/command_buffer/common", "//mojo/public/cpp/bindings", "//skia", ] + if (enable_vulkan) { public_deps += [ ":vulkan_context_provider" ] }
diff --git a/components/viz/common/debugger/viz_debugger.gni b/components/viz/common/debugger/viz_debugger.gni new file mode 100644 index 0000000..2c9354c --- /dev/null +++ b/components/viz/common/debugger/viz_debugger.gni
@@ -0,0 +1,10 @@ +# 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("//components/ui_devtools/devtools.gni") + +declare_args() { + # Indicates if the Viz Debugger is enabled. This is disabled by default on + # official builds due to security and performance reasons. + use_viz_debugger = use_viz_devtools && !is_official_build +}
diff --git a/components/viz/common/debugger/viz_debugger.pdl b/components/viz/common/debugger/viz_debugger.pdl new file mode 100644 index 0000000..b762f5d --- /dev/null +++ b/components/viz/common/debugger/viz_debugger.pdl
@@ -0,0 +1,32 @@ +# 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. + +version + major 1 + minor 0 + + +# The VisualDebugger domain defines methods and events for the Visual Debugger. +domain VisualDebugger + # Sends filtering information to the visual debugging instance. + command filterStream + parameters + # This string contains filtering information for the debugging stream. + # See: //components/viz/service/debugger/README.md + object filter + + # Starts communication stream for visual debugger. + command startStream + # Simply informs the visual debugger that debugging session has ended. + command stopStream + + # Frame data is sent from the debugging instance with this event. + # This event will be emitted every render frame. + event frameResponse + parameters + # This Json dictionary object contains one full frame + # of visual debug submissions. + # See: //components/viz/service/debugger/README.md + object frameData +
diff --git a/components/viz/host/gpu_host_impl.cc b/components/viz/host/gpu_host_impl.cc index b94d3c4..297165a 100644 --- a/components/viz/host/gpu_host_impl.cc +++ b/components/viz/host/gpu_host_impl.cc
@@ -14,6 +14,7 @@ #include "base/threading/thread_checker.h" #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/trace_event.h" +#include "base/values.h" #include "build/build_config.h" #include "components/viz/common/features.h" #include "gpu/config/gpu_driver_bug_workaround_type.h" @@ -275,6 +276,22 @@ channel_requests_.erase(client_id); } +#if BUILDFLAG(USE_VIZ_DEBUGGER) +void GpuHostImpl::FilterVisualDebugStream(base::Value json) { + viz_main_->FilterDebugStream(std::move(json)); +} + +void GpuHostImpl::StartVisualDebugStream( + base::RepeatingCallback<void(base::Value)> callback) { + viz_debug_output_callback_ = std::move(callback); + viz_main_->StartDebugStream(viz_debug_output_.BindNewPipeAndPassRemote()); +} + +void GpuHostImpl::StopVisualDebugStream() { + viz_main_->StopDebugStream(); + viz_debug_output_.reset(); +} +#endif void GpuHostImpl::SendOutstandingReplies() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -581,4 +598,11 @@ delegate_->RecordLogMessage(severity, header, message); } +#if BUILDFLAG(USE_VIZ_DEBUGGER) +void GpuHostImpl::LogFrame(base::Value frame_data) { + if (!viz_debug_output_callback_.is_null()) + viz_debug_output_callback_.Run(std::move(frame_data)); +} +#endif + } // namespace viz
diff --git a/components/viz/host/gpu_host_impl.h b/components/viz/host/gpu_host_impl.h index daa0a4a..31778511c1 100644 --- a/components/viz/host/gpu_host_impl.h +++ b/components/viz/host/gpu_host_impl.h
@@ -20,9 +20,11 @@ #include "base/process/process_handle.h" #include "base/sequence_checker.h" #include "base/timer/timer.h" +#include "base/values.h" #include "build/build_config.h" #include "components/discardable_memory/public/mojom/discardable_shared_memory_manager.mojom.h" #include "components/ui_devtools/buildflags.h" +#include "components/viz/common/buildflags.h" #include "components/viz/host/viz_host_export.h" #include "gpu/command_buffer/common/activity_flags.h" #include "gpu/config/gpu_domain_guilt.h" @@ -54,7 +56,12 @@ namespace viz { -class VIZ_HOST_EXPORT GpuHostImpl : public mojom::GpuHost { +class VIZ_HOST_EXPORT GpuHostImpl : public mojom::GpuHost +#if BUILDFLAG(USE_VIZ_DEBUGGER) + , + public mojom::VizDebugOutput +#endif +{ public: class VIZ_HOST_EXPORT Delegate { public: @@ -176,6 +183,19 @@ EstablishChannelCallback callback); void CloseChannel(int client_id); +#if BUILDFLAG(USE_VIZ_DEBUGGER) + // Command as a Json string that the visual debugging instance interprets as + // stream filtering. + void FilterVisualDebugStream(base::Value filter_data); + + // Establishes the connection between the visual debugging instance and the + // output stream. + void StartVisualDebugStream( + base::RepeatingCallback<void(base::Value)> callback); + + void StopVisualDebugStream(); +#endif + void SendOutstandingReplies(); void BindInterface(const std::string& interface_name, @@ -246,6 +266,11 @@ const std::string& header, const std::string& message) override; + // Implements mojom::VizDebugOutput and is called by VizDebugger. +#if BUILDFLAG(USE_VIZ_DEBUGGER) + void LogFrame(base::Value frame_data) override; +#endif + Delegate* const delegate_; mojo::Remote<mojom::VizMain> viz_main_; const InitParams params_; @@ -261,6 +286,11 @@ mojo::Receiver<mojom::GpuHost> gpu_host_receiver_{this}; gpu::GpuProcessHostActivityFlags activity_flags_; +#if BUILDFLAG(USE_VIZ_DEBUGGER) + mojo::Receiver<mojom::VizDebugOutput> viz_debug_output_{this}; + base::RepeatingCallback<void(base::Value)> viz_debug_output_callback_; +#endif + base::ProcessId pid_ = base::kNullProcessId; // List of connection error handlers for the GpuService.
diff --git a/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc b/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc index 410e9e9..996fd0e 100644 --- a/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc +++ b/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc
@@ -222,8 +222,6 @@ void ThrowJavaException() override {} - void Stop(StopCallback callback) override {} - private: base::OnceClosure connection_error_handler_;
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn index 159fa9e..2ff8732 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn
@@ -16,6 +16,8 @@ viz_component("service") { sources = [ + "debugger/viz_debugger.cc", + "debugger/viz_debugger.h", "display/aggregated_frame.cc", "display/aggregated_frame.h", "display/bsp_tree.cc", @@ -522,6 +524,7 @@ viz_source_set("unit_tests") { testonly = true sources = [ + "debugger/viz_debugger_unittest.cc", "display/bsp_tree_unittest.cc", "display/copy_output_scaling_pixeltest.cc", "display/delegated_ink_point_pixel_test_helper.cc",
diff --git a/components/viz/service/DEPS b/components/viz/service/DEPS index 00c1c1c..e7f63ed4 100644 --- a/components/viz/service/DEPS +++ b/components/viz/service/DEPS
@@ -6,6 +6,7 @@ "-components/viz/common/features.h", "-components/viz/common/switches.h", "-components/viz/service", + "+components/viz/service/debugger/viz_debugger.h", "+components/viz/service/gl/gpu_service_impl.h", "+components/viz/service/viz_service_export.h", "+gpu/config/gpu_feature_info.h",
diff --git a/components/viz/service/debugger/DEPS b/components/viz/service/debugger/DEPS new file mode 100644 index 0000000..9263a086 --- /dev/null +++ b/components/viz/service/debugger/DEPS
@@ -0,0 +1,9 @@ +# Please consult components/viz/README.md about allowable dependencies. + +include_rules = [ + "+components/viz", + "+ui/base", + "+ui/gfx", + "+mojo/public", +] +
diff --git a/components/viz/service/debugger/README.md b/components/viz/service/debugger/README.md new file mode 100644 index 0000000..01d4385 --- /dev/null +++ b/components/viz/service/debugger/README.md
@@ -0,0 +1,62 @@ +# //components/viz/service/debugger + +## Viz Remote Visual Debugger + +The Viz Remote Debugger is a debug only connection that allows an active chromium instance to send graphical and text debug information to a remote client for display. + +### Motivation +[Visual Debugger one-pager](https://docs.google.com/document/d/1s2OLZcUrUxXRxOD8nR4giNRnCQZcdtXBp4DUI_Fb2GU/edit?usp=sharing). + + +### Usage +Macros constitute the full Viz Debugger logging API (as far as a nominal chromium developer is concerned). + +These macros tend to take the basic form below: + +DBG_DRAW_RECT(anno, rect); + +This macro will log a rect to the viz debugger for this frame. +anno - short for Annotation. This must be a string literal. The remote can filter on anno (as well as file and function). +rect - a (gfx::) rect. Expected dimensions is in pixels. + +Unlike a debugging session printfs these logging macros can be remain the chromium source. This allows developers to use these debug logs in future sessions and other share them with other developers. + + +The full list of these macros can be found in VizDebugger.h +At present, Visual debugging is currently limited to the VizCompositor thread. + + +### Operation +The debugging macros feed information into the VizDebugger static instance. At the end of each frame this cached information is fed upstream and eventually reaches the remote client. + +[Viz Debugger Communication](https://docs.google.com/drawings/d/11zqorcaRuyGx7W2AdL-7hSQJG0wknm0-RDkZSyobmy4/edit?usp=sharing) + + +### Performance +The logging performance of this system has several variants depending on the configuration. + +* Disabled at Compile time + + Zero overhead with the exception of mutable side effects in the creation of input variables. + +* Disabled at Runtime + + Every log call must check the debugging instance. This case has been optimized to be one memory read instruction followed by one predictable branch. + +* Disabled by Source Filter + + Must read the local static data to determine if this specific logging is enabled. This is on the order of tens of instructions. + +* Enabled + + Submits data into VizDebugger buffers. On the order of 100 instructions with the exception of when these buffers need to expand. + + +Additional performance overhead of this system comes from when the collected data is serialized and sent upstream. Unlike the logging submission overhead, this overhead is very easy to track and currently is not consider to be a concern. + + +### Security + +For official builds all visual debug macros are compiled out and the VizDebugger is reduced to a selective few method stubs. This means there are no security concerns for this system with exception of mutable side effects in the creation of input variables to the logging macros. These concerns for mutable side effects already exist for any other code; so no special attention is warranted for these macros. + +For non-official (debug) builds the dev-tools remote debugging port command line argument must be provided for the viz debugger to collect and stream data. Thus the security of this new system is identical to that of the remote dev tools for the case of debugging builds.
diff --git a/components/viz/service/debugger/viz_debugger.cc b/components/viz/service/debugger/viz_debugger.cc new file mode 100644 index 0000000..01ed564 --- /dev/null +++ b/components/viz/service/debugger/viz_debugger.cc
@@ -0,0 +1,339 @@ +// Copyright 2020 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 <algorithm> +#include <atomic> +#include <string> +#include <utility> + +#include "base/strings/string_number_conversions.h" +#include "base/values.h" +#include "components/viz/service/debugger/viz_debugger.h" + +#if VIZ_DEBUGGER_IS_ON() + +#include "base/json/json_reader.h" +#include "base/json/json_writer.h" +#include "base/threading/sequenced_task_runner_handle.h" + +namespace viz { + +std::atomic<bool> VizDebugger::enabled_; + +VizDebugger* VizDebugger::GetInstance() { + static VizDebugger g_debugger; + return &g_debugger; +} + +VizDebugger::FilterBlock::FilterBlock(const std::string file_str, + const std::string func_str, + const std::string anno_str, + bool is_active) + : file(std::move(file_str)), + func(std::move(func_str)), + anno(std::move(anno_str)), + active(is_active) {} + +VizDebugger::FilterBlock::~FilterBlock() = default; + +VizDebugger::FilterBlock::FilterBlock(const FilterBlock& other) = default; + +base::DictionaryValue VizDebugger::CallSubmitCommon::GetDictionaryValue() + const { + base::DictionaryValue option_dict; + option_dict.SetString("color", + base::StringPrintf("#%02x%02x%02x", option.color_r, + option.color_g, option.color_b)); + option_dict.SetInteger("alpha", option.color_a); + + base::DictionaryValue dict; + dict.SetInteger("drawindex", draw_index); + dict.SetInteger("source_index", source_index); + dict.SetKey("option", std::move(option_dict)); + return dict; +} + +VizDebugger::StaticSource::StaticSource(const char* anno_name, + const char* file_name, + int file_line, + const char* func_name) + : anno(anno_name), file(file_name), func(func_name), line(file_line) { + VizDebugger::GetInstance()->RegisterSource(this); +} + +VizDebugger::VizDebugger() + : gpu_thread_task_runner_(base::SequencedTaskRunnerHandle::Get()) { + DETACH_FROM_THREAD(viz_compositor_thread_checker_); + enabled_.store(false); +} + +VizDebugger::~VizDebugger() = default; + +base::Value VizDebugger::FrameAsJson(const uint64_t counter, + const gfx::Size& window_pix, + base::TimeTicks time_ticks) { + // TODO(petermcneeley): When we move to multithread we need to do something + // like an atomic swap here. Currently all multithreading concerns are handled + // by having a lock around the |json_frame_output_| object. + common_lock_.AssertAcquired(); + submission_count_ = 0; + + base::DictionaryValue global_dict; + global_dict.SetString("frame", base::NumberToString(counter)); + global_dict.SetInteger("windowx", window_pix.width()); + global_dict.SetInteger("windowy", window_pix.height()); + global_dict.SetString( + "time", base::NumberToString(time_ticks.since_origin().InMicroseconds())); + + base::ListValue new_sources; + for (size_t i = last_sent_source_count_; i < sources_.size(); i++) { + const StaticSource* each = sources_[i]; + base::DictionaryValue dict; + dict.SetString("file", each->file); + dict.SetInteger("line", each->line); + dict.SetString("func", each->func); + dict.SetString("anno", each->anno); + dict.SetInteger("index", each->reg_index); + new_sources.Append(std::move(dict)); + } + + // Remote connection will now have acknowledged all the new sources. + last_sent_source_count_ = sources_.size(); + global_dict.SetKey("new_sources", std::move(new_sources)); + + base::ListValue draw_calls; + for (auto&& each : draw_rect_calls_) { + base::DictionaryValue dict = each.GetDictionaryValue(); + { + base::ListValue list_xy; + list_xy.AppendInteger(each.obj_size.width()); + list_xy.AppendInteger(each.obj_size.height()); + dict.SetKey("size", std::move(list_xy)); + } + { + base::ListValue list_xy; + list_xy.AppendDouble(each.pos.x()); + list_xy.AppendDouble(each.pos.y()); + dict.SetKey("pos", std::move(list_xy)); + } + + draw_calls.Append(std::move(dict)); + } + global_dict.SetKey("drawcalls", std::move(draw_calls)); + + base::ListValue logs; + for (auto&& log : logs_) { + base::DictionaryValue dict = log.GetDictionaryValue(); + dict.SetString("value", std::move(log.value)); + logs.Append(std::move(dict)); + } + global_dict.SetKey("logs", std::move(logs)); + + base::ListValue texts; + for (auto&& text : draw_text_calls_) { + base::DictionaryValue dict = text.GetDictionaryValue(); + { + base::ListValue list_xy; + list_xy.AppendDouble(text.pos.x()); + list_xy.AppendDouble(text.pos.y()); + dict.SetKey("pos", std::move(list_xy)); + } + dict.SetString("text", text.text); + texts.Append(std::move(dict)); + } + global_dict.SetKey("text", std::move(texts)); + + logs_.clear(); + draw_rect_calls_.clear(); + draw_text_calls_.clear(); + return std::move(global_dict); +} + +void VizDebugger::UpdateFilters() { + common_lock_.AssertAcquired(); + if (apply_new_filters_next_frame_) { + cached_filters_ = new_filters_; + for (auto&& source : sources_) { + ApplyFilters(source); + } + new_filters_.clear(); + apply_new_filters_next_frame_ = false; + } +} + +void VizDebugger::CompleteFrame(uint64_t counter, + const gfx::Size& window_pix, + base::TimeTicks time_ticks) { + DCHECK_CALLED_ON_VALID_THREAD(viz_compositor_thread_checker_); + base::AutoLock scoped_lock(common_lock_); + UpdateFilters(); + json_frame_output_ = FrameAsJson(counter, window_pix, time_ticks); + gpu_thread_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&VizDebugger::AddFrame, base::Unretained(this))); +} + +void VizDebugger::ApplyFilters(VizDebugger::StaticSource* src) { + // In the case of no filters we disable this source. + src->active = false; + + // TODO(petermcneeley): We should probably make this string filtering more + // optimal. However, for the most part it the cost is only paid on the + // application of new filters. + auto simple_match = [](const char* source_str, + const std::string& filter_match) { + if (filter_match.empty() || source_str == nullptr) { + return true; + } + return std::strstr(source_str, filter_match.c_str()) != nullptr; + }; + + for (const auto& filter_block : cached_filters_) { + if (simple_match(src->file, filter_block.file) && + simple_match(src->func, filter_block.func) && + simple_match(src->anno, filter_block.anno)) { + src->active = filter_block.active; + } + } +} + +void VizDebugger::RegisterSource(StaticSource* src) { + DCHECK_CALLED_ON_VALID_THREAD(viz_compositor_thread_checker_); + int index = sources_.size(); + src->reg_index = index; + ApplyFilters(src); + sources_.push_back(src); +} + +void VizDebugger::Draw(const gfx::SizeF& obj_size, + const gfx::Vector2dF& pos, + const VizDebugger::StaticSource* dcs, + VizDebugger::DrawOption option) { + DCHECK_CALLED_ON_VALID_THREAD(viz_compositor_thread_checker_); + Draw(gfx::Size(obj_size.width(), obj_size.height()), pos, dcs, option); +} + +void VizDebugger::Draw(const gfx::Size& obj_size, + const gfx::Vector2dF& pos, + const VizDebugger::StaticSource* dcs, + VizDebugger::DrawOption option) { + DCHECK_CALLED_ON_VALID_THREAD(viz_compositor_thread_checker_); + DrawInternal(obj_size, pos, dcs, option); +} + +void VizDebugger::DrawInternal(const gfx::Size& obj_size, + const gfx::Vector2dF& pos, + const VizDebugger::StaticSource* dcs, + VizDebugger::DrawOption option) { + DCHECK_CALLED_ON_VALID_THREAD(viz_compositor_thread_checker_); + draw_rect_calls_.emplace_back(submission_count_++, dcs->reg_index, option, + obj_size, pos); +} + +void VizDebugger::DrawText(const gfx::Point& pos, + const std::string& text, + const VizDebugger::StaticSource* dcs, + VizDebugger::DrawOption option) { + DCHECK_CALLED_ON_VALID_THREAD(viz_compositor_thread_checker_); + DrawText(gfx::Vector2dF(pos.x(), pos.y()), text, dcs, option); +} + +void VizDebugger::DrawText(const gfx::Vector2dF& pos, + const std::string& text, + const VizDebugger::StaticSource* dcs, + VizDebugger::DrawOption option) { + DCHECK_CALLED_ON_VALID_THREAD(viz_compositor_thread_checker_); + draw_text_calls_.emplace_back(submission_count_++, dcs->reg_index, option, + pos, text); +} + +void VizDebugger::AddFrame() { + // TODO(petermcneeley): This code has duel thread entry. One to launch the + // task and one for the task to run. We should improve on this design in the + // future and have a better multithreaded frame data aggregation system. + base::AutoLock scoped_lock(common_lock_); + DCHECK(gpu_thread_task_runner_->RunsTasksInCurrentSequence()); + if (debug_output_.is_bound()) { + debug_output_->LogFrame(std::move(json_frame_output_)); + } +} + +void VizDebugger::FilterDebugStream(base::Value json) { + base::AutoLock scoped_lock(common_lock_); + DCHECK(gpu_thread_task_runner_->RunsTasksInCurrentSequence()); + const base::Value* value = &(json); + const base::Value* filterlist = value->FindPath("filters"); + + if (!filterlist || !filterlist->is_list()) { + LOG(ERROR) << "Missing filter list in json: " << json; + return; + } + + new_filters_.clear(); + + for (const auto& filter : filterlist->GetList()) { + const base::Value* file = filter.FindPath("selector.file"); + const base::Value* func = filter.FindPath("selector.func"); + const base::Value* anno = filter.FindPath("selector.anno"); + const base::Value* active = filter.FindPath("active"); + + if (!active) { + LOG(ERROR) << "Missing filter props in json: " << json; + return; + } + + if ((file && !file->is_string()) || (func && !func->is_string()) || + (anno && !anno->is_string()) || !active->is_bool()) { + LOG(ERROR) << "Filter props wrong type in json: " << json; + continue; + } + + auto check_str = [](const base::Value* filter_str) { + return (filter_str ? filter_str->GetString() : std::string()); + }; + + new_filters_.emplace_back(check_str(file), check_str(func), check_str(anno), + active->GetBool()); + } + + apply_new_filters_next_frame_ = true; +} + +void VizDebugger::StartDebugStream( + mojo::PendingRemote<mojom::VizDebugOutput> pending_debug_output) { + base::AutoLock scoped_lock(common_lock_); + DCHECK(gpu_thread_task_runner_->RunsTasksInCurrentSequence()); + debug_output_.Bind(std::move(pending_debug_output)); + debug_output_.reset_on_disconnect(); + last_sent_source_count_ = 0; + + // Reset our filters for our new connection. By default the client will send + // along the new filters after establishing the connection. + new_filters_.clear(); + apply_new_filters_next_frame_ = true; + + base::DictionaryValue dict; + dict.SetString("connection", "ok"); + debug_output_->LogFrame(std::move(dict)); + + enabled_.store(true); +} + +void VizDebugger::StopDebugStream() { + base::AutoLock scoped_lock(common_lock_); + DCHECK(gpu_thread_task_runner_->RunsTasksInCurrentSequence()); + debug_output_.reset(); + enabled_.store(false); +} + +void VizDebugger::AddLogMessage(std::string log, + const VizDebugger::StaticSource* dcs, + DrawOption option) { + DCHECK_CALLED_ON_VALID_THREAD(viz_compositor_thread_checker_); + logs_.emplace_back(submission_count_++, dcs->reg_index, option, + std::move(log)); +} + +} // namespace viz + +#endif // VIZ_DEBUGGER_IS_ON()
diff --git a/components/viz/service/debugger/viz_debugger.h b/components/viz/service/debugger/viz_debugger.h new file mode 100644 index 0000000..b5fb992 --- /dev/null +++ b/components/viz/service/debugger/viz_debugger.h
@@ -0,0 +1,328 @@ +// Copyright 2020 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 COMPONENTS_VIZ_SERVICE_DEBUGGER_VIZ_DEBUGGER_H_ +#define COMPONENTS_VIZ_SERVICE_DEBUGGER_VIZ_DEBUGGER_H_ + +#include <atomic> +#include <string> +#include <utility> +#include <vector> + +#include "base/debug/debugging_buildflags.h" +#include "base/sequenced_task_runner.h" +#include "base/strings/stringprintf.h" +#include "base/synchronization/lock.h" +#include "base/time/time.h" +#include "base/values.h" +#include "components/viz/common/buildflags.h" +#include "components/viz/service/viz_service_export.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/remote.h" +#include "services/viz/privileged/mojom/viz_main.mojom.h" +#include "ui/gfx/geometry/vector2d_f.h" + +// The visual debugger can be completely disabled/enabled at compile time via +// the |USE_VIZ_DEBUGGER| build flag which corresponds to boolean gn arg +// 'use_viz_debugger'. Consult README.md for more information. + +#if BUILDFLAG(USE_VIZ_DEBUGGER) + +#define VIZ_DEBUGGER_IS_ON() true + +namespace viz { + +class VIZ_SERVICE_EXPORT VizDebugger { + public: + // These functions are called on a gpu thread that is not the + // 'VizCompositorThread' and therefore have mulithreaded considerations. + void FilterDebugStream(base::Value json); + void StartDebugStream( + mojo::PendingRemote<mojom::VizDebugOutput> pending_debug_output); + void StopDebugStream(); + + struct VIZ_SERVICE_EXPORT StaticSource { + StaticSource(const char* anno_name, + const char* file_name, + int file_line, + const char* func_name); + inline bool IsActive() const { return active; } + const char* anno; + const char* file; + const char* func; + const int line; + + int reg_index; + bool active; + }; + + struct DrawOption { + // TODO(petermcneeley): Consider moving this custom rgba color data over to + // |SkColor| representation. + uint8_t color_r; + uint8_t color_g; + uint8_t color_b; + // Alpha is applied to rect fill only. + uint8_t color_a; + }; + + static ALWAYS_INLINE bool IsEnabled() { + return enabled_.load(std::memory_order_acquire); + } + + static VizDebugger* GetInstance(); + + ~VizDebugger(); + + void CompleteFrame(const uint64_t counter, + const gfx::Size& window_pix, + base::TimeTicks time_ticks); + void DrawText(const gfx::Point& pos, + const std::string& text, + const StaticSource* dcs, + DrawOption option); + void DrawText(const gfx::Vector2dF& pos, + const std::string& text, + const StaticSource* dcs, + DrawOption option); + void Draw(const gfx::Size& obj_size, + const gfx::Vector2dF& pos, + const StaticSource* dcs, + DrawOption option); + void Draw(const gfx::SizeF& obj_size, + const gfx::Vector2dF& pos, + const StaticSource* dcs, + DrawOption option); + + void AddLogMessage(std::string log, + const StaticSource* dcs, + DrawOption option); + + VizDebugger(const VizDebugger&) = delete; + VizDebugger& operator=(const VizDebugger&) = delete; + + private: + friend class VizDebuggerInternal; + static std::atomic<bool> enabled_; + VizDebugger(); + base::Value FrameAsJson(const uint64_t counter, + const gfx::Size& window_pix, + base::TimeTicks time_ticks); + + void AddFrame(); + void UpdateFilters(); + void RegisterSource(StaticSource* source); + void DrawInternal(const gfx::Size& obj_size, + const gfx::Vector2dF& pos, + const StaticSource* dcs, + DrawOption option); + void ApplyFilters(VizDebugger::StaticSource* source); + mojo::Remote<mojom::VizDebugOutput> debug_output_; + + // This |task_runner_| is required to send json through mojo. + scoped_refptr<base::SequencedTaskRunner> gpu_thread_task_runner_; + + struct CallSubmitCommon { + CallSubmitCommon(int index, int source, DrawOption draw_option) + : draw_index(index), source_index(source), option(draw_option) {} + base::DictionaryValue GetDictionaryValue() const; + int draw_index; + int source_index; + VizDebugger::DrawOption option; + }; + + struct DrawCall : public CallSubmitCommon { + DrawCall(int index, + int source, + DrawOption draw_option, + gfx::Size size, + gfx::Vector2dF position) + : CallSubmitCommon(index, source, draw_option), + obj_size(size), + pos(position) {} + gfx::Size obj_size; + gfx::Vector2dF pos; + }; + + struct DrawTextCall : public CallSubmitCommon { + DrawTextCall(int index, + int source, + DrawOption draw_option, + gfx::Vector2dF position, + std::string str) + : CallSubmitCommon(index, source, draw_option), + pos(position), + text(str) {} + gfx::Vector2dF pos; + std::string text; + }; + + struct LogCall : public CallSubmitCommon { + LogCall(int index, int source, DrawOption draw_option, std::string str) + : CallSubmitCommon(index, source, draw_option), value(std::move(str)) {} + std::string value; + }; + + struct FilterBlock { + FilterBlock(const std::string file_str, + const std::string func_str, + const std::string anno_str, + bool is_active); + ~FilterBlock(); + FilterBlock(const FilterBlock& other); + std::string file; + std::string func; + std::string anno; + bool active; + }; + + // Synchronize access to the variables in the block below as it is mutated by + // multiple threads. + base::Lock common_lock_; + // New filters to promoted to cached filters on next frame. + std::vector<FilterBlock> new_filters_; + bool apply_new_filters_next_frame_ = false; + // Json is saved out every frame on the call to 'CompleteFrame' but may not be + // uploaded immediately due to task runner sequencing. + base::Value json_frame_output_; + size_t last_sent_source_count_ = 0; + + // Cached filters to apply filtering to new sources not just on filter update. + std::vector<FilterBlock> cached_filters_; + // Common counter for all submissions. + int submission_count_ = 0; + std::vector<DrawCall> draw_rect_calls_; + std::vector<DrawTextCall> draw_text_calls_; + std::vector<LogCall> logs_; + std::vector<StaticSource*> sources_; + + THREAD_CHECKER(viz_compositor_thread_checker_); +}; + +} // namespace viz + +#define DBG_OPT_RED \ + (viz::VizDebugger::DrawOption) { 255, 0, 0, 0 } +#define DBG_OPT_GREEN \ + (viz::VizDebugger::DrawOption) { 0, 255, 0, 0 } +#define DBG_OPT_BLUE \ + (viz::VizDebugger::DrawOption) { 0, 0, 255, 0 } +#define DBG_OPT_BLACK \ + (viz::VizDebugger::DrawOption) { 0, 0, 0, 0 } + +#define DBG_DRAW_RECTANGLE_OPT(anno, option, pos, size) \ + do { \ + if (viz::VizDebugger::IsEnabled()) { \ + static VizDebugger::StaticSource dcs(anno, __FILE__, __LINE__, \ + __func__); \ + if (dcs.IsActive()) { \ + viz::VizDebugger::GetInstance()->Draw(size, pos, &dcs, option); \ + } \ + } \ + } while (0) + +#define DBG_DRAW_RECTANGLE(anno, pos, size) \ + DBG_DRAW_RECTANGLE_OPT(anno, DBG_OPT_BLACK, pos, size) + +#define DBG_DRAW_TEXT_OPT(anno, option, pos, text) \ + do { \ + if (viz::VizDebugger::IsEnabled()) { \ + static VizDebugger::StaticSource dcs(anno, __FILE__, __LINE__, \ + __func__); \ + if (dcs.IsActive()) { \ + viz::VizDebugger::GetInstance()->DrawText(pos, text, &dcs, option); \ + } \ + } \ + } while (0) + +#define DBG_DRAW_TEXT(anno, pos, text) \ + DBG_DRAW_TEXT_OPT(anno, DBG_OPT_BLACK, pos, text) + +#define DBG_LOG_OPT(anno, option, format, ...) \ + do { \ + if (VizDebugger::IsEnabled()) { \ + static VizDebugger::StaticSource dcs(anno, __FILE__, __LINE__, \ + __func__); \ + if (dcs.IsActive()) { \ + VizDebugger::GetInstance()->AddLogMessage( \ + base::StringPrintf(format, __VA_ARGS__), &dcs, option); \ + } \ + } \ + } while (0) + +#define DBG_LOG(anno, format, ...) \ + DBG_LOG_OPT(anno, DBG_OPT_BLACK, format, __VA_ARGS__) + +#define DBG_DRAW_RECT_OPT(anno, option, rect) \ + DBG_DRAW_RECTANGLE( \ + anno, gfx::Vector2dF(rect.origin().x(), rect.origin().y()), rect.size()) + +#define DBG_DRAW_RECT(anno, rect) DBG_DRAW_RECT_OPT(anno, DBG_OPT_BLACK, rect) + +#else // !BUILDFLAG(USE_VIZ_DEBUGGER) + +#define VIZ_DEBUGGER_IS_ON() false + +// Viz Debugger is not enabled. The |VizDebugger| class is minimally defined to +// reduce the need for if/def checks in external code. All debugging macros +// compiled to empty statements but do eat some parameters to prevent used +// variable warnings. + +namespace viz { +class VIZ_SERVICE_EXPORT VizDebugger { + public: + VizDebugger() = default; + static inline VizDebugger* GetInstance() { + static VizDebugger g_debugger; + return &g_debugger; + } + inline void CompleteFrame(uint64_t counter, + const gfx::Size& window_pix, + base::TimeTicks time_ticks) {} + + static inline bool IsEnabled() { return false; } + VizDebugger(const VizDebugger&) = delete; + VizDebugger& operator=(const VizDebugger&) = delete; +}; +} // namespace viz + +#define DBG_OPT_RED 0 + +#define DBG_OPT_GREEN 0 + +#define DBG_OPT_BLUE 0 + +#define DBG_OPT_BLACK 0 + +#define DBG_DRAW_RECTANGLE_OPT(anno, option, pos, size) \ + ANALYZER_ALLOW_UNUSED(anno) \ + ANALYZER_ALLOW_UNUSED(option) \ + ANALYZER_ALLOW_UNUSED(pos) ANALYZER_ALLOW_UNUSED(size) + +#define DBG_DRAW_RECTANGLE(anno, pos, size) \ + DBG_DRAW_RECTANGLE_OPT(anno, DBG_OPT_BLACK, pos, size) + +#define DBG_DRAW_TEXT_OPT(anno, option, pos, text) \ + ANALYZER_ALLOW_UNUSED(anno) \ + ANALYZER_ALLOW_UNUSED(option) \ + ANALYZER_ALLOW_UNUSED(pos) ANALYZER_ALLOW_UNUSED(text) + +#define DBG_DRAW_TEXT(anno, pos, text) \ + DBG_DRAW_TEXT_OPT(anno, DBG_OPT_BLACK, pos, text) + +#define DBG_LOG_OPT(anno, option, format, ...) \ + ANALYZER_ALLOW_UNUSED(anno) \ + ANALYZER_ALLOW_UNUSED(option) ANALYZER_ALLOW_UNUSED(format) + +#define DBG_LOG(anno, format, ...) DBG_LOG_OPT(anno, DBG_OPT_BLACK, format, ...) + +#define DBG_DRAW_RECT_OPT(anno, option, rect) \ + ANALYZER_ALLOW_UNUSED(anno) \ + ANALYZER_ALLOW_UNUSED(option) ANALYZER_ALLOW_UNUSED(rect) + +#define DBG_DRAW_RECT(anno, rect) DBG_DRAW_RECT_OPT(anno, DBG_OPT_BLACK, rect) + +#endif // BUILDFLAG(USE_VIZ_DEBUGGER) + +#endif // COMPONENTS_VIZ_SERVICE_DEBUGGER_VIZ_DEBUGGER_H_
diff --git a/components/viz/service/debugger/viz_debugger_unittest.cc b/components/viz/service/debugger/viz_debugger_unittest.cc new file mode 100644 index 0000000..8d76c99 --- /dev/null +++ b/components/viz/service/debugger/viz_debugger_unittest.cc
@@ -0,0 +1,386 @@ +// 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 <stddef.h> + +#include <cstdio> +#include <unordered_map> +#include <utility> +#include <vector> + +#include "base/bind.h" +#include "base/callback_helpers.h" +#include "base/json/json_reader.h" +#include "base/strings/stringprintf.h" +#include "base/time/time.h" +#include "components/viz/service/debugger/viz_debugger.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/gfx/geometry/vector2d_f.h" + +#if VIZ_DEBUGGER_IS_ON() +using testing::_; +using testing::Mock; + +namespace viz { + +class VizDebuggerInternal : public VizDebugger { + public: + void ForceEnabled() { enabled_ = true; } + bool Reset(); + + int GetSourceCount() { return static_cast<int>(sources_.size()); } + + using VizDebugger::CallSubmitCommon; + using VizDebugger::common_lock_; + using VizDebugger::DrawCall; + using VizDebugger::DrawTextCall; + using VizDebugger::FrameAsJson; + using VizDebugger::LogCall; + using VizDebugger::UpdateFilters; +}; + +bool VizDebuggerInternal::Reset() { + submission_count_ = 0; + draw_rect_calls_.clear(); + draw_text_calls_.clear(); + logs_.clear(); + last_sent_source_count_ = 0; + sources_.clear(); + return true; +} + +namespace { + +struct TestFilter { + std::string anno; + std::string func; + std::string file; + bool active = true; +}; + +static_assert(sizeof(VizDebuggerInternal) == sizeof(VizDebugger), + "This test code exposes the internals of |VizDebugger| via an " + "upcast; thus they must be the same size."); + +class VisualDebuggerTest : public testing::Test { + protected: + VizDebuggerInternal* GetInternal() { + return static_cast<VizDebuggerInternal*>(VizDebugger::GetInstance()); + } + + void SetUp() override { GetInternal()->Reset(); } + void TearDown() override { GetInternal()->Reset(); } + + void SetFilter(std::vector<TestFilter> filters) { + base::DictionaryValue filters_json; + base::ListValue filters_list; + for (auto&& each : filters) { + base::DictionaryValue full_filter; + base::DictionaryValue selector; + if (!each.file.empty()) + selector.SetString("file", each.file); + + if (!each.func.empty()) + selector.SetString("func", each.func); + + selector.SetString("anno", each.anno); + + full_filter.SetKey("selector", std::move(selector)); + full_filter.SetBoolean("active", each.active); + filters_list.Append(std::move(full_filter)); + } + filters_json.SetKey("filters", std::move(filters_list)); + GetInternal()->FilterDebugStream(std::move(filters_json)); + GetInternal()->common_lock_.Acquire(); + GetInternal()->UpdateFilters(); + GetInternal()->common_lock_.Release(); + } + + public: + struct StaticSource { + std::string file; + std::string func; + std::string anno; + int line; + int index; + }; + + void GetFrameData() { + sources_.clear(); + draw_calls_.clear(); + log_calls_.clear(); + draw_text_calls_.clear(); + GetInternal()->common_lock_.Acquire(); + base::Optional<base::Value> global_dict = GetInternal()->FrameAsJson( + frame_counter_, gfx::Size(window_x_, window_y_), base::TimeTicks()); + GetInternal()->common_lock_.Release(); + frame_counter_++; + + EXPECT_TRUE(global_dict->is_dict()); + + std::string str; + global_dict->FindKey("frame")->GetAsString(&str); + base::StringToUint64(str.c_str(), &counter_); + static const int kNoVal = -1; + + window_x_ = global_dict->FindKey("windowx")->GetIfInt().value_or(kNoVal); + window_y_ = global_dict->FindKey("windowy")->GetIfInt().value_or(kNoVal); + + base::Value* list_source = global_dict->FindListKey("new_sources"); + EXPECT_TRUE(list_source->is_list()); + + for (size_t i = 0; i < list_source->GetList().size(); i++) { + auto&& local_dict = list_source->GetList()[i]; + StaticSource ss; + local_dict.FindKey("file")->GetAsString(&str); + ss.file = str; + + local_dict.FindKey("func")->GetAsString(&str); + ss.func = str; + + local_dict.FindKey("anno")->GetAsString(&str); + ss.anno = str; + + ss.line = local_dict.FindKey("line")->GetIfInt().value_or(kNoVal); + ss.index = local_dict.FindKey("index")->GetIfInt().value_or(kNoVal); + sources_.push_back(ss); + } + + base::Value* draw_call_list = global_dict->FindListKey("drawcalls"); + EXPECT_TRUE(draw_call_list->is_list()); + + auto func_common_call = [](const base::Value& dict, int* draw_index, + int* source_index, + VizDebugger::DrawOption* option) { + *draw_index = dict.FindKey("drawindex")->GetIfInt().value_or(kNoVal); + *source_index = dict.FindKey("source_index")->GetIfInt().value_or(kNoVal); + + std::string str; + const base::Value* option_dict = dict.FindDictKey("option"); + option_dict->FindKey("color")->GetAsString(&str); + + uint32_t red; + uint32_t green; + uint32_t blue; + std::sscanf(str.c_str(), "#%x%x%x", &red, &green, &blue); + + option->color_r = red; + option->color_g = green; + option->color_b = blue; + option->color_a = static_cast<uint8_t>( + option_dict->FindKey("alpha")->GetIfInt().value_or(kNoVal)); + }; + + for (size_t i = 0; i < draw_call_list->GetList().size(); i++) { + const base::Value& local_dict = draw_call_list->GetList()[i]; + int draw_index; + int source_index; + VizDebugger::DrawOption option; + func_common_call(local_dict, &draw_index, &source_index, &option); + + const base::Value* list_size = local_dict.FindListKey("size"); + EXPECT_TRUE(list_size->is_list()); + int size_x = list_size->GetList()[0].GetIfInt().value_or(kNoVal); + int size_y = list_size->GetList()[1].GetIfInt().value_or(kNoVal); + + const base::Value* list_pos = local_dict.FindListKey("pos"); + EXPECT_TRUE(list_pos->is_list()); + float pos_x = list_pos->GetList()[0].GetIfDouble().value_or(kNoVal); + float pos_y = list_pos->GetList()[1].GetIfDouble().value_or(kNoVal); + + VizDebuggerInternal::DrawCall draw_call(draw_index, source_index, option, + gfx::Size(size_x, size_y), + gfx::Vector2dF(pos_x, pos_y)); + + draw_calls_.push_back(draw_call); + } + + base::Value* text_call_list = global_dict->FindListKey("text"); + EXPECT_TRUE(text_call_list->is_list()); + + for (size_t i = 0; i < text_call_list->GetList().size(); i++) { + const base::Value& local_dict = text_call_list->GetList()[i]; + int draw_index; + int source_index; + VizDebugger::DrawOption option; + + func_common_call(local_dict, &draw_index, &source_index, &option); + + local_dict.FindKey("text")->GetAsString(&str); + std::string text_str = str; + + const base::Value* list_pos = local_dict.FindListKey("pos"); + EXPECT_TRUE(list_pos->is_list()); + float pos_x = list_pos->GetList()[0].GetIfDouble().value_or(kNoVal); + float pos_y = list_pos->GetList()[1].GetIfDouble().value_or(kNoVal); + + VizDebuggerInternal::DrawTextCall text_call( + draw_index, source_index, option, gfx::Vector2dF(pos_x, pos_y), + text_str); + + draw_text_calls_.push_back(text_call); + } + + base::Value* log_call_list = global_dict->FindListKey("logs"); + EXPECT_TRUE(log_call_list->is_list()); + + for (size_t i = 0; i < log_call_list->GetList().size(); i++) { + const base::Value& local_dict = log_call_list->GetList()[i]; + int draw_index; + int source_index; + VizDebugger::DrawOption option; + func_common_call(local_dict, &draw_index, &source_index, &option); + + local_dict.FindKey("value")->GetAsString(&str); + std::string log_str = str; + + VizDebuggerInternal::LogCall log_call(draw_index, source_index, option, + log_str); + + log_calls_.push_back(log_call); + } + } + + uint64_t frame_counter_ = 0; + + // Cached result of call to 'GetFrameData' to simplify code. + uint64_t counter_; + int window_x_ = 256; + int window_y_ = 256; + std::vector<StaticSource> sources_; + std::vector<VizDebuggerInternal::DrawCall> draw_calls_; + std::vector<VizDebuggerInternal::LogCall> log_calls_; + std::vector<VizDebuggerInternal::DrawTextCall> draw_text_calls_; +}; + +TEST_F(VisualDebuggerTest, GeneralDrawSubmission) { + const char kAnnoRect[] = "annorect"; + const char kAnnoText[] = "annotext"; + const char kAnnoLog[] = "annolog"; + const gfx::Rect kTestRect = gfx::Rect(12, 34, 56, 78); + static const int kNumFrames = 4; + GetInternal()->ForceEnabled(); + for (uint64_t frame_idx = 0; frame_idx < kNumFrames; frame_idx++) { + SetFilter({TestFilter({""})}); + + static const int kNumSubmission = 8; + for (int i = 0; i < kNumSubmission; i++) { + DBG_DRAW_RECT(kAnnoRect, kTestRect); + DBG_DRAW_TEXT(kAnnoText, kTestRect.origin(), + base::StringPrintf("Text %d", i)); + DBG_LOG(kAnnoLog, "%d", i); + } + + GetFrameData(); + + EXPECT_EQ(counter_, frame_idx); + EXPECT_EQ(window_x_, 256); + EXPECT_EQ(window_x_, 256); + EXPECT_EQ(draw_calls_.size(), static_cast<size_t>(kNumSubmission)); + EXPECT_EQ(log_calls_.size(), static_cast<size_t>(kNumSubmission)); + EXPECT_EQ(draw_text_calls_.size(), static_cast<size_t>(kNumSubmission)); + + if (frame_idx == 0) { + EXPECT_EQ(sources_.size(), 3u); + EXPECT_EQ(sources_[0].func, "TestBody"); + EXPECT_EQ(sources_[0].file, __FILE__); + EXPECT_EQ(sources_[0].anno, kAnnoRect); + EXPECT_EQ(sources_[1].func, "TestBody"); + EXPECT_EQ(sources_[1].file, __FILE__); + EXPECT_EQ(sources_[1].anno, kAnnoText); + EXPECT_EQ(sources_[2].func, "TestBody"); + EXPECT_EQ(sources_[2].file, __FILE__); + EXPECT_EQ(sources_[2].anno, kAnnoLog); + } else { + // After the first frame there are no new sources in the loop. + EXPECT_EQ(sources_.size(), 0u); + } + + for (int i = 0; i < kNumSubmission; i++) { + EXPECT_EQ(draw_calls_[i].pos, + gfx::Vector2dF(kTestRect.origin().x(), kTestRect.origin().y())); + EXPECT_EQ(draw_calls_[i].obj_size, kTestRect.size()); + EXPECT_EQ(draw_calls_[i].source_index, 0); + EXPECT_EQ(draw_calls_[i].draw_index, i * 3); + + EXPECT_EQ(draw_text_calls_[i].pos, + gfx::Vector2dF(kTestRect.origin().x(), kTestRect.origin().y())); + EXPECT_EQ(draw_text_calls_[i].source_index, 1); + EXPECT_EQ(draw_text_calls_[i].draw_index, i * 3 + 1); + EXPECT_EQ(draw_text_calls_[i].text, base::StringPrintf("Text %d", i)); + + EXPECT_EQ(log_calls_[i].value, base::StringPrintf("%d", i)); + EXPECT_EQ(log_calls_[i].source_index, 2); + EXPECT_EQ(log_calls_[i].draw_index, i * 3 + 2); + } + } +} + +static void FunctionNameTest(const char* anno_rect, gfx::Rect rect) { + DBG_DRAW_RECT(anno_rect, rect); +} + +TEST_F(VisualDebuggerTest, FilterDrawSubmission) { + const char kAnnoRect[] = "annorect"; + const char kAnnoMissing[] = "testmissing"; + const char kAnnoMatch[] = "before_annorect_after"; + + GetInternal()->ForceEnabled(); + const gfx::Rect kTestRect = gfx::Rect(10, 30, 50, 70); + const gfx::Rect kMissingRect = gfx::Rect(11, 33, 55, 77); + std::vector<int> valid_indices; + SetFilter({TestFilter({"annorect"})}); + valid_indices.push_back(GetInternal()->GetSourceCount()); + FunctionNameTest(kAnnoRect, kTestRect); + valid_indices.push_back(GetInternal()->GetSourceCount()); + DBG_DRAW_RECT(kAnnoRect, kTestRect); + DBG_DRAW_RECT(kAnnoMissing, kMissingRect); + valid_indices.push_back(GetInternal()->GetSourceCount()); + DBG_DRAW_RECT(kAnnoMatch, kTestRect); + + SetFilter({TestFilter({"", "FunctionNameTest"})}); + DBG_DRAW_RECT(kAnnoRect, kMissingRect); + valid_indices.push_back(0); + FunctionNameTest(kAnnoRect, kTestRect); + + SetFilter({TestFilter({"", "TestBody"})}); + FunctionNameTest(kAnnoRect, kMissingRect); + valid_indices.push_back(GetInternal()->GetSourceCount()); + DBG_DRAW_RECT(kAnnoRect, kTestRect); + + SetFilter({TestFilter({"", "", "no_file"})}); + DBG_DRAW_RECT(kAnnoRect, kMissingRect); + + SetFilter({TestFilter({"", "", __FILE__})}); + valid_indices.push_back(GetInternal()->GetSourceCount()); + DBG_DRAW_RECT(kAnnoRect, kTestRect); + + GetFrameData(); + EXPECT_EQ(sources_[0].func, "FunctionNameTest"); + EXPECT_EQ(sources_[0].file, __FILE__); + EXPECT_EQ(sources_[0].anno, kAnnoRect); + EXPECT_EQ(sources_[1].func, "TestBody"); + EXPECT_EQ(sources_[1].file, __FILE__); + EXPECT_EQ(sources_[1].anno, kAnnoRect); + EXPECT_EQ(sources_[2].anno, kAnnoMissing); + EXPECT_EQ(sources_[3].anno, kAnnoMatch); + + auto check_draw = [](const VizDebuggerInternal::DrawCall& draw_call, + const gfx::Rect& rect, int src_idx, int draw_idx) { + EXPECT_EQ(draw_call.pos, + gfx::Vector2dF(rect.origin().x(), rect.origin().y())); + EXPECT_EQ(draw_call.obj_size, rect.size()); + EXPECT_EQ(draw_call.source_index, src_idx); + EXPECT_EQ(draw_call.draw_index, draw_idx); + }; + + // Makes sure all valid indices are here and have the correct rect. + for (size_t i = 0; i < draw_calls_.size(); i++) { + check_draw(draw_calls_[i], kTestRect, valid_indices[i], i); + } +} + +} // namespace +} // namespace viz +#endif // VIZ_DEBUGGER_IS_ON()
diff --git a/components/viz/service/display/direct_renderer.cc b/components/viz/service/display/direct_renderer.cc index 652e61d..bb0a01f 100644 --- a/components/viz/service/display/direct_renderer.cc +++ b/components/viz/service/display/direct_renderer.cc
@@ -798,6 +798,9 @@ const AggregatedRenderPass* root_render_pass = current_frame()->root_render_pass; gfx::Rect root_damage_rect = current_frame()->root_damage_rect; + // If |frame_buffer_damage|, which is carried over from the previous frame + // when we want to preserve buffer content, is not empty, we should add it + // to both root and non-root render passes. gfx::Rect frame_buffer_damage = output_surface_->GetCurrentFramebufferDamage(); @@ -879,13 +882,18 @@ DCHECK(render_pass->copy_requests.empty() || (render_pass->damage_rect == render_pass->output_rect)); + // For the non-root render pass. gfx::Rect damage_rect = render_pass->damage_rect; - gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization); - if (render_pass->transform_to_root_target.GetInverse(&inverse_transform)) { - gfx::Rect frame_buffer_damage_in_render_space = - cc::MathUtil::MapEnclosingClippedRect(inverse_transform, - frame_buffer_damage); - damage_rect.Union(frame_buffer_damage_in_render_space); + if (!frame_buffer_damage.IsEmpty()) { + gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization); + if (render_pass->transform_to_root_target.GetInverse(&inverse_transform)) { + // |frame_buffer_damage| is in the root target space. Transform the damage + // from the root to the non-root space before it's added. + gfx::Rect frame_buffer_damage_in_render_pass_space = + cc::MathUtil::MapEnclosingClippedRect(inverse_transform, + frame_buffer_damage); + damage_rect.Union(frame_buffer_damage_in_render_pass_space); + } } return damage_rect;
diff --git a/components/viz/service/display_embedder/image_context_impl.cc b/components/viz/service/display_embedder/image_context_impl.cc index bcaa036..5002a214 100644 --- a/components/viz/service/display_embedder/image_context_impl.cc +++ b/components/viz/service/display_embedder/image_context_impl.cc
@@ -139,8 +139,7 @@ if (BindOrCopyTextureIfNecessary(texture_base, &texture_size) && texture_size != size()) { DLOG(ERROR) << "Failed to fulfill the promise texture - texture " - "size does not match TransferableResource size: " - << texture_size.ToString() << " vs " << size().ToString(); + "size does not match TransferableResource size."; CreateFallbackImage(context_state); return; } @@ -203,9 +202,7 @@ if (representation->size() != size()) { DLOG(ERROR) << "Failed to fulfill the promise texture - SharedImage " - "size does not match TransferableResource size: " - << representation->size().ToString() << " vs " - << size().ToString(); + "size does not match TransferableResource size."; return false; }
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc index fa087e0..0be8b6b 100644 --- a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc +++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc
@@ -113,18 +113,6 @@ ui_task_runner_ = ui_task_runner; } -void FrameSinkManagerImpl::ForceShutdown() { - if (receiver_.is_bound()) - receiver_.reset(); - - for (auto& it : cached_back_buffers_) - it.second.RunAndReset(); - cached_back_buffers_.clear(); - - sink_map_.clear(); - root_sink_map_.clear(); -} - void FrameSinkManagerImpl::RegisterFrameSinkId(const FrameSinkId& frame_sink_id, bool report_activation) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.h b/components/viz/service/frame_sinks/frame_sink_manager_impl.h index f90c7bb7..7a17fa7 100644 --- a/components/viz/service/frame_sinks/frame_sink_manager_impl.h +++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.h
@@ -85,10 +85,6 @@ OutputSurfaceProvider* output_surface_provider = nullptr); ~FrameSinkManagerImpl() override; - // Performs cleanup needed to force shutdown from the GPU process. Stops all - // incoming IPCs and destroys all [Root]CompositorFrameSinkImpls. - void ForceShutdown(); - // Binds |this| as a FrameSinkManagerImpl for |receiver| on |task_runner|. On // Mac |task_runner| will be the resize helper task runner. May only be called // once.
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 290a27e..f5d90b6 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
@@ -563,9 +563,14 @@ DCHECK_EQ(media::PIXEL_FORMAT_ARGB, pixel_format_); content_rect = media::ComputeLetterboxRegion(frame->visible_rect(), source_size); + // The media letterboxing computation explicitly allows for off-by-one + // errors due to computation, so we address those here. + if (content_rect.ApproximatelyEqual(frame->visible_rect(), 1)) { + content_rect = frame->visible_rect(); + } } - // Determine what rectangluar region has changed since the last captured + // Determine what rectangular region has changed since the last captured // frame. gfx::Rect update_rect; if (dirty_rect_ == kMaxRect ||
diff --git a/components/viz/service/gl/gpu_service_impl.cc b/components/viz/service/gl/gpu_service_impl.cc index 0a38553..e5c9207 100644 --- a/components/viz/service/gl/gpu_service_impl.cc +++ b/components/viz/service/gl/gpu_service_impl.cc
@@ -331,7 +331,7 @@ gpu_feature_info_for_hardware_gpu, const gfx::GpuExtraInfo& gpu_extra_info, gpu::VulkanImplementation* vulkan_implementation, - base::OnceCallback<void(base::Optional<ExitCode>)> exit_callback) + base::OnceCallback<void(ExitCode)> exit_callback) : main_runner_(base::ThreadTaskRunnerHandle::Get()), io_runner_(std::move(io_runner)), watchdog_thread_(std::move(watchdog_thread)), @@ -912,7 +912,19 @@ } void GpuServiceImpl::MaybeExitOnContextLost() { - MaybeExit(true); + DCHECK(main_runner_->BelongsToCurrentThread()); + + // We can't restart the GPU process when running in the host process. + if (in_host_process()) + return; + + if (IsExiting() || !exit_callback_) + return; + + LOG(ERROR) << "Exiting GPU process because some drivers can't recover " + "from errors. GPU process will restart shortly."; + is_exiting_.Set(); + std::move(exit_callback_).Run(ExitCode::RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST); } bool GpuServiceImpl::IsExiting() const { @@ -1180,13 +1192,6 @@ #endif } -void GpuServiceImpl::Stop(StopCallback callback) { - DCHECK(io_runner_->BelongsToCurrentThread()); - main_runner_->PostTaskAndReply( - FROM_HERE, base::BindOnce(&GpuServiceImpl::MaybeExit, weak_ptr_, false), - std::move(callback)); -} - void GpuServiceImpl::StartPeakMemoryMonitorOnMainThread(uint32_t sequence_num) { gpu_channel_manager_->StartPeakMemoryMonitor(sequence_num); } @@ -1202,31 +1207,6 @@ std::move(allocation_per_source))); } -void GpuServiceImpl::MaybeExit(bool for_context_loss) { - DCHECK(main_runner_->BelongsToCurrentThread()); - - // We can't restart the GPU process when running in the host process. - if (in_host_process()) - return; - - if (IsExiting() || !exit_callback_) - return; - - if (for_context_loss) { - LOG(ERROR) << "Exiting GPU process because some drivers can't recover " - "from errors. GPU process will restart shortly."; - } - is_exiting_.Set(); - // For the unsandboxed GPU info collection process used for info collection, - // if we exit immediately, then the reply message could be lost. That's why - // the |exit_callback_| takes the boolean argument. - if (for_context_loss) - std::move(exit_callback_) - .Run(ExitCode::RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST); - else - std::move(exit_callback_).Run(base::nullopt); -} - gpu::Scheduler* GpuServiceImpl::GetGpuScheduler() { return scheduler_.get(); }
diff --git a/components/viz/service/gl/gpu_service_impl.h b/components/viz/service/gl/gpu_service_impl.h index 9306892..89dfc24 100644 --- a/components/viz/service/gl/gpu_service_impl.h +++ b/components/viz/service/gl/gpu_service_impl.h
@@ -87,18 +87,17 @@ class VIZ_SERVICE_EXPORT GpuServiceImpl : public gpu::GpuChannelManagerDelegate, public mojom::GpuService { public: - GpuServiceImpl( - const gpu::GPUInfo& gpu_info, - std::unique_ptr<gpu::GpuWatchdogThread> watchdog, - scoped_refptr<base::SingleThreadTaskRunner> io_runner, - const gpu::GpuFeatureInfo& gpu_feature_info, - const gpu::GpuPreferences& gpu_preferences, - const base::Optional<gpu::GPUInfo>& gpu_info_for_hardware_gpu, - const base::Optional<gpu::GpuFeatureInfo>& - gpu_feature_info_for_hardware_gpu, - const gfx::GpuExtraInfo& gpu_extra_info, - gpu::VulkanImplementation* vulkan_implementation, - base::OnceCallback<void(base::Optional<ExitCode>)> exit_callback); + GpuServiceImpl(const gpu::GPUInfo& gpu_info, + std::unique_ptr<gpu::GpuWatchdogThread> watchdog, + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + const gpu::GpuFeatureInfo& gpu_feature_info, + const gpu::GpuPreferences& gpu_preferences, + const base::Optional<gpu::GPUInfo>& gpu_info_for_hardware_gpu, + const base::Optional<gpu::GpuFeatureInfo>& + gpu_feature_info_for_hardware_gpu, + const gfx::GpuExtraInfo& gpu_extra_info, + gpu::VulkanImplementation* vulkan_implementation, + base::OnceCallback<void(ExitCode)> exit_callback); ~GpuServiceImpl() override; @@ -200,7 +199,6 @@ void Crash() override; void Hang() override; void ThrowJavaException() override; - void Stop(StopCallback callback) override; // gpu::GpuChannelManagerDelegate: void RegisterDisplayContext(gpu::DisplayContext* display_context) override; @@ -221,6 +219,8 @@ void StoreShaderToDisk(int client_id, const std::string& key, const std::string& shader) override; + // Attempts to atomically shut down the process but only if not running in + // host process. An error message will be logged. void MaybeExitOnContextLost() override; bool IsExiting() const override; gpu::Scheduler* GetGpuScheduler() override; @@ -350,10 +350,6 @@ void GetPeakMemoryUsageOnMainThread(uint32_t sequence_num, GetPeakMemoryUsageCallback callback); - // Attempts to cleanly exit the process but only if not running in host - // process. If |for_context_loss| is true an error message will be logged. - void MaybeExit(bool for_context_loss); - // Update overlay info and HDR status on the GPU process and send the updated // info back to the browser process if there is a change. #if defined(OS_WIN) @@ -414,7 +410,7 @@ base::WaitableEvent* shutdown_event_ = nullptr; // Callback that safely exits GPU process. - base::OnceCallback<void(base::Optional<ExitCode>)> exit_callback_; + base::OnceCallback<void(ExitCode)> exit_callback_; base::AtomicFlag is_exiting_; // Used for performing hardware decode acceleration of images. This is shared
diff --git a/components/viz/service/main/viz_compositor_thread_runner.h b/components/viz/service/main/viz_compositor_thread_runner.h index 98446a2..0a9c5ff 100644 --- a/components/viz/service/main/viz_compositor_thread_runner.h +++ b/components/viz/service/main/viz_compositor_thread_runner.h
@@ -52,18 +52,6 @@ #if BUILDFLAG(USE_VIZ_DEVTOOLS) virtual void CreateVizDevTools(mojom::VizDevToolsParamsPtr params) = 0; #endif - - // Performs cleanup on VizCompositorThread needed before forcing thread to - // shut down. Ensures VizCompositorThread teardown during the destructor - // doesn't block on PostTasks back to the GPU thread. After cleanup has - // finished |cleanup_finished_callback| will be run. Should be called from the - // thread that owns |this|. - // - // This is intended to be used when the GPU thread wants to force restart. The - // cleanup is normally handled by the browser process before GPU process - // shutdown, except if the GPU thread is forcing restart. - virtual void CleanupForShutdown( - base::OnceClosure cleanup_finished_callback) = 0; }; } // namespace viz
diff --git a/components/viz/service/main/viz_compositor_thread_runner_impl.cc b/components/viz/service/main/viz_compositor_thread_runner_impl.cc index dfe9db2a..cedd715 100644 --- a/components/viz/service/main/viz_compositor_thread_runner_impl.cc +++ b/components/viz/service/main/viz_compositor_thread_runner_impl.cc
@@ -170,16 +170,6 @@ } #endif -void VizCompositorThreadRunnerImpl::CleanupForShutdown( - base::OnceClosure cleanup_finished_callback) { - task_runner_->PostTaskAndReply( - FROM_HERE, - base::BindOnce( - &VizCompositorThreadRunnerImpl::CleanupForShutdownOnCompositorThread, - base::Unretained(this)), - std::move(cleanup_finished_callback)); -} - void VizCompositorThreadRunnerImpl::CreateFrameSinkManagerOnCompositorThread( mojom::FrameSinkManagerParamsPtr params, gpu::CommandBufferTaskExecutor* task_executor, @@ -276,13 +266,6 @@ } #endif -void VizCompositorThreadRunnerImpl::CleanupForShutdownOnCompositorThread() { - DCHECK(task_runner_->BelongsToCurrentThread()); - - if (frame_sink_manager_) - frame_sink_manager_->ForceShutdown(); -} - void VizCompositorThreadRunnerImpl::TearDownOnCompositorThread() { DCHECK(task_runner_->BelongsToCurrentThread());
diff --git a/components/viz/service/main/viz_compositor_thread_runner_impl.h b/components/viz/service/main/viz_compositor_thread_runner_impl.h index 9e4b20d..6ed5be8 100644 --- a/components/viz/service/main/viz_compositor_thread_runner_impl.h +++ b/components/viz/service/main/viz_compositor_thread_runner_impl.h
@@ -54,7 +54,6 @@ #if BUILDFLAG(USE_VIZ_DEVTOOLS) void CreateVizDevTools(mojom::VizDevToolsParamsPtr params) override; #endif - void CleanupForShutdown(base::OnceClosure cleanup_finished_callback) override; private: void CreateFrameSinkManagerOnCompositorThread( @@ -66,7 +65,6 @@ void CreateVizDevToolsOnCompositorThread(mojom::VizDevToolsParamsPtr params); void InitVizDevToolsOnCompositorThread(mojom::VizDevToolsParamsPtr params); #endif - void CleanupForShutdownOnCompositorThread(); void TearDownOnCompositorThread(); // Start variables to be accessed only on |task_runner_|.
diff --git a/components/viz/service/main/viz_main_impl.cc b/components/viz/service/main/viz_main_impl.cc index bb73fb2..55a292a 100644 --- a/components/viz/service/main/viz_main_impl.cc +++ b/components/viz/service/main/viz_main_impl.cc
@@ -17,6 +17,7 @@ #include "build/build_config.h" #include "components/ui_devtools/buildflags.h" #include "components/viz/common/features.h" +#include "components/viz/service/debugger/viz_debugger.h" #include "gpu/command_buffer/common/activity_flags.h" #include "gpu/config/gpu_finch_features.h" #include "gpu/ipc/service/gpu_init.h" @@ -111,6 +112,7 @@ gpu_init_->gpu_feature_info_for_hardware_gpu(), gpu_init_->gpu_extra_info(), gpu_init_->vulkan_implementation(), base::BindOnce(&VizMainImpl::ExitProcess, base::Unretained(this))); + VizDebugger::GetInstance(); } VizMainImpl::~VizMainImpl() { @@ -266,6 +268,21 @@ #endif } +#if BUILDFLAG(USE_VIZ_DEBUGGER) +void VizMainImpl::FilterDebugStream(base::Value filter_data) { + VizDebugger::GetInstance()->FilterDebugStream(std::move(filter_data)); +} + +void VizMainImpl::StartDebugStream( + mojo::PendingRemote<mojom::VizDebugOutput> pending_debug_output) { + VizDebugger::GetInstance()->StartDebugStream(std::move(pending_debug_output)); +} + +void VizMainImpl::StopDebugStream() { + VizDebugger::GetInstance()->StopDebugStream(); +} +#endif + scoped_refptr<gpu::SharedContextState> VizMainImpl::GetSharedContextState() { return gpu_service_->GetContextState(); } @@ -274,28 +291,21 @@ return gpu_service_->share_group(); } -void VizMainImpl::ExitProcess(base::Optional<ExitCode> immediate_exit_code) { +void VizMainImpl::ExitProcess(ExitCode immediate_exit_code) { DCHECK(gpu_thread_task_runner_->BelongsToCurrentThread()); - if (!gpu_init_->gpu_info().in_process_gpu && immediate_exit_code) { + if (!gpu_init_->gpu_info().in_process_gpu) { // Atomically shut down GPU process to make it faster and simpler. base::Process::TerminateCurrentProcessImmediately( - static_cast<int>(immediate_exit_code.value())); + static_cast<int>(immediate_exit_code)); return; } // Close mojom::VizMain bindings first so the browser can't try to reconnect. receiver_.reset(); - if (viz_compositor_thread_runner_) { - // Destroy RootCompositorFrameSinkImpls on the compositor while the GPU - // thread is still running to avoid deadlock. Quit GPU thread TaskRunner - // after cleanup on compositor thread is finished. - viz_compositor_thread_runner_->CleanupForShutdown(base::BindOnce( - &Delegate::QuitMainMessageLoop, base::Unretained(delegate_))); - } else { - delegate_->QuitMainMessageLoop(); - } + DCHECK(!viz_compositor_thread_runner_); + delegate_->QuitMainMessageLoop(); } } // namespace viz
diff --git a/components/viz/service/main/viz_main_impl.h b/components/viz/service/main/viz_main_impl.h index 4b82e5a2..37c89f0 100644 --- a/components/viz/service/main/viz_main_impl.h +++ b/components/viz/service/main/viz_main_impl.h
@@ -13,6 +13,7 @@ #include "base/threading/thread.h" #include "build/build_config.h" #include "components/discardable_memory/client/client_discardable_shared_memory_manager.h" +#include "components/viz/common/buildflags.h" #include "components/viz/service/gl/gpu_service_impl.h" #include "components/viz/service/main/viz_compositor_thread_runner_impl.h" #include "gpu/ipc/gpu_in_process_thread_service.h" @@ -126,6 +127,12 @@ #endif void CreateFrameSinkManager(mojom::FrameSinkManagerParamsPtr params) override; void CreateVizDevTools(mojom::VizDevToolsParamsPtr params) override; +#if BUILDFLAG(USE_VIZ_DEBUGGER) + void FilterDebugStream(base::Value filter_data) override; + void StartDebugStream( + mojo::PendingRemote<mojom::VizDebugOutput> debug_output) override; + void StopDebugStream() override; +#endif // gpu::GpuInProcessThreadServiceDelegate implementation: scoped_refptr<gpu::SharedContextState> GetSharedContextState() override; @@ -141,10 +148,9 @@ return discardable_shared_memory_manager_.get(); } - // Cleanly exits the process. If |immediate_exit_code| is base::nullopt, the - // process exits by shutting down the GPU main thread. Otherwise, the process - // is terminated immediately with the specified exit code. - void ExitProcess(base::Optional<ExitCode> immediate_exit_code); + // If it's in browser process, shut down the GPU main thread. Otherwise, the + // GPU process is terminated immediately with the specified exit code. + void ExitProcess(ExitCode immediate_exit_code); private: void CreateFrameSinkManagerInternal(mojom::FrameSinkManagerParamsPtr params);
diff --git a/components/viz/service/main/viz_main_impl_unittest.cc b/components/viz/service/main/viz_main_impl_unittest.cc index 8a60ed0..dff6d7a1 100644 --- a/components/viz/service/main/viz_main_impl_unittest.cc +++ b/components/viz/service/main/viz_main_impl_unittest.cc
@@ -62,7 +62,6 @@ #if BUILDFLAG(USE_VIZ_DEVTOOLS) MOCK_METHOD1(CreateVizDevTools, void(mojom::VizDevToolsParamsPtr)); #endif - MOCK_METHOD1(CleanupForShutdown, void(base::OnceClosure)); private: base::SingleThreadTaskRunner* const task_runner_;
diff --git a/components/webxr/android/java/src/org/chromium/components/webxr/ArImmersiveOverlay.java b/components/webxr/android/java/src/org/chromium/components/webxr/ArImmersiveOverlay.java index 05a84a8f..88e4966b 100644 --- a/components/webxr/android/java/src/org/chromium/components/webxr/ArImmersiveOverlay.java +++ b/components/webxr/android/java/src/org/chromium/components/webxr/ArImmersiveOverlay.java
@@ -6,20 +6,15 @@ import android.annotation.SuppressLint; import android.app.Activity; -import android.app.Dialog; -import android.content.Context; import android.content.pm.ActivityInfo; import android.graphics.PixelFormat; import android.graphics.Point; -import android.os.Build; import android.view.Display; -import android.view.Gravity; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.ViewGroup; -import android.view.WindowManager; import androidx.annotation.NonNull; @@ -29,7 +24,6 @@ import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.browser.WebContentsObserver; import org.chromium.ui.display.DisplayAndroidManager; -import org.chromium.ui.widget.Toast; import java.util.HashMap; import java.util.Map; @@ -48,8 +42,9 @@ private boolean mSurfaceReportedReady; private Integer mRestoreOrientation; private boolean mCleanupInProgress; - private SurfaceUiWrapper mSurfaceUi; + private ArSurfaceView mArSurfaceView; private WebContents mWebContents; + private boolean mUseOverlay; // Set containing all currently touching pointers. private HashMap<Integer, PointerData> mPointerIdToData; @@ -70,95 +65,11 @@ mPointerIdToData = new HashMap<Integer, PointerData>(); mPrimaryPointerId = null; + mUseOverlay = useOverlay; + // Choose a concrete implementation to create a drawable Surface and make it fullscreen. // It forwards SurfaceHolder callbacks and touch events to this ArImmersiveOverlay object. - if (useOverlay) { - mSurfaceUi = new SurfaceUiCompositor(canRenderDomContent); - } else { - mSurfaceUi = new SurfaceUiDialog(); - } - } - - private interface SurfaceUiWrapper { - public void onSurfaceVisible(); - public void forwardMotionEvent(MotionEvent ev); - public void destroy(); - } - - // The default Dialog cancellation behavior destroys the Surface before we get notified via the - // Cancelation callback. This is unfortunate, because we need to ensure that the compositor is - // stopped before the surface is destroyed. This class allows us to override the default - // cancellation behavior to properly shutdown the compositor before the surface is destroyed. It - // is unclear why the SurfaceHolder callbacks are not triggered. - private class ArDialog extends Dialog { - public ArDialog(Context context, int themeResId) { - super(context, themeResId); - } - - @Override - public void cancel() { - ArCoreJavaUtils.onBackPressed(); - super.cancel(); - } - } - - private class SurfaceUiDialog implements SurfaceUiWrapper { - private Toast mNotificationToast; - private ArDialog mDialog; - // Android supports multiple variants of fullscreen applications. Use fully-immersive - // "sticky" mode without navigation or status bars, and show a toast with a "pull from top - // and press back button to exit" prompt. - private static final int VISIBILITY_FLAGS_IMMERSIVE = View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; - - public SurfaceUiDialog() { - // Create a fullscreen dialog and use its backing Surface for drawing. - mDialog = new ArDialog(mActivity, android.R.style.Theme_NoTitleBar_Fullscreen); - mDialog.getWindow().setBackgroundDrawable(null); - mDialog.getWindow().takeSurface(ArImmersiveOverlay.this); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { - // Use maximum fullscreen, ignoring a notch if present. This code path is used - // for non-DOM-Overlay mode where the browser compositor view isn't visible. - // In DOM Overlay mode (SurfaceUiCompositor), Blink configures this separately - // via ViewportData::SetExpandIntoDisplayCutout. - mDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, - WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); - mDialog.getWindow().getAttributes().layoutInDisplayCutoutMode = - WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; - } - View view = mDialog.getWindow().getDecorView(); - view.setSystemUiVisibility(VISIBILITY_FLAGS_IMMERSIVE); - view.setOnTouchListener(ArImmersiveOverlay.this); - view.setKeepScreenOn(true); - mDialog.getWindow().setLayout( - ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); - mDialog.show(); - } - - @Override // SurfaceUiWrapper - public void onSurfaceVisible() { - if (mNotificationToast != null) { - mNotificationToast.cancel(); - } - int resId = R.string.immersive_fullscreen_api_notification; - mNotificationToast = Toast.makeText(mActivity, resId, Toast.LENGTH_LONG); - mNotificationToast.setGravity(Gravity.TOP | Gravity.CENTER, 0, 0); - mNotificationToast.show(); - } - - @Override // SurfaceUiWrapper - public void forwardMotionEvent(MotionEvent ev) {} - - @Override // SurfaceUiWrapper - public void destroy() { - if (mNotificationToast != null) { - mNotificationToast.cancel(); - mNotificationToast = null; - } - mDialog.dismiss(); - } + mArSurfaceView = new ArSurfaceView(canRenderDomContent); } private class PointerData { @@ -173,17 +84,18 @@ } } - private class SurfaceUiCompositor implements SurfaceUiWrapper { + private class ArSurfaceView { private SurfaceView mSurfaceView; private WebContentsObserver mWebContentsObserver; private boolean mDomSurfaceNeedsConfiguring; @SuppressLint("ClickableViewAccessibility") - public SurfaceUiCompositor(boolean canRenderDomContent) { - // If we can't render the dom content on top of the camera/gl layers manually, then - // we need to configure the DOM content's surface view to overlay ours. We need to - // track this so that we ensure we teardown everything we need to teardown as well. - mDomSurfaceNeedsConfiguring = !canRenderDomContent; + public ArSurfaceView(boolean canRenderDomContent) { + // If we need to show the dom content, but can't render it on top of the camera/gl + // layers manually, then we need to configure the DOM content's surface view to + // overlay ours. We need to track this so that we ensure we teardown everything + // we need to teardown as well. + mDomSurfaceNeedsConfiguring = mUseOverlay && !canRenderDomContent; // Enable alpha channel for the compositor and make the background transparent. // Note that this needs to happen before we create and parent our SurfaceView, so that @@ -191,6 +103,10 @@ if (DEBUG_LOGS) { Log.i(TAG, "calling mArCompositorDelegate.setOverlayImmersiveArMode(true)"); } + + // While it's fine to omit if the page does not use DOMOverlay, once the page does + // use DOMOverlay, something appears to have changed such that it becomes required, + // otherwies the DOM SurfaceView will be in front of the XR content. mArCompositorDelegate.setOverlayImmersiveArMode(true, mDomSurfaceNeedsConfiguring); mSurfaceView = new SurfaceView(mActivity); @@ -226,15 +142,6 @@ mWebContents.addObserver(mWebContentsObserver); } - @Override // SurfaceUiWrapper - public void onSurfaceVisible() {} - - @Override // SurfaceUiWrapper - public void forwardMotionEvent(MotionEvent ev) { - mArCompositorDelegate.dispatchTouchEvent(ev); - } - - @Override // SurfaceUiWrapper public void destroy() { mWebContents.removeObserver(mWebContentsObserver); View content = mActivity.getWindow().findViewById(android.R.id.content); @@ -400,7 +307,9 @@ // We need to consume the touch (returning true) to ensure that we get // followup events such as MOVE and UP. DOM Overlay mode needs to forward // the touch to the content view so that its UI elements keep working. - mSurfaceUi.forwardMotionEvent(ev); + if (mUseOverlay) { + mArCompositorDelegate.dispatchTouchEvent(ev); + } return true; } @@ -480,7 +389,7 @@ // // While it would be preferable to wait until the surface is at the desired fullscreen // resolution, i.e. via mActivity.getFullscreenManager().getPersistentFullscreenMode(), that - // causes a chicken-and-egg problem for SurfaceUiCompositor mode as used for DOM overlay. + // causes a chicken-and-egg problem for ArSurfaceView mode as used for DOM overlay. // Chrome's fullscreen mode is triggered by the Blink side setting an element fullscreen // after the session starts, but the session doesn't start until we report the drawing // surface being ready (including a configured size), so we use this reported size assuming @@ -505,10 +414,6 @@ mArCoreJavaUtils.onDrawingSurfaceReady(holder.getSurface(), mWebContents.getTopLevelNativeWindow(), rotation, width, height); mSurfaceReportedReady = true; - - // Show the toast with instructions how to exit fullscreen mode now if necessary. - // Not needed in DOM overlay mode which uses FullscreenHtmlApiHandler to do so. - mSurfaceUi.onSurfaceVisible(); } @Override // SurfaceHolder.Callback2 @@ -533,7 +438,7 @@ // the destroy callbacks to ensure consistent state after non-exiting lifecycle events. mArCoreJavaUtils.onDrawingSurfaceDestroyed(); - mSurfaceUi.destroy(); + mArSurfaceView.destroy(); // The JS app may have put an element into fullscreen mode during the immersive session, // even if this wasn't visible to the user. Ensure that we fully exit out of any active
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 0cc1eb2e..bad677b 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -11,6 +11,7 @@ import("//build/config/ui.gni") import("//chromeos/assistant/assistant.gni") import("//components/ui_devtools/devtools.gni") +import("//components/viz/common/debugger/viz_debugger.gni") import("//content/common/features.gni") import("//content/public/common/zygote/features.gni") import("//device/vr/buildflags/buildflags.gni") @@ -2161,6 +2162,14 @@ ] } + if (use_viz_debugger) { + sources += [ + "$target_gen_dir/devtools/protocol/visual_debugger.cc", + "$target_gen_dir/devtools/protocol/visual_debugger.h", + "devtools/protocol/visual_debugger_handler.cc", + "devtools/protocol/visual_debugger_handler.h", + ] + } if (toolkit_views) { deps += [ "//ui/events" ] }
diff --git a/content/browser/conversions/conversions_browsertest.cc b/content/browser/conversions/conversions_browsertest.cc index a96f9a6..b49f66fb 100644 --- a/content/browser/conversions/conversions_browsertest.cc +++ b/content/browser/conversions/conversions_browsertest.cc
@@ -6,6 +6,7 @@ #include "base/command_line.h" #include "base/sequenced_task_runner.h" +#include "base/strings/strcat.h" #include "base/test/scoped_feature_list.h" #include "base/threading/sequenced_task_runner_handle.h" #include "content/browser/conversions/conversion_manager_impl.h" @@ -161,7 +162,7 @@ } IN_PROC_BROWSER_TEST_F(ConversionsBrowserTest, - WindowOpenImpressionConversion_ReportSent) { + WindowOpenDeprecatedAPI_NoException) { // Expected reports must be registered before the server starts. ExpectedReportWaiter expected_report( GURL( @@ -203,6 +204,43 @@ } IN_PROC_BROWSER_TEST_F(ConversionsBrowserTest, + WindowOpenImpressionConversion_ReportSent) { + // Expected reports must be registered before the server starts. + ExpectedReportWaiter expected_report( + GURL( + "https://a.test/.well-known/" + "register-conversion?impression-data=1&conversion-data=7&credit=100"), + https_server()); + ASSERT_TRUE(https_server()->Start()); + + GURL impression_url = https_server()->GetURL( + "a.test", "/conversions/page_with_impression_creator.html"); + EXPECT_TRUE(NavigateToURL(web_contents(), impression_url)); + + GURL conversion_url = https_server()->GetURL( + "b.test", "/conversions/page_with_conversion_redirect.html"); + + // We can't use `JsReplace` directly to input the origin as it will use string + // literals which shouldn't be provided in the window features string. + std::string window_features = + base::StrCat({"attributionsourceeventid=1,attributiondestination=", + url::Origin::Create(conversion_url).Serialize()}); + + TestNavigationObserver observer(web_contents()); + EXPECT_TRUE( + ExecJs(web_contents(), JsReplace(R"(window.open($1, '_top', $2);)", + conversion_url, window_features))); + observer.Wait(); + + // Register a conversion with the original page as the reporting origin. + EXPECT_TRUE( + ExecJs(web_contents(), JsReplace("registerConversionForOrigin(7, $1)", + url::Origin::Create(impression_url)))); + + EXPECT_EQ(expected_report.expected_url, expected_report.WaitForRequestUrl()); +} + +IN_PROC_BROWSER_TEST_F(ConversionsBrowserTest, ImpressionFromCrossOriginSubframe_ReportSent) { ExpectedReportWaiter expected_report( GURL(
diff --git a/content/browser/conversions/impression_declaration_browsertest.cc b/content/browser/conversions/impression_declaration_browsertest.cc index 7c0e835b..5229930 100644 --- a/content/browser/conversions/impression_declaration_browsertest.cc +++ b/content/browser/conversions/impression_declaration_browsertest.cc
@@ -807,4 +807,83 @@ EXPECT_EQ(0u, host->num_impressions()); } +IN_PROC_BROWSER_TEST_F(ImpressionDeclarationBrowserTest, + WindowOpenImpression_ImpressionReceived) { + ImpressionObserver impression_observer(web_contents()); + GURL page_url = + https_server()->GetURL("b.test", "/page_with_impression_creator.html"); + EXPECT_TRUE(NavigateToURL(web_contents(), page_url)); + + // Navigate the page using window.open and set an impression. + EXPECT_TRUE(ExecJs(web_contents(), R"( + window.open("https://a.com", "_top", + "attributionsourceeventid=1,attributiondestination=https://a.com,\ + attributionreportto=https://report.com,attributionexpiry=1000");)")); + + // Wait for the impression to be seen by the observer. + blink::Impression last_impression = impression_observer.Wait(); + + // Verify the attributes of the impression are set as expected. + EXPECT_EQ(1UL, last_impression.impression_data); + EXPECT_EQ(url::Origin::Create(GURL("https://a.com")), + last_impression.conversion_destination); + EXPECT_EQ(url::Origin::Create(GURL("https://report.com")), + last_impression.reporting_origin); + EXPECT_EQ(base::TimeDelta::FromMilliseconds(1000), *last_impression.expiry); +} + +IN_PROC_BROWSER_TEST_F(ImpressionDeclarationBrowserTest, + WindowOpenAttributionSourceFeatures_FeaturesHandled) { + struct { + std::string features; + bool expected; + } kTestCases[] = { + {"", false}, + {"attributionsourceeventid=1", false}, + {"attributiondestination=1", false}, + {"attributionexpiry=1", false}, + {"attributionsourceeventid=1,attributiondestination=1234", false}, + {"attributionsourceeventid=1,attributiondestination=abcdefg", false}, + {"attributionsourceeventid=1,attributiondestination=http://a.com", false}, + {"attributionsourceeventid=1,attributiondestination=https://a.com", true}, + {"attributionsourceeventid=bb,attributiondestination=https://a.com", + true}, + }; + + for (const auto& test_case : kTestCases) { + ImpressionObserver impression_observer(web_contents()); + GURL page_url = + https_server()->GetURL("b.test", "/page_with_impression_creator.html"); + EXPECT_TRUE(NavigateToURL(web_contents(), page_url)); + + // Navigate the page using window.open and set an impression. + EXPECT_TRUE(ExecJs(web_contents(), + JsReplace(R"(window.open("https://a.com", "_top", $1);)", + test_case.features))); + + // Wait for the impression to be seen by the observer. + if (test_case.expected) + impression_observer.Wait(); + else + EXPECT_TRUE(impression_observer.WaitForNavigationWithNoImpression()); + } +} + +IN_PROC_BROWSER_TEST_F(ImpressionDeclarationBrowserTest, + WindowOpenNoUserGesture_NoImpression) { + ImpressionObserver impression_observer(web_contents()); + GURL page_url = + https_server()->GetURL("b.test", "/page_with_impression_creator.html"); + EXPECT_TRUE(NavigateToURL(web_contents(), page_url)); + + // Navigate the page using window.open and set an impression, but do not give + // a user gesture. + EXPECT_TRUE(ExecJs(web_contents(), R"( + window.open("https://a.com", "_top", + "attributionsourceeventid=1,attributiondestination=https://a.com");)", + EXECUTE_SCRIPT_NO_USER_GESTURE)); + + EXPECT_TRUE(impression_observer.WaitForNavigationWithNoImpression()); +} + } // namespace content
diff --git a/content/browser/cross_origin_opener_policy_browsertest.cc b/content/browser/cross_origin_opener_policy_browsertest.cc index 9d2699b..fbd8e338 100644 --- a/content/browser/cross_origin_opener_policy_browsertest.cc +++ b/content/browser/cross_origin_opener_policy_browsertest.cc
@@ -187,10 +187,10 @@ "a.com", "/set-header?cross-origin-opener-policy: same-origin")); EXPECT_TRUE(NavigateToURL(shell(), starting_page)); - RenderFrameHostImpl* main_frame = current_frame_host(); + RenderFrameHostImpl* main_rfh = current_frame_host(); // Create same origin child frame. - ASSERT_TRUE(ExecJs(main_frame, R"( + ASSERT_TRUE(ExecJs(main_rfh, R"( let frame = document.createElement('iframe'); frame.src = '/empty.html'; document.body.appendChild(frame); @@ -198,17 +198,17 @@ EXPECT_TRUE(WaitForLoadStop(web_contents())); ShellAddedObserver shell_observer; - RenderFrameHostImpl* iframe = main_frame->child_at(0)->current_frame_host(); - EXPECT_TRUE(ExecJs(iframe, "window.open('about:blank')")); + RenderFrameHostImpl* iframe_rfh = main_rfh->child_at(0)->current_frame_host(); + EXPECT_TRUE(ExecJs(iframe_rfh, "window.open('about:blank')")); - RenderFrameHostImpl* popup_frame = + RenderFrameHostImpl* popup_rfh = static_cast<WebContentsImpl*>(shell_observer.GetShell()->web_contents()) ->GetFrameTree() ->root() ->current_frame_host(); - EXPECT_EQ(main_frame->cross_origin_opener_policy(), CoopSameOrigin()); - EXPECT_EQ(popup_frame->cross_origin_opener_policy(), CoopSameOrigin()); + EXPECT_EQ(main_rfh->cross_origin_opener_policy(), CoopSameOrigin()); + EXPECT_EQ(popup_rfh->cross_origin_opener_policy(), CoopSameOrigin()); } IN_PROC_BROWSER_TEST_P(CrossOriginOpenerPolicyBrowserTest, @@ -218,7 +218,7 @@ "/set-header?cross-origin-opener-policy: same-origin-allow-popups")); EXPECT_TRUE(NavigateToURL(shell(), starting_page)); - RenderFrameHostImpl* main_frame = current_frame_host(); + RenderFrameHostImpl* main_rfh = current_frame_host(); // Create same origin child frame. ASSERT_TRUE(ExecJs(current_frame_host(), R"( @@ -229,18 +229,18 @@ EXPECT_TRUE(WaitForLoadStop(web_contents())); ShellAddedObserver shell_observer; - RenderFrameHostImpl* iframe = main_frame->child_at(0)->current_frame_host(); - EXPECT_TRUE(ExecJs(iframe, "window.open('about:blank')")); + RenderFrameHostImpl* iframe_rfh = main_rfh->child_at(0)->current_frame_host(); + EXPECT_TRUE(ExecJs(iframe_rfh, "window.open('about:blank')")); - RenderFrameHostImpl* popup_frame = + RenderFrameHostImpl* popup_rfh = static_cast<WebContentsImpl*>(shell_observer.GetShell()->web_contents()) ->GetFrameTree() ->root() ->current_frame_host(); - EXPECT_EQ(main_frame->cross_origin_opener_policy(), + EXPECT_EQ(main_rfh->cross_origin_opener_policy(), CoopSameOriginAllowPopups()); - EXPECT_EQ(popup_frame->cross_origin_opener_policy(), + EXPECT_EQ(popup_rfh->cross_origin_opener_policy(), CoopSameOriginAllowPopups()); } @@ -252,29 +252,29 @@ EXPECT_TRUE(NavigateToURL(shell(), starting_page)); - RenderFrameHostImpl* main_frame = current_frame_host(); + RenderFrameHostImpl* main_rfh = current_frame_host(); // Create cross origin child frame. - ASSERT_TRUE(ExecJs(main_frame, JsReplace(R"( + ASSERT_TRUE(ExecJs(main_rfh, JsReplace(R"( let frame = document.createElement('iframe'); frame.src = $1; document.body.appendChild(frame); )", - url_b))); + url_b))); EXPECT_TRUE(WaitForLoadStop(web_contents())); ShellAddedObserver shell_observer; - RenderFrameHostImpl* iframe = main_frame->child_at(0)->current_frame_host(); - EXPECT_TRUE(ExecJs(iframe, "window.open('about:blank')")); + RenderFrameHostImpl* iframe_rfh = main_rfh->child_at(0)->current_frame_host(); + EXPECT_TRUE(ExecJs(iframe_rfh, "window.open('about:blank')")); - RenderFrameHostImpl* popup_frame = + RenderFrameHostImpl* popup_rfh = static_cast<WebContentsImpl*>(shell_observer.GetShell()->web_contents()) ->GetFrameTree() ->root() ->current_frame_host(); - EXPECT_EQ(main_frame->cross_origin_opener_policy(), CoopSameOrigin()); - EXPECT_EQ(popup_frame->cross_origin_opener_policy(), CoopUnsafeNone()); + EXPECT_EQ(main_rfh->cross_origin_opener_policy(), CoopSameOrigin()); + EXPECT_EQ(popup_rfh->cross_origin_opener_policy(), CoopUnsafeNone()); } IN_PROC_BROWSER_TEST_P( @@ -290,38 +290,40 @@ EXPECT_TRUE(NavigateToURL(shell(), starting_page)); - RenderFrameHostImpl* main_frame = current_frame_host(); + RenderFrameHostImpl* main_rfh = current_frame_host(); // Create cross origin child frame. - ASSERT_TRUE(ExecJs(main_frame, JsReplace(R"( + ASSERT_TRUE(ExecJs(main_rfh, JsReplace(R"( let frame = document.createElement('iframe'); frame.src = $1; document.body.appendChild(frame); )", - url_b))); + url_b))); EXPECT_TRUE(WaitForLoadStop(web_contents())); ShellAddedObserver new_shell_observer; - RenderFrameHostImpl* iframe = main_frame->child_at(0)->current_frame_host(); - EXPECT_TRUE(ExecJs(iframe, "window.open('about:blank')")); + RenderFrameHostImpl* iframe_rfh = + main_rfh->child_at(0)->current_frame_host(); + EXPECT_TRUE(ExecJs(iframe_rfh, "window.open('about:blank')")); Shell* new_shell = new_shell_observer.GetShell(); - RenderFrameHostImpl* popup_frame = + RenderFrameHostImpl* popup_rfh = static_cast<WebContentsImpl*>(new_shell->web_contents()) ->GetFrameTree() ->root() ->current_frame_host(); - scoped_refptr<SiteInstance> main_frame_site_instance( - main_frame->GetSiteInstance()); - scoped_refptr<SiteInstance> iframe_site_instance(iframe->GetSiteInstance()); + scoped_refptr<SiteInstance> main_rfh_site_instance( + main_rfh->GetSiteInstance()); + scoped_refptr<SiteInstance> iframe_site_instance( + iframe_rfh->GetSiteInstance()); scoped_refptr<SiteInstance> popup_site_instance( - popup_frame->GetSiteInstance()); + popup_rfh->GetSiteInstance()); - ASSERT_TRUE(main_frame_site_instance); + ASSERT_TRUE(main_rfh_site_instance); ASSERT_TRUE(iframe_site_instance); ASSERT_TRUE(popup_site_instance); - EXPECT_FALSE(main_frame_site_instance->IsRelatedSiteInstance( + EXPECT_FALSE(main_rfh_site_instance->IsRelatedSiteInstance( popup_site_instance.get())); EXPECT_FALSE( iframe_site_instance->IsRelatedSiteInstance(popup_site_instance.get())); @@ -341,10 +343,10 @@ EXPECT_TRUE(NavigateToURL(shell(), starting_page)); ShellAddedObserver shell_observer; - RenderFrameHostImpl* iframe = + RenderFrameHostImpl* iframe_rfh = current_frame_host()->child_at(0)->current_frame_host(); - EXPECT_TRUE(ExecJs(iframe, JsReplace("window.open($1);", openee_url))); + EXPECT_TRUE(ExecJs(iframe_rfh, JsReplace("window.open($1);", openee_url))); auto* popup_webcontents = static_cast<WebContentsImpl*>(shell_observer.GetShell()->web_contents()); @@ -2322,9 +2324,9 @@ same_origin_iframe_navigation.WaitForNavigationFinished(); EXPECT_TRUE(same_origin_iframe_navigation.was_successful()); - RenderFrameHostImpl* iframe = + RenderFrameHostImpl* iframe_rfh = current_frame_host()->child_at(0)->current_frame_host(); - SiteInstanceImpl* iframe_si = iframe->GetSiteInstance(); + SiteInstanceImpl* iframe_si = iframe_rfh->GetSiteInstance(); EXPECT_EQ(iframe_si, main_si); } @@ -2342,9 +2344,9 @@ cross_origin_iframe_navigation.WaitForNavigationFinished(); EXPECT_TRUE(cross_origin_iframe_navigation.was_successful()); - RenderFrameHostImpl* iframe = + RenderFrameHostImpl* iframe_rfh = current_frame_host()->child_at(1)->current_frame_host(); - SiteInstanceImpl* iframe_si = iframe->GetSiteInstance(); + SiteInstanceImpl* iframe_si = iframe_rfh->GetSiteInstance(); EXPECT_TRUE(iframe_si->IsCoopCoepCrossOriginIsolated()); EXPECT_TRUE(iframe_si->IsRelatedSiteInstance(main_si)); EXPECT_EQ(iframe_si->GetProcess(), main_si->GetProcess()); @@ -2373,7 +2375,7 @@ // Open a non isolated popup. { - RenderFrameHostImpl* popup_frame = + RenderFrameHostImpl* popup_rfh = static_cast<WebContentsImpl*>( OpenPopup(current_frame_host(), non_isolated_page, "") ->web_contents()) @@ -2381,31 +2383,29 @@ ->root() ->current_frame_host(); - EXPECT_FALSE( - popup_frame->GetSiteInstance()->IsCoopCoepCrossOriginIsolated()); - EXPECT_FALSE(popup_frame->GetSiteInstance()->IsRelatedSiteInstance( + EXPECT_FALSE(popup_rfh->GetSiteInstance()->IsCoopCoepCrossOriginIsolated()); + EXPECT_FALSE(popup_rfh->GetSiteInstance()->IsRelatedSiteInstance( current_frame_host()->GetSiteInstance())); - EXPECT_FALSE(popup_frame->frame_tree_node()->opener()); + EXPECT_FALSE(popup_rfh->frame_tree_node()->opener()); } // Open an isolated popup. { - RenderFrameHostImpl* popup_frame = + RenderFrameHostImpl* popup_rfh = static_cast<WebContentsImpl*>( OpenPopup(current_frame_host(), isolated_page, "")->web_contents()) ->GetFrameTree() ->root() ->current_frame_host(); - EXPECT_TRUE( - popup_frame->GetSiteInstance()->IsCoopCoepCrossOriginIsolated()); - EXPECT_EQ(popup_frame->GetSiteInstance(), + EXPECT_TRUE(popup_rfh->GetSiteInstance()->IsCoopCoepCrossOriginIsolated()); + EXPECT_EQ(popup_rfh->GetSiteInstance(), current_frame_host()->GetSiteInstance()); } // Open an isolated popup, but cross-origin. { - RenderFrameHostImpl* popup_frame = + RenderFrameHostImpl* popup_rfh = static_cast<WebContentsImpl*>( OpenPopup(current_frame_host(), isolated_page_b, "") ->web_contents()) @@ -2413,12 +2413,11 @@ ->root() ->current_frame_host(); - EXPECT_TRUE( - popup_frame->GetSiteInstance()->IsCoopCoepCrossOriginIsolated()); - EXPECT_FALSE(popup_frame->GetSiteInstance()->IsRelatedSiteInstance( + EXPECT_TRUE(popup_rfh->GetSiteInstance()->IsCoopCoepCrossOriginIsolated()); + EXPECT_FALSE(popup_rfh->GetSiteInstance()->IsRelatedSiteInstance( current_frame_host()->GetSiteInstance())); - EXPECT_FALSE(popup_frame->frame_tree_node()->opener()); - EXPECT_NE(popup_frame->GetSiteInstance()->GetProcess(), + EXPECT_FALSE(popup_rfh->frame_tree_node()->opener()); + EXPECT_NE(popup_rfh->GetSiteInstance()->GetProcess(), current_frame_host()->GetSiteInstance()->GetProcess()); } } @@ -2457,13 +2456,13 @@ iframe_navigation.WaitForNavigationFinished(); EXPECT_FALSE(iframe_navigation.was_successful()); - RenderFrameHostImpl* iframe = + RenderFrameHostImpl* iframe_rfh = current_frame_host()->child_at(0)->current_frame_host(); - SiteInstanceImpl* iframe_si = iframe->GetSiteInstance(); + SiteInstanceImpl* iframe_si = iframe_rfh->GetSiteInstance(); // The load of the document with 404 status code is blocked by COEP. // An error page is expected in lieu of that document. EXPECT_EQ(GURL(kUnreachableWebDataURL), - EvalJs(iframe, "document.location.href;")); + EvalJs(iframe_rfh, "document.location.href;")); EXPECT_TRUE(IsExpectedSubframeErrorTransition(main_si, iframe_si)); EXPECT_TRUE(iframe_si->IsCoopCoepCrossOriginIsolated()); } @@ -2481,15 +2480,15 @@ iframe_navigation.WaitForNavigationFinished(); EXPECT_FALSE(iframe_navigation.was_successful()); - RenderFrameHostImpl* iframe = + RenderFrameHostImpl* iframe_rfh = current_frame_host()->child_at(0)->current_frame_host(); - SiteInstanceImpl* iframe_si = iframe->GetSiteInstance(); + SiteInstanceImpl* iframe_si = iframe_rfh->GetSiteInstance(); EXPECT_TRUE(IsExpectedSubframeErrorTransition(main_si, iframe_si)); // The load of the document with 404 status code and custom body is blocked // by COEP. An error page is expected in lieu of that document. EXPECT_EQ(GURL(kUnreachableWebDataURL), - EvalJs(iframe, "document.location.href;")); + EvalJs(iframe_rfh, "document.location.href;")); EXPECT_TRUE(iframe_si->IsCoopCoepCrossOriginIsolated()); } @@ -2506,9 +2505,9 @@ iframe_navigation.WaitForNavigationFinished(); EXPECT_FALSE(iframe_navigation.was_successful()); - RenderFrameHostImpl* iframe = + RenderFrameHostImpl* iframe_rfh = current_frame_host()->child_at(0)->current_frame_host(); - SiteInstanceImpl* iframe_si = iframe->GetSiteInstance(); + SiteInstanceImpl* iframe_si = iframe_rfh->GetSiteInstance(); EXPECT_TRUE(IsExpectedSubframeErrorTransition(main_si, iframe_si)); EXPECT_TRUE(iframe_si->IsCoopCoepCrossOriginIsolated()); } @@ -2581,28 +2580,27 @@ cross_origin_iframe_navigation.WaitForNavigationFinished(); EXPECT_TRUE(cross_origin_iframe_navigation.was_successful()); - RenderFrameHostImpl* iframe = + RenderFrameHostImpl* iframe_rfh = current_frame_host()->child_at(0)->current_frame_host(); - SiteInstanceImpl* iframe_si = iframe->GetSiteInstance(); + SiteInstanceImpl* iframe_si = iframe_rfh->GetSiteInstance(); EXPECT_TRUE(iframe_si->IsCoopCoepCrossOriginIsolated()); EXPECT_TRUE(iframe_si->IsRelatedSiteInstance(main_si)); EXPECT_EQ(iframe_si->GetProcess(), main_si->GetProcess()); // Open an isolated popup, but cross-origin. { - RenderFrameHostImpl* popup_frame = + RenderFrameHostImpl* popup_rfh = static_cast<WebContentsImpl*>( - OpenPopup(iframe, isolated_page, "", "", false)->web_contents()) + OpenPopup(iframe_rfh, isolated_page, "", "", false)->web_contents()) ->GetFrameTree() ->root() ->current_frame_host(); - EXPECT_TRUE( - popup_frame->GetSiteInstance()->IsCoopCoepCrossOriginIsolated()); - EXPECT_FALSE(popup_frame->GetSiteInstance()->IsRelatedSiteInstance( + EXPECT_TRUE(popup_rfh->GetSiteInstance()->IsCoopCoepCrossOriginIsolated()); + EXPECT_FALSE(popup_rfh->GetSiteInstance()->IsRelatedSiteInstance( current_frame_host()->GetSiteInstance())); - EXPECT_FALSE(popup_frame->frame_tree_node()->opener()); - EXPECT_NE(popup_frame->GetSiteInstance()->GetProcess(), + EXPECT_FALSE(popup_rfh->frame_tree_node()->opener()); + EXPECT_NE(popup_rfh->GetSiteInstance()->GetProcess(), current_frame_host()->GetSiteInstance()->GetProcess()); } }
diff --git a/content/browser/devtools/BUILD.gn b/content/browser/devtools/BUILD.gn index 24749934..ac10fe1 100644 --- a/content/browser/devtools/BUILD.gn +++ b/content/browser/devtools/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("//components/viz/common/debugger/viz_debugger.gni") import("//third_party/inspector_protocol/inspector_protocol.gni") import("//third_party/protobuf/proto_library.gni") import("//tools/grit/grit_rule.gni") @@ -38,20 +39,41 @@ } } +# Here we concatenate the viz_debugger.pdl into our browser protocol. +# This technique is nearly identical to what is done for cros_protocol.pdl in chrome/browser/devtools +_concatenated_protocol_path = + "$root_gen_dir/content/browser/devtools/protocol.json" +action("concatenate_protocols") { + script = "//third_party/inspector_protocol/concatenate_protocols.py" + deps = [ "//third_party/blink/public/devtools_protocol:protocol_version" ] + + _blink_protocol_path = + "$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json" + inputs = [ _blink_protocol_path ] + output_file = _concatenated_protocol_path + outputs = [ output_file ] + + args = [ rebase_path(_blink_protocol_path, root_build_dir) ] + if (use_viz_debugger) { + _visual_debugger_pdl = "//components/viz/common/debugger/viz_debugger.pdl" + inputs += [ _visual_debugger_pdl ] + args += [ rebase_path(_visual_debugger_pdl, root_build_dir) ] + } + + args += [ rebase_path(output_file, root_build_dir) ] +} + inspector_protocol_generate("protocol_sources") { visibility = [ "//content/browser" ] - deps = [ "//third_party/blink/public/devtools_protocol:protocol_version" ] - _blink_protocol_path = rebase_path( - "$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json", - root_build_dir) - + deps = [ ":concatenate_protocols" ] inspector_protocol_dir = "//third_party/inspector_protocol" out_dir = target_gen_dir config_file = "protocol_config.json" - config_values = [ "protocol.path=$_blink_protocol_path" ] + protocol_path = rebase_path(_concatenated_protocol_path, root_build_dir) + config_values = [ "protocol.path=$protocol_path" ] inputs = [ - "$root_gen_dir/third_party/blink/public/devtools_protocol/protocol.json", + _concatenated_protocol_path, config_file, ] @@ -111,6 +133,13 @@ "protocol/web_authn.cc", "protocol/web_authn.h", ] + + if (use_viz_debugger) { + outputs += [ + "protocol/visual_debugger.cc", + "protocol/visual_debugger.h", + ] + } } proto_library("devtools_background_services_proto") {
diff --git a/content/browser/devtools/browser_devtools_agent_host.cc b/content/browser/devtools/browser_devtools_agent_host.cc index 55efb9d..cdad4cb9 100644 --- a/content/browser/devtools/browser_devtools_agent_host.cc +++ b/content/browser/devtools/browser_devtools_agent_host.cc
@@ -10,6 +10,7 @@ #include "base/memory/ptr_util.h" #include "base/no_destructor.h" #include "base/single_thread_task_runner.h" +#include "components/viz/common/buildflags.h" #include "content/browser/devtools/devtools_session.h" #include "content/browser/devtools/protocol/browser_handler.h" #include "content/browser/devtools/protocol/fetch_handler.h" @@ -24,6 +25,10 @@ #include "content/browser/devtools/protocol/tracing_handler.h" #include "content/browser/renderer_host/frame_tree_node.h" +#if BUILDFLAG(USE_VIZ_DEBUGGER) +#include "content/browser/devtools/protocol/visual_debugger_handler.h" +#endif + namespace content { scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::CreateForBrowser( @@ -81,6 +86,9 @@ session->AddHandler(std::make_unique<protocol::BrowserHandler>( session->GetClient()->MayWriteLocalFiles())); +#if BUILDFLAG(USE_VIZ_DEBUGGER) + session->AddHandler(std::make_unique<protocol::VisualDebuggerHandler>()); +#endif session->AddHandler(std::make_unique<protocol::IOHandler>(GetIOContext())); session->AddHandler(std::make_unique<protocol::FetchHandler>( GetIOContext(),
diff --git a/content/browser/devtools/devtools_instrumentation.cc b/content/browser/devtools/devtools_instrumentation.cc index dbe847b..ba619ff 100644 --- a/content/browser/devtools/devtools_instrumentation.cc +++ b/content/browser/devtools/devtools_instrumentation.cc
@@ -293,6 +293,8 @@ : nullptr; if (!ftn) return; + DispatchToAgents(ftn, &protocol::BrowserHandler::DownloadWillBegin, ftn, + item); DispatchToAgents(ftn, &protocol::PageHandler::DownloadWillBegin, ftn, item); for (auto* agent_host : BrowserDevToolsAgentHost::Instances()) {
diff --git a/content/browser/devtools/protocol/browser_handler.cc b/content/browser/devtools/protocol/browser_handler.cc index 271b0f7..66b7e45c 100644 --- a/content/browser/devtools/protocol/browser_handler.cc +++ b/content/browser/devtools/protocol/browser_handler.cc
@@ -344,7 +344,7 @@ // static std::vector<BrowserHandler*> BrowserHandler::ForAgentHost( - BrowserDevToolsAgentHost* host) { + DevToolsAgentHostImpl* host) { return host->HandlersByName<BrowserHandler>(Browser::Metainfo::domainName); }
diff --git a/content/browser/devtools/protocol/browser_handler.h b/content/browser/devtools/protocol/browser_handler.h index cd1b69e..3f58a98 100644 --- a/content/browser/devtools/protocol/browser_handler.h +++ b/content/browser/devtools/protocol/browser_handler.h
@@ -14,7 +14,6 @@ namespace content { class BrowserContext; -class BrowserDevToolsAgentHost; class FrameTreeNode; namespace protocol { @@ -30,8 +29,7 @@ const Maybe<std::string>& browser_context_id, BrowserContext** browser_context); - static std::vector<BrowserHandler*> ForAgentHost( - BrowserDevToolsAgentHost* host); + static std::vector<BrowserHandler*> ForAgentHost(DevToolsAgentHostImpl* host); void Wire(UberDispatcher* dispatcher) override;
diff --git a/content/browser/devtools/protocol/visual_debugger_handler.cc b/content/browser/devtools/protocol/visual_debugger_handler.cc new file mode 100644 index 0000000..e9b1b10 --- /dev/null +++ b/content/browser/devtools/protocol/visual_debugger_handler.cc
@@ -0,0 +1,93 @@ +// 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. + +#include "content/browser/devtools/protocol/visual_debugger_handler.h" + +#include <string.h> +#include <algorithm> + +#include "base/bind_post_task.h" +#include "base/json/json_writer.h" +#include "base/values.h" +#include "build/build_config.h" +#include "content/browser/devtools/protocol/base_string_adapter.h" +#include "content/browser/gpu/gpu_process_host.h" +#include "content/public/browser/browser_context.h" +#include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/browser_thread.h" +#include "third_party/inspector_protocol/crdtp/json.h" + +namespace content { +namespace protocol { + +static const int sMaxJsonDepth = 1000; +VisualDebuggerHandler::VisualDebuggerHandler() + : DevToolsDomainHandler(VisualDebugger::Metainfo::domainName) {} + +VisualDebuggerHandler::~VisualDebuggerHandler() { + StopStream(); +} + +void VisualDebuggerHandler::Wire(UberDispatcher* dispatcher) { + frontend_ = std::make_unique<VisualDebugger::Frontend>(dispatcher->channel()); + VisualDebugger::Dispatcher::wire(dispatcher, this); +} + +DispatchResponse VisualDebuggerHandler::FilterStream( + std::unique_ptr<protocol::DictionaryValue> in_filter) { + std::unique_ptr<base::Value> dict = + toBaseValue(in_filter.get(), sMaxJsonDepth); + + GpuProcessHost::CallOnIO( + GPU_PROCESS_KIND_SANDBOXED, + /*force_create=*/false, + base::BindOnce( + [](base::Value json, GpuProcessHost* host) { + host->gpu_host()->FilterVisualDebugStream(std::move(json)); + }, + std::move(*dict.get()))); + + return DispatchResponse::Success(); +} + +DispatchResponse VisualDebuggerHandler::StartStream() { + enabled_ = true; + GpuProcessHost::CallOnIO( + GPU_PROCESS_KIND_SANDBOXED, + /*force_create=*/false, + base::BindOnce( + [](base::RepeatingCallback<void(base::Value)> callback, + GpuProcessHost* host) { + host->gpu_host()->StartVisualDebugStream(callback); + }, + base::BindPostTask( + base::ThreadTaskRunnerHandle::Get(), + base::BindRepeating(&VisualDebuggerHandler::OnFrameResponse, + weak_ptr_factory_.GetWeakPtr()), + FROM_HERE))); + return DispatchResponse::Success(); +} + +void VisualDebuggerHandler::OnFrameResponse(base::Value json) { + // This should be called via the 'BindPostTask' in 'StartStream' function + // above and thus should be in the correct thread. + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + std::unique_ptr<protocol::DictionaryValue> dict = + protocol::DictionaryValue::cast(toProtocolValue(&json, sMaxJsonDepth)); + frontend_->FrameResponse(std::move(dict)); +} + +DispatchResponse VisualDebuggerHandler::StopStream() { + if (enabled_) { + GpuProcessHost::CallOnIO(GPU_PROCESS_KIND_SANDBOXED, + /*force_create=*/false, + base::BindOnce([](GpuProcessHost* host) { + host->gpu_host()->StopVisualDebugStream(); + })); + } + enabled_ = false; + return DispatchResponse::Success(); +} +} // namespace protocol +} // namespace content
diff --git a/content/browser/devtools/protocol/visual_debugger_handler.h b/content/browser/devtools/protocol/visual_debugger_handler.h new file mode 100644 index 0000000..cbfe9e4 --- /dev/null +++ b/content/browser/devtools/protocol/visual_debugger_handler.h
@@ -0,0 +1,44 @@ +// 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. + +#ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_VISUAL_DEBUGGER_HANDLER_H_ +#define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_VISUAL_DEBUGGER_HANDLER_H_ + +#include "base/containers/flat_set.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "content/browser/devtools/protocol/browser.h" +#include "content/browser/devtools/protocol/devtools_domain_handler.h" +#include "content/browser/devtools/protocol/visual_debugger.h" + +namespace content { +namespace protocol { + +class VisualDebuggerHandler : public DevToolsDomainHandler, + public VisualDebugger::Backend { + public: + VisualDebuggerHandler(); + ~VisualDebuggerHandler() override; + + private: + // DevToolsDomainHandler: + void Wire(UberDispatcher* dispatcher) override; + + DispatchResponse FilterStream( + std::unique_ptr<protocol::DictionaryValue> in_filter) override; + + DispatchResponse StartStream() override; + DispatchResponse StopStream() override; + + void OnFrameResponse(base::Value json); + + bool enabled_ = false; + std::unique_ptr<VisualDebugger::Frontend> frontend_; + base::WeakPtrFactory<VisualDebuggerHandler> weak_ptr_factory_{this}; +}; + +} // namespace protocol +} // namespace content + +#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_VISUAL_DEBUGGER_HANDLER_H_
diff --git a/content/browser/devtools/protocol/visual_debugger_handler_browsertest.cc b/content/browser/devtools/protocol/visual_debugger_handler_browsertest.cc new file mode 100644 index 0000000..0db88bd9 --- /dev/null +++ b/content/browser/devtools/protocol/visual_debugger_handler_browsertest.cc
@@ -0,0 +1,42 @@ +// 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. + +#include <stddef.h> +#include <memory> +#include <utility> + +#include "base/bind.h" +#include "base/callback_helpers.h" +#include "base/command_line.h" +#include "base/json/json_reader.h" +#include "base/system/sys_info.h" +#include "base/test/scoped_feature_list.h" +#include "base/values.h" +#include "build/build_config.h" +#include "content/browser/devtools/protocol/devtools_protocol_test_support.h" +#include "content/public/common/content_switches.h" +#include "content/public/common/url_constants.h" +#include "content/public/test/browser_test.h" +#include "content/public/test/browser_test_utils.h" +#include "content/public/test/content_browser_test_utils.h" + +namespace content { +IN_PROC_BROWSER_TEST_F(DevToolsProtocolTest, VisualDebuggerTest) { + set_agent_host_can_close(); + GURL url = GURL("data:text/html,<body></body>"); + NavigateToURLBlockUntilNavigationsComplete(shell(), url, 1); + Attach(); + SendCommand("VisualDebugger.startStream", nullptr, true); + WaitForNotification("VisualDebugger.frameResponse", true); + + std::unique_ptr<base::DictionaryValue> command_params = + std::make_unique<base::DictionaryValue>(); + auto filter_param = + std::string(R"({"filters":[{"selector":{"anno":""},"active":true}]})"); + command_params->SetString("json", filter_param); + SendCommand("VisualDebugger.filterStream", std::move(command_params), true); + SendCommand("VisualDebugger.stopStream", nullptr, true); +} + +} // namespace content
diff --git a/content/browser/devtools/protocol_config.json b/content/browser/devtools/protocol_config.json index 9129e527..4ac51e5 100644 --- a/content/browser/devtools/protocol_config.json +++ b/content/browser/devtools/protocol_config.json
@@ -105,6 +105,11 @@ "async": ["start", "getCategories", "requestMemoryDump"] }, { + "domain": "VisualDebugger", + "include": ["filterStream", "startStream", "stopStream"], + "include_events": ["frameResponse"] + }, + { "domain": "Fetch", "async": ["enable", "continueRequest", "failRequest", "fulfillRequest", "continueWithAuth", "getResponseBody", "takeResponseBodyAsStream"] },
diff --git a/content/browser/devtools/render_frame_devtools_agent_host.cc b/content/browser/devtools/render_frame_devtools_agent_host.cc index 160a34f..40499c0 100644 --- a/content/browser/devtools/render_frame_devtools_agent_host.cc +++ b/content/browser/devtools/render_frame_devtools_agent_host.cc
@@ -16,6 +16,7 @@ #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" +#include "components/viz/common/buildflags.h" #include "content/browser/bad_message.h" #include "content/browser/child_process_security_policy_impl.h" #include "content/browser/devtools/devtools_manager.h" @@ -72,6 +73,10 @@ #include "content/browser/devtools/protocol/webauthn_handler.h" #endif +#if BUILDFLAG(USE_VIZ_DEBUGGER) +#include "content/browser/devtools/protocol/visual_debugger_handler.h" +#endif + namespace content { namespace { @@ -301,6 +306,9 @@ session->AddHandler(std::make_unique<protocol::InspectorHandler>()); session->AddHandler(std::make_unique<protocol::IOHandler>(GetIOContext())); session->AddHandler(std::make_unique<protocol::MemoryHandler>()); +#if BUILDFLAG(USE_VIZ_DEBUGGER) + session->AddHandler(std::make_unique<protocol::VisualDebuggerHandler>()); +#endif if (!frame_tree_node_ || !frame_tree_node_->parent()) session->AddHandler(std::make_unique<protocol::OverlayHandler>()); session->AddHandler(std::make_unique<protocol::NetworkHandler>(
diff --git a/content/browser/gpu/gpu_ipc_browsertests.cc b/content/browser/gpu/gpu_ipc_browsertests.cc index a3649ac..bb4c801f 100644 --- a/content/browser/gpu/gpu_ipc_browsertests.cc +++ b/content/browser/gpu/gpu_ipc_browsertests.cc
@@ -271,16 +271,6 @@ EXPECT_TRUE(IsChannelEstablished()); } -using GpuProcessHostBrowserTest = BrowserGpuChannelHostFactoryTest; - -IN_PROC_BROWSER_TEST_F(GpuProcessHostBrowserTest, Shutdown) { - DCHECK(!IsChannelEstablished()); - EstablishAndWait(); - base::RunLoop run_loop; - StopGpuProcess(run_loop.QuitClosure()); - run_loop.Run(); -} - // Disabled outside linux like other tests here sadface. // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. @@ -345,25 +335,4 @@ } #endif -class GpuProcessHostDisableGLBrowserTest : public GpuProcessHostBrowserTest { - public: - void SetUpCommandLine(base::CommandLine* command_line) override { - UseSoftwareCompositing(); - GpuProcessHostBrowserTest::SetUpCommandLine(command_line); - command_line->AppendSwitchASCII(switches::kUseGL, - gl::kGLImplementationDisabledName); - } -}; - -// Android and CrOS don't support disabling GL. -#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) -IN_PROC_BROWSER_TEST_F(GpuProcessHostDisableGLBrowserTest, CreateAndDestroy) { - DCHECK(!IsChannelEstablished()); - EstablishAndWait(); - base::RunLoop run_loop; - StopGpuProcess(run_loop.QuitClosure()); - run_loop.Run(); -} -#endif - } // namespace content
diff --git a/content/browser/gpu/peak_gpu_memory_tracker_impl_browsertest.cc b/content/browser/gpu/peak_gpu_memory_tracker_impl_browsertest.cc index 83b984a..830986a 100644 --- a/content/browser/gpu/peak_gpu_memory_tracker_impl_browsertest.cc +++ b/content/browser/gpu/peak_gpu_memory_tracker_impl_browsertest.cc
@@ -129,7 +129,6 @@ void Crash() override {} void Hang() override {} void ThrowJavaException() override {} - void Stop(StopCallback callback) override {} base::RepeatingClosure quit_closure_; };
diff --git a/content/browser/interest_group/ad_auction_service_impl.cc b/content/browser/interest_group/ad_auction_service_impl.cc index dcdf7da..1a0d6fcb 100644 --- a/content/browser/interest_group/ad_auction_service_impl.cc +++ b/content/browser/interest_group/ad_auction_service_impl.cc
@@ -349,7 +349,7 @@ bidder_report->report_url.SchemeIs(url::kHttpsScheme)) { FetchReport(factory, bidder_report->report_url, origin()); } - if (seller_report->report_requested && seller_report->report_url.is_valid() && + if (seller_report->success && seller_report->report_url.is_valid() && seller_report->report_url.SchemeIs(url::kHttpsScheme)) { FetchReport(factory, seller_report->report_url, origin()); }
diff --git a/content/browser/media/fullscreen_video_detection_browsertest.cc b/content/browser/media/fullscreen_video_detection_browsertest.cc index c1607648..40534117 100644 --- a/content/browser/media/fullscreen_video_detection_browsertest.cc +++ b/content/browser/media/fullscreen_video_detection_browsertest.cc
@@ -63,10 +63,14 @@ private: std::unique_ptr<base::RunLoop> run_loop_; size_t expected_event_count_ = 0; + FullscreenTestEvent last_event_ = FullscreenTestEvent::kInvalidEvent; std::vector<FullscreenTestEvent> events_; void AddEvent(FullscreenTestEvent e) { + if (last_event_ == e) + return; events_.push_back(e); + last_event_ = e; if (events_.size() == expected_event_count_ && run_loop_) run_loop_->Quit(); }
diff --git a/content/browser/media/key_system_support_impl.cc b/content/browser/media/key_system_support_impl.cc index 4877aa4..1e09146 100644 --- a/content/browser/media/key_system_support_impl.cc +++ b/content/browser/media/key_system_support_impl.cc
@@ -41,6 +41,11 @@ available); } +template <typename T> +std::vector<T> SetToVector(const base::flat_set<T>& s) { + return std::vector<T>(s.begin(), s.end()); +} + // Returns a CdmCapability with codecs specified on command line. Returns null // if kOverrideHardwareSecureCodecsForTesting was not specified or not valid // codecs specified. @@ -243,15 +248,30 @@ hw_secure_capability)); } - auto capability = media::mojom::KeySystemCapability::New(); - capability->sw_secure_capability = GetSoftwareSecureCapability(key_system); - capability->hw_secure_capability = hw_secure_capability; + auto sw_secure_capability = GetSoftwareSecureCapability(key_system); - if (!capability->sw_secure_capability && !capability->hw_secure_capability) { + if (!sw_secure_capability && !hw_secure_capability) { std::move(callback).Run(false, nullptr); return; } + auto capability = media::mojom::KeySystemCapability::New(); + + if (sw_secure_capability) { + capability->video_codecs = sw_secure_capability->video_codecs; + capability->encryption_schemes = + SetToVector(sw_secure_capability->encryption_schemes); + capability->session_types = + SetToVector(sw_secure_capability->session_types); + } + + if (hw_secure_capability) { + capability->hw_secure_video_codecs = hw_secure_capability->video_codecs; + capability->hw_secure_encryption_schemes = + SetToVector(hw_secure_capability->encryption_schemes); + // TODO(xhwang): Also populate supported session types here. + } + std::move(callback).Run(true, std::move(capability)); }
diff --git a/content/browser/media/key_system_support_impl_unittest.cc b/content/browser/media/key_system_support_impl_unittest.cc index 743d5a7..5aa910c 100644 --- a/content/browser/media/key_system_support_impl_unittest.cc +++ b/content/browser/media/key_system_support_impl_unittest.cc
@@ -50,30 +50,26 @@ return a == Container(b); } -#define EXPECT_STL_EQ(container, ...) \ - do { \ - EXPECT_THAT(container, ::testing::ElementsAre(__VA_ARGS__)); \ +#define EXPECT_STL_EQ(a, ...) \ + do { \ + EXPECT_TRUE(StlEquals(a, {__VA_ARGS__})); \ } while (false) #define EXPECT_VIDEO_CODECS(...) \ - EXPECT_STL_EQ(capability_->sw_secure_capability->video_codecs, __VA_ARGS__) + EXPECT_STL_EQ(capability_->video_codecs, __VA_ARGS__) -#define EXPECT_ENCRYPTION_SCHEMES(...) \ - EXPECT_STL_EQ(capability_->sw_secure_capability->encryption_schemes, \ - __VA_ARGS__) +#define EXPECT_ENCRYPTION_SCHEMES(...) \ + EXPECT_STL_EQ(capability_->encryption_schemes, __VA_ARGS__) #define EXPECT_SESSION_TYPES(...) \ - EXPECT_STL_EQ(capability_->sw_secure_capability->session_types, __VA_ARGS__) + EXPECT_STL_EQ(capability_->session_types, __VA_ARGS__) #define EXPECT_HW_SECURE_VIDEO_CODECS(...) \ - EXPECT_STL_EQ(capability_->hw_secure_capability->video_codecs, __VA_ARGS__) + EXPECT_STL_EQ(capability_->hw_secure_video_codecs, __VA_ARGS__) -#define EXPECT_HW_SECURE_ENCRYPTION_SCHEMES(...) \ - EXPECT_STL_EQ(capability_->hw_secure_capability->encryption_schemes, \ - __VA_ARGS__) +#define EXPECT_HW_SECURE_ENCRYPTION_SCHEMES(...) \ + EXPECT_STL_EQ(capability_->hw_secure_encryption_schemes, __VA_ARGS__) -#define EXPECT_HW_SECURE_SESSION_TYPES(...) \ - EXPECT_STL_EQ(capability_->hw_secure_capability->session_types, __VA_ARGS__) } // namespace class KeySystemSupportImplTest : public testing::Test { @@ -143,8 +139,6 @@ Register("KeySystem", TestCdmCapability()); EXPECT_TRUE(IsSupported("KeySystem")); - EXPECT_TRUE(capability_->sw_secure_capability); - EXPECT_FALSE(capability_->hw_secure_capability); EXPECT_VIDEO_CODECS(VideoCodec::kCodecVP8, VideoCodec::kCodecVP9); EXPECT_ENCRYPTION_SCHEMES(EncryptionScheme::kCenc, EncryptionScheme::kCbcs); EXPECT_SESSION_TYPES(CdmSessionType::kTemporary, @@ -164,13 +158,11 @@ Register("KeySystem", TestCdmCapability(), Robustness::kHardwareSecure); EXPECT_TRUE(IsSupported("KeySystem")); - EXPECT_FALSE(capability_->sw_secure_capability); - EXPECT_TRUE(capability_->hw_secure_capability); EXPECT_HW_SECURE_VIDEO_CODECS(VideoCodec::kCodecVP8, VideoCodec::kCodecVP9); EXPECT_HW_SECURE_ENCRYPTION_SCHEMES(EncryptionScheme::kCenc, EncryptionScheme::kCbcs); - EXPECT_HW_SECURE_SESSION_TYPES(CdmSessionType::kTemporary, - CdmSessionType::kPersistentLicense); + // TODO(xhwang): Support hardware secure session types. + EXPECT_TRUE(capability_->session_types.empty()); } TEST_F(KeySystemSupportImplTest, MultipleKeySystems) {
diff --git a/content/browser/media/key_system_support_win.cc b/content/browser/media/key_system_support_win.cc index f39080b..750226a 100644 --- a/content/browser/media/key_system_support_win.cc +++ b/content/browser/media/key_system_support_win.cc
@@ -24,19 +24,20 @@ CdmCapabilityCB cdm_capability_cb, bool is_supported, media::mojom::KeySystemCapabilityPtr key_system_capability) { - // Key system must support at least 1 video codec, 1 encryption scheme, - // and 1 encryption scheme to be considered. Support for audio codecs is - // optional. if (!is_supported || !key_system_capability || - !key_system_capability->hw_secure_capability || - key_system_capability->hw_secure_capability->video_codecs.empty() || - key_system_capability->hw_secure_capability->encryption_schemes.empty() || - key_system_capability->hw_secure_capability->session_types.empty()) { + key_system_capability->hw_secure_video_codecs.empty() || + key_system_capability->hw_secure_encryption_schemes.empty()) { std::move(cdm_capability_cb).Run(base::nullopt); return; } - std::move(cdm_capability_cb).Run(key_system_capability->hw_secure_capability); + // TODO(xhwang/jrummell): Support hardware session types. Now only assume + // temporary session support. + std::move(cdm_capability_cb) + .Run(media::CdmCapability( + key_system_capability->hw_secure_video_codecs, + VectorToSet(key_system_capability->hw_secure_encryption_schemes), + {media::CdmSessionType::kTemporary})); } } // namespace
diff --git a/content/browser/process_internals/process_internals.mojom b/content/browser/process_internals/process_internals.mojom index 7109cb1f..0b2f4ef 100644 --- a/content/browser/process_internals/process_internals.mojom +++ b/content/browser/process_internals/process_internals.mojom
@@ -66,6 +66,14 @@ // restarts, and they are cleared when the user clears browsing data. GetUserTriggeredIsolatedOrigins() => (array<string> isolated_origins); + // Returns a list of web-triggered isolated origins, which are typically + // added in response to heuristics triggered directly by web sites, such + // as headers that suggest the site might benefit from isolation. Like + // user-triggered isolated origins, these isolated origins apply within + // the current profile only, though currently they aren't preserved across + // restarts. + GetWebTriggeredIsolatedOrigins() => (array<string> isolated_origins); + // Returns a list of isolated origins that apply globally in all profiles. GetGloballyIsolatedOrigins() => (array<IsolatedOriginInfo> isolated_origins);
diff --git a/content/browser/process_internals/process_internals_handler_impl.cc b/content/browser/process_internals/process_internals_handler_impl.cc index c0aa1121..43dd9e5 100644 --- a/content/browser/process_internals/process_internals_handler_impl.cc +++ b/content/browser/process_internals/process_internals_handler_impl.cc
@@ -93,6 +93,8 @@ return "Test"; case IsolatedOriginSource::USER_TRIGGERED: return "User-triggered"; + case IsolatedOriginSource::WEB_TRIGGERED: + return "Web-triggered"; default: NOTREACHED(); return ""; @@ -117,6 +119,8 @@ modes.push_back("Isolate Origins"); if (SiteIsolationPolicy::IsStrictOriginIsolationEnabled()) modes.push_back("Strict Origin Isolation"); + if (SiteIsolationPolicy::IsSiteIsolationForCOOPEnabled()) + modes.push_back("COOP"); // Retrieve any additional site isolation modes controlled by the embedder. std::vector<std::string> additional_modes = @@ -146,6 +150,19 @@ std::move(callback).Run(std::move(serialized_origins)); } +void ProcessInternalsHandlerImpl::GetWebTriggeredIsolatedOrigins( + GetWebTriggeredIsolatedOriginsCallback callback) { + // Retrieve serialized user-triggered isolated origins for the current + // profile (i.e., profile from which chrome://process-internals is shown). + auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); + std::vector<std::string> serialized_origins; + for (const auto& origin : policy->GetIsolatedOrigins( + IsolatedOriginSource::WEB_TRIGGERED, browser_context_)) { + serialized_origins.push_back(origin.Serialize()); + } + std::move(callback).Run(std::move(serialized_origins)); +} + void ProcessInternalsHandlerImpl::GetGloballyIsolatedOrigins( GetGloballyIsolatedOriginsCallback callback) { auto* policy = ChildProcessSecurityPolicyImpl::GetInstance();
diff --git a/content/browser/process_internals/process_internals_handler_impl.h b/content/browser/process_internals/process_internals_handler_impl.h index 51a7f01a..b594e6f 100644 --- a/content/browser/process_internals/process_internals_handler_impl.h +++ b/content/browser/process_internals/process_internals_handler_impl.h
@@ -26,6 +26,8 @@ void GetIsolationMode(GetIsolationModeCallback callback) override; void GetUserTriggeredIsolatedOrigins( GetUserTriggeredIsolatedOriginsCallback callback) override; + void GetWebTriggeredIsolatedOrigins( + GetWebTriggeredIsolatedOriginsCallback callback) override; void GetGloballyIsolatedOrigins( GetGloballyIsolatedOriginsCallback callback) override; void GetAllWebContentsInfo(GetAllWebContentsInfoCallback callback) override;
diff --git a/content/browser/renderer_host/frame_tree_browsertest.cc b/content/browser/renderer_host/frame_tree_browsertest.cc index 31646a79..04f13a0 100644 --- a/content/browser/renderer_host/frame_tree_browsertest.cc +++ b/content/browser/renderer_host/frame_tree_browsertest.cc
@@ -384,11 +384,9 @@ " resolve(frames[0].self.origin);" " }, 16);" "});"); - // Since we used document.write(), the URL of the frame document changes to - // match the document that called it. - EXPECT_EQ(initiator->current_url(), target->current_url()); - EXPECT_EQ(url::kHttpScheme, target->current_url().scheme()); EXPECT_EQ(target->current_origin(), about_blank_origin); + EXPECT_EQ(GURL(url::kAboutBlankURL), target->current_url()); + EXPECT_EQ(url::kAboutScheme, target->current_url().scheme()); EXPECT_FALSE(target->current_origin().opaque()); EXPECT_EQ("b.com", target->current_origin().host()); EXPECT_EQ(url::kHttpScheme, target->current_origin().scheme());
diff --git a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc index 8315f79..b112ff6 100644 --- a/content/browser/renderer_host/navigation_controller_impl_browsertest.cc +++ b/content/browser/renderer_host/navigation_controller_impl_browsertest.cc
@@ -1579,9 +1579,6 @@ EXPECT_EQ(blank_url, new_root->current_url()); // Make a new iframe in it using document.write from the opener. - // Call document.open() outside LoadCommittedCapturer as it implicitly does a - // same-document navigation. - EXPECT_TRUE(ExecJs(root->current_frame_host(), "w.document.open()")); { LoadCommittedCapturer capturer(new_shell->web_contents()); std::string html = "<iframe src='" + url1.spec() + "'></iframe>"; @@ -1593,9 +1590,7 @@ capturer.Wait(); } ASSERT_EQ(1U, new_root->child_count()); - // Since we did a document.open(), the new root's URL is the same as the - // outer URL. - EXPECT_EQ(url1, new_root->current_url()); + EXPECT_EQ(blank_url, new_root->current_url()); EXPECT_EQ(url1, new_root->child_at(0)->current_url()); // Navigate the subframe. @@ -1607,7 +1602,7 @@ EXPECT_TRUE(ExecJs(new_root->child_at(0), script)); capturer.Wait(); } - EXPECT_EQ(url1, new_root->current_url()); + EXPECT_EQ(blank_url, new_root->current_url()); EXPECT_EQ(url2, new_root->child_at(0)->current_url()); EXPECT_EQ(2, new_shell->web_contents()->GetController().GetEntryCount()); @@ -1642,96 +1637,6 @@ EXPECT_TRUE(new_root->current_frame_host()->IsRenderFrameLive()); } -// Test that a frame's url is correctly updated after a document.open() from -// an about:blank frame. -IN_PROC_BROWSER_TEST_P(NavigationControllerBrowserTest, - DocumentOpenFromAboutBlank) { - GURL url1 = embedded_test_server()->GetURL( - "/navigation_controller/page_with_iframe_simple.html"); - EXPECT_TRUE(NavigateToURL(shell(), url1)); - FrameTreeNode* root = contents()->GetFrameTree()->root(); - - // Make a new iframe that will document.open() its sibling. - { - LoadCommittedCapturer capturer(contents()); - EXPECT_EQ("done", EvalJs(root->current_frame_host(), R"( - new Promise(async resolve => { - const blank_iframe = document.createElement('iframe'); - await new Promise(resolve => { - blank_iframe.onload = resolve; - document.body.appendChild(blank_iframe); - }); - - let script = document.createElement('script'); - script.text = ` - const sibling = parent.document.getElementById("frame") - sibling.contentDocument.open(); - `; - blank_iframe.contentDocument.body.appendChild(script); - resolve("done"); - }) - )")); - capturer.Wait(); - } - ASSERT_EQ(2U, root->child_count()); - EXPECT_EQ(GURL(url::kAboutBlankURL), root->child_at(0)->current_url()); - EXPECT_EQ(GURL(url::kAboutBlankURL), root->child_at(1)->current_url()); -} - -// Test that a frame's url is correctly updated after a document.open() from -// an about:srcdoc frame. -IN_PROC_BROWSER_TEST_P(NavigationControllerBrowserTest, - DocumentOpenFromSrcdoc) { - GURL url1 = embedded_test_server()->GetURL( - "/navigation_controller/page_with_iframe_simple.html"); - EXPECT_TRUE(NavigateToURL(shell(), url1)); - FrameTreeNode* root = contents()->GetFrameTree()->root(); - - // Make a new iframe that will document.open() its sibling. - { - LoadCommittedCapturer capturer(contents()); - std::string html = "<iframe src='" + url1.spec() + "'></iframe>"; - std::string script = - "let origin = document.createElement('iframe');" - "origin.srcdoc = '<script>parent.document.getElementById(\"frame\")" - ".contentDocument.open();</s' + 'cript>';" - "document.body.appendChild(origin);"; - EXPECT_TRUE(ExecJs(root->current_frame_host(), script)); - capturer.Wait(); - } - ASSERT_EQ(2U, root->child_count()); - EXPECT_EQ("about:srcdoc", root->child_at(0)->current_url()); - EXPECT_EQ("about:srcdoc", root->child_at(1)->current_url()); -} - -// Test that a frame's url is correctly updated after a document.open() from -// a blob: url -IN_PROC_BROWSER_TEST_P(NavigationControllerBrowserTest, - DocumentOpenFromBloblIframe) { - GURL url1 = embedded_test_server()->GetURL( - "/navigation_controller/page_with_iframe_simple.html"); - EXPECT_TRUE(NavigateToURL(shell(), url1)); - FrameTreeNode* root = contents()->GetFrameTree()->root(); - - // Make a new iframe that will document.open() its sibling. - { - LoadCommittedCapturer capturer(contents()); - std::string html = "<iframe src='" + url1.spec() + "'></iframe>"; - std::string script = - "let origin = document.createElement('iframe');" - "let blob = new Blob(['<script>" - "parent.document.getElementById(\"frame\").contentDocument.open();" - "</s' + 'cript>'], { type: 'text/html' });" - "origin.src = URL.createObjectURL(blob);" - "document.body.appendChild(origin);"; - EXPECT_TRUE(ExecJs(root->current_frame_host(), script)); - capturer.Wait(); - } - ASSERT_EQ(2U, root->child_count()); - EXPECT_TRUE(root->child_at(0)->current_url().SchemeIsBlob()); - EXPECT_TRUE(root->child_at(1)->current_url().SchemeIsBlob()); -} - IN_PROC_BROWSER_TEST_P(NavigationControllerBrowserTest, ErrorPageReplacement) { NavigationController& controller = shell()->web_contents()->GetController(); GURL error_url = embedded_test_server()->GetURL("/close-socket"); @@ -3015,54 +2920,6 @@ EXPECT_EQ(expected_entry_count, controller.GetEntryCount()); } - // 5) Navigate to |url_2| on a new subframe that has done a document.open(). - { - SCOPED_TRACE(testing::Message() << " Testing case 5."); - - // Create the "child5" subframe. - CreateSubframe(contents(), "child5", GURL(), - false /* wait_for_navigation */); - subframe_index++; - EXPECT_EQ(expected_entry_count, controller.GetEntryCount()); - EXPECT_EQ(GURL("about:blank"), - root->child_at(subframe_index)->current_url()); - - { - // Do a document.open() on it, generating a same-document navigation. - FrameNavigateParamsCapturer capturer(root->child_at(subframe_index)); - EXPECT_TRUE(ExecJs(shell(), R"( - var iframeDoc = document.getElementById("child5").contentDocument; - iframeDoc.open(); - iframeDoc.write("foo"); - iframeDoc.close(); - )")); - capturer.Wait(); - - // The document.open() created a same-document navigation that changed the - // subframe's URL to be the same as the main frame's URL. - EXPECT_TRUE(capturer.is_same_document()); - EXPECT_EQ(url_1, root->child_at(subframe_index)->current_url()); - - // The navigation is classified as AUTO_SUBFRAME. - EXPECT_EQ(NAVIGATION_TYPE_AUTO_SUBFRAME, capturer.navigation_type()); - EXPECT_TRUE(ui::PageTransitionTypeIncludingQualifiersIs( - capturer.transition(), ui::PAGE_TRANSITION_AUTO_SUBFRAME)); - // The history item in the renderer replaced the initial empty document's - // history entry. - EXPECT_TRUE(capturer.did_replace_entry()); - EXPECT_EQ(expected_entry_count, controller.GetEntryCount()); - } - - // Do a navigation on the "child5" subframe to |url_2|. - // The navigation is classified as a new navigation, and appended a new - // NavigationEntry. - NavigateSubframeAndCheckNavigationType( - contents(), root->child_at(subframe_index), "child5", url_2, - NAVIGATION_TYPE_NEW_SUBFRAME); - expected_entry_count++; - EXPECT_EQ(expected_entry_count, controller.GetEntryCount()); - } - // 6) Navigate to |url_2| on a new subframe that has done a navigation to // a javascript: url that replaces the document. { @@ -3219,44 +3076,6 @@ EXPECT_TRUE(controller.GetLastCommittedEntry()); } - // 6) Navigate to |url_2| on a new window that has done a document.open(). - { - SCOPED_TRACE(testing::Message() << " Testing case 6."); - - // Create a new blank window that won't create a NavigationEntry. - Shell* new_shell = OpenBlankWindow(contents()); - WebContentsImpl* new_contents = - static_cast<WebContentsImpl*>(new_shell->web_contents()); - NavigationControllerImpl& controller = new_contents->GetController(); - EXPECT_EQ(0, controller.GetEntryCount()); - EXPECT_FALSE(controller.GetLastCommittedEntry()); - - { - // Do a document.open() on the blank window, generating a same-document - // navigation. - TestNavigationObserver nav_observer(new_contents); - EXPECT_TRUE(ExecJs(contents(), R"( - last_opened_window.document.open(); - last_opened_window.document.write("foo"); - last_opened_window.document.close(); - )")); - nav_observer.Wait(); - - // The document.open() changed the window's URL to be the same as the main - // tab's URL, but didn't add a new entry because the navigation is - // ignored (see https://crbug.com/1190111). - EXPECT_EQ(main_window_url, - new_contents->GetFrameTree()->root()->current_url()); - EXPECT_EQ(0, controller.GetEntryCount()); - } - - // Navigating the window to |url_2| will be classified as NEW_ENTRY and will - // add a new entry. - NavigateWindowAndCheckNavigationTypeIsNewEntry(new_contents, url_2); - EXPECT_EQ(1, controller.GetEntryCount()); - EXPECT_TRUE(controller.GetLastCommittedEntry()); - } - // 7) Navigate to |url_2| on a new window that has navigated to a javascript: // URL that replaced the initial empty document. { @@ -3281,8 +3100,10 @@ // Test pushState in a new window's initial empty document after it has done a // document.open() (inheriting the opener's URL). +// https://crbug.com/1189026: disabled because document.open() no longer makes +// pushState possible. IN_PROC_BROWSER_TEST_P(NavigationControllerBrowserTest, - PushStateAfterDocumentOpenInNewWindow) { + DISABLED_PushStateAfterDocumentOpenInNewWindow) { GURL main_window_url(embedded_test_server()->GetURL("/title1.html")); EXPECT_TRUE(NavigateToURL(shell(), main_window_url)); @@ -5132,7 +4953,7 @@ ASSERT_EQ(1U, root->child_at(0)->child_count()); ASSERT_EQ(0U, root->child_at(0)->child_at(0)->child_count()); EXPECT_EQ(main_url, root->current_url()); - EXPECT_EQ(main_url, root->child_at(0)->current_url()); + EXPECT_EQ(blank_url, root->child_at(0)->current_url()); EXPECT_EQ(inner_url, root->child_at(0)->child_at(0)->current_url()); EXPECT_EQ(1, controller.GetEntryCount()); @@ -5141,7 +4962,7 @@ // The entry should have FrameNavigationEntries for the subframes. ASSERT_EQ(1U, entry->root_node()->children.size()); - EXPECT_EQ(main_url, entry->root_node()->children[0]->frame_entry->url()); + EXPECT_EQ(blank_url, entry->root_node()->children[0]->frame_entry->url()); EXPECT_EQ(inner_url, entry->root_node()->children[0]->children[0]->frame_entry->url()); @@ -5167,7 +4988,7 @@ } ASSERT_EQ(1U, root->child_count()); EXPECT_EQ(main_url, root->current_url()); - EXPECT_EQ(main_url, root->child_at(0)->current_url()); + EXPECT_EQ(blank_url, root->child_at(0)->current_url()); // Verify that the inner iframe went to the correct URL. EXPECT_EQ(inner_url, root->child_at(0)->child_at(0)->current_url()); @@ -5183,7 +5004,7 @@ ASSERT_EQ(1U, entry->root_node()->children.size()); // The entry should have FrameNavigationEntries for the subframes. - EXPECT_EQ(main_url, entry->root_node()->children[0]->frame_entry->url()); + EXPECT_EQ(blank_url, entry->root_node()->children[0]->frame_entry->url()); EXPECT_EQ(inner_url, entry->root_node()->children[0]->children[0]->frame_entry->url()); @@ -8653,15 +8474,13 @@ ASSERT_NE(nullptr, frame); EXPECT_EQ(blank_url, frame->current_url()); - // Do a document.write() in the subframe to create a link to click. This sets - // the URL to be the same as the frame that called document.write(). + // Do a document.write in the subframe to create a link to click. std::string document_write_script = "var iframe = document.getElementById('frame');" "iframe.contentWindow.document.write(" " \"<a id='fraglink' href='#frag'>fragment link</a>\");" "iframe.contentWindow.document.close();"; EXPECT_TRUE(ExecJs(root->current_frame_host(), document_write_script)); - EXPECT_EQ(links_url, frame->current_url()); // Click the link to do a same document navigation. Due to the // document.write, the new URL matches the parent frame's URL. @@ -8688,10 +8507,7 @@ EXPECT_TRUE(ExecJs(root->current_frame_host(), "true;")); EXPECT_TRUE(root->current_frame_host()->IsRenderFrameLive()); - // When we go back in history, the history entry URL should be used. However, - // since we did a .write which set the history entry's URL, we go back to the - // main page URL. - EXPECT_EQ(links_url, frame->current_url()); + EXPECT_EQ(blank_url, frame->current_url()); } // Test for same document navigation kills when going back to about:blank in an @@ -8742,14 +8558,12 @@ "iframe.contentWindow.document.close();", html); EXPECT_TRUE(ExecJs(root, document_write_script)); - EXPECT_EQ(data_url, frame->current_url()); EXPECT_EQ(opaque_origin, root->current_origin()); EXPECT_EQ(opaque_origin, frame->current_origin()); - // Click the link to do a same document navigation. Due to the + // Click the link to do a same document navigation. Due to the // document.write, the new URL matches the parent frame's URL, but the - // opaque origin is preserved. Not only that, the history entry's URL is - // changed to match the parent frame's URL. + // opaque origin is preserved. GURL frame_url_2("data:text/html,Top level page#frag"); std::string link_script = "document.getElementById('fraglink').click()"; EXPECT_TRUE(ExecJs(frame, link_script)); @@ -8779,10 +8593,7 @@ EXPECT_EQ("ping", EvalJs(root, "'ping'")); EXPECT_TRUE(root->current_frame_host()->IsRenderFrameLive()); - // When we go back in history, the history entry URL should be used. However, - // since we did a .write which set the history entry's URL, we go back to the - // main page URL. - EXPECT_EQ(data_url, frame->current_url()); + EXPECT_EQ(blank_url, frame->current_url()); EXPECT_EQ(opaque_origin, frame->current_origin()); }
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index fdfcd32b..80e4a073 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -10299,7 +10299,6 @@ // - http_status_code // - should_update_history // - gesture - // - should_replace_current_entry // TODO(crbug.com/1131832): Verify more params. // We can know if we're going to be in an error page after this navigation // if the net error code is not net::OK, or if we're doing a same-document @@ -10347,12 +10346,6 @@ const bool renderer_gesture = (params.gesture == NavigationGesture::NavigationGestureUser); - const bool browser_should_replace_current_entry = - CalculateShouldReplaceCurrentEntry( - request, same_document_params.Clone(), frame_tree_node_, - last_committed_url_, is_loaded_from_load_data_with_base_url_, - last_base_url_); - if ((!ShouldVerify("intended_as_new_entry") || request->commit_params().intended_as_new_entry == params.intended_as_new_entry) && @@ -10366,10 +10359,7 @@ browser_http_status_code == params.http_status_code) && (!ShouldVerify("should_update_history") || browser_should_update_history == params.should_update_history) && - (!ShouldVerify("gesture") || browser_gesture == renderer_gesture) && - (!ShouldVerify("should_replace_current_entry") || - browser_should_replace_current_entry == - params.should_replace_current_entry)) { + (!ShouldVerify("gesture") || browser_gesture == renderer_gesture)) { return; } @@ -10444,11 +10434,6 @@ SCOPED_CRASH_KEY_BOOL("VerifyDidCommit", "gesture_renderer", renderer_gesture); - SCOPED_CRASH_KEY_BOOL("VerifyDidCommit", "replace_browser", - browser_should_replace_current_entry); - SCOPED_CRASH_KEY_BOOL("VerifyDidCommit", "replace_renderer", - params.should_replace_current_entry); - SCOPED_CRASH_KEY_BOOL("VerifyDidCommit", "is_same_document", is_same_document_navigation); SCOPED_CRASH_KEY_BOOL("VerifyDidCommit", "is_history_api", @@ -10550,8 +10535,6 @@ DCHECK_EQ(browser_http_status_code, params.http_status_code); DCHECK_EQ(browser_should_update_history, params.should_update_history); DCHECK_EQ(browser_gesture, renderer_gesture); - DCHECK_EQ(browser_should_replace_current_entry, - params.should_replace_current_entry); // Log histograms to trigger Chrometto slow reports, allowing us to see traces // to analyze what happened in these navigations. @@ -10588,11 +10571,6 @@ LogVerifyDidCommitParamsDifference( VerifyDidCommitParamsDifference::kGesture); } - if (browser_should_replace_current_entry != - params.should_replace_current_entry) { - LogVerifyDidCommitParamsDifference( - VerifyDidCommitParamsDifference::kShouldReplaceCurrentEntry); - } base::debug::DumpWithoutCrashing(); }
diff --git a/content/browser/renderer_host/render_frame_host_manager_browsertest.cc b/content/browser/renderer_host/render_frame_host_manager_browsertest.cc index 778d8b88..ea4dd62 100644 --- a/content/browser/renderer_host/render_frame_host_manager_browsertest.cc +++ b/content/browser/renderer_host/render_frame_host_manager_browsertest.cc
@@ -4056,12 +4056,10 @@ kExpectedSiteURL.spec(), DepictFrameTree(*root)); - EXPECT_EQ(url, root->child_at(0)->child_at(0)->current_url()); + EXPECT_EQ(GURL(url::kAboutBlankURL), + root->child_at(0)->child_at(0)->current_url()); - // This is true because of the document.open() call, which makes the frame to - // be considered to have had committed a real load. The FrameTreeVisualizer - // test should be enough to ensure that the childmost frame is not loaded. - EXPECT_TRUE(root->child_at(0)->child_at(0)->has_committed_real_load()); + EXPECT_FALSE(root->child_at(0)->child_at(0)->has_committed_real_load()); } // Ensure that navigating a subframe to the same URL as its parent twice in a
diff --git a/content/browser/renderer_host/render_process_host_browsertest.cc b/content/browser/renderer_host/render_process_host_browsertest.cc index fc7b06e..969b63e 100644 --- a/content/browser/renderer_host/render_process_host_browsertest.cc +++ b/content/browser/renderer_host/render_process_host_browsertest.cc
@@ -278,8 +278,7 @@ RenderProcessHost* rph = shell()->web_contents()->GetMainFrame()->GetProcess(); // Make it believe it's a guest. - static_cast<RenderProcessHostImpl*>(rph)->set_is_for_guests_only_for_testing( - true); + static_cast<RenderProcessHostImpl*>(rph)->SetForGuestsOnlyForTesting(); EXPECT_EQ(1, RenderProcessHost::GetCurrentRenderProcessCountForTesting()); // Navigate to a different page.
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 8ed81f9..d94dbfaf 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -524,7 +524,7 @@ // MaybeTakeSpareRenderProcessHost is called with a BrowserContext that does not // match, the spare renderer is discarded. Only the default StoragePartition // will be able to use a spare renderer. The spare renderer will also not be -// used as a guest renderer (is_for_guests_ == true). +// used as a guest renderer (flags_ contains kForGuestsOnly). // // It is safe to call WarmupSpareRenderProcessHost multiple times, although if // called in a context where the spare renderer is not likely to be used @@ -1536,22 +1536,27 @@ static_cast<StoragePartitionImpl*>( browser_context->GetStoragePartition(site_instance)); - // If we've made a StoragePartition for guests (e.g., for the <webview> tag), - // stash the Site URL on it. This way, when we start a service worker inside - // this storage partition, we can create the appropriate SiteInstance for - // finding a process (e.g., we will try to start a worker from - // "https://example.com/sw.js" but need to use the guest site URL - // to get a process in the guest's StoragePartition.) - const bool is_for_guests_only = site_instance && site_instance->IsGuest(); - if (is_for_guests_only && - storage_partition_impl->site_for_guest_service_worker_or_shared_worker() - .is_empty()) { - storage_partition_impl->set_site_for_guest_service_worker_or_shared_worker( - site_instance->GetSiteInfo().site_url()); + int flags = RenderProcessFlags::kNone; + + if (site_instance && site_instance->IsGuest()) { + flags |= RenderProcessFlags::kForGuestsOnly; + + // If we've made a StoragePartition for guests (e.g., for the <webview> + // tag), stash the Site URL on it. This way, when we start a service worker + // inside this storage partition, we can create the appropriate SiteInstance + // for finding a process (e.g., we will try to start a worker from + // "https://example.com/sw.js" but need to use the guest site URL to get a + // process in the guest's StoragePartition.) + if (storage_partition_impl->site_for_guest_service_worker_or_shared_worker() + .is_empty()) { + storage_partition_impl + ->set_site_for_guest_service_worker_or_shared_worker( + site_instance->GetSiteInfo().site_url()); + } } return new RenderProcessHostImpl(browser_context, storage_partition_impl, - is_for_guests_only); + flags); } // static @@ -1561,7 +1566,7 @@ RenderProcessHostImpl::RenderProcessHostImpl( BrowserContext* browser_context, StoragePartitionImpl* storage_partition_impl, - bool is_for_guests_only) + int flags) : fast_shutdown_started_(false), deleting_soon_(false), #ifndef NDEBUG @@ -1587,7 +1592,7 @@ storage_partition_impl_(storage_partition_impl), sudden_termination_allowed_(true), is_blocked_(false), - is_for_guests_only_(is_for_guests_only), + flags_(flags), is_unused_(true), delayed_cleanup_needed_(false), within_process_died_observer_(false), @@ -1711,6 +1716,10 @@ GetCodeCacheHostReceiverHandler() = handler; } +void RenderProcessHostImpl::SetForGuestsOnlyForTesting() { + flags_ |= RenderProcessFlags::kForGuestsOnly; +} + RenderProcessHostImpl::~RenderProcessHostImpl() { TRACE_EVENT2("shutdown", "~RenderProcessHostImpl", "render_process_host", this, "id", GetID()); @@ -3083,7 +3092,7 @@ } bool RenderProcessHostImpl::IsForGuestsOnly() { - return is_for_guests_only_; + return !!(flags_ & RenderProcessFlags::kForGuestsOnly); } StoragePartition* RenderProcessHostImpl::GetStoragePartition() {
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index e7cb1cfc..78ac2ff6 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -457,9 +457,8 @@ static void SetCodeCacheHostReceiverHandlerForTesting( CodeCacheHostReceiverHandler handler); - void set_is_for_guests_only_for_testing(bool is_for_guests_only) { - is_for_guests_only_ = is_for_guests_only; - } + // Sets this RenderProcessHost to be guest only. For Testing only. + void SetForGuestsOnlyForTesting(); #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MAC) // Launch the zygote early in the browser startup. @@ -692,7 +691,7 @@ // A proxy for our IPC::Channel that lives on the IO thread. std::unique_ptr<IPC::ChannelProxy> channel_; - // True if fast shutdown has been performed on this RPH. + // True if fast shutdown has been performed on this RenderProcessHost. bool fast_shutdown_started_; // True if shutdown from started by the |Shutdown()| method. @@ -723,11 +722,20 @@ // methods here. At that point we'll remove this friend class. friend class AgentSchedulingGroupHost; + // A set of flags for this RenderProcessHost. + enum RenderProcessFlags : int { + kNone = 0, + + // Indicates whether this RenderProcessHost is exclusively hosting guest + // RenderFrames. + kForGuestsOnly = 1 << 0 + }; + // Use CreateRenderProcessHost() instead of calling this constructor // directly. RenderProcessHostImpl(BrowserContext* browser_context, StoragePartitionImpl* storage_partition_impl, - bool is_for_guests_only); + int flags); // Initializes a new IPC::ChannelProxy in |channel_|, which will be // connected to the next child process launched for this host, if any. @@ -888,8 +896,9 @@ }; // Helper to bind an interface callback whose lifetime is limited to that of - // the render process currently hosted by the RPHI. Callbacks added by this - // method will never run beyond the next invocation of Cleanup(). + // the render process currently hosted by the RenderProcessHost. Callbacks + // added by this method will never run beyond the next invocation of + // Cleanup(). template <typename CallbackType> void AddUIThreadInterface(service_manager::BinderRegistry* registry, CallbackType callback) { @@ -993,7 +1002,7 @@ // Used to launch and terminate the process without blocking the UI thread. std::unique_ptr<ChildProcessLauncher> child_process_launcher_; - // The globally-unique identifier for this RPH. + // The globally-unique identifier for this RenderProcessHost. const int id_; BrowserContext* const browser_context_; @@ -1034,9 +1043,8 @@ // Records the last time we regarded the child process active. base::TimeTicks child_process_activity_time_; - // Indicates whether this RenderProcessHost is exclusively hosting guest - // RenderFrames. - bool is_for_guests_only_; + // A set of flags that influence RenderProcessHost behavior. + int flags_; // Indicates whether this RenderProcessHost is unused, meaning that it has // not committed any web content, and it has not been given to a SiteInstance @@ -1065,7 +1073,7 @@ base::TimeTicks keep_alive_start_time_; // Context shared for each mojom::PermissionService instance created for this - // RPH. This is destroyed early in ResetIPC() method. + // RenderProcessHost. This is destroyed early in ResetIPC() method. std::unique_ptr<PermissionServiceContext> permission_service_context_; // The memory allocator, if any, in which the renderer will write its metrics. @@ -1103,7 +1111,7 @@ int foreground_service_worker_count_ = 0; // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend - // WeakPtrs which are invalidated any time the RPHI is recycled. + // WeakPtrs which are invalidated any time the RenderProcessHost is recycled. base::Optional<base::WeakPtrFactory<RenderProcessHostImpl>> instance_weak_factory_;
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index c3c9629..606051a 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -122,10 +122,6 @@ #include "ui/wm/core/ime_util_chromeos.h" #endif -#if defined(OS_FUCHSIA) -#include "ui/base/ime/virtual_keyboard_controller.h" -#endif - #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ui/base/ime/chromeos/extension_ime_util.h" #include "ui/base/ime/chromeos/input_method_manager.h" @@ -1560,6 +1556,54 @@ {ui_ime_text_span}); return true; } + +base::Optional<ui::GrammarFragment> +RenderWidgetHostViewAura::GetGrammarFragment(const gfx::Range& range) { + if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) + return base::nullopt; + return text_input_manager_->GetGrammarFragment(range); +} + +bool RenderWidgetHostViewAura::ClearGrammarFragments(const gfx::Range& range) { + auto* input_handler = GetFrameWidgetInputHandlerForFocusedWidget(); + if (!input_handler) + return false; + + input_handler->ClearImeTextSpansByType( + range.start(), range.end(), ui::ImeTextSpan::Type::kGrammarSuggestion); + return true; +} + +bool RenderWidgetHostViewAura::AddGrammarFragments( + const std::vector<ui::GrammarFragment>& fragments) { + auto* input_handler = GetFrameWidgetInputHandlerForFocusedWidget(); + if (!input_handler || fragments.empty()) + return false; + + unsigned max_fragment_end = 0; + std::vector<::ui::ImeTextSpan> ime_text_spans; + ime_text_spans.reserve(fragments.size()); + for (auto& fragment : fragments) { + ui::ImeTextSpan ui_ime_text_span; + ui_ime_text_span.type = ui::ImeTextSpan::Type::kGrammarSuggestion; + ui_ime_text_span.start_offset = fragment.range.start(); + ui_ime_text_span.end_offset = fragment.range.end(); + ui_ime_text_span.thickness = ui::ImeTextSpan::Thickness::kThick; + ui_ime_text_span.underline_style = ui::ImeTextSpan::UnderlineStyle::kDot; + ui_ime_text_span.underline_color = gfx::kGoogleBlue400; + ui_ime_text_span.suggestions = {fragment.suggestion}; + + ime_text_spans.push_back(ui_ime_text_span); + if (fragment.range.end() > max_fragment_end) { + max_fragment_end = fragment.range.end(); + } + } + input_handler->AddImeTextSpansToExistingText(0, max_fragment_end, + ime_text_spans); + + return true; +} + #endif #if defined(OS_WIN) @@ -1828,12 +1872,6 @@ if (window_ && virtual_keyboard_controller_win_) { virtual_keyboard_controller_win_->FocusedNodeChanged(editable); } -#elif defined(OS_FUCHSIA) - if (!editable && window_) { - if (input_method) { - input_method->GetVirtualKeyboardController()->DismissVirtualKeyboard(); - } - } #endif }
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 355f66b..14151bff 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -238,6 +238,11 @@ gfx::Range GetAutocorrectRange() const override; gfx::Rect GetAutocorrectCharacterBounds() const override; bool SetAutocorrectRange(const gfx::Range& range) override; + base::Optional<ui::GrammarFragment> GetGrammarFragment( + const gfx::Range& range) override; + bool ClearGrammarFragments(const gfx::Range& range) override; + bool AddGrammarFragments( + const std::vector<ui::GrammarFragment>& fragments) override; #endif #if defined(OS_WIN)
diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc index 2544cab..6bb0e3c 100644 --- a/content/browser/renderer_host/text_input_manager.cc +++ b/content/browser/renderer_host/text_input_manager.cc
@@ -88,6 +88,27 @@ return gfx::Range(); } +base::Optional<ui::GrammarFragment> TextInputManager::GetGrammarFragment( + gfx::Range range) const { + if (!active_view_) + return base::nullopt; + + for (const auto& ime_text_span_info : + text_input_state_map_.at(active_view_)->ime_text_spans_info) { + if (ime_text_span_info->span.type == + ui::ImeTextSpan::Type::kGrammarSuggestion && + ime_text_span_info->span.suggestions.size() > 0) { + auto span_range = gfx::Range(ime_text_span_info->span.start_offset, + ime_text_span_info->span.end_offset); + if (span_range.Contains(range)) { + return ui::GrammarFragment(span_range, + ime_text_span_info->span.suggestions[0]); + } + } + } + return base::nullopt; +} + const TextInputManager::SelectionRegion* TextInputManager::GetSelectionRegion( RenderWidgetHostViewBase* view) const { DCHECK(!view || IsRegistered(view));
diff --git a/content/browser/renderer_host/text_input_manager.h b/content/browser/renderer_host/text_input_manager.h index e4a524f..f7c12ec 100644 --- a/content/browser/renderer_host/text_input_manager.h +++ b/content/browser/renderer_host/text_input_manager.h
@@ -13,6 +13,7 @@ #include "base/observer_list.h" #include "content/common/content_export.h" #include "ui/base/ime/mojom/text_input_state.mojom.h" +#include "ui/base/ime/text_input_client.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/range/range.h" #include "ui/gfx/selection_bound.h" @@ -156,6 +157,11 @@ // range is currently present. gfx::Range GetAutocorrectRange() const; + // Returns the grammar fragment which contains |range|. If non-existent, + // returns an empty Fragment. + base::Optional<ui::GrammarFragment> GetGrammarFragment( + gfx::Range range) const; + // Returns the selection bounds information for |view|. If |view| == nullptr, // it will return the corresponding information for |active_view_| or nullptr // if there are no active views.
diff --git a/content/browser/resources/process/process_internals.html b/content/browser/resources/process/process_internals.html index f1072e7..93d4306 100644 --- a/content/browser/resources/process/process_internals.html +++ b/content/browser/resources/process/process_internals.html
@@ -24,6 +24,7 @@ <div id="site-isolation-mode">Site Isolation mode: <span id='isolation-mode'>unknown</span></div> <div id="isolated-origins-container"> <div id="user-triggered-isolated-origins"></div> + <div id="web-triggered-isolated-origins"></div> <div id="global-isolated-origins"></div> </div> </div>
diff --git a/content/browser/resources/process/process_internals.js b/content/browser/resources/process/process_internals.js index 2193714..fcd0e6d 100644 --- a/content/browser/resources/process/process_internals.js +++ b/content/browser/resources/process/process_internals.js
@@ -215,7 +215,7 @@ $('user-triggered-isolated-origins').textContent = 'The following origins are isolated because you previously typed a ' + - 'password into these sites (' + originCount + ' total). ' + + 'password or logged in on these sites (' + originCount + ' total). ' + 'Clear cookies or history to wipe this list; this takes effect ' + 'after a restart.'; @@ -229,6 +229,27 @@ $('user-triggered-isolated-origins').appendChild(list); }); + pageHandler.getWebTriggeredIsolatedOrigins().then((response) => { + const originCount = response.isolatedOrigins.length; + if (!originCount) { + return; + } + + $('web-triggered-isolated-origins').textContent = + 'The following origins are isolated based on runtime heuristics ' + + 'triggered directly by web pages, such as Cross-Origin-Opener-Policy ' + + 'headers. This list is cleared after a restart.'; + + const list = document.createElement('ul'); + for (const origin of response.isolatedOrigins) { + const item = document.createElement('li'); + item.textContent = origin; + list.appendChild(item); + } + + $('web-triggered-isolated-origins').appendChild(list); + }); + // Retrieve global isolated origins and insert them into a separate list if // there is at least one such origin. Since these origins may come from // multiple sources, include the source info for each origin in parens.
diff --git a/content/browser/service_worker/service_worker_new_script_loader.cc b/content/browser/service_worker/service_worker_new_script_loader.cc index a50b05d..d52aa01 100644 --- a/content/browser/service_worker/service_worker_new_script_loader.cc +++ b/content/browser/service_worker/service_worker_new_script_loader.cc
@@ -76,7 +76,10 @@ int64_t cache_resource_id, bool is_throttle_needed) : request_url_(original_request.url), - resource_destination_(original_request.destination), + is_main_script_(original_request.destination == + network::mojom::RequestDestination::kServiceWorker && + original_request.mode == + network::mojom::RequestMode::kSameOrigin), original_options_(options), version_(version), network_watcher_(FROM_HERE, @@ -89,7 +92,7 @@ network::ResourceRequest resource_request(original_request); #if DCHECK_IS_ON() service_worker_loader_helpers::CheckVersionStatusBeforeWorkerScriptLoad( - version_->status(), resource_destination_); + version_->status(), original_request.destination); #endif // DCHECK_IS_ON() scoped_refptr<ServiceWorkerRegistration> registration = @@ -100,11 +103,7 @@ // We need to filter on mode, since module imports use kServiceWorker as // destination, but only top level module scripts are same-origin. - const bool is_main_script = - (resource_destination_ == - network::mojom::RequestDestination::kServiceWorker && - resource_request.mode == network::mojom::RequestMode::kSameOrigin); - if (is_main_script) { + if (is_main_script_) { // Request SSLInfo. It will be persisted in service worker storage and // may be used by ServiceWorkerMainResourceLoader for navigations handled // by this service worker. @@ -117,7 +116,7 @@ base::TimeDelta time_since_last_check = base::Time::Now() - registration->last_update_check(); if (service_worker_loader_helpers::ShouldValidateBrowserCacheForScript( - is_main_script, version_->force_bypass_cache_for_scripts(), + is_main_script_, version_->force_bypass_cache_for_scripts(), registration->update_via_cache(), time_since_last_check)) { resource_request.load_flags |= net::LOAD_VALIDATE_CACHE; } @@ -228,8 +227,7 @@ return; } - if (resource_destination_ == - network::mojom::RequestDestination::kServiceWorker) { + if (is_main_script_) { // Check the path restriction defined in the spec: // https://w3c.github.io/ServiceWorker/#service-worker-script-response std::string service_worker_allowed;
diff --git a/content/browser/service_worker/service_worker_new_script_loader.h b/content/browser/service_worker/service_worker_new_script_loader.h index ae8e7c4d..a373320 100644 --- a/content/browser/service_worker/service_worker_new_script_loader.h +++ b/content/browser/service_worker/service_worker_new_script_loader.h
@@ -180,10 +180,7 @@ const GURL request_url_; - // This is network::mojom::RequestDestination::kServiceWorker for the - // main script or network::mojom::RequestDestination::kScript for - // an imported script. - const network::mojom::RequestDestination resource_destination_; + const bool is_main_script_; // Load options originally passed to this loader. The options passed to the // network loader might be different from this.
diff --git a/content/browser/service_worker/service_worker_new_script_loader_unittest.cc b/content/browser/service_worker/service_worker_new_script_loader_unittest.cc index aad7d96..6ee8d4c 100644 --- a/content/browser/service_worker/service_worker_new_script_loader_unittest.cc +++ b/content/browser/service_worker/service_worker_new_script_loader_unittest.cc
@@ -221,6 +221,10 @@ ? network::mojom::RequestDestination::kServiceWorker : network::mojom::RequestDestination::kScript; + request.mode = (url == version_->script_url()) + ? network::mojom::RequestMode::kSameOrigin + : network::mojom::RequestMode::kNoCors; + *out_client = std::make_unique<network::TestURLLoaderClient>(); *out_loader = ServiceWorkerNewScriptLoader::CreateAndStart( request_id, options, request, (*out_client)->CreateRemote(), version_, @@ -552,6 +556,45 @@ ServiceWorkerMetrics::WRITE_OK, 2); } +TEST_F(ServiceWorkerNewScriptLoaderTest, + Fail_ModuleServiceWorker_PathRestriction) { + base::HistogramTester histogram_tester; + + std::unique_ptr<network::TestURLLoaderClient> client; + std::unique_ptr<ServiceWorkerNewScriptLoader> loader; + + // |kScope| is not under the default scope ("/out-of-scope/"), but the + // Service-Worker-Allowed header allows it. + const GURL kImportedScriptURL(kNormalImportedScriptURL); + const GURL kScope("https://example.com/in-scope/"); + mock_server_.Set( + kImportedScriptURL, + MockHTTPServer::Response(std::string("HTTP/1.1 200 OK\n" + "Content-Type: text/javascript\n\n"), + std::string("٩( ’ω’ )و I'm body!"))); + blink::mojom::ServiceWorkerRegistrationOptions options; + options.scope = kScope; + options.type = blink::mojom::ScriptType::kModule; + SetUpRegistrationWithOptions(kImportedScriptURL, options); + DoRequest(kImportedScriptURL, &client, &loader); + client->RunUntilComplete(); + EXPECT_EQ(net::OK, client->completion_status().error_code); + + // The client should have received the response. + EXPECT_TRUE(client->has_received_response()); + EXPECT_TRUE(client->response_body().is_valid()); + std::string response; + EXPECT_TRUE( + mojo::BlockingCopyToString(client->response_body_release(), &response)); + EXPECT_EQ(mock_server_.Get(kImportedScriptURL).body, response); + + // WRITE_OK should be recorded once plus one as we record a single write + // success and the end of the body. + EXPECT_TRUE(VerifyStoredResponse(kImportedScriptURL)); + histogram_tester.ExpectUniqueSample(kHistogramWriteResponseResult, + ServiceWorkerMetrics::WRITE_OK, 2); +} + TEST_F(ServiceWorkerNewScriptLoaderTest, Error_PathRestriction) { base::HistogramTester histogram_tester;
diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc index a622025..7823b5e 100644 --- a/content/browser/webauth/authenticator_impl_unittest.cc +++ b/content/browser/webauth/authenticator_impl_unittest.cc
@@ -3840,29 +3840,25 @@ class UVTestAuthenticatorContentBrowserClient : public ContentBrowserClient { public: + // ContentBrowserClient: + WebAuthenticationDelegate* GetWebAuthenticationDelegate() override { + return &web_authentication_delegate; + } + std::unique_ptr<AuthenticatorRequestClientDelegate> GetWebAuthenticationRequestDelegate( RenderFrameHost* render_frame_host) override { return std::make_unique<UVTestAuthenticatorClientDelegate>( - &collected_pin_, &min_pin_length_, &did_bio_enrollment_, - cancel_bio_enrollment_); + &collected_pin, &min_pin_length, &did_bio_enrollment, + cancel_bio_enrollment); } - bool collected_pin() { return collected_pin_; } + TestWebAuthenticationDelegate web_authentication_delegate; - uint32_t min_pin_length() { return min_pin_length_; } - - bool did_bio_enrollment() { return did_bio_enrollment_; } - - void set_cancel_bio_enrollment(bool cancel_bio_enrollment) { - cancel_bio_enrollment_ = cancel_bio_enrollment; - } - - private: - bool collected_pin_; - uint32_t min_pin_length_ = 0; - bool did_bio_enrollment_; - bool cancel_bio_enrollment_ = false; + bool collected_pin; + uint32_t min_pin_length = 0; + bool did_bio_enrollment; + bool cancel_bio_enrollment = false; }; class UVAuthenticatorImplTest : public AuthenticatorImplTest { @@ -4993,8 +4989,8 @@ EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); EXPECT_TRUE(HasUV(result.response)); - EXPECT_TRUE(test_client_.collected_pin()); - EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length()); + EXPECT_TRUE(test_client_.collected_pin); + EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length); } TEST_F(InternalUVAuthenticatorImplTest, MakeCredentialCryptotoken) { @@ -5037,16 +5033,16 @@ EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); EXPECT_TRUE(HasUV(result.response)); - EXPECT_TRUE(test_client_.collected_pin()); - EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length()); - EXPECT_TRUE(test_client_.did_bio_enrollment()); + EXPECT_TRUE(test_client_.collected_pin); + EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length); + EXPECT_TRUE(test_client_.did_bio_enrollment); EXPECT_TRUE(virtual_device_factory_->mutable_state()->fingerprints_enrolled); } // Test making a credential skipping biometric enrollment during credential // creation. TEST_F(InternalUVAuthenticatorImplTest, MakeCredentialSkipInlineBioEnrollment) { - test_client_.set_cancel_bio_enrollment(true); + test_client_.cancel_bio_enrollment = true; device::VirtualCtap2Device::Config config; config.internal_uv_support = true; @@ -5064,12 +5060,57 @@ EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); EXPECT_TRUE(HasUV(result.response)); - EXPECT_TRUE(test_client_.collected_pin()); - EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length()); - EXPECT_TRUE(test_client_.did_bio_enrollment()); + EXPECT_TRUE(test_client_.collected_pin); + EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length); + EXPECT_TRUE(test_client_.did_bio_enrollment); EXPECT_FALSE(virtual_device_factory_->mutable_state()->fingerprints_enrolled); } +TEST_F(InternalUVAuthenticatorImplTest, MakeCredUvNotRqd) { + // Test that on an authenticator with the makeCredUvNotRqd option enabled, + // non-discoverable credentials can be created without requiring UV or a PIN. + for (bool discoverable : {false, true}) { + for (bool request_uv : {false, true}) { + SCOPED_TRACE(testing::Message() << "discoverable=" << discoverable + << " request_uv=" << request_uv); + + test_client_.web_authentication_delegate.supports_resident_keys = true; + ResetVirtualDevice(); + device::VirtualCtap2Device::Config config; + config.u2f_support = true; + config.internal_uv_support = true; + config.user_verification_succeeds = true; + config.pin_support = true; + config.resident_key_support = true; + config.pin_uv_auth_token_support = true; + config.allow_non_resident_credential_creation_without_uv = true; + config.ctap2_versions = {device::Ctap2Version::kCtap2_1}; + virtual_device_factory_->SetCtap2Config(config); + virtual_device_factory_->mutable_state()->pin = kTestPIN; + virtual_device_factory_->mutable_state()->fingerprints_enrolled = true; + + PublicKeyCredentialCreationOptionsPtr request = make_credential_options(); + request->authenticator_selection + ->SetUserVerificationRequirementForTesting( + request_uv ? device::UserVerificationRequirement::kPreferred + : device::UserVerificationRequirement::kDiscouraged); + request->authenticator_selection->SetResidentKeyForTesting( + discoverable ? device::ResidentKeyRequirement::kPreferred + : device::ResidentKeyRequirement::kDiscouraged); + + MakeCredentialResult result = + AuthenticatorMakeCredential(std::move(request)); + EXPECT_EQ(result.status, AuthenticatorStatus::SUCCESS); + EXPECT_EQ(HasUV(result.response), discoverable || request_uv); + EXPECT_FALSE(test_client_.collected_pin); + // Requests shouldn't fall back to creating U2F credentials. + EXPECT_FALSE(virtual_device_factory_->mutable_state() + ->registrations.begin() + ->second.is_u2f); + } + } +} + TEST_F(InternalUVAuthenticatorImplTest, GetAssertion) { ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( get_credential_options()->allow_credentials[0].id(), @@ -5123,8 +5164,8 @@ EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); EXPECT_TRUE(HasUV(result.response)); - EXPECT_TRUE(test_client_.collected_pin()); - EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length()); + EXPECT_TRUE(test_client_.collected_pin); + EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length); } TEST_F(InternalUVAuthenticatorImplTest, GetAssertionCryptotoken) { @@ -5259,8 +5300,8 @@ AuthenticatorStatus::SUCCESS); // 5 retries + 1 tap for the actual get assertion request. EXPECT_EQ(taps, 6); - EXPECT_TRUE(test_client_.collected_pin()); - EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length()); + EXPECT_TRUE(test_client_.collected_pin); + EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length); EXPECT_EQ(5, virtual_device_factory_->mutable_state()->uv_retries); } @@ -5284,8 +5325,8 @@ EXPECT_EQ(AuthenticatorGetAssertion(get_credential_options()).status, AuthenticatorStatus::SUCCESS); - EXPECT_TRUE(test_client_.collected_pin()); - EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length()); + EXPECT_TRUE(test_client_.collected_pin); + EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length); EXPECT_EQ(5, virtual_device_factory_->mutable_state()->uv_retries); } @@ -5378,8 +5419,8 @@ AuthenticatorStatus::SUCCESS); // 5 retries + 1 tap for the actual get assertion request. EXPECT_EQ(taps, 6); - EXPECT_TRUE(test_client_.collected_pin()); - EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length()); + EXPECT_TRUE(test_client_.collected_pin); + EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length); EXPECT_EQ(5, virtual_device_factory_->mutable_state()->uv_retries); } @@ -5403,8 +5444,8 @@ EXPECT_EQ(AuthenticatorMakeCredential(make_credential_options()).status, AuthenticatorStatus::SUCCESS); - EXPECT_TRUE(test_client_.collected_pin()); - EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length()); + EXPECT_TRUE(test_client_.collected_pin); + EXPECT_EQ(device::kMinPinLength, test_client_.min_pin_length); EXPECT_EQ(5, virtual_device_factory_->mutable_state()->uv_retries); }
diff --git a/content/browser/webid/federated_auth_request_impl.cc b/content/browser/webid/federated_auth_request_impl.cc index 9cb9eb2..586d043d 100644 --- a/content/browser/webid/federated_auth_request_impl.cc +++ b/content/browser/webid/federated_auth_request_impl.cc
@@ -421,10 +421,9 @@ GURL endpoint = GURL(logout_endpoints_.back()); logout_endpoints_.pop_back(); - // TODO(kenrb): Validate that |endpoint| is a legal target under whatever - // policy we decide is appropriate. - - if (endpoint.is_valid()) { + if (endpoint.is_valid() && GetRequestPermissionContext() && + GetRequestPermissionContext()->HasRequestPermission( + url::Origin::Create(endpoint), origin())) { network_manager_->SendLogout( endpoint, base::BindOnce(&FederatedAuthRequestImpl::OnLogoutCompleted, weak_ptr_factory_.GetWeakPtr())); @@ -510,13 +509,24 @@ mock_dialog_controller_ = std::move(controller); } +void FederatedAuthRequestImpl::SetRequestPermissionDelegateForTests( + FederatedIdentityRequestPermissionContextDelegate* + request_permission_delegate) { + request_permission_delegate_ = request_permission_delegate; +} + +void FederatedAuthRequestImpl::SetSharingPermissionDelegateForTests( + FederatedIdentitySharingPermissionContextDelegate* + sharing_permission_delegate) { + sharing_permission_delegate_ = sharing_permission_delegate; +} + FederatedIdentityRequestPermissionContextDelegate* FederatedAuthRequestImpl::GetRequestPermissionContext() { if (!request_permission_delegate_) { - request_permission_delegate_ = - render_frame_host() - ->GetBrowserContext() - ->GetFederatedIdentityRequestPermissionContext(); + render_frame_host() + ->GetBrowserContext() + ->GetFederatedIdentityRequestPermissionContext(); } return request_permission_delegate_; } @@ -524,10 +534,9 @@ FederatedIdentitySharingPermissionContextDelegate* FederatedAuthRequestImpl::GetSharingPermissionContext() { if (!sharing_permission_delegate_) { - sharing_permission_delegate_ = - render_frame_host() - ->GetBrowserContext() - ->GetFederatedIdentitySharingPermissionContext(); + render_frame_host() + ->GetBrowserContext() + ->GetFederatedIdentitySharingPermissionContext(); } return sharing_permission_delegate_; }
diff --git a/content/browser/webid/federated_auth_request_impl.h b/content/browser/webid/federated_auth_request_impl.h index e602cc6..8ef3bb2 100644 --- a/content/browser/webid/federated_auth_request_impl.h +++ b/content/browser/webid/federated_auth_request_impl.h
@@ -60,6 +60,10 @@ std::unique_ptr<IdpNetworkRequestManager> manager); void SetDialogControllerForTests( std::unique_ptr<IdentityRequestDialogController> controller); + void SetRequestPermissionDelegateForTests( + FederatedIdentityRequestPermissionContextDelegate*); + void SetSharingPermissionDelegateForTests( + FederatedIdentitySharingPermissionContextDelegate*); private: void OnWellKnownFetched(IdpNetworkRequestManager::FetchStatus status,
diff --git a/content/browser/webid/federated_auth_request_impl_unittest.cc b/content/browser/webid/federated_auth_request_impl_unittest.cc index 46cbe93..0769c21e 100644 --- a/content/browser/webid/federated_auth_request_impl_unittest.cc +++ b/content/browser/webid/federated_auth_request_impl_unittest.cc
@@ -16,6 +16,7 @@ #include "content/browser/webid/id_token_request_callback_data.h" #include "content/browser/webid/test/mock_identity_request_dialog_controller.h" #include "content/browser/webid/test/mock_idp_network_request_manager.h" +#include "content/browser/webid/test/mock_request_permission_delegate.h" #include "content/public/test/test_renderer_host.h" #include "mojo/public/cpp/bindings/remote.h" #include "testing/gmock/include/gmock/gmock.h" @@ -35,6 +36,7 @@ using ::testing::_; using ::testing::Invoke; using ::testing::NiceMock; +using ::testing::Return; namespace content { @@ -364,6 +366,9 @@ main_rfh()); mock_dialog_controller_ = std::make_unique<NiceMock<MockIdentityRequestDialogController>>(); + + mock_request_permission_delegate_ = + std::make_unique<NiceMock<MockRequestPermissionDelegate>>(); } std::pair<RequestIdTokenStatus, base::Optional<std::string>> @@ -385,6 +390,8 @@ const std::vector<std::string>& logout_endpoints) { auth_request_impl_->SetNetworkManagerForTests( std::move(mock_request_manager_)); + auth_request_impl_->SetRequestPermissionDelegateForTests( + mock_request_permission_delegate_.get()); LogoutRequestCallbackHelper logout_helper; request_remote_->Logout(logout_endpoints, logout_helper.callback()); @@ -507,20 +514,44 @@ // Expectations have to be set explicitly in advance using // logout_return_status() and logout_endpoints(). void SetLogoutMockExpectations() { - logout_count_ = 0; - EXPECT_CALL(*mock_request_manager_, SendLogout(_, _)) - .Times(logout_endpoints_.size()) - .WillRepeatedly( - Invoke([&](const GURL& logout_endpoint, - IdpNetworkRequestManager::LogoutCallback callback) { - std::move(callback).Run(logout_return_status_[logout_count_++]); - })); + if (logout_request_permissions_.size() == 0) { + EXPECT_CALL(*mock_request_permission_delegate_, + HasRequestPermission(_, _)) + .Times(0); + } else { + for (int i = logout_request_permissions_.size() - 1; i >= 0; i--) { + auto single_logout_request_permission = logout_request_permissions_[i]; + EXPECT_CALL(*mock_request_permission_delegate_, + HasRequestPermission(_, _)) + .WillOnce(Return(single_logout_request_permission)) + .RetiresOnSaturation(); + } + } + + if (logout_return_status_.size() == 0) { + EXPECT_CALL(*mock_request_manager_, SendLogout(_, _)).Times(0); + } else { + for (int i = logout_return_status_.size() - 1; i >= 0; i--) { + auto single_logout_return_status = logout_return_status_[i]; + EXPECT_CALL(*mock_request_manager_, SendLogout(_, _)) + .WillOnce( + Invoke([single_logout_return_status]( + const GURL& logout_endpoint, + IdpNetworkRequestManager::LogoutCallback callback) { + std::move(callback).Run(single_logout_return_status); + })) + .RetiresOnSaturation(); + } + } } std::vector<LogoutResponse>& logout_return_status() { return logout_return_status_; } std::vector<std::string>& logout_endpoints() { return logout_endpoints_; } + std::vector<bool>& logout_request_permissions() { + return logout_request_permissions_; + } private: mojo::Remote<blink::mojom::FederatedAuthRequest> request_remote_; @@ -529,13 +560,15 @@ std::unique_ptr<NiceMock<MockIdpNetworkRequestManager>> mock_request_manager_; std::unique_ptr<NiceMock<MockIdentityRequestDialogController>> mock_dialog_controller_; + std::unique_ptr<NiceMock<MockRequestPermissionDelegate>> + mock_request_permission_delegate_; base::OnceClosure close_idp_window_callback_; // Test case storage for Logout tests. std::vector<LogoutResponse> logout_return_status_; std::vector<std::string> logout_endpoints_; - int logout_count_; + std::vector<bool> logout_request_permissions_; GURL provider_; }; @@ -571,12 +604,15 @@ logout_endpoints().push_back("https://rp1.example"); logout_return_status().push_back(LogoutResponse::kSuccess); + logout_request_permissions().push_back(true); logout_endpoints().push_back("https://rp2.example"); logout_return_status().push_back(LogoutResponse::kSuccess); + logout_request_permissions().push_back(true); logout_endpoints().push_back("https://rp3.example"); logout_return_status().push_back(LogoutResponse::kSuccess); - SetLogoutMockExpectations(); + logout_request_permissions().push_back(true); + SetLogoutMockExpectations(); auto logout_response = PerformLogoutRequest(logout_endpoints()); EXPECT_EQ(logout_response, LogoutStatus::kSuccess); } @@ -587,8 +623,7 @@ logout_endpoints().push_back("Invalid string"); - // No need to set mock expectations here because it should not attempt to - // send anything. + SetLogoutMockExpectations(); auto logout_response = PerformLogoutRequest(logout_endpoints()); EXPECT_EQ(logout_response, LogoutStatus::kError); } @@ -599,8 +634,10 @@ logout_endpoints().push_back("https://rp1.example"); logout_return_status().push_back(LogoutResponse::kSuccess); + logout_request_permissions().push_back(true); logout_endpoints().push_back("https://rp2.example"); logout_return_status().push_back(LogoutResponse::kError); + logout_request_permissions().push_back(true); SetLogoutMockExpectations(); auto logout_response = PerformLogoutRequest(logout_endpoints()); @@ -611,8 +648,21 @@ TEST_F(BasicFederatedAuthRequestImplTest, LogoutNoEndpoints) { CreateAuthRequest(GURL(kIdpTestOrigin)); - // No need to set mock expectations here because it should not attempt to - // send anything. + SetLogoutMockExpectations(); + auto logout_response = PerformLogoutRequest(logout_endpoints()); + EXPECT_EQ(logout_response, LogoutStatus::kError); +} + +// Test Logout without request permission granted. +TEST_F(BasicFederatedAuthRequestImplTest, LogoutWithoutPermission) { + CreateAuthRequest(GURL(kIdpTestOrigin)); + + // logout_return_status() not set because there should be no + // attempt at dispatch. + logout_endpoints().push_back("https://rp1.example"); + logout_request_permissions().push_back(false); + + SetLogoutMockExpectations(); auto logout_response = PerformLogoutRequest(logout_endpoints()); EXPECT_EQ(logout_response, LogoutStatus::kError); }
diff --git a/content/browser/webid/test/mock_request_permission_delegate.cc b/content/browser/webid/test/mock_request_permission_delegate.cc new file mode 100644 index 0000000..7a21797 --- /dev/null +++ b/content/browser/webid/test/mock_request_permission_delegate.cc
@@ -0,0 +1,13 @@ +// 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. + +#include "content/browser/webid/test/mock_request_permission_delegate.h" + +namespace content { + +MockRequestPermissionDelegate::MockRequestPermissionDelegate() = default; + +MockRequestPermissionDelegate::~MockRequestPermissionDelegate() = default; + +} // namespace content
diff --git a/content/browser/webid/test/mock_request_permission_delegate.h b/content/browser/webid/test/mock_request_permission_delegate.h new file mode 100644 index 0000000..a1cf8bc6 --- /dev/null +++ b/content/browser/webid/test/mock_request_permission_delegate.h
@@ -0,0 +1,34 @@ +// 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. + +#ifndef CONTENT_BROWSER_WEBID_TEST_MOCK_REQUEST_PERMISSION_DELEGATE_H_ +#define CONTENT_BROWSER_WEBID_TEST_MOCK_REQUEST_PERMISSION_DELEGATE_H_ + +#include "content/public/browser/federated_identity_request_permission_context_delegate.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace content { + +class MockRequestPermissionDelegate + : public FederatedIdentityRequestPermissionContextDelegate { + public: + MockRequestPermissionDelegate(); + + ~MockRequestPermissionDelegate() override; + + MockRequestPermissionDelegate(const MockRequestPermissionDelegate&) = delete; + MockRequestPermissionDelegate& operator=( + const MockRequestPermissionDelegate&) = delete; + + MOCK_METHOD2(HasRequestPermission, + bool(const url::Origin&, const url::Origin&)); + MOCK_METHOD2(GrantRequestPermission, + void(const url::Origin&, const url::Origin&)); + MOCK_METHOD2(RevokeRequestPermission, + void(const url::Origin&, const url::Origin&)); +}; + +} // namespace content + +#endif // CONTENT_BROWSER_WEBID_TEST_MOCK_REQUEST_PERMISSION_DELEGATE_H_
diff --git a/content/browser/webid/test/mock_sharing_permission_delegate.cc b/content/browser/webid/test/mock_sharing_permission_delegate.cc new file mode 100644 index 0000000..985401d5 --- /dev/null +++ b/content/browser/webid/test/mock_sharing_permission_delegate.cc
@@ -0,0 +1,13 @@ +// 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. + +#include "content/browser/webid/test/mock_sharing_permission_delegate.h" + +namespace content { + +MockSharingPermissionDelegate::MockSharingPermissionDelegate() = default; + +MockSharingPermissionDelegate::~MockSharingPermissionDelegate() = default; + +} // namespace content
diff --git a/content/browser/webid/test/mock_sharing_permission_delegate.h b/content/browser/webid/test/mock_sharing_permission_delegate.h new file mode 100644 index 0000000..83a8701b --- /dev/null +++ b/content/browser/webid/test/mock_sharing_permission_delegate.h
@@ -0,0 +1,34 @@ +// 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. + +#ifndef CONTENT_BROWSER_WEBID_TEST_MOCK_SHARING_PERMISSION_DELEGATE_H_ +#define CONTENT_BROWSER_WEBID_TEST_MOCK_SHARING_PERMISSION_DELEGATE_H_ + +#include "content/public/browser/federated_identity_sharing_permission_context_delegate.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace content { + +class MockSharingPermissionDelegate + : public FederatedIdentitySharingPermissionContextDelegate { + public: + MockSharingPermissionDelegate(); + + ~MockSharingPermissionDelegate() override; + + MockSharingPermissionDelegate(const MockSharingPermissionDelegate&) = delete; + MockSharingPermissionDelegate& operator=( + const MockSharingPermissionDelegate&) = delete; + + MOCK_METHOD2(HasSharingPermission, + bool(const url::Origin&, const url::Origin&)); + MOCK_METHOD2(GrantSharingPermission, + void(const url::Origin&, const url::Origin&)); + MOCK_METHOD2(RevokeSharingPermission, + void(const url::Origin&, const url::Origin&)); +}; + +} // namespace content + +#endif // CONTENT_BROWSER_WEBID_TEST_MOCK_SHARING_PERMISSION_DELEGATE_H_
diff --git a/content/browser/webrtc/webrtc_getusermedia_browsertest.cc b/content/browser/webrtc/webrtc_getusermedia_browsertest.cc index e02206f2..d2e9851 100644 --- a/content/browser/webrtc/webrtc_getusermedia_browsertest.cc +++ b/content/browser/webrtc/webrtc_getusermedia_browsertest.cc
@@ -612,8 +612,17 @@ ExecuteJavascriptAndWaitForOk(call); } +// TODO(http://crbug.com/1205560): This test is flaky on mac bots. Re-enable the +// test after fixing the issue. +#if defined(OS_MAC) +#define MAYBE_InvalidSourceIdInIFrameAndCloseInFailureCb \ + DISABLED_InvalidSourceIdInIFrameAndCloseInFailureCb +#else +#define MAYBE_InvalidSourceIdInIFrameAndCloseInFailureCb \ + InvalidSourceIdInIFrameAndCloseInFailureCb +#endif IN_PROC_BROWSER_TEST_F(WebRtcGetUserMediaBrowserTest, - InvalidSourceIdInIFrameAndCloseInFailureCb) { + MAYBE_InvalidSourceIdInIFrameAndCloseInFailureCb) { ASSERT_TRUE(embedded_test_server()->Start()); GURL url(embedded_test_server()->GetURL("/media/getusermedia.html"));
diff --git a/content/public/browser/federated_identity_request_permission_context_delegate.h b/content/public/browser/federated_identity_request_permission_context_delegate.h index 218566b..24e4012 100644 --- a/content/public/browser/federated_identity_request_permission_context_delegate.h +++ b/content/public/browser/federated_identity_request_permission_context_delegate.h
@@ -14,6 +14,9 @@ // requests to a given provider. class FederatedIdentityRequestPermissionContextDelegate { public: + FederatedIdentityRequestPermissionContextDelegate() = default; + virtual ~FederatedIdentityRequestPermissionContextDelegate() = default; + // Determine whether the relying_party has an existing permission grant to // send identity requests to the Identity Provider. virtual bool HasRequestPermission(const url::Origin& relying_party, @@ -28,9 +31,6 @@ virtual void RevokeRequestPermission( const url::Origin& relying_party, const url::Origin& identity_provider) = 0; - - protected: - virtual ~FederatedIdentityRequestPermissionContextDelegate() = default; }; } // namespace content
diff --git a/content/public/browser/federated_identity_sharing_permission_context_delegate.h b/content/public/browser/federated_identity_sharing_permission_context_delegate.h index 1d24ec2..0de1290 100644 --- a/content/public/browser/federated_identity_sharing_permission_context_delegate.h +++ b/content/public/browser/federated_identity_sharing_permission_context_delegate.h
@@ -14,6 +14,9 @@ // information from a given provider to a given relying party. class FederatedIdentitySharingPermissionContextDelegate { public: + FederatedIdentitySharingPermissionContextDelegate() = default; + virtual ~FederatedIdentitySharingPermissionContextDelegate() = default; + // Determine whether the requester has an existing permission grant to share // identity information to the relying party. virtual bool HasSharingPermission(const url::Origin& identity_provider, @@ -28,9 +31,6 @@ // relying party. virtual void RevokeSharingPermission(const url::Origin& identity_provider, const url::Origin& relying_party) = 0; - - protected: - virtual ~FederatedIdentitySharingPermissionContextDelegate() = default; }; } // namespace content
diff --git a/content/public/browser/gpu_utils.cc b/content/public/browser/gpu_utils.cc index 58857b37..3d18c96 100644 --- a/content/public/browser/gpu_utils.cc +++ b/content/public/browser/gpu_utils.cc
@@ -29,20 +29,6 @@ namespace { -void RunTaskOnTaskRunner( - scoped_refptr<base::SingleThreadTaskRunner> task_runner, - base::OnceClosure callback) { - task_runner->PostTask(FROM_HERE, std::move(callback)); -} - -void StopGpuProcessImpl(base::OnceClosure callback, - content::GpuProcessHost* host) { - if (host) - host->gpu_service()->Stop(std::move(callback)); - else - std::move(callback).Run(); -} - void KillGpuProcessImpl(content::GpuProcessHost* host) { if (host) { host->ForceShutdown(); @@ -168,15 +154,6 @@ return gpu_preferences; } -void StopGpuProcess(base::OnceClosure callback) { - GpuProcessHost::CallOnIO( - GPU_PROCESS_KIND_SANDBOXED, false /* force_create */, - base::BindOnce(&StopGpuProcessImpl, - base::BindOnce(RunTaskOnTaskRunner, - base::ThreadTaskRunnerHandle::Get(), - std::move(callback)))); -} - void KillGpuProcess() { GpuProcessHost::CallOnIO(GPU_PROCESS_KIND_SANDBOXED, false /* force_create */, base::BindOnce(&KillGpuProcessImpl));
diff --git a/content/public/browser/gpu_utils.h b/content/public/browser/gpu_utils.h index 31d96e8..d90a5db1 100644 --- a/content/public/browser/gpu_utils.h +++ b/content/public/browser/gpu_utils.h
@@ -18,10 +18,7 @@ CONTENT_EXPORT const gpu::GpuPreferences GetGpuPreferencesFromCommandLine(); -CONTENT_EXPORT void StopGpuProcess(base::OnceClosure callback); - // Kills the GPU process with a normal termination status. -// TODO(crbug.com/1095977): Combine with StopGpuProcess CONTENT_EXPORT void KillGpuProcess(); CONTENT_EXPORT gpu::GpuChannelEstablishFactory* GetGpuChannelEstablishFactory();
diff --git a/content/renderer/accessibility/render_accessibility_impl.cc b/content/renderer/accessibility/render_accessibility_impl.cc index d240a8d..8b5ecc7 100644 --- a/content/renderer/accessibility/render_accessibility_impl.cc +++ b/content/renderer/accessibility/render_accessibility_impl.cc
@@ -18,6 +18,7 @@ #include "base/debug/crash_logging.h" #include "base/location.h" #include "base/memory/ptr_util.h" +#include "base/metrics/histogram_macros.h" #include "base/single_thread_task_runner.h" #include "base/strings/string_split.h" #include "base/strings/utf_string_conversions.h" @@ -1046,6 +1047,11 @@ last_ukm_url_ = document.CanonicalUrlForSharing().GetString().Utf8(); slowest_serialization_time_ = elapsed_time_ms; } + // Also log the time taken in this function to track serialization + // performance. + UMA_HISTOGRAM_TIMES( + "Accessibility.Performance.SendPendingAccessibilityEvents", + elapsed_time_ms); if (ukm_timer_->Elapsed() >= kMinUKMDelay) MaybeSendUKM();
diff --git a/content/renderer/accessibility/render_accessibility_impl_browsertest.cc b/content/renderer/accessibility/render_accessibility_impl_browsertest.cc index 79706f3..bcf29a96 100644 --- a/content/renderer/accessibility/render_accessibility_impl_browsertest.cc +++ b/content/renderer/accessibility/render_accessibility_impl_browsertest.cc
@@ -13,6 +13,7 @@ #include "base/bind.h" #include "base/macros.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/time/time.h" @@ -1456,6 +1457,9 @@ // No URL-keyed metrics should be fired initially. EXPECT_EQ(0, ukm_recorder()->calls()); + base::HistogramTester histogram_tester; + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.SendPendingAccessibilityEvents", 0); // No URL-keyed metrics should be fired after we send one event. WebDocument document = GetMainFrame()->GetDocument(); @@ -1464,6 +1468,8 @@ ui::AXEvent(root_obj.AxID(), ax::mojom::Event::kChildrenChanged)); SendPendingAccessibilityEvents(); EXPECT_EQ(0, ukm_recorder()->calls()); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.SendPendingAccessibilityEvents", 1); // No URL-keyed metrics should be fired even after an event that takes // 300 ms, but we should now have something to send. @@ -1473,6 +1479,8 @@ ui::AXEvent(root_obj.AxID(), ax::mojom::Event::kChildrenChanged)); SendPendingAccessibilityEvents(); EXPECT_EQ(0, ukm_recorder()->calls()); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.SendPendingAccessibilityEvents", 2); // After 1000 seconds have passed, the next time we send an event we should // send URL-keyed metrics. @@ -1481,6 +1489,8 @@ ui::AXEvent(root_obj.AxID(), ax::mojom::Event::kChildrenChanged)); SendPendingAccessibilityEvents(); EXPECT_EQ(1, ukm_recorder()->calls()); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.SendPendingAccessibilityEvents", 3); // Send another event that takes a long (simulated) time to serialize. // This must be >= kMinSerializationTimeToSendInMS @@ -1488,6 +1498,8 @@ GetRenderAccessibilityImpl()->HandleAXEvent( ui::AXEvent(root_obj.AxID(), ax::mojom::Event::kChildrenChanged)); SendPendingAccessibilityEvents(); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.SendPendingAccessibilityEvents", 4); // We shouldn't have a new call to the UKM recorder yet, not enough // time has elapsed.
diff --git a/content/renderer/pepper/ppb_var_deprecated_impl.cc b/content/renderer/pepper/ppb_var_deprecated_impl.cc index 68adb2e1..1ee3454 100644 --- a/content/renderer/pepper/ppb_var_deprecated_impl.cc +++ b/content/renderer/pepper/ppb_var_deprecated_impl.cc
@@ -94,6 +94,9 @@ PepperTryCatchVar try_catch(accessor.instance(), accessor.converter(), exception); + v8::MicrotasksScope microtasks_scope( + accessor.GetObject()->GetIsolate(), + v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local<v8::Value> v8_name = try_catch.ToV8(name); if (try_catch.HasException()) return false; @@ -118,6 +121,9 @@ PepperTryCatchVar try_catch(accessor.instance(), accessor.converter(), exception); + v8::MicrotasksScope microtasks_scope( + accessor.GetObject()->GetIsolate(), + v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local<v8::Value> v8_name = try_catch.ToV8(name); if (try_catch.HasException()) return false; @@ -147,6 +153,9 @@ PepperTryCatchVar try_catch(accessor.instance(), accessor.converter(), exception); + v8::MicrotasksScope microtasks_scope( + accessor.GetObject()->GetIsolate(), + v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local<v8::Value> v8_name = try_catch.ToV8(name); if (try_catch.HasException()) return PP_MakeUndefined(); @@ -170,6 +179,9 @@ PepperTryCatchVar try_catch(accessor.instance(), accessor.converter(), exception); + v8::MicrotasksScope microtasks_scope( + accessor.GetObject()->GetIsolate(), + v8::MicrotasksScope::kDoNotRunMicrotasks); *properties = nullptr; *property_count = 0; @@ -203,6 +215,9 @@ PepperTryCatchVar try_catch(accessor.instance(), accessor.converter(), exception); + v8::MicrotasksScope microtasks_scope( + accessor.GetObject()->GetIsolate(), + v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local<v8::Value> v8_name = try_catch.ToV8(name); v8::Local<v8::Value> v8_value = try_catch.ToV8(value); @@ -223,6 +238,9 @@ PepperTryCatchVar try_catch(accessor.instance(), accessor.converter(), exception); + v8::MicrotasksScope microtasks_scope( + accessor.GetObject()->GetIsolate(), + v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local<v8::Value> v8_name = try_catch.ToV8(name); if (try_catch.HasException()) @@ -259,6 +277,9 @@ PepperTryCatchVar try_catch(accessor.instance(), accessor.converter(), exception); + v8::MicrotasksScope microtasks_scope( + accessor.GetObject()->GetIsolate(), + v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local<v8::Value> v8_method_name = try_catch.ToV8(scoped_name.get()); if (try_catch.HasException()) return PP_MakeUndefined();
diff --git a/content/services/auction_worklet/auction_runner_unittest.cc b/content/services/auction_worklet/auction_runner_unittest.cc index 1a412d36..9b00429 100644 --- a/content/services/auction_worklet/auction_runner_unittest.cc +++ b/content/services/auction_worklet/auction_runner_unittest.cc
@@ -111,7 +111,6 @@ throw new Error("wrong browserSignals.bid"); sendReportTo("https://buyer-reporting.example.com"); - return {ig: interestGroupName}; } )"; return base::StringPrintf( @@ -120,7 +119,14 @@ has_signals ? "true" : "false", signal_key.c_str(), signal_val.c_str()); } -constexpr char kAuctionScript[] = R"( +// This can be appended to the standard script to override the function. +constexpr char kReportWinNoUrl[] = R"( + function reportWin(auctionSignals, perBuyerSignals, sellerSignals, + browserSignals) { + } +)"; + +constexpr char kCheckingAuctionScript[] = R"( function scoreAd(adMetadata, bid, auctionConfig, trustedScoringSignals, browserSignals) { if (adMetadata.bidKey !== ("data for " + bid)) { @@ -141,10 +147,18 @@ throw new Error("wrong topWindowHostname"); if ("joinCount" in browserSignals) throw new Error("wrong kind of browser signals"); + if (browserSignals.adRenderFingerprint !== "#####") + throw new Error("wrong adRenderFingerprint"); + if (typeof browserSignals.biddingDurationMsec !== "number") + throw new Error("biddingDurationMsec is not a number. huh"); + if (browserSignals.biddingDurationMsec < 0) + throw new Error("biddingDurationMsec should be non-negative."); return bid * 2; } +)"; +constexpr char kReportResultScript[] = R"( function reportResult(auctionConfig, browserSignals) { if (auctionConfig.decisionLogicUrl !== "https://adstuff.publisher1.com/auction.js") { @@ -157,6 +171,32 @@ } )"; +constexpr char kReportResultScriptNoUrl[] = R"( + function reportResult(auctionConfig, browserSignals) { + return browserSignals; + } +)"; + +std::string MakeAuctionScript() { + return std::string(kCheckingAuctionScript) + kReportResultScript; +} + +std::string MakeAuctionScriptNoReportUrl() { + return std::string(kCheckingAuctionScript) + kReportResultScriptNoUrl; +} + +const char kAuctionScriptRejects2[] = R"( + function scoreAd(adMetadata, bid, auctionConfig, browserSignals) { + if (bid === 2) + return -1; + return bid + 1; + } +)"; + +std::string MakeAuctionScriptReject2() { + return std::string(kAuctionScriptRejects2) + kReportResultScript; +} + class AuctionRunnerTest : public testing::Test { protected: struct Result { @@ -280,7 +320,7 @@ &url_loader_factory_, kBidder2Url, MakeBidScript("2", "https://ad2.com/", kBidder2, kBidder2Name, true /* has_signals */, "l2", "b")); - AddJavascriptResponse(&url_loader_factory_, kSellerUrl, kAuctionScript); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, MakeAuctionScript()); AddJsonResponse( &url_loader_factory_, GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=k1,k2"), @@ -294,7 +334,7 @@ EXPECT_EQ("https://ad2.com/", res.ad_url.spec()); EXPECT_EQ("https://anotheradthing.com", res.interest_group_owner.Serialize()); EXPECT_EQ("Another Ad Thing", res.interest_group_name); - EXPECT_TRUE(res.seller_report->report_requested); + EXPECT_TRUE(res.seller_report->success); EXPECT_EQ("https://reporting.example.com/", res.seller_report->report_url.spec()); EXPECT_EQ(R"({"topWindowHostname":"publisher1.com",)" @@ -315,7 +355,7 @@ MakeBidScript("1", "https://ad1.com/", kBidder1, kBidder1Name, true /* has_signals */, "k1", "a")); url_loader_factory_.AddResponse(kBidder2Url.spec(), "", net::HTTP_NOT_FOUND); - AddJavascriptResponse(&url_loader_factory_, kSellerUrl, kAuctionScript); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, MakeAuctionScript()); AddJsonResponse( &url_loader_factory_, GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=k1,k2"), @@ -329,7 +369,7 @@ EXPECT_EQ("https://ad1.com/", res.ad_url.spec()); EXPECT_EQ("https://adplatform.com", res.interest_group_owner.Serialize()); EXPECT_EQ("Ad Platform", res.interest_group_name); - EXPECT_TRUE(res.seller_report->report_requested); + EXPECT_TRUE(res.seller_report->success); EXPECT_EQ("https://reporting.example.com/", res.seller_report->report_url.spec()); EXPECT_EQ(R"({"topWindowHostname":"publisher1.com",)" @@ -352,8 +392,8 @@ true /* has_signals */, "k1", "a")); // The auction script doesn't make any bids. - AddJavascriptResponse(&url_loader_factory_, kBidder2Url, kAuctionScript); - AddJavascriptResponse(&url_loader_factory_, kSellerUrl, kAuctionScript); + AddJavascriptResponse(&url_loader_factory_, kBidder2Url, MakeAuctionScript()); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, MakeAuctionScript()); AddJsonResponse( &url_loader_factory_, GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=k1,k2"), @@ -367,7 +407,7 @@ EXPECT_EQ("https://ad1.com/", res.ad_url.spec()); EXPECT_EQ("https://adplatform.com", res.interest_group_owner.Serialize()); EXPECT_EQ("Ad Platform", res.interest_group_name); - EXPECT_TRUE(res.seller_report->report_requested); + EXPECT_TRUE(res.seller_report->success); EXPECT_EQ("https://reporting.example.com/", res.seller_report->report_url.spec()); EXPECT_EQ(R"({"topWindowHostname":"publisher1.com",)" @@ -385,7 +425,7 @@ TEST_F(AuctionRunnerTest, NoBids) { url_loader_factory_.AddResponse(kBidder1Url.spec(), "", net::HTTP_NOT_FOUND); url_loader_factory_.AddResponse(kBidder2Url.spec(), "", net::HTTP_NOT_FOUND); - AddJavascriptResponse(&url_loader_factory_, kSellerUrl, kAuctionScript); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, MakeAuctionScript()); AddJsonResponse( &url_loader_factory_, GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=k1,k2"), @@ -399,7 +439,7 @@ EXPECT_TRUE(res.ad_url.is_empty()); EXPECT_TRUE(res.interest_group_owner.opaque()); EXPECT_EQ("", res.interest_group_name); - EXPECT_FALSE(res.seller_report->report_requested); + EXPECT_FALSE(res.seller_report->success); EXPECT_TRUE(res.seller_report->report_url.is_empty()); EXPECT_EQ("", res.seller_report->signals_for_winner_json); EXPECT_FALSE(res.bidder_report->report_requested); @@ -408,10 +448,10 @@ // An auction where none of the bidding scripts has a valid bidding function. TEST_F(AuctionRunnerTest, NoBidMadeByScript) { - // kAuctionScript is a valid script that doesn't have a bidding function. - AddJavascriptResponse(&url_loader_factory_, kBidder1Url, kAuctionScript); - AddJavascriptResponse(&url_loader_factory_, kBidder2Url, kAuctionScript); - AddJavascriptResponse(&url_loader_factory_, kSellerUrl, kAuctionScript); + // MakeAuctionScript() is a valid script that doesn't have a bidding function. + AddJavascriptResponse(&url_loader_factory_, kBidder1Url, MakeAuctionScript()); + AddJavascriptResponse(&url_loader_factory_, kBidder2Url, MakeAuctionScript()); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, MakeAuctionScript()); AddJsonResponse( &url_loader_factory_, GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=k1,k2"), @@ -425,7 +465,7 @@ EXPECT_TRUE(res.ad_url.is_empty()); EXPECT_TRUE(res.interest_group_owner.opaque()); EXPECT_EQ("", res.interest_group_name); - EXPECT_FALSE(res.seller_report->report_requested); + EXPECT_FALSE(res.seller_report->success); EXPECT_TRUE(res.seller_report->report_url.is_empty()); EXPECT_EQ("", res.seller_report->signals_for_winner_json); EXPECT_FALSE(res.bidder_report->report_requested); @@ -458,13 +498,52 @@ EXPECT_TRUE(res.ad_url.is_empty()); EXPECT_TRUE(res.interest_group_owner.opaque()); EXPECT_EQ("", res.interest_group_name); - EXPECT_FALSE(res.seller_report->report_requested); + EXPECT_FALSE(res.seller_report->success); EXPECT_TRUE(res.seller_report->report_url.is_empty()); EXPECT_EQ("", res.seller_report->signals_for_winner_json); EXPECT_FALSE(res.bidder_report->report_requested); EXPECT_TRUE(res.bidder_report->report_url.is_empty()); } +// An auction where seller rejects one bid when scoring. +TEST_F(AuctionRunnerTest, SellerRejectsOne) { + AddJavascriptResponse( + &url_loader_factory_, kBidder1Url, + MakeBidScript("1", "https://ad1.com/", kBidder1, kBidder1Name, + true /* has_signals */, "k1", "a")); + AddJavascriptResponse( + &url_loader_factory_, kBidder2Url, + MakeBidScript("2", "https://ad2.com/", kBidder2, kBidder2Name, + true /* has_signals */, "l2", "b")); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, + MakeAuctionScriptReject2()); + AddJsonResponse( + &url_loader_factory_, + GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=k1,k2"), + R"({"k1":"a", "k2": "b", "extra": "c"})"); + AddJsonResponse( + &url_loader_factory_, + GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=l1,l2"), + R"({"l1":"a", "l2": "b", "extra": "c"})"); + + Result res = RunStandardAuction(); + EXPECT_EQ("https://ad1.com/", res.ad_url.spec()); + EXPECT_EQ("https://adplatform.com", res.interest_group_owner.Serialize()); + EXPECT_EQ("Ad Platform", res.interest_group_name); + EXPECT_TRUE(res.seller_report->success); + EXPECT_EQ("https://reporting.example.com/", + res.seller_report->report_url.spec()); + EXPECT_EQ(R"({"topWindowHostname":"publisher1.com",)" + R"("interestGroupOwner":"https://adplatform.com",)" + R"("renderUrl":"https://ad1.com/",)" + R"("adRenderFingerprint":"#####",)" + R"("bid":1,"desirability":2})", + res.seller_report->signals_for_winner_json); + EXPECT_TRUE(res.bidder_report->report_requested); + EXPECT_EQ("https://buyer-reporting.example.com/", + res.bidder_report->report_url.spec()); +} + // An auction where the seller script fails to load. TEST_F(AuctionRunnerTest, NoSellerScript) { // Tests to make sure that if seller script fails the other fetches are @@ -474,7 +553,7 @@ EXPECT_TRUE(res.ad_url.is_empty()); EXPECT_TRUE(res.interest_group_owner.opaque()); EXPECT_EQ("", res.interest_group_name); - EXPECT_FALSE(res.seller_report->report_requested); + EXPECT_FALSE(res.seller_report->success); EXPECT_TRUE(res.seller_report->report_url.is_empty()); EXPECT_EQ("", res.seller_report->signals_for_winner_json); EXPECT_FALSE(res.bidder_report->report_requested); @@ -493,7 +572,7 @@ &url_loader_factory_, kBidder2Url, MakeBidScript("2", "https://ad2.com/", kBidder2, kBidder2Name, false /* has_signals */, "l2", "b")); - AddJavascriptResponse(&url_loader_factory_, kSellerUrl, kAuctionScript); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, MakeAuctionScript()); std::vector<mojom::BiddingInterestGroupPtr> bidders; bidders.push_back(MakeInterestGroup(kBidder1, kBidder1Name, kBidder1Url, @@ -513,7 +592,7 @@ EXPECT_EQ("https://ad2.com/", res.ad_url.spec()); EXPECT_EQ("https://anotheradthing.com", res.interest_group_owner.Serialize()); EXPECT_EQ("Another Ad Thing", res.interest_group_name); - EXPECT_TRUE(res.seller_report->report_requested); + EXPECT_TRUE(res.seller_report->success); EXPECT_EQ("https://reporting.example.com/", res.seller_report->report_url.spec()); EXPECT_EQ(R"({"topWindowHostname":"publisher1.com",)" @@ -543,13 +622,13 @@ url_loader_factory_.AddResponse( kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=l1,l2", "", net::HTTP_NOT_FOUND); - AddJavascriptResponse(&url_loader_factory_, kSellerUrl, kAuctionScript); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, MakeAuctionScript()); Result res = RunStandardAuction(); EXPECT_EQ("https://ad2.com/", res.ad_url.spec()); EXPECT_EQ("https://anotheradthing.com", res.interest_group_owner.Serialize()); EXPECT_EQ("Another Ad Thing", res.interest_group_name); - EXPECT_TRUE(res.seller_report->report_requested); + EXPECT_TRUE(res.seller_report->success); EXPECT_EQ("https://reporting.example.com/", res.seller_report->report_url.spec()); EXPECT_EQ(R"({"topWindowHostname":"publisher1.com",)" @@ -563,5 +642,121 @@ res.bidder_report->report_url.spec()); } +// A successful auction where seller reporting worklet doesn't set a URL. +TEST_F(AuctionRunnerTest, NoReportResultUrl) { + AddJavascriptResponse( + &url_loader_factory_, kBidder1Url, + MakeBidScript("1", "https://ad1.com/", kBidder1, kBidder1Name, + true /* has_signals */, "k1", "a")); + AddJavascriptResponse( + &url_loader_factory_, kBidder2Url, + MakeBidScript("2", "https://ad2.com/", kBidder2, kBidder2Name, + true /* has_signals */, "l2", "b")); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, + MakeAuctionScriptNoReportUrl()); + AddJsonResponse( + &url_loader_factory_, + GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=k1,k2"), + R"({"k1":"a", "k2": "b", "extra": "c"})"); + AddJsonResponse( + &url_loader_factory_, + GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=l1,l2"), + R"({"l1":"a", "l2": "b", "extra": "c"})"); + + Result res = RunStandardAuction(); + EXPECT_EQ("https://ad2.com/", res.ad_url.spec()); + EXPECT_EQ("https://anotheradthing.com", res.interest_group_owner.Serialize()); + EXPECT_EQ("Another Ad Thing", res.interest_group_name); + EXPECT_TRUE(res.seller_report->success); + EXPECT_TRUE(res.seller_report->report_url.is_empty()); + EXPECT_EQ(R"({"topWindowHostname":"publisher1.com",)" + R"("interestGroupOwner":"https://anotheradthing.com",)" + R"("renderUrl":"https://ad2.com/",)" + R"("adRenderFingerprint":"#####",)" + R"("bid":2,"desirability":4})", + res.seller_report->signals_for_winner_json); + EXPECT_TRUE(res.bidder_report->report_requested); + EXPECT_EQ("https://buyer-reporting.example.com/", + res.bidder_report->report_url.spec()); +} + +// A successful auction where bidder reporting worklet doesn't set a URL. +TEST_F(AuctionRunnerTest, NoReportWinUrl) { + AddJavascriptResponse( + &url_loader_factory_, kBidder1Url, + MakeBidScript("1", "https://ad1.com/", kBidder1, kBidder1Name, + true /* has_signals */, "k1", "a") + + kReportWinNoUrl); + AddJavascriptResponse( + &url_loader_factory_, kBidder2Url, + MakeBidScript("2", "https://ad2.com/", kBidder2, kBidder2Name, + true /* has_signals */, "l2", "b") + + kReportWinNoUrl); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, MakeAuctionScript()); + AddJsonResponse( + &url_loader_factory_, + GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=k1,k2"), + R"({"k1":"a", "k2": "b", "extra": "c"})"); + AddJsonResponse( + &url_loader_factory_, + GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=l1,l2"), + R"({"l1":"a", "l2": "b", "extra": "c"})"); + + Result res = RunStandardAuction(); + EXPECT_EQ("https://ad2.com/", res.ad_url.spec()); + EXPECT_EQ("https://anotheradthing.com", res.interest_group_owner.Serialize()); + EXPECT_EQ("Another Ad Thing", res.interest_group_name); + EXPECT_TRUE(res.seller_report->success); + EXPECT_EQ("https://reporting.example.com/", + res.seller_report->report_url.spec()); + EXPECT_EQ(R"({"topWindowHostname":"publisher1.com",)" + R"("interestGroupOwner":"https://anotheradthing.com",)" + R"("renderUrl":"https://ad2.com/",)" + R"("adRenderFingerprint":"#####",)" + R"("bid":2,"desirability":4})", + res.seller_report->signals_for_winner_json); + EXPECT_FALSE(res.bidder_report->report_requested); + EXPECT_TRUE(res.bidder_report->report_url.is_empty()); +} + +// A successful auction where neither reporting worklets sets a URL. +TEST_F(AuctionRunnerTest, NeitherReportUrl) { + AddJavascriptResponse( + &url_loader_factory_, kBidder1Url, + MakeBidScript("1", "https://ad1.com/", kBidder1, kBidder1Name, + true /* has_signals */, "k1", "a") + + kReportWinNoUrl); + AddJavascriptResponse( + &url_loader_factory_, kBidder2Url, + MakeBidScript("2", "https://ad2.com/", kBidder2, kBidder2Name, + true /* has_signals */, "l2", "b") + + kReportWinNoUrl); + AddJavascriptResponse(&url_loader_factory_, kSellerUrl, + MakeAuctionScriptNoReportUrl()); + AddJsonResponse( + &url_loader_factory_, + GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=k1,k2"), + R"({"k1":"a", "k2": "b", "extra": "c"})"); + AddJsonResponse( + &url_loader_factory_, + GURL(kTrustedSignalsUrl.spec() + "?hostname=publisher1.com&keys=l1,l2"), + R"({"l1":"a", "l2": "b", "extra": "c"})"); + + Result res = RunStandardAuction(); + EXPECT_EQ("https://ad2.com/", res.ad_url.spec()); + EXPECT_EQ("https://anotheradthing.com", res.interest_group_owner.Serialize()); + EXPECT_EQ("Another Ad Thing", res.interest_group_name); + EXPECT_TRUE(res.seller_report->success); + EXPECT_TRUE(res.seller_report->report_url.is_empty()); + EXPECT_EQ(R"({"topWindowHostname":"publisher1.com",)" + R"("interestGroupOwner":"https://anotheradthing.com",)" + R"("renderUrl":"https://ad2.com/",)" + R"("adRenderFingerprint":"#####",)" + R"("bid":2,"desirability":4})", + res.seller_report->signals_for_winner_json); + EXPECT_FALSE(res.bidder_report->report_requested); + EXPECT_TRUE(res.bidder_report->report_url.is_empty()); +} + } // namespace } // namespace auction_worklet
diff --git a/content/services/auction_worklet/bidder_worklet_unittest.cc b/content/services/auction_worklet/bidder_worklet_unittest.cc index 5607470..3e5811d 100644 --- a/content/services/auction_worklet/bidder_worklet_unittest.cc +++ b/content/services/auction_worklet/bidder_worklet_unittest.cc
@@ -615,38 +615,37 @@ // Test handling of null auctionSignals and perBuyerSignals to generateBid. TEST_F(BidderWorkletTest, GenerateBidParametersOptionalString) { constexpr char kRetVal[] = R"({ - ad: "metadata", - bid: (auctionSignals === null ? 10 : 0) + - (perBuyerSignals === null ? 2 : 1), + ad: [auctionSignals === null, perBuyerSignals === null], + bid: 1, render: "https://response.test/" -})"; + })"; SetDefaultParameters(); null_auction_signals_ = false; null_per_buyer_signals_ = false; RunGenerateBidWithReturnValueExpectingResult( - kRetVal, BidderWorklet::BidResult("\"metadata\"", 1, + kRetVal, BidderWorklet::BidResult("[false,false]", 1, GURL("https://response.test/"))); SetDefaultParameters(); null_auction_signals_ = false; null_per_buyer_signals_ = true; RunGenerateBidWithReturnValueExpectingResult( - kRetVal, BidderWorklet::BidResult("\"metadata\"", 2, + kRetVal, BidderWorklet::BidResult("[false,true]", 1, GURL("https://response.test/"))); SetDefaultParameters(); null_auction_signals_ = true; null_per_buyer_signals_ = false; RunGenerateBidWithReturnValueExpectingResult( - kRetVal, BidderWorklet::BidResult("\"metadata\"", 11, + kRetVal, BidderWorklet::BidResult("[true,false]", 1, GURL("https://response.test/"))); SetDefaultParameters(); null_auction_signals_ = true; null_per_buyer_signals_ = true; RunGenerateBidWithReturnValueExpectingResult( - kRetVal, BidderWorklet::BidResult("\"metadata\"", 12, + kRetVal, BidderWorklet::BidResult("[true,true]", 1, GURL("https://response.test/"))); }
diff --git a/content/services/auction_worklet/public/mojom/auction_worklet_service.mojom b/content/services/auction_worklet/public/mojom/auction_worklet_service.mojom index 4da36de..6552c60 100644 --- a/content/services/auction_worklet/public/mojom/auction_worklet_service.mojom +++ b/content/services/auction_worklet/public/mojom/auction_worklet_service.mojom
@@ -11,13 +11,25 @@ import "url/mojom/url.mojom"; struct PreviousWin { + // Approximate time a particular group won an auction. mojo_base.mojom.Time time; + + // The ad object returned by that group's bidding function with the winning + // bid. string ad_json; }; +// Information here corresponds to the interest group it's packaged with inside +// BiddingInterestGroup. struct BiddingBrowserSignals { + // How many times this interest group has been joined in the period history + // is maintained. int32 join_count; + + // How many times this interest group has made bids in auctions. int32 bid_count; + + // Previous times the group won auctions. array<PreviousWin> prev_wins; }; @@ -42,13 +54,13 @@ }; struct SellerReport { - // true if the seller worklet's reporting function ran successfully and set a - // reporting URL. - bool report_requested; + // true if the seller worklet's reporting function ran successfully. Unlike + // WinningBidderReport, this doesn't require the URL to be set and valid. + bool success; string signals_for_winner_json; - // This is checked to be a https:// URL for `report_requested` to be true, but - // no restrictions on the destination are performed by AuctionRunner. + // If this is non-empty, it's a valid https:// URL, but no restrictions on + // destination beyond the scheme are enforced by AuctionRunner. url.mojom.Url report_url; };
diff --git a/content/shell/browser/shell_platform_delegate_views.cc b/content/shell/browser/shell_platform_delegate_views.cc index 1c556eec..887526e 100644 --- a/content/shell/browser/shell_platform_delegate_views.cc +++ b/content/shell/browser/shell_platform_delegate_views.cc
@@ -22,6 +22,8 @@ #include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_tree_host.h" #include "ui/base/clipboard/clipboard.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/events/event.h" #include "ui/native_theme/native_theme_color_id.h" @@ -32,8 +34,6 @@ #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/test/desktop_test_views_delegate.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index f9d8657..fc872e6 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -10,6 +10,7 @@ import("//build/config/features.gni") import("//build/config/ui.gni") import("//build/nocompile.gni") +import("//components/viz/common/debugger/viz_debugger.gni") import("//content/common/features.gni") import("//device/vr/buildflags/buildflags.gni") import("//media/media_options.gni") @@ -1289,6 +1290,12 @@ "../test/url_loader_interceptor_test.cc", ] + if (use_viz_debugger) { + sources += [ + "../browser/devtools/protocol/visual_debugger_handler_browsertest.cc", + ] + } + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] configs += [ @@ -2146,6 +2153,10 @@ "../browser/webid/test/mock_identity_request_dialog_controller.h", "../browser/webid/test/mock_idp_network_request_manager.cc", "../browser/webid/test/mock_idp_network_request_manager.h", + "../browser/webid/test/mock_request_permission_delegate.cc", + "../browser/webid/test/mock_request_permission_delegate.h", + "../browser/webid/test/mock_sharing_permission_delegate.cc", + "../browser/webid/test/mock_sharing_permission_delegate.h", "../browser/webrtc/webrtc_internals_message_handler_unittest.cc", "../browser/webrtc/webrtc_internals_unittest.cc", "../browser/webui/web_ui_data_source_unittest.cc",
diff --git a/content/test/data/gpu/webcodecs/draw-image.html b/content/test/data/gpu/webcodecs/draw-image.html deleted file mode 100644 index 87e6fa2..0000000 --- a/content/test/data/gpu/webcodecs/draw-image.html +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html> -<!-- -Take frames coming from various sources and render them to a canvas with -CanvasRenderingContext2D.drawImage(). ---> -<html> - -<head> - <title>drawImage() test</title> - <script src="webcodecs_common.js"></script> - <script type="text/javascript"> - 'use strict'; - - async function main(arg) { - const frames_to_draw = 5; - let source_type = arg.source_type; - let cnv = document.getElementById('display'); - let ctx = cnv.getContext('2d'); - let source = await createFrameSource(source_type, cnv.width, cnv.height); - if (!source) { - TEST.log('Skipping unsupported source: ' + source_type); - return; - } - - for (let i = 0; i < frames_to_draw; i++) { - let frame = await source.getNextFrame(); - ctx.drawImage(frame, 0, 0, cnv.width, cnv.height); - frame.close(); - await waitForNextFrame(); - // TODO: Take snapshot of the canvas and compare it to the frame. - } - } - </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/encode-decode.html b/content/test/data/gpu/webcodecs/encode-decode-render.html similarity index 64% rename from content/test/data/gpu/webcodecs/encode-decode.html rename to content/test/data/gpu/webcodecs/encode-decode-render.html index 397db67a..30052db 100644 --- a/content/test/data/gpu/webcodecs/encode-decode.html +++ b/content/test/data/gpu/webcodecs/encode-decode-render.html
@@ -1,8 +1,4 @@ <!DOCTYPE html> -<!-- -The most basic GPU smoke test for WebCodecs: Accelerated VideoEncoder encodes -several frames and accelerated VideoDecoder needs to successfully decode them. ---> <html> <head> @@ -10,36 +6,38 @@ <script src="webcodecs_common.js"></script> <script type="text/javascript"> 'use strict'; - const acceleration = 'require'; + const acceleration = "require"; async function main(arg) { - const width = 640; - const height = 480; - const frames_to_encode = 32; + let cnv = document.getElementById("display"); + let ctx = cnv.getContext("2d"); + let frames_to_encode = 35; let frames_encoded = 0; let frames_decoded = 0; let errors = 0; - const encoder_config = { + const encoder_config = + { codec: arg.codec, hardwareAcceleration: acceleration, - width: width, - height: height, + width: cnv.width, + height: cnv.height, bitrate: 5000000, framerate: 24 }; if (arg.codec.startsWith('avc1')) { - encoder_config.avc = { format: 'annexb' }; + encoder_config.avc = { format: "annexb" }; } let support = await VideoEncoder.isConfigSupported(encoder_config); if (!support.supported) { - TEST.log('Skipping unsupported codec: ' + arg.codec); + TEST.log("Skipping unsupported codec: " + arg.codec); return; } let decoder = new VideoDecoder({ output(frame) { frames_decoded++; + ctx.drawImage(frame, 0, 0); frame.close(); }, error(e) { @@ -68,34 +66,32 @@ let encoder = new VideoEncoder(encoder_init); encoder.configure(encoder_config); - let source = new CanvasSource(width, height); for (let i = 0; i < frames_to_encode; i++) { - let frame = await source.getNextFrame(); + let frame = await createFrame(cnv.width, cnv.height, i * 100); let keyframe = (i % 10 == 0); encoder.encode(frame, { keyFrame: keyframe }); frame.close(); - await waitForNextFrame(); + await delay(1); } await encoder.flush(); await decoder.flush(); encoder.close(); decoder.close(); - TEST.assert( - frames_encoded == frames_to_encode, - 'frames_encoded mismatch: ' + frames_encoded); - TEST.assert( - frames_decoded == frames_to_encode, - 'frames_decoded mismatch: ' + frames_decoded); - TEST.assert( - errors == 0, 'Decoding or encoding errors occurred during the test'); + TEST.assert(frames_encoded == frames_to_encode, + "frames_encoded mismatch: " + frames_encoded); + TEST.assert(frames_decoded == frames_to_encode, + "frames_decoded mismatch: " + frames_decoded); + TEST.assert(errors == 0, + "Decoding or encoding errors occurred during the test"); } </script> </head> <body> + <canvas id='display' width="640" height="480"></canvas> </body> </html> \ No newline at end of file
diff --git a/content/test/data/gpu/webcodecs/encode.html b/content/test/data/gpu/webcodecs/encode.html deleted file mode 100644 index 56c6701..0000000 --- a/content/test/data/gpu/webcodecs/encode.html +++ /dev/null
@@ -1,101 +0,0 @@ -<!DOCTYPE html> -<!-- -Take frames coming from various sources and check that: -- VideoEncoder can encode frames without resizing -- VideoEncoder can change bitrate and frame size -- VideoEncoder can encoder frames while resizing to the new width and height ---> -<html> - -<head> - <title>Encode test</title> - <script src="webcodecs_common.js"></script> - <script type="text/javascript"> - 'use strict'; - async function main(arg) { - const width = 640; - const height = 480; - const frames_in_one_pass = 15; - let source = await createFrameSource(arg.source_type, width, height); - if (!source) { - TEST.log('Skipping unsupported source: ' + arg.source_type); - return; - } - - let errors = 0; - let chunks = []; - let decoder_configs = []; - - const encoder_config = { - codec: arg.codec, - hardwareAcceleration: arg.acceleration, - width: width, - height: height, - bitrate: 1000000, - framerate: 24 - }; - - let support = await VideoEncoder.isConfigSupported(encoder_config); - if (!support.supported) { - TEST.log('Skipping unsupported codec: ' + arg.codec); - return; - } - - const init = { - output(chunk, metadata) { - if (metadata.decoderConfig) - decoder_configs.push(metadata.decoderConfig); - - chunks.push(chunk); - }, - error(e) { - errors++; - TEST.log(e); - } - }; - - let encoder = new VideoEncoder(init); - encoder.configure(encoder_config); - - for (let i = 0; i < frames_in_one_pass; i++) { - let frame = await source.getNextFrame(); - encoder.encode(frame, { keyFrame: false }); - frame.close(); - await waitForNextFrame(); - } - - TEST.log('First pass completed'); - - // Reconfigure on-the-fly - encoder_config.width += 100; - encoder_config.height += 100; - encoder_config.bitrate += encoder_config.bitrate / 2; - encoder.configure(encoder_config); - - for (let i = 0; i < frames_in_one_pass; i++) { - let frame = await source.getNextFrame(); - encoder.encode(frame, { keyFrame: false }); - frame.close(); - await waitForNextFrame(); - } - - await encoder.flush(); - encoder.close(); - - TEST.assert( - decoder_configs.length >= 2, - 'There should be 2 configs, for each configure()'); - - TEST.assert( - chunks.length == frames_in_one_pass * 2, - 'Output count mismatch: ' + chunks.length); - - TEST.assert(errors == 0, 'Encoding errors occurred during the test'); - } - </script> -</head> - -<body> -</body> - -</html> \ No newline at end of file
diff --git a/content/test/data/gpu/webcodecs/tex-image-2d.html b/content/test/data/gpu/webcodecs/tex-image-2d.html deleted file mode 100644 index 707d11a..0000000 --- a/content/test/data/gpu/webcodecs/tex-image-2d.html +++ /dev/null
@@ -1,103 +0,0 @@ -<!DOCTYPE html> -<!-- -Take frames coming from various sources and render them to a canvas with -WebGLRenderingContext.texImage2D(). ---> -<html> - -<head> - <title>texImage2D() test</title> - <script src="webcodecs_common.js"></script> - <script id="fragment-shader" type="glsl"> - uniform sampler2D tex; - - void main(void) { - mediump vec2 coord = vec2(gl_FragCoord.x/640.0, 1.0 - (gl_FragCoord.y/480.0)); - mediump vec4 sample = texture2D(tex, coord); - gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0); - } - </script> - - <script id="vertex-shader" type="glsl"> - attribute vec2 c; - void main(void) { - gl_Position=vec4(c, 0.0, 1.0); - } - </script> - <script type="text/javascript"> - 'use strict'; - async function main(arg) { - const frames_to_draw = 5; - let source_type = arg.source_type; - let canvas = document.getElementById('display'); - let source = - await createFrameSource(source_type, canvas.width, canvas.height); - if (!source) { - TEST.log('Skipping unsupported source: ' + source_type); - return; - } - - var gl = canvas.getContext('webgl2'); - gl.viewport(0, 0, canvas.width, canvas.height); - - const vs = gl.createShader(gl.VERTEX_SHADER); - gl.shaderSource(vs, document.getElementById('vertex-shader').innerText); - gl.compileShader(vs); - - const fs = gl.createShader(gl.FRAGMENT_SHADER); - gl.shaderSource(fs, document.getElementById('fragment-shader').innerText); - gl.compileShader(fs); - - if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) { - TEST.log(gl.getShaderInfoLog(fs)); - } - - const program = gl.createProgram(); - gl.attachShader(program, vs); - gl.attachShader(program, fs); - gl.linkProgram(program); - gl.useProgram(program); - - const vb = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, vb); - gl.bufferData( - gl.ARRAY_BUFFER, new Float32Array([-1, 1, -1, -1, 1, -1, 1, 1]), - gl.STATIC_DRAW); - - const coordLoc = gl.getAttribLocation(program, 'c'); - gl.vertexAttribPointer(coordLoc, 2, gl.FLOAT, false, 0, 0); - gl.enableVertexAttribArray(coordLoc); - - gl.clearColor(1, 1, 1, 1); - gl.clear(gl.COLOR_BUFFER_BIT); - - const tex = gl.createTexture(); - gl.bindTexture(gl.TEXTURE_2D, tex); - for (let i = 0; i < frames_to_draw; i++) { - let frame = await source.getNextFrame(); - - const format = gl.RGBA; - const srcFormat = gl.RGBA; - gl.texImage2D(gl.TEXTURE_2D, 0, format, format, gl.UNSIGNED_BYTE, frame); - gl.generateMipmap(gl.TEXTURE_2D); - - const texLoc = gl.getUniformLocation(program, 'tex'); - gl.uniform1i(texLoc, 0); - - gl.drawArrays(gl.TRIANGLE_FAN, 0, 4); - - frame.close(); - await waitForNextFrame(); - // TODO: Take snapshot of the canvas and compare it to the frame. - } - } - </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/webcodecs_common.js b/content/test/data/gpu/webcodecs/webcodecs_common.js index 571668a..252a097b 100644 --- a/content/test/data/gpu/webcodecs/webcodecs_common.js +++ b/content/test/data/gpu/webcodecs/webcodecs_common.js
@@ -4,42 +4,43 @@ "use strict"; -class TestHarness { - finished = false; - success = false; - message = 'ok'; - logs = []; +var TEST = { + finished: false, + success: false, + message: "ok", + logs: [], - constructor() {} - - reportSuccess() { + reportSuccess: function () { this.finished = true; this.success = true; - } + }, - reportFailure(error) { + reportFailure: function (error) { this.finished = true; this.success = false; this.message = error.toString(); this.log(this.message); - } + }, - assert(condition, msg) { + assert: function (condition, msg) { if (!condition) this.reportFailure("Assertion failed: " + msg); - } + }, - summary() { + summary: function () { return this.message + "\n\n" + this.logs.join("\n"); - } + }, - log(msg) { + log: function (msg) { this.logs.push(msg); console.log(msg); - } + }, - run(arg) { - main(arg).then( + run: function (arg) { + let p = main(arg); + + if (p) { + p.then( _ => { if (!this.finished) this.reportSuccess(); @@ -47,23 +48,21 @@ error => { if (!this.finished) this.reportFailure(error); - }); + } + ); + } } }; -var TEST = new TestHarness(); -function waitForNextFrame() { - return new Promise((resolve, _) => { - window.requestAnimationFrame(resolve); - }); -} +async function createFrame(width, height, ts) { + let canvas = new OffscreenCanvas(width, height); + let ctx = canvas.getContext('2d', { alpha: false }); -function drawRainbow(ctx, width, height, text) { let gradient = ctx.createLinearGradient(0, 0, width, height); gradient.addColorStop(0, 'magenta'); gradient.addColorStop(0.15, 'blue'); gradient.addColorStop(0.30, 'green'); - gradient.addColorStop(0.50, 'yellow'); + gradient.addColorStop(0.70, 'yellow'); gradient.addColorStop(0.85, 'orange'); gradient.addColorStop(1.0, 'red'); ctx.fillStyle = gradient; @@ -71,220 +70,13 @@ ctx.fillStyle = 'black'; ctx.font = (height / 4) + 'px fantasy'; - ctx.fillText(text, width / 3, height / 2); + ctx.fillText(ts.toString(), width / 2, height / 2); - ctx.lineWidth = 20; - ctx.strokeStyle = 'turquoise'; - ctx.rect(0, 0, width, height); - ctx.stroke(); + return new VideoFrame(canvas, { timestamp: ts }); } - -// Base class for video frame sources. -class FrameSource { - constructor() {} - - async getNextFrame() { - return null; - } -} - -// Source of video frames coming from taking snapshots of a canvas. -class CanvasSource extends FrameSource { - constructor(width, height) { - super(); - this.width = width; - this.height = height; - this.canvas = new OffscreenCanvas(width, height); - this.ctx = this.canvas.getContext('2d'); - this.timestamp = 0; - this.duration = 16666; // 1/60 s - } - - async getNextFrame() { - drawRainbow(this.ctx, this.width, this.height, this.timestamp.toString()); - let result = new VideoFrame(this.canvas, {timestamp: this.timestamp}); - this.timestamp += this.duration; - return result; - } -} - -// Source of video frames coming from MediaStreamTrack. -class StreamSource extends FrameSource { - constructor(track) { - super(); - this.media_processor = new MediaStreamTrackProcessor(track); - this.reader = this.media_processor.readable.getReader(); - } - - async getNextFrame() { - const result = await this.reader.read(); - const frame = result.value; - return frame; - } -} - -// Source of video frames coming from either hardware of software decoder. -class DecoderSource extends FrameSource { - constructor(decoderConfig, chunks) { - super(); - this.decoderConfig = decoderConfig; - this.chunks = chunks; - this.frames = []; - this.decoder = new VideoDecoder( - {error: this.onError.bind(this), output: this.onFrame.bind(this)}); - } - - onError(error) { - TEST.log(error); - if (this.next) - this.next.reject(error); - } - - onFrame(frame) { - if (this.next) { - this.next.resolve(frame); - this.next = null; - } else { - this.frames.push(frame); - } - } - - async getNextFrame() { - if (this.next) - return this.next.promise; - - if (this.decoder.state == 'unconfigured') - this.decoder.configure(this.decoderConfig); - - if (this.frames.length > 0) - return this.frames.shift(); - - if (this.chunks.length > 0) - this.decoder.decode(this.chunks.shift()); - - let next = {}; - this.next = next; - this.next.promise = new Promise((resolve, reject) => { - next.resolve = resolve; - next.reject = reject; - }); - - return this.next.promise; - } -} - -function createCanvasCaptureSource(width, height) { - let canvas = document.createElement('canvas'); - canvas.id = 'canvas-for-capture'; - canvas.width = width; - canvas.height = height; - document.body.appendChild(canvas); - - let ctx = canvas.getContext('2d'); - let drawOneFrame = function(time) { - drawRainbow(ctx, width, height, time.toString()); - window.requestAnimationFrame(drawOneFrame); - }; - window.requestAnimationFrame(drawOneFrame); - - const stream = canvas.captureStream(60); - const track = stream.getVideoTracks()[0]; - return new StreamSource(track); -} - -async function prepareDecoderSource( - frames_to_encode, width, height, codec, acceleration) { - if (!acceleration) - acceleration = 'allow'; - const encoder_config = { - codec: codec, - width: width, - height: height, - bitrate: 1000000, - framerate: 24 - }; - - if (codec.startsWith('avc1')) - encoder_config.avc = {format: 'annexb'}; - - let decoder_config = { - codec: codec, - codedWidth: width, - codedHeight: height, - visibleRegion: {left: 0, top: 0, width: width, height: height}, - hardwareAcceleration: acceleration - }; - - let support = await VideoDecoder.isConfigSupported(decoder_config); - if (!support.supported) - return null; - - let chunks = []; - let errors = 0; - const init = { - output(chunk, metadata) { - let config = metadata.decoderConfig; - if (config) { - decoder_config = config; - decoder_config.hardwareAcceleration = acceleration; - } - chunks.push(chunk); - }, - error(e) { - errors++; - TEST.log(e); - } - }; - - let encoder = new VideoEncoder(init); - encoder.configure(encoder_config); - let canvasSource = new CanvasSource(width, height); - - for (let i = 0; i < frames_to_encode; i++) { - let frame = await canvasSource.getNextFrame(); - encoder.encode(frame, {keyFrame: false}); - frame.close(); - } - await encoder.flush(); - if (errors > 0) - return null; - - return new DecoderSource(decoder_config, chunks); -} - -async function createFrameSource(type, width, height) { - switch (type) { - case 'camera': { - let constraints = {audio: false, video: {width: width, height: height}}; - let stream = - await window.navigator.mediaDevices.getUserMedia(constraints); - var track = stream.getTracks()[0]; - return new StreamSource(track); - } - case 'capture': { - return createCanvasCaptureSource(width, height); - } - case 'offscreen': { - return new CanvasSource(width, height); - } - case 'hw_decoder': { - // Trying to find any hardware decoder supported by the platform. - let src = - prepareDecoderSource(40, width, height, 'avc1.42001E', 'require'); - if (!src) - src = prepareDecoderSource(40, width, height, 'vp8', 'require'); - if (!src) { - src = - prepareDecoderSource(40, width, height, 'vp09.00.10.08', 'require'); - } - if (!src) { - TEST.log('Can\'t find a supported hardware decoder.'); - } - return src; - } - case 'sw_decoder': { - return prepareDecoderSource(40, width, height, 'vp8', 'deny'); - } - } -} \ No newline at end of file +function delay(time_ms) { + return new Promise((resolve, reject) => { + setTimeout(resolve, time_ms); + }); +}; \ No newline at end of file
diff --git a/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt index c580654f..adf4dad 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webcodecs_expectations.txt
@@ -57,14 +57,3 @@ # tags: [ display-server-wayland display-server-x ] # results: [ Failure RetryOnFailure Skip ] # END TAG HEADER - -# crbug.com/1204831: VideoEncoder on CrOS kevin can't resize frames, except for -# frames coming from a camera. -crbug.com/1204831 [ chromeos-board-kevin ] WebCodecs_Encode_offscreen_vp8_require [ Failure ] -crbug.com/1204831 [ chromeos-board-kevin ] WebCodecs_Encode_offscreen_avc1.42001E_require [ Failure ] -crbug.com/1204831 [ chromeos-board-kevin ] WebCodecs_Encode_sw_decoder_vp8_require [ Failure ] -crbug.com/1204831 [ chromeos-board-kevin ] WebCodecs_Encode_sw_decoder_avc1.42001E_require [ Failure ] -crbug.com/1204831 [ chromeos-board-kevin ] WebCodecs_Encode_hw_decoder_vp8_require [ Failure ] -crbug.com/1204831 [ chromeos-board-kevin ] WebCodecs_Encode_hw_decoder_avc1.42001E_require [ Failure ] -crbug.com/1204831 [ chromeos-board-kevin ] WebCodecs_Encode_capture_vp8_require [ Failure ] -crbug.com/1204831 [ chromeos-board-kevin ] WebCodecs_Encode_capture_avc1.42001E_require [ Failure ]
diff --git a/content/test/gpu/gpu_tests/webcodecs_integration_test.py b/content/test/gpu/gpu_tests/webcodecs_integration_test.py index 5a8fee8..6c42350 100644 --- a/content/test/gpu/gpu_tests/webcodecs_integration_test.py +++ b/content/test/gpu/gpu_tests/webcodecs_integration_test.py
@@ -9,13 +9,8 @@ from gpu_tests import gpu_integration_test from gpu_tests import path_util -html_path = os.path.join(path_util.GetChromiumSrcDir(), 'content', 'test', +data_path = os.path.join(path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu', 'webcodecs') -data_path = os.path.join(path_util.GetChromiumSrcDir(), 'media', 'test', 'data') - -frame_sources = ["camera", "capture", "offscreen", "hw_decoder", "sw_decoder"] -codecs = ["avc1.42001E", "vp8", "vp09.00.10.08"] -accelerations = ["require", "deny"] class WebCodecsIntegrationTest(gpu_integration_test.GpuIntegrationTest): @@ -25,26 +20,15 @@ @classmethod def GenerateGpuTests(cls, options): - for source_type in frame_sources: - yield ('WebCodecs_DrawImage_' + source_type, 'draw-image.html', - ('{ source_type : "%s" }' % (source_type))) - yield ('WebCodecs_TexImage2d_' + source_type, 'tex-image-2d.html', - ('{ source_type : "%s" }' % (source_type))) - - for codec in codecs: - yield ('WebCodecs_EncodeDecode_' + codec, 'encode-decode.html', - ('{ codec : "%s" }' % codec)) - - for source_type in frame_sources: - for codec in codecs: - for acc in accelerations: - args = (source_type, codec, acc) - yield ('WebCodecs_Encode_%s_%s_%s' % args, 'encode.html', - ('{ source_type : "%s", codec : "%s", acceleration : "%s" }' % - args)) + yield ('WebCodecs_EncodeDecodeRender_h264_baseline', + 'encode-decode-render.html', ('{ codec : "avc1.42001E" }')) + yield ('WebCodecs_EncodeDecodeRender_vp8', 'encode-decode-render.html', + ('{ codec : "vp8" }')) + yield ('WebCodecs_EncodeDecodeRender_vp9', 'encode-decode-render.html', + ('{ codec : "vp09.00.10.08" }')) def RunActualGpuTest(self, test_path, *args): - url = self.UrlOfStaticFilePath(html_path + '/' + test_path) + url = self.UrlOfStaticFilePath(test_path) tab = self.tab arg_obj = args[0] tab.Navigate(url) @@ -58,14 +42,9 @@ @classmethod def SetUpProcess(cls): super(WebCodecsIntegrationTest, cls).SetUpProcess() - cls.CustomizeBrowserArgs([ - "--enable-blink-features=MediaStreamInsertableStreams", - '--enable-blink-features=WebCodecs', - '--use-fake-device-for-media-stream', - '--use-fake-ui-for-media-stream', - ]) + cls.CustomizeBrowserArgs(['--enable-blink-features=WebCodecs']) cls.StartBrowser() - cls.SetStaticServerDirs([html_path, data_path]) + cls.SetStaticServerDirs([data_path]) @classmethod def ExpectationsFiles(cls):
diff --git a/content/web_test/browser/web_test_browser_main_runner.cc b/content/web_test/browser/web_test_browser_main_runner.cc index 312324b7..0ade439 100644 --- a/content/web_test/browser/web_test_browser_main_runner.cc +++ b/content/web_test/browser/web_test_browser_main_runner.cc
@@ -148,6 +148,9 @@ if (!command_line.HasSwitch(switches::kUseGpuInTests) && !command_line.HasSwitch(switches::kUseGL)) { bool legacy_software_gl = true; +#if (defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_FUCHSIA)) + legacy_software_gl = false; +#endif gl::SetSoftwareGLCommandLineSwitches(&command_line, legacy_software_gl); } command_line.AppendSwitchASCII(switches::kTouchEventFeatureDetection,
diff --git a/device/fido/fido_device_authenticator.cc b/device/fido/fido_device_authenticator.cc index c5bbca5..ea520845 100644 --- a/device/fido/fido_device_authenticator.cc +++ b/device/fido/fido_device_authenticator.cc
@@ -115,7 +115,7 @@ if (!request.pin_auth && options_->user_verification_availability == UserVerificationAvailability::kSupportedAndConfigured && - !request.is_u2f_only) { + !options_->make_cred_uv_not_required && !request.is_u2f_only) { request.user_verification = UserVerificationRequirement::kRequired; } else { request.user_verification = UserVerificationRequirement::kDiscouraged;
diff --git a/device/vr/android/arcore/ar_compositor_frame_sink.cc b/device/vr/android/arcore/ar_compositor_frame_sink.cc index a54b3b09..f3c435d 100644 --- a/device/vr/android/arcore/ar_compositor_frame_sink.cc +++ b/device/vr/android/arcore/ar_compositor_frame_sink.cc
@@ -357,7 +357,13 @@ // First the DOM, if it's enabled if (should_composite_dom_overlay_) { auto dom_surface_id = xr_frame_sink_client_->GetDOMSurface(); - if (dom_surface_id && dom_surface_id->is_valid()) { + bool can_composite_dom_overlay = + dom_surface_id && dom_surface_id->is_valid(); + DVLOG(3) + << __func__ + << " Attempting to composite DOMOverlay, can_composite_dom_overlay=" + << can_composite_dom_overlay; + if (can_composite_dom_overlay) { viz::SharedQuadState* dom_quad_state = render_pass->CreateAndAppendSharedQuadState(); dom_quad_state->SetAll(
diff --git a/device/vr/android/arcore/arcore_gl.cc b/device/vr/android/arcore/arcore_gl.cc index 6eee07b..bda6598 100644 --- a/device/vr/android/arcore/arcore_gl.cc +++ b/device/vr/android/arcore/arcore_gl.cc
@@ -1654,7 +1654,9 @@ } // Save the touch point for use in Blink's XR input event deduplication. - state->overlay_pointer_position = screen_last_touch; + if (IsFeatureEnabled(device::mojom::XRSessionFeature::DOM_OVERLAY)) { + state->overlay_pointer_position = screen_last_touch; + } state->description = device::mojom::XRInputSourceDescription::New();
diff --git a/docs/security/good-bad-ipc.png b/docs/security/good-bad-ipc.png new file mode 100644 index 0000000..563ab52 --- /dev/null +++ b/docs/security/good-bad-ipc.png Binary files differ
diff --git a/docs/security/handling-messages-from-web-content.md b/docs/security/handling-messages-from-web-content.md new file mode 100644 index 0000000..d569305 --- /dev/null +++ b/docs/security/handling-messages-from-web-content.md
@@ -0,0 +1,47 @@ +# The browser process should not handle messages from web content + + + +(drawing source +[here](https://docs.google.com/drawings/d/1SmqvOvLY_DnDxeJHKQRB3rACO0aVSHpyfTycV2v1P1w/edit?usp=sharing)) + +Sometimes features are proposed in which the Chrome user interface (in the +browser process) handles messages directly from web content (JavaScript, HTML +etc.). For example, this could be done using the `postMessage` APIs which have +been put in place for Android WebView apps. This is not allowed, because: + +* Overall system security relies on simple and predictable security properties. + Adding extra message channels causes complexity, non-discoverability and + non-predictability. +* Chrome's security strategy relies on isolating web content using sandboxed + renderer processes and site isolation. Any communication outside of that + renderer process presents a risk of a sandbox escape. All such communication + has to be via Mojo such that the `mojom` interface definition files go through + our [IPC security review process](mojo.md) (and will benefit from other future + Mojo security improvements). +* Websites are untrustworthy. TLS can’t guarantee the provenance of a website — + even pinning has limits — and so you must assume any messages from websites + are malicious. Processing such messages in the browser process in C++ is + likely a violation of the [Rule of Two](rule-of-2.md) and is extremely + dangerous. +* Even if you can comply with the Rule of Two (for example by using a safe + language) it's simply difficult to produce robust APIs that are safe against + malicious data: the open web platform [API review + process](https://www.chromium.org/blink/launching-features) is designed to + flush out any concerns. Any APIs or functionality accessible to web content + therefore needs to go via that process to give the best chance of spotting + danger. +* There are non-security concerns: It does not comply with the spirit of an open + web platform which should be equally available on all user agents. + +In order to support WebView, WebLayer, and CCT, APIs exist in Chrome to +establish web message channels between the embedding application and web page. +These exist only to support these "embedding the web" scenarios, which are often +used to build site- or purpose-specific browsers. General browser features +should not use them because of the reasons stated above. + +Other mechanisms of bypassing normal processes might include exposing unreviewed +APIs to a component extension, and making its APIs available to web content. +These are similarly not allowed.
diff --git a/extensions/browser/api/storage/BUILD.gn b/extensions/browser/api/storage/BUILD.gn index 71ac06a..7760d5b7 100644 --- a/extensions/browser/api/storage/BUILD.gn +++ b/extensions/browser/api/storage/BUILD.gn
@@ -20,6 +20,8 @@ "settings_storage_quota_enforcer.h", "storage_api.cc", "storage_api.h", + "storage_area_namespace.cc", + "storage_area_namespace.h", "storage_frontend.cc", "storage_frontend.h", "value_store_cache.cc",
diff --git a/extensions/browser/api/storage/settings_observer.h b/extensions/browser/api/storage/settings_observer.h index b5dfb2d..968ef0b 100644 --- a/extensions/browser/api/storage/settings_observer.h +++ b/extensions/browser/api/storage/settings_observer.h
@@ -7,18 +7,18 @@ #include "base/observer_list_threadsafe.h" #include "base/values.h" -#include "extensions/browser/value_store/settings_namespace.h" namespace extensions { +enum class StorageAreaNamespace; + // Interface for classes that listen to changes to extension settings. class SettingsObserver { public: // Called when a list of settings have changed for an extension. - virtual void OnSettingsChanged( - const std::string& extension_id, - settings_namespace::Namespace settings_namespace, - const base::Value& changes) = 0; + virtual void OnSettingsChanged(const std::string& extension_id, + StorageAreaNamespace storage_area, + const base::Value& changes) = 0; virtual ~SettingsObserver() {} };
diff --git a/extensions/browser/api/storage/storage_api.cc b/extensions/browser/api/storage/storage_api.cc index ee06084c..9d39ef6 100644 --- a/extensions/browser/api/storage/storage_api.cc +++ b/extensions/browser/api/storage/storage_api.cc
@@ -26,11 +26,6 @@ namespace { -constexpr char kLocalString[] = "local"; -constexpr char kSyncString[] = "sync"; -constexpr char kManagedString[] = "managed"; -constexpr char kSessionString[] = "session"; - // Adds all StringValues from a ListValue to a vector of strings. void AddAllStringValues(const base::ListValue& from, std::vector<std::string>* to) { @@ -71,40 +66,6 @@ "MAX_WRITE_OPERATIONS_PER_HOUR")); } -// Returns the settings namespace of `storage_area`, or `Namespace::INVALID` if -// the StorageArea doesn't map to one. -settings_namespace::Namespace StorageAreaToSettingsNamespace( - StorageAreaNamespace storage_area) { - switch (storage_area) { - case StorageAreaNamespace::kLocal: - return settings_namespace::LOCAL; - case StorageAreaNamespace::kSync: - return settings_namespace::SYNC; - case StorageAreaNamespace::kManaged: - return settings_namespace::MANAGED; - case StorageAreaNamespace::kSession: - return settings_namespace::INVALID; - case StorageAreaNamespace::kInvalid: - NOTREACHED(); - return settings_namespace::INVALID; - } -} - -// Returns the StorageArea of `storage_area_string`, or -// `StorageAreaNamespace::kInvalid` if the string doesn't map to one. -StorageAreaNamespace StorageAreaFromString( - const std::string& storage_area_string) { - if (storage_area_string == kLocalString) - return StorageAreaNamespace::kLocal; - if (storage_area_string == kSyncString) - return StorageAreaNamespace::kSync; - if (storage_area_string == kManagedString) - return StorageAreaNamespace::kManaged; - if (storage_area_string == kSessionString) - return StorageAreaNamespace::kSession; - return StorageAreaNamespace::kInvalid; -} - } // namespace // SettingsFunction @@ -121,7 +82,8 @@ // to signify that from this function. It will be caught in Run(). return false; } - return storage_area_string != kSyncString; + return StorageAreaFromString(storage_area_string) != + StorageAreaNamespace::kSync; } ExtensionFunction::ResponseAction SettingsFunction::Run() { @@ -189,7 +151,7 @@ if (!result.changes().empty()) { observers_->Notify(FROM_HERE, &SettingsObserver::OnSettingsChanged, - extension_id(), settings_namespace_, + extension_id(), storage_area_, ValueStoreChange::ToValue(result.PassChanges())); }
diff --git a/extensions/browser/api/storage/storage_api.h b/extensions/browser/api/storage/storage_api.h index 547afeae..169bff1b 100644 --- a/extensions/browser/api/storage/storage_api.h +++ b/extensions/browser/api/storage/storage_api.h
@@ -10,21 +10,13 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "extensions/browser/api/storage/settings_observer.h" +#include "extensions/browser/api/storage/storage_area_namespace.h" #include "extensions/browser/extension_function.h" #include "extensions/browser/value_store/settings_namespace.h" #include "extensions/browser/value_store/value_store.h" namespace extensions { -// Enumerates all the namespaces of the storage areas. -enum class StorageAreaNamespace { - kLocal, // "local" i.e. chrome.storage.local - kSync, // "sync" i.e. chrome.storage.sync - kManaged, // "managed" i.e. chrome.storage.managed - kSession, // "session" i.e. chrome.storage.session - kInvalid, -}; - // Superclass of all settings functions. class SettingsFunction : public ExtensionFunction { protected:
diff --git a/extensions/browser/api/storage/storage_area_namespace.cc b/extensions/browser/api/storage/storage_area_namespace.cc new file mode 100644 index 0000000..cfb86aa --- /dev/null +++ b/extensions/browser/api/storage/storage_area_namespace.cc
@@ -0,0 +1,64 @@ +// 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. + +#include "extensions/browser/api/storage/storage_area_namespace.h" + +#include "base/notreached.h" + +namespace extensions { + +namespace { +constexpr char kLocalString[] = "local"; +constexpr char kSyncString[] = "sync"; +constexpr char kManagedString[] = "managed"; +constexpr char kSessionString[] = "session"; +} // namespace + +const char* StorageAreaToString(StorageAreaNamespace storage_area) { + switch (storage_area) { + case StorageAreaNamespace::kLocal: + return kLocalString; + case StorageAreaNamespace::kSync: + return kSyncString; + case StorageAreaNamespace::kManaged: + return kManagedString; + case StorageAreaNamespace::kSession: + return kSessionString; + case StorageAreaNamespace::kInvalid: + NOTREACHED(); + return ""; + } +} + +settings_namespace::Namespace StorageAreaToSettingsNamespace( + StorageAreaNamespace storage_area) { + switch (storage_area) { + case StorageAreaNamespace::kLocal: + return settings_namespace::LOCAL; + case StorageAreaNamespace::kSync: + return settings_namespace::SYNC; + case StorageAreaNamespace::kManaged: + return settings_namespace::MANAGED; + case StorageAreaNamespace::kSession: + return settings_namespace::INVALID; + case StorageAreaNamespace::kInvalid: + NOTREACHED(); + return settings_namespace::INVALID; + } +} + +StorageAreaNamespace StorageAreaFromString( + const std::string& storage_area_string) { + if (storage_area_string == kLocalString) + return StorageAreaNamespace::kLocal; + if (storage_area_string == kSyncString) + return StorageAreaNamespace::kSync; + if (storage_area_string == kManagedString) + return StorageAreaNamespace::kManaged; + if (storage_area_string == kSessionString) + return StorageAreaNamespace::kSession; + return StorageAreaNamespace::kInvalid; +} + +} // namespace extensions
diff --git a/extensions/browser/api/storage/storage_area_namespace.h b/extensions/browser/api/storage/storage_area_namespace.h new file mode 100644 index 0000000..e8dfe3b --- /dev/null +++ b/extensions/browser/api/storage/storage_area_namespace.h
@@ -0,0 +1,39 @@ +// 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. + +#ifndef EXTENSIONS_BROWSER_API_STORAGE_STORAGE_AREA_NAMESPACE_H_ +#define EXTENSIONS_BROWSER_API_STORAGE_STORAGE_AREA_NAMESPACE_H_ + +#include <string> + +#include "extensions/browser/value_store/settings_namespace.h" + +namespace extensions { + +// Enumerates all the namespaces of the storage areas. +enum class StorageAreaNamespace { + kLocal, // "local" i.e. chrome.storage.local + kSync, // "sync" i.e. chrome.storage.sync + kManaged, // "managed" i.e. chrome.storage.managed + kSession, // "session" i.e. chrome.storage.session + kInvalid, +}; + +// Returns the string representation of `storage_area`, or an empty string if +// it doesn't map to one. +const char* StorageAreaToString(StorageAreaNamespace storage_area); + +// Returns the settings namespace of `storage_area`, or `Namespace::INVALID` if +// the StorageArea doesn't map to one. +settings_namespace::Namespace StorageAreaToSettingsNamespace( + StorageAreaNamespace storage_area); + +// Returns the StorageArea of `storage_area_string`, or +// `StorageAreaNamespace::kInvalid` if the string doesn't map to one. +StorageAreaNamespace StorageAreaFromString( + const std::string& storage_area_string); + +} // namespace extensions + +#endif // EXTENSIONS_BROWSER_API_STORAGE_STORAGE_AREA_NAMESPACE_H_
diff --git a/extensions/browser/api/storage/storage_frontend.cc b/extensions/browser/api/storage/storage_frontend.cc index 4e697025..866fb1c 100644 --- a/extensions/browser/api/storage/storage_frontend.cc +++ b/extensions/browser/api/storage/storage_frontend.cc
@@ -21,6 +21,7 @@ #include "extensions/browser/api/extensions_api_client.h" #include "extensions/browser/api/storage/backend_task_runner.h" #include "extensions/browser/api/storage/local_value_store_cache.h" +#include "extensions/browser/api/storage/storage_area_namespace.h" #include "extensions/browser/event_router.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_system.h" @@ -37,16 +38,20 @@ base::LazyInstance<BrowserContextKeyedAPIFactory<StorageFrontend>>:: DestructorAtExit g_factory = LAZY_INSTANCE_INITIALIZER; -events::HistogramValue NamespaceToEventHistogram( - settings_namespace::Namespace settings_namespace) { - switch (settings_namespace) { - case settings_namespace::LOCAL: +events::HistogramValue StorageAreaToEventHistogram( + StorageAreaNamespace storage_area) { + switch (storage_area) { + case StorageAreaNamespace::kLocal: return events::STORAGE_LOCAL_ON_CHANGE; - case settings_namespace::SYNC: + case StorageAreaNamespace::kSync: return events::STORAGE_SYNC_ON_CHANGE; - case settings_namespace::MANAGED: + case StorageAreaNamespace::kManaged: return events::STORAGE_MANAGED_ON_CHANGE; - case settings_namespace::INVALID: + case StorageAreaNamespace::kSession: + // TODO(emiliapaz): Update after onChangedEvent is implemented for + // `session`. + break; + case StorageAreaNamespace::kInvalid: break; } NOTREACHED(); @@ -62,7 +67,7 @@ // SettingsObserver implementation. void OnSettingsChanged(const std::string& extension_id, - settings_namespace::Namespace settings_namespace, + StorageAreaNamespace storage_area, const base::Value& changes) override { TRACE_EVENT1("browser", "SettingsObserver:OnSettingsChanged", "extension_id", extension_id); @@ -75,8 +80,7 @@ base::size(extension_id_str)); base::debug::Alias(extension_id_str); - const std::string namespace_string = - settings_namespace::ToString(settings_namespace); + const std::string namespace_string = StorageAreaToString(storage_area); EventRouter* event_router = EventRouter::Get(browser_context_); // We only dispatch the events if there's a valid listener (even though @@ -102,7 +106,7 @@ auto args = std::make_unique<base::ListValue>(); args->Append(changes.Clone()); auto event = - std::make_unique<Event>(NamespaceToEventHistogram(settings_namespace), + std::make_unique<Event>(StorageAreaToEventHistogram(storage_area), area_event_name, std::move(args)); event_router->DispatchEventToExtension(extension_id, std::move(event)); }
diff --git a/extensions/browser/extension_event_histogram_value.h b/extensions/browser/extension_event_histogram_value.h index 91fb437..2f5f048 100644 --- a/extensions/browser/extension_event_histogram_value.h +++ b/extensions/browser/extension_event_histogram_value.h
@@ -496,6 +496,7 @@ TAB_GROUPS_ON_UPDATED = 474, FILE_MANAGER_PRIVATE_ON_DRIVE_CONFIRM_DIALOG = 475, TTS_ENGINE_ON_SPEAK_WITH_AUDIO_STREAM = 476, + ACCESSIBILITY_PRIVATE_ON_SHOW_CHROMEVOX_TUTORIAL = 477, // Last entry: Add new entries above, then run: // python tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h index 486b778f..4862c44 100644 --- a/extensions/browser/extension_function.h +++ b/extensions/browser/extension_function.h
@@ -416,7 +416,7 @@ // this return value in those cases. // // FooExtensionFunction::Run() { - // Helper::FetchResults(..., base::Bind(&Success)); + // Helper::FetchResults(..., base::BindOnce(&Success)); // if (did_respond()) return AlreadyResponded(); // return RespondLater(); // } @@ -424,9 +424,9 @@ // Respond(...); // } // - // Helper::FetchResults(..., callback) { + // Helper::FetchResults(..., base::OnceCallback callback) { // if (...) - // callback.Run(..); // Synchronously call |callback|. + // std::move(callback).Run(..); // Synchronously call |callback|. // else // // Asynchronously call |callback|. // }
diff --git a/extensions/browser/extension_pref_store.cc b/extensions/browser/extension_pref_store.cc index ff530d3..5ab49cc 100644 --- a/extensions/browser/extension_pref_store.cc +++ b/extensions/browser/extension_pref_store.cc
@@ -24,7 +24,7 @@ const base::Value* winner = extension_pref_value_map_->GetEffectivePrefValue( key, incognito_pref_store_, nullptr); if (winner) { - SetValue(key, winner->CreateDeepCopy(), + SetValue(key, base::Value::ToUniquePtrValue(winner->Clone()), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); } else { RemoveValue(key, WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
diff --git a/extensions/browser/extension_util.cc b/extensions/browser/extension_util.cc index 5e96e76..0143283 100644 --- a/extensions/browser/extension_util.cc +++ b/extensions/browser/extension_util.cc
@@ -58,13 +58,8 @@ // profile if the extension is actually allowed to run in an incognito // profile (not just by the extension manifest, but also by user // preferences). - if (browser_context->IsOffTheRecord()) { - // TODO(lukasza): Change to util::IsIncognitoEnabled if possible. This - // fails today in All/IncognitoCommandsApiTest.IncognitoMode/0 apparently - // because ExtensionPrefs::IsIncognitoEnabled return `false` and - // ExtensionPrefs::SetIsIncognitoEnabled(..., true) is never called. - DCHECK(IncognitoInfo::IsIncognitoAllowed(&extension)); - } + if (browser_context->IsOffTheRecord()) + DCHECK(IsIncognitoEnabled(extension.id(), browser_context)); content::CorsOriginPatternSetter::Set( browser_context, extension.origin(), mojo::Clone(allow_patterns),
diff --git a/extensions/browser/value_store/testing_value_store.cc b/extensions/browser/value_store/testing_value_store.cc index ea93d5f..06ba4f6 100644 --- a/extensions/browser/value_store/testing_value_store.cc +++ b/extensions/browser/value_store/testing_value_store.cc
@@ -62,7 +62,8 @@ for (auto it = keys.cbegin(); it != keys.cend(); ++it) { base::Value* value = NULL; if (storage_.GetWithoutPathExpansion(*it, &value)) { - settings->SetWithoutPathExpansion(*it, value->CreateDeepCopy()); + settings->SetWithoutPathExpansion( + *it, base::Value::ToUniquePtrValue(value->Clone())); } } return ReadResult(std::move(settings), CreateStatusCopy(status_)); @@ -78,7 +79,8 @@ ValueStore::WriteResult TestingValueStore::Set( WriteOptions options, const std::string& key, const base::Value& value) { base::DictionaryValue settings; - settings.SetWithoutPathExpansion(key, value.CreateDeepCopy()); + settings.SetWithoutPathExpansion( + key, base::Value::ToUniquePtrValue(value.Clone())); return Set(options, settings); } @@ -99,7 +101,8 @@ ? base::Optional<base::Value>(old_value->Clone()) : base::nullopt, it.value().Clone()); - storage_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy()); + storage_.SetWithoutPathExpansion( + it.key(), base::Value::ToUniquePtrValue(it.value().Clone())); } } return WriteResult(std::move(changes), CreateStatusCopy(status_));
diff --git a/extensions/common/api/requirements.json b/extensions/common/api/requirements.json new file mode 100644 index 0000000..6e4e9f9 --- /dev/null +++ b/extensions/common/api/requirements.json
@@ -0,0 +1,59 @@ +// 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. + +[ + { + "namespace": "requirements", + "description": "Stub namepsace for the 'requirements' manifest key.", + "compiler_options": { + "generate_error_messages": true + }, + "types": [ + { + "id": "3DFeature", + "type": "string", + "enum": ["webgl", "css3d"] + } + ], + "manifest_keys": { + "requirements": { + "type": "object", + "optional": true, + "properties": { + "plugins": { + "type": "object", + "optional": true, + "deprecated": true, + "properties": { + "npapi": { + "type": "boolean", + "optional": true + } + } + }, + "3D": { + "type": "object", + "optional": true, + "properties": { + "features": { + "type": "array", + "items": { "$ref": "3DFeature" } + } + } + }, + "window": { + "type": "object", + "optional": true, + "properties": { + "shape": { + "type": "boolean", + "optional": true + } + } + } + } + } + } + } +]
diff --git a/extensions/common/api/schema.gni b/extensions/common/api/schema.gni index 9b060d74..b4cedcfc 100644 --- a/extensions/common/api/schema.gni +++ b/extensions/common/api/schema.gni
@@ -62,6 +62,7 @@ "content_scripts.idl", "extensions_manifest_types.json", "incognito.json", + "requirements.json", "shared_module.idl", "web_accessible_resources.idl", "web_accessible_resources_mv2.idl",
diff --git a/extensions/common/manifest_constants.cc b/extensions/common/manifest_constants.cc index d370fbc..681fa61 100644 --- a/extensions/common/manifest_constants.cc +++ b/extensions/common/manifest_constants.cc
@@ -123,7 +123,6 @@ const char kRemoveButton[] = "remove_button"; const char kReplacementAndroidApp[] = "replacement_android_app"; const char kReplacementWebApp[] = "replacement_web_app"; -const char kRequirements[] = "requirements"; const char kSandboxedPages[] = "sandbox.pages"; const char kSandboxedPagesCSP[] = "sandbox.content_security_policy"; const char kSettingsOverride[] = "chrome_settings_overrides"; @@ -553,10 +552,6 @@ "Invalid value for 'replacement_android_app'"; const char kInvalidReplacementWebApp[] = "Invalid value for 'replacement_web_app'."; -const char kInvalidRequirement[] = - "Invalid value for requirement \"*\""; -const char kInvalidRequirements[] = - "Invalid value for 'requirements'"; const char kInvalidRulesetID[] = "'*.*': Invalid 'id' specified for Ruleset at index *. The ID must be " "non-empty, unique and must not start with '_'.";
diff --git a/extensions/common/manifest_constants.h b/extensions/common/manifest_constants.h index b42da5be..ecfb4641 100644 --- a/extensions/common/manifest_constants.h +++ b/extensions/common/manifest_constants.h
@@ -126,7 +126,6 @@ extern const char kRemoveButton[]; extern const char kReplacementAndroidApp[]; extern const char kReplacementWebApp[]; -extern const char kRequirements[]; extern const char kSandboxedPages[]; extern const char kSandboxedPagesCSP[]; extern const char kSettingsOverride[]; @@ -395,8 +394,6 @@ extern const char kInvalidPermissionWithDetail[]; extern const char kInvalidReplacementAndroidApp[]; extern const char kInvalidReplacementWebApp[]; -extern const char kInvalidRequirement[]; -extern const char kInvalidRequirements[]; extern const char kInvalidRulesetID[]; extern const char kInvalidSandboxedPagesList[]; extern const char kInvalidSandboxedPage[];
diff --git a/extensions/common/manifest_handlers/requirements_info.cc b/extensions/common/manifest_handlers/requirements_info.cc index 242d0f5..a362b1e 100644 --- a/extensions/common/manifest_handlers/requirements_info.cc +++ b/extensions/common/manifest_handlers/requirements_info.cc
@@ -6,28 +6,26 @@ #include <memory> -#include "base/lazy_instance.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "extensions/common/api/requirements.h" #include "extensions/common/error_utils.h" #include "extensions/common/manifest_constants.h" namespace extensions { -namespace keys = manifest_keys; namespace errors = manifest_errors; -RequirementsInfo::RequirementsInfo(const Manifest* manifest) - : webgl(false), window_shape(false) {} +using ManifestKeys = api::requirements::ManifestKeys; -RequirementsInfo::~RequirementsInfo() { -} +RequirementsInfo::RequirementsInfo() = default; +RequirementsInfo::~RequirementsInfo() = default; // static const RequirementsInfo& RequirementsInfo::GetRequirements( const Extension* extension) { RequirementsInfo* info = static_cast<RequirementsInfo*>( - extension->GetManifestData(keys::kRequirements)); + extension->GetManifestData(ManifestKeys::kRequirements)); // We should be guaranteed to have requirements, since they are parsed for all // extension types. @@ -35,14 +33,11 @@ return *info; } -RequirementsHandler::RequirementsHandler() { -} - -RequirementsHandler::~RequirementsHandler() { -} +RequirementsHandler::RequirementsHandler() = default; +RequirementsHandler::~RequirementsHandler() = default; base::span<const char* const> RequirementsHandler::Keys() const { - static constexpr const char* kKeys[] = {keys::kRequirements}; + static constexpr const char* kKeys[] = {ManifestKeys::kRequirements}; return kKeys; } @@ -51,85 +46,44 @@ } bool RequirementsHandler::Parse(Extension* extension, std::u16string* error) { - std::unique_ptr<RequirementsInfo> requirements( - new RequirementsInfo(extension->manifest())); - - if (!extension->manifest()->HasKey(keys::kRequirements)) { - extension->SetManifestData(keys::kRequirements, std::move(requirements)); - return true; - } - - const base::Value* requirements_value = nullptr; - if (!extension->manifest()->GetDictionary(keys::kRequirements, - &requirements_value)) { - *error = base::ASCIIToUTF16(errors::kInvalidRequirements); + ManifestKeys manifest_keys; + if (!ManifestKeys::ParseFromDictionary( + extension->manifest()->available_values(), &manifest_keys, error)) { return false; } - for (const auto& entry : requirements_value->DictItems()) { - if (!entry.second.is_dict()) { - *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidRequirement, - entry.first); - return false; - } - const base::Value& requirement_value = entry.second; + auto requirements_info = std::make_unique<RequirementsInfo>(); + if (!manifest_keys.requirements) { + extension->SetManifestData(ManifestKeys::kRequirements, + std::move(requirements_info)); + return true; + } - // The plugins requirement is deprecated. Raise an install warning. If the - // extension explicitly requires npapi plugins, raise an error. - if (entry.first == "plugins") { - extension->AddInstallWarning( - InstallWarning(errors::kPluginsRequirementDeprecated)); - const base::Value* npapi_requirement = - requirement_value.FindKeyOfType("npapi", base::Value::Type::BOOLEAN); - if (npapi_requirement != nullptr && npapi_requirement->GetBool()) { - *error = base::ASCIIToUTF16(errors::kNPAPIPluginsNotSupported); - return false; - } - } else if (entry.first == "3D") { - const base::Value* features = - requirement_value.FindKeyOfType("features", base::Value::Type::LIST); - if (features == nullptr) { - *error = ErrorUtils::FormatErrorMessageUTF16( - errors::kInvalidRequirement, entry.first); - return false; - } + const auto& requirements = *manifest_keys.requirements; - for (const auto& feature : features->GetList()) { - if (!feature.is_string()) - continue; - if (feature.GetString() == "webgl") { - requirements->webgl = true; - } else if (feature.GetString() == "css3d") { - // css3d is always available, so no check is needed, but no error is - // generated. - } else { - *error = ErrorUtils::FormatErrorMessageUTF16( - errors::kInvalidRequirement, entry.first); - return false; - } - } - } else if (entry.first == "window") { - for (const auto& feature : requirement_value.DictItems()) { - if (!feature.second.is_bool()) { - *error = ErrorUtils::FormatErrorMessageUTF16( - errors::kInvalidRequirement, entry.first); - return false; - } - if (feature.first == "shape") { - requirements->window_shape = feature.second.GetBool(); - } else { - *error = ErrorUtils::FormatErrorMessageUTF16( - errors::kInvalidRequirement, entry.first); - return false; - } - } - } else { - *error = base::ASCIIToUTF16(errors::kInvalidRequirements); + // The plugins requirement is deprecated. Raise an install warning. If the + // extension explicitly requires npapi plugins, raise an error. + if (requirements.plugins) { + extension->AddInstallWarning( + InstallWarning(errors::kPluginsRequirementDeprecated)); + if (requirements.plugins->npapi && *requirements.plugins->npapi) { + *error = base::ASCIIToUTF16(errors::kNPAPIPluginsNotSupported); return false; } } - extension->SetManifestData(keys::kRequirements, std::move(requirements)); + if (requirements._3d) { + // css3d is always available, so no check is needed, but no error is + // generated. + requirements_info->webgl = base::Contains( + requirements._3d->features, api::requirements::_3D_FEATURE_WEBGL); + } + + if (requirements.window && requirements.window->shape) + requirements_info->window_shape = *requirements.window->shape; + + extension->SetManifestData(ManifestKeys::kRequirements, + std::move(requirements_info)); return true; }
diff --git a/extensions/common/manifest_handlers/requirements_info.h b/extensions/common/manifest_handlers/requirements_info.h index 257c1e24..6fd3e4a 100644 --- a/extensions/common/manifest_handlers/requirements_info.h +++ b/extensions/common/manifest_handlers/requirements_info.h
@@ -17,11 +17,11 @@ // Declared requirements for the extension. struct RequirementsInfo : public Extension::ManifestData { - explicit RequirementsInfo(const Manifest* manifest); + RequirementsInfo(); ~RequirementsInfo() override; - bool webgl; - bool window_shape; + bool webgl = false; + bool window_shape = false; static const RequirementsInfo& GetRequirements(const Extension* extension); };
diff --git a/extensions/common/manifest_test.cc b/extensions/common/manifest_test.cc index 1cbbe09..e966508d 100644 --- a/extensions/common/manifest_test.cc +++ b/extensions/common/manifest_test.cc
@@ -154,7 +154,8 @@ EXPECT_TRUE(extension.get()) << manifest.name(); EXPECT_EQ(std::string(), error) << manifest.name(); EXPECT_EQ(1u, extension->install_warnings().size()); - EXPECT_EQ(expected_warning, extension->install_warnings()[0].message); + if (extension->install_warnings().size() == 1) + EXPECT_EQ(expected_warning, extension->install_warnings()[0].message); return extension; }
diff --git a/extensions/components/native_app_window/native_app_window_views.cc b/extensions/components/native_app_window/native_app_window_views.cc index 12042bd..2fc85e12 100644 --- a/extensions/components/native_app_window/native_app_window_views.cc +++ b/extensions/components/native_app_window/native_app_window_views.cc
@@ -11,9 +11,9 @@ #include "extensions/browser/app_window/app_window.h" #include "extensions/common/draggable_region.h" #include "third_party/skia/include/core/SkRegion.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/non_client_view.h"
diff --git a/extensions/components/native_app_window/native_app_window_views.h b/extensions/components/native_app_window/native_app_window_views.h index a244963..ae7e295 100644 --- a/extensions/components/native_app_window/native_app_window_views.h +++ b/extensions/components/native_app_window/native_app_window_views.h
@@ -13,9 +13,9 @@ #include "extensions/browser/app_window/app_window.h" #include "extensions/browser/app_window/native_app_window.h" #include "extensions/browser/app_window/size_constraints.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_observer.h"
diff --git a/fuchsia/cipd/BUILD.gn b/fuchsia/cipd/BUILD.gn index 149e3fd..cf5a91f 100644 --- a/fuchsia/cipd/BUILD.gn +++ b/fuchsia/cipd/BUILD.gn
@@ -9,6 +9,7 @@ import("//build/cipd/cipd.gni") import("//build/util/process_version.gni") import("//third_party/fuchsia-sdk/sdk/build/build_id_dir.gni") +import("//third_party/fuchsia-sdk/sdk/build/cipd.gni") # gn binary location. if (host_os == "mac") { @@ -30,56 +31,48 @@ process_only = true } -# Prepares a CIPD archive and generates a manifest file. +if (target_cpu == "x64") { + targetarch = "amd64" +} else { + targetarch = "arm64" +} + +# Prepares a CIPD archive, produces a corresponding LICENSE file and generates +# a manifest file. # # Parameters: # package_basename: Determines the package basename in CIPD. -# package_definition_basename: The non-extension portion of the filename used -# for the generated CIPD YAML file. Defaults to -# package_basename. # package_relative_path: Specify the package location relative to the fuchsia/ # CIPD subdirectory. Defaults to a package name # based on package_basename. -# description: Sets the "description" field in CIPD metadata. -# install_mode: String, should be either "symlink" or "copy". -# deps: A list of targets to build prior to copying files. -# sources: A list of files to copy into the staging root. -# source_directories: A list of directories to include in the package. -template("cipd_archive_internal") { +# description: Sets the "description" field in CIPD package definition. +# +# Optional parameters used directly by fuchsia_cipd_package template: +# "package_root", +# "package_definition_name", +# "package_definition_dir", +# "install_mode", +# "files", +# "directories", +# "sources", + +template("cipd_archive") { forward_variables_from(invoker, [ - "deps", "package_basename", - "package_definition_basename", "package_relative_path", - "source_directories", + "package_root", + "package_definition_name", + "package_definition_dir", + "description", + "install_mode", + "files", + "directories", "sources", + "deps", "testonly", + "visibility", ]) - if (!defined(package_definition_basename)) { - package_definition_basename = package_basename - } - - if (!defined(package_relative_path)) { - if (target_cpu == "x64") { - targetarch = "amd64" - } else { - targetarch = "arm64" - } - package_relative_path = "${package_basename}-$targetarch" - } - - if (invoker.is_internal) { - package = "chrome_internal/fuchsia/" + package_relative_path - - # '_google' is appended to the YAML file for internal binaries. - # TODO (crbug.com/1169400): Remove this once we have separate builders - # for internal and public WebEngine. - package_definition_yaml = package_definition_basename + "_google.yaml" - } else { - package = "chromium/fuchsia/" + package_relative_path - package_definition_yaml = package_definition_basename + ".yaml" - } # Produces a consolidated license file. action("${target_name}_license") { @@ -109,52 +102,41 @@ } sources += get_target_outputs(":${target_name}_license") - cipd_package_definition(target_name) { - forward_variables_from(invoker, - [ - "description", - "install_mode", - "package", - "package_definition_yaml", - ]) - } -} + fuchsia_cipd_package(target_name) { + if (!defined(package_relative_path)) { + package_relative_path = "${package_basename}-$targetarch" + } -# This template allows built binaries to be saved to both the internal and -# public CIPD directory. -# TODO (crbug.com/1169400): Remove this template once we have separate builders -# for internal and public WebEngine. -template("cipd_archive") { - cipd_archive_internal("${target_name}") { - is_internal = false - forward_variables_from(invoker, - [ - "package_basename", - "package_definition_basename", - "package_relative_path", - "description", - "source_directories", - "install_mode", - "deps", - "sources", - "testonly", - ]) + package = "chromium/fuchsia/${package_relative_path}" + + if (!defined(package_definition_name)) { + package_definition_name = "${target_name}.yaml" + } + + # Always use absolute path. + use_absolute_root_path = true } - cipd_archive_internal("${target_name}_google") { - is_internal = true - forward_variables_from(invoker, - [ - "package_basename", - "package_definition_basename", - "package_relative_path", - "description", - "source_directories", - "install_mode", - "deps", - "sources", - "testonly", - ]) + # TODO (crbug.com/1169400): Remove this target when Fuchsia side is ready to + # transition. + fuchsia_cipd_package("${target_name}_google") { + if (!defined(package_relative_path)) { + if (target_cpu == "x64") { + targetarch = "amd64" + } else { + targetarch = "arm64" + } + package_relative_path = "${package_basename}-$targetarch" + } + + package = "chrome_internal/fuchsia/${package_relative_path}" + + if (!defined(package_definition_name)) { + package_definition_name = "${target_name}.yaml" + } + + # Always use absolute path. + use_absolute_root_path = true } } @@ -229,7 +211,6 @@ } cipd_archive("chromedriver") { - package_basename = "chromedriver" package_relative_path = "chromedriver/\${os}-\${arch}" description = "Prebuilt Chromedriver binary for Fuchsia host." install_mode = "copy" @@ -288,6 +269,8 @@ # .build_id structure for CIPD archival. _build_ids_target = "debug_symbol_directory" _debug_symbols_archive_name = "debug_symbols" +_debug_symbols_outdir = + "${target_gen_dir}/${_debug_symbols_archive_name}/${_build_ids_target}" build_id_dir(_build_ids_target) { build_id_dirs = [ @@ -295,7 +278,8 @@ "${root_gen_dir}/fuchsia/runners/cast_runner", "${root_gen_dir}/fuchsia/runners/web_runner", ] - output_path = "${target_gen_dir}/${_debug_symbols_archive_name}" + + output_path = _debug_symbols_outdir deps = [ "//fuchsia/engine:web_engine", "//fuchsia/runners:cast_runner_pkg", @@ -303,18 +287,32 @@ ] } -cipd_archive(_debug_symbols_archive_name) { - package_basename = "debug-symbols" - package_definition_basename = _debug_symbols_archive_name +fuchsia_cipd_package(_debug_symbols_archive_name) { + package = "chromium/fuchsia/debug-symbols-${targetarch}" + package_root = _debug_symbols_outdir + package_definition_name = "${target_name}.yaml" + package_definition_dir = "${target_gen_dir}/${target_name}" description = "Debugging symbols for prebuilt binaries from Chromium." + use_absolute_root_path = true + directories = [ "." ] deps = [ ":${_build_ids_target}" ] - source_directories = [ "." ] +} + +fuchsia_cipd_package("${_debug_symbols_archive_name}_google") { + package = "chrome_internal/fuchsia/debug-symbols-${targetarch}" + package_root = _debug_symbols_outdir + package_definition_name = "${target_name}.yaml" + package_definition_dir = "${target_gen_dir}/${_debug_symbols_archive_name}" + description = "Debugging symbols for prebuilt binaries from Chromium." + use_absolute_root_path = true + + directories = [ "." ] + deps = [ ":${_build_ids_target}" ] } cipd_archive("clear_key_cdm") { package_basename = "libclearkeycdm" - package_definition_basename = "clear_key_cdm" description = "Prebuilt libclearkeycdm.so binary for Fuchsia." testonly = true
diff --git a/fuchsia/engine/BUILD.gn b/fuchsia/engine/BUILD.gn index 4a7409f..5fde885 100644 --- a/fuchsia/engine/BUILD.gn +++ b/fuchsia/engine/BUILD.gn
@@ -405,6 +405,7 @@ "browser/fake_semantic_tree.h", "browser/fake_semantics_manager.cc", "browser/fake_semantics_manager.h", + "browser/frame_host_impl_browsertest.cc", "browser/frame_impl_browser_test_base.cc", "browser/frame_impl_browser_test_base.h", "browser/frame_impl_browsertest.cc",
diff --git a/fuchsia/engine/browser/frame_host_impl_browsertest.cc b/fuchsia/engine/browser/frame_host_impl_browsertest.cc new file mode 100644 index 0000000..b65ba04 --- /dev/null +++ b/fuchsia/engine/browser/frame_host_impl_browsertest.cc
@@ -0,0 +1,43 @@ +// 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. + +#include <lib/sys/cpp/service_directory.h> + +#include "content/public/test/browser_test.h" +#include "fuchsia/base/test_navigation_listener.h" +#include "fuchsia/engine/browser/context_impl.h" +#include "fuchsia/engine/test/web_engine_browser_test.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/url_constants.h" + +namespace { + +using FrameHostImplBrowserTest = cr_fuchsia::WebEngineBrowserTest; + +} // namespace + +// Verify that it is possible to connect to the fuchsia.web.FrameHost service, +// and that a Frame created in it uses a different ContextImpl than one created +// via the fuchsia.web.Context. +IN_PROC_BROWSER_TEST_F(FrameHostImplBrowserTest, IsolatedFromWebContext) { + ASSERT_TRUE(embedded_test_server()->Start()); + + // Create a new Frame via the fuchsia.web.Context. + cr_fuchsia::TestNavigationListener navigation_listener1; + fuchsia::web::FramePtr frame1 = CreateFrame(&navigation_listener1); + + // Verify that the FrameImpl can be found via the |context_impl()| to which + // the fuchsia.web.Context is connected. + EXPECT_TRUE(context_impl()->GetFrameImplForTest(&frame1) != nullptr); + + // Create a new Frame via a FrameHost instance. + fuchsia::web::FrameHostPtr frame_host; + published_services().Connect(frame_host.NewRequest()); + fuchsia::web::FramePtr frame2; + frame_host->CreateFrameWithParams({}, frame2.NewRequest()); + + // Verify that the new Frame cannot be resolved to a FrameImpl under the + // |context_impl()| to which the fuchsia.web.Context is connected. + EXPECT_TRUE(context_impl()->GetFrameImplForTest(&frame2) == nullptr); +}
diff --git a/fuchsia/engine/browser/virtual_keyboard_browsertest.cc b/fuchsia/engine/browser/virtual_keyboard_browsertest.cc index 1b98466..2eff7d9a 100644 --- a/fuchsia/engine/browser/virtual_keyboard_browsertest.cc +++ b/fuchsia/engine/browser/virtual_keyboard_browsertest.cc
@@ -243,115 +243,102 @@ fuchsia::ui::views::ViewRef view_ref_; }; -// Verifies that RequestShow() is invoked multiple times if the virtual -// keyboard service does not indicate that the keyboard is made visible. -IN_PROC_BROWSER_TEST_F(VirtualKeyboardTest, ShowAndHideCalledButIgnored) { - testing::InSequence s; - EXPECT_CALL(*controller_, RequestShow()).Times(2); - EXPECT_CALL(*controller_, RequestHide()); - base::RunLoop run_loop; - EXPECT_CALL(*controller_, RequestShow()) - .WillOnce(testing::InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); })); - - // Tap inside the text field. The IME should be summoned via a call to - // RequestShow(). - content::SimulateTapAt(web_contents_, - GetCoordinatesOfInputField(kInputFieldText)); - - // Change fields. RequestShow() should be called again, since the keyboard - // is not yet known to be visible. - content::SimulateTapAt(web_contents_, - GetCoordinatesOfInputField(kInputFieldNumeric)); - - // Tap outside the text field. The IME should be dismissed, which will result - // in a call to RequestHide(). - content::SimulateTapAt(web_contents_, kNoTarget); - - // Tap back on a text field. RequestShow should be called. - content::SimulateTapAt(web_contents_, - GetCoordinatesOfInputField(kInputFieldText)); - run_loop.Run(); -} - // Verifies that RequestShow() is not called redundantly if the virtual // keyboard is reported as visible. IN_PROC_BROWSER_TEST_F(VirtualKeyboardTest, ShowAndHideWithVisibility) { testing::InSequence s; base::RunLoop on_show_run_loop; - EXPECT_CALL(*controller_, - SetTextType(virtualkeyboard::TextType::ALPHANUMERIC)); + + // Alphanumeric field click. EXPECT_CALL(*controller_, RequestShow()) .WillOnce(testing::InvokeWithoutArgs( - [&on_show_run_loop]() { on_show_run_loop.Quit(); })); - EXPECT_CALL(*controller_, SetTextType(virtualkeyboard::TextType::NUMERIC)); - base::RunLoop on_hide_run_loop; - EXPECT_CALL(*controller_, RequestHide()) - .WillOnce(testing::InvokeWithoutArgs( - [&on_hide_run_loop]() { on_hide_run_loop.Quit(); })); + [&on_show_run_loop]() { on_show_run_loop.Quit(); })) + .RetiresOnSaturation(); + EXPECT_CALL(*controller_, RequestHide()).RetiresOnSaturation(); - // Give focus to an input field, which will result in RequestShow() being - // called. + // Numeric field click. + base::RunLoop click_numeric_run_loop; + EXPECT_CALL(*controller_, SetTextType(virtualkeyboard::TextType::NUMERIC)) + .WillOnce(testing::InvokeWithoutArgs( + [&click_numeric_run_loop]() { click_numeric_run_loop.Quit(); })) + .RetiresOnSaturation(); + EXPECT_CALL(*controller_, RequestShow()).RetiresOnSaturation(); + + // Input blur click. + EXPECT_CALL(*controller_, RequestHide()).RetiresOnSaturation(); + base::RunLoop text_type_changed_run_loop; + EXPECT_CALL(*controller_, + SetTextType(virtualkeyboard::TextType::ALPHANUMERIC)) + .WillOnce(testing::InvokeWithoutArgs([&text_type_changed_run_loop]() { + text_type_changed_run_loop.Quit(); + })) + .RetiresOnSaturation(); + content::SimulateTapAt(web_contents_, GetCoordinatesOfInputField(kInputFieldText)); on_show_run_loop.Run(); + EXPECT_EQ(controller_->text_type(), virtualkeyboard::TextType::ALPHANUMERIC); // Indicate that the virtual keyboard is now visible. controller_->AwaitWatchAndRespondWith(true); + base::RunLoop().RunUntilIdle(); // Tap on another text field. RequestShow should not be called a second time // since the keyboard is already onscreen. content::SimulateTapAt(web_contents_, GetCoordinatesOfInputField(kInputFieldNumeric)); - base::RunLoop().RunUntilIdle(); + click_numeric_run_loop.Run(); + // Trigger input blur by clicking outside any input element. content::SimulateTapAt(web_contents_, kNoTarget); - on_hide_run_loop.Run(); + text_type_changed_run_loop.Run(); } // Gives focus to a sequence of HTML <input> nodes with different InputModes, // and verifies that the InputMode's FIDL equivalent is sent via SetTextType(). IN_PROC_BROWSER_TEST_F(VirtualKeyboardTest, InputModeMappings) { + // Note that the service will elide type updates if there is no change, + // so the array is ordered to produce an update on each entry. const std::vector<std::pair<base::StringPiece, virtualkeyboard::TextType>> kInputTypeMappings = { - {kInputFieldText, virtualkeyboard::TextType::ALPHANUMERIC}, {kInputFieldTel, virtualkeyboard::TextType::PHONE}, + {kInputFieldSearch, virtualkeyboard::TextType::ALPHANUMERIC}, {kInputFieldNumeric, virtualkeyboard::TextType::NUMERIC}, {kInputFieldUrl, virtualkeyboard::TextType::ALPHANUMERIC}, - {kInputFieldEmail, virtualkeyboard::TextType::ALPHANUMERIC}, {kInputFieldDecimal, virtualkeyboard::TextType::NUMERIC}, - {kInputFieldSearch, virtualkeyboard::TextType::ALPHANUMERIC}, + {kInputFieldEmail, virtualkeyboard::TextType::ALPHANUMERIC}, }; - // Simulate like the keyboard is already shown, so that the test can focus on - // input type mappings without clutter from visibility management. - controller_->AwaitWatchAndRespondWith(true); - base::RunLoop().RunUntilIdle(); - // GMock expectations must be set upfront, hence the redundant for-each loop. - for (const auto& field_type_pair : kInputTypeMappings) { + testing::InSequence s; + virtualkeyboard::TextType previous_text_type = + virtualkeyboard::TextType::ALPHANUMERIC; + std::vector<base::RunLoop> set_type_loops(base::size(kInputTypeMappings)); + for (size_t i = 0; i < base::size(kInputTypeMappings); ++i) { + const auto& field_type_pair = kInputTypeMappings[i]; + DCHECK_NE(field_type_pair.second, previous_text_type); + EXPECT_CALL(*controller_, SetTextType(field_type_pair.second)) + .WillOnce(testing::InvokeWithoutArgs( + [run_loop = &set_type_loops[i]]() mutable { run_loop->Quit(); })) .RetiresOnSaturation(); + previous_text_type = field_type_pair.second; } - base::RunLoop run_loop; - EXPECT_CALL(*controller_, RequestHide()) - .WillOnce(testing::InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); })); + controller_->AwaitWatchAndRespondWith(false); - for (const auto& field_type_pair : kInputTypeMappings) { - content::SimulateTapAt(web_contents_, - GetCoordinatesOfInputField(field_type_pair.first)); + for (size_t i = 0; i < base::size(kInputTypeMappings); ++i) { + content::SimulateTapAt( + web_contents_, GetCoordinatesOfInputField(kInputTypeMappings[i].first)); + + // Spin the runloop until we've received the type update. + set_type_loops[i].Run(); } - - // Dismiss the virtual keyboard and wait for RequestHide(). - content::SimulateTapAt(web_contents_, kNoTarget); - run_loop.Run(); } IN_PROC_BROWSER_TEST_F(VirtualKeyboardTest, Disconnection) { testing::InSequence s; base::RunLoop on_show_run_loop; - EXPECT_CALL(*controller_, - SetTextType(virtualkeyboard::TextType::ALPHANUMERIC)); EXPECT_CALL(*controller_, RequestShow()) .WillOnce(testing::InvokeWithoutArgs( [&on_show_run_loop]() { on_show_run_loop.Quit(); }));
diff --git a/fuchsia/engine/browser/web_engine_browser_main_parts.cc b/fuchsia/engine/browser/web_engine_browser_main_parts.cc index ef3499a..2810335 100644 --- a/fuchsia/engine/browser/web_engine_browser_main_parts.cc +++ b/fuchsia/engine/browser/web_engine_browser_main_parts.cc
@@ -65,6 +65,29 @@ kChildProcessHistogramFetchTimeout); } +// Implements the fuchsia.web.FrameHost protocol using a ContextImpl with +// incognito browser context. +class FrameHostImpl : public fuchsia::web::FrameHost { + public: + explicit FrameHostImpl(WebEngineDevToolsController* devtools_controller) + : context_(WebEngineBrowserContext::CreateIncognito(), + devtools_controller) {} + ~FrameHostImpl() final = default; + + FrameHostImpl(const FrameHostImpl&) = delete; + FrameHostImpl& operator=(const FrameHostImpl&) = delete; + + // fuchsia.web.FrameHost implementation. + void CreateFrameWithParams( + fuchsia::web::CreateFrameParams params, + fidl::InterfaceRequest<fuchsia::web::Frame> request) final { + context_.CreateFrameWithParams(std::move(params), std::move(request)); + } + + private: + ContextImpl context_; +}; + } // namespace WebEngineBrowserMainParts::WebEngineBrowserMainParts( @@ -159,10 +182,13 @@ // Make sure temporary files associated with this process are cleaned up. base::ImportantFileWriterCleaner::GetInstance().Start(); - // Publish the fuchsia.web.Context service, and allow exactly one connection. + // Publish the fuchsia.web.Context and fuchsia.web.FrameHost capabilities. base::ComponentContextForProcess()->outgoing()->AddPublicService( fidl::InterfaceRequestHandler<fuchsia::web::Context>(fit::bind_member( this, &WebEngineBrowserMainParts::HandleContextRequest))); + base::ComponentContextForProcess()->outgoing()->AddPublicService( + fidl::InterfaceRequestHandler<fuchsia::web::FrameHost>(fit::bind_member( + this, &WebEngineBrowserMainParts::HandleFrameHostRequest))); // Now that all services have been published, it is safe to start processing // requests to the service directory. @@ -256,6 +282,13 @@ }); } +void WebEngineBrowserMainParts::HandleFrameHostRequest( + fidl::InterfaceRequest<fuchsia::web::FrameHost> request) { + frame_host_bindings_.AddBinding( + std::make_unique<FrameHostImpl>(devtools_controller_.get()), + std::move(request)); +} + void WebEngineBrowserMainParts::OnIntlProfileChanged( const fuchsia::intl::Profile& profile) { // Configure the ICU library in this process with the new primary locale.
diff --git a/fuchsia/engine/browser/web_engine_browser_main_parts.h b/fuchsia/engine/browser/web_engine_browser_main_parts.h index dd3111a4..d3b09f7 100644 --- a/fuchsia/engine/browser/web_engine_browser_main_parts.h +++ b/fuchsia/engine/browser/web_engine_browser_main_parts.h
@@ -68,9 +68,11 @@ ContextImpl* context_for_test() const; private: - // Receives requests for the fuchsia.web.Context capability. + // Handle fuchsia.web.Context and fuchsia.web.FrameHost connection requests. void HandleContextRequest( fidl::InterfaceRequest<fuchsia::web::Context> request); + void HandleFrameHostRequest( + fidl::InterfaceRequest<fuchsia::web::FrameHost> request); // Notified if the system timezone, language, settings change. void OnIntlProfileChanged(const fuchsia::intl::Profile& profile); @@ -81,6 +83,9 @@ std::unique_ptr<display::Screen> screen_; fidl::BindingSet<fuchsia::web::Context, std::unique_ptr<ContextImpl>> context_bindings_; + fidl::BindingSet<fuchsia::web::FrameHost, + std::unique_ptr<fuchsia::web::FrameHost>> + frame_host_bindings_; std::unique_ptr<WebEngineDevToolsController> devtools_controller_; std::unique_ptr<cr_fuchsia::LegacyMetricsClient> legacy_metrics_client_; std::unique_ptr<MediaResourceProviderService>
diff --git a/fuchsia/engine/web_instance.cmx b/fuchsia/engine/web_instance.cmx index f5717bb..58ea5e2 100644 --- a/fuchsia/engine/web_instance.cmx +++ b/fuchsia/engine/web_instance.cmx
@@ -13,6 +13,7 @@ "fuchsia.camera3.DeviceWatcher", "fuchsia.device.NameProvider", "fuchsia.fonts.Provider", + "fuchsia.input.virtualkeyboard.ControllerCreator", "fuchsia.intl.PropertyProvider", "fuchsia.legacymetrics.MetricsRecorder", "fuchsia.logger.LogSink", @@ -28,8 +29,7 @@ "fuchsia.process.Launcher", "fuchsia.settings.Display", "fuchsia.sysmem.Allocator", - "fuchsia.ui.input.ImeService", - "fuchsia.ui.input.ImeVisibilityService", + "fuchsia.ui.input3.Keyboard", "fuchsia.ui.scenic.Scenic", "fuchsia.vulkan.loader.Loader" ]
diff --git a/google_apis/gcm/engine/unregistration_request_unittest.cc b/google_apis/gcm/engine/unregistration_request_unittest.cc index ef1f3ee..2b384dac 100644 --- a/google_apis/gcm/engine/unregistration_request_unittest.cc +++ b/google_apis/gcm/engine/unregistration_request_unittest.cc
@@ -128,11 +128,11 @@ headers->GetHeader(net::HttpRequestHeaders::kAuthorization, &auth_header); base::StringTokenizer auth_tokenizer(auth_header, " :"); ASSERT_TRUE(auth_tokenizer.GetNext()); - EXPECT_EQ(kLoginHeader, auth_tokenizer.token()); + EXPECT_EQ(kLoginHeader, auth_tokenizer.token_piece()); ASSERT_TRUE(auth_tokenizer.GetNext()); - EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token()); + EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token_piece()); ASSERT_TRUE(auth_tokenizer.GetNext()); - EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token()); + EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token_piece()); std::map<std::string, std::string> expected_pairs; expected_pairs["app"] = kAppId; @@ -338,11 +338,11 @@ headers->GetHeader(net::HttpRequestHeaders::kAuthorization, &auth_header); base::StringTokenizer auth_tokenizer(auth_header, " :"); ASSERT_TRUE(auth_tokenizer.GetNext()); - EXPECT_EQ(kLoginHeader, auth_tokenizer.token()); + EXPECT_EQ(kLoginHeader, auth_tokenizer.token_piece()); ASSERT_TRUE(auth_tokenizer.GetNext()); - EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token()); + EXPECT_EQ(base::NumberToString(kAndroidId), auth_tokenizer.token_piece()); ASSERT_TRUE(auth_tokenizer.GetNext()); - EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token()); + EXPECT_EQ(base::NumberToString(kSecurityToken), auth_tokenizer.token_piece()); std::map<std::string, std::string> expected_pairs; expected_pairs["gmsv"] = base::NumberToString(kGCMVersion);
diff --git a/gpu/command_buffer/service/abstract_texture_impl_shared_context_state.cc b/gpu/command_buffer/service/abstract_texture_impl_shared_context_state.cc index a81828f5..296cd32 100644 --- a/gpu/command_buffer/service/abstract_texture_impl_shared_context_state.cc +++ b/gpu/command_buffer/service/abstract_texture_impl_shared_context_state.cc
@@ -193,7 +193,10 @@ void AbstractTextureImplOnSharedContextPassthrough::BindStreamTextureImage( gl::GLImage* image, GLuint service_id) { - NOTIMPLEMENTED(); + const GLint level = 0; + const GLuint target = texture_->target(); + texture_->SetStreamLevelImage(target, level, image, service_id); + texture_->set_is_bind_pending(true); } void AbstractTextureImplOnSharedContextPassthrough::BindImage(
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc index 304ca283..8d6eb403 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
@@ -1278,6 +1278,27 @@ } } + for (PendingQuery& pending_query : pending_queries_) { + if (!have_context) { + if (pending_query.commands_completed_fence) { + pending_query.commands_completed_fence->Invalidate(); + } + if (pending_query.buffer_shadow_update_fence) { + pending_query.buffer_shadow_update_fence->Invalidate(); + } + } + } + pending_queries_.clear(); + + for (PendingReadPixels& pending_read_pixels : pending_read_pixels_) { + if (!have_context) { + if (pending_read_pixels.fence) { + pending_read_pixels.fence->Invalidate(); + } + } + } + pending_read_pixels_.clear(); + DeleteServiceObjects(&framebuffer_id_map_, have_context, [this](GLuint client_id, GLuint framebuffer) { api()->glDeleteFramebuffersEXTFn(1, &framebuffer);
diff --git a/gpu/command_buffer/service/shared_image_backing_d3d.cc b/gpu/command_buffer/service/shared_image_backing_d3d.cc index 1f98a72..893f4d19 100644 --- a/gpu/command_buffer/service/shared_image_backing_d3d.cc +++ b/gpu/command_buffer/service/shared_image_backing_d3d.cc
@@ -4,7 +4,6 @@ #include "gpu/command_buffer/service/shared_image_backing_d3d.h" -#include "base/memory/ptr_util.h" #include "base/trace_event/memory_dump_manager.h" #include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/resource_sizes.h" @@ -18,353 +17,26 @@ namespace { -bool SupportsVideoFormat(DXGI_FORMAT dxgi_format) { - switch (dxgi_format) { - case DXGI_FORMAT_NV12: - case DXGI_FORMAT_P010: - case DXGI_FORMAT_B8G8R8A8_UNORM: - case DXGI_FORMAT_R10G10B10A2_UNORM: - case DXGI_FORMAT_R16G16B16A16_FLOAT: - return true; - default: - return false; - } -} - -size_t NumPlanes(DXGI_FORMAT dxgi_format) { - switch (dxgi_format) { - case DXGI_FORMAT_NV12: - case DXGI_FORMAT_P010: - return 2; - case DXGI_FORMAT_B8G8R8A8_UNORM: - case DXGI_FORMAT_R10G10B10A2_UNORM: - case DXGI_FORMAT_R16G16B16A16_FLOAT: - return 1; - default: - NOTREACHED(); - return 0; - } -} - -viz::ResourceFormat PlaneFormat(DXGI_FORMAT dxgi_format, size_t plane) { - DCHECK_LT(plane, NumPlanes(dxgi_format)); - switch (dxgi_format) { - // TODO(crbug.com/1011555): P010 formats are not fully supported by Skia. - // Treat them the same as NV12 for the time being. - case DXGI_FORMAT_NV12: - case DXGI_FORMAT_P010: - // Y plane is accessed as R8 and UV plane is accessed as RG88 in D3D. - return plane == 0 ? viz::RED_8 : viz::RG_88; - case DXGI_FORMAT_B8G8R8A8_UNORM: - return viz::BGRA_8888; - case DXGI_FORMAT_R10G10B10A2_UNORM: - return viz::RGBA_1010102; - case DXGI_FORMAT_R16G16B16A16_FLOAT: - return viz::RGBA_F16; - default: - NOTREACHED(); - return viz::BGRA_8888; - } -} - -gfx::Size PlaneSize(DXGI_FORMAT dxgi_format, - const gfx::Size& size, - size_t plane) { - DCHECK_LT(plane, NumPlanes(dxgi_format)); - switch (dxgi_format) { - case DXGI_FORMAT_NV12: - case DXGI_FORMAT_P010: - // Y plane is full size and UV plane is accessed as half size in D3D. - return plane == 0 ? size : gfx::Size(size.width() / 2, size.height() / 2); - case DXGI_FORMAT_B8G8R8A8_UNORM: - case DXGI_FORMAT_R10G10B10A2_UNORM: - case DXGI_FORMAT_R16G16B16A16_FLOAT: - return size; - default: - NOTREACHED(); - return gfx::Size(); - } -} - -class ScopedRestoreTexture { +class ScopedRestoreTexture2D { public: - ScopedRestoreTexture(gl::GLApi* api, GLenum target) - : api_(api), target_(target) { - DCHECK(target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES); + explicit ScopedRestoreTexture2D(gl::GLApi* api) : api_(api) { GLint binding = 0; - api->glGetIntegervFn(target == GL_TEXTURE_2D - ? GL_TEXTURE_BINDING_2D - : GL_TEXTURE_BINDING_EXTERNAL_OES, - &binding); + api->glGetIntegervFn(GL_TEXTURE_BINDING_2D, &binding); prev_binding_ = binding; } - ~ScopedRestoreTexture() { api_->glBindTextureFn(target_, prev_binding_); } + ~ScopedRestoreTexture2D() { + api_->glBindTextureFn(GL_TEXTURE_2D, prev_binding_); + } private: gl::GLApi* const api_; - const GLenum target_; GLuint prev_binding_ = 0; - DISALLOW_COPY_AND_ASSIGN(ScopedRestoreTexture); + DISALLOW_COPY_AND_ASSIGN(ScopedRestoreTexture2D); }; -scoped_refptr<gles2::TexturePassthrough> CreateGLTexture( - viz::ResourceFormat format, - const gfx::Size& size, - const gfx::ColorSpace& color_space, - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, - Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain = nullptr, - GLenum texture_target = GL_TEXTURE_2D, - unsigned array_slice = 0u, - unsigned plane_index = 0u) { - gl::GLApi* const api = gl::g_current_gl_context; - ScopedRestoreTexture scoped_restore(api, texture_target); - - GLuint service_id = 0; - api->glGenTexturesFn(1, &service_id); - api->glBindTextureFn(texture_target, service_id); - - // The GL internal format can differ from the underlying swap chain or texture - // format e.g. RGBA or RGB instead of BGRA or RED/RG for NV12 texture planes. - // See EGL_ANGLE_d3d_texture_client_buffer spec for format restrictions. - const auto internal_format = viz::GLInternalFormat(format); - const auto data_type = viz::GLDataType(format); - auto image = base::MakeRefCounted<gl::GLImageD3D>( - size, internal_format, data_type, color_space, d3d11_texture, array_slice, - plane_index, swap_chain); - DCHECK_EQ(image->GetDataFormat(), viz::GLDataFormat(format)); - if (!image->Initialize()) { - DLOG(ERROR) << "GLImageD3D::Initialize failed"; - api->glDeleteTexturesFn(1, &service_id); - return nullptr; - } - if (!image->BindTexImage(texture_target)) { - DLOG(ERROR) << "GLImageD3D::BindTexImage failed"; - api->glDeleteTexturesFn(1, &service_id); - return nullptr; - } - - auto texture = base::MakeRefCounted<gles2::TexturePassthrough>( - service_id, texture_target); - texture->SetLevelImage(texture_target, 0, image.get()); - GLint texture_memory_size = 0; - api->glGetTexParameterivFn(texture_target, GL_MEMORY_SIZE_ANGLE, - &texture_memory_size); - texture->SetEstimatedSize(texture_memory_size); - - return texture; -} - } // anonymous namespace -SharedImageBackingD3D::SharedState::SharedState( - base::win::ScopedHandle shared_handle, - Microsoft::WRL::ComPtr<IDXGIKeyedMutex> dxgi_keyed_mutex) - : shared_handle_(std::move(shared_handle)), - dxgi_keyed_mutex_(std::move(dxgi_keyed_mutex)) {} - -SharedImageBackingD3D::SharedState::~SharedState() { - DCHECK(!acquired_for_d3d12_); - DCHECK_EQ(acquired_for_d3d11_count_, 0); - shared_handle_.Close(); -} - -bool SharedImageBackingD3D::SharedState::BeginAccessD3D12( - uint64_t* acquire_key) { - if (!dxgi_keyed_mutex_) { - DLOG(ERROR) << "D3D12 access not supported without keyed mutex"; - return false; - } - if (acquired_for_d3d12_ || acquired_for_d3d11_count_ > 0) { - DLOG(ERROR) << "Recursive BeginAccess not supported"; - return false; - } - *acquire_key = acquire_key_; - acquire_key_++; - acquired_for_d3d12_ = true; - return true; -} - -void SharedImageBackingD3D::SharedState::EndAccessD3D12() { - acquired_for_d3d12_ = false; -} - -bool SharedImageBackingD3D::SharedState::BeginAccessD3D11() { - // Nop for shared images that are created without keyed mutex (D3D11 only). - if (!dxgi_keyed_mutex_) - return true; - - if (acquired_for_d3d12_) { - DLOG(ERROR) << "Recursive BeginAccess not supported"; - return false; - } - if (acquired_for_d3d11_count_ > 0) { - acquired_for_d3d11_count_++; - return true; - } - const HRESULT hr = dxgi_keyed_mutex_->AcquireSync(acquire_key_, INFINITE); - if (FAILED(hr)) { - DLOG(ERROR) << "Unable to acquire the keyed mutex " << std::hex << hr; - return false; - } - acquire_key_++; - acquired_for_d3d11_count_++; - return true; -} - -void SharedImageBackingD3D::SharedState::EndAccessD3D11() { - // Nop for shared images that are created without keyed mutex (D3D11 only). - if (!dxgi_keyed_mutex_) - return; - - DCHECK_GT(acquired_for_d3d11_count_, 0); - acquired_for_d3d11_count_--; - if (acquired_for_d3d11_count_ == 0) { - const HRESULT hr = dxgi_keyed_mutex_->ReleaseSync(acquire_key_); - if (FAILED(hr)) - DLOG(ERROR) << "Unable to release the keyed mutex " << std::hex << hr; - } -} - -HANDLE SharedImageBackingD3D::SharedState::GetSharedHandle() const { - return shared_handle_.Get(); -} - -// static -std::unique_ptr<SharedImageBackingD3D> -SharedImageBackingD3D::CreateFromSwapChainBuffer( - const Mailbox& mailbox, - viz::ResourceFormat format, - const gfx::Size& size, - const gfx::ColorSpace& color_space, - GrSurfaceOrigin surface_origin, - SkAlphaType alpha_type, - uint32_t usage, - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, - Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain, - size_t buffer_index) { - auto gl_texture = - CreateGLTexture(format, size, color_space, d3d11_texture, swap_chain); - if (!gl_texture) { - DLOG(ERROR) << "Failed to create GL texture"; - return nullptr; - } - return base::WrapUnique(new SharedImageBackingD3D( - mailbox, format, size, color_space, surface_origin, alpha_type, usage, - std::move(d3d11_texture), std::move(gl_texture), std::move(swap_chain), - buffer_index)); -} - -// static -std::unique_ptr<SharedImageBackingD3D> -SharedImageBackingD3D::CreateFromSharedHandle( - const Mailbox& mailbox, - viz::ResourceFormat format, - const gfx::Size& size, - const gfx::ColorSpace& color_space, - GrSurfaceOrigin surface_origin, - SkAlphaType alpha_type, - uint32_t usage, - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, - base::win::ScopedHandle shared_handle) { - DCHECK(shared_handle.IsValid()); - // Keyed mutexes are required for Dawn interop but are not used for XR - // composition where fences are used instead. - Microsoft::WRL::ComPtr<IDXGIKeyedMutex> dxgi_keyed_mutex; - d3d11_texture.As(&dxgi_keyed_mutex); - DCHECK(!(usage & SHARED_IMAGE_USAGE_WEBGPU) || dxgi_keyed_mutex); - - auto shared_state = base::MakeRefCounted<SharedState>( - std::move(shared_handle), std::move(dxgi_keyed_mutex)); - - // Creating the GL texture doesn't require exclusive access to the underlying - // D3D11 texture. - auto gl_texture = CreateGLTexture(format, size, color_space, d3d11_texture); - if (!gl_texture) { - DLOG(ERROR) << "Failed to create GL texture"; - return nullptr; - } - - return base::WrapUnique(new SharedImageBackingD3D( - mailbox, format, size, color_space, surface_origin, alpha_type, usage, - std::move(d3d11_texture), std::move(gl_texture), /*swap_chain=*/nullptr, - /*buffer_index=*/0, std::move(shared_state))); -} - -std::unique_ptr<SharedImageBackingD3D> -SharedImageBackingD3D::CreateFromGLTexture( - const Mailbox& mailbox, - viz::ResourceFormat format, - const gfx::Size& size, - const gfx::ColorSpace& color_space, - GrSurfaceOrigin surface_origin, - SkAlphaType alpha_type, - uint32_t usage, - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, - scoped_refptr<gles2::TexturePassthrough> gl_texture) { - return base::WrapUnique(new SharedImageBackingD3D( - mailbox, format, size, color_space, surface_origin, alpha_type, usage, - std::move(d3d11_texture), std::move(gl_texture))); -} - -// static -std::vector<std::unique_ptr<SharedImageBackingD3D>> -SharedImageBackingD3D::CreateFromVideoTexture( - base::span<const Mailbox> mailboxes, - DXGI_FORMAT dxgi_format, - const gfx::Size& size, - uint32_t usage, - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, - unsigned array_slice, - base::win::ScopedHandle shared_handle) { - DCHECK(SupportsVideoFormat(dxgi_format)); - DCHECK_EQ(mailboxes.size(), NumPlanes(dxgi_format)); - - // Shared handle and keyed mutex are required for Dawn interop. - Microsoft::WRL::ComPtr<IDXGIKeyedMutex> dxgi_keyed_mutex; - d3d11_texture.As(&dxgi_keyed_mutex); - DCHECK(!(usage & gpu::SHARED_IMAGE_USAGE_WEBGPU) || - (shared_handle.IsValid() && dxgi_keyed_mutex)); - - // Share the same keyed mutex state for all the plane backings. - auto shared_state = base::MakeRefCounted<SharedState>( - std::move(shared_handle), std::move(dxgi_keyed_mutex)); - - std::vector<std::unique_ptr<SharedImageBackingD3D>> shared_images( - NumPlanes(dxgi_format)); - for (size_t plane_index = 0; plane_index < shared_images.size(); - plane_index++) { - const auto& mailbox = mailboxes[plane_index]; - - const auto plane_format = PlaneFormat(dxgi_format, plane_index); - const auto plane_size = PlaneSize(dxgi_format, size, plane_index); - - // Shared image does not need to store the colorspace since it is already - // stored on the VideoFrame which is provided upon presenting the overlay. - // To prevent the developer from mistakenly using it, provide the invalid - // value from default-construction. - constexpr gfx::ColorSpace kInvalidColorSpace; - - auto gl_texture = CreateGLTexture( - plane_format, plane_size, kInvalidColorSpace, d3d11_texture, - /*swap_chain=*/nullptr, GL_TEXTURE_EXTERNAL_OES, array_slice, - plane_index); - if (!gl_texture) { - DLOG(ERROR) << "Failed to create GL texture"; - return {}; - } - - shared_images[plane_index] = base::WrapUnique(new SharedImageBackingD3D( - mailbox, plane_format, plane_size, kInvalidColorSpace, - kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, usage, d3d11_texture, - std::move(gl_texture), /*swap_chain=*/nullptr, /*buffer_index=*/0, - shared_state)); - shared_images[plane_index]->SetCleared(); - } - - return shared_images; -} - SharedImageBackingD3D::SharedImageBackingD3D( const Mailbox& mailbox, viz::ResourceFormat format, @@ -373,11 +45,13 @@ GrSurfaceOrigin surface_origin, SkAlphaType alpha_type, uint32_t usage, - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, - scoped_refptr<gles2::TexturePassthrough> gl_texture, Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain, + scoped_refptr<gles2::TexturePassthrough> texture, + scoped_refptr<gl::GLImage> image, size_t buffer_index, - scoped_refptr<SharedState> shared_state) + Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, + base::win::ScopedHandle shared_handle, + Microsoft::WRL::ComPtr<IDXGIKeyedMutex> dxgi_keyed_mutex) : ClearTrackingSharedImageBacking(mailbox, format, size, @@ -385,23 +59,28 @@ surface_origin, alpha_type, usage, - gl_texture->estimated_size(), + texture->estimated_size(), false /* is_thread_safe */), - d3d11_texture_(std::move(d3d11_texture)), - gl_texture_(std::move(gl_texture)), swap_chain_(std::move(swap_chain)), + texture_(std::move(texture)), + image_(std::move(image)), buffer_index_(buffer_index), - shared_state_(std::move(shared_state)) { - DCHECK(gl_texture_); + d3d11_texture_(std::move(d3d11_texture)), + shared_handle_(std::move(shared_handle)), + dxgi_keyed_mutex_(std::move(dxgi_keyed_mutex)) { + DCHECK(texture_); } SharedImageBackingD3D::~SharedImageBackingD3D() { if (!have_context()) - gl_texture_->MarkContextLost(); - gl_texture_ = nullptr; - shared_state_ = nullptr; - swap_chain_.Reset(); + texture_->MarkContextLost(); + texture_ = nullptr; + swap_chain_ = nullptr; d3d11_texture_.Reset(); + dxgi_keyed_mutex_.Reset(); + keyed_mutex_acquire_key_ = 0; + keyed_mutex_acquired_ = false; + shared_handle_.Close(); #if BUILDFLAG(USE_DAWN) external_image_ = nullptr; @@ -415,7 +94,7 @@ bool SharedImageBackingD3D::ProduceLegacyMailbox( MailboxManager* mailbox_manager) { - mailbox_manager->ProduceTexture(mailbox(), gl_texture_.get()); + mailbox_manager->ProduceTexture(mailbox(), texture_.get()); return true; } @@ -435,7 +114,7 @@ // Persistently open the shared handle by caching it on this backing. if (!external_image_) { - DCHECK(base::win::HandleTraits::IsHandleValid(GetSharedHandle())); + DCHECK(shared_handle_.IsValid()); const viz::ResourceFormat viz_resource_format = format(); const WGPUTextureFormat wgpu_format = @@ -457,7 +136,7 @@ dawn_native::d3d12::ExternalImageDescriptorDXGISharedHandle externalImageDesc; externalImageDesc.cTextureDescriptor = &texture_descriptor; - externalImageDesc.sharedHandle = GetSharedHandle(); + externalImageDesc.sharedHandle = shared_handle_.Get(); external_image_ = dawn_native::d3d12::ExternalImageDXGI::Create( device, &externalImageDesc); @@ -484,38 +163,65 @@ // various GPU dumps. auto client_guid = GetSharedImageGUIDForTracing(mailbox()); base::trace_event::MemoryAllocatorDumpGuid service_guid = - gl::GetGLTextureServiceGUIDForTracing(gl_texture_->service_id()); + gl::GetGLTextureServiceGUIDForTracing(texture_->service_id()); pmd->CreateSharedGlobalAllocatorDump(service_guid); int importance = 2; // This client always owns the ref. pmd->AddOwnershipEdge(client_guid, service_guid, importance); // Swap chain textures only have one level backed by an image. - GetGLImage()->OnMemoryDump(pmd, client_tracing_id, dump_name); + image_->OnMemoryDump(pmd, client_tracing_id, dump_name); } bool SharedImageBackingD3D::BeginAccessD3D12(uint64_t* acquire_key) { - return shared_state_->BeginAccessD3D12(acquire_key); + if (keyed_mutex_acquired_) { + DLOG(ERROR) << "Recursive BeginAccess not supported"; + return false; + } + *acquire_key = keyed_mutex_acquire_key_; + keyed_mutex_acquire_key_++; + keyed_mutex_acquired_ = true; + return true; } void SharedImageBackingD3D::EndAccessD3D12() { - shared_state_->EndAccessD3D12(); + keyed_mutex_acquired_ = false; } bool SharedImageBackingD3D::BeginAccessD3D11() { - return shared_state_->BeginAccessD3D11(); + if (dxgi_keyed_mutex_) { + if (keyed_mutex_acquired_) { + DLOG(ERROR) << "Recursive BeginAccess not supported"; + return false; + } + const HRESULT hr = + dxgi_keyed_mutex_->AcquireSync(keyed_mutex_acquire_key_, INFINITE); + if (FAILED(hr)) { + DLOG(ERROR) << "Unable to acquire the keyed mutex " << std::hex << hr; + return false; + } + keyed_mutex_acquire_key_++; + keyed_mutex_acquired_ = true; + } + return true; } - void SharedImageBackingD3D::EndAccessD3D11() { - shared_state_->EndAccessD3D11(); + if (dxgi_keyed_mutex_) { + const HRESULT hr = dxgi_keyed_mutex_->ReleaseSync(keyed_mutex_acquire_key_); + if (FAILED(hr)) { + DLOG(ERROR) << "Unable to release the keyed mutex " << std::hex << hr; + return; + } + keyed_mutex_acquired_ = false; + } } HANDLE SharedImageBackingD3D::GetSharedHandle() const { - return shared_state_->GetSharedHandle(); + return shared_handle_.Get(); } gl::GLImage* SharedImageBackingD3D::GetGLImage() const { - return gl_texture_->GetLevelImage(gl_texture_->target(), 0u); + return image_.get(); } bool SharedImageBackingD3D::PresentSwapChain() { @@ -538,12 +244,10 @@ } gl::GLApi* const api = gl::g_current_gl_context; + ScopedRestoreTexture2D scoped_restore(api); - DCHECK_EQ(gl_texture_->target(), static_cast<unsigned>(GL_TEXTURE_2D)); - ScopedRestoreTexture scoped_restore(api, GL_TEXTURE_2D); - - api->glBindTextureFn(GL_TEXTURE_2D, gl_texture_->service_id()); - if (!GetGLImage()->BindTexImage(GL_TEXTURE_2D)) { + api->glBindTextureFn(GL_TEXTURE_2D, texture_->service_id()); + if (!image_->BindTexImage(GL_TEXTURE_2D)) { DLOG(ERROR) << "GLImage::BindTexImage failed"; return false; } @@ -559,7 +263,7 @@ MemoryTypeTracker* tracker) { TRACE_EVENT0("gpu", "SharedImageBackingD3D::ProduceGLTexturePassthrough"); return std::make_unique<SharedImageRepresentationGLTexturePassthroughD3D>( - manager, this, tracker, gl_texture_); + manager, this, tracker, texture_); } std::unique_ptr<SharedImageRepresentationSkia>
diff --git a/gpu/command_buffer/service/shared_image_backing_d3d.h b/gpu/command_buffer/service/shared_image_backing_d3d.h index 5af24d9..b6bdb07 100644 --- a/gpu/command_buffer/service/shared_image_backing_d3d.h +++ b/gpu/command_buffer/service/shared_image_backing_d3d.h
@@ -42,7 +42,7 @@ class GPU_GLES2_EXPORT SharedImageBackingD3D : public ClearTrackingSharedImageBacking { public: - static std::unique_ptr<SharedImageBackingD3D> CreateFromSwapChainBuffer( + SharedImageBackingD3D( const Mailbox& mailbox, viz::ResourceFormat format, const gfx::Size& size, @@ -50,42 +50,13 @@ GrSurfaceOrigin surface_origin, SkAlphaType alpha_type, uint32_t usage, - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain, - size_t buffer_index); - - static std::unique_ptr<SharedImageBackingD3D> CreateFromSharedHandle( - const Mailbox& mailbox, - viz::ResourceFormat format, - const gfx::Size& size, - const gfx::ColorSpace& color_space, - GrSurfaceOrigin surface_origin, - SkAlphaType alpha_type, - uint32_t usage, + scoped_refptr<gles2::TexturePassthrough> texture, + scoped_refptr<gl::GLImage> image, + size_t buffer_index, Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, - base::win::ScopedHandle shared_handle); - - // TODO(sunnyps): Remove this after migrating DXVA decoder to EGLImage. - static std::unique_ptr<SharedImageBackingD3D> CreateFromGLTexture( - const Mailbox& mailbox, - viz::ResourceFormat format, - const gfx::Size& size, - const gfx::ColorSpace& color_space, - GrSurfaceOrigin surface_origin, - SkAlphaType alpha_type, - uint32_t usage, - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, - scoped_refptr<gles2::TexturePassthrough> gl_texture); - - static std::vector<std::unique_ptr<SharedImageBackingD3D>> - CreateFromVideoTexture( - base::span<const Mailbox> mailboxes, - DXGI_FORMAT dxgi_format, - const gfx::Size& size, - uint32_t usage, - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, - unsigned array_slice, - base::win::ScopedHandle shared_handle = base::win::ScopedHandle()); + base::win::ScopedHandle shared_handle, + Microsoft::WRL::ComPtr<IDXGIKeyedMutex> dxgi_keyed_mutex); ~SharedImageBackingD3D() override; @@ -129,64 +100,29 @@ scoped_refptr<SharedContextState> context_state) override; private: - class SharedState : public base::RefCountedThreadSafe<SharedState> { - public: - explicit SharedState( - base::win::ScopedHandle shared_handle = base::win::ScopedHandle(), - Microsoft::WRL::ComPtr<IDXGIKeyedMutex> dxgi_keyed_mutex = nullptr); - - bool BeginAccessD3D11(); - void EndAccessD3D11(); - - bool BeginAccessD3D12(uint64_t* acquire_key); - void EndAccessD3D12(); - - HANDLE GetSharedHandle() const; - - private: - friend class base::RefCountedThreadSafe<SharedState>; - ~SharedState(); - - // If |d3d11_texture_| has a keyed mutex, it will be stored in - // |dxgi_keyed_mutex_|. The keyed mutex is used to synchronize D3D11 and - // D3D12 Chromium components. |dxgi_keyed_mutex_| is the D3D11 side of the - // keyed mutex. To create the corresponding D3D12 interface, pass the handle - // stored in |shared_handle_| to ID3D12Device::OpenSharedHandle. Only one - // component is allowed to read/write to the texture at a time. - // |acquire_key_| is incremented on every Acquire/Release usage. - base::win::ScopedHandle shared_handle_; - Microsoft::WRL::ComPtr<IDXGIKeyedMutex> dxgi_keyed_mutex_; - uint64_t acquire_key_ = 0; - bool acquired_for_d3d12_ = false; - int acquired_for_d3d11_count_ = 0; - }; - - SharedImageBackingD3D( - const Mailbox& mailbox, - viz::ResourceFormat format, - const gfx::Size& size, - const gfx::ColorSpace& color_space, - GrSurfaceOrigin surface_origin, - SkAlphaType alpha_type, - uint32_t usage, - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, - scoped_refptr<gles2::TexturePassthrough> gl_texture, - Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain = nullptr, - size_t buffer_index = 0, - scoped_refptr<SharedState> shared_state = - base::MakeRefCounted<SharedState>()); - uint32_t GetAllowedDawnUsages() const; + Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain_; + scoped_refptr<gles2::TexturePassthrough> texture_; + scoped_refptr<gl::GLImage> image_; + const size_t buffer_index_; + // Texture could be nullptr if an empty backing is needed for testing. Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture_; - scoped_refptr<gles2::TexturePassthrough> gl_texture_; - Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain_; - - const size_t buffer_index_; - - scoped_refptr<SharedState> shared_state_; + // If d3d11_texture_ has a keyed mutex, it will be stored in + // dxgi_keyed_mutex. The keyed mutex is used to synchronize + // D3D11 and D3D12 Chromium components. + // dxgi_keyed_mutex_ is the D3D11 side of the keyed mutex. + // To create the corresponding D3D12 interface, pass the handle + // stored in shared_handle_ to ID3D12Device::OpenSharedHandle. + // Only one component is allowed to read/write to the texture + // at a time. keyed_mutex_acquire_key_ is incremented on every + // Acquire/Release usage. + base::win::ScopedHandle shared_handle_; + Microsoft::WRL::ComPtr<IDXGIKeyedMutex> dxgi_keyed_mutex_; + uint64_t keyed_mutex_acquire_key_ = 0; + bool keyed_mutex_acquired_ = false; // If external_image_ exists, it means Dawn produced the D3D12 side of the // D3D11 texture created by ID3D12Device::OpenSharedHandle.
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_d3d.cc b/gpu/command_buffer/service/shared_image_backing_factory_d3d.cc index e2a8c22..02225c6 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_d3d.cc +++ b/gpu/command_buffer/service/shared_image_backing_factory_d3d.cc
@@ -18,6 +18,24 @@ namespace { +class ScopedRestoreTexture2D { + public: + explicit ScopedRestoreTexture2D(gl::GLApi* api) : api_(api) { + GLint binding = 0; + api->glGetIntegervFn(GL_TEXTURE_BINDING_2D, &binding); + prev_binding_ = binding; + } + + ~ScopedRestoreTexture2D() { + api_->glBindTextureFn(GL_TEXTURE_2D, prev_binding_); + } + + private: + gl::GLApi* const api_; + GLuint prev_binding_ = 0; + DISALLOW_COPY_AND_ASSIGN(ScopedRestoreTexture2D); +}; + bool ClearBackBuffer(Microsoft::WRL::ComPtr<IDXGISwapChain1>& swap_chain, Microsoft::WRL::ComPtr<ID3D11Device>& d3d11_device) { Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture; @@ -90,6 +108,80 @@ gl::DirectCompositionSurfaceWin::IsSwapChainTearingSupported(); } +std::unique_ptr<SharedImageBacking> SharedImageBackingFactoryD3D::MakeBacking( + const Mailbox& mailbox, + viz::ResourceFormat format, + const gfx::Size& size, + const gfx::ColorSpace& color_space, + GrSurfaceOrigin surface_origin, + SkAlphaType alpha_type, + uint32_t usage, + Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain, + size_t buffer_index, + Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture, + base::win::ScopedHandle shared_handle) { + gl::GLApi* const api = gl::g_current_gl_context; + ScopedRestoreTexture2D scoped_restore(api); + + const GLenum target = GL_TEXTURE_2D; + GLuint service_id = 0; + api->glGenTexturesFn(1, &service_id); + api->glBindTextureFn(target, service_id); + api->glTexParameteriFn(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + api->glTexParameteriFn(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + api->glTexParameteriFn(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + api->glTexParameteriFn(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + Microsoft::WRL::ComPtr<IDXGIKeyedMutex> dxgi_keyed_mutex; + + if (swap_chain) { + DCHECK(!d3d11_texture); + DCHECK(!shared_handle.IsValid()); + const HRESULT hr = + swap_chain->GetBuffer(buffer_index, IID_PPV_ARGS(&d3d11_texture)); + if (FAILED(hr)) { + DLOG(ERROR) << "GetBuffer failed with error " << std::hex; + return nullptr; + } + } else if (shared_handle.IsValid()) { + // Keyed mutexes are required for Dawn interop but are not used + // for XR composition where fences are used instead. + d3d11_texture.As(&dxgi_keyed_mutex); + } + DCHECK(d3d11_texture); + + // The GL internal format can differ from the underlying swap chain format + // e.g. RGBA8 or RGB8 instead of BGRA8. + const GLenum internal_format = viz::GLInternalFormat(format); + const GLenum data_type = viz::GLDataType(format); + const GLenum data_format = viz::GLDataFormat(format); + auto image = base::MakeRefCounted<gl::GLImageD3D>( + size, internal_format, data_type, d3d11_texture, swap_chain); + DCHECK_EQ(image->GetDataFormat(), data_format); + if (!image->Initialize()) { + DLOG(ERROR) << "GLImageD3D::Initialize failed"; + return nullptr; + } + if (!image->BindTexImage(target)) { + DLOG(ERROR) << "GLImageD3D::BindTexImage failed"; + return nullptr; + } + + scoped_refptr<gles2::TexturePassthrough> texture = + base::MakeRefCounted<gles2::TexturePassthrough>(service_id, target); + texture->SetLevelImage(target, 0, image.get()); + GLint texture_memory_size = 0; + api->glGetTexParameterivFn(target, GL_MEMORY_SIZE_ANGLE, + &texture_memory_size); + texture->SetEstimatedSize(texture_memory_size); + + return std::make_unique<SharedImageBackingD3D>( + mailbox, format, size, color_space, surface_origin, alpha_type, usage, + std::move(swap_chain), std::move(texture), std::move(image), buffer_index, + std::move(d3d11_texture), std::move(shared_handle), + std::move(dxgi_keyed_mutex)); +} + SharedImageBackingFactoryD3D::SwapChainBackings SharedImageBackingFactoryD3D::CreateSwapChain( const Mailbox& front_buffer_mailbox, @@ -171,30 +263,18 @@ if (!ClearBackBuffer(swap_chain, d3d11_device_)) return {nullptr, nullptr}; - Microsoft::WRL::ComPtr<ID3D11Texture2D> back_buffer_texture; - hr = swap_chain->GetBuffer(0, IID_PPV_ARGS(&back_buffer_texture)); - if (FAILED(hr)) { - DLOG(ERROR) << "GetBuffer failed with error " << std::hex; - return {nullptr, nullptr}; - } - auto back_buffer_backing = SharedImageBackingD3D::CreateFromSwapChainBuffer( + auto back_buffer_backing = MakeBacking( back_buffer_mailbox, format, size, color_space, surface_origin, - alpha_type, usage, std::move(back_buffer_texture), swap_chain, - /*buffer_index=*/0); + alpha_type, usage, swap_chain, 0 /* buffer_index */, + nullptr /* d3d11_texture */, base::win::ScopedHandle()); if (!back_buffer_backing) return {nullptr, nullptr}; back_buffer_backing->SetCleared(); - Microsoft::WRL::ComPtr<ID3D11Texture2D> front_buffer_texture; - hr = swap_chain->GetBuffer(1, IID_PPV_ARGS(&front_buffer_texture)); - if (FAILED(hr)) { - DLOG(ERROR) << "GetBuffer failed with error " << std::hex; - return {nullptr, nullptr}; - } - auto front_buffer_backing = SharedImageBackingD3D::CreateFromSwapChainBuffer( + auto front_buffer_backing = MakeBacking( front_buffer_mailbox, format, size, color_space, surface_origin, - alpha_type, usage, std::move(front_buffer_texture), swap_chain, - /*buffer_index=*/1); + alpha_type, usage, swap_chain, 1 /* buffer_index */, + nullptr /* d3d11_texture */, base::win::ScopedHandle()); if (!front_buffer_backing) return {nullptr, nullptr}; front_buffer_backing->SetCleared(); @@ -265,12 +345,14 @@ << std::hex << hr; return nullptr; } + // Put the shared handle into an RAII object as quickly as possible to // ensure we do not leak it. base::win::ScopedHandle scoped_shared_handle(shared_handle); - return SharedImageBackingD3D::CreateFromSharedHandle( - mailbox, format, size, color_space, surface_origin, alpha_type, usage, - std::move(d3d11_texture), std::move(scoped_shared_handle)); + + return MakeBacking(mailbox, format, size, color_space, surface_origin, + alpha_type, usage, nullptr, 0, std::move(d3d11_texture), + std::move(scoped_shared_handle)); } std::unique_ptr<SharedImageBacking> @@ -345,10 +427,11 @@ return nullptr; } - auto backing = SharedImageBackingD3D::CreateFromSharedHandle( - mailbox, viz::GetResourceFormat(format), size, color_space, - surface_origin, alpha_type, usage, std::move(d3d11_texture), - std::move(handle.dxgi_handle)); + auto backing = + MakeBacking(mailbox, viz::GetResourceFormat(format), size, color_space, + surface_origin, alpha_type, usage, /*swap_chain=*/nullptr, + /*buffer_index=*/0, std::move(d3d11_texture), + std::move(handle.dxgi_handle)); if (backing) backing->SetCleared(); return backing;
diff --git a/gpu/command_buffer/service/shared_image_backing_factory_d3d_unittest.cc b/gpu/command_buffer/service/shared_image_backing_factory_d3d_unittest.cc index c84072b..356d812 100644 --- a/gpu/command_buffer/service/shared_image_backing_factory_d3d_unittest.cc +++ b/gpu/command_buffer/service/shared_image_backing_factory_d3d_unittest.cc
@@ -33,15 +33,6 @@ #include <dawn_native/DawnNative.h> #endif // BUILDFLAG(USE_DAWN) -#define SCOPED_GL_CLEANUP_VAR(api, func, var) \ - base::ScopedClosureRunner delete_##var(base::BindOnce( \ - [](gl::GLApi* api, GLuint var) { api->gl##func##Fn(var); }, api, var)) - -#define SCOPED_GL_CLEANUP_PTR(api, func, n, var) \ - base::ScopedClosureRunner delete_##var(base::BindOnce( \ - [](gl::GLApi* api, GLuint var) { api->gl##func##Fn(n, &var); }, api, \ - var)) - namespace gpu { namespace { @@ -461,8 +452,6 @@ } } - void RunVideoTest(bool use_shared_handle); - scoped_refptr<SharedContextState> context_state_; }; @@ -1049,248 +1038,5 @@ } #endif // BUILDFLAG(USE_DAWN) -void SharedImageBackingFactoryD3DTest::RunVideoTest(bool use_shared_handle) { - if (!IsD3DSharedImageSupported()) - return; - - Microsoft::WRL::ComPtr<ID3D11Device> d3d11_device = - shared_image_factory_->GetDeviceForTesting(); - - const gfx::Size size(32, 32); - - const unsigned kYFillValue = 0x12; - const unsigned kUFillValue = 0x23; - const unsigned kVFillValue = 0x34; - - const size_t kYPlaneSize = size.width() * size.height(); - - std::vector<unsigned char> video_data; - video_data.resize(kYPlaneSize * 3 / 2); - memset(video_data.data(), kYFillValue, kYPlaneSize); - for (size_t i = 0; i < kYPlaneSize / 2; i += 2) { - video_data[kYPlaneSize + i] = kUFillValue; - video_data[kYPlaneSize + i + 1] = kVFillValue; - } - - D3D11_SUBRESOURCE_DATA data = {}; - data.pSysMem = static_cast<const void*>(video_data.data()); - data.SysMemPitch = static_cast<UINT>(size.width()); - - CD3D11_TEXTURE2D_DESC desc(DXGI_FORMAT_NV12, size.width(), size.height(), 1, - 1, D3D11_BIND_SHADER_RESOURCE); - if (use_shared_handle) { - desc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_NTHANDLE | - D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX; - } - - Microsoft::WRL::ComPtr<ID3D11Texture2D> d3d11_texture; - HRESULT hr = d3d11_device->CreateTexture2D(&desc, &data, &d3d11_texture); - ASSERT_TRUE(SUCCEEDED(hr)); - - uint32_t usage = - gpu::SHARED_IMAGE_USAGE_VIDEO_DECODE | gpu::SHARED_IMAGE_USAGE_GLES2 | - gpu::SHARED_IMAGE_USAGE_RASTER | gpu::SHARED_IMAGE_USAGE_DISPLAY | - gpu::SHARED_IMAGE_USAGE_SCANOUT; - - base::win::ScopedHandle shared_handle; - if (use_shared_handle) { - Microsoft::WRL::ComPtr<IDXGIResource1> dxgi_resource; - hr = d3d11_texture.As(&dxgi_resource); - ASSERT_TRUE(SUCCEEDED(hr)); - - HANDLE handle; - hr = dxgi_resource->CreateSharedHandle( - nullptr, DXGI_SHARED_RESOURCE_READ | DXGI_SHARED_RESOURCE_WRITE, - nullptr, &handle); - ASSERT_TRUE(SUCCEEDED(hr)); - - shared_handle.Set(handle); - ASSERT_TRUE(shared_handle.IsValid()); - - usage |= gpu::SHARED_IMAGE_USAGE_WEBGPU; - } - - const gpu::Mailbox mailboxes[] = {gpu::Mailbox::GenerateForSharedImage(), - gpu::Mailbox::GenerateForSharedImage()}; - - auto shared_image_backings = SharedImageBackingD3D::CreateFromVideoTexture( - mailboxes, DXGI_FORMAT_NV12, size, usage, d3d11_texture, - /*array_slice=*/0, std::move(shared_handle)); - ASSERT_EQ(shared_image_backings.size(), 2u); - - const gfx::Size plane_sizes[] = { - size, gfx::Size(size.width() / 2, size.height() / 2)}; - const viz::ResourceFormat plane_formats[] = {viz::RED_8, viz::RG_88}; - - std::vector<std::unique_ptr<SharedImageRepresentationFactoryRef>> - shared_image_refs; - for (size_t i = 0; i < shared_image_backings.size(); i++) { - auto& backing = shared_image_backings[i]; - - EXPECT_EQ(backing->mailbox(), mailboxes[i]); - EXPECT_EQ(backing->size(), plane_sizes[i]); - EXPECT_EQ(backing->format(), plane_formats[i]); - EXPECT_EQ(backing->color_space(), gfx::ColorSpace()); - EXPECT_EQ(backing->surface_origin(), kTopLeft_GrSurfaceOrigin); - EXPECT_EQ(backing->alpha_type(), kPremul_SkAlphaType); - EXPECT_EQ(backing->usage(), usage); - EXPECT_TRUE(backing->IsCleared()); - - shared_image_refs.push_back(shared_image_manager_.Register( - std::move(backing), memory_type_tracker_.get())); - } - - // Setup GL shaders, framebuffers, uniforms, etc. - static const char* kVideoFragmentShaderSrc = - "#extension GL_OES_EGL_image_external : require\n" - "precision mediump float;\n" - "uniform samplerExternalOES u_texture_y;\n" - "uniform samplerExternalOES u_texture_uv;\n" - "varying vec2 v_texCoord;\n" - "void main() {\n" - " gl_FragColor.r = texture2D(u_texture_y, v_texCoord).r;\n" - " gl_FragColor.gb = texture2D(u_texture_uv, v_texCoord).rg;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - - gl::GLApi* api = gl::g_current_gl_context; - - GLint status = 0; - GLuint vertex_shader = api->glCreateShaderFn(GL_VERTEX_SHADER); - SCOPED_GL_CLEANUP_VAR(api, DeleteShader, vertex_shader); - ASSERT_NE(vertex_shader, 0u); - api->glShaderSourceFn(vertex_shader, 1, &kVertexShaderSrc, nullptr); - api->glCompileShaderFn(vertex_shader); - api->glGetShaderivFn(vertex_shader, GL_COMPILE_STATUS, &status); - ASSERT_NE(status, 0); - - GLuint fragment_shader = api->glCreateShaderFn(GL_FRAGMENT_SHADER); - SCOPED_GL_CLEANUP_VAR(api, DeleteShader, fragment_shader); - ASSERT_NE(fragment_shader, 0u); - api->glShaderSourceFn(fragment_shader, 1, &kVideoFragmentShaderSrc, nullptr); - api->glCompileShaderFn(fragment_shader); - api->glGetShaderivFn(fragment_shader, GL_COMPILE_STATUS, &status); - ASSERT_NE(status, 0); - - GLuint program = api->glCreateProgramFn(); - ASSERT_NE(program, 0u); - SCOPED_GL_CLEANUP_VAR(api, DeleteProgram, program); - api->glAttachShaderFn(program, vertex_shader); - api->glAttachShaderFn(program, fragment_shader); - api->glLinkProgramFn(program); - api->glGetProgramivFn(program, GL_LINK_STATUS, &status); - ASSERT_NE(status, 0); - - GLint vertex_location = api->glGetAttribLocationFn(program, "a_position"); - ASSERT_NE(vertex_location, -1); - - GLint y_texture_location = - api->glGetUniformLocationFn(program, "u_texture_y"); - ASSERT_NE(y_texture_location, -1); - - GLint uv_texture_location = - api->glGetUniformLocationFn(program, "u_texture_uv"); - ASSERT_NE(uv_texture_location, -1); - - GLuint fbo, renderbuffer = 0u; - api->glGenFramebuffersEXTFn(1, &fbo); - ASSERT_NE(fbo, 0u); - SCOPED_GL_CLEANUP_PTR(api, DeleteFramebuffersEXT, 1, fbo); - api->glBindFramebufferEXTFn(GL_FRAMEBUFFER, fbo); - - api->glGenRenderbuffersEXTFn(1, &renderbuffer); - ASSERT_NE(renderbuffer, 0u); - SCOPED_GL_CLEANUP_PTR(api, DeleteRenderbuffersEXT, 1, renderbuffer); - api->glBindRenderbufferEXTFn(GL_RENDERBUFFER, renderbuffer); - - api->glRenderbufferStorageEXTFn(GL_RENDERBUFFER, GL_RGBA8_OES, size.width(), - size.height()); - api->glFramebufferRenderbufferEXTFn(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - GL_RENDERBUFFER, renderbuffer); - ASSERT_EQ(api->glCheckFramebufferStatusEXTFn(GL_FRAMEBUFFER), - static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE)); - - // Set the clear color to green. - api->glViewportFn(0, 0, size.width(), size.height()); - api->glClearColorFn(0.0f, 1.0f, 0.0f, 1.0f); - api->glClearFn(GL_COLOR_BUFFER_BIT); - - GLuint vbo = 0u; - api->glGenBuffersARBFn(1, &vbo); - ASSERT_NE(vbo, 0u); - SCOPED_GL_CLEANUP_PTR(api, DeleteBuffersARB, 1, vbo); - api->glBindBufferFn(GL_ARRAY_BUFFER, vbo); - static const float vertices[] = { - 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, - 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, - }; - api->glBufferDataFn(GL_ARRAY_BUFFER, sizeof(vertices), vertices, - GL_STATIC_DRAW); - - ASSERT_EQ(api->glGetErrorFn(), static_cast<GLenum>(GL_NO_ERROR)); - - // Create the representations for the planes, get the texture ids, bind to - // samplers, and draw. - { - auto y_texture = - shared_image_representation_factory_->ProduceGLTexturePassthrough( - mailboxes[0]); - ASSERT_NE(y_texture, nullptr); - - auto uv_texture = - shared_image_representation_factory_->ProduceGLTexturePassthrough( - mailboxes[1]); - ASSERT_NE(uv_texture, nullptr); - - auto y_texture_access = y_texture->BeginScopedAccess( - GL_SHARED_IMAGE_ACCESS_MODE_READ_CHROMIUM, - SharedImageRepresentation::AllowUnclearedAccess::kNo); - ASSERT_NE(y_texture_access, nullptr); - - auto uv_texture_access = uv_texture->BeginScopedAccess( - GL_SHARED_IMAGE_ACCESS_MODE_READ_CHROMIUM, - SharedImageRepresentation::AllowUnclearedAccess::kNo); - ASSERT_NE(uv_texture_access, nullptr); - - api->glActiveTextureFn(GL_TEXTURE0); - api->glBindTextureFn(GL_TEXTURE_EXTERNAL_OES, - y_texture->GetTextureBase()->service_id()); - ASSERT_EQ(api->glGetErrorFn(), static_cast<GLenum>(GL_NO_ERROR)); - - api->glActiveTextureFn(GL_TEXTURE1); - api->glBindTextureFn(GL_TEXTURE_EXTERNAL_OES, - uv_texture->GetTextureBase()->service_id()); - ASSERT_EQ(api->glGetErrorFn(), static_cast<GLenum>(GL_NO_ERROR)); - - api->glUseProgramFn(program); - - api->glEnableVertexAttribArrayFn(vertex_location); - api->glVertexAttribPointerFn(vertex_location, 2, GL_FLOAT, GL_FALSE, 0, 0); - - api->glUniform1iFn(y_texture_location, 0); - api->glUniform1iFn(uv_texture_location, 1); - - api->glDrawArraysFn(GL_TRIANGLES, 0, 6); - ASSERT_EQ(api->glGetErrorFn(), static_cast<GLenum>(GL_NO_ERROR)); - - GLubyte pixel_color[4]; - api->glReadPixelsFn(size.width() / 2, size.height() / 2, 1, 1, GL_RGBA, - GL_UNSIGNED_BYTE, pixel_color); - EXPECT_EQ(kYFillValue, pixel_color[0]); - EXPECT_EQ(kUFillValue, pixel_color[1]); - EXPECT_EQ(kVFillValue, pixel_color[2]); - EXPECT_EQ(0xff, pixel_color[3]); - } - // TODO(dawn:551): Test Dawn access after multi-planar support lands in Dawn. -} - -TEST_F(SharedImageBackingFactoryD3DTest, CreateFromVideoTexture) { - RunVideoTest(/*use_shared_handle=*/false); -} - -TEST_F(SharedImageBackingFactoryD3DTest, CreateFromVideoTextureSharedHandle) { - RunVideoTest(/*use_shared_handle=*/true); -} - } // anonymous namespace } // namespace gpu
diff --git a/gpu/ipc/client/shared_image_interface_proxy.cc b/gpu/ipc/client/shared_image_interface_proxy.cc index 68cae6b..dd1585a 100644 --- a/gpu/ipc/client/shared_image_interface_proxy.cc +++ b/gpu/ipc/client/shared_image_interface_proxy.cc
@@ -308,7 +308,7 @@ GenerateDependenciesFromSyncToken(std::move(sync_token), host_); { base::AutoLock lock(lock_); - last_flush_id_ = host_->EnqueueDeferredMessage(GpuChannelMsg_Nop(), + last_flush_id_ = host_->EnqueueDeferredMessage(GpuChannelMsg_Nop(route_id_), std::move(dependencies)); } }
diff --git a/gpu/ipc/common/gpu_messages.h b/gpu/ipc/common/gpu_messages.h index 5e38362..5c4f8dff 100644 --- a/gpu/ipc/common/gpu_messages.h +++ b/gpu/ipc/common/gpu_messages.h
@@ -214,7 +214,7 @@ // Simple NOP message which can be used as fence to ensure all previous sent // messages have been received. -IPC_SYNC_MESSAGE_CONTROL0_0(GpuChannelMsg_Nop) +IPC_SYNC_MESSAGE_ROUTED0_0(GpuChannelMsg_Nop) // Creates a StreamTexture attached to the provided |stream_id|. IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_CreateStreamTexture,
diff --git a/gpu/vulkan/BUILD.gn b/gpu/vulkan/BUILD.gn index b91be74..86021a4 100644 --- a/gpu/vulkan/BUILD.gn +++ b/gpu/vulkan/BUILD.gn
@@ -146,13 +146,12 @@ data_deps += [ "//third_party/fuchsia-sdk:vulkan_base" ] - # VulkanInstance enables validation layer in Debug builds and when DCHECKs - # are enabled in Release builds. In these cases the validation layer - # libraries and configs need to be included in the generated Fuchsia - # package. - if (is_debug || dcheck_always_on) { - data_deps += [ "//third_party/fuchsia-sdk:vulkan_validation" ] - } + # TODO(fxbug.dev/73208): Vulkan validation is disabled temporarily. + # Re-enable once Vulkan is updated. + # + # if (is_debug || dcheck_always_on) { + # data_deps += [ "//third_party/fuchsia-sdk:vulkan_validation" ] + # } } }
diff --git a/headless/test/headless_protocol_browsertest.cc b/headless/test/headless_protocol_browsertest.cc index 1c5ed22..279f0032 100644 --- a/headless/test/headless_protocol_browsertest.cc +++ b/headless/test/headless_protocol_browsertest.cc
@@ -261,7 +261,13 @@ HEADLESS_PROTOCOL_TEST(DragStarted, "input/dragIntercepted.js") -HEADLESS_PROTOCOL_TEST(InputClipboardOps, "input/input-clipboard-ops.js") +// https://crbug.com/1205451 +#if defined(OS_MAC) +#define MAYBE_InputClipboardOps DISABLED_InputClipboardOps +#else +#define MAYBE_InputClipboardOps InputClipboardOps +#endif +HEADLESS_PROTOCOL_TEST(MAYBE_InputClipboardOps, "input/input-clipboard-ops.js") HEADLESS_PROTOCOL_TEST(HeadlessSessionBasicsTest, "sessions/headless-session-basics.js")
diff --git a/infra/config/generated/commit-queue.cfg b/infra/config/generated/commit-queue.cfg index e2ad292..ee86a78 100644 --- a/infra/config/generated/commit-queue.cfg +++ b/infra/config/generated/commit-queue.cfg
@@ -1306,10 +1306,6 @@ location_regexp_exclude: ".+/[+]/infra/config/.+" } builders { - name: "chromium/try/linux_chromium_asan_rel_ng_bionic" - includable_only: true - } - builders { name: "chromium/try/linux_chromium_cfi_rel_ng" includable_only: true }
diff --git a/infra/config/generated/cr-buildbucket.cfg b/infra/config/generated/cr-buildbucket.cfg index d4d3883..cbb9580 100644 --- a/infra/config/generated/cr-buildbucket.cfg +++ b/infra/config/generated/cr-buildbucket.cfg
@@ -7293,68 +7293,6 @@ } } builders { - name: "Linux ASan LSan (bionic)" - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.chromium.ci" - dimensions: "ssd:1" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" - cipd_version: "refs/heads/master" - cmd: "recipes" - } - properties: "{\"$build/goma\":{\"enable_ats\":true,\"jobs\":500,\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\",\"use_luci_auth\":true},\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"$recipe_engine/isolated\":{\"server\":\"https://isolateserver.appspot.com\"},\"builder_group\":\"chromium.memory\",\"recipe\":\"chromium\"}" - execution_timeout_secs: 10800 - build_numbers: YES - service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "chromium.resultdb.result_sink" - value: 100 - } - experiments { - key: "chromium.resultdb.result_sink.gtests_local" - value: 100 - } - experiments { - key: "chromium.resultdb.result_sink.junit_tests" - value: 100 - } - experiments { - key: "luci.buildbucket.use_bbagent" - value: 100 - } - experiments { - key: "luci.use_realms" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "luci-resultdb" - dataset: "chromium" - table: "ci_test_results" - test_results {} - } - bq_exports { - project: "luci-resultdb" - dataset: "chromium" - table: "gpu_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test/.+" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "Linux ASan LSan Builder" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper" @@ -13268,6 +13206,130 @@ } } builders { + name: "TSAN Release (core-32) (goma)" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "builderless:1" + dimensions: "cores:32" + dimensions: "cpu:x86-64" + dimensions: "os:Ubuntu-16.04" + dimensions: "pool:luci.chromium.ci" + dimensions: "ssd:0" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/master" + cmd: "recipes" + } + properties: "{\"$build/goma\":{\"enable_ats\":true,\"jobs\":250,\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\",\"use_luci_auth\":true},\"$kitchen\":{\"devshell\":true,\"emulate_gce\":true,\"git_auth\":true},\"$recipe_engine/isolated\":{\"server\":\"https://isolateserver.appspot.com\"},\"builder_group\":\"chromium.fyi\",\"recipe\":\"chromium\"}" + execution_timeout_secs: 36000 + build_numbers: YES + service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" + experiments { + key: "chromium.resultdb.result_sink" + value: 100 + } + experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { + key: "chromium.resultdb.result_sink.junit_tests" + value: 100 + } + experiments { + key: "luci.buildbucket.use_bbagent" + value: 100 + } + experiments { + key: "luci.use_realms" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "ci_test_results" + test_results {} + } + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "gpu_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test/.+" + } + } + } + history_options { + use_invocation_timestamp: true + } + } + } + builders { + name: "TSAN Release (core-32) (reclient)" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "builderless:1" + dimensions: "cores:32" + dimensions: "cpu:x86-64" + dimensions: "os:Ubuntu-16.04" + dimensions: "pool:luci.chromium.ci" + dimensions: "ssd:0" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/master" + cmd: "recipes" + } + properties: "{\"$build/reclient\":{\"instance\":\"rbe-chromium-trusted\",\"jobs\":250,\"metrics_project\":\"chromium-reclient-metrics\",\"rewrapper_env\":{\"RBE_cache_silo\":\"TSAN Release (core-32) (reclient)\"}},\"$kitchen\":{\"devshell\":true,\"emulate_gce\":true,\"git_auth\":true},\"$recipe_engine/isolated\":{\"server\":\"https://isolateserver.appspot.com\"},\"builder_group\":\"chromium.fyi\",\"recipe\":\"chromium\"}" + execution_timeout_secs: 36000 + build_numbers: YES + service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" + experiments { + key: "chromium.resultdb.result_sink" + value: 100 + } + experiments { + key: "chromium.resultdb.result_sink.gtests_local" + value: 100 + } + experiments { + key: "chromium.resultdb.result_sink.junit_tests" + value: 100 + } + experiments { + key: "luci.buildbucket.use_bbagent" + value: 100 + } + experiments { + key: "luci.use_realms" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "ci_test_results" + test_results {} + } + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "gpu_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test/.+" + } + } + } + history_options { + use_invocation_timestamp: true + } + } + } + builders { name: "TSAN Release (deps-cache) (reclient)" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper" @@ -22841,7 +22903,7 @@ dimensions: "builderless:1" dimensions: "cores:32" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" + dimensions: "os:Ubuntu-18.04" dimensions: "pool:luci.chromium.ci" dimensions: "ssd:0" exe { @@ -24172,7 +24234,7 @@ dimensions: "builderless:1" dimensions: "cores:8" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-18.04" dimensions: "pool:luci.chromium.ci" dimensions: "ssd:0" exe { @@ -34455,7 +34517,7 @@ dimensions: "builder:android-binary-size" dimensions: "cores:8" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" dimensions: "pool:luci.chromium.try" exe { cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" @@ -34844,7 +34906,7 @@ dimensions: "builder:android-lollipop-arm-rel" dimensions: "cores:16" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" dimensions: "pool:luci.chromium.try" exe { cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" @@ -34908,7 +34970,7 @@ dimensions: "builder:android-marshmallow-arm64-rel" dimensions: "cores:32" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" dimensions: "pool:luci.chromium.try" dimensions: "ssd:1" exe { @@ -35038,7 +35100,7 @@ dimensions: "builder:android-marshmallow-x86-rel" dimensions: "cores:16" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" dimensions: "pool:luci.chromium.try" dimensions: "ssd:1" exe { @@ -35232,7 +35294,7 @@ dimensions: "builderless:1" dimensions: "cores:32" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" + dimensions: "os:Ubuntu-18.04" dimensions: "pool:luci.chromium.try" dimensions: "ssd:0" exe { @@ -35686,7 +35748,7 @@ dimensions: "builder:android-pie-arm64-rel" dimensions: "cores:16" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" dimensions: "pool:luci.chromium.try" dimensions: "ssd:1" exe { @@ -37305,7 +37367,7 @@ dimensions: "builder:android_compile_dbg" dimensions: "cores:8" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" dimensions: "pool:luci.chromium.try" exe { cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" @@ -37499,7 +37561,7 @@ dimensions: "builder:android_cronet" dimensions: "cores:8" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" dimensions: "pool:luci.chromium.try" exe { cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" @@ -37952,7 +38014,7 @@ dimensions: "builder:cast_shell_android" dimensions: "cores:8" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" dimensions: "pool:luci.chromium.try" exe { cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" @@ -39823,7 +39885,7 @@ dimensions: "builderless:1" dimensions: "cores:32" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" + dimensions: "os:Ubuntu-18.04" dimensions: "pool:luci.chromium.try" dimensions: "ssd:0" exe { @@ -44891,7 +44953,7 @@ dimensions: "builder:lacros-amd64-generic-rel" dimensions: "cores:8" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-18.04" dimensions: "pool:luci.chromium.try" exe { cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" @@ -46057,7 +46119,7 @@ dimensions: "builder:linux-chromeos-compile-dbg" dimensions: "cores:8" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04" + dimensions: "os:Ubuntu-18.04" dimensions: "pool:luci.chromium.try" exe { cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" @@ -47351,7 +47413,7 @@ dimensions: "builderless:1" dimensions: "cores:32" dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-16.04|Ubuntu-18.04" + dimensions: "os:Ubuntu-18.04" dimensions: "pool:luci.chromium.try" dimensions: "ssd:0" exe { @@ -48954,71 +49016,6 @@ } } builders { - name: "linux_chromium_asan_rel_ng_bionic" - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.chromium.try" - dimensions: "ssd:1" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" - cipd_version: "refs/heads/master" - cmd: "recipes" - } - properties: "{\"$build/goma\":{\"enable_ats\":true,\"jobs\":150,\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\",\"use_luci_auth\":true},\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"$recipe_engine/isolated\":{\"server\":\"https://isolateserver.appspot.com\"},\"builder_group\":\"tryserver.chromium.linux\",\"recipe\":\"chromium_trybot\"}" - execution_timeout_secs: 14400 - expiration_secs: 7200 - grace_period { - seconds: 120 - } - caches { - name: "win_toolchain" - path: "win_toolchain" - } - build_numbers: YES - service_account: "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com" - task_template_canary_percentage { - value: 5 - } - experiments { - key: "chromium.resultdb.result_sink" - value: 100 - } - experiments { - key: "chromium.resultdb.result_sink.junit_tests" - value: 100 - } - experiments { - key: "luci.use_realms" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "luci-resultdb" - dataset: "chromium" - table: "try_test_results" - test_results {} - } - bq_exports { - project: "luci-resultdb" - dataset: "chromium" - table: "gpu_try_test_results" - test_results { - predicate { - test_id_regexp: "ninja://(chrome/test:|content/test:fuchsia_)telemetry_gpu_integration_test/.+" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "linux_chromium_cfi_rel_ng" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper"
diff --git a/infra/config/generated/luci-milo.cfg b/infra/config/generated/luci-milo.cfg index 344e108..a63b7481 100644 --- a/infra/config/generated/luci-milo.cfg +++ b/infra/config/generated/luci-milo.cfg
@@ -489,11 +489,6 @@ short_name: "tst" } builders { - name: "buildbucket/luci.chromium.ci/Linux ASan LSan (bionic)" - category: "chromium.memory|linux|asan bionic" - short_name: "bio" - } - builders { name: "buildbucket/luci.chromium.ci/Linux ASan LSan Builder" category: "chromium.memory|linux|asan lsan" short_name: "bld" @@ -1175,11 +1170,6 @@ short_name: "tst" } builders { - name: "buildbucket/luci.chromium.ci/Linux ASan LSan (bionic)" - category: "chromium.memory|linux|asan bionic" - short_name: "bio" - } - builders { name: "buildbucket/luci.chromium.ci/Linux ASan LSan Builder" category: "chromium.memory|linux|asan lsan" short_name: "bld" @@ -2058,9 +2048,6 @@ name: "buildbucket/luci.chromium.try/linux_chromium_asan_rel_ng" } builders { - name: "buildbucket/luci.chromium.try/linux_chromium_asan_rel_ng_bionic" - } - builders { name: "buildbucket/luci.chromium.try/linux_chromium_compile_dbg_ng" } builders { @@ -5934,6 +5921,16 @@ short_name: "dre" } builders { + name: "buildbucket/luci.chromium.ci/TSAN Release (core-32) (goma)" + category: "linux tsan" + short_name: "rre" + } + builders { + name: "buildbucket/luci.chromium.ci/TSAN Release (core-32) (reclient)" + category: "linux tsan" + short_name: "rre" + } + builders { name: "buildbucket/luci.chromium.ci/TSAN Release (deps-cache) (reclient)" category: "linux tsan" short_name: "rre" @@ -8800,11 +8797,6 @@ short_name: "tst" } builders { - name: "buildbucket/luci.chromium.ci/Linux ASan LSan (bionic)" - category: "linux|asan bionic" - short_name: "bio" - } - builders { name: "buildbucket/luci.chromium.ci/Linux ASan LSan Builder" category: "linux|asan lsan" short_name: "bld" @@ -13245,9 +13237,6 @@ name: "buildbucket/luci.chromium.try/linux_chromium_asan_rel_ng" } builders { - name: "buildbucket/luci.chromium.try/linux_chromium_asan_rel_ng_bionic" - } - builders { name: "buildbucket/luci.chromium.try/linux_chromium_cfi_rel_ng" } builders { @@ -14207,9 +14196,6 @@ name: "buildbucket/luci.chromium.try/linux_chromium_asan_rel_ng" } builders { - name: "buildbucket/luci.chromium.try/linux_chromium_asan_rel_ng_bionic" - } - builders { name: "buildbucket/luci.chromium.try/linux_chromium_cfi_rel_ng" } builders {
diff --git a/infra/config/generated/luci-notify.cfg b/infra/config/generated/luci-notify.cfg index d9eb661..c0577e84 100644 --- a/infra/config/generated/luci-notify.cfg +++ b/infra/config/generated/luci-notify.cfg
@@ -754,20 +754,6 @@ on_occurrence: FAILURE failed_step_regexp: "\\b(bot_update|compile|gclient runhooks|runhooks|update|\\w*nocompile_test)\\b" email { - recipients: "thomasanderson@chromium.org" - } - } - builders { - bucket: "ci" - name: "Linux ASan LSan (bionic)" - repository: "https://chromium.googlesource.com/chromium/src" - } -} -notifiers { - notifications { - on_occurrence: FAILURE - failed_step_regexp: "\\b(bot_update|compile|gclient runhooks|runhooks|update|\\w*nocompile_test)\\b" - email { rotation_urls: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" } template: "tree_closure_email_template"
diff --git a/infra/config/generated/luci-scheduler.cfg b/infra/config/generated/luci-scheduler.cfg index 0c70b56..3839e67 100644 --- a/infra/config/generated/luci-scheduler.cfg +++ b/infra/config/generated/luci-scheduler.cfg
@@ -1558,16 +1558,6 @@ } } job { - id: "Linux ASan LSan (bionic)" - realm: "ci" - acl_sets: "ci" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "luci.chromium.ci" - builder: "Linux ASan LSan (bionic)" - } -} -job { id: "Linux ASan LSan Builder" realm: "ci" acl_sets: "ci" @@ -2825,6 +2815,28 @@ } } job { + id: "TSAN Release (core-32) (goma)" + realm: "ci" + schedule: "triggered" + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "TSAN Release (core-32) (goma)" + } +} +job { + id: "TSAN Release (core-32) (reclient)" + realm: "ci" + schedule: "triggered" + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "TSAN Release (core-32) (reclient)" + } +} +job { id: "TSAN Release (deps-cache) (reclient)" realm: "ci" acl_sets: "ci" @@ -6873,7 +6885,6 @@ triggers: "Libfuzzer Upload Linux32 V8-ARM ASan Debug" triggers: "Libfuzzer Upload Mac ASan" triggers: "Libfuzzer Upload Windows ASan" - triggers: "Linux ASan LSan (bionic)" triggers: "Linux ASan LSan Builder" triggers: "Linux Builder" triggers: "Linux Builder (dbg)" @@ -6913,6 +6924,8 @@ triggers: "TSAN Debug" triggers: "TSAN Debug (reclient)" triggers: "TSAN Release" + triggers: "TSAN Release (core-32) (goma)" + triggers: "TSAN Release (core-32) (reclient)" triggers: "TSAN Release (deps-cache) (reclient)" triggers: "TSAN Release (deps-cache-full-files) (reclient)" triggers: "TSAN Release (j-250) (reclient)"
diff --git a/infra/config/generated/realms.cfg b/infra/config/generated/realms.cfg index cb020b7..bec47d7 100644 --- a/infra/config/generated/realms.cfg +++ b/infra/config/generated/realms.cfg
@@ -164,6 +164,8 @@ name: "pools/tests" bindings { role: "role/swarming.poolUser" + principals: "group:project-angle-ci-task-accounts" + principals: "group:project-angle-try-task-accounts" principals: "group:project-chromium-ci-task-accounts" principals: "group:project-chromium-findit-task-accounts" principals: "group:project-chromium-try-task-accounts"
diff --git a/infra/config/lib/try.star b/infra/config/lib/try.star index d6cf3ec..010b3cc 100644 --- a/infra/config/lib/try.star +++ b/infra/config/lib/try.star
@@ -218,7 +218,7 @@ ) def chromium_builder(*, name, **kwargs): - kwargs.setdefault("os", builders.os.LINUX_XENIAL_OR_BIONIC_REMOVE) + kwargs.setdefault("os", builders.os.LINUX_BIONIC_REMOVE) return try_builder( name = name, builder_group = "tryserver.chromium",
diff --git a/infra/config/subprojects/chromium/ci.star b/infra/config/subprojects/chromium/ci.star index 808bd50d..ddcf2e7 100644 --- a/infra/config/subprojects/chromium/ci.star +++ b/infra/config/subprojects/chromium/ci.star
@@ -1474,7 +1474,7 @@ # TODO: Change this back down to something reasonable once these builders # have populated their cached by getting through the compile step execution_timeout = 10 * time.hour, - os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, + os = os.LINUX_BIONIC_REMOVE, tree_closing = False, ) @@ -1804,6 +1804,7 @@ ), cq_mirrors_console_view = "mirrors", main_console_view = "main", + os = os.LINUX_BIONIC_REMOVE, ) ci.chromiumos_builder( @@ -3567,6 +3568,37 @@ ) ci.fyi_builder( + name = "TSAN Release (core-32) (goma)", + console_view_entry = consoles.console_view_entry( + category = "linux tsan", + short_name = "rre", + ), + cores = 32, + goma_jobs = 250, + configure_kitchen = True, + kitchen_emulate_gce = True, + os = os.LINUX_DEFAULT, + schedule = "triggered", # triggered manually via Scheduler UI +) + +ci.fyi_builder( + name = "TSAN Release (core-32) (reclient)", + console_view_entry = consoles.console_view_entry( + category = "linux tsan", + short_name = "rre", + ), + cores = 32, + goma_backend = None, + reclient_instance = "rbe-chromium-trusted", + reclient_jobs = 250, + reclient_rewrapper_env = {"RBE_cache_silo": "TSAN Release (core-32) (reclient)"}, + configure_kitchen = True, + kitchen_emulate_gce = True, + os = os.LINUX_DEFAULT, + schedule = "triggered", # triggered manually via Scheduler UI +) + +ci.fyi_builder( name = "TSAN Release (deps-cache) (reclient)", console_view_entry = consoles.console_view_entry( category = "linux tsan", @@ -5417,21 +5449,6 @@ tree_closing = False, ) -# TODO(crbug.com/1200574): Remove this builder after migration. -ci.memory_builder( - name = "Linux ASan LSan (bionic)", - branch_selector = branches.STANDARD_MILESTONE, - console_view_entry = consoles.console_view_entry( - category = "linux|asan bionic", - short_name = "bio", - ), - cq_mirrors_console_view = "mirrors", - main_console_view = "main", - os = os.LINUX_BIONIC, - ssd = True, - tree_closing = False, -) - ci.memory_builder( name = "Linux ASan LSan Builder", branch_selector = branches.STANDARD_MILESTONE,
diff --git a/infra/config/subprojects/chromium/try.star b/infra/config/subprojects/chromium/try.star index fb968d15..1e55de2 100644 --- a/infra/config/subprojects/chromium/try.star +++ b/infra/config/subprojects/chromium/try.star
@@ -326,6 +326,8 @@ }, }, tryjob = try_.job(), + # TODO(crbug/1202741) + os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, ) try_.chromium_android_builder( @@ -373,6 +375,8 @@ goma_jobs = goma.jobs.J150, main_list_view = "try", tryjob = try_.job(), + # TODO(crbug/1202741) + os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, ) try_.chromium_android_builder( @@ -385,6 +389,8 @@ ssd = True, use_java_coverage = True, tryjob = try_.job(), + # TODO(crbug/1202741) + os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, ) # Experimental builder to check dual coverage on android platform. @@ -406,6 +412,8 @@ goma_jobs = goma.jobs.J300, ssd = True, tryjob = try_.job(), + # TODO(crbug/1202741) + os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, ) try_.chromium_android_builder( @@ -479,6 +487,8 @@ ssd = True, main_list_view = "try", tryjob = try_.job(), + # TODO(crbug/1202741) + os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, ) try_.chromium_android_builder( @@ -573,6 +583,8 @@ goma_jobs = goma.jobs.J150, main_list_view = "try", tryjob = try_.job(), + # TODO(crbug/1202741) + os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, ) try_.chromium_android_builder( @@ -617,6 +629,8 @@ builderless = not settings.is_main, main_list_view = "try", tryjob = try_.job(), + # TODO(crbug/1202741) + os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, ) try_.chromium_android_builder( @@ -637,6 +651,8 @@ builderless = not settings.is_main, main_list_view = "try", tryjob = try_.job(), + # TODO(crbug/1202741) + os = os.LINUX_XENIAL_OR_BIONIC_REMOVE, ) try_.chromium_android_builder( @@ -795,6 +811,7 @@ builderless = not settings.is_main, main_list_view = "try", tryjob = try_.job(), + os = os.LINUX_BIONIC_REMOVE, ) try_.chromium_chromiumos_builder( @@ -802,6 +819,7 @@ branch_selector = branches.STANDARD_MILESTONE, builderless = not settings.is_main, main_list_view = "try", + os = os.LINUX_BIONIC_REMOVE, tryjob = try_.job(), ) @@ -1355,16 +1373,6 @@ os = os.LINUX_BIONIC, ) -# TODO(crbug.com/1200574): Remove after migration. -try_.chromium_linux_builder( - name = "linux_chromium_asan_rel_ng_bionic", - branch_selector = branches.STANDARD_MILESTONE, - goma_jobs = goma.jobs.J150, - ssd = True, - os = os.LINUX_BIONIC, - main_list_view = "try", -) - try_.chromium_linux_builder( name = "linux_chromium_cfi_rel_ng", cores = 32,
diff --git a/infra/config/swarming.star b/infra/config/swarming.star index dacd827b..875221b 100644 --- a/infra/config/swarming.star +++ b/infra/config/swarming.star
@@ -118,6 +118,10 @@ "project-webrtc-ci-task-accounts", "project-webrtc-try-task-accounts", + # ... and Angle. + "project-angle-ci-task-accounts", + "project-angle-try-task-accounts", + # Used by Pinpoint to trigger bisect jobs on machines in the Chrome-GPU pool. "service-account-chromeperf", ],
diff --git a/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.mm b/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.mm index c053a0f2..9774009 100644 --- a/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.mm +++ b/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.mm
@@ -121,7 +121,6 @@ } OmniboxPedalProvider* AutocompleteProviderClientImpl::GetPedalProvider() const { - NOTREACHED(); return nullptr; }
diff --git a/ios/chrome/browser/ui/history/history_ui_egtest.mm b/ios/chrome/browser/ui/history/history_ui_egtest.mm index 279b6ca..60ac3973 100644 --- a/ios/chrome/browser/ui/history/history_ui_egtest.mm +++ b/ios/chrome/browser/ui/history/history_ui_egtest.mm
@@ -461,7 +461,8 @@ performAction:grey_longPress()]; [ChromeEarlGrey - verifyShareActionWithPageTitle:[NSString stringWithUTF8String:kTitle1]]; + verifyShareActionWithURL:_URL1 + pageTitle:[NSString stringWithUTF8String:kTitle1]]; } // Tests the Delete context menu action for a History entry.
diff --git a/ios/chrome/browser/ui/menu/tab_context_menu_delegate.h b/ios/chrome/browser/ui/menu/tab_context_menu_delegate.h index b372730..883712ac 100644 --- a/ios/chrome/browser/ui/menu/tab_context_menu_delegate.h +++ b/ios/chrome/browser/ui/menu/tab_context_menu_delegate.h
@@ -34,6 +34,9 @@ // Tells the delegate to add |URL| and |title| to the reading list. - (void)addToReadingListURL:(const GURL&)URL title:(NSString*)title; +// Tells the delegate to close the tab with the item identifier |identifier|. +- (void)closeTabWithIdentifier:(NSString*)identifier incognito:(BOOL)incognito; + @end #endif // IOS_CHROME_BROWSER_UI_MENU_TAB_CONTEXT_MENU_DELEGATE_H_
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm b/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm index 5ebf8a7..d1dbe03 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm
@@ -467,7 +467,9 @@ } - (void)updateDiscoverFeedLayout { - if (self.discoverFeedViewController) { + // If this coordinator has not finished [self start], the below will start + // viewDidLoad before the UI is ready, failing DCHECKS. + if (self.started && self.discoverFeedViewController) { [self.containedViewController.view setNeedsLayout]; [self.containedViewController.view layoutIfNeeded]; [self.ntpViewController updateContentSuggestionForCurrentLayout];
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm b/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm index 7679eb2..f52df71b 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_egtest.mm
@@ -1280,7 +1280,8 @@ [self addURLToReadingList:distillablePageURL]; LongPressEntry(kDistillableTitle); - [ChromeEarlGrey verifyShareActionWithPageTitle:kDistillableTitle]; + [ChromeEarlGrey verifyShareActionWithURL:distillablePageURL + pageTitle:kDistillableTitle]; } // Tests the Delete context menu action for a reading list entry.
diff --git a/ios/chrome/browser/ui/recent_tabs/recent_tabs_egtest.mm b/ios/chrome/browser/ui/recent_tabs/recent_tabs_egtest.mm index b6ed001..844047a 100644 --- a/ios/chrome/browser/ui/recent_tabs/recent_tabs_egtest.mm +++ b/ios/chrome/browser/ui/recent_tabs/recent_tabs_egtest.mm
@@ -392,7 +392,9 @@ OpenRecentTabsPanel(); [self longPressTestURLTab]; - [ChromeEarlGrey verifyShareActionWithPageTitle:kTitleOfTestPage]; + const GURL testPageURL = web::test::HttpServer::MakeUrl(kURLOfTestPage); + [ChromeEarlGrey verifyShareActionWithURL:testPageURL + pageTitle:kTitleOfTestPage]; } #pragma mark Helper Methods
diff --git a/ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.mm b/ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.mm index 618f620..3bd65fb 100644 --- a/ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.mm +++ b/ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.mm
@@ -503,27 +503,23 @@ case PasswordCheckState::kNoPasswords: return PasswordCheckRowStateDefault; case PasswordCheckState::kSignedOut: - base::UmaHistogramEnumeration( - kSafetyCheckMetricsPasswords, - safety_check::SafetyCheck::PasswordsStatus::kSignedOut); + base::UmaHistogramEnumeration(kSafetyCheckMetricsPasswords, + safety_check::PasswordsStatus::kSignedOut); return noCompromisedPasswords ? PasswordCheckRowStateError : PasswordCheckRowStateUnSafe; case PasswordCheckState::kOffline: - base::UmaHistogramEnumeration( - kSafetyCheckMetricsPasswords, - safety_check::SafetyCheck::PasswordsStatus::kOffline); + base::UmaHistogramEnumeration(kSafetyCheckMetricsPasswords, + safety_check::PasswordsStatus::kOffline); return noCompromisedPasswords ? PasswordCheckRowStateError : PasswordCheckRowStateUnSafe; case PasswordCheckState::kQuotaLimit: - base::UmaHistogramEnumeration( - kSafetyCheckMetricsPasswords, - safety_check::SafetyCheck::PasswordsStatus::kQuotaLimit); + base::UmaHistogramEnumeration(kSafetyCheckMetricsPasswords, + safety_check::PasswordsStatus::kQuotaLimit); return noCompromisedPasswords ? PasswordCheckRowStateError : PasswordCheckRowStateUnSafe; case PasswordCheckState::kOther: - base::UmaHistogramEnumeration( - kSafetyCheckMetricsPasswords, - safety_check::SafetyCheck::PasswordsStatus::kError); + base::UmaHistogramEnumeration(kSafetyCheckMetricsPasswords, + safety_check::PasswordsStatus::kError); return noCompromisedPasswords ? PasswordCheckRowStateError : PasswordCheckRowStateUnSafe; case PasswordCheckState::kCanceled: @@ -531,15 +527,14 @@ if (!noCompromisedPasswords) { base::UmaHistogramEnumeration( kSafetyCheckMetricsPasswords, - safety_check::SafetyCheck::PasswordsStatus::kCompromisedExist); + safety_check::PasswordsStatus::kCompromisedExist); return PasswordCheckRowStateUnSafe; } else if (self.currentPasswordCheckState == PasswordCheckState::kIdle) { // Safe state is only possible after the state transitioned from // kRunning to kIdle. if (wasRunning) { - base::UmaHistogramEnumeration( - kSafetyCheckMetricsPasswords, - safety_check::SafetyCheck::PasswordsStatus::kSafe); + base::UmaHistogramEnumeration(kSafetyCheckMetricsPasswords, + safety_check::PasswordsStatus::kSafe); return PasswordCheckRowStateSafe; } else { return PasswordCheckRowStateDefault; @@ -687,15 +682,12 @@ base::RecordAction(base::UserMetricsAction("Settings.SafetyCheck.Start")); base::UmaHistogramEnumeration(kSafetyCheckInteractions, SafetyCheckInteractions::kStarted); - base::UmaHistogramEnumeration( - kSafetyCheckMetricsUpdates, - safety_check::SafetyCheck::UpdateStatus::kChecking); - base::UmaHistogramEnumeration( - kSafetyCheckMetricsPasswords, - safety_check::SafetyCheck::PasswordsStatus::kChecking); - base::UmaHistogramEnumeration( - kSafetyCheckMetricsSafeBrowsing, - safety_check::SafetyCheck::SafeBrowsingStatus::kChecking); + base::UmaHistogramEnumeration(kSafetyCheckMetricsUpdates, + safety_check::UpdateStatus::kChecking); + base::UmaHistogramEnumeration(kSafetyCheckMetricsPasswords, + safety_check::PasswordsStatus::kChecking); + base::UmaHistogramEnumeration(kSafetyCheckMetricsSafeBrowsing, + safety_check::SafeBrowsingStatus::kChecking); // Change checkStartItem to cancel state. self.checkStartState = CheckStartStateCancel; @@ -749,7 +741,7 @@ base::UmaHistogramEnumeration( kSafetyCheckMetricsPasswords, - safety_check::SafetyCheck::PasswordsStatus::kNoPasswords); + safety_check::PasswordsStatus::kNoPasswords); } }); } else { @@ -817,9 +809,8 @@ self.updateCheckRowState = UpdateCheckRowStateNetError; [self reconfigureUpdateCheckItem]; - base::UmaHistogramEnumeration( - kSafetyCheckMetricsUpdates, - safety_check::SafetyCheck::UpdateStatus::kFailedOffline); + base::UmaHistogramEnumeration(kSafetyCheckMetricsUpdates, + safety_check::UpdateStatus::kFailedOffline); } } @@ -831,9 +822,8 @@ self.updateCheckRowState = UpdateCheckRowStateOmahaError; [self reconfigureUpdateCheckItem]; - base::UmaHistogramEnumeration( - kSafetyCheckMetricsUpdates, - safety_check::SafetyCheck::UpdateStatus::kFailed); + base::UmaHistogramEnumeration(kSafetyCheckMetricsUpdates, + safety_check::UpdateStatus::kFailed); } return; } @@ -878,9 +868,8 @@ if (details.is_up_to_date) { [self possiblyDelayReconfigureUpdateCheckItemWithState: UpdateCheckRowStateUpToDate]; - base::UmaHistogramEnumeration( - kSafetyCheckMetricsUpdates, - safety_check::SafetyCheck::UpdateStatus::kUpdated); + base::UmaHistogramEnumeration(kSafetyCheckMetricsUpdates, + safety_check::UpdateStatus::kUpdated); } else { // upgradeURL and next_version are only set if not up to date. const GURL& upgradeUrl = details.upgrade_url; @@ -889,9 +878,8 @@ [self possiblyDelayReconfigureUpdateCheckItemWithState: UpdateCheckRowStateOmahaError]; - base::UmaHistogramEnumeration( - kSafetyCheckMetricsUpdates, - safety_check::SafetyCheck::UpdateStatus::kFailed); + base::UmaHistogramEnumeration(kSafetyCheckMetricsUpdates, + safety_check::UpdateStatus::kFailed); return; } @@ -900,17 +888,15 @@ [self possiblyDelayReconfigureUpdateCheckItemWithState: UpdateCheckRowStateOmahaError]; - base::UmaHistogramEnumeration( - kSafetyCheckMetricsUpdates, - safety_check::SafetyCheck::UpdateStatus::kFailed); + base::UmaHistogramEnumeration(kSafetyCheckMetricsUpdates, + safety_check::UpdateStatus::kFailed); return; } [self possiblyDelayReconfigureUpdateCheckItemWithState: UpdateCheckRowStateOutOfDate]; - base::UmaHistogramEnumeration( - kSafetyCheckMetricsUpdates, - safety_check::SafetyCheck::UpdateStatus::kOutdated); + base::UmaHistogramEnumeration(kSafetyCheckMetricsUpdates, + safety_check::UpdateStatus::kOutdated); // Valid results, update all NSUserDefaults. [defaults setValue:base::SysUTF8ToNSString(upgradeUrl.spec()) @@ -946,14 +932,13 @@ if (!self.safeBrowsingPreferenceManaged) { if (self.safeBrowsingPreference.value) { self.safeBrowsingCheckRowState = SafeBrowsingCheckRowStateSafe; - base::UmaHistogramEnumeration( - kSafetyCheckMetricsSafeBrowsing, - safety_check::SafetyCheck::SafeBrowsingStatus::kEnabled); + base::UmaHistogramEnumeration(kSafetyCheckMetricsSafeBrowsing, + safety_check::SafeBrowsingStatus::kEnabled); } else { self.safeBrowsingCheckRowState = SafeBrowsingCheckRowStateUnsafe; base::UmaHistogramEnumeration( kSafetyCheckMetricsSafeBrowsing, - safety_check::SafetyCheck::SafeBrowsingStatus::kDisabled); + safety_check::SafeBrowsingStatus::kDisabled); } } if (self.safeBrowsingCheckRowState == SafeBrowsingCheckRowStateUnsafe && @@ -961,7 +946,7 @@ self.safeBrowsingCheckRowState = SafeBrowsingCheckRowStateManaged; base::UmaHistogramEnumeration( kSafetyCheckMetricsSafeBrowsing, - safety_check::SafetyCheck::SafeBrowsingStatus::kDisabledByAdmin); + safety_check::SafeBrowsingStatus::kDisabledByAdmin); } [self reconfigureSafeBrowsingCheckItem];
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/BUILD.gn b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/BUILD.gn index c26d4b6..c4477302 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/BUILD.gn +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/BUILD.gn
@@ -52,7 +52,9 @@ "//base", "//ios/chrome/app/strings", "//ios/chrome/browser", + "//ios/chrome/browser/browser_state", "//ios/chrome/browser/drag_and_drop", + "//ios/chrome/browser/main:public", "//ios/chrome/browser/ui:feature_flags", "//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/elements",
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_context_menu_helper.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_context_menu_helper.mm index be3cf7b9..ea3c25a 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_context_menu_helper.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_context_menu_helper.mm
@@ -5,6 +5,8 @@ #import "ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_context_menu_helper.h" #include "base/metrics/histogram_functions.h" +#include "ios/chrome/browser/browser_state/chrome_browser_state.h" +#include "ios/chrome/browser/main/browser.h" #import "ios/chrome/browser/ui/menu/action_factory.h" #import "ios/chrome/browser/ui/menu/menu_histograms.h" #import "ios/chrome/browser/ui/menu/tab_context_menu_delegate.h" @@ -81,6 +83,17 @@ title:item.title]; }]]; } + if ([weakSelf.contextMenuDelegate + respondsToSelector:@selector(closeTabWithIdentifier: + incognito:)]) { + [menuElements + addObject:[actionFactory actionToCloseTabWithBlock:^{ + [weakSelf.contextMenuDelegate + closeTabWithIdentifier:gridCell.itemIdentifier + incognito:weakSelf.browser->GetBrowserState() + ->IsOffTheRecord()]; + }]]; + } return [UIMenu menuWithTitle:@"" children:menuElements]; };
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm index 85ea473..7003ac1 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator.mm
@@ -858,6 +858,14 @@ [readingListAdder addToReadingList:command]; } +- (void)closeTabWithIdentifier:(NSString*)identifier incognito:(BOOL)incognito { + if (incognito) { + [self.incognitoTabsMediator closeItemWithID:identifier]; + } else { + [self.regularTabsMediator closeItemWithID:identifier]; + } +} + - (void)removeSessionAtTableSectionWithIdentifier:(NSInteger)sectionIdentifier { [self.baseViewController.remoteTabsViewController removeSessionAtTableSectionWithIdentifier:sectionIdentifier];
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_egtest.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_egtest.mm index 7354f80..88fdf5e 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_egtest.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_egtest.mm
@@ -32,6 +32,7 @@ using chrome_test_util::TapAtOffsetOf; using chrome_test_util::WindowWithNumber; using chrome_test_util::AddToReadingListButton; +using chrome_test_util::CloseTabMenuButton; namespace { char kURL1[] = "http://firstURL"; @@ -59,6 +60,11 @@ grey_accessibilityTrait(UIAccessibilityTraitButton), nil); } +id<GREYMatcher> TabWithTitle(NSString* title) { + return grey_allOf(grey_accessibilityLabel(title), grey_sufficientlyVisible(), + nil); +} + // Identifer for cell at given |index| in the tab grid. NSString* IdentifierForCellAtIndex(unsigned int index) { return [NSString stringWithFormat:@"%@%u", kGridCellIdentifierPrefix, index]; @@ -84,7 +90,8 @@ // ensureAppLaunchedWithConfiguration for each test. if ([self isRunningTest:@selector(testTabGridItemContextMenuShare)] || [self isRunningTest:@selector - (testTabGridItemContextMenuAddToReadingList)]) { + (testTabGridItemContextMenuAddToReadingList)] || + [self isRunningTest:@selector(testTabGridItemContextCloseTab)]) { config.features_enabled.push_back(kTabGridContextMenu); } return config; @@ -283,7 +290,8 @@ [self longPressTabWithTitle:[NSString stringWithUTF8String:kTitle1]]; [ChromeEarlGrey - verifyShareActionWithPageTitle:[NSString stringWithUTF8String:kTitle1]]; + verifyShareActionWithURL:_URL1 + pageTitle:[NSString stringWithUTF8String:kTitle1]]; } #pragma mark - Tab Grid Item Context Menu @@ -304,7 +312,8 @@ [self longPressTabWithTitle:[NSString stringWithUTF8String:kTitle1]]; [ChromeEarlGrey - verifyShareActionWithPageTitle:[NSString stringWithUTF8String:kTitle1]]; + verifyShareActionWithURL:_URL1 + pageTitle:[NSString stringWithUTF8String:kTitle1]]; } // Tests the Add to Reading list action on a tab grid item's context menu. @@ -357,6 +366,35 @@ @"Snackbar did not disappear."); } +// Tests the Share action on a tab grid item's context menu. +- (void)testTabGridItemContextCloseTab { + if (!base::ios::IsRunningOnIOS13OrLater()) { + EARL_GREY_TEST_SKIPPED( + @"Tab Grid context menu only supported on iOS 13 and later."); + } + + [ChromeEarlGrey loadURL:_URL1]; + [ChromeEarlGrey waitForWebStateContainingText:kResponse1]; + + [[EarlGrey selectElementWithMatcher:chrome_test_util::ShowTabsButton()] + performAction:grey_tap()]; + + [self longPressTabWithTitle:[NSString stringWithUTF8String:kTitle1]]; + + // Close Tab. + [[EarlGrey selectElementWithMatcher:CloseTabMenuButton()] + performAction:grey_tap()]; + + // Make sure that the tab is no longer present. + [[EarlGrey selectElementWithMatcher:TabWithTitle([NSString + stringWithUTF8String:kTitle1])] + assertWithMatcher:grey_nil()]; + + [[EarlGrey selectElementWithMatcher:chrome_test_util:: + TabGridRegularTabsEmptyStateView()] + assertWithMatcher:grey_sufficientlyVisible()]; +} + #pragma mark - // Tests that tapping on "Close All" shows a confirmation dialog.
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.h b/ios/chrome/test/earl_grey/chrome_earl_grey.h index a888941..4eb35e0 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.h
@@ -704,8 +704,10 @@ useNewString:(BOOL)useNewString; // Taps on the Share context menu action and validates that the ActivityView -// was brought up with |pageTitle| in its header. -- (void)verifyShareActionWithPageTitle:(NSString*)pageTitle; +// was brought up with the correct title in its header. The title starts as the +// host of the loaded |URL| and is then updated to the page title |pageTitle|. +- (void)verifyShareActionWithURL:(const GURL&)URL + pageTitle:(NSString*)pageTitle; #pragma mark - Unified Consent utilities
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.mm b/ios/chrome/test/earl_grey/chrome_earl_grey.mm index d8cfdd6..39ecfed9 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
@@ -1323,11 +1323,13 @@ assertWithMatcher:grey_notNil()]; } -- (void)verifyShareActionWithPageTitle:(NSString*)pageTitle { +- (void)verifyShareActionWithURL:(const GURL&)URL + pageTitle:(NSString*)pageTitle { [[EarlGrey selectElementWithMatcher:ShareButton()] performAction:grey_tap()]; // Page title is added asynchronously, so wait for its appearance. - [self waitForMatcher:grey_allOf(ActivityViewHeader(pageTitle), + NSString* hostString = base::SysUTF8ToNSString(URL.host()); + [self waitForMatcher:grey_allOf(ActivityViewHeader(hostString, pageTitle), grey_sufficientlyVisible(), nil)]; // Dismiss the Activity View by tapping outside its bounds.
diff --git a/ios/chrome/test/earl_grey/chrome_matchers.h b/ios/chrome/test/earl_grey/chrome_matchers.h index 23af69a..100eb95a 100644 --- a/ios/chrome/test/earl_grey/chrome_matchers.h +++ b/ios/chrome/test/earl_grey/chrome_matchers.h
@@ -87,6 +87,9 @@ // Returns matcher for a close button. id<GREYMatcher> CloseButton(); +// Returns matcher for close tab menu button. +id<GREYMatcher> CloseTabMenuButton(); + // Matcher for the navigate forward button. id<GREYMatcher> ForwardButton(); @@ -565,7 +568,7 @@ id<GREYMatcher> ManualFallbackCreditCardTableViewWindowMatcher(); // Returns the matcher for the iOS 13+ Activity View header. -id<GREYMatcher> ActivityViewHeader(NSString* page_title); +id<GREYMatcher> ActivityViewHeader(NSString* url_host, NSString* page_title); // Returns a matcher for the button to trigger password generation on manual // fallback.
diff --git a/ios/chrome/test/earl_grey/chrome_matchers.mm b/ios/chrome/test/earl_grey/chrome_matchers.mm index 57166ec..fb1cf413c 100644 --- a/ios/chrome/test/earl_grey/chrome_matchers.mm +++ b/ios/chrome/test/earl_grey/chrome_matchers.mm
@@ -178,6 +178,10 @@ return [ChromeMatchersAppInterface addToReadingListButton]; } +id<GREYMatcher> CloseTabMenuButton() { + return [ChromeMatchersAppInterface closeTabMenuButton]; +} + id<GREYMatcher> SettingsSwitchCell(NSString* accessibility_identifier, BOOL is_toggled_on) { return [ChromeMatchersAppInterface settingsSwitchCell:accessibility_identifier @@ -711,8 +715,9 @@ manualFallbackCreditCardTableViewWindowMatcher]; } -id<GREYMatcher> ActivityViewHeader(NSString* page_title) { - return [ChromeMatchersAppInterface activityViewHeaderWithTitle:page_title]; +id<GREYMatcher> ActivityViewHeader(NSString* url_host, NSString* page_title) { + return [ChromeMatchersAppInterface activityViewHeaderWithURLHost:url_host + title:page_title]; } id<GREYMatcher> ManualFallbackSuggestPasswordMatcher() {
diff --git a/ios/chrome/test/earl_grey/chrome_matchers_app_interface.h b/ios/chrome/test/earl_grey/chrome_matchers_app_interface.h index ffd08e8..cf32ca7 100644 --- a/ios/chrome/test/earl_grey/chrome_matchers_app_interface.h +++ b/ios/chrome/test/earl_grey/chrome_matchers_app_interface.h
@@ -80,6 +80,9 @@ // Returns matcher for a close button. + (id<GREYMatcher>)closeButton; +// Returns matcher for close tab context menu button. ++ (id<GREYMatcher>)closeTabMenuButton; + // Matcher for the navigate forward button. + (id<GREYMatcher>)forwardButton; @@ -556,7 +559,8 @@ + (id<GREYMatcher>)manualFallbackCreditCardTableViewWindowMatcher; // Returns the matcher for the Activity View header. -+ (id<GREYMatcher>)activityViewHeaderWithTitle:(NSString*)pageTitle; ++ (id<GREYMatcher>)activityViewHeaderWithURLHost:(NSString*)host + title:(NSString*)pageTitle; // Returns a matcher for the button to trigger password generation on manual // fallback.
diff --git a/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm b/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm index b098aff..3e508d70 100644 --- a/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm +++ b/ios/chrome/test/earl_grey/chrome_matchers_app_interface.mm
@@ -269,6 +269,13 @@ grey_not(grey_accessibilityTrait(UIAccessibilityTraitNotEnabled)), nil); } ++ (id<GREYMatcher>)closeTabMenuButton { + return grey_allOf( + [ChromeMatchersAppInterface + buttonWithAccessibilityLabelID:(IDS_IOS_CONTENT_CONTEXT_CLOSETAB)], + grey_sufficientlyVisible(), nil); +} + + (id<GREYMatcher>)forwardButton { return [ChromeMatchersAppInterface buttonWithAccessibilityLabelID:(IDS_ACCNAME_FORWARD)]; @@ -1067,12 +1074,19 @@ return grey_allOf(classMatcher, parentMatcher, nil); } -+ (id<GREYMatcher>)activityViewHeaderWithTitle:(NSString*)pageTitle { - return grey_allOf(grey_accessibilityLabel(pageTitle), - grey_ancestor(grey_allOf( - grey_accessibilityTrait(UIAccessibilityTraitHeader), - grey_kindOfClassName(@"LPLinkView"), nil)), - nil); ++ (id<GREYMatcher>)activityViewHeaderWithURLHost:(NSString*)host + title:(NSString*)pageTitle { + return grey_allOf( + // The title of the activity view starts as the URL, then asynchronously + // changes to the page title. Sometimes, the activity view fails to update + // the text to the page title, causing test flake. Allow matcher to pass + // with either value for the activity view title. + grey_anyOf(grey_accessibilityLabel(host), + grey_accessibilityLabel(pageTitle), nil), + grey_ancestor( + grey_allOf(grey_accessibilityTrait(UIAccessibilityTraitHeader), + grey_kindOfClassName(@"LPLinkView"), nil)), + nil); } + (id<GREYMatcher>)manualFallbackSuggestPasswordMatcher {
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm index 873ee986..de5a0391 100644 --- a/ios/web/navigation/navigation_manager_impl.mm +++ b/ios/web/navigation/navigation_manager_impl.mm
@@ -16,6 +16,7 @@ #include "base/mac/bundle_locations.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" +#include "base/numerics/checked_math.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" #include "base/timer/elapsed_timer.h" @@ -412,7 +413,13 @@ empty_window_open_item_ ? 0 : web_view_cache_.GetCurrentItemIndex(); } - return current_item_index + offset; + // Handled signed integer overflow or underflow. + int index; + if (!base::CheckAdd(current_item_index, offset).AssignIfValid(&index)) { + return -1; + } + + return index; } void NavigationManagerImpl::SetPendingItemIndex(int index) {
diff --git a/media/audio/alsa/alsa_input.cc b/media/audio/alsa/alsa_input.cc index ee7c5d0..89e6d1fb 100644 --- a/media/audio/alsa/alsa_input.cc +++ b/media/audio/alsa/alsa_input.cc
@@ -52,9 +52,9 @@ AlsaPcmInputStream::~AlsaPcmInputStream() = default; -bool AlsaPcmInputStream::Open() { +AudioInputStream::OpenOutcome AlsaPcmInputStream::Open() { if (device_handle_) - return false; // Already open. + return OpenOutcome::kAlreadyOpen; uint32_t packet_us = buffer_duration_.InMicroseconds(); uint32_t buffer_us = packet_us * kNumPacketsInRingBuffer; @@ -91,7 +91,8 @@ } } - return device_handle_ != nullptr; + return device_handle_ != nullptr ? OpenOutcome::kSuccess + : OpenOutcome::kFailed; } void AlsaPcmInputStream::Start(AudioInputCallback* callback) {
diff --git a/media/audio/alsa/alsa_input.h b/media/audio/alsa/alsa_input.h index 09e525f..6301fba 100644 --- a/media/audio/alsa/alsa_input.h +++ b/media/audio/alsa/alsa_input.h
@@ -46,7 +46,7 @@ ~AlsaPcmInputStream() override; // Implementation of AudioInputStream. - bool Open() override; + OpenOutcome Open() override; void Start(AudioInputCallback* callback) override; void Stop() override; void Close() override;
diff --git a/media/audio/android/audio_android_unittest.cc b/media/audio/android/audio_android_unittest.cc index 55b67d3..20e696f 100644 --- a/media/audio/android/audio_android_unittest.cc +++ b/media/audio/android/audio_android_unittest.cc
@@ -691,14 +691,16 @@ void OpenAndClose() { DCHECK(audio_manager()->GetTaskRunner()->BelongsToCurrentThread()); - EXPECT_TRUE(audio_input_stream_->Open()); + EXPECT_EQ(audio_input_stream_->Open(), + AudioInputStream::OpenOutcome::kSuccess); audio_input_stream_->Close(); audio_input_stream_ = nullptr; } void OpenAndStart(AudioInputStream::AudioInputCallback* sink) { DCHECK(audio_manager()->GetTaskRunner()->BelongsToCurrentThread()); - EXPECT_TRUE(audio_input_stream_->Open()); + EXPECT_EQ(audio_input_stream_->Open(), + AudioInputStream::OpenOutcome::kSuccess); audio_input_stream_->Start(sink); }
diff --git a/media/audio/android/opensles_input.cc b/media/audio/android/opensles_input.cc index 5949e7d..695277e 100644 --- a/media/audio/android/opensles_input.cc +++ b/media/audio/android/opensles_input.cc
@@ -63,18 +63,17 @@ DCHECK(!audio_data_[0]); } -bool OpenSLESInputStream::Open() { +AudioInputStream::OpenOutcome OpenSLESInputStream::Open() { DVLOG(2) << __PRETTY_FUNCTION__; DCHECK(thread_checker_.CalledOnValidThread()); if (engine_object_.Get()) - return false; + return AudioInputStream::OpenOutcome::kFailed; if (!CreateRecorder()) - return false; + return AudioInputStream::OpenOutcome::kFailed; SetupAudioBuffer(); - - return true; + return AudioInputStream::OpenOutcome::kSuccess; } void OpenSLESInputStream::Start(AudioInputCallback* callback) {
diff --git a/media/audio/android/opensles_input.h b/media/audio/android/opensles_input.h index a3afed0e..ee354f2 100644 --- a/media/audio/android/opensles_input.h +++ b/media/audio/android/opensles_input.h
@@ -38,7 +38,7 @@ ~OpenSLESInputStream() override; // Implementation of AudioInputStream. - bool Open() override; + OpenOutcome Open() override; void Start(AudioInputCallback* callback) override; void Stop() override; void Close() override;
diff --git a/media/audio/audio_input_stream_data_interceptor.cc b/media/audio/audio_input_stream_data_interceptor.cc index b5030385..332b3ae 100644 --- a/media/audio/audio_input_stream_data_interceptor.cc +++ b/media/audio/audio_input_stream_data_interceptor.cc
@@ -24,13 +24,13 @@ } // Implementation of AudioInputStream. -bool AudioInputStreamDataInterceptor::Open() { +AudioInputStream::OpenOutcome AudioInputStreamDataInterceptor::Open() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return stream_->Open(); } void AudioInputStreamDataInterceptor::Start( - media::AudioInputStream::AudioInputCallback* callback) { + AudioInputStream::AudioInputCallback* callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); callback_ = callback; debug_recorder_ = create_debug_recorder_cb_.Run();
diff --git a/media/audio/audio_input_stream_data_interceptor.h b/media/audio/audio_input_stream_data_interceptor.h index 383a28b3..6794267 100644 --- a/media/audio/audio_input_stream_data_interceptor.h +++ b/media/audio/audio_input_stream_data_interceptor.h
@@ -36,7 +36,7 @@ ~AudioInputStreamDataInterceptor() override; // Implementation of AudioInputStream. - bool Open() override; + OpenOutcome Open() override; void Start(AudioInputStream::AudioInputCallback* callback) override; void Stop() override; void Close() override;
diff --git a/media/audio/audio_input_stream_data_interceptor_unittest.cc b/media/audio/audio_input_stream_data_interceptor_unittest.cc index 6e56000..3a2ec62 100644 --- a/media/audio/audio_input_stream_data_interceptor_unittest.cc +++ b/media/audio/audio_input_stream_data_interceptor_unittest.cc
@@ -30,7 +30,7 @@ public: MockStream() = default; ~MockStream() override = default; - MOCK_METHOD0(Open, bool()); + MOCK_METHOD0(Open, AudioInputStream::OpenOutcome()); MOCK_METHOD1(Start, void(AudioInputStream::AudioInputCallback*)); MOCK_METHOD0(Stop, void()); MOCK_METHOD0(Close, void());
diff --git a/media/audio/audio_input_unittest.cc b/media/audio/audio_input_unittest.cc index ddaba1dd..cd91959 100644 --- a/media/audio/audio_input_unittest.cc +++ b/media/audio/audio_input_unittest.cc
@@ -145,7 +145,8 @@ void OpenAndClose() { DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread()); ASSERT_TRUE(audio_input_stream_); - EXPECT_TRUE(audio_input_stream_->Open()); + EXPECT_EQ(audio_input_stream_->Open(), + AudioInputStream::OpenOutcome::kSuccess); audio_input_stream_->Close(); audio_input_stream_ = nullptr; } @@ -153,14 +154,16 @@ void OpenAndStart(AudioInputStream::AudioInputCallback* sink) { DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread()); ASSERT_TRUE(audio_input_stream_); - EXPECT_TRUE(audio_input_stream_->Open()); + EXPECT_EQ(audio_input_stream_->Open(), + AudioInputStream::OpenOutcome::kSuccess); audio_input_stream_->Start(sink); } void OpenStopAndClose() { DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread()); ASSERT_TRUE(audio_input_stream_); - EXPECT_TRUE(audio_input_stream_->Open()); + EXPECT_EQ(audio_input_stream_->Open(), + AudioInputStream::OpenOutcome::kSuccess); audio_input_stream_->Stop(); audio_input_stream_->Close(); audio_input_stream_ = nullptr;
diff --git a/media/audio/audio_io.h b/media/audio/audio_io.h index ae9111a..e574390 100644 --- a/media/audio/audio_io.h +++ b/media/audio/audio_io.h
@@ -39,7 +39,6 @@ // Specifically for this case we avoid supporting complex formats such as MP3 // or WMA. Complex format decoding should be done by the renderers. - // Models an audio stream that gets rendered to the audio hardware output. // Because we support more audio streams than physically available channels // a given AudioOutputStream might or might not talk directly to hardware. @@ -155,9 +154,18 @@ virtual ~AudioInputStream() {} + enum class OpenOutcome { + kSuccess, + kAlreadyOpen, + // Failed due to an unknown or unspecified reason. + kFailed, + // Failed to open due to OS-level System permissions. + kFailedSystemPermissions, + }; + // Open the stream and prepares it for recording. Call Start() to actually // begin recording. - virtual bool Open() = 0; + virtual OpenOutcome Open() = 0; // Starts recording audio and generating AudioInputCallback::OnData(). // The input stream does not take ownership of this callback.
diff --git a/media/audio/audio_low_latency_input_output_unittest.cc b/media/audio/audio_low_latency_input_output_unittest.cc index 04b2d09..eca3b367 100644 --- a/media/audio/audio_low_latency_input_output_unittest.cc +++ b/media/audio/audio_low_latency_input_output_unittest.cc
@@ -378,7 +378,7 @@ return; } - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); EXPECT_TRUE(aos->Open()); FullDuplexAudioSinkSource full_duplex(
diff --git a/media/audio/cras/cras_input.cc b/media/audio/cras/cras_input.cc index dc91a84..63c18e5 100644 --- a/media/audio/cras/cras_input.cc +++ b/media/audio/cras/cras_input.cc
@@ -45,22 +45,22 @@ DCHECK(!client_); } -bool CrasInputStream::Open() { +AudioInputStream::OpenOutcome CrasInputStream::Open() { if (client_) { NOTREACHED() << "CrasInputStream already open"; - return false; // Already open. + return OpenOutcome::kAlreadyOpen; } // Sanity check input values. if (params_.sample_rate() <= 0) { DLOG(WARNING) << "Unsupported audio frequency."; - return false; + return OpenOutcome::kFailed; } if (AudioParameters::AUDIO_PCM_LINEAR != params_.format() && AudioParameters::AUDIO_PCM_LOW_LATENCY != params_.format()) { DLOG(WARNING) << "Unsupported audio format."; - return false; + return OpenOutcome::kFailed; } // Create the client and connect to the CRAS server. @@ -68,14 +68,14 @@ if (!client_) { DLOG(WARNING) << "Couldn't create CRAS client.\n"; client_ = NULL; - return false; + return OpenOutcome::kFailed; } if (libcras_client_connect(client_)) { DLOG(WARNING) << "Couldn't connect CRAS client.\n"; libcras_client_destroy(client_); client_ = NULL; - return false; + return OpenOutcome::kFailed; } // Then start running the client. @@ -83,7 +83,7 @@ DLOG(WARNING) << "Couldn't run CRAS client.\n"; libcras_client_destroy(client_); client_ = NULL; - return false; + return OpenOutcome::kFailed; } if (is_loopback_) { @@ -93,7 +93,7 @@ // cleanup code. libcras_client_destroy(client_); client_ = NULL; - return false; + return OpenOutcome::kFailed; } int rc = libcras_client_get_loopback_dev_idx(client_, &pin_device_); @@ -101,11 +101,11 @@ DLOG(WARNING) << "Couldn't find CRAS loopback device."; libcras_client_destroy(client_); client_ = NULL; - return false; + return OpenOutcome::kFailed; } } - return true; + return OpenOutcome::kSuccess; } void CrasInputStream::Close() {
diff --git a/media/audio/cras/cras_input.h b/media/audio/cras/cras_input.h index 17fa790..9c1c1e0 100644 --- a/media/audio/cras/cras_input.h +++ b/media/audio/cras/cras_input.h
@@ -39,7 +39,7 @@ ~CrasInputStream() override; // Implementation of AudioInputStream. - bool Open() override; + AudioInputStream::OpenOutcome Open() override; void Start(AudioInputCallback* callback) override; void Stop() override; void Close() override;
diff --git a/media/audio/cras/cras_input_unittest.cc b/media/audio/cras/cras_input_unittest.cc index 04d4dea..5bda316 100644 --- a/media/audio/cras/cras_input_unittest.cc +++ b/media/audio/cras/cras_input_unittest.cc
@@ -102,7 +102,7 @@ CrasInputStream* test_stream = new CrasInputStream( params, mock_manager_.get(), AudioDeviceDescription::kDefaultDeviceId); - ASSERT_TRUE(test_stream->Open()); + EXPECT_EQ(test_stream->Open(), AudioInputStream::OpenOutcome::kSuccess); // Allow 8 frames variance for SRC in the callback. Different numbers of // samples can be provided when doing non-integer SRC. For example @@ -146,13 +146,13 @@ TEST_F(CrasInputStreamTest, OpenMono) { CrasInputStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); - EXPECT_TRUE(test_stream->Open()); + EXPECT_EQ(test_stream->Open(), AudioInputStream::OpenOutcome::kSuccess); test_stream->Close(); } TEST_F(CrasInputStreamTest, OpenStereo) { CrasInputStream* test_stream = CreateStream(CHANNEL_LAYOUT_STEREO); - EXPECT_TRUE(test_stream->Open()); + EXPECT_EQ(test_stream->Open(), AudioInputStream::OpenOutcome::kSuccess); test_stream->Close(); } @@ -164,13 +164,13 @@ CrasInputStream* test_stream = new CrasInputStream(bad_rate_params, mock_manager_.get(), AudioDeviceDescription::kDefaultDeviceId); - EXPECT_FALSE(test_stream->Open()); + EXPECT_EQ(test_stream->Open(), AudioInputStream::OpenOutcome::kFailed); test_stream->Close(); } TEST_F(CrasInputStreamTest, SetGetVolume) { CrasInputStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); - EXPECT_TRUE(test_stream->Open()); + EXPECT_EQ(test_stream->Open(), AudioInputStream::OpenOutcome::kSuccess); double max_volume = test_stream->GetMaxVolume(); EXPECT_GE(max_volume, 1.0); @@ -212,7 +212,7 @@ CrasInputStream* test_stream = CreateStream(CHANNEL_LAYOUT_STEREO, kTestFramesPerPacket, AudioDeviceDescription::kLoopbackInputDeviceId); - EXPECT_TRUE(test_stream->Open()); + EXPECT_EQ(test_stream->Open(), AudioInputStream::OpenOutcome::kSuccess); test_stream->Close(); }
diff --git a/media/audio/fake_audio_input_stream.cc b/media/audio/fake_audio_input_stream.cc index ca0ec90..a2dea13 100644 --- a/media/audio/fake_audio_input_stream.cc +++ b/media/audio/fake_audio_input_stream.cc
@@ -61,11 +61,11 @@ DCHECK(!fake_audio_worker_); } -bool FakeAudioInputStream::Open() { +AudioInputStream::OpenOutcome FakeAudioInputStream::Open() { DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread()); audio_bus_->Zero(); - return true; + return OpenOutcome::kSuccess; } void FakeAudioInputStream::Start(AudioInputCallback* callback) {
diff --git a/media/audio/fake_audio_input_stream.h b/media/audio/fake_audio_input_stream.h index b76f12f..809edfb 100644 --- a/media/audio/fake_audio_input_stream.h +++ b/media/audio/fake_audio_input_stream.h
@@ -28,13 +28,12 @@ // beeping sound unless --use-file-for-fake-audio-capture=<file> is specified, // in which case the indicated .wav file will be read and played into the // stream. -class MEDIA_EXPORT FakeAudioInputStream - : public AudioInputStream { +class MEDIA_EXPORT FakeAudioInputStream : public AudioInputStream { public: - static AudioInputStream* MakeFakeStream( - AudioManagerBase* manager, const AudioParameters& params); + static AudioInputStream* MakeFakeStream(AudioManagerBase* manager, + const AudioParameters& params); - bool Open() override; + OpenOutcome Open() override; void Start(AudioInputCallback* callback) override; void Stop() override; void Close() override;
diff --git a/media/audio/mac/audio_input_mac.cc b/media/audio/mac/audio_input_mac.cc index 7cac52a..3151f4e 100644 --- a/media/audio/mac/audio_input_mac.cc +++ b/media/audio/mac/audio_input_mac.cc
@@ -27,7 +27,7 @@ // should ideally be set to about the same value as in // audio_low_latency_input_mac.cc, to make comparing them reasonable. const int kInputCallbackStartTimeoutInSeconds = 8; -} +} // namespace PCMQueueInAudioInputStream::PCMQueueInAudioInputStream( AudioManagerMac* manager, @@ -66,7 +66,7 @@ DCHECK(!audio_queue_); } -bool PCMQueueInAudioInputStream::Open() { +AudioInputStream::OpenOutcome PCMQueueInAudioInputStream::Open() { OSStatus err = AudioQueueNewInput(&format_, &HandleInputBufferStatic, this, @@ -76,9 +76,10 @@ &audio_queue_); if (err != noErr) { HandleError(err); - return false; + return AudioInputStream::OpenOutcome::kFailed; } - return SetupBuffers(); + return SetupBuffers() ? AudioInputStream::OpenOutcome::kSuccess + : AudioInputStream::OpenOutcome::kFailed; } void PCMQueueInAudioInputStream::Start(AudioInputCallback* callback) {
diff --git a/media/audio/mac/audio_input_mac.h b/media/audio/mac/audio_input_mac.h index b96aadf..15da618 100644 --- a/media/audio/mac/audio_input_mac.h +++ b/media/audio/mac/audio_input_mac.h
@@ -35,7 +35,7 @@ ~PCMQueueInAudioInputStream() override; // Implementation of AudioInputStream. - bool Open() override; + AudioInputStream::OpenOutcome Open() override; void Start(AudioInputCallback* callback) override; void Stop() override; void Close() override;
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc index e5fd2b35..eb39b38 100644 --- a/media/audio/mac/audio_low_latency_input_mac.cc +++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -286,7 +286,7 @@ } // Obtain and open the AUHAL AudioOutputUnit for recording. -bool AUAudioInputStream::Open() { +AudioInputStream::OpenOutcome AUAudioInputStream::Open() { DCHECK(thread_checker_.CalledOnValidThread()); DVLOG(1) << "Open"; DCHECK(!audio_unit_); @@ -296,7 +296,7 @@ if (input_device_id_ == kAudioObjectUnknown) { NOTREACHED() << "Device ID is unknown"; HandleError(kAudioUnitErr_InvalidElement); - return false; + return OpenOutcome::kFailed; } // The requested sample-rate must match the hardware sample-rate. @@ -311,7 +311,7 @@ use_voice_processing_ ? OpenVoiceProcessingAU() : OpenAUHAL(); if (!success) - return false; + return OpenOutcome::kFailed; // The hardware latency is fixed and will not change during the call. hardware_latency_ = AudioManagerMac::GetHardwareLatency( @@ -322,7 +322,7 @@ // And the master channel is not counted in |number_of_channels_in_frame_|. number_of_channels_in_frame_ = GetNumberOfChannelsFromStream(); - return true; + return OpenOutcome::kSuccess; } bool AUAudioInputStream::OpenAUHAL() {
diff --git a/media/audio/mac/audio_low_latency_input_mac.h b/media/audio/mac/audio_low_latency_input_mac.h index da71627..1344ba83e 100644 --- a/media/audio/mac/audio_low_latency_input_mac.h +++ b/media/audio/mac/audio_low_latency_input_mac.h
@@ -72,7 +72,7 @@ ~AUAudioInputStream() override; // Implementation of AudioInputStream. - bool Open() override; + AudioInputStream::OpenOutcome Open() override; void Start(AudioInputCallback* callback) override; void Stop() override; void Close() override;
diff --git a/media/audio/mac/audio_low_latency_input_mac_unittest.cc b/media/audio/mac/audio_low_latency_input_mac_unittest.cc index 341111d..96287c9 100644 --- a/media/audio/mac/audio_low_latency_input_mac_unittest.cc +++ b/media/audio/mac/audio_low_latency_input_mac_unittest.cc
@@ -184,7 +184,7 @@ TEST_F(MacAudioInputTest, AUAudioInputStreamOpenAndClose) { ABORT_AUDIO_TEST_IF_NOT(InputDevicesAvailable()); AudioInputStream* ais = CreateDefaultAudioInputStream(); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); ais->Close(); } @@ -192,7 +192,7 @@ TEST_F(MacAudioInputTest, AUAudioInputStreamOpenStartAndClose) { ABORT_AUDIO_TEST_IF_NOT(InputDevicesAvailable()); AudioInputStream* ais = CreateDefaultAudioInputStream(); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); MockAudioInputCallback sink; ais->Start(&sink); ais->Close(); @@ -202,7 +202,7 @@ TEST_F(MacAudioInputTest, AUAudioInputStreamOpenStartStopAndClose) { ABORT_AUDIO_TEST_IF_NOT(InputDevicesAvailable()); AudioInputStream* ais = CreateDefaultAudioInputStream(); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); MockAudioInputCallback sink; ais->Start(&sink); ais->Stop(); @@ -217,7 +217,7 @@ // Create an audio input stream which records in mono. AudioInputStream* ais = CreateAudioInputStream(CHANNEL_LAYOUT_MONO); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); MockAudioInputCallback sink; @@ -246,7 +246,7 @@ // Create an audio input stream which records in stereo. AudioInputStream* ais = CreateAudioInputStream(CHANNEL_LAYOUT_STEREO); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); MockAudioInputCallback sink; @@ -286,7 +286,7 @@ int fs = static_cast<int>(AUAudioInputStream::HardwareSampleRate()); AudioInputStream* ais = CreateDefaultAudioInputStream(); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); fprintf(stderr, " File name : %s\n", file_name); fprintf(stderr, " Sample rate: %d\n", fs);
diff --git a/media/audio/pulse/pulse_input.cc b/media/audio/pulse/pulse_input.cc index 10bbd2d2..59b288ed 100644 --- a/media/audio/pulse/pulse_input.cc +++ b/media/audio/pulse/pulse_input.cc
@@ -56,25 +56,25 @@ DCHECK(!handle_); } -bool PulseAudioInputStream::Open() { +AudioInputStream::OpenOutcome PulseAudioInputStream::Open() { DCHECK(thread_checker_.CalledOnValidThread()); SendLogMessage("%s()", __func__); if (device_name_ == AudioDeviceDescription::kDefaultDeviceId && audio_manager_->DefaultSourceIsMonitor()) { SendLogMessage("%s => (ERROR: can't open monitor device)", __func__); - return false; + return OpenOutcome::kFailed; } AutoPulseLock auto_lock(pa_mainloop_); if (!pulse::CreateInputStream(pa_mainloop_, pa_context_, &handle_, params_, device_name_, &StreamNotifyCallback, this)) { SendLogMessage("%s => (ERROR: failed to open PA stream)", __func__); - return false; + return OpenOutcome::kFailed; } DCHECK(handle_); - return true; + return OpenOutcome::kSuccess; } void PulseAudioInputStream::Start(AudioInputCallback* callback) {
diff --git a/media/audio/pulse/pulse_input.h b/media/audio/pulse/pulse_input.h index 2fe4b77..b340bda0 100644 --- a/media/audio/pulse/pulse_input.h +++ b/media/audio/pulse/pulse_input.h
@@ -34,7 +34,7 @@ ~PulseAudioInputStream() override; // Implementation of AudioInputStream. - bool Open() override; + AudioInputStream::OpenOutcome Open() override; void Start(AudioInputCallback* callback) override; void Stop() override; void Close() override;
diff --git a/media/audio/win/audio_low_latency_input_win.cc b/media/audio/win/audio_low_latency_input_win.cc index 497df37..5183348 100644 --- a/media/audio/win/audio_low_latency_input_win.cc +++ b/media/audio/win/audio_low_latency_input_win.cc
@@ -389,11 +389,11 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } -bool WASAPIAudioInputStream::Open() { +AudioInputStream::OpenOutcome WASAPIAudioInputStream::Open() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); SendLogMessage("%s([opened=%s])", __func__, opened_ ? "true" : "false"); if (opened_) { - return false; + return OpenOutcome::kAlreadyOpen; } // Obtain a reference to the IMMDevice interface of the capturing device with @@ -401,7 +401,7 @@ HRESULT hr = SetCaptureDevice(); if (FAILED(hr)) { ReportOpenResult(hr); - return false; + return OpenOutcome::kFailed; } // Check if raw audio processing is supported for the selected capture device. @@ -432,7 +432,7 @@ if (FAILED(hr)) { open_result_ = OPEN_RESULT_ACTIVATION_FAILED; ReportOpenResult(hr); - return false; + return OpenOutcome::kFailed; } #ifndef NDEBUG @@ -457,7 +457,7 @@ if (!DesiredFormatIsSupported(&hr)) { open_result_ = OPEN_RESULT_FORMAT_NOT_SUPPORTED; ReportOpenResult(hr); - return false; + return OpenOutcome::kFailed; } // Initialize the audio stream between the client and the device using @@ -468,7 +468,12 @@ ReportOpenResult(hr); // Report before we assign a value to |opened_|. opened_ = SUCCEEDED(hr); - return opened_; + if (opened_) { + return OpenOutcome::kSuccess; + } + + return (hr == E_ACCESSDENIED) ? OpenOutcome::kFailedSystemPermissions + : OpenOutcome::kFailed; } void WASAPIAudioInputStream::Start(AudioInputCallback* callback) {
diff --git a/media/audio/win/audio_low_latency_input_win.h b/media/audio/win/audio_low_latency_input_win.h index b66a15b2..91b8fb1 100644 --- a/media/audio/win/audio_low_latency_input_win.h +++ b/media/audio/win/audio_low_latency_input_win.h
@@ -130,7 +130,7 @@ ~WASAPIAudioInputStream() override; // Implementation of AudioInputStream. - bool Open() override; + AudioInputStream::OpenOutcome Open() override; void Start(AudioInputCallback* callback) override; void Stop() override; void Close() override;
diff --git a/media/audio/win/audio_low_latency_input_win_unittest.cc b/media/audio/win/audio_low_latency_input_win_unittest.cc index d4eee511..a2cdbc2 100644 --- a/media/audio/win/audio_low_latency_input_win_unittest.cc +++ b/media/audio/win/audio_low_latency_input_win_unittest.cc
@@ -348,7 +348,7 @@ ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); ScopedAudioInputStream ais( CreateDefaultAudioInputStream(audio_manager_.get())); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); ais.Close(); } @@ -367,7 +367,7 @@ AudioInputStreamWrapper aisw(audio_manager_.get(), device.unique_id); { ScopedAudioInputStream ais(aisw.Create()); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); } } } @@ -377,7 +377,7 @@ ABORT_AUDIO_TEST_IF_NOT(HasCoreAudioAndInputDevices(audio_manager_.get())); ScopedAudioInputStream ais( CreateDefaultAudioInputStream(audio_manager_.get())); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); MockAudioInputCallback sink; ais->Start(&sink); ais.Close(); @@ -394,7 +394,7 @@ ScopedAudioInputStream ais( CreateDefaultAudioInputStream(audio_manager_.get())); EXPECT_TRUE(ais->SetAutomaticGainControl(true)); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); MockAudioInputCallback sink; ais->Start(&sink); ais->Stop(); @@ -408,7 +408,7 @@ base::HistogramTester histogram_tester; ScopedAudioInputStream ais( CreateDefaultAudioInputStream(audio_manager_.get())); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); FakeAudioInputCallback sink; ais->Start(&sink); sink.WaitForData(); @@ -429,8 +429,8 @@ CreateDefaultAudioInputStream(audio_manager_.get())); // Open(), Open() should fail the second time. - EXPECT_TRUE(ais->Open()); - EXPECT_FALSE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kAlreadyOpen); FakeAudioInputCallback sink; @@ -459,7 +459,7 @@ // the shared mixing rate. The default buffer size is 10ms. AudioInputStreamWrapper aisw(audio_manager_.get()); ScopedAudioInputStream ais(aisw.Create()); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); MockAudioInputCallback sink; @@ -491,7 +491,7 @@ count = 0; ais.Reset(aisw.Create(2 * frames_per_buffer_10ms)); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); bytes_per_packet = aisw.channels() * aisw.frames_per_buffer() * SampleFormatToBytesPerChannel(kSampleFormat); @@ -512,7 +512,7 @@ count = 0; ais.Reset(aisw.Create(frames_per_buffer_10ms / 2)); - EXPECT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); bytes_per_packet = aisw.channels() * aisw.frames_per_buffer() * SampleFormatToBytesPerChannel(kSampleFormat); @@ -547,7 +547,7 @@ ScopedAudioInputStream stream(audio_manager_->MakeAudioInputStream( params, AudioDeviceDescription::kLoopbackInputDeviceId, base::BindRepeating(&LogCallbackDummy))); - ASSERT_TRUE(stream->Open()); + EXPECT_EQ(stream->Open(), AudioInputStream::OpenOutcome::kSuccess); FakeAudioInputCallback sink; stream->Start(&sink); ASSERT_FALSE(sink.error()); @@ -575,7 +575,7 @@ AudioInputStreamWrapper aisw(audio_manager_.get()); ScopedAudioInputStream ais(aisw.Create()); - ASSERT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); VLOG(0) << ">> Sample rate: " << aisw.sample_rate() << " [Hz]"; WriteToFileAudioSink file_sink(file_name); @@ -602,7 +602,7 @@ AudioInputStreamWrapper aisw(audio_manager_.get()); ScopedAudioInputStream ais(aisw.Create()); - ASSERT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); VLOG(0) << ">> Sample rate: " << aisw.sample_rate() << " [Hz]"; WriteToFileAudioSink file_sink(file_name); @@ -656,7 +656,7 @@ AudioInputStreamWrapper aisw(audio_manager_.get(), params); ScopedAudioInputStream ais(aisw.Create()); - ASSERT_TRUE(ais->Open()); + EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess); VLOG(0) << ">> Resampled rate will be: " << aisw.sample_rate() << " [Hz]"; VLOG(0) << ">> New layout will be: "
diff --git a/media/base/BUILD.gn b/media/base/BUILD.gn index 38dfdb8..eb2295b 100644 --- a/media/base/BUILD.gn +++ b/media/base/BUILD.gn
@@ -395,6 +395,10 @@ ] } + if (is_chromeos_ash) { + deps += [ "//ash/constants" ] + } + if (media_use_libvpx) { deps += [ "//third_party/libvpx" ] }
diff --git a/media/base/DEPS b/media/base/DEPS new file mode 100644 index 0000000..f514004 --- /dev/null +++ b/media/base/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+ash/constants", +]
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index 5cdc7782..29527ff6 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc
@@ -13,6 +13,10 @@ #include "base/cpu.h" #endif +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/constants/ash_features.h" +#endif + namespace switches { // Allow users to specify a custom buffer size for debugging purpose. @@ -869,6 +873,12 @@ if (!base::FeatureList::IsEnabled(media::kLiveCaption)) return false; +#if BUILDFLAG(IS_CHROMEOS_ASH) + // Some Chrome OS devices do not support on-device speech. + if (!base::FeatureList::IsEnabled(ash::features::kOnDeviceSpeechRecognition)) + return false; +#endif + #if defined(OS_LINUX) if (base::FeatureList::IsEnabled(media::kUseSodaForLiveCaption)) { // Check if the CPU has the required instruction set to run the Speech
diff --git a/media/base/status_codes.h b/media/base/status_codes.h index 70078b0..45eee646 100644 --- a/media/base/status_codes.h +++ b/media/base/status_codes.h
@@ -94,7 +94,6 @@ kGetQuantBufferFailed = 0x00000328, kReleaseQuantBufferFailed = 0x00000329, kBitstreamBufferSliceTooBig = 0x00000330, - kCreateSharedImageFailed = 0x00000331, // MojoDecoder Errors: 0x04 kMojoDecoderNoWrappedDecoder = 0x00000401,
diff --git a/media/gpu/command_buffer_helper.cc b/media/gpu/command_buffer_helper.cc index 92881495..a15549c0 100644 --- a/media/gpu/command_buffer_helper.cc +++ b/media/gpu/command_buffer_helper.cc
@@ -48,10 +48,8 @@ #endif // defined(OS_MAC) ); decoder_helper_ = GLES2DecoderHelper::Create(stub_->decoder_context()); - // Use the shared image stub tracker instead of command buffer stub tracker - // since the created shared images could outlive the command buffer. - gpu::MemoryTracker* tracker = stub_->channel()->shared_image_stub(); - tracker_ = std::make_unique<gpu::MemoryTypeTracker>(tracker); + tracker_ = + std::make_unique<gpu::MemoryTypeTracker>(stub_->GetMemoryTracker()); } gl::GLContext* GetGLContext() override {
diff --git a/media/gpu/windows/d3d11_texture_selector.cc b/media/gpu/windows/d3d11_texture_selector.cc index 4a84e58..7a92a8f 100644 --- a/media/gpu/windows/d3d11_texture_selector.cc +++ b/media/gpu/windows/d3d11_texture_selector.cc
@@ -66,6 +66,7 @@ } case DXGI_FORMAT_P010: { MEDIA_LOG(INFO, media_log) << "D3D11VideoDecoder producing P010"; + output_pixel_format = PIXEL_FORMAT_ARGB; // TODO(liberato): handle case where we bind P010 directly (see dxva). @@ -93,7 +94,6 @@ // TODO(liberato): use the format checker, else bind P010. MEDIA_LOG(INFO, media_log) << "D3D11VideoDecoder: 8 bit sRGB"; output_dxgi_format = DXGI_FORMAT_B8G8R8A8_UNORM; - output_pixel_format = PIXEL_FORMAT_ARGB; output_color_space = gfx::ColorSpace::CreateSRGB(); } else { // Bind P010 directly, since we can't copy. @@ -116,10 +116,9 @@ output_color_space = gfx::ColorSpace::CreateSCRGBLinear(); } else if (format_checker->CheckOutputFormatSupport( DXGI_FORMAT_R10G10B10A2_UNORM)) { - MEDIA_LOG(INFO, media_log) << "D3D11VideoDecoder: RGB10A2 HDR10/PQ"; + MEDIA_LOG(INFO, media_log) << "D3D11VideoDecoder: BGRA10 scRGBLinear"; output_dxgi_format = DXGI_FORMAT_R10G10B10A2_UNORM; - output_pixel_format = PIXEL_FORMAT_XB30; - output_color_space = gfx::ColorSpace::CreateHDR10(); + output_color_space = gfx::ColorSpace::CreateSCRGBLinear(); } else { // No support at all. Just bind P010, and hope for the best. MEDIA_LOG(INFO, media_log) @@ -150,10 +149,9 @@ // If we're trying to produce an output texture that's different from what // the decoder is providing, then we need to copy it. If sharing decoder // textures is not allowed, then copy either way. - bool needs_texture_copy = - !SupportsZeroCopy(gpu_preferences, workarounds) || - (decoder_output_format != output_dxgi_format) || - base::FeatureList::IsEnabled(kD3D11VideoDecoderAlwaysCopy); + bool needs_texture_copy = !SupportsZeroCopy(gpu_preferences, workarounds) || + (decoder_output_format != output_dxgi_format) || + base::FeatureList::IsEnabled(kD3D11VideoDecoderAlwaysCopy); MEDIA_LOG(INFO, media_log) << "D3D11VideoDecoder output color space: " @@ -180,7 +178,8 @@ ComD3D11Device device, gfx::Size size) { // TODO(liberato): If the output format is rgb, then create a pbuffer wrapper. - return std::make_unique<DefaultTexture2DWrapper>(size, OutputDXGIFormat()); + return std::make_unique<DefaultTexture2DWrapper>(size, OutputDXGIFormat(), + PixelFormat()); } bool TextureSelector::WillCopyForTesting() const { @@ -229,7 +228,9 @@ return nullptr; return std::make_unique<CopyingTexture2DWrapper>( - size, std::make_unique<DefaultTexture2DWrapper>(size, OutputDXGIFormat()), + size, + std::make_unique<DefaultTexture2DWrapper>(size, OutputDXGIFormat(), + PixelFormat()), video_processor_proxy_, out_texture, output_color_space_); }
diff --git a/media/gpu/windows/d3d11_texture_selector_unittest.cc b/media/gpu/windows/d3d11_texture_selector_unittest.cc index 9ebb9c34..12bd030 100644 --- a/media/gpu/windows/d3d11_texture_selector_unittest.cc +++ b/media/gpu/windows/d3d11_texture_selector_unittest.cc
@@ -129,7 +129,7 @@ CreateWithDefaultGPUInfo(DXGI_FORMAT_P010, ZeroCopyEnabled::kTrue, TextureSelector::HDRMode::kSDROrHDR); - EXPECT_EQ(tex_sel->PixelFormat(), PIXEL_FORMAT_XB30); + EXPECT_EQ(tex_sel->PixelFormat(), PIXEL_FORMAT_ARGB); EXPECT_EQ(tex_sel->OutputDXGIFormat(), DXGI_FORMAT_R10G10B10A2_UNORM); EXPECT_TRUE(tex_sel->WillCopyForTesting()); }
diff --git a/media/gpu/windows/d3d11_texture_wrapper.cc b/media/gpu/windows/d3d11_texture_wrapper.cc index 0d1da96..ed2ede8d 100644 --- a/media/gpu/windows/d3d11_texture_wrapper.cc +++ b/media/gpu/windows/d3d11_texture_wrapper.cc
@@ -22,43 +22,90 @@ namespace { -bool SupportsFormat(DXGI_FORMAT dxgi_format) { +// Populates Viz |texture_formats| that map to the corresponding DXGI format and +// VideoPixelFormat. Returns true if they can be successfully mapped. +bool DXGIFormatToVizFormat( + DXGI_FORMAT dxgi_format, + VideoPixelFormat pixel_format, + size_t textures_per_picture, + std::array<viz::ResourceFormat, VideoFrame::kMaxPlanes>& texture_formats) { switch (dxgi_format) { case DXGI_FORMAT_NV12: - case DXGI_FORMAT_P010: - case DXGI_FORMAT_B8G8R8A8_UNORM: - case DXGI_FORMAT_R10G10B10A2_UNORM: - case DXGI_FORMAT_R16G16B16A16_FLOAT: + DCHECK_EQ(textures_per_picture, 2u); + texture_formats[0] = viz::RED_8; // Y + texture_formats[1] = viz::RG_88; // UV return true; - default: + case DXGI_FORMAT_P010: + // TODO(crbug.com/1011555): P010 formats are not fully supported. + // Treat them to be the same as NV12 for the time being. + DCHECK_EQ(textures_per_picture, 2u); + texture_formats[0] = viz::RED_8; + texture_formats[1] = viz::RG_88; + return true; + case DXGI_FORMAT_B8G8R8A8_UNORM: + DCHECK_EQ(textures_per_picture, 1u); + if (pixel_format != PIXEL_FORMAT_ARGB) { + return false; + } + texture_formats[0] = viz::BGRA_8888; + return true; + case DXGI_FORMAT_R16G16B16A16_FLOAT: + DCHECK_EQ(textures_per_picture, 1u); + if (pixel_format != PIXEL_FORMAT_RGBAF16) + return false; + texture_formats[0] = viz::RGBA_F16; + return true; + default: // Unsupported return false; } } -size_t NumPlanes(DXGI_FORMAT dxgi_format) { - switch (dxgi_format) { - case DXGI_FORMAT_NV12: - case DXGI_FORMAT_P010: - return 2; - case DXGI_FORMAT_B8G8R8A8_UNORM: - case DXGI_FORMAT_R10G10B10A2_UNORM: - case DXGI_FORMAT_R16G16B16A16_FLOAT: - return 1; - default: - NOTREACHED(); - return 0; - } -} - } // anonymous namespace +// Handy structure so that we can activate / bind one or two textures. +struct ScopedTextureEverything { + ScopedTextureEverything(GLenum unit, GLuint service_id) + : active_(unit), binder_(GL_TEXTURE_EXTERNAL_OES, service_id) {} + ~ScopedTextureEverything() = default; + + // Order is important; we need |active_| to be constructed first + // and destructed last. + gl::ScopedActiveTexture active_; + gl::ScopedTextureBinder binder_; + + DISALLOW_COPY_AND_ASSIGN(ScopedTextureEverything); +}; + +// Another handy helper class to guarantee that ScopedTextureEverythings +// are deleted in reverse order. This is required so that the scoped +// active texture unit doesn't change. Surprisingly, none of the stl +// containers, or the chromium ones, seem to guarantee anything about +// the order of destruction. +struct OrderedDestructionList { + OrderedDestructionList() = default; + ~OrderedDestructionList() { + // Erase last-to-first. + while (!list_.empty()) + list_.pop_back(); + } + + template <typename... Args> + void emplace_back(Args&&... args) { + list_.emplace_back(std::forward<Args>(args)...); + } + + std::list<ScopedTextureEverything> list_; + DISALLOW_COPY_AND_ASSIGN(OrderedDestructionList); +}; + Texture2DWrapper::Texture2DWrapper() = default; Texture2DWrapper::~Texture2DWrapper() = default; DefaultTexture2DWrapper::DefaultTexture2DWrapper(const gfx::Size& size, - DXGI_FORMAT dxgi_format) - : size_(size), dxgi_format_(dxgi_format) {} + DXGI_FORMAT dxgi_format, + VideoPixelFormat pixel_format) + : size_(size), dxgi_format_(dxgi_format), pixel_format_(pixel_format) {} DefaultTexture2DWrapper::~DefaultTexture2DWrapper() = default; @@ -88,17 +135,28 @@ GetCommandBufferHelperCB get_helper_cb, ComD3D11Texture2D texture, size_t array_slice) { - if (!SupportsFormat(dxgi_format_)) + gpu_resources_ = base::SequenceBound<GpuResources>( + std::move(gpu_task_runner), + BindToCurrentLoop(base::BindOnce(&DefaultTexture2DWrapper::OnError, + weak_factory_.GetWeakPtr()))); + + const size_t textures_per_picture = VideoFrame::NumPlanes(pixel_format_); + + std::array<viz::ResourceFormat, VideoFrame::kMaxPlanes> texture_formats; + if (!DXGIFormatToVizFormat(dxgi_format_, pixel_format_, textures_per_picture, + texture_formats)) { return Status(StatusCode::kUnsupportedTextureFormatForBind); + } // Generate mailboxes and holders. // TODO(liberato): Verify that this is really okay off the GPU main thread. // The current implementation is. std::vector<gpu::Mailbox> mailboxes; - for (size_t plane = 0; plane < NumPlanes(dxgi_format_); plane++) { + for (size_t texture_idx = 0; texture_idx < textures_per_picture; + texture_idx++) { mailboxes.push_back(gpu::Mailbox::GenerateForSharedImage()); - mailbox_holders_[plane] = gpu::MailboxHolder( - mailboxes[plane], gpu::SyncToken(), GL_TEXTURE_EXTERNAL_OES); + mailbox_holders_[texture_idx] = gpu::MailboxHolder( + mailboxes[texture_idx], gpu::SyncToken(), GL_TEXTURE_EXTERNAL_OES); } // Start construction of the GpuResources. @@ -106,12 +164,10 @@ // device for decoding. Sharing seems not to work very well. Otherwise, we // would create the texture with KEYED_MUTEX and NTHANDLE, then send along // a handle that we get from |texture| as an IDXGIResource1. - auto on_error_cb = BindToCurrentLoop(base::BindOnce( - &DefaultTexture2DWrapper::OnError, weak_factory_.GetWeakPtr())); - gpu_resources_ = base::SequenceBound<GpuResources>( - std::move(gpu_task_runner), std::move(on_error_cb), - std::move(get_helper_cb), std::move(mailboxes), size_, dxgi_format_, - texture, array_slice); + gpu_resources_.AsyncCall(&GpuResources::Init) + .WithArgs(std::move(get_helper_cb), std::move(mailboxes), + GL_TEXTURE_EXTERNAL_OES, size_, textures_per_picture, + texture_formats, pixel_format_, texture, array_slice); return OkStatus(); } @@ -126,47 +182,217 @@ void DefaultTexture2DWrapper::SetDisplayHDRMetadata( const DXGI_HDR_METADATA_HDR10& dxgi_display_metadata) {} -DefaultTexture2DWrapper::GpuResources::GpuResources( - OnErrorCB on_error_cb, +DefaultTexture2DWrapper::GpuResources::GpuResources(OnErrorCB on_error_cb) + : on_error_cb_(std::move(on_error_cb)) {} + +DefaultTexture2DWrapper::GpuResources::~GpuResources() { + if (helper_ && helper_->MakeContextCurrent()) { + for (uint32_t service_id : service_ids_) + helper_->DestroyTexture(service_id); + } +} + +void DefaultTexture2DWrapper::GpuResources::Init( GetCommandBufferHelperCB get_helper_cb, - const std::vector<gpu::Mailbox>& mailboxes, - const gfx::Size& size, - DXGI_FORMAT dxgi_format, + const std::vector<gpu::Mailbox> mailboxes, + GLenum target, + gfx::Size size, + size_t textures_per_picture, + std::array<viz::ResourceFormat, VideoFrame::kMaxPlanes> texture_formats, + VideoPixelFormat pixel_format, ComD3D11Texture2D texture, size_t array_slice) { helper_ = get_helper_cb.Run(); if (!helper_ || !helper_->MakeContextCurrent()) { - std::move(on_error_cb) - .Run(std::move(StatusCode::kMakeContextCurrentFailed)); + NotifyError(StatusCode::kMakeContextCurrentFailed); return; } - // Usage flags to allow the display compositor to draw from it, video to - // decode, and allow webgl/canvas access. - constexpr uint32_t usage = - gpu::SHARED_IMAGE_USAGE_VIDEO_DECODE | gpu::SHARED_IMAGE_USAGE_GLES2 | - gpu::SHARED_IMAGE_USAGE_RASTER | gpu::SHARED_IMAGE_USAGE_DISPLAY | - gpu::SHARED_IMAGE_USAGE_SCANOUT; - - auto shared_image_backings = - gpu::SharedImageBackingD3D::CreateFromVideoTexture( - mailboxes, dxgi_format, size, usage, texture, array_slice); - if (shared_image_backings.empty()) { - std::move(on_error_cb).Run(std::move(StatusCode::kCreateSharedImageFailed)); + // Create the stream for zero-copy use by gl. + EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); + const EGLint stream_attributes[] = { + // clang-format off + EGL_CONSUMER_LATENCY_USEC_KHR, 0, + EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR, 0, + EGL_NONE, + // clang-format on + }; + EGLStreamKHR stream = eglCreateStreamKHR(egl_display, stream_attributes); + if (!stream) { + NotifyError(StatusCode::kCreateEglStreamFailed); return; } - DCHECK_EQ(shared_image_backings.size(), NumPlanes(dxgi_format)); - for (auto& backing : shared_image_backings) - shared_images_.push_back(helper_->Register(std::move(backing))); + // |stream| will be destroyed when the GLImage is. + // TODO(liberato): for tests, it will be destroyed pretty much at the end of + // this function unless |helper_| retains it. Also, this won't work if we + // have a FakeCommandBufferHelper since the service IDs aren't meaningful. + gl_image_ = base::MakeRefCounted<gl::GLImageDXGI>(size, stream); + + // Create the textures and attach them to the mailboxes. + // TODO(liberato): Should we use GL_FLOAT for an fp16 texture? It doesn't + // really seem to matter so far as I can tell. + for (size_t texture_idx = 0; texture_idx < textures_per_picture; + texture_idx++) { + const viz::ResourceFormat format = texture_formats[texture_idx]; + const GLenum internal_format = viz::GLInternalFormat(format); + const GLenum data_type = viz::GLDataType(format); + const GLenum data_format = viz::GLDataFormat(format); + + // Adjust the size by the subsampling factor. + const size_t width = + VideoFrame::Columns(texture_idx, pixel_format, size.width()); + const size_t height = + VideoFrame::Rows(texture_idx, pixel_format, size.height()); + const gfx::Size plane_size(width, height); + + // TODO(crbug.com/1011555): CreateTexture allocates a GL texture, figure out + // if this can be removed. + const uint32_t service_id = + helper_->CreateTexture(target, internal_format, plane_size.width(), + plane_size.height(), data_format, data_type); + + const auto& mailbox = mailboxes[texture_idx]; + + // Shared image does not need to store the colorspace since it is already + // stored on the VideoFrame which is provided upon presenting the overlay. + // To prevent the developer from mistakenly using it, provide the invalid + // value from default-construction. + const gfx::ColorSpace kInvalidColorSpace; + + // Usage flags to allow the display compositor to draw from it, video to + // decode, and allow webgl/canvas access. + const uint32_t shared_image_usage = + gpu::SHARED_IMAGE_USAGE_VIDEO_DECODE | gpu::SHARED_IMAGE_USAGE_GLES2 | + gpu::SHARED_IMAGE_USAGE_RASTER | gpu::SHARED_IMAGE_USAGE_DISPLAY | + gpu::SHARED_IMAGE_USAGE_SCANOUT; + + // Create a shared image + // TODO(crbug.com/1011555): Need key shared mutex if shared image is ever + // used by another device. + scoped_refptr<gpu::gles2::TexturePassthrough> gl_texture = + gpu::gles2::TexturePassthrough::CheckedCast( + helper_->GetTexture(service_id)); + + auto shared_image = std::make_unique<gpu::SharedImageBackingD3D>( + mailbox, format, plane_size, kInvalidColorSpace, + kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, shared_image_usage, + /*swap_chain=*/nullptr, std::move(gl_texture), gl_image_, + /*buffer_index=*/0, texture, base::win::ScopedHandle(), + /*dxgi_key_mutex=*/nullptr); + + // Caller is assumed to provide cleared d3d textures. + shared_image->SetCleared(); + + // Shared images will be destroyed when this wrapper goes away. + // Only GpuResource can be used to safely destroy the shared images on the + // gpu main thread. + shared_images_.push_back(helper_->Register(std::move(shared_image))); + + service_ids_.push_back(service_id); + } + + // Bind all the textures so that the stream can find them. + OrderedDestructionList texture_everythings; + for (size_t i = 0; i < textures_per_picture; i++) + texture_everythings.emplace_back(GL_TEXTURE0 + i, service_ids_[i]); + + std::vector<EGLAttrib> consumer_attributes; + if (textures_per_picture == 2) { + // Assume NV12. + consumer_attributes = { + // clang-format off + EGL_COLOR_BUFFER_TYPE, EGL_YUV_BUFFER_EXT, + EGL_YUV_NUMBER_OF_PLANES_EXT, 2, + EGL_YUV_PLANE0_TEXTURE_UNIT_NV, 0, + EGL_YUV_PLANE1_TEXTURE_UNIT_NV, 1, + EGL_NONE, + // clang-format on + }; + } else { + // Assume some rgb format. + consumer_attributes = { + // clang-format off + EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER, + EGL_NONE, + // clang-format on + }; + } + EGLBoolean result = eglStreamConsumerGLTextureExternalAttribsNV( + egl_display, stream, consumer_attributes.data()); + if (!result) { + NotifyError(StatusCode::kCreateEglStreamConsumerFailed); + return; + } + + EGLAttrib producer_attributes[] = { + EGL_NONE, + }; + + result = eglCreateStreamProducerD3DTextureANGLE(egl_display, stream, + producer_attributes); + if (!result) { + NotifyError(StatusCode::kCreateEglStreamProducerFailed); + return; + } + + // Note that this is valid as long as |gl_image_| is valid; it is + // what deletes the stream. + stream_ = stream; + + // Bind the image to each texture. + for (size_t texture_idx = 0; texture_idx < service_ids_.size(); + texture_idx++) { + helper_->BindImage(service_ids_[texture_idx], gl_image_.get(), + false /* client_managed */); + } + + // Specify the texture so ProcessTexture knows how to process it using a GL + // image. + gl_image_->SetTexture(texture, array_slice); + + PushNewTexture(); } -DefaultTexture2DWrapper::GpuResources::~GpuResources() { - // Destroy shared images with a current context. - if (!helper_ || !helper_->MakeContextCurrent()) +void DefaultTexture2DWrapper::GpuResources::PushNewTexture() { + // If init didn't complete, then signal (another) error that will probably be + // ignored in favor of whatever we signalled earlier. + if (!gl_image_ || !stream_) { + NotifyError(StatusCode::kDecoderInitializeNeverCompleted); return; - shared_images_.clear(); + } + + if (!helper_ || !helper_->MakeContextCurrent()) { + NotifyError(StatusCode::kMakeContextCurrentFailed); + return; + } + + // Notify angle that it has a new texture. + EGLAttrib frame_attributes[] = { + EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, + gl_image_->level(), + EGL_NONE, + }; + + EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); + if (!eglStreamPostD3DTextureANGLE( + egl_display, stream_, static_cast<void*>(gl_image_->texture().Get()), + frame_attributes)) { + NotifyError(StatusCode::kPostTextureFailed); + return; + } + + if (!eglStreamConsumerAcquireKHR(egl_display, stream_)) { + NotifyError(StatusCode::kPostAcquireStreamFailed); + return; + } +} + +void DefaultTexture2DWrapper::GpuResources::NotifyError(Status status) { + if (on_error_cb_) + std::move(on_error_cb_).Run(std::move(status)); + // else this isn't the first error, so skip it. } } // namespace media
diff --git a/media/gpu/windows/d3d11_texture_wrapper.h b/media/gpu/windows/d3d11_texture_wrapper.h index 9604e88..5c097ec9 100644 --- a/media/gpu/windows/d3d11_texture_wrapper.h +++ b/media/gpu/windows/d3d11_texture_wrapper.h
@@ -74,7 +74,9 @@ // While the specific texture instance can change on every call to // ProcessTexture, the dxgi format must be the same for all of them. - DefaultTexture2DWrapper(const gfx::Size& size, DXGI_FORMAT dxgi_format); + DefaultTexture2DWrapper(const gfx::Size& size, + DXGI_FORMAT dxgi_format, + VideoPixelFormat pixel_format); ~DefaultTexture2DWrapper() override; Status Init(scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner, @@ -97,17 +99,36 @@ // can use the mailbox. class GpuResources { public: - GpuResources(OnErrorCB on_error_cb, - GetCommandBufferHelperCB get_helper_cb, - const std::vector<gpu::Mailbox>& mailboxes, - const gfx::Size& size, - DXGI_FORMAT dxgi_format, - ComD3D11Texture2D texture, - size_t array_slice); + GpuResources(OnErrorCB on_error_cb); ~GpuResources(); + void Init( + GetCommandBufferHelperCB get_helper_cb, + const std::vector<gpu::Mailbox> mailboxes, + GLenum target, + gfx::Size size, + size_t textures_per_picture, + std::array<viz::ResourceFormat, VideoFrame::kMaxPlanes> texture_formats, + VideoPixelFormat pixel_format, + ComD3D11Texture2D texture, + size_t array_slice); + + std::vector<uint32_t> service_ids_; + private: + // Push a new |texture|, |array_slice| to |gl_image_|. + // Both |texture| and |array_slice| were set by Init. + void PushNewTexture(); + + // Notify our wrapper about |status|, if we haven't before. + void NotifyError(Status status); + + // May be empty if we've already sent an error. + OnErrorCB on_error_cb_; + scoped_refptr<CommandBufferHelper> helper_; + scoped_refptr<gl::GLImageDXGI> gl_image_; + EGLStreamKHR stream_; std::vector<std::unique_ptr<gpu::SharedImageRepresentationFactoryRef>> shared_images_; @@ -125,6 +146,7 @@ base::SequenceBound<GpuResources> gpu_resources_; MailboxHolderArray mailbox_holders_; DXGI_FORMAT dxgi_format_; + VideoPixelFormat pixel_format_; base::WeakPtrFactory<DefaultTexture2DWrapper> weak_factory_{this}; };
diff --git a/media/gpu/windows/d3d11_texture_wrapper_unittest.cc b/media/gpu/windows/d3d11_texture_wrapper_unittest.cc index cfcd5fa..3142782 100644 --- a/media/gpu/windows/d3d11_texture_wrapper_unittest.cc +++ b/media/gpu/windows/d3d11_texture_wrapper_unittest.cc
@@ -88,8 +88,10 @@ TEST_F(D3D11TextureWrapperUnittest, NV12InitSucceeds) { STOP_IF_WIN7(); const DXGI_FORMAT dxgi_format = DXGI_FORMAT_NV12; + const VideoPixelFormat pixel_format = PIXEL_FORMAT_NV12; - auto wrapper = std::make_unique<DefaultTexture2DWrapper>(size_, dxgi_format); + auto wrapper = std::make_unique<DefaultTexture2DWrapper>(size_, dxgi_format, + pixel_format); const Status init_result = wrapper->Init( task_runner_, get_helper_cb_, /*texture_d3d=*/nullptr, /*array_slice=*/0); EXPECT_TRUE(init_result.is_ok()); @@ -100,8 +102,10 @@ TEST_F(D3D11TextureWrapperUnittest, BGRA8InitSucceeds) { STOP_IF_WIN7(); const DXGI_FORMAT dxgi_format = DXGI_FORMAT_B8G8R8A8_UNORM; + const VideoPixelFormat pixel_format = PIXEL_FORMAT_ARGB; - auto wrapper = std::make_unique<DefaultTexture2DWrapper>(size_, dxgi_format); + auto wrapper = std::make_unique<DefaultTexture2DWrapper>(size_, dxgi_format, + pixel_format); const Status init_result = wrapper->Init( task_runner_, get_helper_cb_, /*texture_d3d=*/nullptr, /*array_slice=*/0); EXPECT_TRUE(init_result.is_ok()); @@ -110,8 +114,10 @@ TEST_F(D3D11TextureWrapperUnittest, FP16InitSucceeds) { STOP_IF_WIN7(); const DXGI_FORMAT dxgi_format = DXGI_FORMAT_R16G16B16A16_FLOAT; + const VideoPixelFormat pixel_format = PIXEL_FORMAT_RGBAF16; - auto wrapper = std::make_unique<DefaultTexture2DWrapper>(size_, dxgi_format); + auto wrapper = std::make_unique<DefaultTexture2DWrapper>(size_, dxgi_format, + pixel_format); const Status init_result = wrapper->Init( task_runner_, get_helper_cb_, /*texture_d3d=*/nullptr, /*array_slice=*/0); EXPECT_TRUE(init_result.is_ok()); @@ -120,8 +126,10 @@ TEST_F(D3D11TextureWrapperUnittest, P010InitSucceeds) { STOP_IF_WIN7(); const DXGI_FORMAT dxgi_format = DXGI_FORMAT_P010; + const VideoPixelFormat pixel_format = PIXEL_FORMAT_NV12; - auto wrapper = std::make_unique<DefaultTexture2DWrapper>(size_, dxgi_format); + auto wrapper = std::make_unique<DefaultTexture2DWrapper>(size_, dxgi_format, + pixel_format); const Status init_result = wrapper->Init( task_runner_, get_helper_cb_, /*texture_d3d=*/nullptr, /*array_slice=*/0); EXPECT_TRUE(init_result.is_ok()); @@ -130,11 +138,13 @@ TEST_F(D3D11TextureWrapperUnittest, UnknownInitFails) { STOP_IF_WIN7(); const DXGI_FORMAT dxgi_format = DXGI_FORMAT_UNKNOWN; + const VideoPixelFormat pixel_format = PIXEL_FORMAT_UNKNOWN; - auto wrapper = std::make_unique<DefaultTexture2DWrapper>(size_, dxgi_format); + auto wrapper = std::make_unique<DefaultTexture2DWrapper>(size_, dxgi_format, + pixel_format); const Status init_result = wrapper->Init( task_runner_, get_helper_cb_, /*texture_d3d=*/nullptr, /*array_slice=*/0); EXPECT_FALSE(init_result.is_ok()); } -} // namespace media +} // namespace media \ No newline at end of file
diff --git a/media/gpu/windows/dxva_video_decode_accelerator_win.cc b/media/gpu/windows/dxva_video_decode_accelerator_win.cc index e7a5084..19736f5 100644 --- a/media/gpu/windows/dxva_video_decode_accelerator_win.cc +++ b/media/gpu/windows/dxva_video_decode_accelerator_win.cc
@@ -2377,7 +2377,11 @@ PLATFORM_FAILURE, ); hr = decoder_->ProcessInput(0, sample.Get(), 0); } - // If we continue to get the MF_E_NOTACCEPTING error we do the following:- + // If we continue to get the MF_E_NOTACCEPTING error we do the following: + // 1. Check if MF appears to be stuck in a not-accepting loop. When this + // occurs we want to break out of the loop early to allow recovery + // without prolonged ux hangs or running into potential OOM issues. + // If not in a loop then: // 1. Add the input sample to the pending queue. // 2. If we don't have any output samples we post the // DecodePendingInputBuffers task to process the pending input samples. @@ -2387,6 +2391,17 @@ // given time due to the limitation with the Microsoft media foundation // decoder where it recycles the output Decoder surfaces. if (hr == MF_E_NOTACCEPTING) { + // Check if we appear to be stuck in a loop + if (inputs_before_decode_ >= 1000) { + // The value of 1000 is an arbitrary upper bound here since processing + // is not gated on any media timings. In practice we typically see + // maximum values in the 5 to 10 range for normal execution, so 1000 + // affords two orders of magnitude outside of the expected range. + RETURN_AND_NOTIFY_ON_HR_FAILURE( + hr, "Input processing appears stuck in MF_E_NOTACCEPTING loop.", + PLATFORM_FAILURE, ); + } + pending_input_buffers_.push_back(sample); decoder_thread_task_runner_->PostTask( FROM_HERE, @@ -2732,12 +2747,16 @@ // this |picture_buffer| will be updated when the video frame is created. const auto& mailbox = gpu::Mailbox::GenerateForSharedImage(); - auto shared_image = gpu::SharedImageBackingD3D::CreateFromGLTexture( + auto shared_image = std::make_unique<gpu::SharedImageBackingD3D>( mailbox, viz_formats[texture_idx], picture_buffer->texture_size(texture_idx), picture_buffer->color_space(), kTopLeft_GrSurfaceOrigin, - kPremul_SkAlphaType, shared_image_usage, gl_image_dxgi->texture(), - std::move(gl_texture)); + kPremul_SkAlphaType, shared_image_usage, + /*swap_chain=*/nullptr, std::move(gl_texture), + picture_buffer->gl_image(), + /*buffer_index=*/0, gl_image_dxgi->texture(), + base::win::ScopedHandle(), + /*dxgi_keyed_mutex=*/nullptr); // Caller is assumed to provide cleared d3d textures. shared_image->SetCleared();
diff --git a/media/mojo/mojom/BUILD.gn b/media/mojo/mojom/BUILD.gn index 727d993..eacf42a 100644 --- a/media/mojo/mojom/BUILD.gn +++ b/media/mojo/mojom/BUILD.gn
@@ -536,17 +536,6 @@ "//ui/gfx/geometry/mojom", ] }, - { - types = [ - { - mojom = "media.mojom.CdmCapability" - cpp = "::media::CdmCapability" - }, - ] - traits_headers = [ "cdm_capability_mojom_traits.h" ] - traits_sources = [ "cdm_capability_mojom_traits.cc" ] - traits_public_deps = [ "//media" ] - }, ] cpp_typemaps += shared_typemaps
diff --git a/media/mojo/mojom/cdm_capability_mojom_traits.cc b/media/mojo/mojom/cdm_capability_mojom_traits.cc deleted file mode 100644 index ac48d09..0000000 --- a/media/mojo/mojom/cdm_capability_mojom_traits.cc +++ /dev/null
@@ -1,35 +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. - -#include "media/mojo/mojom/cdm_capability_mojom_traits.h" - -#include <utility> - -namespace mojo { - -// static -bool StructTraits<media::mojom::CdmCapabilityDataView, media::CdmCapability>:: - Read(media::mojom::CdmCapabilityDataView input, - media::CdmCapability* output) { - std::vector<media::VideoCodec> video_codecs; - if (!input.ReadVideoCodecs(&video_codecs)) - return false; - - std::vector<media::EncryptionScheme> encryption_schemes; - if (!input.ReadEncryptionSchemes(&encryption_schemes)) - return false; - - std::vector<media::CdmSessionType> session_types; - if (!input.ReadSessionTypes(&session_types)) - return false; - - // |encryption_schemes| and |session_types| are convert to a base::flat_map - // implicitly. - *output = media::CdmCapability(std::move(video_codecs), - std::move(encryption_schemes), - std::move(session_types)); - return true; -} - -} // namespace mojo
diff --git a/media/mojo/mojom/cdm_capability_mojom_traits.h b/media/mojo/mojom/cdm_capability_mojom_traits.h deleted file mode 100644 index f060329..0000000 --- a/media/mojo/mojom/cdm_capability_mojom_traits.h +++ /dev/null
@@ -1,44 +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. - -#ifndef MEDIA_MOJO_MOJOM_CDM_CAPABILITY_MOJOM_TRAITS_H_ -#define MEDIA_MOJO_MOJOM_CDM_CAPABILITY_MOJOM_TRAITS_H_ - -#include <vector> - -#include "base/containers/flat_set.h" -#include "media/base/content_decryption_module.h" -#include "media/base/encryption_scheme.h" -#include "media/base/video_codecs.h" -#include "media/cdm/cdm_capability.h" -#include "media/mojo/mojom/key_system_support.mojom.h" - -namespace mojo { - -template <> -struct StructTraits<media::mojom::CdmCapabilityDataView, media::CdmCapability> { - static const std::vector<media::VideoCodec>& video_codecs( - const media::CdmCapability& input) { - return input.video_codecs; - } - - // List of encryption schemes supported by the CDM (e.g. cenc). - static const base::flat_set<media::EncryptionScheme>& encryption_schemes( - const media::CdmCapability& input) { - return input.encryption_schemes; - } - - // List of session types supported by the CDM. - static const base::flat_set<media::CdmSessionType>& session_types( - const media::CdmCapability& input) { - return input.session_types; - } - - static bool Read(media::mojom::CdmCapabilityDataView input, - media::CdmCapability* output); -}; - -} // namespace mojo - -#endif // MEDIA_MOJO_MOJOM_CDM_CAPABILITY_MOJOM_TRAITS_H_
diff --git a/media/mojo/mojom/key_system_support.mojom b/media/mojo/mojom/key_system_support.mojom index b46dd12d..ce62672 100644 --- a/media/mojo/mojom/key_system_support.mojom +++ b/media/mojo/mojom/key_system_support.mojom
@@ -10,18 +10,20 @@ // TODO(xhwang): Use "set" instead of "array" if supported by mojom. // TODO(crbug.com/796725) Find a way to include profiles and levels for // supported codecs. -struct CdmCapability { +struct KeySystemCapability { + // Software secure codecs and encryption schemes supported by the CDM. array<VideoCodec> video_codecs; array<EncryptionScheme> encryption_schemes; + + // Hardware secure codecs and encryption schemes supported by the CDM. + array<VideoCodec> hw_secure_video_codecs; + array<EncryptionScheme> hw_secure_encryption_schemes; + + // Session types supported in software secure mode if no + // |hw_secure_video_codecs| is supported, or in both modes otherwise. array<CdmSessionType> session_types; }; -struct KeySystemCapability { - CdmCapability? sw_secure_capability; - CdmCapability? hw_secure_capability; -}; - -// Used to query the browser to see if a specific key system is supported. interface KeySystemSupport { // Query to determine if the browser supports the |key_system|. If supported, // |key_system_capability| is non-null indicating supported capability.
diff --git a/mojo/public/cpp/bindings/array_traits_stl.h b/mojo/public/cpp/bindings/array_traits_stl.h index 68f44df..c72b2a1 100644 --- a/mojo/public/cpp/bindings/array_traits_stl.h +++ b/mojo/public/cpp/bindings/array_traits_stl.h
@@ -11,7 +11,6 @@ #include <unordered_set> #include <vector> -#include "base/containers/flat_set.h" #include "mojo/public/cpp/bindings/array_traits.h" namespace mojo { @@ -113,24 +112,6 @@ } }; -// This ArrayTraits specialization is used only for serialization. -template <typename T> -struct ArrayTraits<base::flat_set<T>> { - using Element = T; - using ConstIterator = typename base::flat_set<T>::const_iterator; - - static bool IsNull(const base::flat_set<T>& input) { - // base::flat_set<> is always converted to non-null mojom array. - return false; - } - static size_t GetSize(const base::flat_set<T>& input) { return input.size(); } - static ConstIterator GetBegin(const base::flat_set<T>& input) { - return input.begin(); - } - static void AdvanceIterator(ConstIterator& iterator) { ++iterator; } - static const T& GetValue(ConstIterator& iterator) { return *iterator; } -}; - template <typename K, typename V> struct MapValuesArrayView { explicit MapValuesArrayView(const std::map<K, V>& map) : map(map) {}
diff --git a/mojo/public/cpp/bindings/lib/multiplex_router.cc b/mojo/public/cpp/bindings/lib/multiplex_router.cc index 8fccf1a..0bc65a5 100644 --- a/mojo/public/cpp/bindings/lib/multiplex_router.cc +++ b/mojo/public/cpp/bindings/lib/multiplex_router.cc
@@ -368,15 +368,14 @@ control_message_handler_(this), control_message_proxy_(&connector_) { DETACH_FROM_SEQUENCE(sequence_checker_); + if (config_ == MULTI_INTERFACE) + lock_.emplace(); } void MultiplexRouter::BindToCurrentSequence() { DCHECK(task_runner_->RunsTasksInCurrentSequence()); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (config_ == MULTI_INTERFACE) - lock_.emplace(); - if (config_ == SINGLE_INTERFACE_WITH_SYNC_METHODS || config_ == MULTI_INTERFACE) { // Always participate in sync handle watching in multi-interface mode,
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc index 54c3d23d..79c5d9a 100644 --- a/net/socket/ssl_client_socket_impl.cc +++ b/net/socket/ssl_client_socket_impl.cc
@@ -855,8 +855,10 @@ if (ssl_config_.require_ecdhe) command.append(":!kRSA"); - if (ssl_config_.disable_legacy_crypto) + if (!context_->config().triple_des_enabled || + ssl_config_.disable_legacy_crypto) { command.append(":!3DES"); + } // Remove any disabled ciphers. for (uint16_t id : context_->config().disabled_cipher_suites) {
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc index b1e1323..557a641 100644 --- a/net/socket/ssl_client_socket_unittest.cc +++ b/net/socket/ssl_client_socket_unittest.cc
@@ -3453,14 +3453,29 @@ ASSERT_TRUE( StartEmbeddedTestServer(EmbeddedTestServer::CERT_OK, server_config)); + // 3DES is allowed by default. int rv; ASSERT_TRUE(CreateAndConnectSSLClientSocket(SSLConfig(), &rv)); EXPECT_THAT(rv, IsOk()); + // disable_legacy_crypto, among other things, disables 3DES. SSLConfig config; config.disable_legacy_crypto = true; ASSERT_TRUE(CreateAndConnectSSLClientSocket(config, &rv)); EXPECT_THAT(rv, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); + + SSLContextConfig context_config; + context_config.triple_des_enabled = false; + ssl_config_service_->UpdateSSLConfigAndNotify(context_config); + + // Disabling 3DES at both the context and disable_legacy_crypto disables 3DES. + ASSERT_TRUE(CreateAndConnectSSLClientSocket(config, &rv)); + EXPECT_THAT(rv, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); + + // Use a fresh SSLConfig to test that disabling 3DES at the context alone also + // disables 3DES. + ASSERT_TRUE(CreateAndConnectSSLClientSocket(SSLConfig(), &rv)); + EXPECT_THAT(rv, IsError(ERR_SSL_VERSION_OR_CIPHER_MISMATCH)); } TEST_F(SSLClientSocketTest, SHA1) {
diff --git a/net/ssl/ssl_config_service.cc b/net/ssl/ssl_config_service.cc index eaacabd..2bae4b9 100644 --- a/net/ssl/ssl_config_service.cc +++ b/net/ssl/ssl_config_service.cc
@@ -18,10 +18,10 @@ const net::SSLContextConfig& config2) { return std::tie(config1.version_min, config1.version_min_warn, config1.version_max, config1.disabled_cipher_suites, - config1.cecpq2_enabled) == + config1.cecpq2_enabled, config1.triple_des_enabled) == std::tie(config2.version_min, config2.version_min_warn, config2.version_max, config2.disabled_cipher_suites, - config2.cecpq2_enabled); + config2.cecpq2_enabled, config2.triple_des_enabled); } } // namespace
diff --git a/net/ssl/ssl_config_service.h b/net/ssl/ssl_config_service.h index 070a52b..cc2b73f2 100644 --- a/net/ssl/ssl_config_service.h +++ b/net/ssl/ssl_config_service.h
@@ -47,6 +47,9 @@ // If false, disables post-quantum key agreement in TLS connections. bool cecpq2_enabled = true; + // If false, disables 3DES cipher suites in TLS connections. + bool triple_des_enabled = true; + // ADDING MORE HERE? Don't forget to update |SSLContextConfigsAreEqual|. };
diff --git a/printing/backend/printing_restrictions.h b/printing/backend/printing_restrictions.h index f85f590..0fba795f8 100644 --- a/printing/backend/printing_restrictions.h +++ b/printing/backend/printing_restrictions.h
@@ -8,34 +8,24 @@ #include "base/component_export.h" #include "build/chromeos_buildflags.h" +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "printing/mojom/print.mojom.h" +#endif + namespace printing { #if BUILDFLAG(IS_CHROMEOS_ASH) // Allowed printing modes as a bitmask. // This is used in pref file and should never change. -enum class ColorModeRestriction { - kUnset = 0x0, - kMonochrome = 0x1, - kColor = 0x2, -}; +using ColorModeRestriction = mojom::ColorModeRestriction; // Allowed duplex modes as a bitmask. // This is used in pref file and should never change. -enum class DuplexModeRestriction { - kUnset = 0x0, - kSimplex = 0x1, - kLongEdge = 0x2, - kShortEdge = 0x4, - kDuplex = 0x2 | 0x4, -}; +using DuplexModeRestriction = mojom::DuplexModeRestriction; // Allowed PIN printing modes. // This is used in pref file and should never change. -enum class PinModeRestriction { - kUnset = 0, - kPin = 1, - kNoPin = 2, -}; +using PinModeRestriction = mojom::PinModeRestriction; // Dictionary key for printing policies. // Must coincide with the name of field in `print_preview.Policies` in
diff --git a/printing/mojom/print.mojom b/printing/mojom/print.mojom index 992b535b..b32eb76 100644 --- a/printing/mojom/print.mojom +++ b/printing/mojom/print.mojom
@@ -97,3 +97,32 @@ kPrintableAreaMargins, kCustomMargins, }; + +// Allowed printing modes as a bitmask. +// This is used in pref file and should never change. +[Stable, Extensible, EnableIf=is_chromeos] +enum ColorModeRestriction { + [Default] kUnset = 0x0, + kMonochrome = 0x1, + kColor = 0x2, +}; + +// Allowed duplex modes as a bitmask. +// This is used in pref file and should never change. +[Stable, Extensible, EnableIf=is_chromeos] +enum DuplexModeRestriction { + [Default] kUnset = 0x0, + kSimplex = 0x1, + kLongEdge = 0x2, + kShortEdge = 0x4, + kDuplex = 0x6, +}; + +// Allowed PIN printing modes as a bitmask. +// This is used in pref file and should never change. +[Stable, Extensible, EnableIf=is_chromeos] +enum PinModeRestriction { + [Default] kUnset = 0, + kPin = 1, + kNoPin = 2, +};
diff --git a/remoting/host/chromeos/message_box.cc b/remoting/host/chromeos/message_box.cc index f414fc8..d6220ef 100644 --- a/remoting/host/chromeos/message_box.cc +++ b/remoting/host/chromeos/message_box.cc
@@ -8,9 +8,9 @@ #include "base/macros.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/message_box_view.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/remoting/host/policy_watcher.cc b/remoting/host/policy_watcher.cc index dcebe70..97507fb 100644 --- a/remoting/host/policy_watcher.cc +++ b/remoting/host/policy_watcher.cc
@@ -17,6 +17,7 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" +#include "base/value_iterators.h" #include "base/values.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -65,7 +66,7 @@ } CHECK(value->type() == i.value().type()); - to->Set(i.key(), value->CreateDeepCopy()); + to->Set(i.key(), base::Value::ToUniquePtrValue(value->Clone())); } return to; @@ -101,7 +102,7 @@ // TODO(lukasza): Removing this somewhat brittle filtering will be possible // after having separate, Chromoting-specific schema. if (key.find(kPolicyNameSubstring) != std::string::npos) { - policy_dict->Set(key, value->CreateDeepCopy()); + policy_dict->Set(key, base::Value::ToUniquePtrValue(value->Clone())); } } @@ -297,7 +298,7 @@ std::string key) { const base::Value* value; if (from.Get(key, &value)) { - to.Set(key, value->CreateDeepCopy()); + to.Set(key, base::Value::ToUniquePtrValue(value->Clone())); } } } // namespace @@ -313,7 +314,8 @@ base::Value* old_policy; if (!(effective_policies_->Get(iter.key(), &old_policy) && old_policy->Equals(&iter.value()))) { - changed_policies->Set(iter.key(), iter.value().CreateDeepCopy()); + changed_policies->Set( + iter.key(), base::Value::ToUniquePtrValue(iter.value().Clone())); } iter.Advance(); }
diff --git a/services/audio/input_controller.cc b/services/audio/input_controller.cc index 7bc0824e..56570ab 100644 --- a/services/audio/input_controller.cc +++ b/services/audio/input_controller.cc
@@ -418,10 +418,15 @@ return; } - if (!stream->Open()) { + auto open_outcome = stream->Open(); + if (open_outcome != media::AudioInputStream::OpenOutcome::kSuccess) { stream->Close(); LogCaptureStartupResult(CAPTURE_STARTUP_OPEN_STREAM_FAILED); - handler_->OnError(STREAM_OPEN_ERROR); + handler_->OnError( + open_outcome == + media::AudioInputStream::OpenOutcome::kFailedSystemPermissions + ? STREAM_OPEN_SYSTEM_PERMISSIONS_ERROR + : STREAM_OPEN_ERROR); return; }
diff --git a/services/audio/input_controller.h b/services/audio/input_controller.h index a136b81..d64749f0 100644 --- a/services/audio/input_controller.h +++ b/services/audio/input_controller.h
@@ -59,6 +59,9 @@ // Native input stream reports an error. Exact reason differs between // platforms. STREAM_ERROR, // = 3 + + // Open failed due to lack of system permissions. + STREAM_OPEN_SYSTEM_PERMISSIONS_ERROR, // = 4 }; #if defined(AUDIO_POWER_MONITORING)
diff --git a/services/audio/input_controller_unittest.cc b/services/audio/input_controller_unittest.cc index d0000ce..b3333bf 100644 --- a/services/audio/input_controller_unittest.cc +++ b/services/audio/input_controller_unittest.cc
@@ -98,7 +98,7 @@ bool IsMuted() override { return false; } void SetOutputDeviceForAec(const std::string&) override {} - MOCK_METHOD0(Open, bool()); + MOCK_METHOD0(Open, media::AudioInputStream::OpenOutcome()); MOCK_METHOD1(SetVolume, void(double)); };
diff --git a/services/audio/input_stream.cc b/services/audio/input_stream.cc index 1264c509e..80196ff 100644 --- a/services/audio/input_stream.cc +++ b/services/audio/input_stream.cc
@@ -35,6 +35,8 @@ return "STREAM_OPEN_ERROR"; case (InputController::STREAM_ERROR): return "STREAM_ERROR"; + case (InputController::STREAM_OPEN_SYSTEM_PERMISSIONS_ERROR): + return "STREAM_OPEN_SYSTEM_PERMISSIONS_ERROR"; default: NOTREACHED(); }
diff --git a/services/audio/input_stream_unittest.cc b/services/audio/input_stream_unittest.cc index 3a21e27..5afa712 100644 --- a/services/audio/input_stream_unittest.cc +++ b/services/audio/input_stream_unittest.cc
@@ -100,7 +100,7 @@ double GetMaxVolume() override { return 1; } - MOCK_METHOD0(Open, bool()); + MOCK_METHOD0(Open, media::AudioInputStream::OpenOutcome()); MOCK_METHOD1(Start, void(AudioInputCallback*)); MOCK_METHOD0(Stop, void()); MOCK_METHOD0(Close, void()); @@ -216,7 +216,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(log(), OnCreated(_, _)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kNotMuted)); @@ -239,7 +240,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kNotMuted)); mojo::Remote<media::mojom::AudioInputStream> remote_stream( @@ -260,7 +262,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(log(), OnCreated(_, _)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kNotMuted)); @@ -283,7 +286,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(log(), OnCreated(_, _)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kNotMuted)); @@ -306,7 +310,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(log(), OnCreated(_, _)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kNotMuted)); @@ -329,7 +334,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(log(), OnCreated(_, _)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kNotMuted)); @@ -353,7 +359,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(log(), OnCreated(_, _)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kNotMuted)); @@ -383,7 +390,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(log(), OnCreated(_, _)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kNotMuted)); @@ -412,7 +420,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(log(), OnCreated(_, _)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kNotMuted)); @@ -436,7 +445,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(log(), OnCreated(_, _)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kNotMuted)); @@ -460,7 +470,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kNotMuted)); EXPECT_CALL(mock_stream, SetAutomaticGainControl(kDoEnableAGC)); EXPECT_CALL(log(), OnCreated(_, _)); @@ -485,7 +496,8 @@ const std::string& device_id) { return stream; }, &mock_stream)); - EXPECT_CALL(mock_stream, Open()).WillOnce(Return(true)); + EXPECT_CALL(mock_stream, Open()) + .WillOnce(Return(MockStream::OpenOutcome::kSuccess)); EXPECT_CALL(mock_stream, IsMuted()).WillOnce(Return(kMuted)); EXPECT_CALL(log(), OnCreated(_, _)); EXPECT_CALL(*this, CreatedCallback(kValidStream, kMuted));
diff --git a/services/device/geolocation/network_location_request.cc b/services/device/geolocation/network_location_request.cc index 454abdc..9bd9db5 100644 --- a/services/device/geolocation/network_location_request.cc +++ b/services/device/geolocation/network_location_request.cc
@@ -365,7 +365,11 @@ *out = value->GetInt(); return true; } - return value->GetAsDouble(out); + if (value->is_double()) { + *out = value->GetDouble(); + return true; + } + return false; } bool ParseServerResponse(const std::string& response_body,
diff --git a/services/network/public/mojom/ssl_config.mojom b/services/network/public/mojom/ssl_config.mojom index 48098ab..810a8137 100644 --- a/services/network/public/mojom/ssl_config.mojom +++ b/services/network/public/mojom/ssl_config.mojom
@@ -46,6 +46,9 @@ // If false, disables post-quantum key agreement in TLS connections. bool cecpq2_enabled = true; + + // If false, disables 3DES cipher suites in TLS connections. + bool triple_des_enabled = true; }; // Receives SSL configuration updates.
diff --git a/services/network/ssl_config_type_converter.cc b/services/network/ssl_config_type_converter.cc index 4b5daac..c67df7e 100644 --- a/services/network/ssl_config_type_converter.cc +++ b/services/network/ssl_config_type_converter.cc
@@ -38,6 +38,7 @@ net_config.disabled_cipher_suites = mojo_config->disabled_cipher_suites; net_config.cecpq2_enabled = mojo_config->cecpq2_enabled; + net_config.triple_des_enabled = mojo_config->triple_des_enabled; return net_config; }
diff --git a/services/resource_coordinator/memory_instrumentation/coordinator_impl.cc b/services/resource_coordinator/memory_instrumentation/coordinator_impl.cc index 77cd931..598a637 100644 --- a/services/resource_coordinator/memory_instrumentation/coordinator_impl.cc +++ b/services/resource_coordinator/memory_instrumentation/coordinator_impl.cc
@@ -248,6 +248,9 @@ if (current->process_id != process_id) continue; RemovePendingResponse(process_id, current->type); + DLOG(ERROR) + << "Memory dump request failed due to disconnected child process " + << process_id; request->failed_memory_dump_count++; } FinalizeGlobalMemoryDumpIfAllManagersReplied(); @@ -334,6 +337,10 @@ return; // Fail all remaining dumps being waited upon and clear the vector. + if (request->pending_responses.size() > 0) { + DLOG(ERROR) << "Global dump request timed out waiting for " + << request->pending_responses.size() << " requests"; + } request->failed_memory_dump_count += request->pending_responses.size(); request->pending_responses.clear(); @@ -446,8 +453,8 @@ response->chrome_dump = std::move(chrome_memory_dump); if (!success) { + DLOG(ERROR) << "Memory dump request failed: NACK from client process"; request->failed_memory_dump_count++; - VLOG(1) << "RequestGlobalMemoryDump() FAIL: NACK from client process"; } FinalizeGlobalMemoryDumpIfAllManagersReplied(); @@ -474,8 +481,8 @@ request->responses[process_id].os_dumps = std::move(os_dumps); if (!success) { + DLOG(ERROR) << "Memory dump request failed: NACK from client process"; request->failed_memory_dump_count++; - VLOG(1) << "RequestGlobalMemoryDump() FAIL: NACK from client process"; } FinalizeGlobalMemoryDumpIfAllManagersReplied();
diff --git a/services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc b/services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc index 3d190a8d..ff575dd 100644 --- a/services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc +++ b/services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc
@@ -297,6 +297,8 @@ // the failed dump count and exit. if (request->args.pid != base::kNullProcessId && request->pending_responses.empty()) { + DLOG(ERROR) << "Memory dump request failed due to missing pid " + << request->args.pid; request->failed_memory_dump_count++; return; } @@ -525,16 +527,24 @@ bool trace_os_success = tracing_observer->AddOsDumpToTraceIfEnabled( request->GetRequestArgs(), pid, *os_dump, raw_os_dump->memory_maps, timestamp); - if (!trace_os_success) + if (!trace_os_success) { + DLOG(ERROR) << "Tracing is disabled or not setup yet while receiving " + "OS dump for pid " + << pid; request->failed_memory_dump_count++; + } } if (raw_chrome_dump) { bool trace_chrome_success = AddChromeMemoryDumpToTrace( request->GetRequestArgs(), pid, *raw_chrome_dump, *global_graph, pid_to_process_type, tracing_observer, use_proto_writer, timestamp); - if (!trace_chrome_success) + if (!trace_chrome_success) { + DLOG(ERROR) << "Tracing is disabled or not setup yet while receiving " + "Chrome dump for pid " + << pid; request->failed_memory_dump_count++; + } } }
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/client_process_impl.cc b/services/resource_coordinator/public/cpp/memory_instrumentation/client_process_impl.cc index ca0e8d84..fea3e99 100644 --- a/services/resource_coordinator/public/cpp/memory_instrumentation/client_process_impl.cc +++ b/services/resource_coordinator/public/cpp/memory_instrumentation/client_process_impl.cc
@@ -100,6 +100,7 @@ } if (!process_memory_dump) { + DLOG(ERROR) << "Chrome dump request failed"; std::move(callback).Run(false, dump_guid, nullptr); return; } @@ -166,8 +167,11 @@ success = success && OSMetrics::FillProcessMemoryMaps( pid, args.mmap_option, result.get()); } - if (success) + if (success) { results[pid] = std::move(result); + } else { + DLOG(ERROR) << "OS memory dump failed for pid " << pid; + } global_success = global_success && success; } std::move(args.callback).Run(global_success, std::move(results));
diff --git a/services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler_unittest.cc b/services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler_unittest.cc index 3ffe6c5..ba8e74f 100644 --- a/services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler_unittest.cc +++ b/services/tracing/public/cpp/stack_sampling/tracing_sampler_profiler_unittest.cc
@@ -38,6 +38,36 @@ using ::testing::Invoke; using ::testing::Return; +#if BUILDFLAG(ENABLE_LOADER_LOCK_SAMPLING) + +class MockLoaderLockSampler : public LoaderLockSampler { + public: + MockLoaderLockSampler() = default; + ~MockLoaderLockSampler() override = default; + + MOCK_METHOD(bool, IsLoaderLockHeld, (), (const, override)); +}; + +class LoaderLockEventAnalyzer { + public: + LoaderLockEventAnalyzer() { + trace_analyzer::Start(TRACE_DISABLED_BY_DEFAULT("cpu_profiler")); + } + + size_t CountEvents() { + std::unique_ptr<trace_analyzer::TraceAnalyzer> analyzer = + trace_analyzer::Stop(); + trace_analyzer::TraceEventVector events; + return analyzer->FindEvents( + trace_analyzer::Query::EventName() == + trace_analyzer::Query::String( + LoaderLockSamplingThread::kLoaderLockHeldEventName), + &events); + } +}; + +#endif // BUILDFLAG(ENABLE_LOADER_LOCK_SAMPLING) + class TracingSampleProfilerTest : public TracingUnitTest { public: TracingSampleProfilerTest() = default; @@ -46,6 +76,16 @@ void SetUp() override { TracingUnitTest::SetUp(); +#if BUILDFLAG(ENABLE_LOADER_LOCK_SAMPLING) + // Override the default LoaderLockSampler because in production it is + // expected to be called from a single thread, and each test may re-create + // the sampling thread. + ON_CALL(mock_loader_lock_sampler_, IsLoaderLockHeld()) + .WillByDefault(Return(false)); + LoaderLockSamplingThread::SetLoaderLockSamplerForTesting( + &mock_loader_lock_sampler_); +#endif + events_stack_received_count_ = 0u; auto perfetto_wrapper = std::make_unique<base::tracing::PerfettoTaskRunner>( @@ -58,6 +98,10 @@ void TearDown() override { producer_.reset(); +#if BUILDFLAG(ENABLE_LOADER_LOCK_SAMPLING) + LoaderLockSamplingThread::SetLoaderLockSamplerForTesting(nullptr); +#endif + TracingUnitTest::TearDown(); } @@ -114,58 +158,14 @@ // Number of stack sampling events received. size_t events_stack_received_count_ = 0; +#if BUILDFLAG(ENABLE_LOADER_LOCK_SAMPLING) + MockLoaderLockSampler mock_loader_lock_sampler_; +#endif + private: DISALLOW_COPY_AND_ASSIGN(TracingSampleProfilerTest); }; -#if BUILDFLAG(ENABLE_LOADER_LOCK_SAMPLING) - -class MockLoaderLockSampler : public LoaderLockSampler { - public: - MockLoaderLockSampler() = default; - ~MockLoaderLockSampler() override = default; - - MOCK_METHOD(bool, IsLoaderLockHeld, (), (const, override)); -}; - -class LoaderLockEventAnalyzer { - public: - LoaderLockEventAnalyzer() { - trace_analyzer::Start(TRACE_DISABLED_BY_DEFAULT("cpu_profiler")); - } - - size_t CountEvents() { - std::unique_ptr<trace_analyzer::TraceAnalyzer> analyzer = - trace_analyzer::Stop(); - trace_analyzer::TraceEventVector events; - return analyzer->FindEvents( - trace_analyzer::Query::EventName() == - trace_analyzer::Query::String( - LoaderLockSamplingThread::kLoaderLockHeldEventName), - &events); - } -}; - -class TracingSampleProfilerMockLoaderLockTest - : public TracingSampleProfilerTest { - public: - TracingSampleProfilerMockLoaderLockTest() { - ON_CALL(mock_loader_lock_sampler_, IsLoaderLockHeld()) - .WillByDefault(Return(false)); - LoaderLockSamplingThread::SetLoaderLockSamplerForTesting( - &mock_loader_lock_sampler_); - } - - ~TracingSampleProfilerMockLoaderLockTest() override { - LoaderLockSamplingThread::SetLoaderLockSamplerForTesting(nullptr); - } - - protected: - MockLoaderLockSampler mock_loader_lock_sampler_; -}; - -#endif // BUILDFLAG(ENABLE_LOADER_LOCK_SAMPLING) - // Stub module for testing. class TestModule : public base::ModuleCache::Module { public: @@ -317,7 +317,7 @@ #if BUILDFLAG(ENABLE_LOADER_LOCK_SAMPLING) -TEST_F(TracingSampleProfilerMockLoaderLockTest, SampleLoaderLockOnMainThread) { +TEST_F(TracingSampleProfilerTest, SampleLoaderLockOnMainThread) { if (ShouldSkipTestForMacOS11()) GTEST_SKIP() << "Stack sampler is not supported on macOS 11"; LoaderLockEventAnalyzer event_analyzer; @@ -344,7 +344,7 @@ EXPECT_EQ(event_analyzer.CountEvents(), call_count); } -TEST_F(TracingSampleProfilerMockLoaderLockTest, SampleLoaderLockAlwaysHeld) { +TEST_F(TracingSampleProfilerTest, SampleLoaderLockAlwaysHeld) { if (ShouldSkipTestForMacOS11()) GTEST_SKIP() << "Stack sampler is not supported on macOS 11"; LoaderLockEventAnalyzer event_analyzer; @@ -364,7 +364,7 @@ EXPECT_EQ(event_analyzer.CountEvents(), 1U); } -TEST_F(TracingSampleProfilerMockLoaderLockTest, SampleLoaderLockNeverHeld) { +TEST_F(TracingSampleProfilerTest, SampleLoaderLockNeverHeld) { if (ShouldSkipTestForMacOS11()) GTEST_SKIP() << "Stack sampler is not supported on macOS 11"; LoaderLockEventAnalyzer event_analyzer; @@ -383,7 +383,7 @@ EXPECT_EQ(event_analyzer.CountEvents(), 0U); } -TEST_F(TracingSampleProfilerMockLoaderLockTest, SampleLoaderLockOnChildThread) { +TEST_F(TracingSampleProfilerTest, SampleLoaderLockOnChildThread) { if (ShouldSkipTestForMacOS11()) GTEST_SKIP() << "Stack sampler is not supported on macOS 11"; LoaderLockEventAnalyzer event_analyzer; @@ -407,12 +407,16 @@ EXPECT_EQ(event_analyzer.CountEvents(), 0U); } -// Use the real loader lock sampler. This tests that it is initialized -// correctly in TracingSamplerProfiler. TEST_F(TracingSampleProfilerTest, SampleLoaderLockWithoutMock) { if (ShouldSkipTestForMacOS11()) GTEST_SKIP() << "Stack sampler is not supported on macOS 11"; + // Use the real loader lock sampler. This tests that it is initialized + // correctly in TracingSamplerProfiler. + LoaderLockSamplingThread::SetLoaderLockSamplerForTesting(nullptr); + + // This must be the only thread that uses the real loader lock sampler in the + // test process. auto profiler = TracingSamplerProfiler::CreateOnMainThread(); BeginTrace(); base::RunLoop().RunUntilIdle();
diff --git a/services/viz/privileged/mojom/BUILD.gn b/services/viz/privileged/mojom/BUILD.gn index 3ce7105..49f93d0 100644 --- a/services/viz/privileged/mojom/BUILD.gn +++ b/services/viz/privileged/mojom/BUILD.gn
@@ -2,11 +2,17 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//components/viz/common/debugger/viz_debugger.gni") import("//mojo/public/tools/bindings/mojom.gni") mojom("mojom") { sources = [ "viz_main.mojom" ] + enabled_features = [] + if (use_viz_debugger) { + enabled_features += [ "use_viz_debugger" ] + } + public_deps = [ "//components/discardable_memory/public/mojom", "//services/network/public/mojom",
diff --git a/services/viz/privileged/mojom/gl/gpu_service.mojom b/services/viz/privileged/mojom/gl/gpu_service.mojom index d1ccdf1..f9b03f2 100644 --- a/services/viz/privileged/mojom/gl/gpu_service.mojom +++ b/services/viz/privileged/mojom/gl/gpu_service.mojom
@@ -37,7 +37,7 @@ // |gpu_feature_info| are returned so that if this method is called // synchronously they are available (since the PostTask for // GpuHost::DidInitialize might not be dispatched yet. - [Sync] + [Sync, NoInterrupt] EstablishGpuChannel(int32 client_id, uint64 client_tracing_id, bool is_gpu_host, @@ -85,7 +85,7 @@ pending_receiver<media.mojom.VideoEncodeAcceleratorProvider> vea_provider); - [Sync] + [Sync, NoInterrupt] CreateGpuMemoryBuffer(gfx.mojom.GpuMemoryBufferId id, gfx.mojom.Size size, gfx.mojom.BufferFormat format, @@ -178,5 +178,4 @@ Crash(); Hang(); ThrowJavaException(); - Stop() => (); };
diff --git a/services/viz/privileged/mojom/viz_main.mojom b/services/viz/privileged/mojom/viz_main.mojom index f13ce455..5738cf7 100644 --- a/services/viz/privileged/mojom/viz_main.mojom +++ b/services/viz/privileged/mojom/viz_main.mojom
@@ -5,6 +5,7 @@ module viz.mojom; import "components/discardable_memory/public/mojom/discardable_shared_memory_manager.mojom"; +import "mojo/public/mojom/base/values.mojom"; import "services/network/public/mojom/tcp_socket.mojom"; import "services/viz/public/mojom/compositing/compositing_mode_watcher.mojom"; import "services/viz/privileged/mojom/compositing/frame_sink_manager.mojom"; @@ -43,6 +44,13 @@ uint16 server_port; }; +// This interface provides mechanism for the Viz Debugger to output data. +[EnableIf=use_viz_debugger] +interface VizDebugOutput { + // Called by the VizDebugger instance at the end of each frame. + LogFrame(mojo_base.mojom.Value frameData); +}; + // This is the primordial interface used to (re)start the viz services. interface VizMain { CreateFrameSinkManager(FrameSinkManagerParams params); @@ -65,4 +73,19 @@ // FrameSinkManager in the viz compositor. This is only called if the flag // --enable-viz-devtools is used. CreateVizDevTools(VizDevToolsParams params); + + // Initiates the devtools enabled stream connection for the Viz Debugger. + // This is only called if the flag --enable-viz-devtools is used. + [EnableIf=use_viz_debugger] + StartDebugStream(pending_remote<VizDebugOutput> viz_debug); + + // Sends debug filtering information to the active Viz Debugger instance. + // This is only called if the flag --enable-viz-devtools is used. + [EnableIf=use_viz_debugger] + FilterDebugStream(mojo_base.mojom.Value filterData); + + // Ends the Viz debugging session. This is only called if the flag + // --enable-viz-devtools is used. + [EnableIf=use_viz_debugger] + StopDebugStream(); };
diff --git a/sql/README.md b/sql/README.md index 57cd897..3303502f 100644 --- a/sql/README.md +++ b/sql/README.md
@@ -277,6 +277,31 @@ Furthermore, some `PRAGMA` statements invalidate previously compiled queries, reducing the efficiency of Chrome's compiled query cache. +#### Virtual tables + +[`CREATE VIRTUAL TABLE` statements](https://www.sqlite.org/vtab.html) should not +be used. The desired functionality should be implemented in C++, and access +storage using standard SQL statements. + +Virtual tables are [SQLite's module system](https://www.sqlite.org/vtab.html). +SQL statements on virtual tables are essentially running arbitrary code, which +makes them very difficult to reason about and maintain. Furthermore, the virtual +table implementations don't receive the same level of fuzzing coverage as the +SQLite core. + +Chrome's SQLite build has virtual table functionality reduced to the minimum +needed to support [FTS3](https://www.sqlite.org/fts3.html) in WebSQL, and an +internal feature. +[SQLite's run-time loading mechanism](https://www.sqlite.org/loadext.html) is +disabled, and most +[built-in virtual tables](https://www.sqlite.org/vtablist.html) are disabled as +well. + +After +[WebSQL](https://www.w3.org/TR/webdatabase/) is removed from Chrome, we plan +to disable SQLite's virtual table support using +[SQLITE_OMIT_VIRTUALTABLE](https://sqlite.org/compile.html#omit_virtualtable). + #### Foreign key constraints [SQL foreign key constraints](https://sqlite.org/foreignkeys.html) should not be
diff --git a/testing/buildbot/chrome.json b/testing/buildbot/chrome.json index ca322b3a2..48cc210 100644 --- a/testing/buildbot/chrome.json +++ b/testing/buildbot/chrome.json
@@ -6633,39 +6633,7 @@ "symupload", "strip_chrome_binary" ], - "gtest_tests": [ - { - "args": [ - "--board=eve", - "--flash" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "lacros_smoke_tast_tests_eve", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "device_type": "eve", - "os": "ChromeOS", - "pool": "chrome.tests" - } - ], - "idempotent": false, - "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "lacros_smoke_tast_tests", - "test_id_prefix": "ninja://chromeos/lacros:lacros_smoke_tast_tests/", - "trigger_script": { - "script": "//testing/trigger_scripts/chromeos_device_trigger.py" - } - } - ], + "gtest_tests": [], "isolated_scripts": [ { "isolate_name": "chrome_sizes",
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index ad9e5e9..abc6934 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -4675,11 +4675,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.206" + "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.207" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.206", + "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.207", "resultdb": { "enable": true }, @@ -4689,7 +4689,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M90", - "revision": "version:90.0.4430.206" + "revision": "version:90.0.4430.207" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -4754,11 +4754,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.34" + "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.46" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.34", + "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.46", "resultdb": { "enable": true }, @@ -4768,7 +4768,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M91", - "revision": "version:91.0.4472.34" + "revision": "version:91.0.4472.46" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -4912,11 +4912,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.206" + "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.207" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.206", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.207", "resultdb": { "enable": true }, @@ -4926,7 +4926,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M90", - "revision": "version:90.0.4430.206" + "revision": "version:90.0.4430.207" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -4991,11 +4991,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.34" + "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.46" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.34", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.46", "resultdb": { "enable": true }, @@ -5005,7 +5005,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M91", - "revision": "version:91.0.4472.34" + "revision": "version:91.0.4472.46" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 1a79bbb4..17843265 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -53838,11 +53838,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_with_chrome_apk_Client Library Skew Tests For 90.0.4430.206" + "weblayer_instrumentation_test_versions_with_chrome_apk_Client Library Skew Tests For 90.0.4430.207" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_with_chrome_apk_Client Library Skew Tests For 90.0.4430.206", + "name": "weblayer_instrumentation_test_versions_with_chrome_apk_Client Library Skew Tests For 90.0.4430.207", "resultdb": { "enable": true }, @@ -53852,7 +53852,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M90", - "revision": "version:90.0.4430.206" + "revision": "version:90.0.4430.207" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -53918,11 +53918,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_with_chrome_apk_Client Library Skew Tests For 91.0.4472.34" + "weblayer_instrumentation_test_versions_with_chrome_apk_Client Library Skew Tests For 91.0.4472.46" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_with_chrome_apk_Client Library Skew Tests For 91.0.4472.34", + "name": "weblayer_instrumentation_test_versions_with_chrome_apk_Client Library Skew Tests For 91.0.4472.46", "resultdb": { "enable": true }, @@ -53932,7 +53932,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M91", - "revision": "version:91.0.4472.34" + "revision": "version:91.0.4472.46" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -54078,11 +54078,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_with_chrome_apk_Implementation Library Skew Tests For 90.0.4430.206" + "weblayer_instrumentation_test_versions_with_chrome_apk_Implementation Library Skew Tests For 90.0.4430.207" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_with_chrome_apk_Implementation Library Skew Tests For 90.0.4430.206", + "name": "weblayer_instrumentation_test_versions_with_chrome_apk_Implementation Library Skew Tests For 90.0.4430.207", "resultdb": { "enable": true }, @@ -54092,7 +54092,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M90", - "revision": "version:90.0.4430.206" + "revision": "version:90.0.4430.207" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -54158,11 +54158,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_with_chrome_apk_Implementation Library Skew Tests For 91.0.4472.34" + "weblayer_instrumentation_test_versions_with_chrome_apk_Implementation Library Skew Tests For 91.0.4472.46" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_with_chrome_apk_Implementation Library Skew Tests For 91.0.4472.34", + "name": "weblayer_instrumentation_test_versions_with_chrome_apk_Implementation Library Skew Tests For 91.0.4472.46", "resultdb": { "enable": true }, @@ -54172,7 +54172,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M91", - "revision": "version:91.0.4472.34" + "revision": "version:91.0.4472.46" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -54383,11 +54383,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.206" + "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.207" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.206", + "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.207", "resultdb": { "enable": true }, @@ -54397,7 +54397,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M90", - "revision": "version:90.0.4430.206" + "revision": "version:90.0.4430.207" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -54462,11 +54462,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.34" + "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.46" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.34", + "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.46", "resultdb": { "enable": true }, @@ -54476,7 +54476,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M91", - "revision": "version:91.0.4472.34" + "revision": "version:91.0.4472.46" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -54620,11 +54620,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.206" + "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.207" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.206", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.207", "resultdb": { "enable": true }, @@ -54634,7 +54634,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M90", - "revision": "version:90.0.4430.206" + "revision": "version:90.0.4430.207" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -54699,11 +54699,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.34" + "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.46" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.34", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.46", "resultdb": { "enable": true }, @@ -54713,7 +54713,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M91", - "revision": "version:91.0.4472.34" + "revision": "version:91.0.4472.46" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -54924,11 +54924,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.206" + "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.207" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.206", + "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 90.0.4430.207", "resultdb": { "enable": true }, @@ -54938,7 +54938,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M90", - "revision": "version:90.0.4430.206" + "revision": "version:90.0.4430.207" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -55003,11 +55003,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.34" + "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.46" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.34", + "name": "weblayer_instrumentation_test_versions_apk_Client Library Skew Tests For 91.0.4472.46", "resultdb": { "enable": true }, @@ -55017,7 +55017,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M91", - "revision": "version:91.0.4472.34" + "revision": "version:91.0.4472.46" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -55161,11 +55161,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.206" + "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.207" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.206", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 90.0.4430.207", "resultdb": { "enable": true }, @@ -55175,7 +55175,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M90", - "revision": "version:90.0.4430.206" + "revision": "version:90.0.4430.207" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -55240,11 +55240,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.34" + "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.46" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.34", + "name": "weblayer_instrumentation_test_versions_apk_Implementation Library Skew Tests For 91.0.4472.46", "resultdb": { "enable": true }, @@ -55254,7 +55254,7 @@ { "cipd_package": "chromium/testing/weblayer-x86", "location": "weblayer_instrumentation_test_M91", - "revision": "version:91.0.4472.34" + "revision": "version:91.0.4472.46" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index bfc95bd..00bf0a8 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -1289,41 +1289,13 @@ { "cpu": "x86", "kvm": "1", - "os": "Ubuntu-16.04" + "os": "Ubuntu-18.04" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test": "cc_unittests", "test_id_prefix": "ninja://cc:cc_unittests/" - }, - { - "args": [ - "--board=amd64-generic", - "--use-vm" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "lacros_smoke_tast_tests_amd64-generic", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86", - "kvm": "1", - "os": "Ubuntu-16.04" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "lacros_smoke_tast_tests", - "test_id_prefix": "ninja://chromeos/lacros:lacros_smoke_tast_tests/" } ] }, @@ -3552,7 +3524,7 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { - "os": "Ubuntu-16.04" + "os": "Ubuntu-18.04" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", @@ -3895,7 +3867,7 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { - "os": "Ubuntu-16.04" + "os": "Ubuntu-18.04" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", @@ -4511,7 +4483,7 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { - "os": "Ubuntu-16.04" + "os": "Ubuntu-18.04" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4601,7 +4573,7 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { - "os": "Ubuntu-16.04" + "os": "Ubuntu-18.04" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", @@ -4782,7 +4754,7 @@ "gtest_tests": [ { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.browser_tests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.browser_tests.filter" ], "merge": { "args": [], @@ -4810,7 +4782,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.components_unittests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.components_unittests.filter" ], "merge": { "args": [], @@ -4840,7 +4812,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.interactive_ui_tests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter" ], "merge": { "args": [], @@ -4880,7 +4852,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.sync_integration_tests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.sync_integration_tests.filter" ], "merge": { "args": [], @@ -4907,7 +4879,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.unit_tests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.unit_tests.filter" ], "merge": { "args": [], @@ -5089,7 +5061,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.browser_tests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.browser_tests.filter" ], "merge": { "args": [], @@ -5204,7 +5176,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.components_unittests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.components_unittests.filter" ], "merge": { "args": [], @@ -5231,7 +5203,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.content_browsertests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.content_browsertests.filter" ], "merge": { "args": [], @@ -5445,7 +5417,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.interactive_ui_tests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter" ], "merge": { "args": [], @@ -5821,7 +5793,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.sync_integration_tests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.sync_integration_tests.filter" ], "merge": { "args": [], @@ -5872,7 +5844,7 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/lacros.unit_tests.filter" + "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.unit_tests.filter" ], "merge": { "args": [],
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index e2d1e3e..0e750f1f 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -360,6 +360,16 @@ "chromium_builder_asan" ] }, + "TSAN Release (core-32) (goma)": { + "additional_compile_targets": [ + "chromium_builder_asan" + ] + }, + "TSAN Release (core-32) (reclient)": { + "additional_compile_targets": [ + "chromium_builder_asan" + ] + }, "TSAN Release (deps-cache) (reclient)": { "additional_compile_targets": [ "chromium_builder_asan" @@ -38652,7 +38662,7 @@ { "cpu": "x86", "kvm": "1", - "os": "Ubuntu-16.04" + "os": "Ubuntu-18.04" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -38679,7 +38689,7 @@ { "cpu": "x86", "kvm": "1", - "os": "Ubuntu-16.04" + "os": "Ubuntu-18.04" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -38706,7 +38716,7 @@ { "cpu": "x86", "kvm": "1", - "os": "Ubuntu-16.04" + "os": "Ubuntu-18.04" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -38733,7 +38743,7 @@ { "cpu": "x86", "kvm": "1", - "os": "Ubuntu-16.04" + "os": "Ubuntu-18.04" } ], "idempotent": false, @@ -38745,7 +38755,8 @@ { "args": [ "--board=amd64-generic", - "--use-vm" + "--use-vm", + "--test-launcher-filter-file=../../testing/buildbot/filters/device-lacros.ozone_unittests.filter" ], "merge": { "args": [], @@ -38761,7 +38772,7 @@ { "cpu": "x86", "kvm": "1", - "os": "Ubuntu-16.04" + "os": "Ubuntu-18.04" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com"
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index 20a3b95b..a29a2468 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -27745,7 +27745,7 @@ "--browser=release_x64", "--passthrough", "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-unsafe-fast-js-calls --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu" + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-unsafe-fast-js-calls --enable-fake-no-alloc-direct-call-for-testing --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -30700,7 +30700,7 @@ "--browser=release_x64", "--passthrough", "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-unsafe-fast-js-calls --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu" + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-unsafe-fast-js-calls --enable-fake-no-alloc-direct-call-for-testing --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -33610,7 +33610,7 @@ "--browser=release_x64", "--passthrough", "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-unsafe-fast-js-calls --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu" + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-unsafe-fast-js-calls --enable-fake-no-alloc-direct-call-for-testing --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -34627,7 +34627,7 @@ "--browser=release_x64", "--passthrough", "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-unsafe-fast-js-calls --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu" + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-unsafe-fast-js-calls --enable-fake-no-alloc-direct-call-for-testing --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -35766,7 +35766,7 @@ "--browser=release", "--passthrough", "-v", - "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-unsafe-fast-js-calls --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu" + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-unsafe-fast-js-calls --enable-fake-no-alloc-direct-call-for-testing --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu" ], "isolate_name": "telemetry_gpu_integration_test", "merge": {
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index 9c913d8..f9f632b 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json
@@ -3638,7 +3638,6 @@ "Mac10.13 Tests": { "gtest_tests": [ { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3648,7 +3647,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3657,7 +3656,6 @@ "test_id_prefix": "ninja://third_party/abseil-cpp:absl_hardening_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3667,7 +3665,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3679,7 +3677,6 @@ "args": [ "angle_unittests" ], - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -3689,7 +3686,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3699,7 +3696,6 @@ "use_isolated_scripts_api": true }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3709,7 +3705,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3718,7 +3714,6 @@ "test_id_prefix": "ninja://extensions/shell:app_shell_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3728,7 +3723,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3737,7 +3732,6 @@ "test_id_prefix": "ninja://base:base_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3747,7 +3741,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3756,7 +3750,6 @@ "test_id_prefix": "ninja://base/util:base_util_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3766,7 +3759,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3775,7 +3768,6 @@ "test_id_prefix": "ninja://third_party/blink/common:blink_common_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3785,7 +3777,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3794,7 +3786,6 @@ "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_fuzzer_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3804,7 +3795,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3813,7 +3804,6 @@ "test_id_prefix": "ninja://third_party/blink/renderer/platform/heap:blink_heap_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3823,7 +3813,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3832,7 +3822,6 @@ "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_platform_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3843,7 +3832,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3852,7 +3841,6 @@ "test_id_prefix": "ninja://third_party/blink/renderer/controller:blink_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3862,7 +3850,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3871,7 +3859,6 @@ "test_id_prefix": "ninja://third_party/boringssl:boringssl_crypto_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3881,7 +3868,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3893,7 +3880,6 @@ "args": [ "--gtest_filter=-*UsingRealWebcam*" ], - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3903,7 +3889,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3912,7 +3898,6 @@ "test_id_prefix": "ninja://media/capture:capture_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3922,7 +3907,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3931,7 +3916,6 @@ "test_id_prefix": "ninja://media/cast:cast_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3941,7 +3925,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3950,7 +3934,6 @@ "test_id_prefix": "ninja://cc:cc_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3960,7 +3943,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3969,7 +3952,6 @@ "test_id_prefix": "ninja://chrome/test:chrome_app_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3979,7 +3961,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -3988,7 +3970,6 @@ "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -3998,7 +3979,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4007,7 +3988,6 @@ "test_id_prefix": "ninja://components:components_browsertests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4017,7 +3997,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4026,7 +4006,6 @@ "test_id_prefix": "ninja://components:components_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4036,7 +4015,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", @@ -4046,7 +4025,6 @@ "test_id_prefix": "ninja://content/test:content_browsertests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4056,7 +4034,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4065,7 +4043,6 @@ "test_id_prefix": "ninja://content/test:content_nocompile_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4075,7 +4052,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4084,7 +4061,6 @@ "test_id_prefix": "ninja://content/test:content_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4094,7 +4070,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4103,7 +4079,6 @@ "test_id_prefix": "ninja://third_party/crashpad/crashpad:crashpad_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4113,7 +4088,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4122,7 +4097,6 @@ "test_id_prefix": "ninja://components/cronet:cronet_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4132,7 +4106,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4141,7 +4115,6 @@ "test_id_prefix": "ninja://components/cronet:cronet_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4151,7 +4124,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4160,7 +4133,6 @@ "test_id_prefix": "ninja://crypto:crypto_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4170,7 +4142,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4179,7 +4151,6 @@ "test_id_prefix": "ninja://device:device_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4189,7 +4160,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4198,7 +4169,6 @@ "test_id_prefix": "ninja://ui/display:display_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4208,7 +4178,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4217,7 +4187,6 @@ "test_id_prefix": "ninja://ui/events:events_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4227,7 +4196,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4236,7 +4205,6 @@ "test_id_prefix": "ninja://extensions:extensions_browsertests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4246,7 +4214,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4255,7 +4223,6 @@ "test_id_prefix": "ninja://extensions:extensions_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4265,7 +4232,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4274,7 +4241,6 @@ "test_id_prefix": "ninja://components/services/filesystem:filesystem_service_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4284,7 +4250,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4293,7 +4259,6 @@ "test_id_prefix": "ninja://google_apis/gcm:gcm_unit_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4303,7 +4268,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4312,7 +4277,6 @@ "test_id_prefix": "ninja://ui/gfx:gfx_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4322,7 +4286,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4331,7 +4295,6 @@ "test_id_prefix": "ninja://gin:gin_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4341,7 +4304,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4350,7 +4313,6 @@ "test_id_prefix": "ninja://google_apis:google_apis_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4360,7 +4322,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4369,7 +4331,6 @@ "test_id_prefix": "ninja://gpu:gpu_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4379,7 +4340,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4388,7 +4349,6 @@ "test_id_prefix": "ninja://components/gwp_asan:gwp_asan_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4398,26 +4358,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "headless_browsertests", - "test_id_prefix": "ninja://headless:headless_browsertests/" - }, - { - "isolate_profile_data": true, - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4426,7 +4367,6 @@ "test_id_prefix": "ninja://headless:headless_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4436,7 +4376,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", @@ -4446,7 +4386,6 @@ "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4456,7 +4395,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4465,7 +4404,6 @@ "test_id_prefix": "ninja://ipc:ipc_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4475,7 +4413,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4484,7 +4422,6 @@ "test_id_prefix": "ninja://jingle:jingle_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4494,7 +4431,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4503,7 +4440,6 @@ "test_id_prefix": "ninja://ui/latency:latency_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4513,7 +4449,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4522,7 +4458,6 @@ "test_id_prefix": "ninja://third_party/libjingle_xmpp:libjingle_xmpp_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4532,7 +4467,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4541,7 +4476,6 @@ "test_id_prefix": "ninja://third_party/liburlpattern:liburlpattern_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4551,7 +4485,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4560,7 +4494,6 @@ "test_id_prefix": "ninja://media/blink:media_blink_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4570,7 +4503,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4579,7 +4512,6 @@ "test_id_prefix": "ninja://media:media_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4589,7 +4521,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4598,7 +4530,6 @@ "test_id_prefix": "ninja://ui/message_center:message_center_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4608,7 +4539,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4617,7 +4548,6 @@ "test_id_prefix": "ninja://media/midi:midi_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4627,7 +4557,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4636,7 +4566,6 @@ "test_id_prefix": "ninja://mojo:mojo_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4646,7 +4575,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4655,7 +4584,6 @@ "test_id_prefix": "ninja://ui/native_theme:native_theme_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4665,7 +4593,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4674,7 +4602,6 @@ "test_id_prefix": "ninja://net:net_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4684,7 +4611,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4693,7 +4620,6 @@ "test_id_prefix": "ninja://chrome/browser/media/router:openscreen_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4703,7 +4629,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4712,7 +4638,6 @@ "test_id_prefix": "ninja://pdf:pdf_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4722,7 +4647,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4731,7 +4656,6 @@ "test_id_prefix": "ninja://third_party/perfetto:perfetto_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4741,7 +4665,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4750,7 +4674,6 @@ "test_id_prefix": "ninja://ppapi:ppapi_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4760,7 +4683,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4769,7 +4692,6 @@ "test_id_prefix": "ninja://printing:printing_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4779,7 +4701,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4788,7 +4710,6 @@ "test_id_prefix": "ninja://remoting:remoting_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4798,7 +4719,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4807,7 +4728,6 @@ "test_id_prefix": "ninja://sandbox/mac:sandbox_mac_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4817,7 +4737,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4826,7 +4746,6 @@ "test_id_prefix": "ninja://services/service_manager/tests:service_manager_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4836,7 +4755,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4845,7 +4764,6 @@ "test_id_prefix": "ninja://services:services_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4855,7 +4773,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4864,7 +4782,6 @@ "test_id_prefix": "ninja://ui/shell_dialogs:shell_dialogs_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4874,7 +4791,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4883,7 +4800,6 @@ "test_id_prefix": "ninja://skia:skia_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4893,7 +4809,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4902,7 +4818,6 @@ "test_id_prefix": "ninja://ui/snapshot:snapshot_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4912,7 +4827,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4921,7 +4836,6 @@ "test_id_prefix": "ninja://sql:sql_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4931,7 +4845,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4940,7 +4854,6 @@ "test_id_prefix": "ninja://storage:storage_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4953,7 +4866,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4962,7 +4875,6 @@ "test_id_prefix": "ninja://chrome/test:sync_integration_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4972,7 +4884,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -4981,7 +4893,6 @@ "test_id_prefix": "ninja://ui/base:ui_base_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -4991,7 +4902,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5000,7 +4911,6 @@ "test_id_prefix": "ninja://ui/touch_selection:ui_touch_selection_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5010,7 +4920,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5019,7 +4929,6 @@ "test_id_prefix": "ninja://chrome/test:unit_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5029,7 +4938,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5038,7 +4947,6 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5048,7 +4956,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5057,7 +4965,6 @@ "test_id_prefix": "ninja://url:url_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5067,7 +4974,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5076,7 +4983,6 @@ "test_id_prefix": "ninja://ui/views:views_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5086,7 +4992,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5095,7 +5001,6 @@ "test_id_prefix": "ninja://components/viz:viz_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5105,7 +5010,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5114,7 +5019,6 @@ "test_id_prefix": "ninja://third_party/blink/renderer/platform/wtf:wtf_unittests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5125,7 +5029,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5134,7 +5038,6 @@ "test_id_prefix": "ninja://chrome/test:xr_browser_tests/" }, { - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5144,7 +5047,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5156,7 +5059,6 @@ "isolated_scripts": [ { "isolate_name": "blink_python_tests", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5170,7 +5072,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5179,40 +5081,9 @@ }, { "args": [ - "--num-retries=3" - ], - "isolate_name": "blink_web_tests", - "isolate_profile_data": true, - "merge": { - "args": [ - "--verbose" - ], - "script": "//third_party/blink/tools/merge_web_test_results.py" - }, - "name": "blink_web_tests", - "resultdb": { - "enable": true - }, - "results_handler": "layout tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-64", - "os": "Mac-10.15" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 25 - }, - "test_id_prefix": "ninja://:blink_web_tests/" - }, - { - "args": [ "--test-type=integration" ], "isolate_name": "chromedriver_py_tests", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5226,7 +5097,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5235,7 +5106,6 @@ }, { "isolate_name": "chromedriver_replay_unittests", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5246,7 +5116,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5258,7 +5128,6 @@ "--gtest-benchmark-name=components_perftests" ], "isolate_name": "components_perftests", - "isolate_profile_data": true, "merge": { "args": [ "--smoke-test-mode" @@ -5271,7 +5140,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5280,7 +5149,6 @@ }, { "isolate_name": "content_shell_crash_test", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5295,7 +5163,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5304,7 +5172,6 @@ }, { "isolate_name": "flatbuffers_unittests", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5319,7 +5186,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5328,7 +5195,6 @@ }, { "isolate_name": "grit_python_unittests", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5342,7 +5208,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5351,7 +5217,6 @@ }, { "isolate_name": "mac_signing_tests", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5362,7 +5227,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5371,7 +5236,6 @@ }, { "isolate_name": "metrics_python_tests", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5385,7 +5249,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5394,7 +5258,6 @@ }, { "isolate_name": "mojo_python_unittests", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5408,7 +5271,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -5417,7 +5280,6 @@ }, { "isolate_name": "telemetry_gpu_unittests", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5431,7 +5293,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "idempotent": false, @@ -5445,7 +5307,6 @@ "--extra-browser-args=--disable-gpu" ], "isolate_name": "telemetry_unittests", - "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -5459,7 +5320,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "idempotent": false, @@ -5473,7 +5334,6 @@ "--gtest-benchmark-name=views_perftests" ], "isolate_name": "views_perftests", - "isolate_profile_data": true, "merge": { "args": [ "--smoke-test-mode" @@ -5486,7 +5346,7 @@ "dimension_sets": [ { "cpu": "x86-64", - "os": "Mac-10.15" + "os": "Mac-10.13.6" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com"
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index e551ba5..4b38fa2 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -3101,1911 +3101,6 @@ } ] }, - "Linux ASan LSan (bionic)": { - "gtest_tests": [ - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "absl_hardening_tests", - "test_id_prefix": "ninja://third_party/abseil-cpp:absl_hardening_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "accessibility_unittests", - "test_id_prefix": "ninja://ui/accessibility:accessibility_unittests/" - }, - { - "args": [ - "angle_unittests", - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_unittests", - "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/", - "use_isolated_scripts_api": true - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "app_shell_unittests", - "test_id_prefix": "ninja://extensions/shell:app_shell_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "aura_unittests", - "test_id_prefix": "ninja://ui/aura:aura_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "base_unittests", - "test_id_prefix": "ninja://base:base_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "base_util_unittests", - "test_id_prefix": "ninja://base/util:base_util_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_common_unittests", - "test_id_prefix": "ninja://third_party/blink/common:blink_common_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_fuzzer_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_fuzzer_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_heap_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform/heap:blink_heap_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_platform_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_platform_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "webkit_unit_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 5 - }, - "test": "blink_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/controller:blink_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "boringssl_crypto_tests", - "test_id_prefix": "ninja://third_party/boringssl:boringssl_crypto_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "boringssl_ssl_tests", - "test_id_prefix": "ninja://third_party/boringssl:boringssl_ssl_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 40 - }, - "test": "browser_tests", - "test_id_prefix": "ninja://chrome/test:browser_tests/" - }, - { - "args": [ - "--gtest_filter=-*UsingRealWebcam*", - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "capture_unittests", - "test_id_prefix": "ninja://media/capture:capture_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cast_unittests", - "test_id_prefix": "ninja://media/cast:cast_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cc_unittests", - "test_id_prefix": "ninja://cc:cc_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_app_unittests", - "test_id_prefix": "ninja://chrome/test:chrome_app_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chromedriver_unittests", - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "color_unittests", - "test_id_prefix": "ninja://ui/color:color_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "components_browsertests", - "test_id_prefix": "ninja://components:components_browsertests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 5 - }, - "test": "components_unittests", - "test_id_prefix": "ninja://components:components_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "compositor_unittests", - "test_id_prefix": "ninja://ui/compositor:compositor_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 12 - }, - "test": "content_browsertests", - "test_id_prefix": "ninja://content/test:content_browsertests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "content_unittests", - "test_id_prefix": "ninja://content/test:content_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "crashpad_tests", - "test_id_prefix": "ninja://third_party/crashpad/crashpad:crashpad_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cronet_tests", - "test_id_prefix": "ninja://components/cronet:cronet_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cronet_unittests", - "test_id_prefix": "ninja://components/cronet:cronet_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "crypto_unittests", - "test_id_prefix": "ninja://crypto:crypto_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "dbus_unittests", - "test_id_prefix": "ninja://dbus:dbus_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "device_unittests", - "test_id_prefix": "ninja://device:device_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "display_unittests", - "test_id_prefix": "ninja://ui/display:display_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "events_unittests", - "test_id_prefix": "ninja://ui/events:events_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "extensions_browsertests", - "test_id_prefix": "ninja://extensions:extensions_browsertests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "extensions_unittests", - "test_id_prefix": "ninja://extensions:extensions_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "filesystem_service_unittests", - "test_id_prefix": "ninja://components/services/filesystem:filesystem_service_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gcm_unit_tests", - "test_id_prefix": "ninja://google_apis/gcm:gcm_unit_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gfx_unittests", - "test_id_prefix": "ninja://ui/gfx:gfx_unittests/" - }, - { - "args": [ - "--use-cmd-decoder=passthrough", - "--test-launcher-print-test-stdio=always", - "--use-gpu-in-tests", - "--no-xvfb" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "gl_tests_passthrough", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "gpu": "10de:1cb3", - "os": "Ubuntu", - "pool": "chromium.tests.gpu" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 2 - }, - "test": "gl_tests", - "test_id_prefix": "ninja://gpu:gl_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gl_unittests", - "test_id_prefix": "ninja://ui/gl:gl_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "google_apis_unittests", - "test_id_prefix": "ninja://google_apis:google_apis_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gpu_unittests", - "test_id_prefix": "ninja://gpu:gpu_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gtk_unittests", - "test_id_prefix": "ninja://ui/gtk:gtk_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gwp_asan_unittests", - "test_id_prefix": "ninja://components/gwp_asan:gwp_asan_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "headless_browsertests", - "test_id_prefix": "ninja://headless:headless_browsertests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "headless_unittests", - "test_id_prefix": "ninja://headless:headless_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 - }, - "test": "interactive_ui_tests", - "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ipc_tests", - "test_id_prefix": "ninja://ipc:ipc_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "jingle_unittests", - "test_id_prefix": "ninja://jingle:jingle_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "latency_unittests", - "test_id_prefix": "ninja://ui/latency:latency_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "libjingle_xmpp_unittests", - "test_id_prefix": "ninja://third_party/libjingle_xmpp:libjingle_xmpp_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "liburlpattern_unittests", - "test_id_prefix": "ninja://third_party/liburlpattern:liburlpattern_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "media_blink_unittests", - "test_id_prefix": "ninja://media/blink:media_blink_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "media_unittests", - "test_id_prefix": "ninja://media:media_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "message_center_unittests", - "test_id_prefix": "ninja://ui/message_center:message_center_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "midi_unittests", - "test_id_prefix": "ninja://media/midi:midi_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "mojo_core_unittests", - "test_id_prefix": "ninja://mojo/core:mojo_core_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "mojo_unittests", - "test_id_prefix": "ninja://mojo:mojo_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_helper_nonsfi_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_helper_nonsfi_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "native_theme_unittests", - "test_id_prefix": "ninja://ui/native_theme:native_theme_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 16 - }, - "test": "net_unittests", - "test_id_prefix": "ninja://net:net_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "openscreen_unittests", - "test_id_prefix": "ninja://chrome/browser/media/router:openscreen_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "pdf_unittests", - "test_id_prefix": "ninja://pdf:pdf_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "perfetto_unittests", - "test_id_prefix": "ninja://third_party/perfetto:perfetto_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "printing_unittests", - "test_id_prefix": "ninja://printing:printing_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "remoting_unittests", - "test_id_prefix": "ninja://remoting:remoting_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sandbox_linux_unittests", - "test_id_prefix": "ninja://sandbox/linux:sandbox_linux_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "service_manager_unittests", - "test_id_prefix": "ninja://services/service_manager/tests:service_manager_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "services_unittests", - "test_id_prefix": "ninja://services:services_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "shell_dialogs_unittests", - "test_id_prefix": "ninja://ui/shell_dialogs:shell_dialogs_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "skia_unittests", - "test_id_prefix": "ninja://skia:skia_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "snapshot_unittests", - "test_id_prefix": "ninja://ui/snapshot:snapshot_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sql_unittests", - "test_id_prefix": "ninja://sql:sql_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "storage_unittests", - "test_id_prefix": "ninja://storage:storage_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 4 - }, - "test": "sync_integration_tests", - "test_id_prefix": "ninja://chrome/test:sync_integration_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "traffic_annotation_auditor_unittests", - "test_id_prefix": "ninja://tools/traffic_annotation/auditor:traffic_annotation_auditor_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_base_unittests", - "test_id_prefix": "ninja://ui/base:ui_base_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_touch_selection_unittests", - "test_id_prefix": "ninja://ui/touch_selection:ui_touch_selection_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 4 - }, - "test": "unit_tests", - "test_id_prefix": "ninja://chrome/test:unit_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "url_unittests", - "test_id_prefix": "ninja://url:url_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "views_unittests", - "test_id_prefix": "ninja://ui/views:views_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "viz_unittests", - "test_id_prefix": "ninja://components/viz:viz_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "vr_common_unittests", - "test_id_prefix": "ninja://chrome/browser/vr:vr_common_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "vr_pixeltests", - "test_id_prefix": "ninja://chrome/browser/vr:vr_pixeltests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "weblayer_browsertests", - "test_id_prefix": "ninja://weblayer/test:weblayer_browsertests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "weblayer_unittests", - "test_id_prefix": "ninja://weblayer/test:weblayer_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "wm_unittests", - "test_id_prefix": "ninja://ui/wm:wm_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "wtf_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform/wtf:wtf_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "x11_unittests", - "test_id_prefix": "ninja://ui/platform_window/x11:x11_unittests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "name": "xr_browser_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "xr_browser_tests", - "test_id_prefix": "ninja://chrome/test:xr_browser_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Ubuntu-18.04" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "zlib_unittests", - "test_id_prefix": "ninja://third_party/zlib:zlib_unittests/" - } - ] - }, "Linux ASan LSan Tests (1)": { "gtest_tests": [ {
diff --git a/testing/buildbot/chromium.swangle.json b/testing/buildbot/chromium.swangle.json index fa2723e..6ef74d2 100644 --- a/testing/buildbot/chromium.swangle.json +++ b/testing/buildbot/chromium.swangle.json
@@ -30,7 +30,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -66,7 +66,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -97,7 +97,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -127,7 +127,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -157,7 +157,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -187,7 +187,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -217,7 +217,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -247,7 +247,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -278,7 +278,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -308,7 +308,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -338,7 +338,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -368,7 +368,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -399,7 +399,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -429,7 +429,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -459,7 +459,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -489,7 +489,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -523,7 +523,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -553,7 +553,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -583,7 +583,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -613,7 +613,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -643,7 +643,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -673,7 +673,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -704,7 +704,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -734,7 +734,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -764,7 +764,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -794,7 +794,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -825,7 +825,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -855,7 +855,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -885,7 +885,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -915,7 +915,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -949,7 +949,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -979,7 +979,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1009,7 +1009,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1039,7 +1039,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1069,7 +1069,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1099,7 +1099,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1130,7 +1130,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1160,7 +1160,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1190,7 +1190,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1220,7 +1220,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1251,7 +1251,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1281,7 +1281,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1311,7 +1311,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ], @@ -1341,7 +1341,7 @@ { "cpu": "x86-64", "gpu": "none", - "os": "Ubuntu-16.04", + "os": "Ubuntu-16.04|Ubuntu-18.04", "pool": "chromium.tests.gpu" } ],
diff --git a/testing/buildbot/filters/BUILD.gn b/testing/buildbot/filters/BUILD.gn index c1b4b1c..0ba021b 100644 --- a/testing/buildbot/filters/BUILD.gn +++ b/testing/buildbot/filters/BUILD.gn
@@ -63,8 +63,8 @@ "//testing/buildbot/filters/chromeos.msan.browser_tests.oobe_negative.filter", "//testing/buildbot/filters/chromeos.msan.browser_tests.oobe_positive.filter", "//testing/buildbot/filters/code_coverage.browser_tests.filter", - "//testing/buildbot/filters/lacros.browser_tests.filter", "//testing/buildbot/filters/linux_bionic.browser_tests.filter", + "//testing/buildbot/filters/linux-lacros.browser_tests.filter", "//testing/buildbot/filters/mac.mac-rel.browser_tests.filter", "//testing/buildbot/filters/ozone-linux.wayland_browser_tests.filter", "//testing/buildbot/filters/pixel_browser_tests.filter", @@ -104,7 +104,7 @@ data = [ "//testing/buildbot/filters/android.emulator_11.components_unittests.filter", - "//testing/buildbot/filters/lacros.components_unittests.filter", + "//testing/buildbot/filters/linux-lacros.components_unittests.filter", ] } @@ -120,7 +120,7 @@ "//testing/buildbot/filters/cast-linux.content_browsertests.filter", "//testing/buildbot/filters/chromium.webrtc.fyi.android.tests.dbg.content_browsertests.filter", "//testing/buildbot/filters/gpu.skiarenderer_vulkan_content_browsertests.filter", - "//testing/buildbot/filters/lacros.content_browsertests.filter", + "//testing/buildbot/filters/linux-lacros.content_browsertests.filter", "//testing/buildbot/filters/site_isolation_android.content_browsertests.filter", "//testing/buildbot/filters/vulkan.content_browsertests.filter", "//testing/buildbot/filters/ozone-linux.wayland_content_browsertests.filter", @@ -160,7 +160,7 @@ data = [ "//testing/buildbot/filters/e2e.sync_integration_tests.filter", - "//testing/buildbot/filters/lacros.sync_integration_tests.filter", + "//testing/buildbot/filters/linux-lacros.sync_integration_tests.filter", ] } @@ -194,7 +194,7 @@ testonly = true data = [ - "//testing/buildbot/filters/lacros.interactive_ui_tests.filter", + "//testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter", "//testing/buildbot/filters/ozone-linux.interactive_ui_tests_wayland.filter", ] } @@ -225,7 +225,10 @@ } source_set("ozone_unittests_filters") { - data = [ "//testing/buildbot/filters/chromeos.ozone_unittests.filter" ] + data = [ + "//testing/buildbot/filters/chromeos.ozone_unittests.filter", + "//testing/buildbot/filters/device-lacros.ozone_unittests.filter", + ] } source_set("sandbox_linux_unittests_filters") { @@ -238,7 +241,7 @@ data = [ "//testing/buildbot/filters/android.asan.unit_tests.filter", "//testing/buildbot/filters/bfcache.unit_tests.filter", - "//testing/buildbot/filters/lacros.unit_tests.filter", + "//testing/buildbot/filters/linux-lacros.unit_tests.filter", "//testing/buildbot/filters/ozone-linux.unit_tests_wayland.filter", ] }
diff --git a/testing/buildbot/filters/device-lacros.ozone_unittests.filter b/testing/buildbot/filters/device-lacros.ozone_unittests.filter new file mode 100644 index 0000000..15a2217 --- /dev/null +++ b/testing/buildbot/filters/device-lacros.ozone_unittests.filter
@@ -0,0 +1,8 @@ +# TODO(crbug.com/1204709) Enable following tests on lacros. +-*/WaylandWindowTest.SetsPropertiesOnShow/* + +# TODO(crbug.com/1204706) Enable following tests on lacros. +-*/WaylandCursorFactoryTest.RetainOldThemeUntilNewBufferIsAttached/* + +# TODO(crbug.com/1204707) Enable following tests on lacros. +-*/WaylandInputMethodContextTest.* \ No newline at end of file
diff --git a/testing/buildbot/filters/lacros.browser_tests.filter b/testing/buildbot/filters/linux-lacros.browser_tests.filter similarity index 100% rename from testing/buildbot/filters/lacros.browser_tests.filter rename to testing/buildbot/filters/linux-lacros.browser_tests.filter
diff --git a/testing/buildbot/filters/lacros.components_unittests.filter b/testing/buildbot/filters/linux-lacros.components_unittests.filter similarity index 100% rename from testing/buildbot/filters/lacros.components_unittests.filter rename to testing/buildbot/filters/linux-lacros.components_unittests.filter
diff --git a/testing/buildbot/filters/lacros.content_browsertests.filter b/testing/buildbot/filters/linux-lacros.content_browsertests.filter similarity index 100% rename from testing/buildbot/filters/lacros.content_browsertests.filter rename to testing/buildbot/filters/linux-lacros.content_browsertests.filter
diff --git a/testing/buildbot/filters/lacros.interactive_ui_tests.filter b/testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter similarity index 100% rename from testing/buildbot/filters/lacros.interactive_ui_tests.filter rename to testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter
diff --git a/testing/buildbot/filters/lacros.sync_integration_tests.filter b/testing/buildbot/filters/linux-lacros.sync_integration_tests.filter similarity index 100% rename from testing/buildbot/filters/lacros.sync_integration_tests.filter rename to testing/buildbot/filters/linux-lacros.sync_integration_tests.filter
diff --git a/testing/buildbot/filters/lacros.unit_tests.filter b/testing/buildbot/filters/linux-lacros.unit_tests.filter similarity index 100% rename from testing/buildbot/filters/lacros.unit_tests.filter rename to testing/buildbot/filters/linux-lacros.unit_tests.filter
diff --git a/testing/buildbot/internal.chromeos.fyi.json b/testing/buildbot/internal.chromeos.fyi.json index 4057b12..1b18e28 100644 --- a/testing/buildbot/internal.chromeos.fyi.json +++ b/testing/buildbot/internal.chromeos.fyi.json
@@ -1219,7 +1219,7 @@ { "cpu": "x86", "kvm": "1", - "os": "Ubuntu-16.04", + "os": "Ubuntu-18.04", "pool": "chrome.tests" } ],
diff --git a/testing/buildbot/mixins.pyl b/testing/buildbot/mixins.pyl index b1e70e2..93b76fef 100644 --- a/testing/buildbot/mixins.pyl +++ b/testing/buildbot/mixins.pyl
@@ -488,6 +488,13 @@ }, }, }, + 'linux-xenial-or-bionic': { + 'swarming': { + 'dimensions': { + 'os': 'Ubuntu-16.04|Ubuntu-18.04', + }, + }, + }, 'linux_amd_rx_5500_xt': { 'swarming': { 'dimensions': {
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index 70e3ee9..f5a0268 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -218,6 +218,7 @@ 'blink_web_tests': { 'remove_from': [ 'Mac10.11 Tests', + 'Mac10.13 Tests', # crbug.com/1205669 'Win 7 Tests x64 (1)', # 64-bit win is unsupported by the layout tests. 'Win10 Tests x64 (dbg)', ], @@ -575,14 +576,6 @@ 'shards': 10, }, }, - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - # These are very slow on the ASAN trybot for some reason. - # crbug.com/794372 - 'swarming': { - 'shards': 40, - }, - }, 'Linux ASan LSan Tests (1)': { # These are very slow on the ASAN trybot for some reason. # crbug.com/794372 @@ -751,12 +744,12 @@ }, 'linux-lacros-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.browser_tests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.browser_tests.filter', ], }, 'linux-lacros-tester-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.browser_tests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.browser_tests.filter', ], }, 'linux-trusty-rel': { @@ -1119,14 +1112,6 @@ 'ToTFuchsiaOfficial', # https://crbug.com/961457 ], 'modifications': { - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - # These are very slow on the ASAN trybot for some reason. - # crbug.com/794372 - 'swarming': { - 'shards': 5, - }, - }, 'Linux ASan LSan Tests (1)': { # These are very slow on the ASAN trybot for some reason. # crbug.com/794372 @@ -1165,13 +1150,13 @@ # https://crbug.com/1111979, 'linux-lacros-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.components_unittests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.components_unittests.filter', ], }, # https://crbug.com/1111979, 'linux-lacros-tester-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.components_unittests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.components_unittests.filter', ], }, }, @@ -1194,12 +1179,6 @@ '--test-launcher-filter-file=../../testing/buildbot/filters/cast-linux.content_browsertests.filter', ], }, - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - 'swarming': { - 'shards': 12, - }, - }, 'Linux ASan LSan Tests (1)': { 'swarming': { 'shards': 12, @@ -1322,6 +1301,12 @@ }, 'linux-chromeos-rel': { 'swarming': { + # TODO(crbug.com/1202743): Remove this exception. + 'dimension_sets': [ + { + 'os': 'Ubuntu-18.04', + }, + ], 'shards': 3, }, }, @@ -1340,7 +1325,7 @@ # https://crbug.com/1111979, 'linux-lacros-tester-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.content_browsertests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.content_browsertests.filter', ], }, }, @@ -1391,14 +1376,6 @@ }, 'content_unittests': { 'modifications': { - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - # These are slow on the ASAN trybot for some reason. - # crbug.com/794372 - 'swarming': { - 'shards': 2, - }, - }, 'Linux ASan LSan Tests (1)': { # These are slow on the ASAN trybot for some reason. # crbug.com/794372 @@ -1539,8 +1516,6 @@ 'gin_unittests': { 'remove_from': [ 'ToTLinuxASan', # https://crbug.com/831667 - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)', 'Linux ASan LSan Tests (1)', # https://crbug.com/831667 'Linux Chromium OS ASan LSan Tests (1)', # https://crbug.com/831667 ], @@ -1555,22 +1530,6 @@ 'modifications': { # TODO(kbr): figure out a better way to specify blocks of # arguments like this for tests on multiple machines. - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - 'args': [ - '--use-gpu-in-tests', - '--no-xvfb', - ], - 'swarming': { - 'dimension_sets': [ - { - 'gpu': '10de:1cb3', - 'os': 'Ubuntu', - 'pool': 'chromium.tests.gpu', - }, - ], - }, - }, 'Linux ASan LSan Tests (1)': { 'args': [ '--use-gpu-in-tests', @@ -1711,6 +1670,7 @@ }, 'remove_from': [ 'CrWinAsan(dll)', # https://crbug.com/935598 + 'Mac10.13 Tests', # https://crbug.com/1204424 ], }, 'info_collection_tests': { @@ -1767,13 +1727,6 @@ 'shards': 3, }, }, - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - # These are slow on the ASan trybot for some reason, crbug.com/794372 - 'swarming': { - 'shards': 6, - }, - }, 'Linux ASan LSan Tests (1)': { # These are slow on the ASan trybot for some reason, crbug.com/794372 'swarming': { @@ -1861,6 +1814,16 @@ '--gtest_filter=-SadTabViewInteractiveUITest.ReloadMultipleSadTabs', ], }, + 'linux-chromeos-rel': { + 'swarming': { + # TODO(crbug.com/1202743): Remove this exception. + 'dimension_sets': [ + { + 'os': 'Ubuntu-18.04', + }, + ], + } + }, 'linux-chromeos-stable': { 'args': [ '--gtest_filter=-SadTabViewInteractiveUITest.ReloadMultipleSadTabs', @@ -1874,13 +1837,13 @@ # https://crbug.com/1111979 'linux-lacros-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.interactive_ui_tests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter', ], }, # https://crbug.com/1111979 'linux-lacros-tester-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.interactive_ui_tests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter', ], }, }, @@ -1916,6 +1879,18 @@ }, }, }, + # TODO(crbug.com/1198252): Remove once Lacros Tast tests flakiness is fixed. + 'lacros_smoke_tast_tests_amd64-generic': { + 'remove_from': [ + 'lacros-amd64-generic-rel', + ], + }, + # TODO(crbug.com/1198252): Remove once Lacros Tast tests flakiness is fixed. + 'lacros_smoke_tast_tests_eve': { + 'remove_from': [ + 'lacros-amd64-generic-chrome', + ], + }, 'maps_pixel_passthrough_test': { 'replacements': { # The V8 builders pass the V8 revision for ${got_revision}, so instead @@ -2174,14 +2149,6 @@ 'shards': 16, }, }, - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - # These are very slow on the ASAN trybot for some reason. - # crbug.com/794372 - 'swarming': { - 'shards': 16, - }, - }, 'Linux ASan LSan Tests (1)': { # These are very slow on the ASAN trybot for some reason. # crbug.com/794372 @@ -2398,7 +2365,14 @@ 'remove_from': [ # TODO(crbug.com/1204231): Re-enable. 'lacros-amd64-generic-rel', - ] + ], + 'modifications': { + 'lacros-amd64-generic-rel-fyi': { + 'args': [ + '--test-launcher-filter-file=../../testing/buildbot/filters/device-lacros.ozone_unittests.filter', + ], + }, + }, }, 'perfetto_unittests': { 'remove_from': [ @@ -2650,12 +2624,6 @@ 'CrWinAsan(dll)', # https://crbug.com/935598 ], 'modifications': { - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - 'swarming': { - 'shards': 4, - }, - }, 'Linux ASan LSan Tests (1)': { 'swarming': { 'shards': 4, @@ -2702,6 +2670,16 @@ 'shards': 4, }, }, + 'linux-chromeos-rel': { + 'swarming': { + # TODO(crbug.com/1202743): Remove this exception. + 'dimension_sets': [ + { + 'os': 'Ubuntu-18.04', + }, + ], + } + }, 'linux-code-coverage': { 'swarming': { 'shards': 4, @@ -2710,12 +2688,12 @@ # https://crbug.com/1199909, 'linux-lacros-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.sync_integration_tests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.sync_integration_tests.filter', ] }, 'linux-lacros-tester-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.sync_integration_tests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.sync_integration_tests.filter', ], }, }, @@ -2889,14 +2867,6 @@ 'android-pie-arm64-rel', # https://crbug.com/1010211 ], 'modifications': { - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - # These are slow on the ASAN trybot for some reason. - # crbug.com/794372 - 'swarming': { - 'shards': 4, - }, - }, 'Linux ASan LSan Tests (1)': { # These are slow on the ASAN trybot for some reason. # crbug.com/794372 @@ -2956,19 +2926,25 @@ }, 'linux-chromeos-rel': { 'swarming': { + # TODO(crbug.com/1202743): Remove this exception. + 'dimension_sets': [ + { + 'os': 'Ubuntu-18.04', + }, + ], 'shards': 2, }, }, # https://crbug.com/1111979, 'linux-lacros-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.unit_tests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.unit_tests.filter', ], }, # https://crbug.com/1111979, 'linux-lacros-tester-rel': { 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/lacros.unit_tests.filter', + '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.unit_tests.filter', ], }, }, @@ -3144,14 +3120,6 @@ 'android-marshmallow-x86-rel-non-cq', ], 'modifications': { - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - # These are very slow on the ASAN trybot for some reason. - # crbug.com/794372 - 'swarming': { - 'shards': 5, - }, - }, 'Linux ASan LSan Tests (1)': { # These are very slow on the ASAN trybot for some reason. # crbug.com/794372
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 4a88b11..762703aa 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -3716,7 +3716,7 @@ 'telemetry_test_name': 'webgl_conformance', 'args': [ # On dual-GPU devices we want the high-performance GPU to be active - '--extra-browser-args=--enable-unsafe-fast-js-calls --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu', + '--extra-browser-args=--enable-unsafe-fast-js-calls --enable-fake-no-alloc-direct-call-for-testing --use-gl=angle --use-cmd-decoder=passthrough --force_high_performance_gpu', ], 'mixins': [ 'enable_resultdb',
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index f669c7d5..16a4d91 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -331,13 +331,13 @@ '../../weblayer/browser/android/javatests/skew/expectations.txt', '--impl-version=91', ], - 'identifier': 'Implementation Library Skew Tests For 91.0.4472.34', + 'identifier': 'Implementation Library Skew Tests For 91.0.4472.46', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M91', - 'revision': 'version:91.0.4472.34', + 'revision': 'version:91.0.4472.46', } ], }, @@ -355,13 +355,13 @@ '../../weblayer/browser/android/javatests/skew/expectations.txt', '--impl-version=90', ], - 'identifier': 'Implementation Library Skew Tests For 90.0.4430.206', + 'identifier': 'Implementation Library Skew Tests For 90.0.4430.207', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M90', - 'revision': 'version:90.0.4430.206', + 'revision': 'version:90.0.4430.207', } ], }, @@ -403,13 +403,13 @@ '../../weblayer/browser/android/javatests/skew/expectations.txt', '--impl-version=91', ], - 'identifier': 'Implementation Library Skew Tests For 91.0.4472.34', + 'identifier': 'Implementation Library Skew Tests For 91.0.4472.46', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M91', - 'revision': 'version:91.0.4472.34', + 'revision': 'version:91.0.4472.46', } ], }, @@ -427,13 +427,13 @@ '../../weblayer/browser/android/javatests/skew/expectations.txt', '--impl-version=90', ], - 'identifier': 'Implementation Library Skew Tests For 90.0.4430.206', + 'identifier': 'Implementation Library Skew Tests For 90.0.4430.207', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M90', - 'revision': 'version:90.0.4430.206', + 'revision': 'version:90.0.4430.207', } ], }, @@ -475,13 +475,13 @@ '../../weblayer/browser/android/javatests/skew/expectations.txt', '--client-version=91', ], - 'identifier': 'Client Library Skew Tests For 91.0.4472.34', + 'identifier': 'Client Library Skew Tests For 91.0.4472.46', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M91', - 'revision': 'version:91.0.4472.34', + 'revision': 'version:91.0.4472.46', } ], }, @@ -499,13 +499,13 @@ '../../weblayer/browser/android/javatests/skew/expectations.txt', '--client-version=90', ], - 'identifier': 'Client Library Skew Tests For 90.0.4430.206', + 'identifier': 'Client Library Skew Tests For 90.0.4430.207', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', 'location': 'weblayer_instrumentation_test_M90', - 'revision': 'version:90.0.4430.206', + 'revision': 'version:90.0.4430.207', } ], }, @@ -601,7 +601,7 @@ { 'cpu': 'x86', 'kvm': '1', - 'os': 'Ubuntu-16.04', + 'os': 'Ubuntu-18.04', } ], },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 9e4a626..31cffe10 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -2742,6 +2742,16 @@ 'chromium_builder_asan', ], }, + 'TSAN Release (core-32) (goma)': { + 'additional_compile_targets': [ + 'chromium_builder_asan', + ], + }, + 'TSAN Release (core-32) (reclient)': { + 'additional_compile_targets': [ + 'chromium_builder_asan', + ], + }, 'TSAN Release (deps-cache) (reclient)': { 'additional_compile_targets': [ 'chromium_builder_asan', @@ -5174,8 +5184,7 @@ }, 'Mac10.13 Tests': { 'mixins': [ - 'isolate_profile_data', - 'mac_10.15', + 'mac_10.13', ], 'test_suites': { 'gtest_tests': 'chromium_mac_gtests_no_nacl', @@ -5300,18 +5309,6 @@ 'gtest_tests': 'chromium_android_gtests', }, }, - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': { - 'mixins': [ - 'linux-bionic', - ], - 'test_suites': { - 'gtest_tests': 'chromium_linux_and_gl_gtests', - }, - 'args': [ - '--test-launcher-print-test-stdio=always', - ], - }, 'Linux ASan LSan Tests (1)': { 'mixins': [ 'linux-bionic', @@ -5546,7 +5543,7 @@ 'mixins': [ 'gpu-swarming-pool', 'isolate_profile_data', - 'linux-xenial', + 'linux-xenial-or-bionic', 'no_gpu', 'x86-64', ], @@ -5559,7 +5556,7 @@ 'mixins': [ 'gpu-swarming-pool', 'isolate_profile_data', - 'linux-xenial', + 'linux-xenial-or-bionic', 'no_gpu', 'timeout_15m', 'x86-64', @@ -5573,7 +5570,7 @@ 'mixins': [ 'gpu-swarming-pool', 'isolate_profile_data', - 'linux-xenial', + 'linux-xenial-or-bionic', 'no_gpu', 'timeout_15m', 'x86-64', @@ -5587,7 +5584,7 @@ 'mixins': [ 'gpu-swarming-pool', 'isolate_profile_data', - 'linux-xenial', + 'linux-xenial-or-bionic', 'no_gpu', 'timeout_15m', 'x86-64',
diff --git a/testing/scripts/representative_perf_test_data/representatives_frame_times_upper_limit.json b/testing/scripts/representative_perf_test_data/representatives_frame_times_upper_limit.json index 2080be4..e958805 100644 --- a/testing/scripts/representative_perf_test_data/representatives_frame_times_upper_limit.json +++ b/testing/scripts/representative_perf_test_data/representatives_frame_times_upper_limit.json
@@ -91,7 +91,9 @@ "balls_javascript_canvas": { "ci_095": 1.227, "avg": 39.719, - "cpu_wall_time_ratio": 0.58 + "cpu_wall_time_ratio": 0.58, + "experimental": true, + "_comment": "crbug.com/1122037" }, "transform_transitions_js_block": { "ci_095": 0.32, @@ -106,7 +108,9 @@ "fill_shapes": { "ci_095": 1.115, "avg": 36.275, - "cpu_wall_time_ratio": 0.55 + "cpu_wall_time_ratio": 0.55, + "experimental": true, + "_comment": "crbug.com/1122037" }, "css_value_type_shadow": { "ci_095": 10.26,
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 0a512eb..a2a3177 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -4042,6 +4042,24 @@ ] } ], + "InstalledAppsInCbd": [ + { + "platforms": [ + "chromeos", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "InstalledAppsInCbd" + ] + } + ] + } + ], "IntentBlockExternalFormRedirectsNoGesture": [ { "platforms": [ @@ -4632,6 +4650,68 @@ ] } ], + "MojoInlineMessagePayloads": [ + { + "platforms": [ + "android", + "chromeos", + "chromeos_lacros", + "ios", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "MojoInlineMessagePayloads" + ] + } + ] + } + ], + "MojoPosixUseWritev": [ + { + "platforms": [ + "android", + "chromeos", + "chromeos_lacros", + "linux", + "ios" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "MojoPosixUseWritev" + ] + } + ] + } + ], + "MojoSharedMemoryChannelLinux": [ + { + "platforms": [ + "android", + "chromeos", + "chromeos_lacros", + "linux" + ], + "experiments": [ + { + "name": "Enabled", + "params": { + "MojoLinuxChannelSharedMemEfdZeroOnWake": "true", + "MojoLinuxChannelSharedMemPages": "2" + }, + "enable_features": [ + "MojoLinuxChannelSharedMem" + ] + } + ] + } + ], "MultipleBlinkIsolates": [ { "platforms": [ @@ -6463,21 +6543,6 @@ ] } ], - "SafeBrowsingPasswordProtectionReferringAppEnabledAndroid": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "SafeBrowsingPasswordProtectionReferringAppEnabledAndroid" - ] - } - ] - } - ], "SafeBrowsingPerProfileNetworkContexts": [ { "platforms": [ @@ -6515,6 +6580,29 @@ ] } ], + "SafeBrowsingRealTimeUrlLookupReferrerChain": [ + { + "platforms": [ + "android", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled_20200422", + "params": { + "SafeBrowsingRealTimeUrlLookupReferrerLengthParam": "2" + }, + "enable_features": [ + "SafeBrowsingRealTimeUrlLookupReferrerChain" + ] + } + ] + } + ], "SafeBrowsingVisualCsdModel": [ { "platforms": [ @@ -7308,7 +7396,7 @@ ] } ], - "TextFragmentColorChange": [ + "TextFragmentColorChangeBlink": [ { "platforms": [ "android", @@ -7321,7 +7409,7 @@ { "name": "Enabled", "enable_features": [ - "TextFragmentColorChange" + "TextFragmentColorChangeBlink" ] } ]
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc index 172445d..98bfdbe 100644 --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc
@@ -581,7 +581,7 @@ // TODO(crbug.com/920069): Remove this once the feature has // landed and no compat issues are reported. const base::Feature kOffsetParentNewSpecBehavior{ - "OffsetParentNewSpecBehavior", base::FEATURE_ENABLED_BY_DEFAULT}; + "OffsetParentNewSpecBehavior", base::FEATURE_DISABLED_BY_DEFAULT}; // Slightly delays rendering if there are fonts being preloaded, so that // they don't miss the first paint if they can be loaded fast enough (e.g.,
diff --git a/third_party/blink/perf_tests/shadow_dom/custom-detail-summary.js b/third_party/blink/perf_tests/shadow_dom/custom-detail-summary.js index cbf6b47..1be17e10 100644 --- a/third_party/blink/perf_tests/shadow_dom/custom-detail-summary.js +++ b/third_party/blink/perf_tests/shadow_dom/custom-detail-summary.js
@@ -27,11 +27,11 @@ //Get the first <my-summary> element from <my-detail>'s direct children const my_summary = target.querySelector(':scope > my-summary'); if (my_summary) { - slot1.assign([my_summary]); + slot1.assign(my_summary); } else { - slot1.assign([]); + slot1.assign(); } - slot2.assign(target.childNodes); + slot2.assign(...target.childNodes); }); observer.observe(this, {childList: true}); }
diff --git a/third_party/blink/perf_tests/shadow_dom/imperative-api-appendchild.html b/third_party/blink/perf_tests/shadow_dom/imperative-api-appendchild.html index ef2aba97..6f72bc91 100644 --- a/third_party/blink/perf_tests/shadow_dom/imperative-api-appendchild.html +++ b/third_party/blink/perf_tests/shadow_dom/imperative-api-appendchild.html
@@ -7,7 +7,7 @@ const shadow_root = host.attachShadow({ mode: 'open', slotAssignment: 'manual' }); const slot1 = document.createElement("slot"); const child1 = document.createElement("child"); - slot1.assign([child1]); + slot1.assign(child1); shadow_root.appendChild(slot1); window.onload = function() { PerfTestRunner.measureTime({
diff --git a/third_party/blink/perf_tests/shadow_dom/imperative-api-assign.html b/third_party/blink/perf_tests/shadow_dom/imperative-api-assign.html index 06417d8..c099d9e5 100644 --- a/third_party/blink/perf_tests/shadow_dom/imperative-api-assign.html +++ b/third_party/blink/perf_tests/shadow_dom/imperative-api-assign.html
@@ -15,7 +15,7 @@ const start = PerfTestRunner.now(); for (let i = 0; i < 100; i++) { host.appendChild(child1); - slot1.assign([child1]); + slot1.assign(child1); child1.remove(); }
diff --git a/third_party/blink/perf_tests/shadow_dom/imperative-api-assigned-elements.html b/third_party/blink/perf_tests/shadow_dom/imperative-api-assigned-elements.html index 6d63ba2..11867f5 100644 --- a/third_party/blink/perf_tests/shadow_dom/imperative-api-assigned-elements.html +++ b/third_party/blink/perf_tests/shadow_dom/imperative-api-assigned-elements.html
@@ -7,7 +7,7 @@ const shadow_root = host.attachShadow({ mode: 'open', slotAssignment: 'manual' }); const slot1 = document.createElement("slot"); const child1 = document.createElement("child"); - slot1.assign([child1]); + slot1.assign(child1); shadow_root.appendChild(slot1); window.onload = function() { PerfTestRunner.measureTime({
diff --git a/third_party/blink/perf_tests/shadow_dom/imperative-api-insertbefore.html b/third_party/blink/perf_tests/shadow_dom/imperative-api-insertbefore.html index 7e4882c..493182b5 100644 --- a/third_party/blink/perf_tests/shadow_dom/imperative-api-insertbefore.html +++ b/third_party/blink/perf_tests/shadow_dom/imperative-api-insertbefore.html
@@ -9,7 +9,7 @@ const slot1 = document.createElement("slot"); const child1 = document.createElement("child"); const child = document.querySelector("#child"); - slot1.assign([child1]); + slot1.assign(child1); shadow_root.appendChild(slot1); window.onload = function() { PerfTestRunner.measureTime({
diff --git a/third_party/blink/perf_tests/shadow_dom/imperative-api.html b/third_party/blink/perf_tests/shadow_dom/imperative-api.html index 56ca1c9..f6ce6561 100644 --- a/third_party/blink/perf_tests/shadow_dom/imperative-api.html +++ b/third_party/blink/perf_tests/shadow_dom/imperative-api.html
@@ -15,7 +15,7 @@ for (let i = 0; i < 100; i++) { const slot1 = document.createElement("slot"); shadow_root.appendChild(slot1); - slot1.assign([child1]); + slot1.assign(child1); child1.assignedSlot; slot1.assignedElements(); slot1.remove();
diff --git a/third_party/blink/public/mojom/frame/frame.mojom b/third_party/blink/public/mojom/frame/frame.mojom index fd861f22..d80d6662 100644 --- a/third_party/blink/public/mojom/frame/frame.mojom +++ b/third_party/blink/public/mojom/frame/frame.mojom
@@ -678,8 +678,7 @@ DidUpdateFramePolicy(blink.mojom.FramePolicy frame_policy); // Called when the device's screen information changes. - // TODO(crbug.com/1068774): Include screen info with this event, perhaps - // plumbing the multi-screen info via SynchronizeVisualProperties. + // TODO(crbug.com/1205676): Remove deprecated window.screenschange plumbing. OnScreensChange(); // Posts a message from a frame in another process to the current renderer.
diff --git a/third_party/blink/public/mojom/link_to_text/link_to_text.mojom b/third_party/blink/public/mojom/link_to_text/link_to_text.mojom index 20dab5d..cc29a81f 100644 --- a/third_party/blink/public/mojom/link_to_text/link_to_text.mojom +++ b/third_party/blink/public/mojom/link_to_text/link_to_text.mojom
@@ -22,4 +22,7 @@ // Retrieves the text fragments matches from the fragment directive. ExtractTextFragmentsMatches() => (array<string> text); + + // Request text fragment selectors for existing highlights. + GetExistingSelectors() => (array<string> selectors); };
diff --git a/third_party/blink/public/mojom/web_feature/web_feature.mojom b/third_party/blink/public/mojom/web_feature/web_feature.mojom index d932a5ce..71e78535 100644 --- a/third_party/blink/public/mojom/web_feature/web_feature.mojom +++ b/third_party/blink/public/mojom/web_feature/web_feature.mojom
@@ -3203,6 +3203,7 @@ kWebGPU = 3888, kCSSFilterColorMatrix = 3889, kHTMLFencedFrameElement = 3890, + kCSSFilterLuminanceToAlpha = 3891, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/public/web/web_window_features.h b/third_party/blink/public/web/web_window_features.h index 18d045f..888a2a26e 100644 --- a/third_party/blink/public/web/web_window_features.h +++ b/third_party/blink/public/web/web_window_features.h
@@ -31,6 +31,10 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_WINDOW_FEATURES_H_ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_WINDOW_FEATURES_H_ +#include "base/optional.h" + +#include "third_party/blink/public/platform/web_impression.h" + namespace blink { struct WebWindowFeatures { @@ -60,6 +64,10 @@ bool noreferrer = false; bool background = false; bool persistent = false; + + // Represents the attribution source declared by Attribution Reporting related + // window features, if any. + base::Optional<WebImpression> impression; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/OWNERS b/third_party/blink/renderer/core/OWNERS index 400137a..363cd81 100644 --- a/third_party/blink/renderer/core/OWNERS +++ b/third_party/blink/renderer/core/OWNERS
@@ -15,6 +15,7 @@ clamy@chromium.org dcheng@chromium.org dgozman@chromium.org +dlibby@microsoft.com # drott reviews font specific changes. drott@chromium.org dsinclair@chromium.org
diff --git a/third_party/blink/renderer/core/app_history/app_history.cc b/third_party/blink/renderer/core/app_history/app_history.cc index 959d06f..1e83323 100644 --- a/third_party/blink/renderer/core/app_history/app_history.cc +++ b/third_party/blink/renderer/core/app_history/app_history.cc
@@ -9,6 +9,8 @@ #include "third_party/blink/renderer/core/app_history/app_history_navigate_event.h" #include "third_party/blink/renderer/core/app_history/app_history_navigate_event_init.h" #include "third_party/blink/renderer/core/app_history/app_history_navigate_options.h" +#include "third_party/blink/renderer/core/dom/dom_exception.h" +#include "third_party/blink/renderer/core/events/error_event.h" #include "third_party/blink/renderer/core/frame/history_util.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/html/forms/form_data.h" @@ -17,6 +19,77 @@ namespace blink { +namespace { + +class NavigateReaction final : public ScriptFunction { + public: + enum class ResolveType { + kFulfill, + kReject, + }; + static ScriptPromise React(ScriptState* script_state, ScriptPromise promise) { + auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); + promise.Then(CreateFunction(script_state, resolver, ResolveType::kFulfill), + CreateFunction(script_state, resolver, ResolveType::kReject)); + return resolver->Promise(); + } + + NavigateReaction(ScriptState* script_state, + ScriptPromiseResolver* resolver, + ResolveType type) + : ScriptFunction(script_state), + window_(LocalDOMWindow::From(script_state)), + resolver_(resolver), + type_(type) {} + + void Trace(Visitor* visitor) const final { + ScriptFunction::Trace(visitor); + visitor->Trace(window_); + visitor->Trace(resolver_); + } + + private: + static v8::Local<v8::Function> CreateFunction(ScriptState* script_state, + ScriptPromiseResolver* resolver, + ResolveType type) { + return MakeGarbageCollected<NavigateReaction>(script_state, resolver, type) + ->BindToV8Function(); + } + + Event* InitEvent(ScriptValue value) const { + if (type_ == ResolveType::kFulfill) + return Event::Create(event_type_names::kNavigatesuccess); + + auto* isolate = window_->GetIsolate(); + v8::Local<v8::Message> message = + v8::Exception::CreateMessage(isolate, value.V8Value()); + std::unique_ptr<SourceLocation> location = + SourceLocation::FromMessage(isolate, message, window_); + ErrorEvent* event = ErrorEvent::Create( + ToCoreStringWithNullCheck(message->Get()), std::move(location), value, + &DOMWrapperWorld::MainWorld()); + event->SetType(event_type_names::kNavigateerror); + return event; + } + + ScriptValue Call(ScriptValue value) final { + DCHECK(window_); + AppHistory::appHistory(*window_)->DispatchEvent(*InitEvent(value)); + if (type_ == ResolveType::kFulfill) + resolver_->Resolve(value); + else + resolver_->Reject(value); + window_ = nullptr; + return ScriptValue(); + } + + Member<LocalDOMWindow> window_; + Member<ScriptPromiseResolver> resolver_; + ResolveType type_; +}; + +} // namespace + const char AppHistory::kSupplementName[] = "AppHistory"; AppHistory* AppHistory::appHistory(LocalDOMWindow& window) { @@ -146,6 +219,12 @@ FrameLoadRequest request(GetSupplementable(), ResourceRequest(completed_url)); request.SetClientRedirectReason(ClientNavigationReason::kFrameNavigation); GetSupplementable()->GetFrame()->Navigate(request, frame_load_type); + if (navigate_method_call_promise_.IsEmpty()) { + return ScriptPromise::RejectWithDOMException( + script_state, + MakeGarbageCollected<DOMException>(DOMExceptionCode::kAbortError, + "Navigation was aborted")); + } return navigate_method_call_promise_; } @@ -190,20 +269,39 @@ auto* navigate_event = AppHistoryNavigateEvent::Create( GetSupplementable(), event_type_names::kNavigate, init); navigate_event->SetUrl(url); - navigate_event->SetFrameLoadType(type); - navigate_event->SetStateObject(state_object); - auto result = navigate_event->Fire(this, event_type); - navigate_method_call_promise_ = result.promise; - return result.should_proceed; -} + DispatchEvent(*navigate_event); + ScriptPromise promise = navigate_event->GetNavigationActionPromise(); + if (!GetSupplementable()->GetFrame()) + return false; + if (navigate_event->defaultPrevented() && promise.IsEmpty()) + return false; -ScriptPromise AppHistory::GetUnresolvingPromise(ScriptState* script_state) { - if (!hung_promise_resolver_) { - hung_promise_resolver_ = - MakeGarbageCollected<ScriptPromiseResolver>(script_state); + auto* script_state = + ToScriptStateForMainWorld(GetSupplementable()->GetFrame()); + ScriptState::Scope scope(script_state); + if (promise.IsEmpty()) { + // Default promises for when respondWith() isn't invoked. Use a promise + // that never resolves for a cross-document navigation (because the context + // will be discarded before the promise resolves), and a resolved promise + // for a same-document navigation since it will complete synchronously. + if (event_type == NavigateEventType::kCrossDocument) { + if (!hung_promise_resolver_) { + hung_promise_resolver_ = + MakeGarbageCollected<ScriptPromiseResolver>(script_state); + } + promise = hung_promise_resolver_->Promise(); + } else { + promise = ScriptPromise::CastUndefined(script_state); + } + } else { + DocumentLoader* loader = GetSupplementable()->document()->Loader(); + loader->RunURLAndHistoryUpdateSteps(url, state_object, type); } - return hung_promise_resolver_->Promise(); + + navigate_method_call_promise_ = + NavigateReaction::React(script_state, promise); + return !navigate_event->defaultPrevented(); } const AtomicString& AppHistory::InterfaceName() const {
diff --git a/third_party/blink/renderer/core/app_history/app_history.h b/third_party/blink/renderer/core/app_history/app_history.h index 0bb6748..d1036547 100644 --- a/third_party/blink/renderer/core/app_history/app_history.h +++ b/third_party/blink/renderer/core/app_history/app_history.h
@@ -70,8 +70,6 @@ UserNavigationInvolvement, SerializedScriptValue* = nullptr); - ScriptPromise GetUnresolvingPromise(ScriptState*); - // EventTargetWithInlineData overrides: const AtomicString& InterfaceName() const final; ExecutionContext* GetExecutionContext() const final {
diff --git a/third_party/blink/renderer/core/app_history/app_history_navigate_event.cc b/third_party/blink/renderer/core/app_history/app_history_navigate_event.cc index 669d8a8..af0af0f8 100644 --- a/third_party/blink/renderer/core/app_history/app_history_navigate_event.cc +++ b/third_party/blink/renderer/core/app_history/app_history_navigate_event.cc
@@ -4,90 +4,15 @@ #include "third_party/blink/renderer/core/app_history/app_history_navigate_event.h" -#include "third_party/blink/renderer/bindings/core/v8/script_function.h" -#include "third_party/blink/renderer/core/app_history/app_history.h" #include "third_party/blink/renderer/core/app_history/app_history_navigate_event_init.h" #include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/event_interface_names.h" #include "third_party/blink/renderer/core/event_type_names.h" -#include "third_party/blink/renderer/core/events/error_event.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/html/forms/form_data.h" -#include "third_party/blink/renderer/core/loader/document_loader.h" namespace blink { -namespace { - -class NavigateReaction final : public ScriptFunction { - public: - enum class ResolveType { - kFulfill, - kReject, - }; - static ScriptPromise React(ScriptState* script_state, ScriptPromise promise) { - auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); - promise.Then(CreateFunction(script_state, resolver, ResolveType::kFulfill), - CreateFunction(script_state, resolver, ResolveType::kReject)); - return resolver->Promise(); - } - - NavigateReaction(ScriptState* script_state, - ScriptPromiseResolver* resolver, - ResolveType type) - : ScriptFunction(script_state), - window_(LocalDOMWindow::From(script_state)), - resolver_(resolver), - type_(type) {} - - void Trace(Visitor* visitor) const final { - ScriptFunction::Trace(visitor); - visitor->Trace(window_); - visitor->Trace(resolver_); - } - - private: - static v8::Local<v8::Function> CreateFunction(ScriptState* script_state, - ScriptPromiseResolver* resolver, - ResolveType type) { - return MakeGarbageCollected<NavigateReaction>(script_state, resolver, type) - ->BindToV8Function(); - } - - Event* InitEvent(ScriptValue value) const { - if (type_ == ResolveType::kFulfill) - return Event::Create(event_type_names::kNavigatesuccess); - - auto* isolate = window_->GetIsolate(); - v8::Local<v8::Message> message = - v8::Exception::CreateMessage(isolate, value.V8Value()); - std::unique_ptr<SourceLocation> location = - SourceLocation::FromMessage(isolate, message, window_); - ErrorEvent* event = ErrorEvent::Create( - ToCoreStringWithNullCheck(message->Get()), std::move(location), value, - &DOMWrapperWorld::MainWorld()); - event->SetType(event_type_names::kNavigateerror); - return event; - } - - ScriptValue Call(ScriptValue value) final { - DCHECK(window_); - AppHistory::appHistory(*window_)->DispatchEvent(*InitEvent(value)); - if (type_ == ResolveType::kFulfill) - resolver_->Resolve(value); - else - resolver_->Reject(value); - window_ = nullptr; - return ScriptValue(); - } - - Member<LocalDOMWindow> window_; - Member<ScriptPromiseResolver> resolver_; - ResolveType type_; -}; - -} // namespace - AppHistoryNavigateEvent::AppHistoryNavigateEvent( ExecutionContext* context, const AtomicString& type, @@ -102,45 +27,6 @@ DCHECK(IsA<LocalDOMWindow>(context)); } -AppHistoryNavigateEvent::FireResult AppHistoryNavigateEvent::Fire( - AppHistory* app_history, - NavigateEventType event_type) { - auto* script_state = ToScriptStateForMainWorld(DomWindow()->GetFrame()); - ScriptState::Scope scope(script_state); - app_history->DispatchEvent(*this); - if (!DomWindow() || (defaultPrevented() && completion_promise_.IsEmpty())) { - return FireResult(false, - ScriptPromise::RejectWithDOMException( - script_state, MakeGarbageCollected<DOMException>( - DOMExceptionCode::kAbortError, - "Navigation was aborted"))); - } - - // If completion_promise_ is set, we will fire navigatesuccess/navigateerror - // when completion_promise_ resolves/rejects: - // * If respondWith() was called, completion_promise_ is already initialized - // with a JS-provided promise. Wait for that promise to resolve. - // * If this is a same-document navigation, this navigation is being handled - // by the browser, and will complete synchronously. Set completion_promise_ - // to a resolved promise, which will cause navigatesuccess to fire on the - // next microtask. - // * Otherwise, this is a standard cross-document navigation. Don't fire any - // completion event, because any event handlers will be disconnected by the - // time the navigation has completed, so there's no way to listen for the - // completion event. - - bool is_respond_with = !completion_promise_.IsEmpty(); - if (!is_respond_with) { - if (event_type == NavigateEventType::kCrossDocument) - completion_promise_ = app_history->GetUnresolvingPromise(script_state); - else - completion_promise_ = ScriptPromise::CastUndefined(script_state); - } - - return FireResult(!is_respond_with, - NavigateReaction::React(script_state, completion_promise_)); -} - void AppHistoryNavigateEvent::respondWith(ScriptState* script_state, ScriptPromise newNavigationAction, ExceptionState& exception_state) { @@ -175,10 +61,7 @@ } preventDefault(); - completion_promise_ = newNavigationAction; - - DocumentLoader* loader = DomWindow()->document()->Loader(); - loader->RunURLAndHistoryUpdateSteps(url_, state_object_, frame_load_type_); + navigation_action_promise_ = newNavigationAction; } const AtomicString& AppHistoryNavigateEvent::InterfaceName() const { @@ -190,7 +73,7 @@ ExecutionContextClient::Trace(visitor); visitor->Trace(form_data_); visitor->Trace(info_); - visitor->Trace(completion_promise_); + visitor->Trace(navigation_action_promise_); } } // namespace blink
diff --git a/third_party/blink/renderer/core/app_history/app_history_navigate_event.h b/third_party/blink/renderer/core/app_history/app_history_navigate_event.h index 478b5e3..2dd2830 100644 --- a/third_party/blink/renderer/core/app_history/app_history_navigate_event.h +++ b/third_party/blink/renderer/core/app_history/app_history_navigate_event.h
@@ -38,20 +38,7 @@ const AtomicString& type, AppHistoryNavigateEventInit* init); - struct FireResult { - STACK_ALLOCATED(); - - public: - FireResult(bool proceed, ScriptPromise p) - : should_proceed(proceed), promise(p) {} - bool should_proceed; - ScriptPromise promise; - }; - FireResult Fire(AppHistory*, NavigateEventType); - void SetUrl(const KURL& url) { url_ = url; } - void SetFrameLoadType(WebFrameLoadType type) { frame_load_type_ = type; } - void SetStateObject(SerializedScriptValue* state) { state_object_ = state; } bool canRespond() const { return can_respond_; } bool userInitiated() const { return user_initiated_; } @@ -63,7 +50,9 @@ ScriptPromise newNavigationAction, ExceptionState&); - ScriptPromise GetCompletionPromise() { return completion_promise_; } + ScriptPromise GetNavigationActionPromise() { + return navigation_action_promise_; + } const AtomicString& InterfaceName() const final; void Trace(Visitor*) const final; @@ -76,9 +65,7 @@ ScriptValue info_; KURL url_; - WebFrameLoadType frame_load_type_ = WebFrameLoadType::kStandard; - scoped_refptr<SerializedScriptValue> state_object_; - ScriptPromise completion_promise_; + ScriptPromise navigation_action_promise_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/css/invalidation/pending_invalidations.cc b/third_party/blink/renderer/core/css/invalidation/pending_invalidations.cc index 992cc17..b8d4534 100644 --- a/third_party/blink/renderer/core/css/invalidation/pending_invalidations.cc +++ b/third_party/blink/renderer/core/css/invalidation/pending_invalidations.cc
@@ -52,7 +52,7 @@ } // No need to schedule descendant invalidations on display:none elements. if (requires_descendant_invalidation && !node.GetComputedStyle() && - node.CanParticipateInFlatTree()) { + !node.IsShadowRoot()) { requires_descendant_invalidation = false; } }
diff --git a/third_party/blink/renderer/core/css/resolver/filter_operation_resolver.cc b/third_party/blink/renderer/core/css/resolver/filter_operation_resolver.cc index 078c500c..8ffd927 100644 --- a/third_party/blink/renderer/core/css/resolver/filter_operation_resolver.cc +++ b/third_party/blink/renderer/core/css/resolver/filter_operation_resolver.cc
@@ -100,6 +100,9 @@ case FilterOperation::HUE_ROTATE: feature = WebFeature::kCSSFilterHueRotate; break; + case FilterOperation::LUMINANCE_TO_ALPHA: + feature = WebFeature::kCSSFilterLuminanceToAlpha; + break; case FilterOperation::COLOR_MATRIX: feature = WebFeature::kCSSFilterColorMatrix; break;
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index 1762a7d7..65d8406d 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -3012,7 +3012,7 @@ if (ignore_opens_and_writes_for_abort_) return; - // If this document is fully active, then run the URL and history update steps + // If this document is fully active, then update the URL // for this document with the entered window's url. if (dom_window_ && entered_window) { KURL new_url = entered_window->Url(); @@ -3021,11 +3021,8 @@ if (dom_window_ != entered_window) new_url.SetFragmentIdentifier(String()); SetURL(new_url); - - auto* state_object = Loader()->GetHistoryItem() - ? Loader()->GetHistoryItem()->StateObject() - : nullptr; - Loader()->RunURLAndHistoryUpdateSteps(new_url, state_object); + if (Loader()) + Loader()->UpdateUrlForDocumentOpen(new_url); if (dom_window_ != entered_window) { // We inherit the sandbox flags of the entered document, so mask on
diff --git a/third_party/blink/renderer/core/dom/flat_tree_traversal.h b/third_party/blink/renderer/core/dom/flat_tree_traversal.h index 3b86b395..bb1d8b4 100644 --- a/third_party/blink/renderer/core/dom/flat_tree_traversal.h +++ b/third_party/blink/renderer/core/dom/flat_tree_traversal.h
@@ -170,7 +170,7 @@ static void AssertPrecondition(const Node& node) { DCHECK(!node.GetDocument().IsFlatTreeTraversalForbidden()); - DCHECK(node.CanParticipateInFlatTree()); + DCHECK(!node.IsShadowRoot()); } static void AssertPostcondition(const Node* node) {
diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc index 662fa19c..5025ab75 100644 --- a/third_party/blink/renderer/core/dom/node.cc +++ b/third_party/blink/renderer/core/dom/node.cc
@@ -1386,7 +1386,8 @@ } bool Node::IsInert() const { - if (!isConnected() || !CanParticipateInFlatTree()) + DCHECK(!IsShadowRoot()); + if (!isConnected()) return true; if (this != GetDocument() && this != GetDocument().documentElement()) { @@ -1717,11 +1718,6 @@ this_element->namespaceURI() == mathml_names::kNamespaceURI); } -bool Node::CanParticipateInFlatTree() const { - // TODO(hayato): Return false for pseudo elements. - return !IsShadowRoot(); -} - bool Node::IsActiveSlot() const { return ToHTMLSlotElementIfSupportsAssignmentOrNull(*this); }
diff --git a/third_party/blink/renderer/core/dom/node.h b/third_party/blink/renderer/core/dom/node.h index 0a28ff9..7f4b4cd 100644 --- a/third_party/blink/renderer/core/dom/node.h +++ b/third_party/blink/renderer/core/dom/node.h
@@ -359,7 +359,6 @@ bool IsTreeScope() const; bool IsShadowRoot() const { return IsDocumentFragment() && IsTreeScope(); } - bool CanParticipateInFlatTree() const; bool IsActiveSlot() const; bool IsSlotable() const { return IsTextNode() || IsElementNode(); } AtomicString SlotName() const;
diff --git a/third_party/blink/renderer/core/editing/position.cc b/third_party/blink/renderer/core/editing/position.cc index ccdfb73..c5404220f6 100644 --- a/third_party/blink/renderer/core/editing/position.cc +++ b/third_party/blink/renderer/core/editing/position.cc
@@ -45,7 +45,7 @@ template <> bool CanBeAnchorNode<EditingInFlatTreeStrategy>(Node* node) { return CanBeAnchorNode<EditingStrategy>(node) && - (!node || node->CanParticipateInFlatTree()); + (!node || !node->IsShadowRoot()); } #endif @@ -586,7 +586,6 @@ if (pos.IsOffsetInAnchor()) { if (anchor->IsCharacterDataNode()) return PositionInFlatTree(anchor, pos.ComputeOffsetInContainerNode()); - DCHECK(!anchor->IsElementNode() || anchor->CanParticipateInFlatTree()); int offset = pos.ComputeOffsetInContainerNode(); if (!offset) { Node* node = anchor->IsShadowRoot() ? anchor->OwnerShadowHost() : anchor; @@ -597,7 +596,7 @@ Node* node = anchor->IsShadowRoot() ? anchor->OwnerShadowHost() : anchor; return PositionInFlatTree::LastPositionInNode(*node); } - if (!child->CanParticipateInFlatTree()) { + if (child->IsShadowRoot()) { if (anchor->IsShadowRoot()) return PositionInFlatTree(anchor->OwnerShadowHost(), offset); return PositionInFlatTree(anchor, offset); @@ -615,7 +614,6 @@ if (anchor->IsShadowRoot()) return PositionInFlatTree(anchor->OwnerShadowHost(), pos.AnchorType()); - DCHECK(anchor->CanParticipateInFlatTree()); if (pos.IsBeforeAnchor() || pos.IsAfterAnchor()) { if (!FlatTreeTraversal::Parent(*anchor)) { // For Before/AfterAnchor, if |anchor| doesn't have parent in the flat
diff --git a/third_party/blink/renderer/core/execution_context/execution_context.h b/third_party/blink/renderer/core/execution_context/execution_context.h index 21a2d37..87d68ec 100644 --- a/third_party/blink/renderer/core/execution_context/execution_context.h +++ b/third_party/blink/renderer/core/execution_context/execution_context.h
@@ -74,6 +74,7 @@ namespace blink { class Agent; +class AuditsIssue; class ConsoleMessage; class ContentSecurityPolicy; class ContentSecurityPolicyDelegate; @@ -246,6 +247,7 @@ AddConsoleMessageImpl(message, discard_duplicates); } virtual void AddInspectorIssue(mojom::blink::InspectorIssueInfoPtr) = 0; + virtual void AddInspectorIssue(AuditsIssue) = 0; bool IsContextPaused() const; WebURLLoader::DeferType DeferType() const;
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc index e274150..c02bf531 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -102,6 +102,8 @@ #include "third_party/blink/renderer/core/html/plugin_document.h" #include "third_party/blink/renderer/core/input/event_handler.h" #include "third_party/blink/renderer/core/inspector/console_message.h" +#include "third_party/blink/renderer/core/inspector/inspector_audits_issue.h" +#include "third_party/blink/renderer/core/inspector/inspector_issue_storage.h" #include "third_party/blink/renderer/core/inspector/inspector_trace_events.h" #include "third_party/blink/renderer/core/inspector/main_thread_debugger.h" #include "third_party/blink/renderer/core/layout/adjust_for_absolute_zoom.h" @@ -574,7 +576,15 @@ void LocalDOMWindow::AddInspectorIssue( mojom::blink::InspectorIssueInfoPtr info) { if (GetFrame()) { - GetFrame()->AddInspectorIssue(std::move(info)); + GetFrame()->GetPage()->GetInspectorIssueStorage().AddInspectorIssue( + this, std::move(info)); + } +} + +void LocalDOMWindow::AddInspectorIssue(AuditsIssue issue) { + if (GetFrame()) { + GetFrame()->GetPage()->GetInspectorIssueStorage().AddInspectorIssue( + this, std::move(issue)); } } @@ -1979,7 +1989,8 @@ return nullptr; } - WebWindowFeatures window_features = GetWindowFeaturesFromString(features); + WebWindowFeatures window_features = + GetWindowFeaturesFromString(features, incumbent_window); FrameLoadRequest frame_request(incumbent_window, ResourceRequest(completed_url)); @@ -2003,6 +2014,10 @@ frame_request.GetResourceRequest().SetHasUserGesture(has_user_gesture); GetFrame()->MaybeLogAdClickNavigation(); + if (has_user_gesture && window_features.impression) { + frame_request.SetImpression(*window_features.impression); + } + FrameTree::FindResult result = GetFrame()->Tree().FindOrCreateFrameForNavigation( frame_request, target.IsEmpty() ? "_blank" : target);
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.h b/third_party/blink/renderer/core/frame/local_dom_window.h index 0ff09aa1..caba4a42 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.h +++ b/third_party/blink/renderer/core/frame/local_dom_window.h
@@ -157,6 +157,7 @@ bool CanExecuteScripts(ReasonForCallingCanExecuteScripts) final; void ExceptionThrown(ErrorEvent*) final; void AddInspectorIssue(mojom::blink::InspectorIssueInfoPtr) final; + void AddInspectorIssue(AuditsIssue) final; EventTarget* ErrorEventTarget() final { return this; } String OutgoingReferrer() const final; CoreProbeSink* GetProbeSink() final;
diff --git a/third_party/blink/renderer/core/fullscreen/fullscreen.cc b/third_party/blink/renderer/core/fullscreen/fullscreen.cc index bd3ca9b..7360bbee 100644 --- a/third_party/blink/renderer/core/fullscreen/fullscreen.cc +++ b/third_party/blink/renderer/core/fullscreen/fullscreen.cc
@@ -283,16 +283,25 @@ // // The current implementation of WebXR's "dom-overlay" mode internally uses // the Fullscreen API to show a single DOM element based on configuration at - // XR session start. The WebXR API doesn't support changing elements during - // the session, so to avoid inconsistencies between implementations we need - // to block changes via Fullscreen API while the XR session is active, while - // still allowing the XR code to set up fullscreen mode on session start. + // XR session start. In addition, for WebXR sessions without "dom-overlay" + // the renderer may need to force the page to fullscreen to ensure that + // browser UI hides/responds accordingly. In either case, requesting a WebXR + // Session does require a user gesture, but it has likely expired by the time + // the renderer actually gets the XR session from the device and attempts + // to fullscreen the page. if (ScopedAllowFullscreen::FullscreenAllowedReason() == - ScopedAllowFullscreen::kXrOverlay) { - DVLOG(1) << __func__ - << ": allowing fullscreen element setup for XR DOM overlay"; + ScopedAllowFullscreen::kXrOverlay || + ScopedAllowFullscreen::FullscreenAllowedReason() == + ScopedAllowFullscreen::kXrSession) { + DVLOG(1) << __func__ << ": allowing fullscreen element setup for XR"; return true; } + + // The WebXR API doesn't support changing elements during the session if the + // dom-overlay feature is in use (indicated by the IsXrOverlay property). To + // avoid inconsistencies between implementations we need to block changes via + // Fullscreen API while the XR session is active, while still allowing the XR + // code to set up fullscreen mode on session start. if (document.IsXrOverlay()) { DVLOG(1) << __func__ << ": rejecting change of fullscreen element for XR DOM overlay";
diff --git a/third_party/blink/renderer/core/fullscreen/scoped_allow_fullscreen.h b/third_party/blink/renderer/core/fullscreen/scoped_allow_fullscreen.h index fb2b80f..caf1056 100644 --- a/third_party/blink/renderer/core/fullscreen/scoped_allow_fullscreen.h +++ b/third_party/blink/renderer/core/fullscreen/scoped_allow_fullscreen.h
@@ -16,7 +16,7 @@ STACK_ALLOCATED(); public: - enum Reason { kOrientationChange, kXrOverlay }; + enum Reason { kOrientationChange, kXrOverlay, kXrSession }; static base::Optional<Reason> FullscreenAllowedReason(); explicit ScopedAllowFullscreen(Reason);
diff --git a/third_party/blink/renderer/core/html/conversion_measurement_parsing.cc b/third_party/blink/renderer/core/html/conversion_measurement_parsing.cc index 2b79ded..399a603 100644 --- a/third_party/blink/renderer/core/html/conversion_measurement_parsing.cc +++ b/third_party/blink/renderer/core/html/conversion_measurement_parsing.cc
@@ -25,6 +25,12 @@ namespace { +base::Optional<uint64_t> ParseExpiry(const String& expiry) { + bool expiry_is_valid = false; + uint64_t parsed_expiry = expiry.ToUInt64Strict(&expiry_is_valid); + return expiry_is_valid ? base::make_optional(parsed_expiry) : base::nullopt; +} + base::Optional<WebImpression> GetImpression( ExecutionContext* execution_context, const String& impression_data_string, @@ -149,13 +155,9 @@ HTMLAnchorElement* element) { base::Optional<uint64_t> expiry; if (element->hasAttribute(html_names::kImpressionexpiryAttr)) { - bool expiry_is_valid = false; - uint64_t expiry_milliseconds = - element->FastGetAttribute(html_names::kImpressionexpiryAttr) - .GetString() - .ToUInt64Strict(&expiry_is_valid); - if (expiry_is_valid) - expiry = expiry_milliseconds; + expiry = + ParseExpiry(element->FastGetAttribute(html_names::kImpressionexpiryAttr) + .GetString()); } DCHECK(element->hasAttribute(html_names::kConversiondestinationAttr)); @@ -174,6 +176,23 @@ expiry, element); } +base::Optional<WebImpression> GetImpressionFromWindowFeatures( + ExecutionContext* execution_context, + const ImpressionFeatures& features) { + if (features.impression_data.IsNull() || + features.conversion_destination.IsNull()) + return base::nullopt; + + return GetImpression( + execution_context, features.impression_data, + features.conversion_destination, + !features.reporting_origin.IsNull() + ? base::make_optional(features.reporting_origin) + : base::nullopt, + !features.expiry.IsNull() ? ParseExpiry(features.expiry) : base::nullopt, + nullptr); +} + base::Optional<WebImpression> GetImpressionForParams( ExecutionContext* execution_context, const ImpressionParams* params) {
diff --git a/third_party/blink/renderer/core/html/conversion_measurement_parsing.h b/third_party/blink/renderer/core/html/conversion_measurement_parsing.h index 82e4c04..052ff20 100644 --- a/third_party/blink/renderer/core/html/conversion_measurement_parsing.h +++ b/third_party/blink/renderer/core/html/conversion_measurement_parsing.h
@@ -18,12 +18,27 @@ class HTMLAnchorElement; class ImpressionParams; +// Dummy struct to pass un-parsed Attribution Reporting window features into the +// parsing utilities below. +struct ImpressionFeatures { + String impression_data; + String conversion_destination; + String reporting_origin; + String expiry; +}; + // Returns the WebImpression struct with all data declared by impression // related attributes on |element|. If the impression attributes do not contain // allowed values, base::nullopt is returned. base::Optional<WebImpression> GetImpressionForAnchor( HTMLAnchorElement* element); +// Same as GetImpressionForAnchor(), but gets an impression specified by the +// features string associated with a window.open call. +base::Optional<WebImpression> GetImpressionFromWindowFeatures( + ExecutionContext* execution_context, + const ImpressionFeatures& features); + // Same as GetImpressionForAnchor(), but gets an impression specified by an // ImpressionParams dictionary associated with a window.open call. base::Optional<WebImpression> GetImpressionForParams(
diff --git a/third_party/blink/renderer/core/html/html_slot_element.idl b/third_party/blink/renderer/core/html/html_slot_element.idl index 1185b83..69984e5 100644 --- a/third_party/blink/renderer/core/html/html_slot_element.idl +++ b/third_party/blink/renderer/core/html/html_slot_element.idl
@@ -32,5 +32,5 @@ [CEReactions, Reflect] attribute DOMString name; [ImplementedAs=AssignedNodesForBinding] sequence<Node> assignedNodes(optional AssignedNodesOptions options = {}); [ImplementedAs=AssignedElementsForBinding] sequence<Element> assignedElements(optional AssignedNodesOptions options = {}); - [RuntimeEnabled=ManualSlotting, RaisesException] void assign(sequence<Node> nodes); + [RuntimeEnabled=ManualSlotting, RaisesException] void assign(Node... nodes); };
diff --git a/third_party/blink/renderer/core/html/media/html_media_element_test.cc b/third_party/blink/renderer/core/html/media/html_media_element_test.cc index 1b034ab..6c563fce 100644 --- a/third_party/blink/renderer/core/html/media/html_media_element_test.cc +++ b/third_party/blink/renderer/core/html/media/html_media_element_test.cc
@@ -762,6 +762,7 @@ } TEST_P(HTMLMediaElementTest, GcMarkingNoAllocWebTimeRanges) { + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; auto* thread_state = ThreadState::Current(); ThreadState::NoAllocationScope no_allocation_scope(thread_state); EXPECT_FALSE(thread_state->IsAllocationAllowed());
diff --git a/third_party/blink/renderer/core/html/media/html_video_element.cc b/third_party/blink/renderer/core/html/media/html_video_element.cc index c24e792..25641f9 100644 --- a/third_party/blink/renderer/core/html/media/html_video_element.cc +++ b/third_party/blink/renderer/core/html/media/html_video_element.cc
@@ -553,7 +553,8 @@ /*allow_zero_copy_images=*/true, resource_provider_.get(), video_renderer, dest_rect); - image->SetOriginClean(!WouldTaintOrigin()); + if (image) + image->SetOriginClean(!WouldTaintOrigin()); return image; }
diff --git a/third_party/blink/renderer/core/inspector/build.gni b/third_party/blink/renderer/core/inspector/build.gni index 9ecad69..b243c88b 100644 --- a/third_party/blink/renderer/core/inspector/build.gni +++ b/third_party/blink/renderer/core/inspector/build.gni
@@ -34,6 +34,8 @@ "inspector_attribution_issue.h", "inspector_audits_agent.cc", "inspector_audits_agent.h", + "inspector_audits_issue.cc", + "inspector_audits_issue.h", "inspector_base_agent.h", "inspector_css_agent.cc", "inspector_css_agent.h",
diff --git a/third_party/blink/renderer/core/inspector/inspector_audits_issue.cc b/third_party/blink/renderer/core/inspector/inspector_audits_issue.cc new file mode 100644 index 0000000..18866ee --- /dev/null +++ b/third_party/blink/renderer/core/inspector/inspector_audits_issue.cc
@@ -0,0 +1,19 @@ +// 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. + +#include "third_party/blink/renderer/core/inspector/inspector_audits_issue.h" + +#include "third_party/blink/renderer/core/inspector/protocol/Audits.h" + +namespace blink { + +AuditsIssue::AuditsIssue( + std::unique_ptr<protocol::Audits::InspectorIssue> issue) + : issue_(std::move(issue)) {} + +AuditsIssue::AuditsIssue(AuditsIssue&&) = default; +AuditsIssue& AuditsIssue::operator=(AuditsIssue&&) = default; +AuditsIssue::~AuditsIssue() = default; + +} // namespace blink
diff --git a/third_party/blink/renderer/core/inspector/inspector_audits_issue.h b/third_party/blink/renderer/core/inspector/inspector_audits_issue.h new file mode 100644 index 0000000..d05f563d --- /dev/null +++ b/third_party/blink/renderer/core/inspector/inspector_audits_issue.h
@@ -0,0 +1,55 @@ +// 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. + +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_INSPECTOR_AUDITS_ISSUE_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_INSPECTOR_AUDITS_ISSUE_H_ + +#include <memory> +#include "third_party/blink/renderer/core/core_export.h" + +namespace blink { + +namespace protocol { +namespace Audits { +class InspectorIssue; +} +} // namespace protocol + +// |AuditsIssue| is a thin wrapper around the Audits::InspectorIssue +// protocol class. +// +// There are a few motiviations for this class: +// 1) Prevent leakage of auto-generated CDP resources into the +// rest of blink. +// 2) Control who can assemble Audits::InspectorIssue's as this should +// happen |inspector| land. +// 3) Prevent re-compilation of various blink classes when the protocol +// changes. The protocol type can be forward declared in header files, +// but for the std::unique_ptr, the generated |Audits.h| header +// would have to be included in various cc files. +class CORE_EXPORT AuditsIssue { + public: + AuditsIssue() = delete; + AuditsIssue(const AuditsIssue&) = delete; + AuditsIssue& operator=(const AuditsIssue&) = delete; + + AuditsIssue(AuditsIssue&&); + AuditsIssue& operator=(AuditsIssue&&); + + const protocol::Audits::InspectorIssue* issue() const { return issue_.get(); } + std::unique_ptr<protocol::Audits::InspectorIssue> TakeIssue() { + return std::move(issue_); + } + + ~AuditsIssue(); + + private: + explicit AuditsIssue(std::unique_ptr<protocol::Audits::InspectorIssue> issue); + + std::unique_ptr<protocol::Audits::InspectorIssue> issue_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_INSPECTOR_AUDITS_ISSUE_H_
diff --git a/third_party/blink/renderer/core/inspector/inspector_issue_storage.cc b/third_party/blink/renderer/core/inspector/inspector_issue_storage.cc index 692d8f4..3543be8 100644 --- a/third_party/blink/renderer/core/inspector/inspector_issue_storage.cc +++ b/third_party/blink/renderer/core/inspector/inspector_issue_storage.cc
@@ -4,8 +4,10 @@ #include "third_party/blink/renderer/core/inspector/inspector_issue_storage.h" +#include "third_party/blink/renderer/core/inspector/inspector_audits_issue.h" #include "third_party/blink/renderer/core/inspector/inspector_issue.h" #include "third_party/blink/renderer/core/inspector/inspector_issue_conversion.h" +#include "third_party/blink/renderer/core/inspector/protocol/Audits.h" #include "third_party/blink/renderer/core/probe/core_probes.h" namespace blink { @@ -13,6 +15,7 @@ static const unsigned kMaxIssueCount = 1000; InspectorIssueStorage::InspectorIssueStorage() = default; +InspectorIssueStorage::~InspectorIssueStorage() = default; void InspectorIssueStorage::AddInspectorIssue( CoreProbeSink* sink, @@ -36,6 +39,16 @@ AddInspectorIssue(sink, InspectorIssue::Create(std::move(info))); } +void InspectorIssueStorage::AddInspectorIssue(CoreProbeSink* sink, + AuditsIssue issue) { + AddInspectorIssue(sink, issue.TakeIssue()); +} + +void InspectorIssueStorage::AddInspectorIssue(ExecutionContext* context, + AuditsIssue issue) { + AddInspectorIssue(probe::ToCoreProbeSink(context), issue.TakeIssue()); +} + void InspectorIssueStorage::AddInspectorIssue( ExecutionContext* context, mojom::blink::InspectorIssueInfoPtr info) {
diff --git a/third_party/blink/renderer/core/inspector/inspector_issue_storage.h b/third_party/blink/renderer/core/inspector/inspector_issue_storage.h index 33a4b74..80f996a 100644 --- a/third_party/blink/renderer/core/inspector/inspector_issue_storage.h +++ b/third_party/blink/renderer/core/inspector/inspector_issue_storage.h
@@ -8,36 +8,45 @@ #include "base/macros.h" #include "third_party/blink/public/mojom/devtools/inspector_issue.mojom-blink-forward.h" #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/inspector/protocol/Audits.h" #include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/wtf/forward.h" namespace blink { +class AuditsIssue; class CoreProbeSink; class InspectorIssue; class ExecutionContext; +namespace protocol { +namespace Audits { +class InspectorIssue; +} // namespace Audits +} // namespace protocol + class CORE_EXPORT InspectorIssueStorage : public GarbageCollected<InspectorIssueStorage> { public: InspectorIssueStorage(); - void AddInspectorIssue(CoreProbeSink*, - std::unique_ptr<protocol::Audits::InspectorIssue>); void AddInspectorIssue(CoreProbeSink*, InspectorIssue*); void AddInspectorIssue(CoreProbeSink*, mojom::blink::InspectorIssueInfoPtr); void AddInspectorIssue(ExecutionContext*, mojom::blink::InspectorIssueInfoPtr); + void AddInspectorIssue(ExecutionContext*, AuditsIssue); + void AddInspectorIssue(CoreProbeSink*, AuditsIssue); + void Clear(); size_t size() const; protocol::Audits::InspectorIssue* at(size_t index) const; void Trace(Visitor*) const; - virtual ~InspectorIssueStorage() = default; + virtual ~InspectorIssueStorage(); private: + void AddInspectorIssue(CoreProbeSink*, + std::unique_ptr<protocol::Audits::InspectorIssue>); Deque<std::unique_ptr<protocol::Audits::InspectorIssue>> issues_; DISALLOW_COPY_AND_ASSIGN(InspectorIssueStorage);
diff --git a/third_party/blink/renderer/core/layout/build.gni b/third_party/blink/renderer/core/layout/build.gni index 8772149..1f975e67 100644 --- a/third_party/blink/renderer/core/layout/build.gni +++ b/third_party/blink/renderer/core/layout/build.gni
@@ -510,6 +510,7 @@ "ng/ng_link.h", "ng/ng_out_of_flow_layout_part.cc", "ng/ng_out_of_flow_layout_part.h", + "ng/ng_out_of_flow_positioned_node.cc", "ng/ng_out_of_flow_positioned_node.h", "ng/ng_outline_type.h", "ng/ng_outline_utils.cc",
diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index 37732c0..db3e0872 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc
@@ -7699,11 +7699,19 @@ return VisualOverflowRect(); } +PhysicalRect LayoutBox::PhysicalVisualOverflowRectAllowingUnset() const { + NGInkOverflow::ReadUnsetAsNoneScope read_unset_as_none; + return PhysicalVisualOverflowRect(); +} + void LayoutBox::CheckIsVisualOverflowComputed() const { if (NGInkOverflow::ReadUnsetAsNoneScope::IsActive()) return; if (!CanUseFragmentsForVisualOverflow()) return; + // TODO(crbug.com/1203402): MathML needs some more work. + if (IsMathML()) + return; for (const NGPhysicalBoxFragment& fragment : PhysicalFragments()) DCHECK(fragment.IsInkOverflowComputed()); }
diff --git a/third_party/blink/renderer/core/layout/layout_box.h b/third_party/blink/renderer/core/layout/layout_box.h index 66031f6..aee56df 100644 --- a/third_party/blink/renderer/core/layout/layout_box.h +++ b/third_party/blink/renderer/core/layout/layout_box.h
@@ -609,14 +609,19 @@ NOT_DESTROYED(); return FlipForWritingMode(VisualOverflowRect()); } - // VisualOverflow has DCHECK for reading before it is computed. This function - // pretends there is no visual overflow when it is not computed. + // VisualOverflow has DCHECK for reading before it is computed. These + // functions pretend there is no visual overflow when it is not computed. + // TODO(crbug.com/1205708): Audit the usages and fix issues. #if DCHECK_IS_ON() LayoutRect VisualOverflowRectAllowingUnset() const; + PhysicalRect PhysicalVisualOverflowRectAllowingUnset() const; #else ALWAYS_INLINE LayoutRect VisualOverflowRectAllowingUnset() const { return VisualOverflowRect(); } + ALWAYS_INLINE PhysicalRect PhysicalVisualOverflowRectAllowingUnset() const { + return PhysicalVisualOverflowRect(); + } #endif LayoutUnit LogicalLeftVisualOverflow() const { NOT_DESTROYED();
diff --git a/third_party/blink/renderer/core/layout/layout_shift_tracker.cc b/third_party/blink/renderer/core/layout/layout_shift_tracker.cc index f077146..fd6539cbe 100644 --- a/third_party/blink/renderer/core/layout/layout_shift_tracker.cc +++ b/third_party/blink/renderer/core/layout/layout_shift_tracker.cc
@@ -190,7 +190,7 @@ return false; const auto& box = To<LayoutBox>(object); - if (SmallerThanRegionGranularity(box.VisualOverflowRect())) + if (SmallerThanRegionGranularity(box.VisualOverflowRectAllowingUnset())) return false; if (auto* display_lock_context = box.GetDisplayLockContext()) {
diff --git a/third_party/blink/renderer/core/layout/layout_view.cc b/third_party/blink/renderer/core/layout/layout_view.cc index 17688245d..140b919 100644 --- a/third_party/blink/renderer/core/layout/layout_view.cc +++ b/third_party/blink/renderer/core/layout/layout_view.cc
@@ -609,15 +609,8 @@ NOT_DESTROYED(); if (ShouldUsePrintingLayout()) return PhysicalRect(PhysicalOffset(), Size()); - if (frame_view_) { - IntRect view_rect(IntPoint(), frame_view_->Size()); - auto& frame = frame_view_->GetFrame(); - if (frame.IsMainFrame()) { - frame.GetChromeClient().OverrideVisibleRectForMainFrame(frame, - &view_rect); - } - return PhysicalRect(view_rect); - } + if (frame_view_) + return PhysicalRect(PhysicalOffset(), PhysicalSize(frame_view_->Size())); return PhysicalRect(); }
diff --git a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc index 6516b8c..50f1b71 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc
@@ -3026,7 +3026,7 @@ for (auto& out_of_flow_descendant : *out_of_flow_descendants) { GridItemData out_of_flow_item = - MeasureGridItem(out_of_flow_descendant.node); + MeasureGridItem(out_of_flow_descendant.Node()); out_of_flow_item.ComputeOutOfFlowItemPlacement(column_track_collection, grid_placement);
diff --git a/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.cc b/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.cc index 414bafab..f175d53 100644 --- a/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.cc +++ b/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.cc
@@ -355,7 +355,7 @@ // These are the unpositioned OOF descendants of the current OOF block. for (const auto& descendant : result->PhysicalFragment().OutOfFlowPositionedDescendants()) - descendant.node.InsertIntoLegacyPositionedObjects(); + descendant.Node().InsertIntoLegacyPositionedObjects(); const auto& fragment = result->PhysicalFragment(); DCHECK_GT(fragment.Children().size(), 0u); @@ -400,7 +400,7 @@ for (const auto& descendant : physical_fragment.OutOfFlowPositionedDescendants()) - descendant.node.InsertIntoLegacyPositionedObjects(); + descendant.Node().InsertIntoLegacyPositionedObjects(); // Even if we are a layout root, our baseline may have shifted. In this // (rare) case, mark our containing-block for layout.
diff --git a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc index 2f24ae8..a22e2cfe 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc
@@ -321,11 +321,24 @@ MinMaxSizesResult result = algorithm.ComputeMinMaxSizes(MinMaxSizesFloatInput()); - // If column-width is non-auto, pick the larger of that and intrinsic column - // width. + // How column-width affects min/max sizes is currently not defined in any + // spec, but there used to be a definition, which everyone still follows to + // some extent: + // https://www.w3.org/TR/2016/WD-css-sizing-3-20160510/#multicol-intrinsic + // + // GitHub issue for getting this back into some spec: + // https://github.com/w3c/csswg-drafts/issues/1742 if (!Style().HasAutoColumnWidth()) { - result.sizes.min_size = - std::max(result.sizes.min_size, LayoutUnit(Style().ColumnWidth())); + // One peculiarity in the (old and only) spec is that column-width may + // shrink min intrinsic inline-size to become less than what the contents + // require: + // + // "The min-content inline size of a multi-column element with a computed + // column-width not auto is the smaller of its column-width and the largest + // min-content inline-size contribution of its contents." + const LayoutUnit column_width(Style().ColumnWidth()); + result.sizes.min_size = std::min(result.sizes.min_size, column_width); + result.sizes.max_size = std::max(result.sizes.max_size, column_width); result.sizes.max_size = std::max(result.sizes.max_size, result.sizes.min_size); } @@ -334,10 +347,18 @@ // values. We typically have multiple columns and also gaps between them. int column_count = Style().ColumnCount(); DCHECK_GE(column_count, 1); - result.sizes.min_size *= column_count; - result.sizes.max_size *= column_count; LayoutUnit column_gap = ResolveUsedColumnGap(LayoutUnit(), Style()); - result.sizes += column_gap * (column_count - 1); + LayoutUnit gap_extra = column_gap * (column_count - 1); + + // Another peculiarity in the (old and only) spec (see above) is that + // column-count (and therefore also column-gap) is ignored in intrinsic min + // inline-size calculation, if column-width is specified. + if (Style().HasAutoColumnWidth()) { + result.sizes.min_size *= column_count; + result.sizes.min_size += gap_extra; + } + result.sizes.max_size *= column_count; + result.sizes.max_size += gap_extra; // The block layout algorithm skips spanners for min/max calculation (since // they shouldn't be part of the column-count multiplication above). Calculate
diff --git a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm_test.cc index 70b46d8..33b29c4c 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm_test.cc
@@ -2764,12 +2764,16 @@ NGColumnLayoutAlgorithm algorithm({node, fragment_geometry, space}); base::Optional<MinMaxSizes> sizes; - // Both column-count and column-width set. + // Both column-count and column-width set. See + // https://www.w3.org/TR/2016/WD-css-sizing-3-20160510/#multicol-intrinsic + // (which is the only thing resembling spec that we currently have); in + // particular, if column-width is non-auto, we ignore column-count for min + // inline-size, and also clamp it down to the specified column-width. style->SetColumnCount(3); style->SetColumnWidth(80); sizes = algorithm.ComputeMinMaxSizes(MinMaxSizesFloatInput()).sizes; ASSERT_TRUE(sizes.has_value()); - EXPECT_EQ(LayoutUnit(260), sizes->min_size); + EXPECT_EQ(LayoutUnit(50), sizes->min_size); EXPECT_EQ(LayoutUnit(320), sizes->max_size); // Only column-count set. @@ -2784,7 +2788,7 @@ style->SetHasAutoColumnCount(); sizes = algorithm.ComputeMinMaxSizes(MinMaxSizesFloatInput()).sizes; ASSERT_TRUE(sizes.has_value()); - EXPECT_EQ(LayoutUnit(80), sizes->min_size); + EXPECT_EQ(LayoutUnit(50), sizes->min_size); EXPECT_EQ(LayoutUnit(100), sizes->max_size); }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.cc b/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.cc index 885a8d1..c53226a 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_container_fragment_builder.cc
@@ -255,14 +255,15 @@ LogicalOffset additional_offset, const NGMulticolWithPendingOOFs<LogicalOffset>* multicol) { for (auto& candidate : oof_positioned_candidates_) { + NGBlockNode node = candidate.Node(); candidate.static_position.offset += additional_offset; if (multicol && multicol->fixedpos_containing_block.fragment && - candidate.node.Style().GetPosition() == EPosition::kFixed) { + node.Style().GetPosition() == EPosition::kFixed) { // A fixedpos containing block was found in |multicol|. Add the fixedpos // as a fragmentainer descendant instead. destination_builder->AddOutOfFlowFragmentainerDescendant( - {candidate.node, candidate.static_position, - candidate.inline_container, candidate.needs_block_offset_adjustment, + {node, candidate.static_position, candidate.inline_container, + candidate.needs_block_offset_adjustment, multicol->fixedpos_containing_block, multicol->fixedpos_containing_block}); continue; @@ -288,7 +289,7 @@ // This checks if the object creating this box will be the container for // the given descendant. if (!candidate.inline_container && - IsInlineContainerForNode(candidate.node, layout_object_)) + IsInlineContainerForNode(candidate.Node(), layout_object_)) candidate.inline_container = To<LayoutInline>(layout_object_); // Ensure that the inline_container is a continuation root. @@ -313,12 +314,13 @@ // Collect the child's out of flow descendants. const WritingModeConverter converter(GetWritingDirection(), fragment.Size()); for (const auto& descendant : fragment.OutOfFlowPositionedDescendants()) { + NGBlockNode node = descendant.Node(); NGLogicalStaticPosition static_position = - descendant.static_position.ConvertToLogical(converter); + descendant.StaticPosition().ConvertToLogical(converter); const LayoutInline* new_inline_container = descendant.inline_container; if (!new_inline_container && - IsInlineContainerForNode(descendant.node, inline_container)) + IsInlineContainerForNode(node, inline_container)) new_inline_container = inline_container; // If an OOF element is inside a fragmentation context, it will be laid out @@ -335,11 +337,11 @@ // provided. if ((fixedpos_containing_block || additional_fixedpos_offset != LogicalOffset()) && - descendant.node.Style().GetPosition() == EPosition::kFixed) { + node.Style().GetPosition() == EPosition::kFixed) { static_position.offset += additional_fixedpos_offset; if (fixedpos_containing_block && fixedpos_containing_block->fragment) { AddOutOfFlowFragmentainerDescendant( - {descendant.node, static_position, new_inline_container, + {node, static_position, new_inline_container, /* needs_block_offset_adjustment */ false, *fixedpos_containing_block, *fixedpos_containing_block}); continue; @@ -350,10 +352,10 @@ // |oof_positioned_candidates_| should not have duplicated entries. DCHECK(std::none_of( oof_positioned_candidates_.begin(), oof_positioned_candidates_.end(), - [&descendant](const NGLogicalOutOfFlowPositionedNode& node) { - return node.node == descendant.node; + [&node](const NGLogicalOutOfFlowPositionedNode& oof_node) { + return oof_node.Node() == node; })); - oof_positioned_candidates_.emplace_back(descendant.node, static_position, + oof_positioned_candidates_.emplace_back(node, static_position, new_inline_container); } @@ -477,9 +479,10 @@ const WritingModeConverter containing_block_converter( GetWritingDirection(), containing_block_fragment->Size()); NGLogicalStaticPosition static_position = - descendant.static_position.ConvertToLogical(containing_block_converter); + descendant.StaticPosition().ConvertToLogical( + containing_block_converter); AddOutOfFlowFragmentainerDescendant( - {descendant.node, static_position, descendant.inline_container, + {descendant.Node(), static_position, descendant.inline_container, /* needs_block_offset_adjustment */ false, NGContainingBlock<LogicalOffset>(containing_block_offset, containing_block_rel_offset,
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc index ace8497..c72ecc6b 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc
@@ -184,11 +184,11 @@ for (auto& candidate : candidates) { if (absolute_containing_block && absolute_containing_block->CanContainOutOfFlowPositionedElement( - candidate.node.Style().GetPosition())) { + candidate.Node().Style().GetPosition())) { candidate.inline_container = absolute_containing_block; } else if (fixed_containing_block && fixed_containing_block->CanContainOutOfFlowPositionedElement( - candidate.node.Style().GetPosition())) { + candidate.Node().Style().GetPosition())) { candidate.inline_container = fixed_containing_block; } container_builder_->AddOutOfFlowDescendant(candidate); @@ -354,7 +354,7 @@ .stored_value->value; } - return candidate.node.Style().GetPosition() == EPosition::kAbsolute + return candidate.Node().Style().GetPosition() == EPosition::kAbsolute ? default_containing_block_info_for_absolute_ : default_containing_block_info_for_fixed_; } @@ -509,7 +509,7 @@ while (candidates->size() > 0) { ComputeInlineContainingBlocks(*candidates); for (auto& candidate : *candidates) { - LayoutBox* layout_box = candidate.node.GetLayoutBox(); + LayoutBox* layout_box = candidate.box; if (!container_builder_->IsBlockFragmentationContextRoot()) SaveStaticPositionOnPaintLayer(layout_box, candidate.static_position); if (IsContainingBlockForCandidate(candidate) && @@ -522,7 +522,7 @@ continue; } if (layout_box != only_layout) - candidate.node.InsertIntoLegacyPositionedObjects(); + candidate.Node().InsertIntoLegacyPositionedObjects(); NodeInfo node_info = SetupNodeInfo(candidate); NodeToLayout node_to_layout = {node_info, CalculateOffset(node_info, only_layout)}; @@ -531,7 +531,7 @@ container_builder_->AddChild(result->PhysicalFragment(), result->OutOfFlowPositionedOffset(), candidate.inline_container); - placed_objects->insert(candidate.node.GetLayoutBox()); + placed_objects->insert(layout_box); } else { container_builder_->AddOutOfFlowDescendant(candidate); } @@ -689,11 +689,11 @@ const WritingModeConverter containing_block_converter( writing_direction, containing_block_fragment->Size()); NGLogicalStaticPosition static_position = - descendant.static_position.ConvertToLogical( + descendant.StaticPosition().ConvertToLogical( containing_block_converter); NGLogicalOutOfFlowPositionedNode node = { - descendant.node, + descendant.Node(), static_position, descendant.inline_container, /* needs_block_offset_adjustment */ false, @@ -824,7 +824,7 @@ NGOutOfFlowLayoutPart::NodeInfo NGOutOfFlowLayoutPart::SetupNodeInfo( const NGLogicalOutOfFlowPositionedNode& oof_node) { - NGBlockNode node = oof_node.node; + NGBlockNode node = oof_node.Node(); const NGPhysicalFragment* containing_block_fragment = oof_node.containing_block.fragment; @@ -1097,15 +1097,15 @@ if (container_builder_->IsFragmentainerBoxType()) return false; - EPosition position = candidate.node.Style().GetPosition(); + EPosition position = candidate.Node().Style().GetPosition(); // Candidates whose containing block is inline are always positioned inside // closest parent block flow. if (candidate.inline_container) { DCHECK(candidate.inline_container->CanContainOutOfFlowPositionedElement( - candidate.node.Style().GetPosition())); + position)); return container_builder_->GetLayoutObject() == - candidate.node.GetLayoutBox()->ContainingBlock(); + candidate.box->ContainingBlock(); } return (is_absolute_container_ && position == EPosition::kAbsolute) || (is_fixed_container_ && position == EPosition::kFixed);
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.cc b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.cc new file mode 100644 index 0000000..292d3b7d --- /dev/null +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.cc
@@ -0,0 +1,31 @@ +// 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. + +#include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h" + +namespace blink { + +void NGPhysicalOutOfFlowPositionedNode::Trace(Visitor* visitor) const { + if (is_for_fragmentation) { + static_cast<const NGPhysicalOOFNodeForFragmentation*>(this) + ->TraceAfterDispatch(visitor); + } else { + TraceAfterDispatch(visitor); + } +} + +void NGPhysicalOutOfFlowPositionedNode::TraceAfterDispatch( + Visitor* visitor) const { + visitor->Trace(box); + visitor->Trace(inline_container); +} + +void NGPhysicalOOFNodeForFragmentation::TraceAfterDispatch( + Visitor* visitor) const { + NGPhysicalOutOfFlowPositionedNode::TraceAfterDispatch(visitor); + visitor->Trace(containing_block); + visitor->Trace(fixedpos_containing_block); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h index 8ac2faf6..3923046 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h
@@ -10,6 +10,7 @@ #include "third_party/blink/renderer/core/layout/layout_inline.h" #include "third_party/blink/renderer/core/layout/ng/geometry/ng_static_position.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" namespace blink { @@ -18,7 +19,7 @@ // once it reaches its containing block. A containing block holds the // containing block information needed to place these OOF positioned nodes once // they reach the fragmentation context root. See -// NGPhysicalOutOfFlowPositionedNode/NGLogicalOutOfFlowPositionedNode for more +// NGPhysicalOOFNodeForFragmentation/NGLogicalOutOfFlowPositionedNode for more // details. template <typename OffsetType> struct NGContainingBlock { @@ -81,14 +82,66 @@ // as a positioned-node reaches its containing block, it gets placed, and // doesn't bubble further up the tree. // -// However, when fragmentation comes into play, we no longer place a -// positioned-node as soon as it reaches its containing block. Instead, we -// continue to bubble the positioned node up until it reaches the -// fragmentation context root. There, it will get placed and properly -// fragmented. -// // This needs its static position [1] to be placed correctly in its containing -// block. And in the case of fragmentation, this also needs the containing block +// block. +// +// This is struct is allowed to be stored/persisted. +// +// [1] https://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-width +struct CORE_EXPORT NGPhysicalOutOfFlowPositionedNode { + DISALLOW_NEW(); + + using HorizontalEdge = NGPhysicalStaticPosition::HorizontalEdge; + using VerticalEdge = NGPhysicalStaticPosition::VerticalEdge; + + public: + Member<LayoutBox> box; + // Unpacked NGPhysicalStaticPosition. + PhysicalOffset static_position; + unsigned static_position_horizontal_edge : 2; + unsigned static_position_vertical_edge : 2; + // Whether or not this is an NGPhysicalOOFNodeForFragmentation. + unsigned is_for_fragmentation : 1; + // Continuation root of the optional inline container. + Member<const LayoutInline> inline_container; + + NGPhysicalOutOfFlowPositionedNode( + NGBlockNode node, + NGPhysicalStaticPosition static_position, + const LayoutInline* inline_container = nullptr) + : box(node.GetLayoutBox()), + static_position(static_position.offset), + static_position_horizontal_edge(static_position.horizontal_edge), + static_position_vertical_edge(static_position.vertical_edge), + is_for_fragmentation(false), + inline_container(inline_container) { + DCHECK(!inline_container || + inline_container == inline_container->ContinuationRoot()); + DCHECK(node.IsBlock()); + } + + NGBlockNode Node() const { return NGBlockNode(box); } + HorizontalEdge GetStaticPositionHorizontalEdge() const { + return static_cast<HorizontalEdge>(static_position_horizontal_edge); + } + VerticalEdge GetStaticPositionVerticalEdge() const { + return static_cast<VerticalEdge>(static_position_vertical_edge); + } + NGPhysicalStaticPosition StaticPosition() const { + return {static_position, GetStaticPositionHorizontalEdge(), + GetStaticPositionVerticalEdge()}; + } + + void Trace(Visitor* visitor) const; + void TraceAfterDispatch(Visitor*) const; +}; + +// When fragmentation comes into play, we no longer place a positioned-node as +// soon as it reaches its containing block. Instead, we continue to bubble the +// positioned node up until it reaches the fragmentation context root. There, it +// will get placed and properly fragmented. +// +// In addition to the static position, we also needs the containing block // fragment to be placed correctly within the fragmentation context root. In // addition, the containing block offset is needed to compute the start offset // and the initial fragmentainer of an out-of-flow positioned-node. @@ -100,20 +153,15 @@ // exists. // // This is struct is allowed to be stored/persisted. -// -// [1] https://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-width -struct CORE_EXPORT NGPhysicalOutOfFlowPositionedNode final { +struct CORE_EXPORT NGPhysicalOOFNodeForFragmentation final + : public NGPhysicalOutOfFlowPositionedNode { DISALLOW_NEW(); public: - NGBlockNode node; - NGPhysicalStaticPosition static_position; - // Continuation root of the optional inline container. - Member<const LayoutInline> inline_container; NGContainingBlock<PhysicalOffset> containing_block; NGContainingBlock<PhysicalOffset> fixedpos_containing_block; - NGPhysicalOutOfFlowPositionedNode( + NGPhysicalOOFNodeForFragmentation( NGBlockNode node, NGPhysicalStaticPosition static_position, const LayoutInline* inline_container = nullptr, @@ -121,21 +169,15 @@ NGContainingBlock<PhysicalOffset>(), NGContainingBlock<PhysicalOffset> fixedpos_containing_block = NGContainingBlock<PhysicalOffset>()) - : node(node), - static_position(static_position), - inline_container(inline_container), + : NGPhysicalOutOfFlowPositionedNode(node, + static_position, + inline_container), containing_block(containing_block), fixedpos_containing_block(fixedpos_containing_block) { - DCHECK(!inline_container || - inline_container == inline_container->ContinuationRoot()); + is_for_fragmentation = true; } - void Trace(Visitor* visitor) const { - visitor->Trace(node); - visitor->Trace(inline_container); - visitor->Trace(containing_block); - visitor->Trace(fixedpos_containing_block); - } + void TraceAfterDispatch(Visitor* visitor) const; }; // The logical version of above. It is used within a an algorithm pass (within @@ -148,7 +190,7 @@ DISALLOW_NEW(); public: - NGBlockNode node; + Member<LayoutBox> box; NGLogicalStaticPosition static_position; // Continuation root of the optional inline container. Member<const LayoutInline> inline_container; @@ -168,7 +210,7 @@ NGContainingBlock<LogicalOffset> fixedpos_containing_block = NGContainingBlock<LogicalOffset>(), const base::Optional<LogicalRect> containing_block_rect = base::nullopt) - : node(node), + : box(node.GetLayoutBox()), static_position(static_position), inline_container(inline_container), needs_block_offset_adjustment(needs_block_offset_adjustment), @@ -177,10 +219,13 @@ containing_block_rect(containing_block_rect) { DCHECK(!inline_container || inline_container == inline_container->ContinuationRoot()); + DCHECK(node.IsBlock()); } + NGBlockNode Node() const { return NGBlockNode(box); } + void Trace(Visitor* visitor) const { - visitor->Trace(node); + visitor->Trace(box); visitor->Trace(inline_container); visitor->Trace(containing_block); visitor->Trace(fixedpos_containing_block); @@ -192,6 +237,8 @@ WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS( blink::NGPhysicalOutOfFlowPositionedNode) WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS( + blink::NGPhysicalOOFNodeForFragmentation) +WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS( blink::NGLogicalOutOfFlowPositionedNode) #endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_OUT_OF_FLOW_POSITIONED_NODE_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc index 0ce0cea..863cb52 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc
@@ -445,7 +445,7 @@ for (const auto& descendant : builder->oof_positioned_fragmentainer_descendants_) { oof_positioned_fragmentainer_descendants.emplace_back( - descendant.node, + descendant.Node(), descendant.static_position.ConvertToPhysical(converter), descendant.inline_container, PhysicalContainingBlock(builder, size, descendant.containing_block), @@ -597,17 +597,6 @@ return this; } -bool NGPhysicalBoxFragment::CanUseFragmentsForInkOverflow() const { - if (UNLIKELY(IsLegacyLayoutRoot())) - return false; - // TODO(crbug.com/1144203): Following conditions are not supported in NG - // visual overflow yet. - if (UNLIKELY(IsMathML())) - return false; - DCHECK(IsInlineBox() || OwnerLayoutBox()); - return true; -} - PhysicalRect NGPhysicalBoxFragment::SelfInkOverflow() const { if (UNLIKELY(!CanUseFragmentsForInkOverflow())) { const auto* owner_box = DynamicTo<LayoutBox>(GetLayoutObject());
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h index 84e0923..d51a416 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h
@@ -195,12 +195,12 @@ ->oof_positioned_fragmentainer_descendants.IsEmpty(); } - base::span<NGPhysicalOutOfFlowPositionedNode> + base::span<NGPhysicalOOFNodeForFragmentation> OutOfFlowPositionedFragmentainerDescendants() const { if (!const_has_rare_data_) - return base::span<NGPhysicalOutOfFlowPositionedNode>(); - HeapVector<NGPhysicalOutOfFlowPositionedNode>& descendants = - const_cast<HeapVector<NGPhysicalOutOfFlowPositionedNode>&>( + return base::span<NGPhysicalOOFNodeForFragmentation>(); + HeapVector<NGPhysicalOOFNodeForFragmentation>& descendants = + const_cast<HeapVector<NGPhysicalOOFNodeForFragmentation>&>( ComputeRareDataAddress()->oof_positioned_fragmentainer_descendants); return {descendants.data(), descendants.size()}; } @@ -415,7 +415,7 @@ } // Returns if this fragment can compute ink overflow. - bool CanUseFragmentsForInkOverflow() const; + bool CanUseFragmentsForInkOverflow() const { return !IsLegacyLayoutRoot(); } // Recalculates and updates |*InkOverflow|. void RecalcInkOverflow(); // |RecalcInkOverflow| using the given contents ink overflow rect. @@ -442,7 +442,7 @@ RareData(NGBoxFragmentBuilder*, PhysicalSize size); void Trace(Visitor*) const; - HeapVector<NGPhysicalOutOfFlowPositionedNode> + HeapVector<NGPhysicalOOFNodeForFragmentation> oof_positioned_fragmentainer_descendants; MulticolCollection multicols_with_pending_oofs; const std::unique_ptr<const NGMathMLPaintInfo> mathml_paint_info;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc index 4936765..f70e65b 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc
@@ -328,7 +328,7 @@ {builder->Style().GetWritingMode(), builder->Direction()}, size); for (const auto& descendant : builder->oof_positioned_descendants_) { oof_positioned_descendants_->emplace_back( - descendant.node, + descendant.Node(), descendant.static_position.ConvertToPhysical(converter), descendant.inline_container); }
diff --git a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_helpers.cc b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_helpers.cc index 3322656..5589a3d 100644 --- a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_helpers.cc +++ b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_helpers.cc
@@ -100,7 +100,9 @@ } } break; case kPercentageGuess: { - // Percent columns grow, auto/fixed get min inline size. + // Percent columns grow in proportion to difference between their + // percentage size and minimum size. + // Auto/Fixed columns get min inline size. LayoutUnit percent_inline_size_increases = guess_size_total_increases[kPercentageGuess]; LayoutUnit distributable_inline_size = @@ -294,8 +296,10 @@ *last_computed_size += rounding_error_inline_size; } } else if (percent_columns_count > 0) { - // All remaining columns are percent. Grow them. - LayoutUnit rounding_error_inline_size = target_inline_size; + // All remaining columns are percent. + // They grow to max(col minimum, %ge size) + additional size + // proportional to column percent. + LayoutUnit rounding_error_inline_size = distributable_inline_size; LayoutUnit* last_computed_size = nullptr; LayoutUnit* computed_size = computed_sizes.begin(); for (const NGTableTypes::Column* column = start_column; @@ -304,13 +308,18 @@ continue; DCHECK(column->percent); last_computed_size = computed_size; - if (total_percent > 0.0f) { - *computed_size = LayoutUnit(*column->percent / total_percent * - target_inline_size); + LayoutUnit percent_inline_size = + column->ResolvePercentInlineSize(target_inline_size); + LayoutUnit delta; + if (total_percent != 0.0f) { + delta = LayoutUnit(distributable_inline_size * *column->percent / + total_percent); } else { - *computed_size = distributable_inline_size / percent_columns_count; + delta = LayoutUnit(distributable_inline_size.ToFloat() / + percent_columns_count); } - rounding_error_inline_size -= *computed_size; + rounding_error_inline_size -= delta; + *computed_size = percent_inline_size + delta; } if (rounding_error_inline_size != LayoutUnit()) { DCHECK(last_computed_size);
diff --git a/third_party/blink/renderer/core/loader/document_loader.h b/third_party/blink/renderer/core/loader/document_loader.h index 6591c47..052ad9ce 100644 --- a/third_party/blink/renderer/core/loader/document_loader.h +++ b/third_party/blink/renderer/core/loader/document_loader.h
@@ -319,6 +319,8 @@ return last_navigation_had_trusted_initiator_; } + void UpdateUrlForDocumentOpen(const KURL& url) { url_ = url; } + enum class HistoryNavigationType { kDifferentDocument, kFragment,
diff --git a/third_party/blink/renderer/core/loader/navigation_policy_test.cc b/third_party/blink/renderer/core/loader/navigation_policy_test.cc index 96e68fae..30a86e0 100644 --- a/third_party/blink/renderer/core/loader/navigation_policy_test.cc +++ b/third_party/blink/renderer/core/loader/navigation_policy_test.cc
@@ -235,8 +235,8 @@ for (const auto& test : kCases) { EXPECT_EQ(test.policy, - NavigationPolicyForCreateWindow( - GetWindowFeaturesFromString(test.feature_string))) + NavigationPolicyForCreateWindow(GetWindowFeaturesFromString( + test.feature_string, nullptr /* dom_window */))) << "Testing '" << test.feature_string << "'"; } } @@ -258,8 +258,8 @@ for (const auto& test : kCases) { EXPECT_EQ(test.policy, - NavigationPolicyForCreateWindow( - GetWindowFeaturesFromString(test.feature_string))) + NavigationPolicyForCreateWindow(GetWindowFeaturesFromString( + test.feature_string, nullptr /* dom_window */))) << "Testing '" << test.feature_string << "'"; } } @@ -281,8 +281,8 @@ for (const auto& test : kCases) { EXPECT_EQ(test.policy, - NavigationPolicyForCreateWindow( - GetWindowFeaturesFromString(test.feature_string))) + NavigationPolicyForCreateWindow(GetWindowFeaturesFromString( + test.feature_string, nullptr /* dom_window */))) << "Testing '" << test.feature_string << "'"; } }
diff --git a/third_party/blink/renderer/core/page/create_window.cc b/third_party/blink/renderer/core/page/create_window.cc index 1a0f51d7..a98db0c8 100644 --- a/third_party/blink/renderer/core/page/create_window.cc +++ b/third_party/blink/renderer/core/page/create_window.cc
@@ -44,6 +44,7 @@ #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h" +#include "third_party/blink/renderer/core/html/conversion_measurement_parsing.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/loader/frame_load_request.h" #include "third_party/blink/renderer/core/page/chrome_client.h" @@ -65,9 +66,15 @@ c == ',' || c == '\f'; } -WebWindowFeatures GetWindowFeaturesFromString(const String& feature_string) { +WebWindowFeatures GetWindowFeaturesFromString(const String& feature_string, + LocalDOMWindow* dom_window) { WebWindowFeatures window_features; + ImpressionFeatures impression_features; + bool conversion_measurement_enabled = + dom_window && + RuntimeEnabledFeatures::ConversionMeasurementEnabled(dom_window); + // This code follows the HTML spec, specifically // https://html.spec.whatwg.org/C/#concept-window-open-features-tokenize if (feature_string.IsEmpty()) @@ -189,12 +196,27 @@ window_features.background = true; } else if (key_string == "persistent") { window_features.persistent = true; + } else if (conversion_measurement_enabled) { + if (key_string == "attributionsourceeventid") { + impression_features.impression_data = value_string.ToString(); + } else if (key_string == "attributiondestination") { + impression_features.conversion_destination = value_string.ToString(); + } else if (key_string == "attributionreportto") { + impression_features.reporting_origin = value_string.ToString(); + } else if (key_string == "attributionexpiry") { + impression_features.expiry = value_string.ToString(); + } } } if (window_features.noreferrer) window_features.noopener = true; + if (conversion_measurement_enabled) { + window_features.impression = + GetImpressionFromWindowFeatures(dom_window, impression_features); + } + return window_features; }
diff --git a/third_party/blink/renderer/core/page/create_window.h b/third_party/blink/renderer/core/page/create_window.h index 65ad2ef..0f5e82ab 100644 --- a/third_party/blink/renderer/core/page/create_window.h +++ b/third_party/blink/renderer/core/page/create_window.h
@@ -33,6 +33,7 @@ namespace blink { class Frame; +class LocalDOMWindow; class LocalFrame; struct FrameLoadRequest; @@ -40,7 +41,9 @@ FrameLoadRequest&, const AtomicString& name); -CORE_EXPORT WebWindowFeatures GetWindowFeaturesFromString(const String&); +CORE_EXPORT WebWindowFeatures +GetWindowFeaturesFromString(const String& feature_string, + LocalDOMWindow* dom_window); } // namespace blink
diff --git a/third_party/blink/renderer/core/page/scrolling/text_fragment_finder.h b/third_party/blink/renderer/core/page/scrolling/text_fragment_finder.h index e1f21b7..4eb105da 100644 --- a/third_party/blink/renderer/core/page/scrolling/text_fragment_finder.h +++ b/third_party/blink/renderer/core/page/scrolling/text_fragment_finder.h
@@ -57,7 +57,9 @@ void Trace(Visitor*) const; - const Member<RangeInFlatTree>& FirstMatch() const { return first_match_; } + const RangeInFlatTree* FirstMatch() const { return first_match_.Get(); } + + TextFragmentSelector GetSelector() const { return selector_; } protected: friend class TextFragmentFinderTest;
diff --git a/third_party/blink/renderer/core/page/scrolling/text_fragment_handler.cc b/third_party/blink/renderer/core/page/scrolling/text_fragment_handler.cc index 0e92d089..0eb4687f3 100644 --- a/third_party/blink/renderer/core/page/scrolling/text_fragment_handler.cc +++ b/third_party/blink/renderer/core/page/scrolling/text_fragment_handler.cc
@@ -40,6 +40,26 @@ GetTextFragmentSelectorGenerator()->RequestSelector(std::move(callback)); } +void TextFragmentHandler::GetExistingSelectors( + GetExistingSelectorsCallback callback) { + Vector<String> text_fragment_selectors; + TextFragmentAnchor* anchor( + static_cast<TextFragmentAnchor*>(GetTextFragmentSelectorGenerator() + ->GetFrame() + ->View() + ->GetFragmentAnchor())); + + if (anchor) { + for (auto& finder : anchor->TextFragmentFinders()) { + if (finder->FirstMatch()) { + text_fragment_selectors.push_back(finder->GetSelector().ToString()); + } + } + } + + std::move(callback).Run(text_fragment_selectors); +} + void TextFragmentHandler::RemoveFragments() { DCHECK( base::FeatureList::IsEnabled(shared_highlighting::kSharedHighlightingV2));
diff --git a/third_party/blink/renderer/core/page/scrolling/text_fragment_handler.h b/third_party/blink/renderer/core/page/scrolling/text_fragment_handler.h index 30bed08..af6fbabd 100644 --- a/third_party/blink/renderer/core/page/scrolling/text_fragment_handler.h +++ b/third_party/blink/renderer/core/page/scrolling/text_fragment_handler.h
@@ -31,6 +31,9 @@ // Requests selector for current selection. void RequestSelector(RequestSelectorCallback callback) override; + // Requests selectors for all existing highlights on the page. + void GetExistingSelectors(GetExistingSelectorsCallback callback) override; + // Remove all text fragments from the current frame. void RemoveFragments() override;
diff --git a/third_party/blink/renderer/core/page/window_features_test.cc b/third_party/blink/renderer/core/page/window_features_test.cc index e6b11fe8..4ea8b7c4 100644 --- a/third_party/blink/renderer/core/page/window_features_test.cc +++ b/third_party/blink/renderer/core/page/window_features_test.cc
@@ -28,8 +28,9 @@ }; for (const auto& test : kCases) { - EXPECT_EQ(test.noopener, - GetWindowFeaturesFromString(test.feature_string).noopener) + EXPECT_EQ(test.noopener, GetWindowFeaturesFromString( + test.feature_string, nullptr /* dom_window */) + .noopener) << "Testing '" << test.feature_string << "'"; } } @@ -59,7 +60,9 @@ for (const auto& test : kCases) { EXPECT_EQ(test.noreferrer, - GetWindowFeaturesFromString(test.feature_string).noreferrer) + GetWindowFeaturesFromString(test.feature_string, + nullptr /* dom_window */) + .noreferrer) << "Testing '" << test.feature_string << "'"; } }
diff --git a/third_party/blink/renderer/core/paint/box_paint_invalidator.cc b/third_party/blink/renderer/core/paint/box_paint_invalidator.cc index df0c78f..72e3e3e 100644 --- a/third_party/blink/renderer/core/paint/box_paint_invalidator.cc +++ b/third_party/blink/renderer/core/paint/box_paint_invalidator.cc
@@ -6,6 +6,7 @@ #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/layout/layout_view.h" +#include "third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h" #include "third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h" #include "third_party/blink/renderer/core/paint/object_paint_invalidator.h" #include "third_party/blink/renderer/core/paint/paint_invalidator.h" @@ -130,6 +131,10 @@ box_.PreviousPhysicalContentBoxRect() != box_.PhysicalContentBoxRect()) return PaintInvalidationReason::kGeometry; +#if DCHECK_IS_ON() + // TODO(crbug.com/1205708): Audit this. + NGInkOverflow::ReadUnsetAsNoneScope read_unset_as_none; +#endif if (box_.PreviousSize() == box_.Size() && box_.PreviousPhysicalSelfVisualOverflowRect() == box_.PhysicalSelfVisualOverflowRect()) @@ -417,6 +422,10 @@ auto mutable_box = box_.GetMutableForPainting(); mutable_box.SavePreviousSize(); +#if DCHECK_IS_ON() + // TODO(crbug.com/1205708): Audit this. + NGInkOverflow::ReadUnsetAsNoneScope read_unset_as_none; +#endif if (NeedsToSavePreviousOverflowData()) mutable_box.SavePreviousOverflowData(); else
diff --git a/third_party/blink/renderer/core/paint/box_paint_invalidator_test.cc b/third_party/blink/renderer/core/paint/box_paint_invalidator_test.cc index fcf78461..0f21923 100644 --- a/third_party/blink/renderer/core/paint/box_paint_invalidator_test.cc +++ b/third_party/blink/renderer/core/paint/box_paint_invalidator_test.cc
@@ -8,7 +8,6 @@ #include "third_party/blink/renderer/core/html/html_frame_owner_element.h" #include "third_party/blink/renderer/core/html_names.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h" #include "third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.h" #include "third_party/blink/renderer/core/paint/paint_controller_paint_test.h" #include "third_party/blink/renderer/core/paint/paint_invalidator.h" @@ -56,16 +55,9 @@ target.setAttribute( html_names::kStyleAttr, target.getAttribute(html_names::kStyleAttr) + "; width: 200px"); -#if DCHECK_IS_ON() - base::Optional<NGInkOverflow::ReadUnsetAsNoneScope> read_unset_as_none; -#endif if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { GetDocument().View()->UpdateLifecycleToLayoutClean( DocumentUpdateReason::kTest); -#if DCHECK_IS_ON() - // |VisualOverflow| is not computed yet, allow it read as no-overflow. - read_unset_as_none.emplace(); -#endif } else { GetDocument().View()->UpdateLifecycleToCompositingInputsClean( DocumentUpdateReason::kTest); @@ -135,14 +127,8 @@ target.setAttribute(html_names::kStyleAttr, "width: 200px"); GetDocument().View()->UpdateLifecycleToLayoutClean( DocumentUpdateReason::kTest); - { -#if DCHECK_IS_ON() - // |VisualOverflow| is not computed yet, allow it read as no-overflow. - NGInkOverflow::ReadUnsetAsNoneScope read_unset_as_none; -#endif - EXPECT_EQ(PaintInvalidationReason::kIncremental, - ComputePaintInvalidationReason(box, paint_offset)); - } + EXPECT_EQ(PaintInvalidationReason::kIncremental, + ComputePaintInvalidationReason(box, paint_offset)); } TEST_P(BoxPaintInvalidatorTest, ComputePaintInvalidationReasonBasic) { @@ -166,14 +152,8 @@ target.setAttribute(html_names::kStyleAttr, "background: blue; width: 200px"); GetDocument().View()->UpdateLifecycleToLayoutClean( DocumentUpdateReason::kTest); - { -#if DCHECK_IS_ON() - // |VisualOverflow| is not computed yet, allow it read as no-overflow. - NGInkOverflow::ReadUnsetAsNoneScope read_unset_as_none; -#endif - EXPECT_EQ(PaintInvalidationReason::kIncremental, - ComputePaintInvalidationReason(box, paint_offset)); - } + EXPECT_EQ(PaintInvalidationReason::kIncremental, + ComputePaintInvalidationReason(box, paint_offset)); // Add visual overflow. target.setAttribute(html_names::kStyleAttr,
diff --git a/third_party/blink/renderer/core/paint/cull_rect_updater.cc b/third_party/blink/renderer/core/paint/cull_rect_updater.cc index a1c572a4..dfa43755 100644 --- a/third_party/blink/renderer/core/paint/cull_rect_updater.cc +++ b/third_party/blink/renderer/core/paint/cull_rect_updater.cc
@@ -46,16 +46,6 @@ return true; } -bool ShouldProactivelyUpdateCullRect(const PaintLayer& layer) { - // If we will repaint anyway, proactively refresh cull rect. A sliding - // window (aka hysteresis, see: CullRect::ChangedEnough()) is used to - // avoid frequent cull rect updates because they force a repaint (see: - // |CullRectUpdater::SetFragmentCullRects|). Proactively updating the cull - // rect resets the sliding window which will minimize the need to update - // the cull rect again. - return layer.SelfOrDescendantNeedsRepaint(); -} - } // anonymous namespace CullRectUpdater::CullRectUpdater(PaintLayer& root_layer) @@ -91,10 +81,16 @@ void CullRectUpdater::UpdateRecursively(PaintLayer& layer, const PaintLayer& parent_painting_layer, bool force_update_self) { - bool should_proactively_update = ShouldProactivelyUpdateCullRect(layer); + bool should_proactively_update = ShouldProactivelyUpdate(layer); bool force_update_children = should_proactively_update || layer.ForcesChildrenCullRectUpdate(); + // This defines the scope of force_proactive_update_ (which may be set by + // ComputeFragmentCullRect() and ComputeFragmentContentsCullRect()) to the + // subtree. + base::AutoReset<bool> reset(&force_proactive_update_, + force_proactive_update_); + if (force_update_self || should_proactively_update || layer.NeedsCullRectUpdate()) force_update_children |= UpdateForSelf(layer, parent_painting_layer); @@ -235,10 +231,12 @@ base::Optional<CullRect> old_cull_rect; // Not using |old_cull_rect| will force the cull rect to be updated // (skipping |ChangedEnough|) in |ApplyPaintProperties|. - if (!ShouldProactivelyUpdateCullRect(layer)) + if (!ShouldProactivelyUpdate(layer)) old_cull_rect = fragment.GetCullRect(); - cull_rect.ApplyPaintProperties(root_state_, parent_state, local_state, - old_cull_rect); + bool expanded = cull_rect.ApplyPaintProperties(root_state_, parent_state, + local_state, old_cull_rect); + if (expanded && fragment.GetCullRect() != cull_rect) + force_proactive_update_ = true; } return cull_rect; } @@ -254,14 +252,29 @@ base::Optional<CullRect> old_contents_cull_rect; // Not using |old_cull_rect| will force the cull rect to be updated // (skipping |CullRect::ChangedEnough|) in |ApplyPaintProperties|. - if (!ShouldProactivelyUpdateCullRect(layer)) + if (!ShouldProactivelyUpdate(layer)) old_contents_cull_rect = fragment.GetContentsCullRect(); - contents_cull_rect.ApplyPaintProperties( + bool expanded = contents_cull_rect.ApplyPaintProperties( root_state_, local_state, contents_state, old_contents_cull_rect); + if (expanded && fragment.GetContentsCullRect() != contents_cull_rect) + force_proactive_update_ = true; } return contents_cull_rect; } +bool CullRectUpdater::ShouldProactivelyUpdate(const PaintLayer& layer) const { + if (force_proactive_update_) + return true; + + // If we will repaint anyway, proactively refresh cull rect. A sliding + // window (aka hysteresis, see: CullRect::ChangedEnough()) is used to + // avoid frequent cull rect updates because they force a repaint (see: + // |CullRectUpdater::SetFragmentCullRects|). Proactively updating the cull + // rect resets the sliding window which will minimize the need to update + // the cull rect again. + return layer.SelfOrDescendantNeedsRepaint(); +} + OverriddenCullRectScope::OverriddenCullRectScope(LocalFrameView& frame_view, const CullRect& cull_rect) : frame_view_(frame_view) {
diff --git a/third_party/blink/renderer/core/paint/cull_rect_updater.h b/third_party/blink/renderer/core/paint/cull_rect_updater.h index bef51d2..0e5d933 100644 --- a/third_party/blink/renderer/core/paint/cull_rect_updater.h +++ b/third_party/blink/renderer/core/paint/cull_rect_updater.h
@@ -49,9 +49,11 @@ CullRect ComputeFragmentContentsCullRect(PaintLayer&, const FragmentData& fragment, const CullRect& cull_rect); + bool ShouldProactivelyUpdate(const PaintLayer&) const; PaintLayer& root_layer_; PropertyTreeState root_state_; + bool force_proactive_update_ = false; }; // Used when painting with a custom top-level cull rect, e.g. when printing a
diff --git a/third_party/blink/renderer/core/paint/filter_effect_builder.cc b/third_party/blink/renderer/core/paint/filter_effect_builder.cc index 48c70a4..32fa1013 100644 --- a/third_party/blink/renderer/core/paint/filter_effect_builder.cc +++ b/third_party/blink/renderer/core/paint/filter_effect_builder.cc
@@ -196,6 +196,13 @@ std::move(input_parameters)); break; } + case FilterOperation::LUMINANCE_TO_ALPHA: { + Vector<float> input_parameters; + effect = MakeGarbageCollected<FEColorMatrix>( + parent_filter, FECOLORMATRIX_TYPE_LUMINANCETOALPHA, + std::move(input_parameters)); + break; + } case FilterOperation::COLOR_MATRIX: { Vector<float> input_parameters = To<ColorMatrixFilterOperation>(filter_operation)->Values(); @@ -363,6 +370,10 @@ } break; } + case FilterOperation::LUMINANCE_TO_ALPHA: + // LuminanceToAlpha only exists for SVG and Canvas filters. + NOTREACHED(); + break; case FilterOperation::COLOR_MATRIX: { Vector<float> matrix_values = To<ColorMatrixFilterOperation>(*op).Values();
diff --git a/third_party/blink/renderer/core/paint/paint_invalidator.cc b/third_party/blink/renderer/core/paint/paint_invalidator.cc index 57e7c55..d1015ce 100644 --- a/third_party/blink/renderer/core/paint/paint_invalidator.cc +++ b/third_party/blink/renderer/core/paint/paint_invalidator.cc
@@ -234,7 +234,7 @@ DCHECK(object.IsBox()); const auto& box = To<LayoutBox>(object); - PhysicalRect new_rect = box.PhysicalVisualOverflowRect(); + PhysicalRect new_rect = box.PhysicalVisualOverflowRectAllowingUnset(); new_rect.Move(new_paint_offset); PhysicalRect old_rect = box.PreviousPhysicalVisualOverflowRect(); old_rect.Move(adjusted_old_paint_offset);
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc index 48f5a410d..54eed64fe 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc +++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
@@ -162,10 +162,8 @@ PaintPropertyTreeBuilderFragmentContext& context = full_context.fragments[0]; context.current.paint_offset += PhysicalOffset(frame_view.Location()); - context.rendering_context_id = 0; - context.should_flatten_inherited_transform = true; - context.current.old_rendering_context_id = 0; - context.current.old_should_flatten_inherited_transform = true; + context.current.rendering_context_id = 0; + context.current.should_flatten_inherited_transform = true; context.absolute_position = context.current; full_context.container_for_absolute_position = nullptr; full_context.container_for_fixed_position = nullptr; @@ -623,15 +621,9 @@ if (paint_offset_translation) { FloatSize new_translation(ToIntSize(*paint_offset_translation)); TransformPaintPropertyNode::State state{new_translation}; - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.should_flatten_inherited_transform == - context_.current.old_should_flatten_inherited_transform); state.flags.flattens_inherited_transform = - context_.should_flatten_inherited_transform; - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.rendering_context_id == - context_.current.old_rendering_context_id); - state.rendering_context_id = context_.rendering_context_id; + context_.current.should_flatten_inherited_transform; + state.rendering_context_id = context_.current.rendering_context_id; state.direct_compositing_reasons = full_context_.direct_compositing_reasons & CompositingReason::kDirectReasonsForPaintOffsetTranslationProperty; @@ -678,15 +670,9 @@ state.compositor_element_id = CompositorElementIdFromUniqueObjectId( box_model.UniqueId(), CompositorElementIdNamespace::kStickyTranslation); - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.rendering_context_id == - context_.current.old_rendering_context_id); - state.rendering_context_id = context_.rendering_context_id; - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.should_flatten_inherited_transform == - context_.current.old_should_flatten_inherited_transform); + state.rendering_context_id = context_.current.rendering_context_id; state.flags.flattens_inherited_transform = - context_.should_flatten_inherited_transform; + context_.current.should_flatten_inherited_transform; auto* layer = box_model.Layer(); const auto* scroller_properties = layer->AncestorScrollContainerLayer() @@ -873,15 +859,9 @@ state.direct_compositing_reasons = direct_compositing_reasons & CompositingReasonsForTransformProperty(); - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.should_flatten_inherited_transform == - context_.current.old_should_flatten_inherited_transform); state.flags.flattens_inherited_transform = - context_.should_flatten_inherited_transform; - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.rendering_context_id == - context_.current.old_rendering_context_id); - state.rendering_context_id = context_.rendering_context_id; + context_.current.should_flatten_inherited_transform; + state.rendering_context_id = context_.current.rendering_context_id; state.flags.is_for_svg_child = true; state.compositor_element_id = GetCompositorElementId( CompositorElementIdNamespace::kPrimaryTransform); @@ -913,13 +893,9 @@ } if (properties_->Transform()) { - // TODO(pdr): SVG does not support 3D transforms so this should be - // should_flatten_inherited_transform = true. context_.current.transform = properties_->Transform(); - context_.should_flatten_inherited_transform = false; - context_.rendering_context_id = 0; - context_.current.old_should_flatten_inherited_transform = false; - context_.current.old_rendering_context_id = 0; + context_.current.should_flatten_inherited_transform = false; + context_.current.rendering_context_id = 0; } } @@ -1024,10 +1000,7 @@ // !matrix.Is2dTransform() or !matrix.IsFlat(); we're interested // *only* in things that cause this element to have a nonzero z // position within the 3-D scene. - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.rendering_context_id == - context_.current.old_rendering_context_id); - if (context_.rendering_context_id && + if (context_.current.rendering_context_id && (matrix.M13() != 0.0 || matrix.M23() != 0.0 || matrix.M43() != 0.0)) { UseCounter::Count(object_.GetDocument(), @@ -1038,7 +1011,7 @@ // PaintLayer is created. If a node with transform-style: preserve-3d // does not exist in an existing rendering context, it establishes a // new one. - state.rendering_context_id = context_.rendering_context_id; + state.rendering_context_id = context_.current.rendering_context_id; if (style.Preserves3D() && !state.rendering_context_id) { state.rendering_context_id = PtrHash<const LayoutObject>::GetHash(&object_); @@ -1055,11 +1028,8 @@ state.direct_compositing_reasons = full_context_.direct_compositing_reasons & CompositingReasonsForTransformProperty(); - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.should_flatten_inherited_transform == - context_.current.old_should_flatten_inherited_transform); state.flags.flattens_inherited_transform = - context_.should_flatten_inherited_transform; + context_.current.should_flatten_inherited_transform; state.backface_visibility = object_.HasHiddenBackface() ? TransformPaintPropertyNode::BackfaceVisibility::kHidden @@ -1098,18 +1068,12 @@ if (const auto* transform = properties_->Transform()) { context_.current.transform = transform; if (object_.StyleRef().Preserves3D()) { - context_.rendering_context_id = transform->RenderingContextId(); - context_.should_flatten_inherited_transform = false; - context_.current.old_rendering_context_id = - transform->RenderingContextId(); - context_.current.old_should_flatten_inherited_transform = false; + context_.current.rendering_context_id = transform->RenderingContextId(); + context_.current.should_flatten_inherited_transform = false; } else { - context_.rendering_context_id = 0; - context_.should_flatten_inherited_transform = true; - context_.current.old_rendering_context_id = 0; - context_.current.old_should_flatten_inherited_transform = true; + context_.current.rendering_context_id = 0; + context_.current.should_flatten_inherited_transform = true; } - if (transform->IsIdentityOr2DTranslation()) { context_.translation_2d_to_layout_shift_root_delta += transform->Translation2D(); @@ -1119,10 +1083,8 @@ // With kTransformInterop enabled, 3D rendering contexts follow the // DOM ancestor chain, so flattening should apply regardless of // presence of transform. - context_.rendering_context_id = 0; - context_.should_flatten_inherited_transform = true; - context_.current.old_rendering_context_id = 0; - context_.current.old_should_flatten_inherited_transform = true; + context_.current.rendering_context_id = 0; + context_.current.should_flatten_inherited_transform = true; } } @@ -1951,12 +1913,6 @@ DCHECK(properties_); if (NeedsPaintPropertyUpdate()) { - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.should_flatten_inherited_transform == - context_.current.old_should_flatten_inherited_transform); - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.rendering_context_id == - context_.current.old_rendering_context_id); if (NeedsPerspective(object_)) { const ComputedStyle& style = object_.StyleRef(); // The perspective node must not flatten (else nothing will get @@ -1968,8 +1924,8 @@ PerspectiveOrigin(To<LayoutBox>(object_)) + FloatSize(context_.current.paint_offset))}; state.flags.flattens_inherited_transform = - context_.should_flatten_inherited_transform; - state.rendering_context_id = context_.rendering_context_id; + context_.current.should_flatten_inherited_transform; + state.rendering_context_id = context_.current.rendering_context_id; OnUpdate(properties_->UpdatePerspective(*context_.current.transform, std::move(state))); } else { @@ -1979,8 +1935,7 @@ if (properties_->Perspective()) { context_.current.transform = properties_->Perspective(); - context_.should_flatten_inherited_transform = false; - context_.current.old_should_flatten_inherited_transform = false; + context_.current.should_flatten_inherited_transform = false; } } @@ -1998,18 +1953,12 @@ } else { NOTREACHED(); } - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.should_flatten_inherited_transform == - context_.current.old_should_flatten_inherited_transform); - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.rendering_context_id == - context_.current.old_rendering_context_id); if (!content_to_parent_space.IsIdentity()) { TransformPaintPropertyNode::State state; SetTransformNodeStateFromAffineTransform(state, content_to_parent_space); state.flags.flattens_inherited_transform = - context_.should_flatten_inherited_transform; - state.rendering_context_id = context_.rendering_context_id; + context_.current.should_flatten_inherited_transform; + state.rendering_context_id = context_.current.rendering_context_id; OnUpdate(properties_->UpdateReplacedContentTransform( *context_.current.transform, std::move(state))); } else { @@ -2031,10 +1980,8 @@ context_.current.transform = properties_->ReplacedContentTransform(); // TODO(pdr): SVG does not support 3D transforms so this should be // should_flatten_inherited_transform = true. - context_.should_flatten_inherited_transform = false; - context_.rendering_context_id = 0; - context_.current.old_should_flatten_inherited_transform = false; - context_.current.old_rendering_context_id = 0; + context_.current.should_flatten_inherited_transform = false; + context_.current.rendering_context_id = 0; } } } @@ -2181,15 +2128,9 @@ FloatPoint scroll_position = FloatPoint(box.ScrollOrigin()) + box.GetScrollableArea()->GetScrollOffset(); TransformPaintPropertyNode::State state{-ToFloatSize(scroll_position)}; - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.should_flatten_inherited_transform == - context_.current.old_should_flatten_inherited_transform); state.flags.flattens_inherited_transform = - context_.should_flatten_inherited_transform; - DCHECK(RuntimeEnabledFeatures::TransformInteropEnabled() || - context_.rendering_context_id == - context_.current.old_rendering_context_id); - state.rendering_context_id = context_.rendering_context_id; + context_.current.should_flatten_inherited_transform; + state.rendering_context_id = context_.current.rendering_context_id; state.direct_compositing_reasons = full_context_.direct_compositing_reasons & CompositingReason::kDirectReasonsForScrollTranslationProperty; @@ -2816,10 +2757,8 @@ // With kTransformInterop enabled, 3D rendering contexts follow the // DOM ancestor chain, so flattening should apply regardless of // presence of transform. - context_.rendering_context_id = 0; - context_.should_flatten_inherited_transform = true; - context_.current.old_rendering_context_id = 0; - context_.current.old_should_flatten_inherited_transform = true; + context_.current.rendering_context_id = 0; + context_.current.should_flatten_inherited_transform = true; } UpdateLocalBorderBoxContext(); UpdateLayoutShiftRootChanged(IsLayoutShiftRoot(object_, fragment_data_));
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder.h b/third_party/blink/renderer/core/paint/paint_property_tree_builder.h index 2f29b23..51a3c614 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_builder.h +++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder.h
@@ -86,10 +86,11 @@ // The PaintLayer corresponding to the origin of |paint_offset|. Member<const LayoutObject> paint_offset_root; - - // TODO(dbaron): Remove this in a few weeks once we know that the - // assertions it supports aren't hit by fuzzers. - bool old_should_flatten_inherited_transform = false; + // Whether newly created children should flatten their inherited transform + // (equivalently, draw into the plane of their parent). Should generally + // be updated whenever |transform| is; flattening only needs to happen + // to immediate children. + bool should_flatten_inherited_transform = false; // True if any fixed-position children within this context are fixed to the // root of the FrameView (and hence above its scroll). @@ -100,9 +101,9 @@ // object has changed. bool layout_shift_root_changed = false; - // TODO(dbaron): Remove this in a few weeks once we know that the - // assertions it supports aren't hit by fuzzers. - unsigned old_rendering_context_id = 0; + // Rendering context for 3D sorting. See + // TransformPaintPropertyNode::renderingContextId. + unsigned rendering_context_id = 0; // The clip node describes the accumulated raster clip for the current // subtree. Note that the computed raster region in canvas space for a clip // node is independent from the transform and paint offset above. Also the @@ -143,16 +144,6 @@ const EffectPaintPropertyNodeOrAlias* current_effect; bool this_or_ancestor_opacity_is_zero = false; - // Whether newly created children should flatten their inherited transform - // (equivalently, draw into the plane of their parent). Should generally - // be updated whenever |transform| is; flattening only needs to happen - // to immediate children. - bool should_flatten_inherited_transform = false; - - // Rendering context for 3D sorting. See - // TransformPaintPropertyNode::RenderingContextId(). - unsigned rendering_context_id = 0; - // If the object is a flow thread, this records the clip rect for this // fragment. base::Optional<PhysicalRect> fragment_clip;
diff --git a/third_party/blink/renderer/core/scroll/mac_scrollbar_animator_impl.mm b/third_party/blink/renderer/core/scroll/mac_scrollbar_animator_impl.mm index 2b8db5c..c86071f 100644 --- a/third_party/blink/renderer/core/scroll/mac_scrollbar_animator_impl.mm +++ b/third_party/blink/renderer/core/scroll/mac_scrollbar_animator_impl.mm
@@ -146,7 +146,7 @@ if (!IsMainThread()) return; - if (!_scrollableArea) + if (!_scrollableArea || !_scrollableArea->GetMacScrollbarAnimator()) return; [scrollerImpPair setScrollerStyle:newRecommendedScrollerStyle];
diff --git a/third_party/blink/renderer/core/style/filter_operation.h b/third_party/blink/renderer/core/style/filter_operation.h index 09e9657..f04c0f6 100644 --- a/third_party/blink/renderer/core/style/filter_operation.h +++ b/third_party/blink/renderer/core/style/filter_operation.h
@@ -52,6 +52,7 @@ SEPIA, SATURATE, HUE_ROTATE, + LUMINANCE_TO_ALPHA, INVERT, OPACITY, BRIGHTNESS, @@ -69,6 +70,7 @@ case SEPIA: case SATURATE: case HUE_ROTATE: + case LUMINANCE_TO_ALPHA: case INVERT: case OPACITY: case BRIGHTNESS: @@ -154,8 +156,9 @@ } }; -// GRAYSCALE, SEPIA, SATURATE and HUE_ROTATE are variations on a basic color -// matrix effect. For HUE_ROTATE, the angle of rotation is stored in m_amount. +// GRAYSCALE, SEPIA, SATURATE, HUE_ROTATE and LUMINANCE_TO_ALPHA are variations +// on a basic color matrix effect. For HUE_ROTATE, the angle of rotation is +// stored in amount_. For LUMINANCE_TO_ALPHA amount_ is unused. class CORE_EXPORT BasicColorMatrixFilterOperation : public FilterOperation { public: BasicColorMatrixFilterOperation(double amount, OperationType type) @@ -200,7 +203,8 @@ FilterOperation::OperationType type = operation.GetType(); return type == FilterOperation::GRAYSCALE || type == FilterOperation::SEPIA || type == FilterOperation::SATURATE || - type == FilterOperation::HUE_ROTATE; + type == FilterOperation::HUE_ROTATE || + type == FilterOperation::LUMINANCE_TO_ALPHA; } template <>
diff --git a/third_party/blink/renderer/core/testing/internals.cc b/third_party/blink/renderer/core/testing/internals.cc index 6e00b4b..d171725c 100644 --- a/third_party/blink/renderer/core/testing/internals.cc +++ b/third_party/blink/renderer/core/testing/internals.cc
@@ -1012,62 +1012,50 @@ return To<ShadowRoot>(root)->ChildShadowRootCount(); } +namespace { + +bool CheckForFlatTreeExceptions(Node* node, ExceptionState& exception_state) { + if (node && !node->IsShadowRoot()) + return false; + exception_state.ThrowDOMException( + DOMExceptionCode::kInvalidAccessError, + "The node argument doesn't participate in the flat tree."); + return true; +} + +} // namespace + Node* Internals::nextSiblingInFlatTree(Node* node, ExceptionState& exception_state) { - DCHECK(node); - if (!node->CanParticipateInFlatTree()) { - exception_state.ThrowDOMException( - DOMExceptionCode::kInvalidAccessError, - "The node argument doesn't particite in the flat tree."); + if (CheckForFlatTreeExceptions(node, exception_state)) return nullptr; - } return FlatTreeTraversal::NextSibling(*node); } Node* Internals::firstChildInFlatTree(Node* node, ExceptionState& exception_state) { - DCHECK(node); - if (!node->CanParticipateInFlatTree()) { - exception_state.ThrowDOMException( - DOMExceptionCode::kInvalidAccessError, - "The node argument doesn't particite in the flat tree"); + if (CheckForFlatTreeExceptions(node, exception_state)) return nullptr; - } return FlatTreeTraversal::FirstChild(*node); } Node* Internals::lastChildInFlatTree(Node* node, ExceptionState& exception_state) { - DCHECK(node); - if (!node->CanParticipateInFlatTree()) { - exception_state.ThrowDOMException( - DOMExceptionCode::kInvalidAccessError, - "The node argument doesn't particite in the flat tree."); + if (CheckForFlatTreeExceptions(node, exception_state)) return nullptr; - } return FlatTreeTraversal::LastChild(*node); } Node* Internals::nextInFlatTree(Node* node, ExceptionState& exception_state) { - DCHECK(node); - if (!node->CanParticipateInFlatTree()) { - exception_state.ThrowDOMException( - DOMExceptionCode::kInvalidAccessError, - "The node argument doesn't particite in the flat tree."); + if (CheckForFlatTreeExceptions(node, exception_state)) return nullptr; - } return FlatTreeTraversal::Next(*node); } Node* Internals::previousInFlatTree(Node* node, ExceptionState& exception_state) { - DCHECK(node); - if (!node->CanParticipateInFlatTree()) { - exception_state.ThrowDOMException( - DOMExceptionCode::kInvalidAccessError, - "The node argument doesn't particite in the flat tree."); + if (CheckForFlatTreeExceptions(node, exception_state)) return nullptr; - } return FlatTreeTraversal::Previous(*node); }
diff --git a/third_party/blink/renderer/core/testing/null_execution_context.h b/third_party/blink/renderer/core/testing/null_execution_context.h index e7bc27c..ec4aec0 100644 --- a/third_party/blink/renderer/core/testing/null_execution_context.h +++ b/third_party/blink/renderer/core/testing/null_execution_context.h
@@ -12,6 +12,7 @@ #include "third_party/blink/renderer/bindings/core/v8/source_location.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/inspector/console_message.h" +#include "third_party/blink/renderer/core/inspector/inspector_audits_issue.h" #include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" @@ -41,6 +42,7 @@ void AddConsoleMessageImpl(ConsoleMessage*, bool discard_duplicates) override {} void AddInspectorIssue(mojom::blink::InspectorIssueInfoPtr) override {} + void AddInspectorIssue(AuditsIssue) override {} void ExceptionThrown(ErrorEvent*) override {} void SetUpSecurityContextForTesting();
diff --git a/third_party/blink/renderer/core/workers/worker_global_scope.cc b/third_party/blink/renderer/core/workers/worker_global_scope.cc index 4fffc62..8eee74f 100644 --- a/third_party/blink/renderer/core/workers/worker_global_scope.cc +++ b/third_party/blink/renderer/core/workers/worker_global_scope.cc
@@ -50,6 +50,7 @@ #include "third_party/blink/renderer/core/frame/user_activation.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/inspector/console_message_storage.h" +#include "third_party/blink/renderer/core/inspector/inspector_audits_issue.h" #include "third_party/blink/renderer/core/inspector/inspector_issue_storage.h" #include "third_party/blink/renderer/core/inspector/worker_inspector_controller.h" #include "third_party/blink/renderer/core/inspector/worker_thread_debugger.h" @@ -405,6 +406,11 @@ std::move(info)); } +void WorkerGlobalScope::AddInspectorIssue(AuditsIssue issue) { + GetThread()->GetInspectorIssueStorage()->AddInspectorIssue(this, + std::move(issue)); +} + CoreProbeSink* WorkerGlobalScope::GetProbeSink() { if (IsClosing()) return nullptr;
diff --git a/third_party/blink/renderer/core/workers/worker_global_scope.h b/third_party/blink/renderer/core/workers/worker_global_scope.h index 581a714a..eeb0f34 100644 --- a/third_party/blink/renderer/core/workers/worker_global_scope.h +++ b/third_party/blink/renderer/core/workers/worker_global_scope.h
@@ -268,6 +268,7 @@ void ImportScriptsInternal(const Vector<String>& urls); // ExecutionContext void AddInspectorIssue(mojom::blink::InspectorIssueInfoPtr) final; + void AddInspectorIssue(AuditsIssue) final; EventTarget* ErrorEventTarget() final { return this; } KURL url_;
diff --git a/third_party/blink/renderer/core/workers/worklet_global_scope.cc b/third_party/blink/renderer/core/workers/worklet_global_scope.cc index 651eebc9..bbbf732d 100644 --- a/third_party/blink/renderer/core/workers/worklet_global_scope.cc +++ b/third_party/blink/renderer/core/workers/worklet_global_scope.cc
@@ -15,9 +15,11 @@ #include "third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.h" #include "third_party/blink/renderer/core/execution_context/agent.h" #include "third_party/blink/renderer/core/frame/frame_console.h" +#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/inspector/console_message_storage.h" +#include "third_party/blink/renderer/core/inspector/inspector_audits_issue.h" #include "third_party/blink/renderer/core/inspector/inspector_issue_storage.h" #include "third_party/blink/renderer/core/inspector/main_thread_debugger.h" #include "third_party/blink/renderer/core/inspector/worker_thread_debugger.h" @@ -181,6 +183,15 @@ } } +void WorkletGlobalScope::AddInspectorIssue(AuditsIssue issue) { + if (IsMainThreadWorkletGlobalScope()) { + frame_->DomWindow()->AddInspectorIssue(std::move(issue)); + } else { + worker_thread_->GetInspectorIssueStorage()->AddInspectorIssue( + this, std::move(issue)); + } +} + void WorkletGlobalScope::ExceptionThrown(ErrorEvent* error_event) { if (IsMainThreadWorkletGlobalScope()) { MainThreadDebugger::Instance()->ExceptionThrown(this, error_event);
diff --git a/third_party/blink/renderer/core/workers/worklet_global_scope.h b/third_party/blink/renderer/core/workers/worklet_global_scope.h index c373f37e5..69ed239 100644 --- a/third_party/blink/renderer/core/workers/worklet_global_scope.h +++ b/third_party/blink/renderer/core/workers/worklet_global_scope.h
@@ -60,6 +60,7 @@ bool IsContextThread() const final; void AddConsoleMessageImpl(ConsoleMessage*, bool discard_duplicates) final; void AddInspectorIssue(mojom::blink::InspectorIssueInfoPtr) final; + void AddInspectorIssue(AuditsIssue) final; void ExceptionThrown(ErrorEvent*) final; CoreProbeSink* GetProbeSink() final; scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner(TaskType) final;
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc index 1753495b..597cb76c 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc
@@ -1921,6 +1921,9 @@ return; } + SCOPED_UMA_HISTOGRAM_TIMER( + "Accessibility.Performance.ProcessDeferredAccessibilityEvents"); + // Destroy and recreate any objects which are no longer valid, for example // they used AXNodeObject and now must be an AXLayoutObject, or vice-versa. // Also fires children changed on the parent of these nodes.
diff --git a/third_party/blink/renderer/modules/file_system_access/file_system_writable_file_stream.cc b/third_party/blink/renderer/modules/file_system_access/file_system_writable_file_stream.cc index e283056fc..d5669046 100644 --- a/third_party/blink/renderer/modules/file_system_access/file_system_writable_file_stream.cc +++ b/third_party/blink/renderer/modules/file_system_access/file_system_writable_file_stream.cc
@@ -41,9 +41,11 @@ auto* strategy = CountQueuingStrategy::Create(script_state, init); ScriptValue strategy_value = ScriptValue::From(script_state, strategy); - ExceptionState exception_state(script_state->GetIsolate(), - ExceptionState::kConstructionContext, + v8::Isolate* isolate = script_state->GetIsolate(); + ExceptionState exception_state(isolate, ExceptionState::kConstructionContext, "FileSystemWritableFileStream"); + v8::MicrotasksScope microtasks_scope( + isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); stream->InitInternal(script_state, underlying_sink_value, strategy_value, exception_state);
diff --git a/third_party/blink/renderer/modules/payments/payment_request.cc b/third_party/blink/renderer/modules/payments/payment_request.cc index 9c593b6..f2947e4c 100644 --- a/third_party/blink/renderer/modules/payments/payment_request.cc +++ b/third_party/blink/renderer/modules/payments/payment_request.cc
@@ -1725,7 +1725,9 @@ FROM_HERE); event_target->DispatchEvent(*event); - if (!event->is_waiting_for_update()) { + // Check whether the execution context still exists, because DispatchEvent() + // could have destroyed it. + if (GetExecutionContext() && !event->is_waiting_for_update()) { // DispatchEvent runs synchronously. The method is_waiting_for_update() // returns false if the merchant did not call event.updateWith() within the // event handler, which is optional, so the renderer sends a message to the
diff --git a/third_party/blink/renderer/modules/payments/payment_request_test.cc b/third_party/blink/renderer/modules/payments/payment_request_test.cc index a4c4944..5e4cf78 100644 --- a/third_party/blink/renderer/modules/payments/payment_request_test.cc +++ b/third_party/blink/renderer/modules/payments/payment_request_test.cc
@@ -4,13 +4,17 @@ #include "third_party/blink/renderer/modules/payments/payment_request.h" +#include <memory> + #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-blink-forward.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h" #include "third_party/blink/renderer/core/dom/document.h" +#include "third_party/blink/renderer/core/dom/events/native_event_listener.h" #include "third_party/blink/renderer/core/event_type_names.h" #include "third_party/blink/renderer/core/frame/local_frame.h" +#include "third_party/blink/renderer/core/testing/dummy_page_holder.h" #include "third_party/blink/renderer/core/testing/mock_function_scope.h" #include "third_party/blink/renderer/modules/payments/payment_test_helper.h" #include "third_party/blink/renderer/platform/bindings/exception_code.h" @@ -595,5 +599,47 @@ EXPECT_EQ("my_payment_id", request->id()); } +// An event listener that owns a page and destroys it when the event is invoked. +class PageDeleter final : public NativeEventListener { + public: + PageDeleter() + : holder_(V8TestingScope::CreateDummyPageHolder( + KURL("https://www.example.com"))) {} + ~PageDeleter() override = default; + + // NativeEventListener: + void Invoke(ExecutionContext*, Event*) override { holder_.reset(); } + + DummyPageHolder* page() { return holder_.get(); } + + private: + std::unique_ptr<DummyPageHolder> holder_; +}; + +TEST(PaymentRequestTest, NoCrashWhenPaymentMethodChangeEventDestroysContext) { + PageDeleter* page_deleter = MakeGarbageCollected<PageDeleter>(); + LocalFrame& frame = page_deleter->page()->GetFrame(); + v8::HandleScope handle_scope(ToIsolate(&frame)); + ScriptState* script_state = ScriptState::From( + ToV8ContextEvenIfDetached(&frame, DOMWrapperWorld::MainWorld())); + v8::Local<v8::Context> context(script_state->GetContext()); + v8::Context::Scope context_scope(context); + MockFunctionScope funcs(script_state); + + HeapVector<Member<PaymentMethodData>> method_data = + BuildPaymentMethodDataForTest(); + PaymentRequest* request = PaymentRequest::Create( + ExecutionContext::From(script_state), method_data, + BuildPaymentDetailsInitForTest(), ASSERT_NO_EXCEPTION); + request->setOnpaymentmethodchange(page_deleter); + request->show(script_state, ASSERT_NO_EXCEPTION) + .Then(funcs.ExpectNoCall(), funcs.ExpectNoCall()); + + // Trigger the event listener that deletes the execution context. + static_cast<payments::mojom::blink::PaymentRequestClient*>(request) + ->OnPaymentMethodChange(method_data.front()->supportedMethod(), + /*stringified_details=*/"{}"); +} + } // namespace } // namespace blink
diff --git a/third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc b/third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc index 4fd4dbad..4b159f26 100644 --- a/third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc +++ b/third_party/blink/renderer/modules/webcodecs/image_decoder_external.cc
@@ -91,6 +91,10 @@ visitor->Trace(exception); } +bool ImageDecoderExternal::DecodeRequest::IsFinal() const { + return result || exception || range_error_message; +} + // static ScriptPromise ImageDecoderExternal::isTypeSupported(ScriptState* script_state, String type) { @@ -429,7 +433,7 @@ } // Ignore already submitted requests and those already satisfied. - if (request->pending || request->exception || request->result) + if (request->pending || request->IsFinal()) continue; if (!data_complete_) { @@ -455,11 +459,9 @@ decode_weak_factory_.GetWeakPtr())); } - auto* new_end = - std::stable_partition(pending_decodes_.begin(), pending_decodes_.end(), - [](const auto& request) { - return !request->result && !request->exception; - }); + auto* new_end = std::stable_partition( + pending_decodes_.begin(), pending_decodes_.end(), + [](const auto& request) { return !request->IsFinal(); }); // Copy completed requests to a new local vector to avoid reentrancy issues // when resolving and rejecting the promises. @@ -470,10 +472,15 @@ // Note: Promise resolution may invoke calls into this class. for (auto& request : completed_decodes) { - if (request->exception) + if (request->exception) { request->resolver->Reject(request->exception); - else + } else if (request->range_error_message) { + ScriptState::Scope scope(script_state_); + request->resolver->Reject(V8ThrowException::CreateRangeError( + script_state_->GetIsolate(), *request->range_error_message)); + } else { request->resolver->Resolve(request->result); + } } } @@ -495,13 +502,12 @@ request->pending = false; if (result->status == ImageDecoderCore::Status::kIndexError) { - request->exception = MakeGarbageCollected<DOMException>( - DOMExceptionCode::kIndexSizeError, + request->range_error_message = ExceptionMessages::IndexOutsideRange<uint32_t>( "frame index", request->frame_index, 0, ExceptionMessages::kInclusiveBound, tracks_->selectedTrack().value()->frameCount(), - ExceptionMessages::kExclusiveBound)); + ExceptionMessages::kExclusiveBound); MaybeSatisfyPendingDecodes(); return; } @@ -512,11 +518,10 @@ // Once we're data complete, if no further image can be decoded, we should // reject the decode() since it can't be satisfied. if (data_complete_) { - request->exception = MakeGarbageCollected<DOMException>( - DOMExceptionCode::kIndexSizeError, - String::Format("Unexpected end of image. Request for frame index %d " - "can't be satisfied.", - request->frame_index)); + request->range_error_message = String::Format( + "Unexpected end of image. Request for frame index %d " + "can't be satisfied.", + request->frame_index); } MaybeSatisfyPendingDecodes();
diff --git a/third_party/blink/renderer/modules/webcodecs/image_decoder_external.h b/third_party/blink/renderer/modules/webcodecs/image_decoder_external.h index da622b6..8393208 100644 --- a/third_party/blink/renderer/modules/webcodecs/image_decoder_external.h +++ b/third_party/blink/renderer/modules/webcodecs/image_decoder_external.h
@@ -135,11 +135,12 @@ bool construction_succeeded_ = false; // Pending decode() requests. - struct DecodeRequest : public GarbageCollected<DecodeRequest> { + struct DecodeRequest final : public GarbageCollected<DecodeRequest> { DecodeRequest(ScriptPromiseResolver* resolver, uint32_t frame_index, bool complete_frames_only); void Trace(Visitor*) const; + bool IsFinal() const; Member<ScriptPromiseResolver> resolver; uint32_t frame_index; @@ -147,6 +148,8 @@ bool pending = false; base::Optional<size_t> bytes_read_index; Member<ImageDecodeResult> result; + + base::Optional<String> range_error_message; Member<DOMException> exception; }; HeapVector<Member<DecodeRequest>> pending_decodes_;
diff --git a/third_party/blink/renderer/modules/webcodecs/video_frame.cc b/third_party/blink/renderer/modules/webcodecs/video_frame.cc index e9cd4511..1c34d0a 100644 --- a/third_party/blink/renderer/modules/webcodecs/video_frame.cc +++ b/third_party/blink/renderer/modules/webcodecs/video_frame.cc
@@ -908,9 +908,7 @@ plane->setStride(layout.planes[i].stride); result.push_back(plane); } - auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); - resolver->Resolve(result); - return resolver->Promise(); + return ScriptPromise::Cast(script_state, ToV8(result, script_state)); } void VideoFrame::close() {
diff --git a/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.cc b/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.cc index 08022833..fde4fa7 100644 --- a/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.cc +++ b/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.cc
@@ -44,6 +44,7 @@ void XrEnterFullscreenObserver::RequestFullscreen( Element* fullscreen_element, + bool setup_for_dom_overlay, base::OnceCallback<void(bool)> on_completed) { DCHECK(!on_completed_); DCHECK(fullscreen_element); @@ -84,11 +85,16 @@ // immersive session had required a user activation state, but that may have // expired by now due to the user taking time to respond to the consent // prompt. - ScopedAllowFullscreen scope(ScopedAllowFullscreen::kXrOverlay); + ScopedAllowFullscreen scope(setup_for_dom_overlay + ? ScopedAllowFullscreen::kXrOverlay + : ScopedAllowFullscreen::kXrSession); - Fullscreen::RequestFullscreen(*fullscreen_element_, options, - FullscreenRequestType::kUnprefixed | - FullscreenRequestType::kForXrOverlay); + FullscreenRequestType request_type = FullscreenRequestType::kUnprefixed; + if (setup_for_dom_overlay) { + request_type = request_type | FullscreenRequestType::kForXrOverlay; + } + + Fullscreen::RequestFullscreen(*fullscreen_element_, options, request_type); if (!wait_for_fullscreen_change) { // Element was already fullscreen, proceed with session creation.
diff --git a/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.h b/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.h index 8b8756c0..d687dc6 100644 --- a/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.h +++ b/third_party/blink/renderer/modules/xr/xr_enter_fullscreen_observer.h
@@ -26,6 +26,7 @@ // Attempt to enter fullscreen with |element| as the root. |on_completed| will // be notified with whether or not fullscreen was successfully entered. void RequestFullscreen(Element* element, + bool setup_for_dom_overlay, base::OnceCallback<void(bool)> on_completed); void Trace(Visitor*) const override;
diff --git a/third_party/blink/renderer/modules/xr/xr_session.cc b/third_party/blink/renderer/modules/xr/xr_session.cc index cf78b72..eec8382 100644 --- a/third_party/blink/renderer/modules/xr/xr_session.cc +++ b/third_party/blink/renderer/modules/xr/xr_session.cc
@@ -2018,7 +2018,8 @@ // cross-origin content. If that's the case, the input source is set as // invisible, and must not return poses or hit test results. bool hide_input_source = false; - if (overlay_element_ && input_state->overlay_pointer_position) { + if (IsFeatureEnabled(device::mojom::XRSessionFeature::DOM_OVERLAY) && + overlay_element_ && input_state->overlay_pointer_position) { input_source->ProcessOverlayHitTest(overlay_element_, input_state); if (!stored_input_source && !input_source->IsVisible()) { DVLOG(2) << __func__ << ": (new) hidden_input_source";
diff --git a/third_party/blink/renderer/modules/xr/xr_system.cc b/third_party/blink/renderer/modules/xr/xr_system.cc index 7dc5b990..143424a14 100644 --- a/third_party/blink/renderer/modules/xr/xr_system.cc +++ b/third_party/blink/renderer/modules/xr/xr_system.cc
@@ -6,6 +6,7 @@ #include <utility> +#include "build/build_config.h" #include "device/vr/public/mojom/vr_service.mojom-blink.h" #include "services/metrics/public/cpp/ukm_builders.h" #include "third_party/blink/public/common/browser_interface_broker_proxy.h" @@ -1116,17 +1117,10 @@ void XRSystem::DoRequestSession( PendingRequestSessionQuery* query, device::mojom::blink::XRSessionOptionsPtr session_options) { - // In DOM overlay mode, there's an additional step before an immersive-ar - // session can start, we need to enter fullscreen mode by setting the - // appropriate element as fullscreen from the Renderer, then waiting for the - // browser side to send an event indicating success or failure. - auto callback = - query->DOMOverlayElement() - ? WTF::Bind(&XRSystem::OnRequestSessionSetupForDomOverlay, - WrapWeakPersistent(this), WrapPersistent(query)) - : WTF::Bind(&XRSystem::OnRequestSessionReturned, - WrapWeakPersistent(this), WrapPersistent(query)); - service_->RequestSession(std::move(session_options), std::move(callback)); + service_->RequestSession( + std::move(session_options), + WTF::Bind(&XRSystem::OnRequestSessionReturned, WrapWeakPersistent(this), + WrapPersistent(query))); } void XRSystem::RequestInlineSession(PendingRequestSessionQuery* query, @@ -1455,39 +1449,72 @@ query->Resolve(supports_session); } -void XRSystem::OnRequestSessionSetupForDomOverlay( +void XRSystem::OnRequestSessionReturned( PendingRequestSessionQuery* query, device::mojom::blink::RequestSessionResultPtr result) { - DCHECK(query->DOMOverlayElement()); - if (result->is_success()) { - // Success. Now request fullscreen mode and continue with - // OnRequestSessionReturned once that completes. - fullscreen_enter_observer_ = - MakeGarbageCollected<XrEnterFullscreenObserver>(); - fullscreen_enter_observer_->RequestFullscreen( - query->DOMOverlayElement(), - WTF::Bind(&XRSystem::OnFullscreenConfigured, WrapPersistent(this), - WrapPersistent(query), std::move(result))); - } else { - // Session request failed, continue processing that normally. - OnRequestSessionReturned(query, std::move(result)); + // If session creation failed, move straight on to processing that. + if (!result->is_success()) { + FinishSessionCreation(query, std::move(result)); + return; } + + Element* fullscreen_element = nullptr; + const auto& enabled_features = + result->get_success()->session->enabled_features; + if (base::Contains(enabled_features, + device::mojom::XRSessionFeature::DOM_OVERLAY)) { + fullscreen_element = query->DOMOverlayElement(); + } + + // Only setup for dom_overlay if the query actually had a DOMOverlayElement + // and the session enabled dom_overlay. (Note that fullscreen_element will be + // null if the feature was not enabled). + bool setup_for_dom_overlay = !!fullscreen_element; + +// On Android, due to the way the device renderer is configured, we always need +// to enter fullscreen if we're starting an AR session, so if we aren't supposed +// to enter DOMOverlay, we simply fullscreen the document body. +#if defined(OS_ANDROID) + if (!fullscreen_element && + query->mode() == device::mojom::blink::XRSessionMode::kImmersiveAr) { + fullscreen_element = DomWindow()->document()->body(); + } +#endif + + // If we don't need to enter fullscreen continue with session setup. + if (!fullscreen_element) { + FinishSessionCreation(query, std::move(result)); + return; + } + + // At this point, we know that we have an element that we need to make + // fullscreen, so we do that before we continue setting up the session. + fullscreen_enter_observer_ = + MakeGarbageCollected<XrEnterFullscreenObserver>(); + fullscreen_enter_observer_->RequestFullscreen( + fullscreen_element, setup_for_dom_overlay, + WTF::Bind(&XRSystem::OnFullscreenConfigured, WrapPersistent(this), + WrapPersistent(query), std::move(result))); } void XRSystem::OnFullscreenConfigured( PendingRequestSessionQuery* query, device::mojom::blink::RequestSessionResultPtr result, bool fullscreen_succeeded) { + // At this point we no longer need the enter observer, so go ahead and destroy + // it. + fullscreen_enter_observer_ = nullptr; + if (fullscreen_succeeded) { - OnRequestSessionReturned(query, std::move(result)); + FinishSessionCreation(query, std::move(result)); } else { - OnRequestSessionReturned( + FinishSessionCreation( query, device::mojom::blink::RequestSessionResult::NewFailureReason( device::mojom::RequestSessionError::FULLSCREEN_ERROR)); } } -void XRSystem::OnRequestSessionReturned( +void XRSystem::FinishSessionCreation( PendingRequestSessionQuery* query, device::mojom::blink::RequestSessionResultPtr result) { DVLOG(2) << __func__; @@ -1501,10 +1528,6 @@ has_outstanding_immersive_request_ = false; } - // Clean up the fullscreen event manager which may have been added for - // DOM overlay setup. - fullscreen_enter_observer_ = nullptr; - if (!result->is_success()) { // |service_| does not support the requested mode. Attempt to create a // sensorless session. @@ -1567,15 +1590,14 @@ session->OnEnvironmentProviderCreated(); } - if (query->mode() == device::mojom::blink::XRSessionMode::kImmersiveAr) { - DCHECK(DomWindow()); - if (query->HasFeature(device::mojom::XRSessionFeature::DOM_OVERLAY)) { - DCHECK(query->DOMOverlayElement()); - // The session is using DOM overlay mode. At this point the overlay - // element is already in fullscreen mode, and the session can - // proceed. - session->SetDOMOverlayElement(query->DOMOverlayElement()); - } + auto dom_overlay_feature = device::mojom::XRSessionFeature::DOM_OVERLAY; + if (query->mode() == device::mojom::blink::XRSessionMode::kImmersiveAr && + query->HasFeature(dom_overlay_feature) && + base::Contains(enabled_features, dom_overlay_feature)) { + DCHECK(query->DOMOverlayElement()); + // The session is using DOM overlay mode. At this point the overlay + // element is already in fullscreen mode, and the session can proceed. + session->SetDOMOverlayElement(query->DOMOverlayElement()); } if (query->mode() == device::mojom::blink::XRSessionMode::kImmersiveVr &&
diff --git a/third_party/blink/renderer/modules/xr/xr_system.h b/third_party/blink/renderer/modules/xr/xr_system.h index 6f52a7d..d4af864 100644 --- a/third_party/blink/renderer/modules/xr/xr_system.h +++ b/third_party/blink/renderer/modules/xr/xr_system.h
@@ -359,14 +359,14 @@ void DoRequestSession( PendingRequestSessionQuery* query, device::mojom::blink::XRSessionOptionsPtr session_options); - void OnRequestSessionSetupForDomOverlay( + void OnRequestSessionReturned( PendingRequestSessionQuery*, device::mojom::blink::RequestSessionResultPtr result); void OnFullscreenConfigured( PendingRequestSessionQuery* query, device::mojom::blink::RequestSessionResultPtr result, bool fullscreen_succeeded); - void OnRequestSessionReturned( + void FinishSessionCreation( PendingRequestSessionQuery*, device::mojom::blink::RequestSessionResultPtr result); void OnSupportsSessionReturned(PendingSupportsSessionQuery*,
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index c23c451a..42b197fd 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1339,6 +1339,8 @@ "peerconnection/rtc_video_decoder_adapter.h", "peerconnection/rtc_video_decoder_factory.cc", "peerconnection/rtc_video_decoder_factory.h", + "peerconnection/rtc_video_decoder_fallback_recorder.cc", + "peerconnection/rtc_video_decoder_fallback_recorder.h", "peerconnection/rtc_video_decoder_stream_adapter.cc", "peerconnection/rtc_video_decoder_stream_adapter.h", "peerconnection/rtc_video_encoder.cc",
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc index 7bd9a20..9ba8adc 100644 --- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc +++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
@@ -145,7 +145,8 @@ static_cast<const ForeignLayerDisplayItem&>( pending_layer.FirstDisplayItem()); layer = foreign_layer_display_item.GetLayer(); - layer_offset = FloatPoint(foreign_layer_display_item.Offset()); + layer_offset = + FloatPoint(foreign_layer_display_item.VisualRect().Location()); } layer->SetOffsetToTransformParent(gfx::Vector2dF( layer_offset + pending_layer.offset_of_decomposited_transforms));
diff --git a/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc b/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc index de1a9d5..305a5d4 100644 --- a/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc +++ b/third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.cc
@@ -969,7 +969,7 @@ int cc_effect_id_for_backdrop_effect = cc::EffectTree::kInvalidNodeId; for (auto i = pending_clips.size(); i--;) { - const auto& pending_clip = pending_clips[i]; + auto& pending_clip = pending_clips[i]; int clip_id = backdrop_effect_clip_id; // For a non-trivial clip, the synthetic effect is an isolation to enclose @@ -979,6 +979,26 @@ cc::EffectNode& synthetic_effect = *GetEffectTree().Node( GetEffectTree().Insert(cc::EffectNode(), current_.effect_id)); + if (pending_clip.type & CcEffectType::kSyntheticFor2dAxisAlignment) { + if (should_realize_backdrop_effect) { + // We need a synthetic mask clip layer for the non-2d-axis-aligned clip + // when we also need to realize a backdrop effect. + pending_clip.type = static_cast<CcEffectType>( + pending_clip.type | CcEffectType::kSyntheticForNonTrivialClip); + } else { + synthetic_effect.stable_id = + CompositorElementIdFromUniqueObjectId(NewUniqueObjectId()) + .GetStableId(); + synthetic_effect.render_surface_reason = + cc::RenderSurfaceReason::kClipAxisAlignment; + // The clip of the synthetic effect is the parent of the clip, so that + // the clip itself will be applied in the render surface. + DCHECK(pending_clip.clip->UnaliasedParent()); + clip_id = + EnsureCompositorClipNode(*pending_clip.clip->UnaliasedParent()); + } + } + if (pending_clip.type & CcEffectType::kSyntheticForNonTrivialClip) { if (clip_id == cc::ClipTree::kInvalidNodeId) clip_id = EnsureCompositorClipNode(*pending_clip.clip); @@ -1013,18 +1033,6 @@ pending_synthetic_mask_layers_.insert(synthetic_effect.id); } - if (pending_clip.type & CcEffectType::kSyntheticFor2dAxisAlignment) { - synthetic_effect.stable_id = - CompositorElementIdFromUniqueObjectId(NewUniqueObjectId()) - .GetStableId(); - synthetic_effect.render_surface_reason = - cc::RenderSurfaceReason::kClipAxisAlignment; - // The clip of the synthetic effect is the parent of the clip, so that - // the clip itself will be applied in the render surface. - DCHECK(pending_clip.clip->UnaliasedParent()); - clip_id = EnsureCompositorClipNode(*pending_clip.clip->UnaliasedParent()); - } - const TransformPaintPropertyNode* transform = nullptr; if (should_realize_backdrop_effect) { // Move the effect node containing backdrop effects up to the outermost
diff --git a/third_party/blink/renderer/platform/graphics/gradient.cc b/third_party/blink/renderer/platform/graphics/gradient.cc index fc33db5..01fcc6e 100644 --- a/third_party/blink/renderer/platform/graphics/gradient.cc +++ b/third_party/blink/renderer/platform/graphics/gradient.cc
@@ -73,7 +73,7 @@ AddColorStop(stop); } -void Gradient::SortStopsIfNecessary() { +void Gradient::SortStopsIfNecessary() const { if (stops_sorted_) return; @@ -127,7 +127,7 @@ } sk_sp<PaintShader> Gradient::CreateShaderInternal( - const SkMatrix& local_matrix) { + const SkMatrix& local_matrix) const { SortStopsIfNecessary(); DCHECK(stops_sorted_); @@ -163,7 +163,8 @@ return shader; } -void Gradient::ApplyToFlags(PaintFlags& flags, const SkMatrix& local_matrix) { +void Gradient::ApplyToFlags(PaintFlags& flags, + const SkMatrix& local_matrix) const { if (!cached_shader_ || local_matrix != cached_shader_->GetLocalMatrix() || flags.getColorFilter().get() != color_filter_.get()) { color_filter_ = flags.getColorFilter();
diff --git a/third_party/blink/renderer/platform/graphics/gradient.h b/third_party/blink/renderer/platform/graphics/gradient.h index 05986e2..5856982b 100644 --- a/third_party/blink/renderer/platform/graphics/gradient.h +++ b/third_party/blink/renderer/platform/graphics/gradient.h
@@ -106,7 +106,7 @@ } void AddColorStops(const Vector<Gradient::ColorStop>&); - void ApplyToFlags(PaintFlags&, const SkMatrix& local_matrix); + void ApplyToFlags(PaintFlags&, const SkMatrix& local_matrix) const; protected: Gradient(Type, GradientSpreadMethod, ColorInterpolation, DegenerateHandling); @@ -125,11 +125,9 @@ } private: - sk_sp<PaintShader> CreateShaderInternal(const SkMatrix& local_matrix); + sk_sp<PaintShader> CreateShaderInternal(const SkMatrix& local_matrix) const; - sk_sp<SkColorFilter> color_filter_; - - void SortStopsIfNecessary(); + void SortStopsIfNecessary() const; void FillSkiaStops(ColorBuffer&, OffsetBuffer&) const; const Type type_; @@ -137,10 +135,11 @@ const ColorInterpolation color_interpolation_; const DegenerateHandling degenerate_handling_; - Vector<ColorStop, 2> stops_; - bool stops_sorted_; + mutable Vector<ColorStop, 2> stops_; + mutable bool stops_sorted_; mutable sk_sp<PaintShader> cached_shader_; + mutable sk_sp<SkColorFilter> color_filter_; DISALLOW_COPY_AND_ASSIGN(Gradient); };
diff --git a/third_party/blink/renderer/platform/graphics/image_pattern.cc b/third_party/blink/renderer/platform/graphics/image_pattern.cc index ac17c96..5b06140 100644 --- a/third_party/blink/renderer/platform/graphics/image_pattern.cc +++ b/third_party/blink/renderer/platform/graphics/image_pattern.cc
@@ -18,7 +18,8 @@ ImagePattern::ImagePattern(scoped_refptr<Image> image, RepeatMode repeat_mode) : Pattern(repeat_mode), tile_image_(image->PaintImageForCurrentFrame()) {} -sk_sp<PaintShader> ImagePattern::CreateShader(const SkMatrix& local_matrix) { +sk_sp<PaintShader> ImagePattern::CreateShader( + const SkMatrix& local_matrix) const { if (!tile_image_) { return PaintShader::MakeColor(SK_ColorTRANSPARENT); }
diff --git a/third_party/blink/renderer/platform/graphics/image_pattern.h b/third_party/blink/renderer/platform/graphics/image_pattern.h index d58b1ec..7937ff6 100644 --- a/third_party/blink/renderer/platform/graphics/image_pattern.h +++ b/third_party/blink/renderer/platform/graphics/image_pattern.h
@@ -19,7 +19,7 @@ bool IsTextureBacked() const override; protected: - sk_sp<PaintShader> CreateShader(const SkMatrix&) override; + sk_sp<PaintShader> CreateShader(const SkMatrix&) const override; private: ImagePattern(scoped_refptr<Image>, RepeatMode);
diff --git a/third_party/blink/renderer/platform/graphics/paint/cull_rect.cc b/third_party/blink/renderer/platform/graphics/paint/cull_rect.cc index 1ae78e8..c2168ff5 100644 --- a/third_party/blink/renderer/platform/graphics/paint/cull_rect.cc +++ b/third_party/blink/renderer/platform/graphics/paint/cull_rect.cc
@@ -196,7 +196,7 @@ return true; } -void CullRect::ApplyPaintProperties( +bool CullRect::ApplyPaintProperties( const PropertyTreeState& root, const PropertyTreeState& source, const PropertyTreeState& destination, @@ -235,8 +235,7 @@ // Either the transform or the clip of |source| is not an ancestor of // |destination|. Map infinite rect from the root. *this = Infinite(); - ApplyPaintProperties(root, root, destination, old_cull_rect); - return; + return ApplyPaintProperties(root, root, destination, old_cull_rect); } // These are either the source transform/clip or the last scroll @@ -263,7 +262,7 @@ PropertyTreeState(*last_transform, *last_clip, effect_root), PropertyTreeState(*scroll_translation->UnaliasedParent(), *clip, effect_root))) - return; + return false; last_scroll_translation_result = ApplyScrollTranslation(root.Transform(), *scroll_translation); @@ -275,7 +274,7 @@ if (!ApplyPaintPropertiesWithoutExpansion( PropertyTreeState(*last_transform, *last_clip, effect_root), destination)) - return; + return false; // Since the cull rect mapping above can produce extremely large numbers in // cases of perspective, try our best to "normalize" the result by ensuring @@ -323,6 +322,8 @@ if (expanded && old_cull_rect && !ChangedEnough(*old_cull_rect, expansion_bounds)) rect_ = old_cull_rect->Rect(); + + return expanded; } bool CullRect::ChangedEnough(const CullRect& old_cull_rect,
diff --git a/third_party/blink/renderer/platform/graphics/paint/cull_rect.h b/third_party/blink/renderer/platform/graphics/paint/cull_rect.h index 87c4eab2..50053cc7 100644 --- a/third_party/blink/renderer/platform/graphics/paint/cull_rect.h +++ b/third_party/blink/renderer/platform/graphics/paint/cull_rect.h
@@ -69,7 +69,8 @@ // non-scrolling ones). |root| is used to calculate the expansion distance in // the local space, to make the expansion distance approximately the same in // the root space. - void ApplyPaintProperties(const PropertyTreeState& root, + // Returns whether the cull rect has been expanded. + bool ApplyPaintProperties(const PropertyTreeState& root, const PropertyTreeState& source, const PropertyTreeState& destination, const base::Optional<CullRect>& old_cull_rect);
diff --git a/third_party/blink/renderer/platform/graphics/paint/display_item.h b/third_party/blink/renderer/platform/graphics/paint/display_item.h index 9fbc658a..a8eb1c7 100644 --- a/third_party/blink/renderer/platform/graphics/paint/display_item.h +++ b/third_party/blink/renderer/platform/graphics/paint/display_item.h
@@ -169,7 +169,9 @@ static_cast<unsigned>(client.VisualRectOutsetForRasterEffects())), draws_content_(draws_content), is_cacheable_(client.IsCacheable()), - is_tombstone_(false) { + is_tombstone_(false), + known_to_be_opaque_is_set_(false), + known_to_be_opaque_(false) { // |derived_size| must fit in |derived_size_|. // If it doesn't, enlarge |derived_size_| and fix this assert. SECURITY_DCHECK(derived_size == derived_size_); @@ -302,6 +304,11 @@ unsigned draws_content_ : 1; unsigned is_cacheable_ : 1; unsigned is_tombstone_ : 1; + + protected: + // These are for DrawingDisplayItem to save memory. + mutable unsigned known_to_be_opaque_is_set_ : 1; + mutable unsigned known_to_be_opaque_ : 1; }; inline bool operator==(const DisplayItem::Id& a, const DisplayItem::Id& b) {
diff --git a/third_party/blink/renderer/platform/graphics/paint/drawing_display_item.h b/third_party/blink/renderer/platform/graphics/paint/drawing_display_item.h index d5e74b1..7aabddc 100644 --- a/third_party/blink/renderer/platform/graphics/paint/drawing_display_item.h +++ b/third_party/blink/renderer/platform/graphics/paint/drawing_display_item.h
@@ -56,8 +56,6 @@ private: bool CalculateKnownToBeOpaque(const PaintRecord*) const; - mutable bool known_to_be_opaque_is_set_ : 1; - mutable bool known_to_be_opaque_ : 1; sk_sp<const PaintRecord> record_; }; @@ -72,8 +70,6 @@ sizeof(*this), visual_rect, /* draws_content*/ record && record->size()), - known_to_be_opaque_is_set_(false), - known_to_be_opaque_(false), record_(DrawsContent() ? std::move(record) : nullptr) { DCHECK(IsDrawingType(type)); }
diff --git a/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.cc b/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.cc index a0236fa..52c2622 100644 --- a/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.cc +++ b/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.cc
@@ -24,7 +24,6 @@ type, sizeof(*this), IntRect(offset, IntSize(layer->bounds()))), - offset_(offset), layer_(std::move(layer)) { DCHECK(IsForeignLayerType(type)); } @@ -39,8 +38,6 @@ void ForeignLayerDisplayItem::PropertiesAsJSON(JSONObject& json) const { DisplayItem::PropertiesAsJSON(json); json.SetInteger("layer", GetLayer()->id()); - json.SetDouble("offset_x", Offset().X()); - json.SetDouble("offset_y", Offset().Y()); } #endif
diff --git a/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h b/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h index df44e67..bd58691 100644 --- a/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h +++ b/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h
@@ -36,10 +36,7 @@ void PropertiesAsJSON(JSONObject&) const final; #endif - IntPoint Offset() const { return offset_; } - private: - IntPoint offset_; scoped_refptr<cc::Layer> layer_; };
diff --git a/third_party/blink/renderer/platform/graphics/paint/scrollbar_display_item.cc b/third_party/blink/renderer/platform/graphics/paint/scrollbar_display_item.cc index 2bc052e..3995ac8e 100644 --- a/third_party/blink/renderer/platform/graphics/paint/scrollbar_display_item.cc +++ b/third_party/blink/renderer/platform/graphics/paint/scrollbar_display_item.cc
@@ -29,57 +29,56 @@ sizeof(*this), visual_rect, /*draws_content*/ true), - scrollbar_(std::move(scrollbar)), - scroll_translation_(scroll_translation), - element_id_(element_id) { + data_(new Data{std::move(scrollbar), scroll_translation, element_id}) { DCHECK(IsScrollbar()); DCHECK(!scroll_translation || scroll_translation->ScrollNode()); } sk_sp<const PaintRecord> ScrollbarDisplayItem::Paint() const { - if (record_) { - DCHECK(!scrollbar_->NeedsRepaintPart( + auto* scrollbar = data_->scrollbar_.get(); + if (data_->record_) { + DCHECK(!scrollbar->NeedsRepaintPart( cc::ScrollbarPart::TRACK_BUTTONS_TICKMARKS)); - DCHECK(!scrollbar_->NeedsRepaintPart(cc::ScrollbarPart::THUMB)); - return record_; + DCHECK(!scrollbar->NeedsRepaintPart(cc::ScrollbarPart::THUMB)); + return data_->record_; } PaintRecorder recorder; const IntRect& rect = VisualRect(); recorder.beginRecording(rect); auto* canvas = recorder.getRecordingCanvas(); - scrollbar_->PaintPart(canvas, cc::ScrollbarPart::TRACK_BUTTONS_TICKMARKS, - rect); - gfx::Rect thumb_rect = scrollbar_->ThumbRect(); + scrollbar->PaintPart(canvas, cc::ScrollbarPart::TRACK_BUTTONS_TICKMARKS, + rect); + gfx::Rect thumb_rect = data_->scrollbar_->ThumbRect(); thumb_rect.Offset(rect.X(), rect.Y()); - scrollbar_->PaintPart(canvas, cc::ScrollbarPart::THUMB, thumb_rect); + scrollbar->PaintPart(canvas, cc::ScrollbarPart::THUMB, thumb_rect); - record_ = recorder.finishRecordingAsPicture(); - return record_; + data_->record_ = recorder.finishRecordingAsPicture(); + return data_->record_; } scoped_refptr<cc::ScrollbarLayerBase> ScrollbarDisplayItem::CreateOrReuseLayer( cc::ScrollbarLayerBase* existing_layer) const { // This function is called when the scrollbar is composited. We don't need // record_ which is for non-composited scrollbars. - record_ = nullptr; + data_->record_ = nullptr; - auto layer = - cc::ScrollbarLayerBase::CreateOrReuse(scrollbar_, existing_layer); + auto* scrollbar = data_->scrollbar_.get(); + auto layer = cc::ScrollbarLayerBase::CreateOrReuse(scrollbar, existing_layer); layer->SetIsDrawable(true); - if (!scrollbar_->IsSolidColor()) + if (!scrollbar->IsSolidColor()) layer->SetHitTestable(true); - layer->SetElementId(element_id_); + layer->SetElementId(data_->element_id_); layer->SetScrollElementId( - scroll_translation_ - ? scroll_translation_->ScrollNode()->GetCompositorElementId() + data_->scroll_translation_ + ? data_->scroll_translation_->ScrollNode()->GetCompositorElementId() : CompositorElementId()); layer->SetOffsetToTransformParent( gfx::Vector2dF(FloatPoint(VisualRect().Location()))); layer->SetBounds(gfx::Size(VisualRect().Size())); - if (scrollbar_->NeedsRepaintPart(cc::ScrollbarPart::THUMB) || - scrollbar_->NeedsRepaintPart(cc::ScrollbarPart::TRACK_BUTTONS_TICKMARKS)) + if (scrollbar->NeedsRepaintPart(cc::ScrollbarPart::THUMB) || + scrollbar->NeedsRepaintPart(cc::ScrollbarPart::TRACK_BUTTONS_TICKMARKS)) layer->SetNeedsDisplay(); return layer; } @@ -94,15 +93,16 @@ // can catch most under-invalidation cases. const auto& other_scrollbar_item = static_cast<const ScrollbarDisplayItem&>(other); - return scroll_translation_ == other_scrollbar_item.scroll_translation_ && - element_id_ == other_scrollbar_item.element_id_; + return data_->scroll_translation_ == + other_scrollbar_item.data_->scroll_translation_ && + data_->element_id_ == other_scrollbar_item.data_->element_id_; } #if DCHECK_IS_ON() void ScrollbarDisplayItem::PropertiesAsJSON(JSONObject& json) const { DisplayItem::PropertiesAsJSON(json); json.SetString("scrollTranslation", - String::Format("%p", scroll_translation_)); + String::Format("%p", data_->scroll_translation_)); } #endif
diff --git a/third_party/blink/renderer/platform/graphics/paint/scrollbar_display_item.h b/third_party/blink/renderer/platform/graphics/paint/scrollbar_display_item.h index 991c3d89..2ac7daa9 100644 --- a/third_party/blink/renderer/platform/graphics/paint/scrollbar_display_item.h +++ b/third_party/blink/renderer/platform/graphics/paint/scrollbar_display_item.h
@@ -37,9 +37,9 @@ CompositorElementId element_id); const TransformPaintPropertyNode* ScrollTranslation() const { - return scroll_translation_; + return data_->scroll_translation_; } - CompositorElementId ElementId() const { return element_id_; } + CompositorElementId ElementId() const { return data_->element_id_; } // Paints the scrollbar into the internal paint record, for non-composited // scrollbar. @@ -67,11 +67,19 @@ CompositorElementId element_id); private: - scoped_refptr<cc::Scrollbar> scrollbar_; - const TransformPaintPropertyNode* scroll_translation_; - CompositorElementId element_id_; - // This is lazily created for non-composited scrollbar. - mutable sk_sp<const PaintRecord> record_; + struct Data { + scoped_refptr<cc::Scrollbar> scrollbar_; + const TransformPaintPropertyNode* scroll_translation_; + CompositorElementId element_id_; + // This is lazily created for non-composited scrollbar. + mutable sk_sp<const PaintRecord> record_; + }; + // This is to make ScrollbarDisplayItem not bigger than other DisplayItems, + // so that we can store different types of DisplayItems in DisplayItemList + // with fixed item size without big gaps. The unique_ptr indirection won't + // affect performance much because ScrollbarDisplayItems are rare in the + // painted result. + std::unique_ptr<Data> data_; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/paint_record_pattern.cc b/third_party/blink/renderer/platform/graphics/paint_record_pattern.cc index 11511abf..ef26311 100644 --- a/third_party/blink/renderer/platform/graphics/paint_record_pattern.cc +++ b/third_party/blink/renderer/platform/graphics/paint_record_pattern.cc
@@ -34,7 +34,7 @@ PaintRecordPattern::~PaintRecordPattern() = default; sk_sp<PaintShader> PaintRecordPattern::CreateShader( - const SkMatrix& local_matrix) { + const SkMatrix& local_matrix) const { return PaintShader::MakePaintRecord(tile_record_, tile_record_bounds_, SkTileMode::kRepeat, SkTileMode::kRepeat, &local_matrix);
diff --git a/third_party/blink/renderer/platform/graphics/paint_record_pattern.h b/third_party/blink/renderer/platform/graphics/paint_record_pattern.h index 47f98e1..5b1b60c 100644 --- a/third_party/blink/renderer/platform/graphics/paint_record_pattern.h +++ b/third_party/blink/renderer/platform/graphics/paint_record_pattern.h
@@ -20,7 +20,7 @@ ~PaintRecordPattern() override; protected: - sk_sp<PaintShader> CreateShader(const SkMatrix&) override; + sk_sp<PaintShader> CreateShader(const SkMatrix&) const override; private: PaintRecordPattern(sk_sp<PaintRecord>,
diff --git a/third_party/blink/renderer/platform/graphics/pattern.cc b/third_party/blink/renderer/platform/graphics/pattern.cc index f38adf2..0167da2 100644 --- a/third_party/blink/renderer/platform/graphics/pattern.cc +++ b/third_party/blink/renderer/platform/graphics/pattern.cc
@@ -55,7 +55,8 @@ Pattern::~Pattern() = default; -void Pattern::ApplyToFlags(PaintFlags& flags, const SkMatrix& local_matrix) { +void Pattern::ApplyToFlags(PaintFlags& flags, + const SkMatrix& local_matrix) const { if (!cached_shader_ || local_matrix != cached_shader_->GetLocalMatrix()) cached_shader_ = CreateShader(local_matrix);
diff --git a/third_party/blink/renderer/platform/graphics/pattern.h b/third_party/blink/renderer/platform/graphics/pattern.h index 60656a9..ba1a98a 100644 --- a/third_party/blink/renderer/platform/graphics/pattern.h +++ b/third_party/blink/renderer/platform/graphics/pattern.h
@@ -60,7 +60,7 @@ RepeatMode = kRepeatModeXY); virtual ~Pattern(); - void ApplyToFlags(cc::PaintFlags&, const SkMatrix&); + void ApplyToFlags(cc::PaintFlags&, const SkMatrix&) const; bool IsRepeatX() const { return repeat_mode_ & kRepeatModeX; } bool IsRepeatY() const { return repeat_mode_ & kRepeatModeY; } @@ -69,11 +69,12 @@ virtual bool IsTextureBacked() const { return false; } protected: - virtual sk_sp<PaintShader> CreateShader(const SkMatrix&) = 0; + explicit Pattern(RepeatMode); + + virtual sk_sp<PaintShader> CreateShader(const SkMatrix&) const = 0; RepeatMode repeat_mode_; - Pattern(RepeatMode); mutable sk_sp<PaintShader> cached_shader_; private:
diff --git a/third_party/blink/renderer/platform/graphics/video_frame_image_util.h b/third_party/blink/renderer/platform/graphics/video_frame_image_util.h index 8532d29..216262c 100644 --- a/third_party/blink/renderer/platform/graphics/video_frame_image_util.h +++ b/third_party/blink/renderer/platform/graphics/video_frame_image_util.h
@@ -62,6 +62,8 @@ // If |prefer_tagged_orientation| is true, CreateImageFromVideoFrame() will just // tag the StaticBitmapImage with the correct orientation ("soft flip") instead // of drawing the frame with the correct orientation ("hard flip"). +// +// Returns nullptr if a StaticBitmapImage can't be created. PLATFORM_EXPORT scoped_refptr<StaticBitmapImage> CreateImageFromVideoFrame( scoped_refptr<media::VideoFrame> frame, bool allow_zero_copy_images = true,
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc index 10d9b90..ea34dcf6 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_adapter.cc
@@ -31,6 +31,7 @@ #include "media/video/gpu_video_accelerator_factories.h" #include "media/video/video_decode_accelerator.h" #include "third_party/blink/public/platform/platform.h" +#include "third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_fallback_recorder.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" #include "third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.h" #include "third_party/blink/renderer/platform/webrtc/webrtc_video_utils.h" @@ -150,38 +151,6 @@ latency); } -// These values are persisted to logs. Entries should not be renumbered and -// numeric values should never be reused. -enum class FallbackReason { - kSpatialLayers = 0, - kConsecutivePendingBufferOverflow = 1, - kReinitializationFailed = 2, - kPreviousErrorOnDecode = 3, - kPreviousErrorOnRegisterCallback = 4, - kMaxValue = kPreviousErrorOnRegisterCallback, -}; - -void RecordFallbackReason(media::VideoCodec codec, - FallbackReason fallback_reason) { - switch (codec) { - case media::VideoCodec::kCodecH264: - base::UmaHistogramEnumeration("Media.RTCVideoDecoderFallbackReason.H264", - fallback_reason); - break; - case media::VideoCodec::kCodecVP8: - base::UmaHistogramEnumeration("Media.RTCVideoDecoderFallbackReason.Vp8", - fallback_reason); - break; - case media::VideoCodec::kCodecVP9: - base::UmaHistogramEnumeration("Media.RTCVideoDecoderFallbackReason.Vp9", - fallback_reason); - break; - default: - base::UmaHistogramEnumeration("Media.RTCVideoDecoderFallbackReason.Other", - fallback_reason); - } -} - } // namespace // static @@ -361,11 +330,13 @@ input_image.SpatialIndex().value_or(0) > 0) { #if defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS_ASH) if (!base::FeatureList::IsEnabled(media::kVp9kSVCHWDecoding)) { - RecordFallbackReason(config_.codec(), FallbackReason::kSpatialLayers); + RecordRTCVideoDecoderFallbackReason( + config_.codec(), RTCVideoDecoderFallbackReason::kSpatialLayers); return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; } #else - RecordFallbackReason(config_.codec(), FallbackReason::kSpatialLayers); + RecordRTCVideoDecoderFallbackReason( + config_.codec(), RTCVideoDecoderFallbackReason::kSpatialLayers); return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; #endif // defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS_ASH) } @@ -419,8 +390,9 @@ config_.set_color_space_info( blink::WebRtcToMediaVideoColorSpace(*input_image.ColorSpace())); if (!ReinitializeSync(config_)) { - RecordFallbackReason(config_.codec(), - FallbackReason::kReinitializationFailed); + RecordRTCVideoDecoderFallbackReason( + config_.codec(), + RTCVideoDecoderFallbackReason::kReinitializationFailed); return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; } if (input_image._frameType != webrtc::VideoFrameType::kVideoFrameKey) @@ -431,8 +403,9 @@ { base::AutoLock auto_lock(lock_); if (has_error_) { - RecordFallbackReason(config_.codec(), - FallbackReason::kPreviousErrorOnDecode); + RecordRTCVideoDecoderFallbackReason( + config_.codec(), + RTCVideoDecoderFallbackReason::kPreviousErrorOnDecode); return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; } @@ -447,8 +420,9 @@ key_frame_required_ = true; if (++consecutive_error_count_ > kMaxConsecutiveErrors) { decode_timestamps_.clear(); - RecordFallbackReason(config_.codec(), - FallbackReason::kConsecutivePendingBufferOverflow); + RecordRTCVideoDecoderFallbackReason( + config_.codec(), + RTCVideoDecoderFallbackReason::kConsecutivePendingBufferOverflow); return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; } return WEBRTC_VIDEO_CODEC_ERROR; @@ -472,8 +446,9 @@ base::AutoLock auto_lock(lock_); decode_complete_callback_ = callback; if (has_error_) { - RecordFallbackReason(config_.codec(), - FallbackReason::kPreviousErrorOnRegisterCallback); + RecordRTCVideoDecoderFallbackReason( + config_.codec(), + RTCVideoDecoderFallbackReason::kPreviousErrorOnRegisterCallback); } return has_error_ ? WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE : WEBRTC_VIDEO_CODEC_OK; @@ -579,9 +554,8 @@ if (!status.is_ok() && status.code() != media::StatusCode::kAborted) { DVLOG(2) << "Entering permanent error state"; - UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoDecoderError", - media::VideoDecodeAccelerator::PLATFORM_FAILURE, - media::VideoDecodeAccelerator::ERROR_MAX + 1); + base::UmaHistogramSparse("Media.RTCVideoDecoderError", + static_cast<int>(status.code())); base::AutoLock auto_lock(lock_); has_error_ = true;
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_fallback_recorder.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_fallback_recorder.cc new file mode 100644 index 0000000..b088702 --- /dev/null +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_fallback_recorder.cc
@@ -0,0 +1,33 @@ +// 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. + +#include "third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_fallback_recorder.h" + +#include "base/metrics/histogram_functions.h" + +namespace blink { + +void RecordRTCVideoDecoderFallbackReason( + media::VideoCodec codec, + RTCVideoDecoderFallbackReason fallback_reason) { + switch (codec) { + case media::VideoCodec::kCodecH264: + base::UmaHistogramEnumeration("Media.RTCVideoDecoderFallbackReason.H264", + fallback_reason); + break; + case media::VideoCodec::kCodecVP8: + base::UmaHistogramEnumeration("Media.RTCVideoDecoderFallbackReason.Vp8", + fallback_reason); + break; + case media::VideoCodec::kCodecVP9: + base::UmaHistogramEnumeration("Media.RTCVideoDecoderFallbackReason.Vp9", + fallback_reason); + break; + default: + base::UmaHistogramEnumeration("Media.RTCVideoDecoderFallbackReason.Other", + fallback_reason); + } +} + +} // namespace blink
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_fallback_recorder.h b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_fallback_recorder.h new file mode 100644 index 0000000..3c3568b --- /dev/null +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_fallback_recorder.h
@@ -0,0 +1,30 @@ +// 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. + +#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_VIDEO_DECODER_FALLBACK_RECORDER_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_VIDEO_DECODER_FALLBACK_RECORDER_H_ + +#include "media/base/video_codecs.h" +#include "third_party/blink/renderer/platform/platform_export.h" + +namespace blink { + +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum class RTCVideoDecoderFallbackReason { + kSpatialLayers = 0, + kConsecutivePendingBufferOverflow = 1, + kReinitializationFailed = 2, + kPreviousErrorOnDecode = 3, + kPreviousErrorOnRegisterCallback = 4, + kMaxValue = kPreviousErrorOnRegisterCallback, +}; + +void RecordRTCVideoDecoderFallbackReason( + media::VideoCodec codec, + RTCVideoDecoderFallbackReason fallback_reason); + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_VIDEO_DECODER_FALLBACK_RECORDER_H_
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc index ab35747..3c74023 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_stream_adapter.cc
@@ -32,6 +32,7 @@ #include "media/video/gpu_video_accelerator_factories.h" #include "media/video/video_decode_accelerator.h" #include "third_party/blink/public/platform/platform.h" +#include "third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_fallback_recorder.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" #include "third_party/blink/renderer/platform/webrtc/webrtc_video_frame_adapter.h" #include "third_party/blink/renderer/platform/webrtc/webrtc_video_utils.h" @@ -361,10 +362,14 @@ #if defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS_ASH) if (!base::FeatureList::IsEnabled(media::kVp9kSVCHWDecoding)) { DLOG(ERROR) << __func__ << " multiple spatial layers."; + RecordRTCVideoDecoderFallbackReason( + config_.codec(), RTCVideoDecoderFallbackReason::kSpatialLayers); return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; } #else DLOG(ERROR) << __func__ << " multiple spatial layers."; + RecordRTCVideoDecoderFallbackReason( + config_.codec(), RTCVideoDecoderFallbackReason::kSpatialLayers); return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; #endif // defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS_ASH) } @@ -430,6 +435,9 @@ // here, to reset the decoder state. For now, just fail. if (has_error_) { DLOG(ERROR) << __func__ << " decoding failed."; + RecordRTCVideoDecoderFallbackReason( + config_.codec(), + RTCVideoDecoderFallbackReason::kPreviousErrorOnDecode); return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; } @@ -457,6 +465,9 @@ &RTCVideoDecoderStreamAdapter::ShutdownOnMediaThread, weak_this_)); DLOG(ERROR) << __func__ << " too many errors / pending buffers."; + RecordRTCVideoDecoderFallbackReason( + config_.codec(), + RTCVideoDecoderFallbackReason::kConsecutivePendingBufferOverflow); return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; } @@ -498,8 +509,13 @@ base::AutoLock auto_lock(lock_); decode_complete_callback_ = callback; - return has_error_ ? WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE - : WEBRTC_VIDEO_CODEC_OK; + if (has_error_) { + RecordRTCVideoDecoderFallbackReason( + config_.codec(), + RTCVideoDecoderFallbackReason::kPreviousErrorOnRegisterCallback); + return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; + } + return WEBRTC_VIDEO_CODEC_OK; } int32_t RTCVideoDecoderStreamAdapter::Release() { @@ -632,9 +648,8 @@ return; default: DVLOG(2) << "Entering permanent error state"; - UMA_HISTOGRAM_ENUMERATION("Media.RTCVideoDecoderError", - media::VideoDecodeAccelerator::PLATFORM_FAILURE, - media::VideoDecodeAccelerator::ERROR_MAX + 1); + base::UmaHistogramSparse("Media.RTCVideoDecoderStream.Error.OnFrameReady", + static_cast<int>(result.code())); { base::AutoLock auto_lock(lock_); has_error_ = true; @@ -695,9 +710,9 @@ // We don't care if there are any pending decodes; keep a read running even if // there aren't any. This way, we don't have to count correctly. + pending_read_ = true; decoder_stream_->Read( base::BindOnce(&RTCVideoDecoderStreamAdapter::OnFrameReady, weak_this_)); - pending_read_ = true; } bool RTCVideoDecoderStreamAdapter::ShouldReinitializeForSettingHDRColorSpace(
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.cc b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.cc index 4b9a76b..e8f69bf 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory.cc
@@ -139,12 +139,6 @@ return base::nullopt; } // namespace -bool IsSameFormat(const webrtc::SdpVideoFormat& format1, - const webrtc::SdpVideoFormat& format2) { - return cricket::IsSameCodec(format1.name, format2.parameters, format2.name, - format2.parameters); -} - struct SupportedFormats { bool unknown = true; std::vector<media::VideoCodecProfile> profiles; @@ -215,7 +209,7 @@ auto supported_formats = GetSupportedFormatsInternal(gpu_factories_); if (!supported_formats.unknown) { for (size_t i = 0; i < supported_formats.sdp_formats.size(); ++i) { - if (IsSameFormat(format, supported_formats.sdp_formats[i])) { + if (format.IsSameCodec(supported_formats.sdp_formats[i])) { encoder = std::make_unique<RTCVideoEncoder>( supported_formats.profiles[i], is_constrained_h264, gpu_factories_); break;
diff --git a/third_party/blink/renderer/platform/peerconnection/video_codec_factory.cc b/third_party/blink/renderer/platform/peerconnection/video_codec_factory.cc index bd9aeb6..efbd1454 100644 --- a/third_party/blink/renderer/platform/peerconnection/video_codec_factory.cc +++ b/third_party/blink/renderer/platform/peerconnection/video_codec_factory.cc
@@ -28,23 +28,10 @@ namespace { -bool IsFormatSupported( - const std::vector<webrtc::SdpVideoFormat>& supported_formats, - const webrtc::SdpVideoFormat& format) { - for (const webrtc::SdpVideoFormat& supported_format : supported_formats) { - if (cricket::IsSameCodec(format.name, format.parameters, - supported_format.name, - supported_format.parameters)) { - return true; - } - } - return false; -} - template <typename Factory> bool IsFormatSupported(const Factory* factory, const webrtc::SdpVideoFormat& format) { - return factory && IsFormatSupported(factory->GetSupportedFormats(), format); + return factory && format.IsCodecInList(factory->GetSupportedFormats()); } // Merge |formats1| and |formats2|, but avoid adding duplicate formats. @@ -53,7 +40,7 @@ const std::vector<webrtc::SdpVideoFormat>& formats2) { for (const webrtc::SdpVideoFormat& format : formats2) { // Don't add same format twice. - if (!IsFormatSupported(formats1, format)) + if (!format.IsCodecInList(formats1)) formats1.push_back(format); } return formats1;
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index d5b98970..f579035b 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1187,7 +1187,8 @@ }, { name: "LayoutNGReplaced", - depends_on: ["LayoutNG"] + depends_on: ["LayoutNG"], + status: "stable", }, { name: "LayoutNGTable", @@ -1446,7 +1447,7 @@ // TODO(crbug.com/920069): Remove OffsetParentNewSpecBehavior after the // feature is in stable with no issues. name: "OffsetParentNewSpecBehavior", - status: "stable" + status: "experimental" }, { name: "OnDeviceChange",
diff --git a/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py index 223d05a..ec9a2dd 100644 --- a/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py
@@ -308,13 +308,17 @@ debug_builders.add(builder) builders_to_fallback_paths = {} + wpt_builders = set() for builder in list(release_builders) + list(debug_builders): - port = self._tool.port_factory.get_from_builder_name(builder) - fallback_path = port.baseline_search_path() - if fallback_path not in builders_to_fallback_paths.values(): - builders_to_fallback_paths[builder] = fallback_path + if not self._tool.builders.is_wpt_builder(builder): + port = self._tool.port_factory.get_from_builder_name(builder) + fallback_path = port.baseline_search_path() + if fallback_path not in builders_to_fallback_paths.values(): + builders_to_fallback_paths[builder] = fallback_path + else: + wpt_builders.add(builder) - return set(builders_to_fallback_paths) + return set(builders_to_fallback_paths) | wpt_builders def _rebaseline_commands(self, test_baseline_set, options): path_to_blink_tool = self._tool.path()
diff --git a/third_party/blink/tools/blinkpy/tool/commands/rebaseline_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_unittest.py index 41d6208..e4065a26 100644 --- a/third_party/blink/tools/blinkpy/tool/commands/rebaseline_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_unittest.py
@@ -77,6 +77,14 @@ 'port_name': 'test-win-win7', 'specifiers': ['Win7', 'Release'] }, + 'MOCK wpt(1)': { + 'port_name': 'test-linux-trusty', + 'specifiers': ['Trusty', 'Release'] + }, + 'MOCK wpt(2)': { + 'port_name': 'test-linux-trusty', + 'specifiers': ['Trusty', 'Release'] + }, }) self.mac_port = self.tool.port_factory.get_from_builder_name( 'MOCK Mac10.11') @@ -198,6 +206,11 @@ ]) self.assertEqual(builders_to_fetch, {'MOCK Win7', 'MOCK Win10'}) + builders_to_fetch = self.command._builders_to_fetch_from([ + 'MOCK Trusty', 'MOCK wpt(1)', 'MOCK wpt(2)' + ]) + self.assertEqual(builders_to_fetch, {'MOCK Trusty', 'MOCK wpt(1)', 'MOCK wpt(2)'}) + def test_generic_baseline_paths(self): test_baseline_set = TestBaselineSet(self.tool) # Multiple ports shouldn't produce duplicate baseline paths.
diff --git a/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py b/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py index accc3b6..f561c12 100644 --- a/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py +++ b/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py
@@ -180,6 +180,12 @@ pid=driver_output.pid, crash_site=driver_output.crash_site) + def _convert_to_str(self, data): + if data: + return data.decode('utf8', 'replace') + else: + return '' + def _update_or_add_new_baselines(self, driver_output, failures): """Updates or adds new baselines for the test if necessary.""" if (test_failures.has_failure_type(test_failures.FailureTimeout, @@ -198,7 +204,7 @@ # Note that the created baseline might be redundant, but users can # optimize them later with optimize-baselines. if self._is_all_pass_testharness_text_not_needing_baseline( - driver_output.text): + self._convert_to_str(driver_output.text)): driver_output.text = None self._save_baseline_data( driver_output.text, '.txt', @@ -409,13 +415,14 @@ if driver_output.text: if self._is_all_pass_testharness_text_not_needing_baseline( - driver_output.text): + self._convert_to_str(driver_output.text)): if self._report_extra_baseline( driver_output, '.txt', 'is a all-pass testharness test'): # TODO(wangxianzhu): Make this a failure. pass - elif testharness_results.is_testharness_output(driver_output.text): + elif testharness_results.is_testharness_output( + self._convert_to_str(driver_output.text)): # We only need -expected.txt for a testharness test when we # expect it to fail or produce additional console output (when # -expected.txt is optional), so don't report missing @@ -472,10 +479,11 @@ if expected_driver_output.text: # Will compare text if there is expected text. return False, [] - if not testharness_results.is_testharness_output(driver_output.text): + if not testharness_results.is_testharness_output( + self._convert_to_str(driver_output.text)): return False, [] if not testharness_results.is_testharness_output_passing( - driver_output.text): + self._convert_to_str(driver_output.text)): return True, [ test_failures.FailureTestHarnessAssertion( driver_output, expected_driver_output) @@ -489,11 +497,13 @@ return text and '{\n "layers": [' in text def _compare_text(self, expected_driver_output, driver_output): - expected_text = expected_driver_output.text - actual_text = driver_output.text - if not expected_text or not actual_text: + + if not expected_driver_output.text or not driver_output.text: return [] + expected_text = expected_driver_output.text.decode('utf8', 'replace') + actual_text = driver_output.text.decode('utf8', 'replace') + normalized_actual_text = self._get_normalized_output_text(actual_text) # Assuming expected_text is already normalized. if not self._port.do_text_results_differ(expected_text, @@ -635,7 +645,6 @@ # failures if needed. compare_text_failures = self._compare_output(expected_text_output, test_output) - # If the test crashed, or timed out, or a leak was detected, there's no point # in running the reference at all. This can save a lot of execution time if we # have a lot of crashes or timeouts. @@ -659,7 +668,6 @@ reference_test_names = [] reftest_failures = [] args = self._port.args_for_test(self._test_name) - # sort self._reference_files to put mismatch tests first for expectation, reference_filename in sorted(self._reference_files): reference_test_name = self._port.relative_test_filename(
diff --git a/third_party/blink/tools/blinkpy/web_tests/models/test_failures.py b/third_party/blink/tools/blinkpy/web_tests/models/test_failures.py index bc96e4b..d0195988 100644 --- a/third_party/blink/tools/blinkpy/web_tests/models/test_failures.py +++ b/third_party/blink/tools/blinkpy/web_tests/models/test_failures.py
@@ -130,10 +130,6 @@ def _write_to_artifacts(self, typ_artifacts, artifact_name, path, content, force_overwrite): - # TODO(crbug/1197331): May need to revisit this while investigating - # failures in PY3. - if (six.PY3 and self._artifact_is_text(path)): - content = content.encode('utf8', 'replace') typ_artifacts.CreateArtifact( artifact_name, path, content, force_overwrite=force_overwrite) @@ -323,8 +319,29 @@ # non empty text. super(FailureText, self).create_artifacts(typ_artifacts, force_overwrite) - expected_text = self.expected_driver_output.text or '' - actual_text = self.actual_driver_output.text or '' + + actual_text = '' + expected_text = '' + if self.expected_driver_output.text is not None: + if six.PY3: + # TODO(crbug/1197331): We should not decode here looks like. + # html_diff expects it to be bytes for comparing to account + # various types of encodings. + # html_diff.py and unified_diff.py use str types during + # diff fixup. Will handle it later. + expected_text = self.expected_driver_output.text.decode( + 'utf8', 'replace') + else: + expected_text = self.expected_driver_output.text + + if self.actual_driver_output.text is not None: + if six.PY3: + # TODO(crbug/1197331): ditto as in the case of expected_text above. + actual_text = self.actual_driver_output.text.decode( + 'utf8', 'replace') + else: + actual_text = self.actual_driver_output.text + artifacts_abs_path = self.filesystem.join( self.result_directory, typ_artifacts.ArtifactsSubDirectory()) diff_content = unified_diff( @@ -338,6 +355,13 @@ html_diff_content = html_diff(expected_text, actual_text) html_diff_filename = self.port.output_filename( self.test_name, FILENAME_SUFFIX_HTML_DIFF, '.html') + + # TODO(crbug/1197331): Revisit while handling the diff modules. + if diff_content and six.PY3: + diff_content = diff_content.encode('utf8', 'replace') + if html_diff_content and six.PY3: + html_diff_content = html_diff_content.encode('utf8', 'replace') + self._write_to_artifacts(typ_artifacts, 'text_diff', diff_filename, diff_content, force_overwrite) self._write_to_artifacts(typ_artifacts, 'pretty_text_diff', @@ -455,7 +479,8 @@ 'prefix': self.port.output_filename(self.test_name, '', '') } self._write_to_artifacts(typ_artifacts, 'pretty_image_diff', - diffs_html_filename, diffs_html, + diffs_html_filename, + diffs_html.encode('utf8', 'replace'), force_overwrite) super(FailureImageHashMismatch, self).create_artifacts(
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/base.py b/third_party/blink/tools/blinkpy/web_tests/port/base.py index 3aa95298..1108a459 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/base.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/base.py
@@ -844,11 +844,8 @@ baseline_path = self.expected_filename(test_name, '.txt') if not self._filesystem.exists(baseline_path): return None - if six.PY2: - text = self._filesystem.read_binary_file(baseline_path) - else: - text = self._filesystem.read_text_file(baseline_path) - return text.replace('\r\n', '\n') + text = self._filesystem.read_binary_file(baseline_path) + return text.replace(b'\r\n', b'\n') def reference_files(self, test_name): """Returns a list of expectation (== or !=) and filename pairs""" @@ -1830,11 +1827,9 @@ def output_contains_sanitizer_messages(self, output): if not output: return None - if 'AddressSanitizer' in output: - return 'AddressSanitizer' - if 'MemorySanitizer' in output: - return 'MemorySanitizer' - return None + if (b'AddressSanitizer' in output) or (b'MemorySanitizer' in output): + return True + return False def _get_crash_log(self, name, pid, stdout, stderr, newer_than): if self.output_contains_sanitizer_messages(stderr): @@ -1866,20 +1861,21 @@ # We require stdout and stderr to be bytestrings, not character strings. if stdout: - assert isinstance(stdout, basestring) stdout_lines = stdout.decode('utf8', 'replace').splitlines() else: stdout_lines = [u'<empty>'] + if stderr: - assert isinstance(stderr, basestring) stderr_lines = stderr.decode('utf8', 'replace').splitlines() else: stderr_lines = [u'<empty>'] - return (stderr, 'crash log for %s (pid %s):\n%s\n%s\n' % - (name_str, pid_str, '\n'.join( - ('STDOUT: ' + l) for l in stdout_lines), '\n'.join( - ('STDERR: ' + l) for l in stderr_lines)), + return (stderr, + ('crash log for %s (pid %s):\n%s\n%s\n' % + (name_str, pid_str, '\n'.join( + ('STDOUT: ' + l) for l in stdout_lines), '\n'.join( + ('STDERR: ' + l) + for l in stderr_lines))).encode('utf8', 'replace'), self._get_crash_site(stderr_lines)) def _get_crash_site(self, stderr_lines):
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/driver.py b/third_party/blink/tools/blinkpy/web_tests/port/driver.py index 211cccf..3c7182b 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/driver.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/driver.py
@@ -30,6 +30,7 @@ import logging import re import shlex +import six import time from blinkpy.common.system import path @@ -195,7 +196,7 @@ # stderr output, as well as if we've seen #EOF on this driver instance. # FIXME: We should probably remove _read_first_block and _read_optional_image_block and # instead scope these locally in run_test. - self.error_from_test = str() + self.error_from_test = bytearray() self.err_seen_eof = False self._server_process = None self._current_cmd_line = None @@ -228,14 +229,14 @@ stdin_deadline = start_time + int(driver_input.timeout) / 2000.0 self.start(driver_input.args, stdin_deadline) test_begin_time = time.time() - self.error_from_test = str() + self.error_from_test = bytearray() self.err_seen_eof = False test_command = self._command_from_driver_input(driver_input) server_process_command = self._server_process.cmd() deadline = test_begin_time + int(driver_input.timeout) / 1000.0 - self._server_process.write(test_command.encode("utf8", "replace")) + self._server_process.write(test_command.encode('utf8', 'replace')) # First block is either text or audio text, audio = self._read_first_block(deadline) # The second (optional) block is image data. @@ -250,8 +251,8 @@ sanitizer = self._port.output_contains_sanitizer_messages( self.error_from_test) if sanitizer: - self.error_from_test = 'OUTPUT CONTAINS "' + sanitizer + \ - '", so we are treating this test as if it crashed, even though it did not.\n\n' + self.error_from_test + self.error_from_test = 'OUTPUT CONTAINS "sanitizer",' + \ + ' so we are treating this test as if it crashed, even though it did not.\n\n' + self.error_from_test crashed = True self._crashed_process_name = 'unknown process name' self._crashed_pid = 0 @@ -288,8 +289,11 @@ if self.error_from_test: crash_log += '\nstdout:\n%s\nstderr:\n%s\n' % ( text, self.error_from_test) - command = "%s %s" % (" ".join(server_process_command), test_command) - + command = ("%s %s" % + (" ".join(server_process_command), test_command)).encode( + 'ascii', 'replace') + if actual_image_hash: + actual_image_hash = actual_image_hash.decode('utf8', 'replace') return DriverOutput(text, image, actual_image_hash, @@ -463,11 +467,11 @@ if wait_for_ready: deadline = time.time() + DRIVER_START_TIMEOUT_SECS if not self._wait_for_server_process_output( - self._server_process, deadline, '#READY'): + self._server_process, deadline, b'#READY'): _log.error('%s took too long to startup.' % server_name) def _wait_for_server_process_output(self, server_process, deadline, text): - output = '' + output = b'' line = server_process.read_stdout_line(deadline) output += server_process.pop_all_buffered_stderr() while (not server_process.timed_out @@ -577,7 +581,6 @@ command = self.test_to_uri(driver_input.test_name) else: command = self._port.abspath_for_test(driver_input.test_name) - # ' is the separator between arguments. if self._port.supports_per_test_timeout(): command += "'--timeout'%s" % driver_input.timeout @@ -592,14 +595,14 @@ self._measurements['Malloc'] = float(block.malloc) if block.js_heap: self._measurements['JSHeap'] = float(block.js_heap) - if block.content_type == 'audio/wav': + if block.content_type == b'audio/wav': return (None, block.decoded_content) return (block.decoded_content, None) def _read_optional_image_block(self, deadline): # returns (image, actual_image_hash) block = self._read_block(deadline, wait_for_stderr_eof=True) - if block.content and block.content_type == 'image/png': + if block.content and block.content_type == b'image/png': return (block.decoded_content, block.content_hash) return (None, block.content_hash) @@ -619,24 +622,24 @@ return False def _process_stdout_line(self, block, line): - if (self._read_header(block, line, 'Content-Type: ', 'content_type') - or self._read_header(block, line, - 'Content-Transfer-Encoding: ', 'encoding') - or self._read_header(block, line, 'Content-Length: ', + if (self._read_header(block, line, b'Content-Type: ', 'content_type') + or self._read_header( + block, line, b'Content-Transfer-Encoding: ', 'encoding') + or self._read_header(block, line, b'Content-Length: ', '_content_length', int) or - self._read_header(block, line, 'ActualHash: ', 'content_hash') - or self._read_header(block, line, 'DumpMalloc: ', 'malloc') - or self._read_header(block, line, 'DumpJSHeap: ', 'js_heap') - or self._read_header(block, line, 'StdinPath', 'stdin_path')): + self._read_header(block, line, b'ActualHash: ', 'content_hash') + or self._read_header(block, line, b'DumpMalloc: ', 'malloc') + or self._read_header(block, line, b'DumpJSHeap: ', 'js_heap') + or self._read_header(block, line, b'StdinPath', 'stdin_path')): return # Note, we're not reading ExpectedHash: here, but we could. # If the line wasn't a header, we just append it to the content. block.content += line def _strip_eof(self, line): - if line and line.endswith('#EOF\n'): + if line and line.endswith(b'#EOF\n'): return line[:-5], True - if line and line.endswith('#EOF\r\n'): + if line and line.endswith(b'#EOF\r\n'): _log.error('Got a CRLF-terminated #EOF - this is a driver bug.') return line[:-6], True return line, False @@ -668,7 +671,6 @@ if err_line: assert not self.err_seen_eof err_line, self.err_seen_eof = self._strip_eof(err_line) - if out_line: if out_line[-1] != '\n': _log.error( @@ -689,9 +691,10 @@ block.content_type, self._server_process.name()) if err_line: - if self._check_for_driver_crash(err_line): + if self._check_for_driver_crash( + err_line.decode('utf8', 'replace')): break - if self._check_for_leak(err_line): + if self._check_for_leak(err_line.decode('utf8', 'replace')): break self.error_from_test += err_line @@ -707,7 +710,12 @@ self._content_length = None # Content is treated as binary data even though the text output is usually UTF-8. # FIXME: Should be bytearray() once we require Python 2.6. - self.content = str() + # TODO(crbug/1197331): Keeping PY2 as str() for now, as diffing modules + # need to be looked into for PY3 unified_diff.py and html_diff.py + if six.PY2: + self.content = str() + else: + self.content = bytearray() self.decoded_content = None self.malloc = None self.js_heap = None
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/port_testcase.py b/third_party/blink/tools/blinkpy/web_tests/port/port_testcase.py index 4c83b03..d03cecb1 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/port_testcase.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/port_testcase.py
@@ -269,7 +269,8 @@ 'foo', 1234, 'foo\xa6bar', 'foo\xa6bar', newer_than=None) self.assertEqual(stderr, 'foo\xa6bar') self.assertEqual( - details, u'crash log for foo (pid 1234):\n' + details.decode('utf8', 'replace'), + u'crash log for foo (pid 1234):\n' u'STDOUT: foo\ufffdbar\n' u'STDERR: foo\ufffdbar\n') self.assertIsNone(crash_site) @@ -280,7 +281,8 @@ 'foo', 1234, 'foo\xa6bar', 'foo\xa6bar', newer_than=1.0) self.assertEqual(stderr, 'foo\xa6bar') self.assertEqual( - details, u'crash log for foo (pid 1234):\n' + details.decode('utf8', 'replace'), + u'crash log for foo (pid 1234):\n' u'STDOUT: foo\ufffdbar\n' u'STDERR: foo\ufffdbar\n') self.assertIsNone(crash_site)
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/server_process.py b/third_party/blink/tools/blinkpy/web_tests/port/server_process.py index 57a5a32..5c8ba8b 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/server_process.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/server_process.py
@@ -120,8 +120,14 @@ self._proc.stderr = None self._proc = None - self._output = str() # bytesarray() once we require Python 2.6 - self._error = str() # bytesarray() once we require Python 2.6 + # TODO(crbug/1197331): Keeping output in PY2 as str() for now as + # diffing modules(unified_diff.py and html_diff.py) need to be looked + # into for PY3. + if six.PY2: + self._output = str() + else: + self._output = bytearray() + self._error = bytearray() self._crashed = False self.timed_out = False @@ -191,19 +197,23 @@ try: self._log_data(' IN', bytes) self._proc.stdin.write(bytes) + # TODO(crbug/)In PY3 select.select to get the stdout/stderr + # file-descriptors times out without this flush. + # Revisit to see if this can be avoided. + self._proc.stdin.flush() except IOError: self.stop(0.0) # stop() calls _reset(), so we have to set crashed to True after calling stop(). self._crashed = True def _pop_stdout_line_if_ready(self): - index_after_newline = self._output.find('\n') + 1 + index_after_newline = self._output.find(b'\n') + 1 if index_after_newline > 0: return self._pop_output_bytes(index_after_newline) return None def _pop_stderr_line_if_ready(self): - index_after_newline = self._error.find('\n') + 1 + index_after_newline = self._error.find(b'\n') + 1 if index_after_newline > 0: return self._pop_error_bytes(index_after_newline) return None @@ -308,11 +318,6 @@ or self._proc.poll()): self._crashed = True self._log_data('OUT', data) - if six.PY3: - # TODO(crbug/1197331): Decode only for PY3 for now. - # In PY2, decoding here causes html_diff.py->html_diff - # to fail an assert. - data = data.decode("utf-8", errors="replace") self._output += data if err_fd in read_fds: @@ -321,11 +326,6 @@ or self._proc.poll()): self._crashed = True self._log_data('ERR', data) - if six.PY3: - # TODO(crbug/1197331): Decode only for PY3 for now. - # In PY2, decoding here causes error string encoding issues - # while writing from test_failures.py - data = data.decode("utf-8", errors="replace") self._error += data except IOError: # We can ignore the IOErrors because we will detect if the
diff --git a/third_party/blink/web_tests/FlagExpectations/composite-after-paint b/third_party/blink/web_tests/FlagExpectations/composite-after-paint index f6e335b..8a528ef 100644 --- a/third_party/blink/web_tests/FlagExpectations/composite-after-paint +++ b/third_party/blink/web_tests/FlagExpectations/composite-after-paint
@@ -77,3 +77,25 @@ crbug.com/829028 external/wpt/css/css-break/out-of-flow-in-multicolumn-040.html [ Crash Failure ] crbug.com/829028 external/wpt/css/css-break/out-of-flow-in-multicolumn-041.html [ Crash Failure ] crbug.com/829028 external/wpt/css/css-break/out-of-flow-in-multicolumn-044.html [ Crash Failure ] + +# SwANGLE failures +crbug.com/1205181 compositing/3d-cube.html [ Failure ] +crbug.com/1205181 compositing/lots-of-img-layers-with-opacity.html [ Failure ] +crbug.com/1205181 css3/blending/background-blend-mode-overlapping-accelerated-elements.html [ Failure ] +crbug.com/1205181 css3/filters/effect-brightness-clamping-hw.html [ Failure ] +crbug.com/1205181 css3/filters/effect-reference-hidpi-hw.html [ Failure ] +crbug.com/1205181 css3/filters/effect-reference-zoom-hw.html [ Failure ] +crbug.com/1205181 css3/filters/filter-repaint-composited-fallback-crash.html [ Failure ] +crbug.com/1205181 css3/filters/filter-repaint-composited-fallback.html [ Failure ] +crbug.com/1205181 fast/frames/frame-set-scaling-rotate.html [ Failure ] +crbug.com/1205181 fast/frames/frame-set-scaling-skew.html [ Failure ] +crbug.com/1205181 fast/table/multiple-captions-display.xhtml [ Failure ] +crbug.com/1205181 virtual/exotic-color-space/images/color-profile-image-canvas-pattern.html [ Failure ] +crbug.com/1205181 virtual/gpu-rasterization/images/color-profile-image-canvas-pattern.html [ Failure ] +crbug.com/1205181 virtual/layout_ng_fragment_traversal/fast/table/multiple-captions-display.xhtml [ Failure ] +crbug.com/1205181 virtual/scalefactor200/css3/filters/effect-brightness-clamping-hw.html [ Failure ] +crbug.com/1205181 virtual/scalefactor200/css3/filters/effect-reference-hidpi-hw.html [ Failure ] +crbug.com/1205181 virtual/scalefactor200/css3/filters/effect-reference-zoom-hw.html [ Failure ] +crbug.com/1205181 virtual/scalefactor200/css3/filters/filter-repaint-composited-fallback-crash.html [ Failure ] +crbug.com/1205181 virtual/scalefactor200/css3/filters/filter-repaint-composited-fallback.html [ Failure ] +crbug.com/1205181 virtual/transform-interop/compositing/overflow/rotate-then-clip-effect-interleave.html [ Failure ]
diff --git a/third_party/blink/web_tests/FlagExpectations/disable-layout-ng b/third_party/blink/web_tests/FlagExpectations/disable-layout-ng index 75bbe15..d8da3f5 100644 --- a/third_party/blink/web_tests/FlagExpectations/disable-layout-ng +++ b/third_party/blink/web_tests/FlagExpectations/disable-layout-ng
@@ -420,12 +420,6 @@ crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/counter-styles-3/descriptor-range.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/counter-styles-3/system-extends.html [ Failure ] -### external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/ -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-1.html [ Failure ] -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-4.html [ Failure ] -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6.html [ Failure ] -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-2.html [ Failure ] - ### external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/selectors4/ crbug.com/576815 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/selectors4/dir-style-01a.html [ Failure ] crbug.com/576815 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/selectors4/dir-style-01b.html [ Failure ] @@ -923,6 +917,7 @@ crbug.com/958381 external/wpt/css/css-tables/tentative/baseline-td.html [ Failure ] crbug.com/958381 external/wpt/css/css-tables/tentative/caption.html [ Failure ] crbug.com/958381 external/wpt/css/css-tables/tentative/colgroup-col.html [ Failure ] +crbug.com/958381 external/wpt/css/css-tables/tentative/colspan-redistribution.html [ Failure ] crbug.com/174167 external/wpt/css/css-tables/tentative/element-sizing.html [ Failure ] crbug.com/958381 external/wpt/css/css-tables/tentative/paint/background-image-column.html [ Failure ] crbug.com/958381 external/wpt/css/css-tables/tentative/paint/collapsed-border-large-cell.html [ Failure ]
diff --git a/third_party/blink/web_tests/FlagExpectations/use-vulkan=swiftshader b/third_party/blink/web_tests/FlagExpectations/use-vulkan=swiftshader index d8e7847..36a28df8 100644 --- a/third_party/blink/web_tests/FlagExpectations/use-vulkan=swiftshader +++ b/third_party/blink/web_tests/FlagExpectations/use-vulkan=swiftshader
@@ -13,6 +13,7 @@ css3/background/background-repeat-round-border.html [ Skip ] css3/background/background-repeat-round-content.html [ Skip ] css3/background/background-repeat-round-padding.html [ Skip ] +css3/blending/background-blend-mode-crossfade-image-gradient.html [ Skip ] css3/blending/background-blend-mode-default-value.html [ Skip ] css3/blending/background-blend-mode-gradient-image.html [ Skip ] css3/blending/background-blend-mode-image-color.html [ Skip ] @@ -45,3 +46,4 @@ images/yuv-decode-eligible/color-profile-image.html [ Skip ] media/color-profile-video-poster-image.html [ Skip ] transforms/shadows.html [ Skip ] +
diff --git a/third_party/blink/web_tests/SlowTests b/third_party/blink/web_tests/SlowTests index ef6e0c1..00b593a806 100644 --- a/third_party/blink/web_tests/SlowTests +++ b/third_party/blink/web_tests/SlowTests
@@ -771,6 +771,7 @@ crbug.com/1195814 [ Mac11.0 ] external/wpt/clear-site-data/storage.https.html [ Slow ] crbug.com/1195814 [ Mac11.0 ] external/wpt/file-system-access/local_FileSystemBaseHandle-IndexedDB-manual.https.html [ Slow ] crbug.com/1195814 [ Mac11.0 ] external/wpt/file-system-access/sandboxed_FileSystemBaseHandle-IndexedDB.https.any.html [ Slow ] +crbug.com/1195814 [ Mac11.0 ] external/wpt/file-system-access/sandboxed_FileSystemBaseHandle-IndexedDB.https.any.worker.html [ Slow ] crbug.com/1195814 [ Mac11.0 ] external/wpt/IndexedDB/fire-error-event-exception.html [ Slow ] crbug.com/1195814 [ Mac11.0 ] external/wpt/IndexedDB/get-databases.any.html [ Slow ] crbug.com/1195814 [ Mac11.0 ] external/wpt/IndexedDB/get-databases.any.worker.html [ Slow ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index dcb66755..669cc2f 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -562,7 +562,6 @@ crbug.com/711807 external/wpt/css/CSS2/normal-flow/max-width-applies-to-006.xht [ Failure ] crbug.com/711807 external/wpt/css/CSS2/normal-flow/replaced-intrinsic-001.xht [ Failure ] crbug.com/711807 external/wpt/css/CSS2/normal-flow/replaced-intrinsic-002.xht [ Failure ] -crbug.com/1114280 external/wpt/css/CSS2/normal-flow/replaced-intrinsic-003.xht [ Failure ] #### external/wpt/css/css-position crbug.com/752022 external/wpt/css/css-position/sticky/position-sticky-offset-overflow.html [ Failure ] @@ -570,18 +569,6 @@ #### external/wpt/css/css-sizing crbug.com/1164135 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-025.html [ Failure ] crbug.com/1164135 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-026.html [ Failure ] -crbug.com/1114280 external/wpt/css/css-sizing/aspect-ratio/replaced-element-034.html [ Failure ] -crbug.com/1135287 external/wpt/css/css-sizing/image-min-max-content-intrinsic-size-change-001.html [ Failure ] -crbug.com/1135287 external/wpt/css/css-sizing/image-min-max-content-intrinsic-size-change-002.html [ Failure ] -crbug.com/1135287 external/wpt/css/css-sizing/image-min-max-content-intrinsic-size-change-003.html [ Failure ] -crbug.com/1135287 external/wpt/css/css-sizing/image-min-max-content-intrinsic-size-change-004.html [ Failure ] -crbug.com/1135287 external/wpt/css/css-sizing/image-min-max-content-intrinsic-size-change-005.html [ Failure ] -crbug.com/1135287 external/wpt/css/css-sizing/image-min-max-content-intrinsic-size-change-006.html [ Failure ] -crbug.com/1135287 external/wpt/css/css-sizing/image-min-max-content-intrinsic-size-change-007.html [ Failure ] -crbug.com/1135287 external/wpt/css/css-sizing/image-min-max-content-intrinsic-size-change-008.html [ Failure ] -crbug.com/1114280 external/wpt/css/css-sizing/replaced-aspect-ratio-stretch-fit-001.html [ Failure ] -crbug.com/1114280 external/wpt/css/css-sizing/replaced-aspect-ratio-stretch-fit-002.html [ Failure ] -crbug.com/1114280 external/wpt/css/css-sizing/replaced-aspect-ratio-stretch-fit-003.html [ Failure ] crbug.com/1008951 external/wpt/css/css-text-decor/text-decoration-subelements-002.html [ Failure ] crbug.com/1008951 external/wpt/css/css-text-decor/text-decoration-subelements-003.html [ Failure ] @@ -834,8 +821,9 @@ crbug.com/470421 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-021.html [ Failure ] crbug.com/470421 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-022.html [ Failure ] -# Correct min/max content sizes for a replaced element wont be supported until ReplacedNG. -crbug.com/1114280 external/wpt/css/css-flexbox/aspect-ratio-intrinsic-size-006.html [ Failure ] +# Bad test expectations, but we aren't sure if web compatible yet. +crbug.com/1114280 external/wpt/css/css-flexbox/flexbox-min-width-auto-005.html [ Failure ] +crbug.com/1114280 external/wpt/css/css-flexbox/flexbox-min-width-auto-006.html [ Failure ] # [css-lists] crbug.com/1123457 external/wpt/css/css-lists/counter-list-item-2.html [ Failure ] @@ -1093,7 +1081,6 @@ crbug.com/874051 virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-span-all-fieldset-002.html [ Failure Crash ] crbug.com/1130451 virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-span-all-list-item-001.html [ Failure ] crbug.com/1130451 virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-span-all-list-item-002.html [ Failure ] -crbug.com/829028 virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-width-004.html [ Failure ] crbug.com/1079031 virtual/layout_ng_block_frag/fast/multicol/abspos-new-width-rebalance.html [ Crash Failure ] crbug.com/1058792 virtual/layout_ng_block_frag/fast/multicol/composited-opacity-2nd-and-3rd-column.html [ Failure ] crbug.com/1151880 virtual/layout_ng_block_frag/fast/multicol/dynamic/relpos-becomes-static-has-abspos.html [ Failure ] @@ -1107,7 +1094,6 @@ crbug.com/1066629 virtual/layout_ng_block_frag/fast/multicol/hit-test-translate-z.html [ Failure ] crbug.com/829181 virtual/layout_ng_block_frag/fast/multicol/infinitely-tall-content-in-outer-crash.html [ Skip ] crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/insane-column-count-and-padding-nested-crash.html [ Skip ] -crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/insane-column-gap.html [ Failure ] crbug.com/1066626 virtual/layout_ng_block_frag/fast/multicol/layers-split-across-columns.html [ Failure ] crbug.com/1066626 virtual/layout_ng_block_frag/fast/multicol/mixed-opacity-fixed-test.html [ Failure ] crbug.com/1079031 virtual/layout_ng_block_frag/fast/multicol/mixed-opacity-test.html [ Crash Failure ] @@ -2522,6 +2508,15 @@ crbug.com/958381 [ Mac ] external/wpt/css/CSS2/tables/table-anonymous-objects-206.xht [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 external/wpt/css/css-will-change/will-change-stacking-context-mask-1.html [ Failure ] +crbug.com/626703 external/wpt/css/css-will-change/will-change-fixpos-cb-transform-style-1.html [ Failure ] +crbug.com/626703 [ Linux ] external/wpt/css/css-will-change/will-change-fixpos-cb-position-1.html [ Failure ] +crbug.com/626703 [ Mac10.12 ] external/wpt/css/css-will-change/will-change-fixpos-cb-position-1.html [ Failure ] +crbug.com/626703 [ Mac10.13 ] external/wpt/css/css-will-change/will-change-fixpos-cb-position-1.html [ Failure ] +crbug.com/626703 [ Mac10.15 ] external/wpt/css/css-will-change/will-change-fixpos-cb-position-1.html [ Failure ] +crbug.com/626703 [ Mac11.0 ] external/wpt/css/css-will-change/will-change-fixpos-cb-position-1.html [ Failure ] +crbug.com/626703 [ Win ] external/wpt/css/css-will-change/will-change-fixpos-cb-position-1.html [ Failure ] +crbug.com/626703 external/wpt/css/css-will-change/will-change-fixpos-cb-contain-1.html [ Failure ] crbug.com/626703 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-004.html [ Failure ] crbug.com/626703 external/wpt/css/css-sizing/aspect-ratio/flex-aspect-ratio-002.html [ Failure ] crbug.com/626703 [ Mac11.0 ] external/wpt/websockets/Create-valid-url-binaryType-blob.any.worker.html?wpt_flags=h2 [ Timeout ] @@ -2893,7 +2888,6 @@ crbug.com/626703 [ Mac10.14 ] external/wpt/websockets/Create-valid-url-protocol-setCorrectly.any.html?wpt_flags=h2 [ Timeout ] crbug.com/626703 [ Mac10.15 ] external/wpt/websockets/Create-valid-url-protocol-setCorrectly.any.html?wpt_flags=h2 [ Timeout ] crbug.com/626703 [ Win ] external/wpt/websockets/Create-valid-url-protocol-setCorrectly.any.html?wpt_flags=h2 [ Timeout ] -crbug.com/626703 [ Mac10.15 ] external/wpt/url/a-element.html [ Failure Crash ] crbug.com/626703 [ Win10 ] external/wpt/url/a-element.html [ Failure Crash ] crbug.com/626703 [ Linux ] external/wpt/css/css-sizing/aspect-ratio/grid-aspect-ratio-020.html [ Failure ] crbug.com/626703 [ Mac10.12 ] external/wpt/css/css-sizing/aspect-ratio/grid-aspect-ratio-020.html [ Failure ] @@ -3564,6 +3558,9 @@ crbug.com/626703 [ Win ] external/wpt/websockets/Create-url-with-space.any.html [ Failure ] crbug.com/626703 [ Win ] virtual/plz-dedicated-worker/external/wpt/resource-timing/cross-origin-start-end-time-with-redirects.html [ Failure ] +# this test blocks import due to an issue with rebaselining it (crbug.com/1205249) +crbug.com/1205249 [ Linux ] external/wpt/css/mediaqueries/test_media_queries.html [ Failure ] + # crbug.com/1203344 idlharness failures: crbug.com/1203344 [ Mac10.15 ] external/wpt/dom/idlharness.window.html?exclude=Node [ Failure Crash ] crbug.com/1203344 [ Mac10.15 ] external/wpt/webxr/idlharness.https.window.html [ Failure Timeout ] @@ -3719,8 +3716,10 @@ crbug.com/626703 external/wpt/css/selectors/old-tests/css3-modsel-65.xml [ Skip ] crbug.com/626703 external/wpt/css/selectors/old-tests/css3-modsel-18b.xml [ Skip ] crbug.com/626703 external/wpt/css/selectors/old-tests/css3-modsel-159.xml [ Skip ] +crbug.com/626703 external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/reload.window.html [ Timeout ] crbug.com/626703 external/wpt/quirks/text-decoration-doesnt-propagate-into-tables/quirks.html [ Failure ] crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-painting-order.html [ Failure ] +crbug.com/626703 external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/tasks.window.html [ Timeout ] crbug.com/875411 external/wpt/svg/text/reftests/text-complex-002.svg [ Failure ] crbug.com/875411 external/wpt/svg/text/reftests/text-shape-inside-001.svg [ Failure ] crbug.com/875411 external/wpt/svg/text/reftests/text-complex-001.svg [ Failure ] @@ -4132,7 +4131,7 @@ crbug.com/1045599 external/wpt/css/css-grid/grid-definition/grid-auto-repeat-aspect-ratio-002.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/grid-definition/grid-auto-repeat-dynamic-001.html [ Failure ] crbug.com/1045599 external/wpt/css/css-grid/grid-definition/grid-auto-repeat-dynamic-003.html [ Failure ] -crbug.com/1114280 external/wpt/css/css-grid/grid-items/aspect-ratio-004.html [ Failure ] +crbug.com/1045599 external/wpt/css/css-grid/grid-items/aspect-ratio-004.html [ Failure ] crbug.com/1053825 external/wpt/css/css-grid/grid-model/grid-overflow-padding-001.html [ Failure ] crbug.com/1053825 external/wpt/css/css-grid/grid-model/grid-overflow-padding-002.html [ Failure ] crbug.com/1053825 external/wpt/css/css-grid/grid-model/grid-areas-overflowing-grid-container-001.html [ Failure ] @@ -4230,6 +4229,7 @@ virtual/layout-ng-grid/external/wpt/css/css-grid/grid-definition/grid-auto-repeat-aspect-ratio-002.html [ Pass ] virtual/layout-ng-grid/external/wpt/css/css-grid/grid-definition/grid-auto-repeat-dynamic-001.html [ Pass ] virtual/layout-ng-grid/external/wpt/css/css-grid/grid-definition/grid-auto-repeat-dynamic-003.html [ Pass ] +virtual/layout-ng-grid/external/wpt/css/css-grid/grid-items/aspect-ratio-004.html [ Pass ] virtual/layout-ng-grid/external/wpt/css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html [ Pass ] virtual/layout-ng-grid/external/wpt/css/css-grid/grid-model/grid-areas-overflowing-grid-container-001.html [ Pass ] virtual/layout-ng-grid/external/wpt/css/css-grid/grid-model/grid-areas-overflowing-grid-container-002.html [ Pass ] @@ -4814,13 +4814,6 @@ crbug.com/619427 [ Mac ] fast/overflow/overflow-height-float-not-removed-crash3.html [ Pass Failure ] # [css-ui] Imported tests from W3C suite. -crbug.com/669473 external/wpt/css/css-ui/box-sizing-014.html [ Failure ] -crbug.com/669473 external/wpt/css/css-ui/box-sizing-015.html [ Failure ] -crbug.com/669473 external/wpt/css/css-ui/box-sizing-016.html [ Failure ] -crbug.com/669473 external/wpt/css/css-ui/box-sizing-018.html [ Failure ] -crbug.com/669473 external/wpt/css/css-ui/box-sizing-019.html [ Failure ] -crbug.com/669473 external/wpt/css/css-ui/box-sizing-024.html [ Failure ] -crbug.com/669473 external/wpt/css/css-ui/box-sizing-025.html [ Failure ] crbug.com/669473 external/wpt/css/css-ui/outline-005.html [ Failure ] crbug.com/669473 external/wpt/css/css-ui/outline-006.html [ Failure ] @@ -6018,16 +6011,12 @@ crbug.com/1008483 external/wpt/css/css-transforms/backface-visibility-hidden-005.tentative.html [ Failure ] crbug.com/1008483 external/wpt/css/css-transforms/backface-visibility-hidden-animated-002.html [ Failure ] crbug.com/1008483 external/wpt/css/css-transforms/preserve-3d-flat-grouping-properties-containing-block.tentative.html [ Failure ] -crbug.com/1008483 external/wpt/css/css-transforms/3d-rendering-context-and-abspos.html [ Failure ] -crbug.com/1008483 external/wpt/css/css-transforms/3d-rendering-context-and-fixpos.html [ Failure ] crbug.com/1008483 virtual/transform-interop/external/wpt/css/css-transforms/3d-rendering-context-behavior.tentative.html [ Pass ] crbug.com/1008483 virtual/transform-interop/external/wpt/css/css-transforms/backface-visibility-hidden-004.tentative.html [ Pass ] crbug.com/1008483 virtual/transform-interop/external/wpt/css/css-transforms/backface-visibility-hidden-005.tentative.html [ Pass ] crbug.com/1008483 virtual/transform-interop/external/wpt/css/css-transforms/backface-visibility-hidden-animated-002.html [ Pass ] crbug.com/1008483 virtual/transform-interop/external/wpt/css/css-transforms/preserve-3d-flat-grouping-properties-containing-block.tentative.html [ Pass ] -crbug.com/1008483 virtual/transform-interop/external/wpt/css/css-transforms/3d-rendering-context-and-abspos.html [ Pass ] -crbug.com/1008483 virtual/transform-interop/external/wpt/css/css-transforms/3d-rendering-context-and-fixpos.html [ Pass ] crbug.com/1008483 virtual/transform-interop/compositing/geometry/require-own-backing-recalc-order.html [ Failure ] crbug.com/1008483 virtual/transform-interop/compositing/overflow/scroll-parent-with-non-stacking-context-composited-ancestor.html [ Failure ] crbug.com/1008483 virtual/transform-interop/paint/invalidation/stacking-context-lost.html [ Failure ] @@ -6050,6 +6039,9 @@ crbug.com/1048149 [ Mac ] fast/forms/color/color-picker-zoom150-bottom-edge-no-nan.html [ Pass Crash ] crbug.com/1048149 crbug.com/1050121 [ Mac ] fast/forms/month/month-picker-appearance-zoom150.html [ Pass Crash ] +# SwANGLE issue +crbug.com/1204234 [ Linux ] css3/blending/background-blend-mode-single-accelerated-element.html [ Failure ] + # Upcoming DevTools change crbug.com/1006759 http/tests/devtools/profiler/cpu-profiler-save-load.js [ Pass Failure Timeout ] crbug.com/1006759 http/tests/devtools/profiler/heap-snapshot-loader.js [ Pass Failure ] @@ -6829,7 +6821,7 @@ crbug.com/1186753 virtual/threaded-prefer-compositing/fast/scroll-snap/snaps-after-scrollbar-scrolling-thumb.html [ Pass Failure ] crbug.com/1186753 virtual/threaded-prefer-compositing/fast/scroll-snap/snaps-after-wheel-scrolling.html [ Pass Failure ] crbug.com/1186753 virtual/threaded-prefer-compositing/fast/scroll-snap/snap-scrolls-visual-viewport.html [ Pass Failure ] -crbug.com/1186753 virtual/threaded-prefer-compositing/fast/scroll-snap/animate-fling-to-snap-points-2.html [ Pass Timeout ] +crbug.com/1186753 virtual/threaded-prefer-compositing/fast/scroll-snap/animate-fling-to-snap-points-2.html [ Pass Failure Timeout ] # Expect failure for unimplemented canvas color object input crbug.com/1187575 external/wpt/html/canvas/element/fill-and-stroke-styles/2d.fillStyle.colorObject.html [ Failure ] @@ -6926,6 +6918,8 @@ # QuicTransport tests should be eventually deleted. crbug.com/1196989 external/wpt/webtransport/quic/* [ Skip ] +crbug.com/1194958 fast/events/mouse-event-buttons-attribute.html [ Pass Failure ] + # Sheriff 2021-04-08 crbug.com/1197087 external/wpt/web-animations/interfaces/Animation/finished.html [ Pass Failure ] crbug.com/1197087 external/wpt/css/css-animations/AnimationEffect-getComputedTiming.tentative.html [ Pass Failure ] @@ -7068,6 +7062,9 @@ # Sheriff 2021-04-30 crbug.com/1204498 [ Linux ] virtual/scroll-unification/fast/events/hit-test-cache-iframes.html [ Pass Failure ] +# Appears to be timing out even when marked as Slow. +crbug.com/1205184 [ Mac11.0 ] external/wpt/IndexedDB/interleaved-cursors-large.html [ Pass Timeout ] + # Sheriff 2021-05-03 crbug.com/1205133 [ Linux ] virtual/gpu/fast/canvas/canvas-blending-gradient-over-color.html [ Pass Timeout ] crbug.com/1205133 [ Mac ] virtual/gpu/fast/canvas/canvas-blending-gradient-over-color.html [ Pass Timeout ] @@ -7080,3 +7077,14 @@ crbug.com/1093041 virtual/gpu/fast/canvas/color-space/canvas-createImageBitmap-rec2020.html [ Pass Failure Timeout ] crbug.com/1093041 virtual/oopr-canvas2d/fast/canvas/color-space/canvas-createImageBitmap-rec2020.html [ Pass Failure Timeout ] crbug.com/1146560 virtual/oopr-canvas2d/fast/canvas/color-space/canvas-createImageBitmap-e_srgb.html [ Pass Failure Timeout ] + +# Sheriff 2021-05-04 +crbug.com/1205659 [ Mac ] external/wpt/IndexedDB/key-generators/reading-autoincrement-indexes.any.worker.html [ Pass Timeout ] +crbug.com/1205659 [ Mac ] storage/indexeddb/empty-blob-file.html [ Pass Timeout ] +crbug.com/1205673 [ Linux ] virtual/layout_ng_block_frag/external/wpt/css/css-multicol/large-actual-column-count.html [ Pass Timeout ] +crbug.com/1205673 [ Linux ] virtual/oopr-canvas2d/fast/canvas/canvas-composite-alpha.html [ Pass Timeout ] +crbug.com/1205673 [ Linux ] virtual/threaded-prefer-compositing/fast/scroll-snap/snaps-after-wheel-scrolling-single-tick.html [ Pass Failure ] + +# Browser Infra 2021-05-04 +# Re-enable once all Linux CI/CQ builders migrated to Bionic +crbug.com/1200134 [ Linux ] fast/gradients/unprefixed-repeating-gradient-color-hint.html [ Pass Failure ]
diff --git a/third_party/blink/web_tests/android/WebviewWPTExpectations b/third_party/blink/web_tests/android/WebviewWPTExpectations index 0e6c5ff..eadbc03 100644 --- a/third_party/blink/web_tests/android/WebviewWPTExpectations +++ b/third_party/blink/web_tests/android/WebviewWPTExpectations
@@ -3065,6 +3065,8 @@ crbug.com/1050754 external/wpt/html/webappapis/dynamic-markup-insertion/document-write/write-active-document.html [ Failure Pass ] crbug.com/1050754 external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-ignore-opens-during-unload.window.html [ Failure Pass ] crbug.com/1050754 external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/location-set-and-document-open.html [ Timeout ] +crbug.com/1050754 external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/reload.window.html [ Timeout ] +crbug.com/1050754 external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/tasks.window.html [ Timeout ] crbug.com/1050754 external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/url.window.html [ Failure Pass ] crbug.com/1050754 external/wpt/html/webappapis/microtask-queuing/queue-microtask-exceptions.any.sharedworker.html [ Failure ] crbug.com/1050754 external/wpt/html/webappapis/microtask-queuing/queue-microtask-exceptions.any.worker.html [ Failure Pass ]
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 77b9a0c..e5cadba 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
@@ -1361,6 +1361,13 @@ {} ] ], + "math-depth-overflow.html": [ + "e096dbb558812ce38ecacc0eb4c32aab1a185bd8", + [ + null, + {} + ] + ], "mmultiscripts-with-two-prescripts.html": [ "54f938460636bb351d9da20611fd872d6b888ca6", [ @@ -78345,6 +78352,32 @@ {} ] ], + "font-size-adjust-zero-1.html": [ + "ea1e57453b6e3ce9993215041dfb257c1a28a51a", + [ + null, + [ + [ + "/css/css-fonts/font-size-zero-2-ref.html", + "==" + ] + ], + {} + ] + ], + "font-size-adjust-zero-2.html": [ + "0fadcd458db59b2191593cfde3c0645cbe3a7c64", + [ + null, + [ + [ + "/css/css-fonts/font-size-zero-2-ref.html", + "==" + ] + ], + {} + ] + ], "font-size-monospace-adjust.html": [ "f1a0b7294d350225d00cfc76c6d3081e8aa7220f", [ @@ -78358,6 +78391,45 @@ {} ] ], + "font-size-zero-1-ref.html": [ + "f3bdd53d71c75326e688e7ff3c72c9a3418e5248", + [ + null, + [ + [ + "/css/css-fonts/font-size-zero-1-notref.html", + "!=" + ] + ], + {} + ] + ], + "font-size-zero-1.html": [ + "9b7b3e6d754318b69f3baeb2164680661cc0566f", + [ + null, + [ + [ + "/css/css-fonts/font-size-zero-1-ref.html", + "==" + ] + ], + {} + ] + ], + "font-size-zero-2.html": [ + "5b5aaa594c3909c4e998f5c47d721e78edefcf27", + [ + null, + [ + [ + "/css/css-fonts/font-size-zero-2-ref.html", + "==" + ] + ], + {} + ] + ], "font-stretch-01.html": [ "11f3b40504d99a47b1595fc87ec0300defd13277", [ @@ -80187,6 +80259,19 @@ {} ] ], + "variable-opsz-size-adjust.html": [ + "b673f3cb7bf4e72fa8aa6ff38b2f18fbd0705717", + [ + null, + [ + [ + "/css/css-fonts/variations/variable-opsz-size-adjust-ref.html", + "==" + ] + ], + {} + ] + ], "variable-opsz.html": [ "d274a478280018de975a74e2781d2ac96d1e97f5", [ @@ -148341,39 +148426,325 @@ {} ] ], - "will-change-stacking-context-001.html": [ - "9720953205b1cd2863649f2b69e6e01b5107acb2", + "will-change-fixpos-cb-contain-1.html": [ + "3bb3afee3b79ff79664501f75b31b01bdad503e8", [ null, [ [ - "/css/css-will-change/will-change-stacking-context-001-ref.html", + "/css/css-will-change/green-square-100-by-100-offset-ref.html", "==" ] ], {} ] ], - "will-change-stacking-context-002.html": [ - "1cda23b9bcfc45c4632f810096ff837084df20d0", + "will-change-fixpos-cb-filter-1.html": [ + "afb03e8becc34d9cae1ee7ea38583de221b81e5d", [ null, [ [ - "/css/css-will-change/will-change-stacking-context-002-ref.html", + "/css/css-will-change/green-square-100-by-100-offset-ref.html", "==" ] ], {} ] ], - "will-change-stacking-context-003.html": [ - "b764d2e86d641d514751afa664672291c3acf0b1", + "will-change-fixpos-cb-height-1.html": [ + "892e6d4541ac2e00a365ab22ef6e246a9b8ccd11", [ null, [ [ - "/css/css-will-change/will-change-stacking-context-003-ref.html", + "/css/css-will-change/green-square-100-by-100-offset-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-fixpos-cb-offset-path-1.html": [ + "0fe1ec1da798479cdf0c43d3d7f8ee506b796e47", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-offset-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-fixpos-cb-perspective-1.html": [ + "4a394f9958fec7021c5eab39dcacbe31902fe6e5", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-offset-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-fixpos-cb-position-1.html": [ + "7e52ab4b038ce14419590e341e8f26775fcc3535", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-offset-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-fixpos-cb-transform-1.html": [ + "92632cd62d47b3718e2c529f6d3101192af99b7c", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-offset-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-fixpos-cb-transform-style-1.html": [ + "808f7d8cd0957e2f157b327ce6a29b384640391b", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-offset-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-fixpos-cb-translate-1.html": [ + "7ff0dfe768a43d06740dd2fb338aab855ff0a175", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-offset-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-backdrop-filter-1.html": [ + "0081e93c4fa2c0eb14e1e51545c45a50c2d565de", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-clip-path-1.html": [ + "673d1a895b5a62ad205c10a5883c5862e171eee6", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-filter-1.html": [ + "0f87768db1ca1fa870ddd3b32568d8ba203ff047", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-height-1.html": [ + "3ce0e61588a43f49123f7525b055d7b1cdb7b477", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-isolation-1.html": [ + "9eaf812e937d1e571c9259060e05ce0aad4118d4", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-mask-1.html": [ + "77ec10caa97f12198bc71e7240b152c67de1219a", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-mix-blend-mode-1.html": [ + "ae13ac6b668889785ba51e778ee64ab15df24379", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-offset-path-1.html": [ + "07277b66d92f74e0d8df1d934ff213efd78c9ab4", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-opacity-1.html": [ + "2bff6676a7171e9132f7d4168d5ee2ad7c3b0f62", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-opacity-2.html": [ + "dfedbd2307bdc87569deda11a5335af7faf2282f", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-perspective-1.html": [ + "3a6863220f7dbc34ca2565bd201092d89a9b8dbd", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-position-1.html": [ + "a244b7c2c55ccf1109fdb852bfd05b288a149336", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-transform-1.html": [ + "1b55d1f7aad334de89748c953edc97551f15cbfa", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-transform-style-1.html": [ + "f8e50c60c13ee88005d5e2821d03ba28f0cc5db7", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-translate-1.html": [ + "1e1e8355d6c54e845d36fc708bbcd1eba782cea2", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", + "==" + ] + ], + {} + ] + ], + "will-change-stacking-context-z-index-1.html": [ + "bcb9ea0a1d62a1ceeb5b6e60e7f90b97bf5b03ed", + [ + null, + [ + [ + "/css/css-will-change/green-square-100-by-100-ref.html", "==" ] ], @@ -161675,6 +162046,32 @@ {} ] ], + "filter-cb-dynamic-1a.html": [ + "cc8c74701fb52bfab4960a6aac00c63f7f8cbc8d", + [ + null, + [ + [ + "/css/filter-effects/filter-cb-dynamic-1-ref.html", + "==" + ] + ], + {} + ] + ], + "filter-cb-dynamic-1b.html": [ + "15e30ee5711c97c68e112f8bdd24a7659ea0915f", + [ + null, + [ + [ + "/css/filter-effects/filter-cb-dynamic-1-ref.html", + "==" + ] + ], + {} + ] + ], "filter-contrast-001.html": [ "3f2281fcbabb8bcbc73e36980229fdcf47eb1ccf", [ @@ -166598,307 +166995,6 @@ ] ] }, - "ib-split": { - "emptyspan-1.html": [ - "dcf9367d2a2aa33599435ceaf176e79f9336cc3c", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-1-ref.html", - "==" - ] - ], - {} - ] - ], - "emptyspan-2.html": [ - "b740fad71b81c7a6b80e2acde33f862989a8aa73", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-2-ref.html", - "==" - ] - ], - {} - ] - ], - "emptyspan-3.html": [ - "1be809ec2d5471897098ade188c3eb41fadd7ce0", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-3-ref.html", - "==" - ] - ], - {} - ] - ], - "emptyspan-4.html": [ - "3656ada50420076c1a32273c4ac8c22f630a0013", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-4-ref.html", - "==" - ] - ], - {} - ] - ], - "float-inside-inline-between-blocks-1.html": [ - "296dcb9bde90c1e579f5baeb937510b644a5e886", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/float-inside-inline-between-blocks-1-ref.html", - "==" - ] - ], - {} - ] - ], - "percent-height-1.html": [ - "91c1594b2775dffcbd1fa8224c19b3ee8e98b7ab", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/percent-height-1-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-1-ref.html": [ - "f197d6ac93da70b237751f56c6e7a4631831b35f", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1-noib-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-1.html": [ - "07053efa19b0a0bca41d840ad7323c7d33d2f459", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-2.html": [ - "d4cf51040e55ebd7faca43cbb893b79001546519", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-2-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-3-ref.html": [ - "5822665ffee2503e0a3307b0f0f19d77e39267b6", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3-noib-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-3.html": [ - "1d5e2a45bea3e3ee843aadb1cd75ff548b300fa8", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-4-ref.html": [ - "8768b0d25bb56a6ea7ee56f0ecf2b34a4ea0163c", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4-noib-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-4.html": [ - "44c0ceed87db65c7c11d7df275433ed6d6a78aa1", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-5-ref.html": [ - "68258ef8b1a5b3f915f524aa2c0ce8e9b6b6ff62", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5-noib-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-5.html": [ - "539115e030142ab99be79814d0fc840b2fe53b00", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-6-ref.html": [ - "bd43b45db5c8be07fb5ae80c19da36959f69f06b", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6-noib-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-from-split-inline-6.html": [ - "99bbcf7a0f0676e384bdf645b4eb5059fdb36c36", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6-ref.html", - "==" - ] - ], - {} - ] - ], - "remove-split-inline-1.html": [ - "cfe6a5e8c02eaa683836da5bc9e0073755977662", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-split-inline-1-ref.html", - "==" - ] - ], - {} - ] - ], - "split-inner-inline-1.html": [ - "3ae7392c2347a901e247adccb30227a8e812d29e", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-1-ref.html", - "==" - ] - ], - {} - ] - ], - "split-inner-inline-2.html": [ - "318df5344f74e5d0662f3d47fa20d0c2ffe1fa1f", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-2-ref.html", - "==" - ] - ], - {} - ] - ], - "table-pseudo-in-part3-1.html": [ - "cb50af9ca87c4d276cbbdf5f99eaddb7fdd33d3a", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/table-pseudo-in-part3-1-ref.html", - "==" - ] - ], - {} - ] - ], - "whitespace-present-1a.html": [ - "283884b0843ab525bb29d0ebeda635ba63ae4d73", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1-ref.html", - "==" - ] - ], - {} - ] - ], - "whitespace-present-1b.html": [ - "70239a8e0853afad656f70cdba460dc3f10995fc", - [ - null, - [ - [ - "/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1-ref.html", - "==" - ] - ], - {} - ] - ] - }, "selectors4": { "child-index-no-parent-01.html": [ "5ae108b7df2dd09d4dff1b31e40e79fcdb6a4e99", @@ -183565,7 +183661,7 @@ [] ], "README.md": [ - "96fdf8d770f566e145c8dd0a31e01e184778ecf0", + "5946646c9f5c4e4de7939f526aef4f91a9bc0148", [] ], "WebCryptoAPI": { @@ -185550,7 +185646,7 @@ [] ], "image.py": [ - "6991224717e70becbd45709461a3f807c40b2081", + "5c9a0c063c367cf7cdc000a88c381d886681068d", [] ], "referrer.py": [ @@ -186961,6 +187057,10 @@ "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", [] ], + "iframe-do.sub.html": [ + "effc1adcdde2b0c85eee53d2a83cc2219eeb05b2", + [] + ], "javascript-url-srcdoc-cross-origin-iframe-inheritance-helper.sub.html": [ "afe4753cf93f8d68884eb731ce69e004a4b5e9ff", [] @@ -200502,6 +200602,14 @@ "098fca5ea76ff3dd31633dc1c7c7166fa7cf076a", [] ], + "font-size-zero-1-notref.html": [ + "9e95ca66ec75caeaa104b7f9eea14ace52f7f46b", + [] + ], + "font-size-zero-2-ref.html": [ + "2aea76d74d479de7497a0fbb53fd89527e87708e", + [] + ], "font-stretch-pass-ref.html": [ "0bd11557a61fd6ee1a2317853458415d156a165c", [] @@ -207390,6 +207498,10 @@ "variable-opsz-ref.html": [ "24080345ba03cc983685d6fe3ed1c1f6631ce254", [] + ], + "variable-opsz-size-adjust-ref.html": [ + "4e88cace350e32711fc06220c2d14dcbd3ab3339", + [] ] } }, @@ -223040,6 +223152,14 @@ "8d265f24986c7af2b08a26741bbfa56f321bfbb3", [] ], + "green-square-100-by-100-offset-ref.html": [ + "fee7030b6d047ff5ca9be9b6d0d69cd33e95af5c", + [] + ], + "green-square-100-by-100-ref.html": [ + "c49bf5a21db575fe8f8ca7f29bcb70a22b884031", + [] + ], "parsing": { "will-change-computed-expected.txt": [ "d3e732b786b28043463eaf01066f2b6ff4857432", @@ -223086,18 +223206,6 @@ "05957327c331a953cc907eeb5ffd2ba117f6f227", [] ], - "will-change-stacking-context-001-ref.html": [ - "38138ebcac3d73796e00173f6a84ba7edaa17cd2", - [] - ], - "will-change-stacking-context-002-ref.html": [ - "38138ebcac3d73796e00173f6a84ba7edaa17cd2", - [] - ], - "will-change-stacking-context-003-ref.html": [ - "38138ebcac3d73796e00173f6a84ba7edaa17cd2", - [] - ], "will-change-transform-add-content-ref.html": [ "edbeaa7b69290ea2514dc85e0e3f47bd8247735e", [] @@ -226254,6 +226362,10 @@ "8b000d96e3978b15bc08ba463ca9c139cdea7136", [] ], + "filter-cb-dynamic-1-ref.html": [ + "7b746b82b2e75d6b6026dab081e99248adc7c34d", + [] + ], "filter-contrast-001-ref.html": [ "1be00e8bba72ed3203819cb51586947535ac5096", [] @@ -226810,10 +226922,6 @@ [] ] }, - "test_media_queries-expected.txt": [ - "5dd6f0116ba1c8a83eca779be742505c6ec948a0", - [] - ], "viewport-script-dynamic-ref.html": [ "e3f1c95d66fcd89bdce9fc08e31e798df3053e32", [] @@ -227684,76 +227792,6 @@ [] ] }, - "ib-split": { - "emptyspan-1-ref.html": [ - "a66a85e762d7d7186b8ddc190d9a2ae7ce19f7a3", - [] - ], - "emptyspan-2-ref.html": [ - "941044b92600db9a536436d3a65a7e7b59da1529", - [] - ], - "emptyspan-3-ref.html": [ - "629c3424ca5c0e17a1c60446aad3214b15dbc7d4", - [] - ], - "emptyspan-4-ref.html": [ - "af74e690e182ab018c66eb8223d84392e03bacfd", - [] - ], - "float-inside-inline-between-blocks-1-ref.html": [ - "d9146e2ae098396623628343ce1417866087d691", - [] - ], - "percent-height-1-ref.html": [ - "0f74e18a85a0539026e9c85c61cd773f2be9fa3c", - [] - ], - "remove-from-split-inline-1-noib-ref.html": [ - "7b8a141e7865fc1ae2541c94a64d398ba177535f", - [] - ], - "remove-from-split-inline-2-ref.html": [ - "9fd41e13849ec3e65c8216bf7d192c5ef93f4091", - [] - ], - "remove-from-split-inline-3-noib-ref.html": [ - "124b8fd8909352aec9c57951e960835d3b280df9", - [] - ], - "remove-from-split-inline-4-noib-ref.html": [ - "10c563ce5405ad01085249e96c30be807058bc0d", - [] - ], - "remove-from-split-inline-5-noib-ref.html": [ - "8bd8802f6652af6545cfdf0dfb7ddbc364600bbd", - [] - ], - "remove-from-split-inline-6-noib-ref.html": [ - "7678e811c0d6f568ea7ba4317cde2b03a4cfde84", - [] - ], - "remove-split-inline-1-ref.html": [ - "cf4cfffd50350f165a4ca85a4abe2a0c3a190c9f", - [] - ], - "split-inner-inline-1-ref.html": [ - "3f2a82f83c10707c5d000afba83805a8d1934f87", - [] - ], - "split-inner-inline-2-ref.html": [ - "1ace2f8fb64e500ab13fb88a44042063822244f2", - [] - ], - "table-pseudo-in-part3-1-ref.html": [ - "b21050370d4819ed10910bcfc4f2ff763cc4c8e6", - [] - ], - "whitespace-present-1-ref.html": [ - "46cac675c51137ccd1214a6971e3705c37c28877", - [] - ] - }, "selectors4": { "OWNERS": [ "5e03d9bce08ec1c2c4d3a23b993e8f428c9e68db", @@ -228091,7 +228129,7 @@ ], "admin": { "index.md": [ - "59569fd464c46c2010a48c8c62d8bfdd88b021c1", + "7acecdfd7c34a90e48a4ae19531f43ddf8654414", [] ], "pywebsocket3.rst": [ @@ -228174,7 +228212,7 @@ [] ], "index.md": [ - "419c99aca9d78c259235dbaa9e8ab662930ffb81", + "b0ba0340d621777cb50f63a0cb1407c5d4179a79", [] ], "intro-video-transcript.md": [ @@ -228241,7 +228279,7 @@ [] ], "from-web.md": [ - "464febbfc0448d209deebd312c74dcb0a7304d3b", + "157598da36d2a0630f05943f734502e22c4188bb", [] ], "index.md": [ @@ -232059,6 +232097,14 @@ ] }, "body": { + "formdata.any-expected.txt": [ + "ecd514be687ea819305f110860de33a661714793", + [] + ], + "formdata.any.worker-expected.txt": [ + "ecd514be687ea819305f110860de33a661714793", + [] + ], "mime-type.any-expected.txt": [ "3de828baab31cabf35d04c2ab253965cf0088f25", [] @@ -238332,11 +238378,11 @@ [] ], "name2dir-offscreen.yaml": [ - "9f6389704f260112e348d06733058188588fa5f5", + "4ac261fe325fddc6563f49423c400a15e4884563", [] ], "name2dir.yaml": [ - "bfb795325203d92931fca4e221b806cad0ff89da", + "8f3c2c9d35eb6fed2d2031faf86b5f19883db4cc", [] ], "spec.yaml": [ @@ -238381,6 +238427,10 @@ "7b82933c86a5d0528f03ca783481443230ed93d5", [] ], + "filters.yaml": [ + "2c275d6d73b22331d5606858cd072316a2ee9fbf", + [] + ], "line-styles.yaml": [ "e6dc3205e727142a4363252ac2576409be8a7eea", [] @@ -238406,7 +238456,7 @@ [] ], "shadows.yaml": [ - "5459033ed57f4fa4df12689554744f7f7e45bcb9", + "599c00804d7cf9746d95c16244c97455e68fbd8d", [] ], "text-styles.yaml": [ @@ -238455,6 +238505,10 @@ "841e313a1346a8cd2fa63d88ff2ec0bc732c88f7", [] ], + "filters.yaml": [ + "43062a66f405a368e086284fec30f70ab13bfe1f", + [] + ], "line-styles.yaml": [ "762deeb84cbcd940ad2faf50c207d1dacb42368c", [] @@ -238472,7 +238526,7 @@ [] ], "shadows.yaml": [ - "d58cf2bfb964ed1ed14f68fc7d6368f63cc98da6", + "28f5d4bfae7f89ab665f94b3d3cafb0c1aab11d0", [] ], "text.yaml": [ @@ -242856,6 +242910,22 @@ "63b60e490f47f4db77d33d7a4ca2f5b9a4181de8", [] ], + "no-coop-coep.https.any-expected.txt": [ + "9cad9da2de8f1c713518a6bd43adcb52ff0777c9", + [] + ], + "no-coop-coep.https.any.serviceworker-expected.txt": [ + "11ccabce6e4bd36ed6744f4c3b3429bca52aefc9", + [] + ], + "no-coop-coep.https.any.sharedworker-expected.txt": [ + "11ccabce6e4bd36ed6744f4c3b3429bca52aefc9", + [] + ], + "no-coop-coep.https.any.worker-expected.txt": [ + "11ccabce6e4bd36ed6744f4c3b3429bca52aefc9", + [] + ], "no-transferring.https.html.headers": [ "63b60e490f47f4db77d33d7a4ca2f5b9a4181de8", [] @@ -253402,7 +253472,7 @@ [] ], "generated-mime-types.py": [ - "91921149011a5d25422961c3e13a3316963760a3", + "5d0e26c8b8d6c86ed9fca055eeeff8f0cb97264b", [] ], "mime-charset.py": [ @@ -257551,7 +257621,7 @@ [] ], "all_resource_types.htm": [ - "bc7101c219230376ffec008dce73bc42f06cbe3f", + "5252a4872ab4e28e6650c45c779b3805254fa90f", [] ], "blank-with-tao.html": [ @@ -257562,14 +257632,6 @@ "7296361df3d1c5755acdb825661dbd9a1807b64f", [] ], - "blank_page_green.htm": [ - "b8a1947b77e25ac6b0d100c75932e8c0a67d846f", - [] - ], - "blank_page_green.htm.headers": [ - "cb762eff806849df46dc758ef7b98b63f27f54c9", - [] - ], "blue-with-tao.png": [ "820f8cace2143bfc45c0c301e84b6c29b8630068", [] @@ -257666,12 +257728,20 @@ "2ee92b2a5511c0d43359e0db7ee3b64ae5f9115c", [] ], - "green_frame.htm": [ - "f3f03245dcc8bde7e969d7682d03c9b89bcb4a1c", + "green-frame.html": [ + "9613240ae38789a104d77d56f890ff62420934b0", + [] + ], + "green.html": [ + "b8a1947b77e25ac6b0d100c75932e8c0a67d846f", + [] + ], + "green.html.headers": [ + "cb762eff806849df46dc758ef7b98b63f27f54c9", [] ], "gzip_xml.py": [ - "2293605ac33a4d357a426cde139bb7d44e4e0cb3", + "7debc9ce3f6cb061be8ca37b73fcf9f2a5396389", [] ], "iframe-TAO-crossorigin-port.sub.html": [ @@ -259779,7 +259849,7 @@ [] ], "registration-scope-module-static-import.https-expected.txt": [ - "66b5edf9100c6760fdb8885c69a2b58989d301ec", + "f2c497809b013369c7e8145fa0e670d03c2a669e", [] ], "registration-updateviacache.https-expected.txt": [ @@ -263579,7 +263649,7 @@ } }, "update-built-tests.sh": [ - "3bc5e367948d9dc26c91e75c2bfd37cd5e3b781e", + "6986440caacd6d9707a11eb2d72a39fc5437ac95", [] ], "upgrade-insecure-requests": { @@ -271275,7 +271345,7 @@ [] ], "gzip.py": [ - "17f142c4405f8e121a2468ffc380a9d56ef0822e", + "fd1ca926fb7d6b5ffa292a4bce77a1116803f296", [] ], "header-content-length-twice.asis": [ @@ -293929,6 +293999,13 @@ {} ] ], + "inheritance-from-initiator.sub.html": [ + "4621c57d45cf1938db812da5d88f7b1cf8f4ea83", + [ + null, + {} + ] + ], "inherited-csp-list-modifications-are-local.html": [ "c473b3f4262230f6e052d149d6461b7c0cabeff7", [ @@ -310683,7 +310760,7 @@ ] ], "position-sticky-input-box-gets-focused-after-scroll.html": [ - "5b2d705e2d0721c072bedf1dcc489fae25b2014f", + "438547dbb75a6e8c5735404c4b665b5fca4365f6", [ null, {} @@ -310821,6 +310898,15 @@ null, {} ] + ], + "sticky-after-input.html": [ + "9104aa3c5e9b40bf478524d30fc95000774d16fc", + [ + null, + { + "testdriver": true + } + ] ] } }, @@ -324705,7 +324791,7 @@ ] ], "test_media_queries.html": [ - "b063d2b6834d8fb7137137c47895b1b17c393b97", + "1630e54e513b245a186a2ba777d1b1169cb4ecdf", [ null, {} @@ -346675,6 +346761,17 @@ ] }, "body": { + "formdata.any.js": [ + "e25035923c1f9e93042889a914f0253a01eb4a15", + [ + "fetch/api/body/formdata.any.html", + {} + ], + [ + "fetch/api/body/formdata.any.worker.html", + {} + ] + ], "mime-type.any.js": [ "a0f90a0abdfc3e672997607611438ff0049ecf2c", [ @@ -363418,6 +363515,29 @@ ] ] }, + "filters": { + "2d.filter.canvasFilterObject.blur.exceptions.html": [ + "f8a93d687135cf8b14a553579126deb744275b9c", + [ + null, + {} + ] + ], + "2d.filter.canvasFilterObject.html": [ + "c4a0838d4fa647d7cdf712b26ae8645acee5be38", + [ + null, + {} + ] + ], + "2d.filter.value.html": [ + "b5803655f5c6e27357996c2ca6243e1c9fb6a882", + [ + null, + {} + ] + ] + }, "line-styles": { "2d.line.cap.butt.html": [ "62ddcfc611e51c9750feea1d6526b911d039df8b", @@ -365891,20 +366011,6 @@ {} ] ], - "2d.shadow.canvasfilter.blur.object.exceptions.html": [ - "3605d40bfbfab45fa13e8b71d02913a0dcafb9b4", - [ - null, - {} - ] - ], - "2d.shadow.canvasfilter.object.html": [ - "093bf7e96c1c866bbd418f7d8e52c1c7ecf1011d", - [ - null, - {} - ] - ], "2d.shadow.clip.1.html": [ "880c26558dea842b7880fcb38c032e760dfed3f0", [ @@ -365982,13 +366088,6 @@ {} ] ], - "2d.shadow.filter.value.html": [ - "72c48ed5c52acdc2fd82226a9ae21dc6dfb6fd4e", - [ - null, - {} - ] - ], "2d.shadow.gradient.alpha.html": [ "f864bb37af442dbf9c4ecaaf70e87dcf723a1bd7", [ @@ -372283,6 +372382,36 @@ ] ] }, + "filters": { + "2d.filter.canvasFilterObject.blur.exceptions.html": [ + "6ca962c7f02772de40f45701e65a55c2e1e9029d", + [ + null, + {} + ] + ], + "2d.filter.canvasFilterObject.blur.exceptions.worker.js": [ + "276c7b23c5f59a0b0a68c4d940a92eb2fbe8466a", + [ + "html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.worker.html", + {} + ] + ], + "2d.filter.canvasFilterObject.html": [ + "8e2e2d8ba95efd638f0a6b54a702e55f55ae910b", + [ + null, + {} + ] + ], + "2d.filter.canvasFilterObject.worker.js": [ + "d07c32e0eb93dd216a2f11947c5d9413ee82d6c7", + [ + "html/canvas/offscreen/filters/2d.filter.canvasFilterObject.worker.html", + {} + ] + ] + }, "line-styles": { "2d.line.cap.butt.html": [ "10c98ce0819eaff0591ada371b649408ed09adb4", @@ -376303,34 +376432,6 @@ {} ] ], - "2d.shadow.canvasfilter.blur.object.exceptions.html": [ - "fe3442d0902e444bb5e2684967fb77998c1b0889", - [ - null, - {} - ] - ], - "2d.shadow.canvasfilter.blur.object.exceptions.worker.js": [ - "cc8d33c70dd1c9b8448053c7649c694a31325475", - [ - "html/canvas/offscreen/shadows/2d.shadow.canvasfilter.blur.object.exceptions.worker.html", - {} - ] - ], - "2d.shadow.canvasfilter.object.html": [ - "47ff374a05ff994dbc1e6d017cbc01068192d529", - [ - null, - {} - ] - ], - "2d.shadow.canvasfilter.object.worker.js": [ - "d7b2597b6c10c15d21b1e11f4918aed26f858ae1", - [ - "html/canvas/offscreen/shadows/2d.shadow.canvasfilter.object.worker.html", - {} - ] - ], "2d.shadow.clip.1.html": [ "2e5f45c954e646228e6eeb0dfec3a015dadc795f", [ @@ -388439,6 +388540,13 @@ {} ] ], + "request-submit-activation.html": [ + "0d1e54daf363296a8555d6079eb1959edeb472d9", + [ + null, + {} + ] + ], "submission-checks.window.js": [ "e242ce830a618cb1bff17c80a6c6559250c1a16d", [ @@ -388982,7 +389090,7 @@ ] ], "form-requestsubmit.html": [ - "65f4b2187dc78ebeb7f1307b5b8c5580e3fcc390", + "cbc46cc7d3829822dbc7df6fc0c0fa758062c38a", [ null, {} @@ -389359,6 +389467,13 @@ {} ] ], + "radio-morphed.html": [ + "b7b8658948d13e403742ae90a62f7f5744eae809", + [ + null, + {} + ] + ], "radio.html": [ "7f183f8367db079cd3b8e6b7a0dc741e874c4d0f", [ @@ -390529,7 +390644,7 @@ ] ], "async_005.htm": [ - "7d79657bf7b3ac6b2026cd24f35dcba986f1ab78", + "03f9adeb67e5f1150b16f78f5840e72eb61add06", [ null, { @@ -391025,7 +391140,7 @@ ] ], "050.html": [ - "143fc917e099c0b000c76b9fa98a096524196491", + "a400749f18e4f83803ee325d45611c0c3ad48a17", [ null, { @@ -396410,6 +396525,13 @@ {} ] ], + "during-readystatechange.window.js": [ + "49d5051c2564c257f916c00d2d73864d129b0a77", + [ + "html/webappapis/dynamic-markup-insertion/document-write/during-readystatechange.window.html", + {} + ] + ], "iframe_001.html": [ "8b54560c6ce5094dd45d661d1a9c3f73db016c7b", [ @@ -409278,6 +409400,13 @@ }, "paint-timing": { "fcp-only": { + "buffered-flag.window.js": [ + "5c83ac01da457cbd6d48ed97b21269b1b1b0a5cc", + [ + "paint-timing/fcp-only/buffered-flag.window.html", + {} + ] + ], "fcp-background-size.html": [ "25fe986bdede921980b96c10f9d3d26a83558cbc", [ @@ -425741,7 +425870,7 @@ ] ], "cross-origin-redirects.html": [ - "7e7eb8a86270a62fe38ffe94871efa20b4e53d9d", + "affc4a05b39cfcf6578c34d9738a1109012811e9", [ null, {} @@ -425776,7 +425905,7 @@ ] ], "fetch-cross-origin-redirect.https.html": [ - "e11f21a45755b3fa6da42025d1730d23e8fc4bfb", + "eab615b62ac9186948117fc4fa55c27fee2c165c", [ null, {} @@ -425833,7 +425962,7 @@ ] ], "iframe-failed-commit.html": [ - "56fe1d594f9479e3be31292147876741aebc7fa3", + "49bd93427c1d39ac5aed928caa3d0253557dd416", [ null, {} @@ -425874,7 +426003,7 @@ ] ], "nextHopProtocol-tao-protected.https.html": [ - "1b2b03016af147588fe4b208dc2f76f7a7ea44b4", + "6011ec2ad9007cc5657a96b4c0530a45c9139a91", [ null, { @@ -425911,7 +426040,7 @@ ] ], "redirects.html": [ - "35d96d4de150476b01f64b3a0af86b15727fef63", + "ba69907a5f6e46a3e8a79041da17039d14d20feb", [ null, {} @@ -426074,7 +426203,7 @@ ] ], "resource_initiator_types.html": [ - "9912da7c3400138d73245acc372463ca174e6f58", + "954978c1b38c9bd66504e9a589e4300c8a8bae8b", [ null, {} @@ -426194,7 +426323,7 @@ ] ], "workerStart-tao-protected.https.html": [ - "f9b50f70360dd6e09908bc2d81dff13735aad236", + "4856f467f16f6e3821d48ea7542d154b3de53bd7", [ null, { @@ -452615,6 +452744,31 @@ } ] ], + "videoFrame-readInto.any.js": [ + "aaf95bf2ab7020ff68090b2a0e665e5c9afc0d04", + [ + "webcodecs/videoFrame-readInto.any.html", + { + "script_metadata": [ + [ + "global", + "window,dedicatedworker" + ] + ] + } + ], + [ + "webcodecs/videoFrame-readInto.any.worker.html", + { + "script_metadata": [ + [ + "global", + "window,dedicatedworker" + ] + ] + } + ] + ], "videoFrame-texImage.any.js": [ "a1405ef67d4c415e361f00a842f7fdfcfd53992e", [ @@ -487461,7 +487615,7 @@ ] ], "execute_async.py": [ - "e584020aa94c42f1027376f5811d1e2a88200ea9", + "5746ed6f05f37d7329308a5f46d47550c8a78164", [ null, {}
diff --git a/third_party/blink/web_tests/external/wpt/README.md b/third_party/blink/web_tests/external/wpt/README.md index 96fdf8d..5946646 100644 --- a/third_party/blink/web_tests/external/wpt/README.md +++ b/third_party/blink/web_tests/external/wpt/README.md
@@ -21,7 +21,7 @@ - [web-platform-tests.org](https://web-platform-tests.org): the documentation website; details how to set up the project, how to write tests, how to give and receive peer review, how to serve as an administrator, and more -- [wpt.live](http://wpt.live): a public deployment of the test suite, +- [wpt.live](https://wpt.live): a public deployment of the test suite, allowing anyone to run the tests by visiting from an Internet-enabled browser of their choice - [wpt.fyi](https://wpt.fyi): an archive of test results collected from an @@ -94,10 +94,11 @@ Publication =========== -The master branch is automatically synced to http://w3c-test.org/. +The master branch is automatically synced to [wpt.live](https://wpt.live/) and +[w3c-test.org](https://w3c-test.org/). Pull requests are -[automatically mirrored](http://w3c-test.org/submissions/) except those +[automatically mirrored](https://w3c-test.org/submissions/) except those that modify sensitive resources (such as `.py`). The latter require someone with merge access to comment with "LGTM" or "w3c-test:mirror" to indicate the pull request has been checked.
diff --git a/third_party/blink/web_tests/external/wpt/common/security-features/subresource/image.py b/third_party/blink/web_tests/external/wpt/common/security-features/subresource/image.py index 6991224..5c9a0c0 100644 --- a/third_party/blink/web_tests/external/wpt/common/security-features/subresource/image.py +++ b/third_party/blink/web_tests/external/wpt/common/security-features/subresource/image.py
@@ -1,6 +1,6 @@ import os, sys, array, math -from six import BytesIO +from io import BytesIO from wptserve.utils import isomorphic_decode
diff --git a/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-rotated-clip.html b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-rotated-clip.html new file mode 100644 index 0000000..9e915ac --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-rotated-clip.html
@@ -0,0 +1,12 @@ +<!DOCTYPE html> +<title>mix-blend-mode under rotated clip</title> +<link rel="help" href="https://drafts.fxtf.org/compositing-1/#mix-blend-mode"> +<link rel="match" href="reference/mix-blend-mode-rotated-clip-ref.html"> +<style>div { width: 100px; height: 100px; }</style> +<div style="background: lime; overflow: hidden"> + <div style="transform: rotate(45deg)"> + <div style="background: lime; overflow: hidden"> + <div style="background: red; transform: rotate(-45deg); mix-blend-mode: overlay; will-change: transform"></div> + </div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/reference/mix-blend-mode-rotated-clip-ref.html b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/reference/mix-blend-mode-rotated-clip-ref.html new file mode 100644 index 0000000..377ed7c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/compositing/mix-blend-mode/reference/mix-blend-mode-rotated-clip-ref.html
@@ -0,0 +1,2 @@ +<!DOCTYPE html> +<div style="width: 100px; height: 100px; background: lime"></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-adjust-zero-1.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-adjust-zero-1.html new file mode 100644 index 0000000..ea1e574 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-adjust-zero-1.html
@@ -0,0 +1,19 @@ +<!DOCTYPE HTML> +<title>CSS Test: font-size-adjust: 0</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-size-adjust-prop"> +<link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> +<link rel="match" href="font-size-zero-2-ref.html"> +<meta name="flags" content=""> +<style> +/* spec ambiguous whether font-size-adjust influences line-height: normal */ +body { line-height: 1.2 } + +p { margin: 1em 0 } +p.zero { font-size-adjust: 0 } +</style> + +<p>before</p> +<p class="zero">zero</p> +<p>after</p>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-adjust-zero-2.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-adjust-zero-2.html new file mode 100644 index 0000000..0fadcd45 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-adjust-zero-2.html
@@ -0,0 +1,20 @@ +<!DOCTYPE HTML> +<title>CSS Test: font-size-adjust: 0</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-size-adjust-prop"> +<link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> +<link rel="match" href="font-size-zero-2-ref.html"> +<meta name="flags" content=""> +<style> +/* spec ambiguous whether font-size-adjust influences line-height: normal */ +body { line-height: 1.2 } +span { line-height: 0 } + +p { margin: 1em 0 } +span.zero { font-size-adjust: 0 } +</style> + +<p>before</p> +<p><span class="zero">zero</span></p> +<p>after</p>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-1-notref.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-1-notref.html new file mode 100644 index 0000000..9e95ca66 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-1-notref.html
@@ -0,0 +1,13 @@ +<!DOCTYPE HTML> +<title>CSS Test Reference</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<meta name="flags" content=""> +<style> +/* spec ambiguous whether font-size-adjust influences line-height: normal */ +body { line-height: 1.2 } +</style> + +<p>before</p> +<p>zero</p> +<p>after</p>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-1-ref.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-1-ref.html new file mode 100644 index 0000000..f3bdd53d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-1-ref.html
@@ -0,0 +1,16 @@ +<!DOCTYPE HTML> +<title>CSS Test Reference</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="mismatch" href="font-size-zero-1-notref.html"> +<meta name="flags" content=""> +<style> +/* spec ambiguous whether font-size-adjust influences line-height: normal */ +body { line-height: 1.2 } + +p { margin: 1em 0 } +p.first { margin-bottom: 2em } +</style> + +<p class="first">before</p> +<p>after</p>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-1.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-1.html new file mode 100644 index 0000000..9b7b3e6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-1.html
@@ -0,0 +1,19 @@ +<!DOCTYPE HTML> +<title>CSS Test: font-size: 0</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-size-prop"> +<link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> +<link rel="match" href="font-size-zero-1-ref.html"> +<meta name="flags" content=""> +<style> +/* spec ambiguous whether font-size-adjust influences line-height: normal */ +body { line-height: 1.2 } + +p { margin: 1em 0 } +p.zero { font-size: 0 } +</style> + +<p>before</p> +<p class="zero">zero</p> +<p>after</p>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-2-ref.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-2-ref.html new file mode 100644 index 0000000..2aea76d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-2-ref.html
@@ -0,0 +1,13 @@ +<!DOCTYPE HTML> +<title>CSS Test Reference</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<meta name="flags" content=""> +<style> +/* spec ambiguous whether font-size-adjust influences line-height: normal */ +body { line-height: 1.2 } +</style> + +<p>before</p> +<p> </p> +<p>after</p>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-2.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-2.html new file mode 100644 index 0000000..5b5aaa5 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/font-size-zero-2.html
@@ -0,0 +1,19 @@ +<!DOCTYPE HTML> +<title>CSS Test: font-size: 0</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="http://www.w3.org/TR/css3-fonts/#font-size-prop"> +<link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"> +<link rel="match" href="font-size-zero-2-ref.html"> +<meta name="flags" content=""> +<style> +/* spec ambiguous whether font-size-adjust influences line-height: normal */ +body { line-height: 1.2 } + +p { margin: 1em 0 } +span.zero { font-size: 0 } +</style> + +<p>before</p> +<p><span class="zero">zero</span></p> +<p>after</p>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/variations/variable-opsz-size-adjust-ref.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/variations/variable-opsz-size-adjust-ref.html new file mode 100644 index 0000000..4e88cace --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/variations/variable-opsz-size-adjust-ref.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<meta charset="utf-8"> +<style> + @font-face { + font-family: variabletest_box; + src: url(resources/variabletest_box.ttf); + } + + body { + font-family: variabletest_box, sans-serif; + font-optical-sizing: none; + } + + div { + line-height: 64px; + } + +</style> +<div style="font-size: 9px; font-variation-settings: 'opsz' 9;">B</div> +<div style="font-size: 18px; font-variation-settings: 'opsz' 18;">B</div> +<div style="font-size: 36px; font-variation-settings: 'opsz' 36;">B</div> +<div style="font-size: 72px; font-variation-settings: 'opsz' 72;">B</div> +<div style="font-size: 96px; font-variation-settings: 'opsz' 96;">B</div> +<div style="font-size: 36px; font-variation-settings: 'opsz' 128;">B</div> +<div style="font-size: 72px; font-variation-settings: 'opsz' 12;">B</div> +<script> + document.fonts.ready.then( + () => { document.documentElement.classList.remove("reftest-wait"); }); +</script> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-fonts/variations/variable-opsz-size-adjust.html b/third_party/blink/web_tests/external/wpt/css/css-fonts/variations/variable-opsz-size-adjust.html new file mode 100644 index 0000000..b673f3c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-fonts/variations/variable-opsz-size-adjust.html
@@ -0,0 +1,39 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<link rel="author" title="Dominik Röttsches" href="drott@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-optical-sizing-def"/> +<link rel="help" href="https://drafts.csswg.org/css-fonts-5/#size-adjust-desc"/> +<meta name="assert" content="Ensures that optical size is adjusted with size-adjust to displayed font size."/> +<link rel="match" href="variable-opsz-size-adjust-ref.html"> +<meta charset="utf-8"> +<style> + @font-face { + font-family: variabletest_box; + src: url(resources/variabletest_box.ttf); + size-adjust: 150%; + } + + body { + font-family: variabletest_box, sans-serif; + } + + div { + line-height: 64px; + } +</style> +<!-- The variabletest_box font file contains a glyph for letter B which moves a + horizontal bar up from the middle for opsz > 12 and moves it down for opsz < + 12 where the opsz axis ranges from 6 to 128. --> +<div style="font-size: 6px;">B</div> +<div style="font-size: 12px;">B</div> +<div style="font-size: 24px;">B</div> +<div style="font-size: 48px;">B</div> +<div style="font-size: 64px;">B</div> +<!-- Explicit value overrides auto. --> +<div style="font-size: 24px; font-variation-settings: 'opsz' 128;">B</div> +<div style="font-size: 48px; font-optical-sizing: none;">B</div> +<script> + document.fonts.ready.then( + () => { document.documentElement.classList.remove("reftest-wait"); }); +</script> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-tables/tentative/colspan-redistribution.html b/third_party/blink/web_tests/external/wpt/css/css-tables/tentative/colspan-redistribution.html index e440728..2797a1e 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-tables/tentative/colspan-redistribution.html +++ b/third_party/blink/web_tests/external/wpt/css/css-tables/tentative/colspan-redistribution.html
@@ -216,29 +216,31 @@ </table> </div> -<p 12 class="testdesc">Colspan>1:Auto/400 C0:50%/150 C1:30%/150 C2:20/Auto +<p 12 class="testdesc">Colspan>1:Auto/468 C0:50%/150 C1:30%/150 C2:20/Auto This tests conflict resolution where min-width > redistributed min width. -400-8px distributed max width tries to redistribute as 245|147, but gets constrained to 245|150 in Chrome. -table width from C0 245/0.5 + 4*8 = 522 -table width from C1 150/0.3 + 4*8 = 532 -C0 = 50% of 500 = 250, C1 = 30% of 500 = 150 , C2 gets the remaining 100</p> -<p class="error">Chrome/FF/Edge end up with tables of different widths: 532/590/685. Chrome's 2nd span cell seems 'most correct' at its original max width of 150. In FF, extra min-width seems to cause more width to be redistributed. If you hover over 30%/150 cell, its min width will change to 100px, and all browsers will agree.</p> -<style> - .test12:hover { - width:100px !important; - } -</style> -<table data-expected-width="532"> +Colspanned redistribution: distributed 468-8 = 460 over C0/C1 +Colspanned 468px needs to distribute 460px over C0/C1. +C0 percent size is 50% * 460 = 230 +C1 percent size is 30% * 460 = 138, defaults to min size of 150 +Column 1 size is 230 + 50%/80% * 80 = 280px +Column 2 size is 150 + 30%/80% * 80 = 180px +Column 3 remains 20px +Assignable table inline size +C1 dominates estimate: 180/30% + 4*8 = 632 +Compute final column widths from assignable table size: +C0 = 50% of 600 = 300 C1 = 30% of 600 = 180 , C2 gets the remaining 120</p> +<table data-expected-width="632"> <tr> - <td style="width:50%" data-expected-width="250"><div style="width:150px">50%/150px</div></td> - <td style="width:30%" data-expected-width="150"><div class="test12" style="width:150px">30%/150px</div></td> - <td style="width:20px" data-expected-width="100">x</td> + <td style="width:50%" data-expected-width="300"><div style="width:150px">50%/150px</div></td> + <td style="width:30%" data-expected-width="180"><div style="width:150px">30%/150px</div></td> + <td style="width:20px" data-expected-width="120">x</td> </tr> <tr> - <td colspan=2 style=""><div style="width:400px">400px min</div></td> + <td colspan=2 style=""><div style="width:468px">408px min</div></td> </tr> </table> + <p 13 class="testdesc"> Colspan>1:Auto/400px C0:50%/75px/125px, C1:30%/75px/125px C2:20px/Auto Colspan>1 cell distribution over different percentages. 400-8px min width gets redistributed as 245/147 (no min width limits)
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/3d-rendering-context-and-abspos.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/3d-rendering-context-and-abspos.html deleted file mode 100644 index c5eef46..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/3d-rendering-context-and-abspos.html +++ /dev/null
@@ -1,54 +0,0 @@ -<!DOCTYPE HTML> -<title>CSS Test (Transforms): 3D Rendering Context following DOM Tree (absolute positioning)</title> -<link rel="author" title="L. David Baron" href="https://dbaron.org/"> -<link rel="author" title="Google" href="http://www.google.com/"> -<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#3d-rendering-contexts"> -<meta name="assert" content="Absolutely positioned elements participate in 3D Rendering Contexts based on their parent, not their containing block."> -<link rel="match" href="reference/green.html"> - -<style> - -div { - width: 100px; - height: 100px; -} - -.cb { - transform-style: preserve-3d; - background: red; - position: relative; -} - -.parent { -} - -.abspos { - position: absolute; - top: 0; - left: 0; - /* Since this element is not in the 3D Rendering Context, this translation - does not put it above the <div class="sibling">. */ - transform: translateZ(20px); - background: red; -} - -.sibling { - position: absolute; - top: 0; - left: 0; - transform: translateZ(10px); - background: green; -} - -</style> - -<p>Pass if there is NO red below:</p> - -<div class="cb"> - <div class="parent"> - <div class="abspos"> - </div> - </div> - <div class="sibling"> - </div> -</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/3d-rendering-context-and-fixpos.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/3d-rendering-context-and-fixpos.html deleted file mode 100644 index e763e8b..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/3d-rendering-context-and-fixpos.html +++ /dev/null
@@ -1,55 +0,0 @@ -<!DOCTYPE HTML> -<title>CSS Test (Transforms): 3D Rendering Context following DOM Tree (fixed positioning)</title> -<link rel="author" title="L. David Baron" href="https://dbaron.org/"> -<link rel="author" title="Google" href="http://www.google.com/"> -<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#3d-rendering-contexts"> -<meta name="assert" content="Fixed positioned elements participate in 3D Rendering Contexts based on their parent, not their containing block."> -<link rel="match" href="reference/green.html"> - -<style> - -div { - width: 100px; - height: 100px; -} - -.cb { - transform-style: preserve-3d; - transform: translateX(0); - background: red; - position: relative; -} - -.parent { -} - -.abspos { - position: fixed; - top: 0; - left: 0; - /* Since this element is not in the 3D Rendering Context, this translation - does not put it above the <div class="sibling">. */ - transform: translateZ(20px); - background: red; -} - -.sibling { - position: absolute; - top: 0; - left: 0; - transform: translateZ(10px); - background: green; -} - -</style> - -<p>Pass if there is NO red below:</p> - -<div class="cb"> - <div class="parent"> - <div class="abspos"> - </div> - </div> - <div class="sibling"> - </div> -</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/green-square-100-by-100-offset-ref.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/green-square-100-by-100-offset-ref.html new file mode 100644 index 0000000..fee7030 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/green-square-100-by-100-offset-ref.html
@@ -0,0 +1,12 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change reference</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px; margin: 100px 0 0 100px; background: green } +</style> +<body> + <div></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/green-square-100-by-100-ref.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/green-square-100-by-100-ref.html new file mode 100644 index 0000000..c49bf5a2 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/green-square-100-by-100-ref.html
@@ -0,0 +1,12 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change reference</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px; background: green } +</style> +<body> + <div></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-contain-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-contain-1.html new file mode 100644 index 0000000..3bb3afe --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-contain-1.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: contain' creates a containing block for fixed positioned elements</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="https://drafts.csswg.org/css-containment/#containment-paint"> +<link rel="match" href="green-square-100-by-100-offset-ref.html"> +<meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: contain; margin: 100px 0 0 100px; background: red } +.child { top: 0; left: 0; width: 50px; background: green } +#fixpos { position: fixed } +#abspos { position: absolute; left: 50px } +</style> +<body> + <div id="wc"> + <div class="child" id="fixpos"> + </div> + <div class="child" id="abspos"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-filter-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-filter-1.html new file mode 100644 index 0000000..afb03e8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-filter-1.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: filter' creates a containing block for fixed positioned elements</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/filter-effects/#FilterProperty"> +<link rel="match" href="green-square-100-by-100-offset-ref.html"> +<meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: filter; margin: 100px 0 0 100px; background: red } +.child { top: 0; left: 0; width: 50px; background: green } +#fixpos { position: fixed } +#abspos { position: absolute; left: 50px } +</style> +<body> + <div id="wc"> + <div class="child" id="fixpos"> + </div> + <div class="child" id="abspos"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-height-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-height-1.html new file mode 100644 index 0000000..892e6d4 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-height-1.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: height' does not create a containing block for fixed positioned elements</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="match" href="green-square-100-by-100-offset-ref.html"> +<meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: height; margin: 100px 0 0 100px; background: red } +.child { top: 100px; left: 100px; width: 50px; background: green } +#fixpos { position: fixed } +#abspos { position: absolute; left: 150px } +</style> +<body> + <div id="wc"> + <div class="child" id="fixpos"> + </div> + <div class="child" id="abspos"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-offset-path-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-offset-path-1.html new file mode 100644 index 0000000..0fe1ec1 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-offset-path-1.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: offset-path' creates a containing block for fixed positioned elements</title> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="https://drafts.fxtf.org/motion-1/#offset-path-property"> +<link rel="match" href="green-square-100-by-100-offset-ref.html"> +<meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: offset-path; margin: 100px 0 0 100px; background: red } +.child { top: 0; left: 0; width: 50px; background: green } +#fixpos { position: fixed } +#abspos { position: absolute; left: 50px } +</style> +<body> + <div id="wc"> + <div class="child" id="fixpos"> + </div> + <div class="child" id="abspos"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-perspective-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-perspective-1.html new file mode 100644 index 0000000..4a394f9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-perspective-1.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: perspective' creates a containing block for fixed positioned elements</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/css3-transforms/#perspective-property"> +<link rel="match" href="green-square-100-by-100-offset-ref.html"> +<meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: perspective; margin: 100px 0 0 100px; background: red } +.child { top: 0; left: 0; width: 50px; background: green } +#fixpos { position: fixed } +#abspos { position: absolute; left: 50px } +</style> +<body> + <div id="wc"> + <div class="child" id="fixpos"> + </div> + <div class="child" id="abspos"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-position-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-position-1.html new file mode 100644 index 0000000..7e52ab4b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-position-1.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: position' does not create a containing block for fixed positioned elements but does create a containing block for absolutely positioned elements</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="match" href="green-square-100-by-100-offset-ref.html"> +<meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: position; margin: 100px 0 0 100px; background: red } +.child { width: 50px; background: green } +#fixpos { position: fixed; top: 100px; left: 100px } +#abspos { position: absolute; top: 0; left: 50px } +</style> +<body> + <div id="wc"> + <div class="child" id="fixpos"> + </div> + <div class="child" id="abspos"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-transform-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-transform-1.html new file mode 100644 index 0000000..92632cd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-transform-1.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: transform' creates a containing block for fixed positioned elements</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/css3-transforms/#transform-property"> +<link rel="match" href="green-square-100-by-100-offset-ref.html"> +<meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: transform; margin: 100px 0 0 100px; background: red } +.child { top: 0; left: 0; width: 50px; background: green } +#fixpos { position: fixed } +#abspos { position: absolute; left: 50px } +</style> +<body> + <div id="wc"> + <div class="child" id="fixpos"> + </div> + <div class="child" id="abspos"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-transform-style-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-transform-style-1.html new file mode 100644 index 0000000..808f7d8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-transform-style-1.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: transform-style' creates a containing block for fixed positioned elements</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/css3-transforms/#transform-style-property"> +<link rel="match" href="green-square-100-by-100-offset-ref.html"> +<meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: transform-style; margin: 100px 0 0 100px; background: red } +.child { top: 0; left: 0; width: 50px; background: green } +#fixpos { position: fixed } +#abspos { position: absolute; left: 50px } +</style> +<body> + <div id="wc"> + <div class="child" id="fixpos"> + </div> + <div class="child" id="abspos"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-translate-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-translate-1.html new file mode 100644 index 0000000..7ff0dfe --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-fixpos-cb-translate-1.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: translate' creates a containing block for fixed positioned elements</title> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-translate"> +<link rel="match" href="green-square-100-by-100-offset-ref.html"> +<meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: translate; margin: 100px 0 0 100px; background: red } +.child { top: 0; left: 0; width: 50px; background: green } +#fixpos { position: fixed } +#abspos { position: absolute; left: 50px } +</style> +<body> + <div id="wc"> + <div class="child" id="fixpos"> + </div> + <div class="child" id="abspos"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-001-ref.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-001-ref.html deleted file mode 100644 index 38138eb..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-001-ref.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<style> - div { - background: green; - width: 100px; - height: 100px; - } -</style> -<div></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-001.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-001.html deleted file mode 100644 index 9720953..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-001.html +++ /dev/null
@@ -1,36 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>CSS Test: will-change: filter should create a stacking context.</title> -<link rel="author" title="Philip Rogers" href="mailto:pdr@chromium.org"> -<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=960953"> -<link rel="help" href="https://drafts.csswg.org/css-will-change/#will-change"> -<link rel="help" href="https://drafts.fxtf.org/filter-effects/#FilterProperty"> -<link rel="match" href="will-change-stacking-context-001-ref.html"> -<style> - .indicator { - position: absolute; - background-color: green; - z-index: 1; - } - .willchange { - will-change: filter; - z-index: 0; - } - .child { - position: relative; - background-color: red; - z-index: 2; - } - .box { - width: 100px; - height: 100px; - } -</style> - -<div class="indicator box"></div> -<div class="willchange box"> - <!-- Because will-change: filter creates a stacking context, this child - remains on bottom even though it has a higher z-index than the indicator - box. --> - <div class="child box"></div> -</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-002-ref.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-002-ref.html deleted file mode 100644 index 38138eb..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-002-ref.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<style> - div { - background: green; - width: 100px; - height: 100px; - } -</style> -<div></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-003-ref.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-003-ref.html deleted file mode 100644 index 38138eb..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-003-ref.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<style> - div { - background: green; - width: 100px; - height: 100px; - } -</style> -<div></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-002.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-backdrop-filter-1.html similarity index 91% rename from third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-002.html rename to third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-backdrop-filter-1.html index 1cda23b..0081e93c 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-002.html +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-backdrop-filter-1.html
@@ -5,8 +5,9 @@ <link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=960953"> <link rel="help" href="https://drafts.csswg.org/css-will-change/#will-change"> <link rel="help" href="https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty"> -<link rel="match" href="will-change-stacking-context-002-ref.html"> +<link rel="match" href="green-square-100-by-100-ref.html"> <style> + html, body { margin: 0; } .indicator { position: absolute; background-color: green;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-clip-path-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-clip-path-1.html new file mode 100644 index 0000000..673d1a89 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-clip-path-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: clip-path' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/css-masking/#the-clip-path"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: clip-path; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-filter-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-filter-1.html new file mode 100644 index 0000000..0f87768d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-filter-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: filter' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/filter-effects/#FilterProperty"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: filter; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-height-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-height-1.html new file mode 100644 index 0000000..3ce0e61 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-height-1.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: height' does not create a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: height; background: green } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: red } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-isolation-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-isolation-1.html new file mode 100644 index 0000000..9eaf812 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-isolation-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: isolation' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/compositing-1/#isolation"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: isolation; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-mask-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-mask-1.html new file mode 100644 index 0000000..77ec10c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-mask-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: mask' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/css-masking/#the-mask-image"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: mask; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-mix-blend-mode-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-mix-blend-mode-1.html new file mode 100644 index 0000000..ae13ac6b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-mix-blend-mode-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: mix-blend-mode' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/compositing-1/#mix-blend-mode"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: mix-blend-mode; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-offset-path-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-offset-path-1.html new file mode 100644 index 0000000..07277b66 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-offset-path-1.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: offset-path' creates a stacking context</title> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="https://drafts.fxtf.org/motion-1/#offset-path-property"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: offset-path; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-opacity-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-opacity-1.html new file mode 100644 index 0000000..2bff667 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-opacity-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: opacity' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="https://drafts.csswg.org/css-color-3/#transparency"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: opacity; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-003.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-opacity-2.html similarity index 91% rename from third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-003.html rename to third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-opacity-2.html index b764d2e..dfedbd23 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-003.html +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-opacity-2.html
@@ -4,8 +4,9 @@ <link rel="author" title="Philip Rogers" href="mailto:pdr@chromium.org"> <link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1119651"> <link rel="help" href="https://drafts.csswg.org/css-will-change/#will-change"> -<link rel="match" href="will-change-stacking-context-003-ref.html"> +<link rel="match" href="green-square-100-by-100-ref.html"> <style> + html, body { margin: 0; } .indicator { position: absolute; width: 100px;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-perspective-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-perspective-1.html new file mode 100644 index 0000000..3a686322 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-perspective-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: perspective' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/css3-transforms/#perspective-property"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: perspective; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-position-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-position-1.html new file mode 100644 index 0000000..a244b7c2 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-position-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: position' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/css3-positioning/#sticky-pos"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: position; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-transform-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-transform-1.html new file mode 100644 index 0000000..1b55d1f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-transform-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: transform' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/css3-transforms/#transform-property"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: transform; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-transform-style-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-transform-style-1.html new file mode 100644 index 0000000..f8e50c6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-transform-style-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: transform-style' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/css3-transforms/#transform-style-property"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: transform-style; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-translate-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-translate-1.html new file mode 100644 index 0000000..1e1e8355 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-translate-1.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: translate' creates a stacking context</title> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-translate"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: translate; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-z-index-1.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-z-index-1.html new file mode 100644 index 0000000..bcb9ea0 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-stacking-context-z-index-1.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: z-index' creates a stacking context</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="http://www.w3.org/TR/css3-positioning/#layered-presentation"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: z-index; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-transform-huge-offset-scrolled-ref.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-transform-huge-offset-scrolled-ref.html new file mode 100644 index 0000000..c2af258 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-transform-huge-offset-scrolled-ref.html
@@ -0,0 +1,3 @@ +<!DOCTYPE html> +<div style="width: 20px; height: 20px; margin-top: 10000px; background: green"></div> +<script>window.scrollTo(0, 10000);</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-transform-huge-offset-scrolled.html b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-transform-huge-offset-scrolled.html new file mode 100644 index 0000000..506ac67 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-will-change/will-change-transform-huge-offset-scrolled.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<link rel="help" href="https://drafts.csswg.org/css-will-change/#will-change"> +<link rel="match" href="will-change-transform-huge-offset-scrolled-ref.html"> +<div style="width: 20px; height: 20px; margin-top: 10000px; background: green; will-change: transform"></div> +<script> +// Incrementally scroll to the bottom. +var lastScrollY = 0; +function scroll() { + window.scrollBy(0, 200); + if (window.scrollY > lastScrollY) { + lastScrollY = window.scrollY; + requestAnimationFrame(scroll); + } else { + document.documentElement.classList.remove('reftest-wait'); + } +} +requestAnimationFrame(scroll); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/filter-cb-dynamic-1-ref.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/filter-cb-dynamic-1-ref.html new file mode 100644 index 0000000..7b746b8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/filter-cb-dynamic-1-ref.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS filters: Creating containing block for fixed positioned elements</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<style> + html, body { margin: 0; padding: 0 } + #fixedmoves { + position: absolute; + top: 150px; + left: 150px; + background: green; + height: 100px; + width: 100px; + } +</style> +<body> + <div id="fixedmoves"></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/filter-cb-dynamic-1a.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/filter-cb-dynamic-1a.html new file mode 100644 index 0000000..cc8c747 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/filter-cb-dynamic-1a.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS filters: Creating containing block for fixed positioned elements</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.fxtf.org/filters-1/#FilterProperty"> +<link rel="help" href="http://www.w3.org/2015/02/10-fx-minutes.html#action02"> +<link rel="match" href="filter-cb-dynamic-1-ref.html"> +<meta name="flags" content="dom"> +<style> + html, body { margin: 0; padding: 0 } + #changefilter { + position: absolute; + top: 100px; + left: 100px; + } + + #abscovered { + position: absolute; + top: 50px; + left: 50px; + background: red; + height: 100px; + width: 100px; + } + + #fixedmoves { + position: fixed; + top: 150px; + left: 150px; + background: green; + height: 100px; + width: 100px; + } +</style> +<body> + <div id="changefilter" style="filter: blur(4px)"> + <div id="abscovered"></div> + <div id="fixedmoves"></div> + </div> + <script> + var changefilter = document.getElementById("changefilter"); + var fixedmoves = document.getElementById("fixedmoves"); + var causeFlush = fixedmoves.offsetTop; + changefilter.style.filter = ""; + </script> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/filter-cb-dynamic-1b.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/filter-cb-dynamic-1b.html new file mode 100644 index 0000000..15e30ee --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/filter-cb-dynamic-1b.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS filters: Creating containing block for fixed positioned elements</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.fxtf.org/filters-1/#FilterProperty"> +<link rel="help" href="http://www.w3.org/2015/02/10-fx-minutes.html#action02"> +<link rel="match" href="filter-cb-dynamic-1-ref.html"> +<meta name="flags" content="dom"> +<style> + html, body { margin: 0; padding: 0 } + #changefilter { + position: absolute; + top: 100px; + left: 100px; + } + + #abscovered { + position: absolute; + top: 50px; + left: 50px; + background: red; + height: 100px; + width: 100px; + } + + #fixedmoves { + position: fixed; + top: 50px; + left: 50px; + background: green; + height: 100px; + width: 100px; + } +</style> +<body> + <div id="changefilter"> + <div id="abscovered"></div> + <div id="fixedmoves"></div> + </div> + <script> + var changefilter = document.getElementById("changefilter"); + var fixedmoves = document.getElementById("fixedmoves"); + var causeFlush = fixedmoves.offsetTop; + changefilter.style.filter = "blur(0px)"; + </script> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/mediaqueries/test_media_queries.html b/third_party/blink/web_tests/external/wpt/css/mediaqueries/test_media_queries.html index b063d2b6..1630e54 100644 --- a/third_party/blink/web_tests/external/wpt/css/mediaqueries/test_media_queries.html +++ b/third_party/blink/web_tests/external/wpt/css/mediaqueries/test_media_queries.html
@@ -33,13 +33,13 @@ function should_apply(q) { test(function() { assert_true(query_applies(q)); - }, "subtest_" + ++testNum); + }, "subtest_" + ++testNum + ": " + q + " should apply"); } function should_not_apply(q) { test(function() { assert_false(query_applies(q)); - }, "subtest_" + ++testNum); + }, "subtest_" + ++testNum + ": " + q + " should not apply"); } /* @@ -142,6 +142,11 @@ expression_should_not_be_parseable("min-" + feature + " " + separator + " -0"); expression_should_not_be_parseable("max-" + feature + " " + separator + " -0"); } + if (separator == ">=") { + expression_should_not_be_parseable(feature + " " + "> =" + " 0px"); + } else if (separator == "<=") { + expression_should_not_be_parseable(feature + " " + "< =" + " 0px"); + } expression_should_not_be_parseable(feature + " " + separator + " -1px"); expression_should_not_be_parseable("min-" + feature + " " + separator + " -1px"); expression_should_not_be_parseable("max-" + feature + " " + separator + " -1px");
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-1-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-1-ref.html deleted file mode 100644 index a66a85e..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-1-ref.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<body style="direction: ltr"> - <span style="display: block">x</span> - <span style="border: 5px solid blue; border-left: none; border-right: none; - padding-right: 10px"></span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-1.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-1.html deleted file mode 100644 index dcf9367..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-1.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="emptyspan-1-ref.html"> -<body style="direction: ltr"> - <span style="border: 5px solid blue; border-left: none; border-right: none; - padding-right: 10px"> - <span style="display: block">x</span> - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-2-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-2-ref.html deleted file mode 100644 index 941044b..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-2-ref.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<body style="direction: rtl"> - <span style="border: 5px solid blue; border-left: none; border-right: none; - padding-right: 10px"></span> - <span style="display: block">x</span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-2.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-2.html deleted file mode 100644 index b740fad..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-2.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="emptyspan-2-ref.html"> -<body style="direction: rtl"> - <span style="border: 5px solid blue; border-left: none; border-right: none; - padding-right: 10px"> - <span style="display: block">x</span> - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-3-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-3-ref.html deleted file mode 100644 index 629c342..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-3-ref.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<body style="direction: ltr"> - <span style="border: 5px solid blue; border-left: none; border-right: none; - padding-left: 10px"></span> - <span style="display: block">x</span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-3.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-3.html deleted file mode 100644 index 1be809e..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-3.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="emptyspan-3-ref.html"> -<body style="direction: ltr"> - <span style="border: 5px solid blue; border-left: none; border-right: none; - padding-left: 10px"> - <span style="display: block">x</span> - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-4-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-4-ref.html deleted file mode 100644 index af74e690..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-4-ref.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<body style="direction: rtl"> - <span style="display: block">x</span> - <span style="border: 5px solid blue; border-left: none; border-right: none; - padding-left: 10px"></span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-4.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-4.html deleted file mode 100644 index 3656ada..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/emptyspan-4.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="emptyspan-4-ref.html"> -<body style="direction: rtl"> - <span style="border: 5px solid blue; border-left: none; border-right: none; - padding-left: 10px"> - <span style="display: block">x</span> - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/float-inside-inline-between-blocks-1-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/float-inside-inline-between-blocks-1-ref.html deleted file mode 100644 index d9146e2..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/float-inside-inline-between-blocks-1-ref.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<div style="position: relative; left: 100px"> - aaa -</div> -<span style="position: relative; left: 100px"> - <span style="float: left">bbb</span> -</span> -<div style="position: relative; left: 100px"> - aaa -</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/float-inside-inline-between-blocks-1.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/float-inside-inline-between-blocks-1.html deleted file mode 100644 index 296dcb9..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/float-inside-inline-between-blocks-1.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="float-inside-inline-between-blocks-1-ref.html"> -<span style="position: relative; left: 100px"> - <span style="display: block"> - aaa - </span> - <span style="float: left">bbb</span> - <span style="display: block"> - aaa - </span> -</span>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/percent-height-1-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/percent-height-1-ref.html deleted file mode 100644 index 0f74e18a..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/percent-height-1-ref.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<div style="height: 100px; border: 10px solid black"></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/percent-height-1.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/percent-height-1.html deleted file mode 100644 index 91c1594b..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/percent-height-1.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="percent-height-1-ref.html"> -<body style="height: 200px"> - <span> - <span style="display: block; height: 50%; border: 10px solid black"> - </span> - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1-noib-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1-noib-ref.html deleted file mode 100644 index 7b8a141..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1-noib-ref.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style> - body > span { border: 3px solid blue } - #start { border-right: none; } - #two { border-left: none; } -</style> -<body> - <span id="start"></span> - <div>One</div> - <span id="two"> - Two - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1-ref.html deleted file mode 100644 index f197d6a..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1-ref.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-from-split-inline-1-noib-ref.html"> -<style> - body > span { border: 3px solid blue } -</style> -<body> - <span - ><div>One</div> - Two - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1.html deleted file mode 100644 index 07053ef..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-1.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-from-split-inline-1-ref.html"> -<script> -function doit() { - var target = document.getElementById("target"); - target.remove(); -} -</script> -<style> - body > span { border: 3px solid blue } -</style> -<body onload='doit()'> - <span - ><span id="target">Four</span - ><div>One</div> - Two - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-2-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-2-ref.html deleted file mode 100644 index 9fd41e1..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-2-ref.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style> - body > span { border: 3px solid blue } -</style> -<body> - <span> - One - Two - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-2.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-2.html deleted file mode 100644 index d4cf510..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-2.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-from-split-inline-2-ref.html"> -<script> -function doit() { - var target = document.getElementById("target"); - target.remove(); -} -</script> -<style> - body > span { border: 3px solid blue } -</style> -<body onload='doit()'> - <span> - One - <div id="target">Three</div> - Two - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3-noib-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3-noib-ref.html deleted file mode 100644 index 124b8fd8..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3-noib-ref.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style> - body > span { border: 3px solid blue } - #one { border-right: none; } - #tail { border-left: none; } -</style> -<body> - <span id="one"> - One - </span> - <div>Two</div> - <span id="tail"></span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3-ref.html deleted file mode 100644 index 5822665f..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3-ref.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-from-split-inline-3-noib-ref.html"> -<style> - body > span { border: 3px solid blue } -</style> -<body> - <span> - One - <div>Two</div - ></span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3.html deleted file mode 100644 index 1d5e2a4..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-3.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-from-split-inline-3-ref.html"> -<script> -function doit() { - var target = document.getElementById("target"); - target.remove(); -} -</script> -<style> - body > span { border: 3px solid blue } -</style> -<body onload='doit()'> - <span> - One - <div>Two</div - ><span id="target">Three</span - ></span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4-noib-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4-noib-ref.html deleted file mode 100644 index 10c563c..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4-noib-ref.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style> - body > span { border: 3px solid blue } - #one { border-right: none; } - #four { border-left: none; } -</style> -<body> - <span id="one"> - One - Two - </span> - <div>Three</div> - <span id="four"> - Four - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4-ref.html deleted file mode 100644 index 8768b0d..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4-ref.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-from-split-inline-4-noib-ref.html"> -<style> - body > span { border: 3px solid blue } -</style> -<body> - <span> - One - Two - <div>Three</div> - Four - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4.html deleted file mode 100644 index 44c0ceed8..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-4.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-from-split-inline-4-ref.html"> -<script> -function doit() { - var target = document.getElementById("target"); - target.remove(); -} -</script> -<style> - body > span { border: 3px solid blue } -</style> -<body onload='doit()'> - <span> - One - <div id="target">Five</div> - Two - <div>Three</div> - Four - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5-noib-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5-noib-ref.html deleted file mode 100644 index 8bd8802f..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5-noib-ref.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style> - body > span { border: 3px solid blue } - #one { border-right: none; } - #three { border-left: none; } -</style> -<body> - <span id="one"> - One - </span> - <div>Two</div> - <span id="three"> - Three - Four - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5-ref.html deleted file mode 100644 index 68258ef..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5-ref.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-from-split-inline-5-noib-ref.html"> -<style> - body > span { border: 3px solid blue } -</style> -<body> - <span> - One - <div>Two</div> - Three - Four - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5.html deleted file mode 100644 index 539115e..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-5.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-from-split-inline-5-ref.html"> -<script> -function doit() { - var target = document.getElementById("target"); - target.remove(); -} -</script> -<style> - body > span { border: 3px solid blue } -</style> -<body onload='doit()'> - <span> - One - <div>Two</div> - Three - <div id="target">Five</div> - Four - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6-noib-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6-noib-ref.html deleted file mode 100644 index 7678e811..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6-noib-ref.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style> - body > span { border: 3px solid blue } - #one { border-right: none; } - #four { border-left: none; } -</style> -<body> - <span id="one"> - One - </span> - <div>Two</div> - <div>Three</div> - <span id="four"> - Four - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6-ref.html deleted file mode 100644 index bd43b45d..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6-ref.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-from-split-inline-6-noib-ref.html"> -<style> - body > span { border: 3px solid blue } -</style> -<body> - <span> - One - <div>Two</div> - <div>Three</div> - Four - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6.html deleted file mode 100644 index 99bbcf7..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-from-split-inline-6.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"/> -<link rel="match" href="remove-from-split-inline-6-ref.html"> -<script> -function doit() { - var target = document.getElementById("target"); - target.remove(); -} -</script> -<style> - body > span { border: 3px solid blue } -</style> -<body onload='doit()'> - <span> - One - <div>Two</div> - <span id="target">Five</span> - <div>Three</div> - Four - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-split-inline-1-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-split-inline-1-ref.html deleted file mode 100644 index cf4cfffd..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-split-inline-1-ref.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -One -Two
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-split-inline-1.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-split-inline-1.html deleted file mode 100644 index cfe6a5e8..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/remove-split-inline-1.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="remove-split-inline-1-ref.html"> -<script> -function doit() { - var target = document.getElementById("target"); - target.remove(); -} -</script> -<body onload='doit()'> - One - <span id="target"> - Three - <div>Four</div> - Five - </span> - Two -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-1-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-1-ref.html deleted file mode 100644 index 3f2a82f..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-1-ref.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<span>First line</span> -<div>Second line</div> -<span>Third line, yes</span>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-1.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-1.html deleted file mode 100644 index 3ae7392..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-1.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="split-inner-inline-1-ref.html"> -<span> - First - <span> - line - <span style="display: block"> - Second line - </span> - Third - </span> - line, yes -</span>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-2-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-2-ref.html deleted file mode 100644 index 1ace2f8..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-2-ref.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<span>First line - <span style="border: 5px solid blue; border-right: none"></span> -</span> -<div>Second line</div> -<span> - <span style="border: 5px solid blue; border-left: none"></span> - Third line, yes -</span>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-2.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-2.html deleted file mode 100644 index 318df534..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/split-inner-inline-2.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="split-inner-inline-2-ref.html"> -<span> - First line - <span style="border: 5px solid blue"> - <span style="display: block"> - Second line - </span> - </span> - Third line, yes -</span>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/table-pseudo-in-part3-1-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/table-pseudo-in-part3-1-ref.html deleted file mode 100644 index b210503..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/table-pseudo-in-part3-1-ref.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - </head> - <body> - <div> - aaa - <div>bbb</div> - </div> - </body> -</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/table-pseudo-in-part3-1.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/table-pseudo-in-part3-1.html deleted file mode 100644 index cb50af9..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/table-pseudo-in-part3-1.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="table-pseudo-in-part3-1-ref.html"> -<span style="display: table-row"> - <span> - aaa - <span style="display: block"></span> - <span style="display: table-cell">bbb</span> - </span> -</span>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1-ref.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1-ref.html deleted file mode 100644 index 46cac67..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1-ref.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS Test Reference</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<style> - body > span { border: 3px solid blue } - .notstart { border-left: none; } - .notend { border-right: none; } -</style> -<body> - <span class="notend"></span> - <div>One</div> - <span class="notstart notend"></span> - <div>Two</div> - <span class="notstart"></span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1a.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1a.html deleted file mode 100644 index 283884b..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1a.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="whitespace-present-1-ref.html"> -<style> - body > span { border: 3px solid blue } -</style> -<body> - <span> - <div>One</div> - <div>Two</div> - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1b.html b/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1b.html deleted file mode 100644 index 70239a8..0000000 --- a/third_party/blink/web_tests/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/ib-split/whitespace-present-1b.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>CSS 2.1 Test Suite: handling of blocks inside inlines</title> -<link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"> -<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/"> -<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> -<link rel="match" href="whitespace-present-1-ref.html"> -<style> - body > span { border: 3px solid blue } -</style> -<script> -function doIt() { - var t = document.createTextNode(" "); - var d = document.getElementById("d"); - d.parentNode.insertBefore(t, d); -} -</script> -<body onload="doIt()"> - <span> - <div>One</div><div id="d">Two</div> - </span> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/docs/admin/index.md b/third_party/blink/web_tests/external/wpt/docs/admin/index.md index 59569fd4..7acecdf 100644 --- a/third_party/blink/web_tests/external/wpt/docs/admin/index.md +++ b/third_party/blink/web_tests/external/wpt/docs/admin/index.md
@@ -46,7 +46,7 @@ - [Google Domains](https://domains.google/): https://wpt.fyi - smcgruer@google.com - foolip@google.com -- (Google internal): https://wpt.live https://wptpr.live +- (Google internal): https://wpt.live - smcgruer@google.com - foolip@google.com - [GitHub](https://github.com/): web-platform-tests @@ -77,9 +77,6 @@ - mike@bocoup.com - simon@bocoup.com -[web-platform-tests]: https://github.com/e3c/web-platform-tests -[wpt.fyi]: https://github.com/web-platform-tests/wpt.fyi - ## Emergency playbook ### Lock down write access to the repo
diff --git a/third_party/blink/web_tests/external/wpt/docs/index.md b/third_party/blink/web_tests/external/wpt/docs/index.md index 419c99a..b0ba0340 100644 --- a/third_party/blink/web_tests/external/wpt/docs/index.md +++ b/third_party/blink/web_tests/external/wpt/docs/index.md
@@ -19,7 +19,7 @@ - [web-platform-tests.org](https://web-platform-tests.org): the documentation website; details how to set up the project, how to write tests, how to give and receive peer review, how to serve as an administrator, and more -- [wpt.live](http://wpt.live): a public deployment of the test suite, +- [wpt.live](https://wpt.live): a public deployment of the test suite, allowing anyone to run the tests by visiting from an Internet-enabled browser of their choice - [wpt.fyi](https://wpt.fyi): an archive of test results collected from an
diff --git a/third_party/blink/web_tests/external/wpt/docs/running-tests/from-web.md b/third_party/blink/web_tests/external/wpt/docs/running-tests/from-web.md index 464febbf..157598d 100644 --- a/third_party/blink/web_tests/external/wpt/docs/running-tests/from-web.md +++ b/third_party/blink/web_tests/external/wpt/docs/running-tests/from-web.md
@@ -1,6 +1,7 @@ # Running Tests from the Web -Tests that have been merged on GitHub are mirrored at [http://w3c-test.org/][w3c-test]. +Tests that have been merged on GitHub are mirrored at +[wpt.live](https://wpt.live) and [w3c-test.org](https://w3c-test.org). [On properly-configured systems](from-local-system), local files may also be served from the URL [http://web-platform.test](http://web-platform.test). @@ -24,5 +25,3 @@ Because it runs entirely in-browser, this runner cannot deal with edge-cases like tests that cause the browser to crash or hang. - -[w3c-test]: http://w3c-test.org
diff --git a/third_party/blink/web_tests/external/wpt/fetch/api/body/formdata.any-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/api/body/formdata.any-expected.txt new file mode 100644 index 0000000..ecd514be6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/fetch/api/body/formdata.any-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +FAIL Consume empty response.formData() as FormData promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch" +FAIL Consume empty request.formData() as FormData promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/fetch/api/body/formdata.any.js b/third_party/blink/web_tests/external/wpt/fetch/api/body/formdata.any.js new file mode 100644 index 0000000..e250359 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/fetch/api/body/formdata.any.js
@@ -0,0 +1,14 @@ +promise_test(async t => { + const res = new Response(new FormData()); + const fd = await res.formData(); + assert_true(fd instanceof FormData); +}, 'Consume empty response.formData() as FormData'); + +promise_test(async t => { + const req = new Request('about:blank', { + method: 'POST', + body: new FormData() + }); + const fd = await req.formData(); + assert_true(fd instanceof FormData); +}, 'Consume empty request.formData() as FormData');
diff --git a/third_party/blink/web_tests/external/wpt/fetch/api/body/formdata.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/fetch/api/body/formdata.any.worker-expected.txt new file mode 100644 index 0000000..ecd514be6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/fetch/api/body/formdata.any.worker-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +FAIL Consume empty response.formData() as FormData promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch" +FAIL Consume empty request.formData() as FormData promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/forms/form-submission-0/request-submit-activation.html b/third_party/blink/web_tests/external/wpt/html/semantics/forms/form-submission-0/request-submit-activation.html new file mode 100644 index 0000000..0d1e54d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/forms/form-submission-0/request-submit-activation.html
@@ -0,0 +1,30 @@ +<!DOCTYPE html> +<link rel="help" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="./resources/targetted-form.js"></script> +<body> +<script> +promise_test(async () => { + let form = populateForm('<input type=submit name=n1 value=v1><button type=submit name=n2 value=v2></button>'); + let submitter = form.querySelector('button'); + let iframe = form.previousSibling; + let event; + form.requestSubmit(submitter); + await loadPromise(iframe); + assert_true(iframe.contentWindow.location.search.indexOf('n1=v1') == -1, "n1=v1"); + assert_true(iframe.contentWindow.location.search.indexOf('n2=v2') > 0), "n2=v2"; +}, 'Test activation of submitter for requestSubmit'); + +promise_test(async () => { + let form = populateForm('<input type=submit name=n1 value=v1><button type=submit name=n2 value=v2></button>'); + let submitter = form.querySelector('input'); + let iframe = form.previousSibling; + let event; + form.requestSubmit(submitter); + await loadPromise(iframe); + assert_true(iframe.contentWindow.location.search.indexOf('n1=v1') > 0, "n1=v1"); + assert_true(iframe.contentWindow.location.search.indexOf('n2=v2') == -1), "n2=v2"; +}, 'Test activation of submitter for requestSubmit 2'); +</script> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-requestsubmit.html b/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-requestsubmit.html index 65f4b21..cbc46cc7 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-requestsubmit.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-requestsubmit.html
@@ -193,4 +193,23 @@ assert_false(formDataInEvent.has('n2')); }, 'The constructed FormData object should not contain an entry for the submit button that was used to submit the form.'); +async_test(t => { + document.body.insertAdjacentHTML('afterbegin', `<form> + <button type="submit" name="n1" value="v1" disabled=""></button> + </form>`); + let form = document.querySelector('form'); + let formDataInEvent = null; + let submitter = form.querySelector('button[type=submit]'); + + form.addEventListener("submit", t.step_func_done(ev => { + ev.preventDefault(); + formDataInEvent = new FormData(ev.target); + assert_false(formDataInEvent.has('n1')); + assert_equals(ev.target, form); + })); + + form.requestSubmit(submitter); + +}, "Using requestSubmit on a disabled button (via disabled attribute) should trigger submit but not be visible in FormData"); + </script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-input-element/radio-morphed.html b/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-input-element/radio-morphed.html new file mode 100644 index 0000000..b7b8658 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-input-element/radio-morphed.html
@@ -0,0 +1,17 @@ +<!DOCTYPE html> +<title>Morphed radio input</title> +<link rel="author" title="Kagami Sascha Rosylight" href="mailto:krosylight@mozilla.com"> +<link rel="help" href="https://html.spec.whatwg.org/#radio-button-state-(type=radio)"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<input id="radio" type="radio" name="name_7" checked> +<input id="text" name="name_7" checked> +<script> + "use strict"; + + test(() => { + text.type = 'radio'; + assert_false(radio.checked); + }, "Setting type attribute must unset checkedness of other elements"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/webappapis/dynamic-markup-insertion/document-write/during-readystatechange.window.js b/third_party/blink/web_tests/external/wpt/html/webappapis/dynamic-markup-insertion/document-write/during-readystatechange.window.js new file mode 100644 index 0000000..49d5051 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/webappapis/dynamic-markup-insertion/document-write/during-readystatechange.window.js
@@ -0,0 +1,24 @@ +// This tests whether the insertion point gets reset before or after the readystatechange event. +// See https://github.com/whatwg/html/pull/6613#discussion_r620171070. +// Recall that resetting the insertion point means that document.write() performs the document open +// steps and blows away previous content in the document. + +async_test(t => { + const frame = document.body.appendChild(document.createElement("iframe")); + t.add_cleanup(() => { frame.remove(); }); + frame.src = "../opening-the-input-stream/resources/dummy.html"; + frame.onload = t.step_func_done(() => { + const states = []; + frame.contentDocument.onreadystatechange = t.step_func(() => { + if (frame.contentDocument.readyState === "interactive") { + assert_not_equals(frame.contentDocument.textContent, "", "Precondition check: dummy document is not empty"); + + frame.contentDocument.write("Some text"); + + // If the insertion point is reset before the readystatechange handler, then the + // document.write() call above will blow away the text originally in dummy.html, leaving only what we wrote. + assert_equals(frame.contentDocument.textContent, "Some text"); + } + }); + }); +}, "document.write() during readystatechange to interactive");
diff --git a/third_party/blink/web_tests/external/wpt/mathml/crashtests/math-depth-overflow.html b/third_party/blink/web_tests/external/wpt/mathml/crashtests/math-depth-overflow.html new file mode 100644 index 0000000..e096dbb --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/mathml/crashtests/math-depth-overflow.html
@@ -0,0 +1,10 @@ +<script> +document.addEventListener('DOMContentLoaded', () => { + let a = document.createElementNS('http://www.w3.org/1998/Math/MathML', 'math') + a.setAttribute('scriptlevel', '127') + let b = document.createElementNS('http://www.w3.org/1998/Math/MathML', 'mstyle') + b.setAttribute('scriptlevel', '+2147483645') + a.appendChild(b) + document.documentElement.appendChild(a) +}) +</script>
diff --git a/third_party/blink/web_tests/external/wpt/mimesniff/mime-types/resources/generated-mime-types.py b/third_party/blink/web_tests/external/wpt/mimesniff/mime-types/resources/generated-mime-types.py index 9192114..5d0e26c8 100644 --- a/third_party/blink/web_tests/external/wpt/mimesniff/mime-types/resources/generated-mime-types.py +++ b/third_party/blink/web_tests/external/wpt/mimesniff/mime-types/resources/generated-mime-types.py
@@ -1,4 +1,7 @@ import json +import os + +here = os.path.dirname(__file__) def isHTTPTokenCodePoint(cp): if cp in (0x21, 0x23, 0x24, 0x25, 0x26, 0x27, 0x2A, 0x2B, 0x2D, 0x2E, 0x5E, 0x5F, 0x60, 0x7C, 0x7E) or (cp >= 0x30 and cp <= 0x39) or (cp >= 0x41 and cp <= 0x5A) or (cp >= 0x61 and cp <= 0x7A): @@ -22,24 +25,24 @@ if cp == 0x2F: # / continue if scenario == "type": - test = unichr(cp) + "/x" + test = chr(cp) + "/x" else: - test = "x/" + unichr(cp) + test = "x/" + chr(cp) tests.append({"input": test, "output": None}) elif scenario == "name": if cp == 0x3B or cp == 0x3D: # ; = continue - tests.append({"input": "x/x;" + unichr(cp) + "=x;bonus=x", "output": "x/x;bonus=x"}) + tests.append({"input": "x/x;" + chr(cp) + "=x;bonus=x", "output": "x/x;bonus=x"}) elif scenario == "value": if cp == 0x09 or cp == 0x20 or cp == 0x22 or cp == 0x3B or cp == 0x5C: # TAB SP " ; \ continue if isHTTPQuotedStringTokenCodePoint(cp): - testOutput = "x/x;x=\"" + unichr(cp) + "\";bonus=x" + testOutput = "x/x;x=\"" + chr(cp) + "\";bonus=x" else: testOutput = "x/x;bonus=x" - tests.append({"input": "x/x;x=" + unichr(cp) + ";bonus=x", "output": testOutput}) - tests.append({"input": "x/x;x=\"" + unichr(cp) + "\";bonus=x", "output": testOutput}) + tests.append({"input": "x/x;x=" + chr(cp) + ";bonus=x", "output": testOutput}) + tests.append({"input": "x/x;x=\"" + chr(cp) + "\";bonus=x", "output": testOutput}) -handle = open("generated-mime-types.json", "w") +handle = open(os.path.join(here, "generated-mime-types.json"), "w") handle.write(json.dumps(tests, indent=2, separators=(',', ': '))) handle.write("\n")
diff --git a/third_party/blink/web_tests/external/wpt/resource-timing/resources/gzip_xml.py b/third_party/blink/web_tests/external/wpt/resource-timing/resources/gzip_xml.py index 2293605..7debc9ce 100644 --- a/third_party/blink/web_tests/external/wpt/resource-timing/resources/gzip_xml.py +++ b/third_party/blink/web_tests/external/wpt/resource-timing/resources/gzip_xml.py
@@ -1,7 +1,7 @@ import gzip as gzip_module import os -from six import BytesIO +from io import BytesIO from wptserve.utils import isomorphic_decode
diff --git a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/registration-scope-module-static-import.https-expected.txt b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/registration-scope-module-static-import.https-expected.txt index 66b5edf..f2c49780 100644 --- a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/registration-scope-module-static-import.https-expected.txt +++ b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/registration-scope-module-static-import.https-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. PASS imported-module-script.js works when used as top-level -FAIL static imports to outside path restriction should be allowed promise_test: Unhandled rejection with value: object "TypeError: Failed to register a ServiceWorker for scope ('https://web-platform.test:8444/service-workers/service-worker/resources/scope1/') with script ('https://web-platform.test:8444/service-workers/service-worker/resources/scope1/module-worker-importing-scope2.js'): ServiceWorker cannot be started" +PASS static imports to outside path restriction should be allowed FAIL static imports redirecting to outside path restriction should be allowed promise_test: Unhandled rejection with value: object "TypeError: Failed to register a ServiceWorker for scope ('https://web-platform.test:8444/service-workers/service-worker/resources/scope1/') with script ('https://web-platform.test:8444/service-workers/service-worker/resources/scope1/module-worker-importing-redirect-to-scope2.js'): ServiceWorker cannot be started" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api-crash.html b/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api-crash.html index ca444778..b02968921 100644 --- a/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api-crash.html +++ b/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api-crash.html
@@ -14,10 +14,10 @@ var slot1 = document.createElement("slot"); slot1.id = "first_slot"; shadow_root.appendChild(slot1); - slot1.assign([child1]); + slot1.assign(child1); slot1.remove(); slot1 = document.createElement("slot"); slot1.id = "second_slot"; shadow_root.appendChild(slot1); - slot1.assign([child1]); // Shouldn't crash here + slot1.assign(child1); // Shouldn't crash here </script>
diff --git a/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api-slotchange.html b/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api-slotchange.html index dd9ebbd..1aa6a78 100644 --- a/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api-slotchange.html +++ b/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api-slotchange.html
@@ -90,8 +90,8 @@ let tTree = setupShadowDOM(test_slotchange, test, data); let [s1Promise, s2Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c1]); - tTree.s2.assign([tTree.c2]); + tTree.s1.assign(tTree.c1); + tTree.s2.assign(tTree.c2); assert_equals(data.s1EventCount, 0, 'slotchange event must not be fired synchronously'); assert_equals(data.s2EventCount, 0); @@ -107,8 +107,8 @@ let tTree = setupShadowDOM(test_slotchange, test, data); let [s1Promise, s2Promise] = monitorSlots(data); - tTree.s1.assign([]);; - tTree.s2.assign([]); + tTree.s1.assign();; + tTree.s2.assign(); tTree.host.insertBefore(tTree.c4, tTree.c1); Promise.all([s1Promise, s2Promise]).then(test.step_func_done(() => { @@ -128,14 +128,14 @@ let tTree = setupShadowDOM(test_slotchange,test, data); let [s1Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c1, tTree.c2]); + tTree.s1.assign(tTree.c1, tTree.c2); s1Promise.then(test.step_func(() => { assert_equals(data.s1EventCount, 1); [s1Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c1, tTree.c2]); - tTree.s1.assign([tTree.c1, tTree.c2, tTree.c1, tTree.c2, tTree.c2]); + tTree.s1.assign(tTree.c1, tTree.c2); + tTree.s1.assign(tTree.c1, tTree.c2, tTree.c1, tTree.c2, tTree.c2); s1Promise.then(test.step_func_done(() => { assert_equals(data.s1EventCount, 1); @@ -153,8 +153,8 @@ let tTree = setupShadowDOM(test_slotchange, test, data); let [s1Promise, s2Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c1]); - tTree.s2.assign([tTree.c2]); + tTree.s1.assign(tTree.c1); + tTree.s2.assign(tTree.c2); Promise.all([s1Promise, s2Promise]).then(test.step_func_done(() => { assert_equals(data.s1EventCount, 1); @@ -167,13 +167,13 @@ let tTree = setupShadowDOM(test_slotchange, test, data); let [s1Promise, s2Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c1]); + tTree.s1.assign(tTree.c1); s1Promise.then(test.step_func(() => { assert_equals(data.s1EventCount, 1); [s1Promise, s2Promise] = monitorSlots(data); - tTree.s2.assign([tTree.c1]); + tTree.s2.assign(tTree.c1); Promise.all([s1Promise, s2Promise]).then(test.step_func_done(() => { assert_equals(data.s1EventCount, 2); @@ -187,13 +187,13 @@ let tTree = setupShadowDOM(test_slotchange, test, data); let [s1Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c1]); + tTree.s1.assign(tTree.c1); s1Promise.then(test.step_func(() => { assert_equals(data.s1EventCount, 1); [s1Promise] = monitorSlots(data); - tTree.s1.assign([]); + tTree.s1.assign(); s1Promise.then(test.step_func_done(() => { assert_equals(data.s1EventCount, 2); @@ -206,13 +206,13 @@ let tTree = setupShadowDOM(test_slotchange, test, data); let [s1Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c1, tTree.c2]); + tTree.s1.assign(tTree.c1, tTree.c2); s1Promise.then(test.step_func(() => { assert_equals(data.s1EventCount, 1); [s1Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c2, tTree.c1]); + tTree.s1.assign(tTree.c2, tTree.c1); s1Promise.then(test.step_func_done(() => { assert_equals(data.s1EventCount, 2); @@ -225,7 +225,7 @@ let tTree = setupShadowDOM(test_slotchange, test, data); let [s1Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c1]); + tTree.s1.assign(tTree.c1); return s1Promise.then(test.step_func(() => { assert_equals(data.s1EventCount, 1); @@ -245,7 +245,7 @@ let tTree = setupShadowDOM(test_slotchange, test, data); [s1Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c1]); + tTree.s1.assign(tTree.c1); return s1Promise.then(test.step_func(() => { assert_equals(data.s1EventCount, 1); @@ -341,13 +341,13 @@ let tTree = setupShadowDOM(test_nested_slotchange, test, data); let [s1Promise, s2Promise, s3Promise] = monitorSlots(data); - tTree.s3.assign([tTree.s1]); + tTree.s3.assign(tTree.s1); s3Promise.then(test.step_func(() => { assert_equals(data.s3EventCount, 1); [s1Promise, s2Promise, s3Promise] = monitorSlots(data); - tTree.s1.assign([tTree.c1]); + tTree.s1.assign(tTree.c1); Promise.all([s1Promise, s3Promise]).then(test.step_func_done(() => { assert_equals(data.s1EventCount, 1);
diff --git a/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api.html b/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api.html index 54b2263..8133d7e8 100644 --- a/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api.html +++ b/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api.html
@@ -16,7 +16,7 @@ assert_not_equals(tTree.host1.attachShadow({ mode: 'open', slotAssignment: 'manual'}), null, 'slot assignment manual should work'); assert_not_equals(tTree.host2.attachShadow({ mode: 'open', slotAssignment: 'named'}), - null, 'slot assignment auto should work'); + null, 'slot assignment named should work'); assert_throws_js(TypeError, () => { tTree.host3.attachShadow({ mode: 'open', slotAssignment: 'exceptional' })}, 'others should throw exception'); @@ -47,14 +47,25 @@ <script> test(() => { let tTree = createTestTree(test_assign); + tTree.s1.assign(c1,c2); // Should work + assert_throws_js(TypeError, () => { + tTree.s1.assign([c1,c2]) + }, 'sequence not allowed'); + assert_throws_js(TypeError, () => { + tTree.s1.assign([]) + }, 'including empty sequences'); +}, 'slot.attach() should take variadic not sequence.'); + +test(() => { + let tTree = createTestTree(test_assign); assert_array_equals(tTree.s2.assignedElements(), []); assert_equals(tTree.c1.assignedSlot, null); - tTree.s1.assign([tTree.c1]); + tTree.s1.assign(tTree.c1); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1]); assert_equals(tTree.c1.assignedSlot, tTree.s1); - tTree.s2.assign([tTree.c2, tTree.c3]); + tTree.s2.assign(tTree.c2, tTree.c3); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1]); assert_array_equals(tTree.s2.assignedNodes(), [tTree.c2, tTree.c3]); }, 'Imperative slot API can assign nodes in manual slot assignment.'); @@ -62,19 +73,19 @@ test(() => { let tTree = createTestTree(test_assign); - tTree.s1.assign([tTree.c2, tTree.c3, tTree.c1]); + tTree.s1.assign(tTree.c2, tTree.c3, tTree.c1); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c2, tTree.c3, tTree.c1]); assert_equals(tTree.c1.assignedSlot, tTree.s1); assert_equals(tTree.c2.assignedSlot, tTree.s1); assert_equals(tTree.c3.assignedSlot, tTree.s1); - tTree.s1.assign([tTree.c1, tTree.c2]); + tTree.s1.assign(tTree.c1, tTree.c2); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2]); assert_equals(tTree.c1.assignedSlot, tTree.s1); assert_equals(tTree.c2.assignedSlot, tTree.s1); assert_equals(tTree.c3.assignedSlot, null); - tTree.s1.assign([tTree.c3, tTree.c2, tTree.c1]); + tTree.s1.assign(tTree.c3, tTree.c2, tTree.c1); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c3, tTree.c2, tTree.c1]); assert_equals(tTree.c1.assignedSlot, tTree.s1); assert_equals(tTree.c2.assignedSlot, tTree.s1); @@ -84,17 +95,17 @@ test(() => { let tTree = createTestTree(test_assign); - tTree.s1.assign([tTree.c2, tTree.c3, tTree.c1]); + tTree.s1.assign(tTree.c2, tTree.c3, tTree.c1); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c2, tTree.c3, tTree.c1]); - tTree.s2.assign([tTree.c2]); + tTree.s2.assign(tTree.c2); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c3, tTree.c1]); assert_array_equals(tTree.s2.assignedNodes(), [tTree.c2]); assert_equals(tTree.c1.assignedSlot, tTree.s1); assert_equals(tTree.c2.assignedSlot, tTree.s2); assert_equals(tTree.c3.assignedSlot, tTree.s1); - tTree.s3.assign([tTree.c3]); + tTree.s3.assign(tTree.c3); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1]); assert_array_equals(tTree.s2.assignedNodes(), [tTree.c2]); assert_array_equals(tTree.s3.assignedNodes(), [tTree.c3]); @@ -106,9 +117,9 @@ test(() => { let tTree = createTestTree(test_assign); - tTree.s1.assign([tTree.c1]); - tTree.s2.assign([tTree.c2, tTree.c1]); - tTree.s3.assign([tTree.c1, tTree.c3]); + tTree.s1.assign(tTree.c1); + tTree.s2.assign(tTree.c2, tTree.c1); + tTree.s3.assign(tTree.c1, tTree.c3); assert_array_equals(tTree.s1.assignedNodes(), []); assert_array_equals(tTree.s2.assignedNodes(), [tTree.c2]); @@ -123,7 +134,7 @@ // tTree.c4 is invalid for tTree.host slot assignment. // No exception should be thrown here. - tTree.s1.assign([tTree.c1, tTree.c4, tTree.c2]); + tTree.s1.assign(tTree.c1, tTree.c4, tTree.c2); // All observable assignments should skip c4. assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2]); @@ -151,7 +162,7 @@ test(() => { let tTree = createTestTree(test_assign); - tTree.s1.assign([tTree.c1, tTree.c2, tTree.c3]); + tTree.s1.assign(tTree.c1, tTree.c2, tTree.c3); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2, tTree.c3]); tTree.host4.append(tTree.s1); @@ -161,7 +172,7 @@ test(() => { let tTree = createTestTree(test_assign); - tTree.s1.assign([tTree.c1, tTree.c2, tTree.c3]); + tTree.s1.assign(tTree.c1, tTree.c2, tTree.c3); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2, tTree.c3]); tTree.shadow_root.insertBefore(tTree.s2, tTree.s1); @@ -179,14 +190,14 @@ test(() => { let tTree = createTestTree(test_assign); - tTree.s1.assign([tTree.c1, tTree.c2, tTree.c3]); + tTree.s1.assign(tTree.c1, tTree.c2, tTree.c3); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2, tTree.c3]); tTree.host4.append(tTree.c1); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c2, tTree.c3]); assert_array_equals(tTree.s4.assignedNodes(), []); - tTree.s4.assign([tTree.c1]); + tTree.s4.assign(tTree.c1); assert_array_equals(tTree.s4.assignedNodes(), [tTree.c1]); assert_equals(tTree.c1.assignedSlot, tTree.s4); }, 'Appending slottable to different host, it loses slot assignment. It can be re-assigned within a new host.'); @@ -194,7 +205,7 @@ test(() => { let tTree = createTestTree(test_assign); - tTree.s1.assign([tTree.c1]); + tTree.s1.assign(tTree.c1); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1]); tTree.shadow_root4.insertBefore(tTree.s1, tTree.s4); @@ -209,17 +220,17 @@ test(() => { let tTree = createTestTree(test_assign); - tTree.s1.assign([tTree.c1, tTree.c1, tTree.c1]); + tTree.s1.assign(tTree.c1, tTree.c1, tTree.c1); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1]); - tTree.s1.assign([tTree.c1, tTree.c1, tTree.c2, tTree.c2, tTree.c1]); + tTree.s1.assign(tTree.c1, tTree.c1, tTree.c2, tTree.c2, tTree.c1); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2]); }, 'Assignment with the same node in parameters should be ignored, first one wins.'); test(() => { let tTree = createTestTree(test_assign); - tTree.s1.assign([tTree.c1, tTree.c2, tTree.c3]); + tTree.s1.assign(tTree.c1, tTree.c2, tTree.c3); tTree.s1.remove(); assert_equals(tTree.c1.assignedSlot, null); @@ -235,7 +246,7 @@ const isolatedDocNode2 = document.implementation.createHTMLDocument("").body; isolatedDocNode2.appendChild(tTree.s1); - tTree.s1.assign([tTree.c1, tTree.c2]); + tTree.s1.assign(tTree.c1, tTree.c2); assert_array_equals(tTree.s1.assignedNodes(), [], 's1 not inside shadow root'); assert_equals(tTree.c1.assignedSlot, null); assert_equals(tTree.c2.assignedSlot, null); @@ -250,7 +261,7 @@ test(() => { let tTree = createTestTree(test_assign); - tTree.s1.assign([tTree.c1, tTree.c2]); + tTree.s1.assign(tTree.c1, tTree.c2); assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2]); assert_equals(tTree.c1.assignedSlot, tTree.s1); assert_equals(tTree.c2.assignedSlot, tTree.s1);
diff --git a/third_party/blink/web_tests/external/wpt/update-built-tests.sh b/third_party/blink/web_tests/external/wpt/update-built-tests.sh index 3bc5e36..6986440c 100755 --- a/third_party/blink/web_tests/external/wpt/update-built-tests.sh +++ b/third_party/blink/web_tests/external/wpt/update-built-tests.sh
@@ -4,6 +4,6 @@ html/canvas/tools/build.sh infrastructure/assumptions/tools/build.sh html/tools/build.sh -python mimesniff/mime-types/resources/generated-mime-types.py +python3 mimesniff/mime-types/resources/generated-mime-types.py python3 css/css-ui/tools/appearance-build-webkit-reftests.py python3 WebIDL/tools/generate-setlike.py
diff --git a/third_party/blink/web_tests/external/wpt/webcodecs/image-decoder.any.js b/third_party/blink/web_tests/external/wpt/webcodecs/image-decoder.any.js index 2bbc623..1912e63 100644 --- a/third_party/blink/web_tests/external/wpt/webcodecs/image-decoder.any.js +++ b/third_party/blink/web_tests/external/wpt/webcodecs/image-decoder.any.js
@@ -189,11 +189,11 @@ }) .then(buffer => { let decoder = new ImageDecoder({data: buffer, type: 'image/png'}); - return promise_rejects_dom( - t, 'IndexSizeError', decoder.decode({frameIndex: 1})); + return promise_rejects_js( + t, RangeError, decoder.decode({frameIndex: 1})); }); }); -}, 'Test out of range index returns IndexSizeError'); +}, 'Test out of range index returns RangeError'); promise_test(t => { var decoder; @@ -214,11 +214,11 @@ // Queue two decodes to ensure index verification and decoding are // properly ordered. p1 = decoder.decode({frameIndex: 0}); - return promise_rejects_dom( - t, 'IndexSizeError', decoder.decode({frameIndex: 1})); + return promise_rejects_js( + t, RangeError, decoder.decode({frameIndex: 1})); }) .then(_ => { - return promise_rejects_dom(t, 'IndexSizeError', p1); + return promise_rejects_js(t, RangeError, p1); }) }); }, 'Test partial decoding without a frame results in an error');
diff --git a/third_party/blink/web_tests/external/wpt/webdriver/tests/execute_async_script/execute_async.py b/third_party/blink/web_tests/external/wpt/webdriver/tests/execute_async_script/execute_async.py index e584020a..5746ed6 100644 --- a/third_party/blink/web_tests/external/wpt/webdriver/tests/execute_async_script/execute_async.py +++ b/third_party/blink/web_tests/external/wpt/webdriver/tests/execute_async_script/execute_async.py
@@ -44,25 +44,6 @@ @pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"]) -def test_no_abort_by_user_prompt_in_other_tab(session, dialog_type): - original_handle = session.window_handle - new_handle = session.new_window() - - session.execute_script("setTimeout(() => {}('foo'), 250);".format(dialog_type)) - - session.window_handle = new_handle - response = execute_async_script( - session, - "setTimeout(() => arguments[0](42), 1000);") - assert_success(response, 42) - - session.window.close() - - session.window_handle = original_handle - session.alert.accept() - - -@pytest.mark.parametrize("dialog_type", ["alert", "confirm", "prompt"]) def test_abort_by_user_prompt_twice(session, dialog_type): response = execute_async_script( session,
diff --git a/third_party/blink/web_tests/external/wpt/xhr/resources/gzip.py b/third_party/blink/web_tests/external/wpt/xhr/resources/gzip.py index 17f142c4..fd1ca92 100644 --- a/third_party/blink/web_tests/external/wpt/xhr/resources/gzip.py +++ b/third_party/blink/web_tests/external/wpt/xhr/resources/gzip.py
@@ -1,6 +1,6 @@ import gzip as gzip_module -from six import BytesIO +from io import BytesIO def main(request, response): if b"content" in request.GET:
diff --git a/third_party/blink/web_tests/fast/replaced/table-percent-width-expected.txt b/third_party/blink/web_tests/fast/replaced/table-percent-width-expected.txt index 6f74758..9784532 100644 --- a/third_party/blink/web_tests/fast/replaced/table-percent-width-expected.txt +++ b/third_party/blink/web_tests/fast/replaced/table-percent-width-expected.txt
@@ -16,7 +16,7 @@ PASS getWidth('img-4') is '102px' PASS getHeight('img-4') is '102px' PASS getWidth('img-5') is '40px' -PASS getHeight('img-5') is '102px' +PASS getHeight('img-5') is '42px' PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/fast/replaced/table-percent-width.html b/third_party/blink/web_tests/fast/replaced/table-percent-width.html index 092a1eb..8ea77b33 100644 --- a/third_party/blink/web_tests/fast/replaced/table-percent-width.html +++ b/third_party/blink/web_tests/fast/replaced/table-percent-width.html
@@ -54,7 +54,7 @@ shouldBe("getWidth('img-4')", "'102px'"); shouldBe("getHeight('img-4')", "'102px'"); shouldBe("getWidth('img-5')", "'40px'"); - shouldBe("getHeight('img-5')", "'102px'"); + shouldBe("getHeight('img-5')", "'42px'"); isSuccessfullyParsed();
diff --git a/third_party/blink/web_tests/fast/scrolling/events/scrollend-event-fired-to-document.html b/third_party/blink/web_tests/fast/scrolling/events/scrollend-event-fired-to-document.html index cbcedc32..b398357 100644 --- a/third_party/blink/web_tests/fast/scrolling/events/scrollend-event-fired-to-document.html +++ b/third_party/blink/web_tests/fast/scrolling/events/scrollend-event-fired-to-document.html
@@ -32,64 +32,54 @@ var x = rect.left + rect.width / 2; var y = rect.top + rect.height / 2; -var horizontal_scrollend_arrived = false; -var vertical_scrollend_arrived = false; -function onHorizontalScrollEnd(event) { - assert_false(event.cancelable); - // scrollend events are bubbled when the target node is document. - assert_true(event.bubbles); - horizontal_scrollend_arrived = true; -} -function onVerticalScrollEnd(event) { - assert_false(event.cancelable); - // scrollend events are bubbled when the target node is document. - assert_true(event.bubbles); - vertical_scrollend_arrived = true; -} -document.addEventListener("scrollend", onHorizontalScrollEnd); -document.addEventListener("scrollend", onVerticalScrollEnd); - -async function test_scrollend_event_fire(source_device, - precise_scrolling_delta) { - horizontal_scrollend_arrived = false; - vertical_scrollend_arrived = false; +async function test_scrollend_event_fire(t, source_device, + precise_scrolling_delta) { await waitForCompositorCommit(); + // Make sure that no scrollend event is sent to target_div. + const listener = target_div.addEventListener("scrollend", + t.unreached_func("target_div got unexpected scrollend event.")); + t.add_cleanup(() => target_div.removeEventListener('scrollend', listener)); + // Scroll left on target div and wait for the doc to get scrollend event. + let scrollendPromise = waitForScrollendEvent(document); await scrollLeft(source_device, precise_scrolling_delta); - await waitFor(() => { return horizontal_scrollend_arrived; }, - 'Document did not receive scrollend event after scroll left on target.'); + await scrollendPromise.then((event) => { + assert_false(event.cancelable); + // scrollend events are bubbled when the target node is document. + assert_true(event.bubbles); + }); assert_equals(target_div.scrollLeft, 0); // Scroll up on target div and wait for the doc to get scrollend event. + scrollendPromise = waitForScrollendEvent(document); await scrollUp(source_device, precise_scrolling_delta); - await waitFor(() => { return vertical_scrollend_arrived; }, - 'Document did not receive scrollend event after scroll up on target.'); + await scrollendPromise.then((event) => { + assert_false(event.cancelable); + // scrollend events are bubbled when the target node is document. + assert_true(event.bubbles); + }); assert_equals(target_div.scrollTop, 0); + + // Wait two additional frames to ensure that unexpected events are not + // received. + await raf(); + await raf(); } promise_test (async (t) => { - // Make sure that no scrollend event is sent to target_div. - target_div.addEventListener("scrollend", - t.unreached_func("target_div got unexpected scrollend event.")); - return test_scrollend_event_fire(GestureSourceType.TOUCH_INPUT); + return test_scrollend_event_fire(t, GestureSourceType.TOUCH_INPUT); }, 'Tests that the document gets scrollend event when no element scrolls by ' + 'touch.'); promise_test (async (t) => { - // Make sure that no scrollend event is sent to target_div. - target_div.addEventListener("scrollend", - t.unreached_func("target_div got unexpected scrollend event.")); - return test_scrollend_event_fire(GestureSourceType.MOUSE_INPUT, + return test_scrollend_event_fire(t, GestureSourceType.MOUSE_INPUT, true /* precise_scrolling_delta */); }, 'Tests that the document gets scrollend event when no element scrolls by '+ ' wheel in non-animated scrolling path.'); promise_test (async (t) => { - // Make sure that no scrollend event is sent to target_div. - target_div.addEventListener("scrollend", - t.unreached_func("target_div got unexpected scrollend event.")); - return test_scrollend_event_fire(GestureSourceType.MOUSE_INPUT, + return test_scrollend_event_fire(t, GestureSourceType.MOUSE_INPUT, false /* precise_scrolling_delta */); }, 'Tests that the document gets scrollend event when no element scrolls by '+ ' wheel in smooth scrolling path.');
diff --git a/third_party/blink/web_tests/fast/scrolling/events/scrollend-event-fired-to-window.html b/third_party/blink/web_tests/fast/scrolling/events/scrollend-event-fired-to-window.html index d7d1b19..48f1ea2 100644 --- a/third_party/blink/web_tests/fast/scrolling/events/scrollend-event-fired-to-window.html +++ b/third_party/blink/web_tests/fast/scrolling/events/scrollend-event-fired-to-window.html
@@ -32,45 +32,42 @@ var x = rect.left + rect.width / 2; var y = rect.top + rect.height / 2; -var scrollend_arrived = false; -function onScrollEnd(event) { - assert_false(event.cancelable); - // scrollend events targetting document are bubbled to the window. - assert_true(event.bubbles); - scrollend_arrived = true; -} -window.addEventListener("scrollend", onScrollEnd); - -async function test_scrollend_event_fire(source_device, precise_scroll_deltas) { +async function test_scrollend_event_fire(t, source_device, + precise_scroll_deltas) { scrollend_arrived = false; await waitForCompositorCommit(); - // Scroll up on target div and wait for the doc to get scrollend event. + // Make sure that no scrollend event is sent to target_div. + const listener = target_div.addEventListener("scrollend", + t.unreached_func("target_div got unexpected scrollend event.")); + t.add_cleanup(() => target_div.removeEventListener('scrollend', listener)); + + // Scroll up on target div and wait for the window to get the scrollend event. + const scrollendPromise = waitForScrollendEvent(window); await scrollUp(source_device, precise_scroll_deltas); - await waitFor(() => { return scrollend_arrived; }, - 'Window did not receive scrollend event after scroll up on target.'); + await scrollendPromise.then((event) => { + assert_false(event.cancelable); + // scrollend events targeting the document are bubbled to the window. + assert_true(event.bubbles); + }); assert_equals(target_div.scrollTop, 0); + + // Wait two additional frames to ensure that unexpected events are not + // received. + await raf(); + await raf(); } promise_test (async (t) => { - // Make sure that no scrollend event is sent to target_div. - target_div.addEventListener("scrollend", - t.unreached_func("target_div got unexpected scrollend event.")); - return test_scrollend_event_fire(GestureSourceType.TOUCH_INPUT); + return test_scrollend_event_fire(t, GestureSourceType.TOUCH_INPUT); }, 'Tests that the window gets scrollend event when no element scrolls ' + 'after touch scrolling.'); promise_test (async (t) => { - // Make sure that no scrollend event is sent to target_div. - target_div.addEventListener("scrollend", - t.unreached_func("target_div got unexpected scrollend event.")); - return test_scrollend_event_fire(GestureSourceType.MOUSE_INPUT, true); + return test_scrollend_event_fire(t, GestureSourceType.MOUSE_INPUT, true); }, 'Tests that the window gets scrollend event when no element scrolls ' + 'after non-animated wheel scrolling.'); promise_test (async (t) => { - // Make sure that no scrollend event is sent to target_div. - target_div.addEventListener("scrollend", - t.unreached_func("target_div got unexpected scrollend event.")); - return test_scrollend_event_fire(GestureSourceType.MOUSE_INPUT, false); + return test_scrollend_event_fire(t, GestureSourceType.MOUSE_INPUT, false); }, 'Tests that the window gets scrollend event when no element scrolls ' + 'after animated wheel scrolling(smooth scrolling).'); </script>
diff --git a/third_party/blink/web_tests/fast/scrolling/fractional-scroll-height-chaining.html b/third_party/blink/web_tests/fast/scrolling/fractional-scroll-height-chaining.html index ded146e3f..46e29c07 100644 --- a/third_party/blink/web_tests/fast/scrolling/fractional-scroll-height-chaining.html +++ b/third_party/blink/web_tests/fast/scrolling/fractional-scroll-height-chaining.html
@@ -21,12 +21,12 @@ <script> promise_test(async () => { + await waitForCompositorCommit(); var scroller_element = document.getElementById("scroller"); var scroller_center = pointInElement(scroller_element, 50, 50); + await mouseClickOn(50, 50); await wheelTick(0, 1, scroller_center); - await waitFor( () => { - return scrollY == pixelsPerTick(); -}); - + await waitForScrollEnd(window, () => { return scrollY; }, + pixelsPerTick()); }, "Verify that wheel scrolls chain correctly from a fractional-height scroller to its parent."); </script>
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/browser/downloadWillBegin-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/browser/downloadWillBegin-expected.txt index ac53427..39b5930 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/browser/downloadWillBegin-expected.txt +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/browser/downloadWillBegin-expected.txt
@@ -1,4 +1,5 @@ Tests we properly emit Browser.downloadWillBegin. +Running test for Browser target... Downloading via a navigation: downloadWillBegin from top frame: { method : Browser.downloadWillBegin @@ -179,4 +180,203 @@ url : http://127.0.0.1:8000/devtools/network/resources/resource.php?named_download&type=image } } +Running test for Frame target... +Downloading via a navigation: +downloadWillBegin from top frame: { + method : Browser.downloadWillBegin + params : { + frameId : <string> + guid : <string> + suggestedFilename : hello.txt + url : http://127.0.0.1:8000/devtools/network/resources/resource.php?download=1 + } + sessionId : <string> +} +downloadProgress has expected guid: true +{ + method : Browser.downloadProgress + params : { + guid : <string> + receivedBytes : <number> + state : inProgress + totalBytes : 11 + } + sessionId : <string> +} +downloadProgress has expected guid: true +{ + method : Browser.downloadProgress + params : { + guid : <string> + receivedBytes : <number> + state : completed + totalBytes : 11 + } + sessionId : <string> +} +Downloading via a navigation of subframe: +downloadWillBegin from child frame: { + method : Browser.downloadWillBegin + params : { + frameId : <string> + guid : <string> + suggestedFilename : hello.txt + url : http://127.0.0.1:8000/devtools/network/resources/resource.php?download=1 + } + sessionId : <string> +} +downloadProgress has expected guid: true +{ + method : Browser.downloadProgress + params : { + guid : <string> + receivedBytes : <number> + state : inProgress + totalBytes : 11 + } + sessionId : <string> +} +downloadProgress has expected guid: true +{ + method : Browser.downloadProgress + params : { + guid : <string> + receivedBytes : <number> + state : completed + totalBytes : 11 + } + sessionId : <string> +} +Downloading by clicking a link: +downloadWillBegin from top frame: { + method : Browser.downloadWillBegin + params : { + frameId : <string> + guid : <string> + suggestedFilename : hello.text + url : http://127.0.0.1:8000/devtools/network/resources/resource.php + } + sessionId : <string> +} +downloadProgress has expected guid: true +{ + method : Browser.downloadProgress + params : { + guid : <string> + receivedBytes : <number> + state : inProgress + totalBytes : 11 + } + sessionId : <string> +} +downloadProgress has expected guid: true +{ + method : Browser.downloadProgress + params : { + guid : <string> + receivedBytes : <number> + state : completed + totalBytes : 11 + } + sessionId : <string> +} +Downloading by clicking a link in subframe: +downloadWillBegin from child frame: { + method : Browser.downloadWillBegin + params : { + frameId : <string> + guid : <string> + suggestedFilename : hello.text + url : http://127.0.0.1:8000/devtools/network/resources/resource.php + } + sessionId : <string> +} +downloadProgress has expected guid: true +{ + method : Browser.downloadProgress + params : { + guid : <string> + receivedBytes : <number> + state : inProgress + totalBytes : 11 + } + sessionId : <string> +} +downloadProgress has expected guid: true +{ + method : Browser.downloadProgress + params : { + guid : <string> + receivedBytes : <number> + state : completed + totalBytes : 11 + } + sessionId : <string> +} +Downloading by clicking a link (no HTTP Content-Disposition header, a[download=""]): +downloadWillBegin from top frame: { + method : Browser.downloadWillBegin + params : { + frameId : <string> + guid : <string> + suggestedFilename : download.zzz + url : http://127.0.0.1:8000/devtools/network/resources/download.zzz + } + sessionId : <string> +} +Downloading by clicking a link (HTTP Content-Disposition header with filename=foo.txt, no a[download]): +downloadWillBegin from top frame: { + method : Browser.downloadWillBegin + params : { + frameId : <string> + guid : <string> + suggestedFilename : foo.txt + url : http://127.0.0.1:8000/devtools/network/resources/resource.php?named_download=foo.txt + } + sessionId : <string> +} +Downloading by clicking a link (HTTP Content-Disposition header with filename=override.txt, a[download="foo.txt"]): +downloadWillBegin from top frame: { + method : Browser.downloadWillBegin + params : { + frameId : <string> + guid : <string> + suggestedFilename : override.txt + url : http://127.0.0.1:8000/devtools/network/resources/resource.php?named_download=override.txt + } + sessionId : <string> +} +Downloading by clicking a link (HTTP Content-Disposition header without filename, no a[download]): +downloadWillBegin from top frame: { + method : Browser.downloadWillBegin + params : { + frameId : <string> + guid : <string> + suggestedFilename : resource.txt + url : http://127.0.0.1:8000/devtools/network/resources/resource.php?named_download + } + sessionId : <string> +} +Downloading by clicking a link (HTTP Content-Disposition header without filename, no a[download], js): +downloadWillBegin from top frame: { + method : Browser.downloadWillBegin + params : { + frameId : <string> + guid : <string> + suggestedFilename : resource.js + url : http://127.0.0.1:8000/devtools/network/resources/resource.php?named_download&type=js + } + sessionId : <string> +} +Downloading by clicking a link (HTTP Content-Disposition header without filename, no a[download], image): +downloadWillBegin from top frame: { + method : Browser.downloadWillBegin + params : { + frameId : <string> + guid : <string> + suggestedFilename : resource.png + url : http://127.0.0.1:8000/devtools/network/resources/resource.php?named_download&type=image + } + sessionId : <string> +}
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/browser/downloadWillBegin.js b/third_party/blink/web_tests/http/tests/inspector-protocol/browser/downloadWillBegin.js index 6921c84..a20d7198 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/browser/downloadWillBegin.js +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/browser/downloadWillBegin.js
@@ -1,6 +1,5 @@ (async function(testRunner) { const {page, session, dp} = await testRunner.startBlank('Tests we properly emit Browser.downloadWillBegin.'); - await session.evaluateAsync(` const frame = document.createElement('iframe'); frame.src = location.href; @@ -16,116 +15,135 @@ const pageId = page._targetId; - await testRunner.browserP().Browser.setDownloadBehavior({ - behavior: 'default', - eventsEnabled: true - }); - - let downloadId; - await testRunner.browserP().Browser.onDownloadWillBegin(event => { - const frame = frameNames.get(event.params.frameId) || 'unknown'; - downloadId = event.params.guid; - testRunner.log(event, `downloadWillBegin from ${frame} frame: `); - }); - - async function waitForDownloadAndDump() { - const visitedStates = new Set(); - await new Promise(resolve => { - testRunner.browserP().Browser.onDownloadProgress(event => { - if (visitedStates.has(event.params.state)) - return; - visitedStates.add(event.params.state); - testRunner.log(`downloadProgress has expected guid: ${downloadId === event.params.guid}`); - testRunner.log(event); - if (event.params.state === 'completed') - resolve(); - }); + async function runTestForTarget(target) { + await target.Browser.setDownloadBehavior({ + behavior: 'default', + eventsEnabled: true }); + + let downloadId; + target.Browser.onDownloadWillBegin(event => { + const frame = frameNames.get(event.params.frameId) || 'unknown'; + downloadId = event.params.guid; + testRunner.log(event, `downloadWillBegin from ${frame} frame: `); + }); + + async function waitForDownloadAndDump() { + const visitedStates = new Set(); + await new Promise(resolve => { + target.Browser.onDownloadProgress(event => { + if (visitedStates.has(event.params.state)) + return; + visitedStates.add(event.params.state); + testRunner.log(`downloadProgress has expected guid: ${downloadId === event.params.guid}`); + testRunner.log(event); + if (event.params.state === 'completed') + resolve(); + }); + }); + } + + async function waitForDownloadCompleted() { + await target.Browser.onceDownloadProgress(event => event.params.state === 'completed'); + } + + testRunner.log('Downloading via a navigation: '); + session.evaluate('location.href = "/devtools/network/resources/resource.php?download=1"'); + await waitForDownloadAndDump(); + + testRunner.log('Downloading via a navigation of subframe: '); + session.evaluate(`frames[0].frameElement.src = '/devtools/network/resources/resource.php?download=1'`); + await waitForDownloadAndDump(); + + function createLinkAndClick(doc) { + const a = doc.createElement('a'); + a.href = '/devtools/network/resources/resource.php'; + a.download = 'hello.text'; + doc.body.appendChild(a); + a.click(); + } + + testRunner.log('Downloading by clicking a link: '); + session.evaluate(`(${createLinkAndClick})(document)`); + await waitForDownloadAndDump(); + + testRunner.log('Downloading by clicking a link in subframe: '); + session.evaluate(`(${createLinkAndClick})(frames[0].document)`); + await waitForDownloadAndDump(); + + testRunner.log( + 'Downloading by clicking a link (no HTTP Content-Disposition header, a[download=""]): '); + session.evaluate(` + (function () { + const blankDownloadAttr = document.createElement('a'); + blankDownloadAttr.href = '/devtools/network/resources/download.zzz'; + blankDownloadAttr.download = ''; // Intentionally left blank to trigger unnamed download + document.body.appendChild(blankDownloadAttr); + blankDownloadAttr.click(); + })(); + `); + await waitForDownloadCompleted(); + testRunner.log( + 'Downloading by clicking a link (HTTP Content-Disposition header with filename=foo.txt, no a[download]): '); + session.evaluate(` + (function () { + const headerButNoDownloadAttr = document.createElement('a'); + headerButNoDownloadAttr.href = '/devtools/network/resources/resource.php?named_download=foo.txt'; + document.body.appendChild(headerButNoDownloadAttr); + headerButNoDownloadAttr.click(); + })(); + `); + await waitForDownloadCompleted(); + testRunner.log( + 'Downloading by clicking a link (HTTP Content-Disposition header with filename=override.txt, a[download="foo.txt"]): '); + session.evaluate(` + (function() { + const headerAndConflictingDownloadAttr = document.createElement('a'); + headerAndConflictingDownloadAttr.href = '/devtools/network/resources/resource.php?named_download=override.txt'; + headerAndConflictingDownloadAttr.download = 'foo.txt'; + document.body.appendChild(headerAndConflictingDownloadAttr); + headerAndConflictingDownloadAttr.click(); + })(); + `); + await waitForDownloadCompleted(); + testRunner.log( + 'Downloading by clicking a link (HTTP Content-Disposition header without filename, no a[download]): '); + session.evaluate(` + (function() { + const unnamedDownload = document.createElement('a'); + unnamedDownload.href = '/devtools/network/resources/resource.php?named_download'; + document.body.appendChild(unnamedDownload); + unnamedDownload.click(); + })(); + `); + await waitForDownloadCompleted(); + testRunner.log( + 'Downloading by clicking a link (HTTP Content-Disposition header without filename, no a[download], js): '); + session.evaluate(` + (function() { + const jsDownload = document.createElement('a'); + jsDownload.href = '/devtools/network/resources/resource.php?named_download&type=js'; + document.body.appendChild(jsDownload); + jsDownload.click(); + })(); + `); + await waitForDownloadCompleted(); + testRunner.log( + 'Downloading by clicking a link (HTTP Content-Disposition header without filename, no a[download], image): '); + session.evaluate(` + (function() { + const imageDownload = document.createElement('a'); + imageDownload.href = '/devtools/network/resources/resource.php?named_download&type=image'; + document.body.appendChild(imageDownload); + imageDownload.click(); + })(); + `); + await waitForDownloadCompleted(); + await target.Browser.setDownloadBehavior({behavior: 'default'}); } - - async function waitForDownloadCompleted() { - await testRunner.browserP().Browser.onceDownloadProgress(event => event.params.state === 'completed'); - } - - testRunner.log('Downloading via a navigation: '); - session.evaluate('location.href = "/devtools/network/resources/resource.php?download=1"'); - await waitForDownloadAndDump(); - - testRunner.log('Downloading via a navigation of subframe: '); - session.evaluate(`frames[0].frameElement.src = '/devtools/network/resources/resource.php?download=1'`); - await waitForDownloadAndDump(); - - function createLinkAndClick(doc) { - const a = doc.createElement('a'); - a.href = '/devtools/network/resources/resource.php'; - a.download = 'hello.text'; - doc.body.appendChild(a); - a.click(); - } - - testRunner.log('Downloading by clicking a link: '); - session.evaluate(`(${createLinkAndClick})(document)`); - await waitForDownloadAndDump(); - - testRunner.log('Downloading by clicking a link in subframe: '); - session.evaluate(`(${createLinkAndClick})(frames[0].document)`); - await waitForDownloadAndDump(); - - testRunner.log( - 'Downloading by clicking a link (no HTTP Content-Disposition header, a[download=""]): '); - session.evaluate(` - const blankDownloadAttr = document.createElement('a'); - blankDownloadAttr.href = '/devtools/network/resources/download.zzz'; - blankDownloadAttr.download = ''; // Intentionally left blank to trigger unnamed download - document.body.appendChild(blankDownloadAttr); - blankDownloadAttr.click(); - `); - await waitForDownloadCompleted(); - testRunner.log( - 'Downloading by clicking a link (HTTP Content-Disposition header with filename=foo.txt, no a[download]): '); - session.evaluate(` - const headerButNoDownloadAttr = document.createElement('a'); - headerButNoDownloadAttr.href = '/devtools/network/resources/resource.php?named_download=foo.txt'; - document.body.appendChild(headerButNoDownloadAttr); - headerButNoDownloadAttr.click(); - `); - await waitForDownloadCompleted(); - testRunner.log( - 'Downloading by clicking a link (HTTP Content-Disposition header with filename=override.txt, a[download="foo.txt"]): '); - session.evaluate(` - const headerAndConflictingDownloadAttr = document.createElement('a'); - headerAndConflictingDownloadAttr.href = '/devtools/network/resources/resource.php?named_download=override.txt'; - headerAndConflictingDownloadAttr.download = 'foo.txt'; - document.body.appendChild(headerAndConflictingDownloadAttr); - headerAndConflictingDownloadAttr.click(); - `); - await waitForDownloadCompleted(); - testRunner.log( - 'Downloading by clicking a link (HTTP Content-Disposition header without filename, no a[download]): '); - session.evaluate(` - const unnamedDownload = document.createElement('a'); - unnamedDownload.href = '/devtools/network/resources/resource.php?named_download'; - document.body.appendChild(unnamedDownload); - unnamedDownload.click(); - `); - await waitForDownloadCompleted(); - testRunner.log( - 'Downloading by clicking a link (HTTP Content-Disposition header without filename, no a[download], js): '); - session.evaluate(` - const jsDownload = document.createElement('a'); - jsDownload.href = '/devtools/network/resources/resource.php?named_download&type=js'; - document.body.appendChild(jsDownload); - jsDownload.click(); - `); - await waitForDownloadCompleted(); - testRunner.log( - 'Downloading by clicking a link (HTTP Content-Disposition header without filename, no a[download], image): '); - session.evaluate(` - const imageDownload = document.createElement('a'); - imageDownload.href = '/devtools/network/resources/resource.php?named_download&type=image'; - document.body.appendChild(imageDownload); - imageDownload.click(); - `); - await waitForDownloadCompleted(); + testRunner.log('Running test for Browser target...'); + await runTestForTarget(testRunner.browserP()); + testRunner.log('Running test for Frame target...'); + await runTestForTarget(dp); testRunner.completeTest(); })
diff --git a/third_party/blink/web_tests/http/tests/loading/window-open-onblur-reentrancy-expected.txt b/third_party/blink/web_tests/http/tests/loading/window-open-onblur-reentrancy-expected.txt index 658f9d6..54014cf 100644 --- a/third_party/blink/web_tests/http/tests/loading/window-open-onblur-reentrancy-expected.txt +++ b/third_party/blink/web_tests/http/tests/loading/window-open-onblur-reentrancy-expected.txt
@@ -9,6 +9,5 @@ frame "i" - didHandleOnloadEventsForFrame frame "i" - didFinishLoadForFrame main frame - didFinishDocumentLoadForFrame -main frame - didCommitLoadForFrame main frame - didHandleOnloadEventsForFrame main frame - didFinishLoadForFrame
diff --git a/third_party/blink/web_tests/http/tests/navigation/lockedhistory-iframe-expected.txt b/third_party/blink/web_tests/http/tests/navigation/lockedhistory-iframe-expected.txt index 6def51f..a1d0ffb 100644 --- a/third_party/blink/web_tests/http/tests/navigation/lockedhistory-iframe-expected.txt +++ b/third_party/blink/web_tests/http/tests/navigation/lockedhistory-iframe-expected.txt
@@ -1,3 +1,6 @@ This test verifies that setting the iframe.src through javascript to # does not add a history item. If the test passes you'll see only one history item. - PASS +============== Back Forward List ============== +curr-> http://127.0.0.1:8000/navigation/lockedhistory-iframe.html + http://127.0.0.1:8000/navigation/lockedhistory-iframe.html# (in frame "<!--framePath //<!--frame0-->-->") +===============================================
diff --git a/third_party/blink/web_tests/http/tests/navigation/lockedhistory-iframe.html b/third_party/blink/web_tests/http/tests/navigation/lockedhistory-iframe.html index f0f5c50..fb4420a2 100644 --- a/third_party/blink/web_tests/http/tests/navigation/lockedhistory-iframe.html +++ b/third_party/blink/web_tests/http/tests/navigation/lockedhistory-iframe.html
@@ -2,6 +2,7 @@ <head> <script src="resources/document-location.js"></script> <script type="text/javascript"> +testRunner.dumpBackForwardList(); testRunner.dumpAsText(); testRunner.waitUntilDone(); @@ -14,14 +15,9 @@ <body> <p>This test verifies that setting the iframe.src through javascript to # does not add a history item. If the test passes you'll see only one history item.</p> <script type="text/javascript"> -let historyLength = history.length; myFrame = document.createElement("iframe"); myFrame.src = "javascript:document.write('<script type=text/javascript>window.parent.myCallbackFunction();<\/script>'); document.close()"; -myFrame.onload = () => { - document.body.appendChild(document.createTextNode( - historyLength == history.length ? "PASS" : "FAIL")); - testRunner.notifyDone(); -} +myFrame.onload = () => testRunner.notifyDone(); document.body.appendChild(myFrame); </script> </body>
diff --git a/third_party/blink/web_tests/inspector-protocol/emulation/device-override-intersection-observer-expected.txt b/third_party/blink/web_tests/inspector-protocol/emulation/device-override-intersection-observer-expected.txt new file mode 100644 index 0000000..6ff44ec --- /dev/null +++ b/third_party/blink/web_tests/inspector-protocol/emulation/device-override-intersection-observer-expected.txt
@@ -0,0 +1,5 @@ +Tests that intersection observer works with device emulation. +target intersecting true +target intersecting false +target intersecting true +
diff --git a/third_party/blink/web_tests/inspector-protocol/emulation/device-override-intersection-observer.js b/third_party/blink/web_tests/inspector-protocol/emulation/device-override-intersection-observer.js new file mode 100644 index 0000000..3d78a0f --- /dev/null +++ b/third_party/blink/web_tests/inspector-protocol/emulation/device-override-intersection-observer.js
@@ -0,0 +1,56 @@ +(async function(testRunner) { + + const {page, session, dp} = await testRunner.startBlank( + `Tests that intersection observer works with device emulation.`); + + const params = { + deviceScaleFactor: 1, + width: 1024, + height: 1024, + mobile: false, + screenWidth: 1024, + screenHeight: 1024, + viewport: {x: 0, y: 0, width: 1024, height: 1024, scale: 1} + }; + await dp.Emulation.setDeviceMetricsOverride(params); + dp.Runtime.enable(); + dp.Runtime.onConsoleAPICalled(event => { + testRunner.log(event.params.args[0].value); + }); + await page.loadHTML(` + <html><head> + <style> + .tall { background-color: green; height: 3000px; } + .short { background-color: red; height: 100px; } + </style></head> + <body> + <div id='target' class='short'></div> + <div class='tall'></div> + </body> + `); + await session.evaluateAsync(` + const observer = new IntersectionObserver((entries, observer) => { + for (const entry of entries) + console.log(entry.target.id + ' intersecting ' + entry.isIntersecting); + if (window.intersectionCallback) + window.intersectionCallback(); + }); + new Promise(resolve => { + window.intersectionCallback = resolve; + observer.observe(document.querySelector('#target')); + }) + `); + await session.evaluateAsync(` + new Promise(resolve => { + window.intersectionCallback = resolve; + window.scrollBy(0, 200); + }); + `); + await session.evaluateAsync(` + new Promise(resolve => { + window.intersectionCallback = resolve; + window.scrollTo(0, 0); + }); + `); + testRunner.completeTest(); +})
diff --git a/third_party/blink/web_tests/platform/linux/compositing/3d-corners-expected.png b/third_party/blink/web_tests/platform/linux/compositing/3d-corners-expected.png new file mode 100644 index 0000000..05289d9 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/compositing/3d-corners-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/3d-cube-expected.png b/third_party/blink/web_tests/platform/linux/compositing/3d-cube-expected.png new file mode 100644 index 0000000..ed547bc --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/compositing/3d-cube-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/geometry/vertical-scroll-composited-expected.png b/third_party/blink/web_tests/platform/linux/compositing/geometry/vertical-scroll-composited-expected.png index bec632d..4245cef0 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/geometry/vertical-scroll-composited-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/geometry/vertical-scroll-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/geometry/video-fixed-scrolling-expected.png b/third_party/blink/web_tests/platform/linux/compositing/geometry/video-fixed-scrolling-expected.png index 953b8d8..c477ea7 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/geometry/video-fixed-scrolling-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/geometry/video-fixed-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/geometry/video-opacity-overlay-expected.png b/third_party/blink/web_tests/platform/linux/compositing/geometry/video-opacity-overlay-expected.png index c19b361..7094fc9e 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/geometry/video-opacity-overlay-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/geometry/video-opacity-overlay-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/lots-of-img-layers-expected.png b/third_party/blink/web_tests/platform/linux/compositing/lots-of-img-layers-expected.png index b4bc9ec..56516d65 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/lots-of-img-layers-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/lots-of-img-layers-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/lots-of-img-layers-with-opacity-expected.png b/third_party/blink/web_tests/platform/linux/compositing/lots-of-img-layers-with-opacity-expected.png index 74f4aea..f694a435 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/lots-of-img-layers-with-opacity-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/lots-of-img-layers-with-opacity-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-added-filters-expected.png b/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-added-filters-expected.png index 5b4bfc7..189c2ef3 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-added-filters-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/masks/mask-with-added-filters-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/mask-with-filter-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/mask-with-filter-expected.png new file mode 100644 index 0000000..dc5e8a6 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/mask-with-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-render-surfaces-with-rotation-expected.png new file mode 100644 index 0000000..d90afb61 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/rotate-then-clip-effect-interleave-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/rotate-then-clip-effect-interleave-expected.png index 454239b..cf5e66d9 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/overflow/rotate-then-clip-effect-interleave-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/rotate-then-clip-effect-interleave-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/overflow/rotate-then-clip-z-order-interleave-expected.png b/third_party/blink/web_tests/platform/linux/compositing/overflow/rotate-then-clip-z-order-interleave-expected.png new file mode 100644 index 0000000..6aa19b4 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/compositing/overflow/rotate-then-clip-z-order-interleave-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/perspective-interest-rect-expected.png b/third_party/blink/web_tests/platform/linux/compositing/perspective-interest-rect-expected.png new file mode 100644 index 0000000..7a2c3316 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/compositing/perspective-interest-rect-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/reflections/nested-reflection-animated-expected.png b/third_party/blink/web_tests/platform/linux/compositing/reflections/nested-reflection-animated-expected.png index 766501ce..90fd7410 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/reflections/nested-reflection-animated-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/reflections/nested-reflection-animated-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/transform-3d-scales-different-x-y-expected.png b/third_party/blink/web_tests/platform/linux/compositing/transform-3d-scales-different-x-y-expected.png index 3459b94..a249dc4 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/transform-3d-scales-different-x-y-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/transform-3d-scales-different-x-y-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/video/video-controls-squashing-expected.png b/third_party/blink/web_tests/platform/linux/compositing/video/video-controls-squashing-expected.png index 798be08..094e7384 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/video/video-controls-squashing-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/video/video-controls-squashing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/visibility/visibility-simple-video-layer-expected.png b/third_party/blink/web_tests/platform/linux/compositing/visibility/visibility-simple-video-layer-expected.png new file mode 100644 index 0000000..843dbae --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/compositing/visibility/visibility-simple-video-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/compositing/webgl/webgl-reflection-expected.png b/third_party/blink/web_tests/platform/linux/compositing/webgl/webgl-reflection-expected.png index 4ed823a0..53dfc582 100644 --- a/third_party/blink/web_tests/platform/linux/compositing/webgl/webgl-reflection-expected.png +++ b/third_party/blink/web_tests/platform/linux/compositing/webgl/webgl-reflection-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/blending/background-blend-mode-overlapping-accelerated-elements-expected.png b/third_party/blink/web_tests/platform/linux/css3/blending/background-blend-mode-overlapping-accelerated-elements-expected.png index f27b6304..475d0f6 100644 --- a/third_party/blink/web_tests/platform/linux/css3/blending/background-blend-mode-overlapping-accelerated-elements-expected.png +++ b/third_party/blink/web_tests/platform/linux/css3/blending/background-blend-mode-overlapping-accelerated-elements-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/filters/effect-brightness-clamping-hw-expected.png b/third_party/blink/web_tests/platform/linux/css3/filters/effect-brightness-clamping-hw-expected.png new file mode 100644 index 0000000..b37e829 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/css3/filters/effect-brightness-clamping-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-hidpi-hw-expected.png b/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-hidpi-hw-expected.png new file mode 100644 index 0000000..cf8e5ff --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-hidpi-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-hw-expected.png b/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-hw-expected.png new file mode 100644 index 0000000..a04fc69a --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-ordering-hw-expected.png b/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-ordering-hw-expected.png new file mode 100644 index 0000000..12db1a0 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-ordering-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-subregion-hw-expected.png b/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-subregion-hw-expected.png new file mode 100644 index 0000000..5f03de7 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-subregion-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-zoom-hw-expected.png b/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-zoom-hw-expected.png new file mode 100644 index 0000000..218dd33f --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/css3/filters/effect-reference-zoom-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/filters/filter-repaint-composited-fallback-crash-expected.png b/third_party/blink/web_tests/platform/linux/css3/filters/filter-repaint-composited-fallback-crash-expected.png new file mode 100644 index 0000000..f2436eeb --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/css3/filters/filter-repaint-composited-fallback-crash-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/css3/filters/filter-repaint-composited-fallback-expected.png b/third_party/blink/web_tests/platform/linux/css3/filters/filter-repaint-composited-fallback-expected.png new file mode 100644 index 0000000..f2436eeb --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/css3/filters/filter-repaint-composited-fallback-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/external/wpt/webxr/light-estimation/xrWebGLBinding_getReflectionCubeMap.https-expected.txt b/third_party/blink/web_tests/platform/linux/external/wpt/webxr/light-estimation/xrWebGLBinding_getReflectionCubeMap.https-expected.txt new file mode 100644 index 0000000..845f5cf --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/external/wpt/webxr/light-estimation/xrWebGLBinding_getReflectionCubeMap.https-expected.txt
@@ -0,0 +1,6 @@ +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = Unhandled rejection: Failed to execute 'end' on 'XRSession': XRSession has already ended. +FAIL Test that getReflectionCubeMap returns or throws appropriately without a reflection map. - webgl Failed to execute 'getReflectionCubeMap' on 'XRWebGLBinding': WebGL contexts must have the OES_texture_half_float extension enabled prior to calling getReflectionCubeMap with a format of "rgba16f". This restriction does not apply to WebGL 2.0 contexts. +PASS Test that getReflectionCubeMap returns or throws appropriately without a reflection map. - webgl2 +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/linux/external/wpt/webxr/xrWebGLLayer_opaque_framebuffer_stencil.https-expected.txt b/third_party/blink/web_tests/platform/linux/external/wpt/webxr/xrWebGLLayer_opaque_framebuffer_stencil.https-expected.txt new file mode 100644 index 0000000..5c38daf1 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/external/wpt/webxr/xrWebGLLayer_opaque_framebuffer_stencil.https-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +FAIL Ensure that the framebuffer given by the WebGL layer works with stencil for non-immersive - webgl promise_test: Unhandled rejection with value: "Failed, readPixels (1) didn't work, gl error = 1282, pixel = 30 30 30" +FAIL Ensure that the framebuffer given by the WebGL layer works with stencil for non-immersive - webgl2 promise_test: Unhandled rejection with value: "Failed, readPixels (1) didn't work, gl error = 1282, pixel = 30 30 30" +FAIL Ensure that the framebuffer given by the WebGL layer works with stencil for immersive - webgl promise_test: Unhandled rejection with value: "Failed, readPixels (1) didn't work, gl error = 1282, pixel = 30 30 30" +FAIL Ensure that the framebuffer given by the WebGL layer works with stencil for immersive - webgl2 promise_test: Unhandled rejection with value: "Failed, readPixels (1) didn't work, gl error = 1282, pixel = 30 30 30" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-mask-canvas-expected.png b/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-mask-canvas-expected.png index db4d228..02d8572 100644 --- a/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-mask-canvas-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-mask-canvas-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-mask-video-expected.png b/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-mask-video-expected.png index 274d548..e322baf 100644 --- a/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-mask-video-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-mask-video-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-with-composited-child-expected.png b/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-with-composited-child-expected.png index f87088af..ab6c430b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-with-composited-child-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/borders/border-radius-with-composited-child-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/media/video-overlay-menu-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/media/video-overlay-menu-expected.png index 7f0b4f3..4d38cbc 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/media/video-overlay-menu-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/media/video-overlay-menu-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/media/video-overlay-play-button-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/media/video-overlay-play-button-expected.png index 0a106fe4..9601861c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/media/video-overlay-play-button-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/color-scheme/media/video-overlay-play-button-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/frames/frame-set-scaling-rotate-expected.png b/third_party/blink/web_tests/platform/linux/fast/frames/frame-set-scaling-rotate-expected.png new file mode 100644 index 0000000..a5c6fc95 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/fast/frames/frame-set-scaling-rotate-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/frames/frame-set-scaling-skew-expected.png b/third_party/blink/web_tests/platform/linux/fast/frames/frame-set-scaling-skew-expected.png new file mode 100644 index 0000000..a64adc9 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/fast/frames/frame-set-scaling-skew-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/webgl/pixelated-expected.png b/third_party/blink/web_tests/platform/linux/fast/webgl/pixelated-expected.png new file mode 100644 index 0000000..705007f --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/fast/webgl/pixelated-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/webgl/webgl-composite-modes-expected.png b/third_party/blink/web_tests/platform/linux/fast/webgl/webgl-composite-modes-expected.png new file mode 100644 index 0000000..5dc0380 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/fast/webgl/webgl-composite-modes-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/webgl/webgl-composite-modes-repaint-expected.png b/third_party/blink/web_tests/platform/linux/fast/webgl/webgl-composite-modes-repaint-expected.png new file mode 100644 index 0000000..792831ce --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/fast/webgl/webgl-composite-modes-repaint-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/webgl/webgl-composite-modes-tabswitching-expected.png b/third_party/blink/web_tests/platform/linux/fast/webgl/webgl-composite-modes-tabswitching-expected.png new file mode 100644 index 0000000..de1806345 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/fast/webgl/webgl-composite-modes-tabswitching-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/images/yuv-decode-eligible/color-profile-layer-filter-expected.png b/third_party/blink/web_tests/platform/linux/images/yuv-decode-eligible/color-profile-layer-filter-expected.png new file mode 100644 index 0000000..1225ff3 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/images/yuv-decode-eligible/color-profile-layer-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/color-profile-video-expected.png b/third_party/blink/web_tests/platform/linux/media/color-profile-video-expected.png new file mode 100644 index 0000000..110e5c5 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/media/color-profile-video-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/color-profile-video-seek-filter-expected.png b/third_party/blink/web_tests/platform/linux/media/color-profile-video-seek-filter-expected.png index 616836b..c1490d7 100644 --- a/third_party/blink/web_tests/platform/linux/media/color-profile-video-seek-filter-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/color-profile-video-seek-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/controls-after-reload-expected.png b/third_party/blink/web_tests/platform/linux/media/controls-after-reload-expected.png index 4aea95e8..3872a4a 100644 --- a/third_party/blink/web_tests/platform/linux/media/controls-after-reload-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/controls-after-reload-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/controls-strict-expected.png b/third_party/blink/web_tests/platform/linux/media/controls-strict-expected.png index deda1fd..e79094e 100644 --- a/third_party/blink/web_tests/platform/linux/media/controls-strict-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/controls-strict-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/controls-styling-expected.png b/third_party/blink/web_tests/platform/linux/media/controls-styling-expected.png index c23f5e5..aae08301 100644 --- a/third_party/blink/web_tests/platform/linux/media/controls-styling-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/controls-styling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/controls-styling-strict-expected.png b/third_party/blink/web_tests/platform/linux/media/controls-styling-strict-expected.png index 637142e..3b0ed46 100644 --- a/third_party/blink/web_tests/platform/linux/media/controls-styling-strict-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/controls-styling-strict-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/controls-without-preload-expected.png b/third_party/blink/web_tests/platform/linux/media/controls-without-preload-expected.png index 03caecb..856c532 100644 --- a/third_party/blink/web_tests/platform/linux/media/controls-without-preload-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/controls-without-preload-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/controls/paint-controls-webkit-appearance-none-expected.png b/third_party/blink/web_tests/platform/linux/media/controls/paint-controls-webkit-appearance-none-expected.png index 47e4806..eac24bb 100644 --- a/third_party/blink/web_tests/platform/linux/media/controls/paint-controls-webkit-appearance-none-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/controls/paint-controls-webkit-appearance-none-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/video-canvas-alpha-expected.png b/third_party/blink/web_tests/platform/linux/media/video-canvas-alpha-expected.png index d51ef5eb0..73833681 100644 --- a/third_party/blink/web_tests/platform/linux/media/video-canvas-alpha-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/video-canvas-alpha-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/video-controls-rendering-expected.png b/third_party/blink/web_tests/platform/linux/media/video-controls-rendering-expected.png index 1c39f89..65b8e6f 100644 --- a/third_party/blink/web_tests/platform/linux/media/video-controls-rendering-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/video-controls-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/video-display-toggle-expected.png b/third_party/blink/web_tests/platform/linux/media/video-display-toggle-expected.png index 884b3c8..ad71ea8a 100644 --- a/third_party/blink/web_tests/platform/linux/media/video-display-toggle-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/video-display-toggle-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/video-no-audio-expected.png b/third_party/blink/web_tests/platform/linux/media/video-no-audio-expected.png index 670a2253..3d197ff 100644 --- a/third_party/blink/web_tests/platform/linux/media/video-no-audio-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/video-no-audio-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/video-replaces-poster-expected.png b/third_party/blink/web_tests/platform/linux/media/video-replaces-poster-expected.png index b0580a91..c3c0c82 100644 --- a/third_party/blink/web_tests/platform/linux/media/video-replaces-poster-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/video-replaces-poster-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/video-zoom-controls-expected.png b/third_party/blink/web_tests/platform/linux/media/video-zoom-controls-expected.png index e6d5d0d..e92f329c 100644 --- a/third_party/blink/web_tests/platform/linux/media/video-zoom-controls-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/video-zoom-controls-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/media/video-zoom-expected.png b/third_party/blink/web_tests/platform/linux/media/video-zoom-expected.png index e100646..477cf2e 100644 --- a/third_party/blink/web_tests/platform/linux/media/video-zoom-expected.png +++ b/third_party/blink/web_tests/platform/linux/media/video-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug137388-2-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug137388-2-expected.png index 68ed1dae..756fdf6f 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug137388-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/bugs/bug137388-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_auto_per-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_auto_per-expected.png index 088a44b9..ce66397 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_auto_per-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_auto_per-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_fix_per-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_fix_per-expected.png index e4d4e6e..e164a92 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_fix_per-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla/core/col_widths_fix_per-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug17826-expected.png b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug17826-expected.png index a47cc3cd..08611ed8 100644 --- a/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug17826-expected.png +++ b/third_party/blink/web_tests/platform/linux/tables/mozilla_expected_failures/bugs/bug17826-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/transforms/3d/general/perspective-units-expected.png b/third_party/blink/web_tests/platform/linux/transforms/3d/general/perspective-units-expected.png index 936322ba..af67e96c 100644 --- a/third_party/blink/web_tests/platform/linux/transforms/3d/general/perspective-units-expected.png +++ b/third_party/blink/web_tests/platform/linux/transforms/3d/general/perspective-units-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-2-expected.png b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-2-expected.png index 78e8e397..1fd074b 100644 --- a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-2-expected.png +++ b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-expected.png b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-expected.png index 68c3ebe..5910e00d 100644 --- a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-expected.png +++ b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png index 3abe6a9..cf4a959 100644 --- a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png +++ b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png index 8d9202a..72a5871 100644 --- a/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png +++ b/third_party/blink/web_tests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/android/fullscreen/video-controls-timeline-expected.png b/third_party/blink/web_tests/platform/linux/virtual/android/fullscreen/video-controls-timeline-expected.png index 3f8bdd44..d59d6f11 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/android/fullscreen/video-controls-timeline-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/android/fullscreen/video-controls-timeline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/android/fullscreen/video-scrolled-iframe-expected.png b/third_party/blink/web_tests/platform/linux/virtual/android/fullscreen/video-scrolled-iframe-expected.png index 529e2160..3bf2470 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/android/fullscreen/video-scrolled-iframe-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/android/fullscreen/video-scrolled-iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/media/video-overlay-menu-expected.png b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/media/video-overlay-menu-expected.png index 70ab693..a2eeeb28f 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/media/video-overlay-menu-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/media/video-overlay-menu-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/media/video-overlay-play-button-expected.png b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/media/video-overlay-play-button-expected.png index 7e16696..ab2d59b 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/media/video-overlay-play-button-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/media/video-overlay-play-button-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/media/video-controls-rendering-expected.png b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/media/video-controls-rendering-expected.png index 6193b01..b293b66 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/media/video-controls-rendering-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/media/video-controls-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/2-comp-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/2-comp-expected.png new file mode 100644 index 0000000..b9aada3 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/2-comp-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-jpeg-with-color-profile-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-jpeg-with-color-profile-expected.png new file mode 100644 index 0000000..3161474 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-jpeg-with-color-profile-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-animate-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-animate-expected.png new file mode 100644 index 0000000..3cf3789b --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-animate-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-animate-rotate-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-animate-rotate-expected.png new file mode 100644 index 0000000..4fa3a4e --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-animate-rotate-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-background-image-cover-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-background-image-cover-expected.png new file mode 100644 index 0000000..b59a532 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-background-image-cover-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-background-image-repeat-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-background-image-repeat-expected.png new file mode 100644 index 0000000..d9f2713 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-background-image-repeat-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-background-image-space-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-background-image-space-expected.png new file mode 100644 index 0000000..58b34902 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-background-image-space-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-border-image-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-border-image-expected.png new file mode 100644 index 0000000..89b9df7 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-border-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-group-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-group-expected.png new file mode 100644 index 0000000..1dab753 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-group-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-canvas-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-canvas-expected.png new file mode 100644 index 0000000..6f5b90d7 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-canvas-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-canvas-pattern-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-canvas-pattern-expected.png new file mode 100644 index 0000000..14e6a2b --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-canvas-pattern-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-canvas-svg-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-canvas-svg-expected.png new file mode 100644 index 0000000..1a4b164 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-canvas-svg-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-filter-all-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-filter-all-expected.png index 012e1a5..9084a54 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-filter-all-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-filter-all-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-object-fit-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-object-fit-expected.png new file mode 100644 index 0000000..5688f87 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-object-fit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-shape-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-shape-expected.png index 2799c75..8e4e1a92 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-shape-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-shape-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-svg-resource-url-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-svg-resource-url-expected.png new file mode 100644 index 0000000..657d4ce422 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-image-svg-resource-url-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-mask-image-svg-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-mask-image-svg-expected.png new file mode 100644 index 0000000..1b747ed --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-mask-image-svg-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-object-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-object-expected.png new file mode 100644 index 0000000..0d110cf --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-object-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-svg-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-svg-expected.png new file mode 100644 index 0000000..3035e41 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/color-profile-svg-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/jpeg-with-color-profile-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/jpeg-with-color-profile-expected.png index bfaf5ec5..799f4ab 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/jpeg-with-color-profile-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/jpeg-with-color-profile-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/jpeg-yuv-progressive-canvas-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/jpeg-yuv-progressive-canvas-expected.png new file mode 100644 index 0000000..bdb3350b --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/jpeg-yuv-progressive-canvas-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/jpeg-yuv-progressive-image-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/jpeg-yuv-progressive-image-expected.png new file mode 100644 index 0000000..264444b --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/jpeg-yuv-progressive-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/motion-jpeg-single-frame-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/motion-jpeg-single-frame-expected.png new file mode 100644 index 0000000..f9a4bc5 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/motion-jpeg-single-frame-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/png-with-color-profile-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/png-with-color-profile-expected.png index 14518bf..5a353c9 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/png-with-color-profile-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/png-with-color-profile-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/webp-color-profile-lossless-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/webp-color-profile-lossless-expected.png new file mode 100644 index 0000000..b4ae1928b --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/webp-color-profile-lossless-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/webp-color-profile-lossy-alpha-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/webp-color-profile-lossy-alpha-expected.png new file mode 100644 index 0000000..5aaed9a3 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/webp-color-profile-lossy-alpha-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-border-radius-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-border-radius-expected.png new file mode 100644 index 0000000..afcbac3 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-border-radius-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-filter-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-filter-expected.png new file mode 100644 index 0000000..4c8425c9 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-image-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-image-expected.png new file mode 100644 index 0000000..e37fe5d --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-image-profile-match-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-image-profile-match-expected.png new file mode 100644 index 0000000..ec586f83 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-image-profile-match-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-layer-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-layer-expected.png new file mode 100644 index 0000000..fb8aa4c --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/color-profile-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/jpeg-missing-eoi-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/jpeg-missing-eoi-expected.png new file mode 100644 index 0000000..79ee70a --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/jpeg-missing-eoi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/webp-color-profile-lossy-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/webp-color-profile-lossy-expected.png new file mode 100644 index 0000000..1edf32d8 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/webp-color-profile-lossy-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/webp-no-color-profile-lossy-expected.png b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/webp-no-color-profile-lossy-expected.png new file mode 100644 index 0000000..3efbc1d1 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/exotic-color-space/images/yuv-decode-eligible/webp-no-color-profile-lossy-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization-disable-yuv/images/yuv-decode-eligible/color-profile-filter-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization-disable-yuv/images/yuv-decode-eligible/color-profile-filter-expected.png new file mode 100644 index 0000000..d454902 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization-disable-yuv/images/yuv-decode-eligible/color-profile-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization-disable-yuv/images/yuv-decode-eligible/color-profile-image-profile-match-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization-disable-yuv/images/yuv-decode-eligible/color-profile-image-profile-match-expected.png new file mode 100644 index 0000000..827714e --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization-disable-yuv/images/yuv-decode-eligible/color-profile-image-profile-match-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization-disable-yuv/images/yuv-decode-eligible/jpeg-missing-eoi-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization-disable-yuv/images/yuv-decode-eligible/jpeg-missing-eoi-expected.png new file mode 100644 index 0000000..a45ce53 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization-disable-yuv/images/yuv-decode-eligible/jpeg-missing-eoi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/12-55-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/12-55-expected.png index 155a4eaa..a675d8ab 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/12-55-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/12-55-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/182-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/182-expected.png index 0f3bf770..2b1beb5 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/182-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/182-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/2-comp-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/2-comp-expected.png index 63e409c..5147ada 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/2-comp-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/2-comp-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/2-dht-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/2-dht-expected.png index 413ba93..514fabd8 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/2-dht-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/2-dht-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/23-55-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/23-55-expected.png index 210e889..99551c8 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/23-55-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/23-55-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/55-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/55-expected.png index b0cebffc..750ed75 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/55-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/55-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-jpeg-with-color-profile-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-jpeg-with-color-profile-expected.png new file mode 100644 index 0000000..8bd187f --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-jpeg-with-color-profile-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-cover-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-cover-expected.png new file mode 100644 index 0000000..4c15fc7 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-cover-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png new file mode 100644 index 0000000..9e283aa --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png new file mode 100644 index 0000000..9e283aa --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-repeat-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-repeat-expected.png new file mode 100644 index 0000000..28884058 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-repeat-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-space-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-space-expected.png new file mode 100644 index 0000000..707b2e2 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-background-image-space-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-border-image-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-border-image-expected.png new file mode 100644 index 0000000..f5cbeb24 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-border-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-image-canvas-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-image-canvas-expected.png new file mode 100644 index 0000000..5aa485c --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-image-canvas-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-image-canvas-pattern-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-image-canvas-pattern-expected.png new file mode 100644 index 0000000..330865d6 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-image-canvas-pattern-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-image-filter-all-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-image-filter-all-expected.png index e7f74e89..3ba8799 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-image-filter-all-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-image-filter-all-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-mask-image-svg-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-mask-image-svg-expected.png new file mode 100644 index 0000000..5f0767e --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-mask-image-svg-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-object-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-object-expected.png new file mode 100644 index 0000000..c1b95aa --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/color-profile-object-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png new file mode 100644 index 0000000..102a636d --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/cross-fade-background-size-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png index 5f6514fa..3b7bf55 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.png index 8eb3531..335aa2f1 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/imagemap-overflowing-polygon-focus-ring-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rgb-png-with-cmyk-color-profile-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rgb-png-with-cmyk-color-profile-expected.png new file mode 100644 index 0000000..85e32a7c --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/rgb-png-with-cmyk-color-profile-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/ycbcr-with-cmyk-color-profile-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/ycbcr-with-cmyk-color-profile-expected.png new file mode 100644 index 0000000..2500a7a --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/ycbcr-with-cmyk-color-profile-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/color-profile-filter-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/color-profile-filter-expected.png new file mode 100644 index 0000000..8c343f83 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/color-profile-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/color-profile-image-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/color-profile-image-expected.png new file mode 100644 index 0000000..8c94dd1 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/color-profile-image-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/color-profile-image-profile-match-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/color-profile-image-profile-match-expected.png new file mode 100644 index 0000000..a58c85a --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/color-profile-image-profile-match-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/jpeg-missing-eoi-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/jpeg-missing-eoi-expected.png new file mode 100644 index 0000000..37fcecf --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu-rasterization/images/yuv-decode-eligible/jpeg-missing-eoi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png index 777e2d0..8cd0765 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png index f80428f8..b983fd4 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png index 88cdfd65..f17d9f6 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-pattern-no-repeat-with-transformations-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-pattern-no-repeat-with-transformations-expected.png new file mode 100644 index 0000000..2ac683c --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-pattern-no-repeat-with-transformations-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-toDataURL-jpeg-maximum-quality-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-toDataURL-jpeg-maximum-quality-expected.png index ba05aa7..937cfea 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-toDataURL-jpeg-maximum-quality-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-toDataURL-jpeg-maximum-quality-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-toDataURL-webp-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-toDataURL-webp-expected.png new file mode 100644 index 0000000..84e1d7f --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/canvas-toDataURL-webp-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/image-object-in-canvas-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/image-object-in-canvas-expected.png index 9d79a4c..f69813d 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/image-object-in-canvas-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/image-object-in-canvas-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/quadraticCurveTo-expected.png b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/quadraticCurveTo-expected.png index 447862d..4c5892c 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/quadraticCurveTo-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/gpu/fast/canvas/quadraticCurveTo-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-composite-video-shadow-expected.png index 4e2f44f..eff4d3d 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-composite-video-shadow-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-composite-video-shadow-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-drawImage-video-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-drawImage-video-expected.png index f80428f8..b983fd4 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-drawImage-video-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-drawImage-video-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-drawImage-video-reset-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-drawImage-video-reset-expected.png index 88cdfd65..f17d9f6 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-drawImage-video-reset-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-drawImage-video-reset-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-circumference-fill-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-circumference-fill-expected.png new file mode 100644 index 0000000..0e9fc25 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-circumference-fill-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-incremental-repaint-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-incremental-repaint-expected.png index ba3977b..be4bcf26 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-incremental-repaint-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-incremental-repaint-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-pattern-no-repeat-with-transformations-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-pattern-no-repeat-with-transformations-expected.png new file mode 100644 index 0000000..2ac683c --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-pattern-no-repeat-with-transformations-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-text-alignment-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-text-alignment-expected.png index 9695350..9070397b 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-text-alignment-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-text-alignment-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-toDataURL-jpeg-maximum-quality-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-toDataURL-jpeg-maximum-quality-expected.png index df131d7..4ace483 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-toDataURL-jpeg-maximum-quality-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-toDataURL-jpeg-maximum-quality-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-toDataURL-webp-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-toDataURL-webp-expected.png new file mode 100644 index 0000000..b60f2531 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/canvas-toDataURL-webp-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/fillrect_gradient-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/fillrect_gradient-expected.png index 69ee1487..cc6649e 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/fillrect_gradient-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/fillrect_gradient-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/gradient-add-second-start-end-stop-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/gradient-add-second-start-end-stop-expected.png new file mode 100644 index 0000000..266c825 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/gradient-add-second-start-end-stop-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/image-object-in-canvas-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/image-object-in-canvas-expected.png index 5ab1cee8..5e7f875 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/image-object-in-canvas-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/image-object-in-canvas-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/quadraticCurveTo-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/quadraticCurveTo-expected.png index 447862d..4c5892c 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/quadraticCurveTo-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/quadraticCurveTo-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/setWidthResetAfterForcedRender-expected.png b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/setWidthResetAfterForcedRender-expected.png index f3409f24d..e965786 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/setWidthResetAfterForcedRender-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/oopr-canvas2d/fast/canvas/setWidthResetAfterForcedRender-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/plz-service-worker/external/wpt/service-workers/service-worker/getregistrations.https-expected.txt b/third_party/blink/web_tests/platform/linux/virtual/plz-service-worker/external/wpt/service-workers/service-worker/getregistrations.https-expected.txt new file mode 100644 index 0000000..e34401fc --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/plz-service-worker/external/wpt/service-workers/service-worker/getregistrations.https-expected.txt
@@ -0,0 +1,9 @@ +This is a testharness.js-based test. +PASS registrations are not returned following unregister +PASS Register then getRegistrations +PASS Register multiple times then getRegistrations +PASS Register then Unregister then getRegistrations +PASS Register then Unregister with controlled frame then getRegistrations +PASS getRegistrations promise resolves only with same origin registrations. +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/mask-with-filter-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/mask-with-filter-expected.png new file mode 100644 index 0000000..dc5e8a6 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/mask-with-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png new file mode 100644 index 0000000..0b6ee67 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/rotate-then-clip-effect-interleave-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/rotate-then-clip-effect-interleave-expected.png index 454239b..cf5e66d9 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/rotate-then-clip-effect-interleave-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/rotate-then-clip-effect-interleave-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/rotate-then-clip-z-order-interleave-expected.png b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/rotate-then-clip-z-order-interleave-expected.png new file mode 100644 index 0000000..6aa19b4 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/prefer_compositing_to_lcd_text/compositing/overflow/rotate-then-clip-z-order-interleave-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/backdrop-filter-basic-blur-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/backdrop-filter-basic-blur-expected.png new file mode 100644 index 0000000..33e1bfb --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/backdrop-filter-basic-blur-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/backdrop-filter-boundary-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/backdrop-filter-boundary-expected.png index e56e895..5dd6cee 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/backdrop-filter-boundary-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/backdrop-filter-boundary-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-all-on-background-hw-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-all-on-background-hw-expected.png new file mode 100644 index 0000000..2cad578 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-all-on-background-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-blur-hw-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-blur-hw-expected.png new file mode 100644 index 0000000..f5396e6b --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-blur-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-brightness-clamping-hw-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-brightness-clamping-hw-expected.png index 26e9b80..f495fbf 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-brightness-clamping-hw-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-brightness-clamping-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-combined-hw-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-combined-hw-expected.png index e8f25ee..7854e15 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-combined-hw-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-combined-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-colorspace-hw-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-colorspace-hw-expected.png index 9b37270..41486ec 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-colorspace-hw-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-colorspace-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-hidpi-hw-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-hidpi-hw-expected.png new file mode 100644 index 0000000..cf8e5ff --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-hidpi-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-hw-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-hw-expected.png index 934a5c5..9b5d8884 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-hw-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-ordering-hw-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-ordering-hw-expected.png new file mode 100644 index 0000000..4befff7 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-ordering-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-subregion-hw-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-subregion-hw-expected.png index ea075c8..2c641a0 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-subregion-hw-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-subregion-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-zoom-hw-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-zoom-hw-expected.png index 0465a91..c8a3cb4 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-zoom-hw-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/effect-reference-zoom-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-change-repaint-composited-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-change-repaint-composited-expected.png new file mode 100644 index 0000000..57e724c7 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-change-repaint-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-repaint-composited-fallback-crash-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-repaint-composited-fallback-crash-expected.png new file mode 100644 index 0000000..40e8bcb --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-repaint-composited-fallback-crash-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-repaint-composited-fallback-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-repaint-composited-fallback-expected.png new file mode 100644 index 0000000..40e8bcb --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/css3/filters/filter-repaint-composited-fallback-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/pixelated-expected.png b/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/pixelated-expected.png new file mode 100644 index 0000000..705007f --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/pixelated-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-expected.png b/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-expected.png new file mode 100644 index 0000000..5dc0380 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-repaint-expected.png b/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-repaint-expected.png new file mode 100644 index 0000000..792831ce --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-repaint-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-tabswitching-expected.png b/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-tabswitching-expected.png new file mode 100644 index 0000000..de1806345 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-tabswitching-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/color-profile-video-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/color-profile-video-expected.png new file mode 100644 index 0000000..110e5c5 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/color-profile-video-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/color-profile-video-seek-filter-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/color-profile-video-seek-filter-expected.png index 616836b..c1490d7 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/color-profile-video-seek-filter-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/color-profile-video-seek-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-after-reload-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-after-reload-expected.png new file mode 100644 index 0000000..3872a4a --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-after-reload-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-strict-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-strict-expected.png new file mode 100644 index 0000000..e79094e --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-strict-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-styling-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-styling-expected.png new file mode 100644 index 0000000..aae08301 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-styling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-styling-strict-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-styling-strict-expected.png new file mode 100644 index 0000000..3b0ed46 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-styling-strict-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-without-preload-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-without-preload-expected.png new file mode 100644 index 0000000..856c532 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls-without-preload-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls/paint-controls-webkit-appearance-none-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls/paint-controls-webkit-appearance-none-expected.png new file mode 100644 index 0000000..eac24bb --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/controls/paint-controls-webkit-appearance-none-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-canvas-alpha-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-canvas-alpha-expected.png new file mode 100644 index 0000000..73833681 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-canvas-alpha-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-controls-rendering-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-controls-rendering-expected.png new file mode 100644 index 0000000..65b8e6f --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-controls-rendering-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-display-toggle-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-display-toggle-expected.png new file mode 100644 index 0000000..ad71ea8a --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-display-toggle-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-no-audio-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-no-audio-expected.png new file mode 100644 index 0000000..3d197ff --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-no-audio-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-replaces-poster-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-replaces-poster-expected.png new file mode 100644 index 0000000..c3c0c82 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-replaces-poster-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-zoom-controls-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-zoom-controls-expected.png new file mode 100644 index 0000000..e92f329c --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-zoom-controls-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-zoom-expected.png b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-zoom-expected.png new file mode 100644 index 0000000..477cf2e --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/synchronous_html_parser/media/video-zoom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/threaded/compositing/visibility/visibility-simple-video-layer-expected.png b/third_party/blink/web_tests/platform/linux/virtual/threaded/compositing/visibility/visibility-simple-video-layer-expected.png new file mode 100644 index 0000000..843dbae --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/threaded/compositing/visibility/visibility-simple-video-layer-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/threaded/compositing/webgl/webgl-reflection-expected.png b/third_party/blink/web_tests/platform/linux/virtual/threaded/compositing/webgl/webgl-reflection-expected.png index 4ed823a0..53dfc582 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/threaded/compositing/webgl/webgl-reflection-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/threaded/compositing/webgl/webgl-reflection-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/geometry/vertical-scroll-composited-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/geometry/vertical-scroll-composited-expected.png new file mode 100644 index 0000000..4245cef0 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/geometry/vertical-scroll-composited-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/geometry/video-fixed-scrolling-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/geometry/video-fixed-scrolling-expected.png new file mode 100644 index 0000000..c477ea7 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/geometry/video-fixed-scrolling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/geometry/video-opacity-overlay-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/geometry/video-opacity-overlay-expected.png new file mode 100644 index 0000000..7094fc9e --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/geometry/video-opacity-overlay-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/mask-with-filter-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/mask-with-filter-expected.png new file mode 100644 index 0000000..dc5e8a6 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/mask-with-filter-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/nested-render-surfaces-with-rotation-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/nested-render-surfaces-with-rotation-expected.png new file mode 100644 index 0000000..d90afb61 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/nested-render-surfaces-with-rotation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/rotate-then-clip-effect-interleave-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/rotate-then-clip-effect-interleave-expected.png new file mode 100644 index 0000000..cf5e66d9 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/rotate-then-clip-effect-interleave-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/rotate-then-clip-z-order-interleave-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/rotate-then-clip-z-order-interleave-expected.png new file mode 100644 index 0000000..6aa19b4 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/compositing/overflow/rotate-then-clip-z-order-interleave-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/general/perspective-units-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/general/perspective-units-expected.png new file mode 100644 index 0000000..af67e96c --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/general/perspective-units-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/point-mapping/3d-point-mapping-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/point-mapping/3d-point-mapping-expected.png new file mode 100644 index 0000000..5910e00d --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/point-mapping/3d-point-mapping-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png new file mode 100644 index 0000000..cf4a959 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/point-mapping/3d-point-mapping-origins-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png new file mode 100644 index 0000000..72a5871 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/transform-interop/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/css/mediaqueries/test_media_queries-expected.txt b/third_party/blink/web_tests/platform/mac-mac-arm11.0/external/wpt/css/mediaqueries/test_media_queries-expected.txt similarity index 100% rename from third_party/blink/web_tests/external/wpt/css/mediaqueries/test_media_queries-expected.txt rename to third_party/blink/web_tests/platform/mac-mac-arm11.0/external/wpt/css/mediaqueries/test_media_queries-expected.txt
diff --git a/third_party/blink/web_tests/platform/mac-mac-arm11.0/tables/mozilla/bugs/bug137388-2-expected.png b/third_party/blink/web_tests/platform/mac-mac-arm11.0/tables/mozilla/bugs/bug137388-2-expected.png new file mode 100644 index 0000000..c83c11bd --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac-arm11.0/tables/mozilla/bugs/bug137388-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/fetch/api/idlharness.any.sharedworker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/fetch/api/idlharness.any.sharedworker-expected.txt new file mode 100644 index 0000000..3a6843f --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/fetch/api/idlharness.any.sharedworker-expected.txt
@@ -0,0 +1,142 @@ +This is a testharness.js-based test. +Found 138 tests; 136 PASS, 2 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface mixin WindowOrWorkerGlobalScope: original interface mixin defined +PASS Partial interface mixin WindowOrWorkerGlobalScope: member names are unique +PASS Partial interface Window: member names are unique +PASS Request includes Body: member names are unique +PASS Response includes Body: member names are unique +PASS Window includes GlobalEventHandlers: member names are unique +PASS Window includes WindowEventHandlers: member names are unique +PASS Window includes WindowOrWorkerGlobalScope: member names are unique +PASS WorkerGlobalScope includes WindowOrWorkerGlobalScope: member names are unique +PASS Window includes AnimationFrameProvider: member names are unique +PASS Window includes WindowSessionStorage: member names are unique +PASS Window includes WindowLocalStorage: member names are unique +PASS Headers interface: existence and properties of interface object +PASS Headers interface object length +PASS Headers interface object name +PASS Headers interface: existence and properties of interface prototype object +PASS Headers interface: existence and properties of interface prototype object's "constructor" property +PASS Headers interface: existence and properties of interface prototype object's @@unscopables property +PASS Headers interface: operation append(ByteString, ByteString) +PASS Headers interface: operation delete(ByteString) +PASS Headers interface: operation get(ByteString) +PASS Headers interface: operation has(ByteString) +PASS Headers interface: operation set(ByteString, ByteString) +PASS Headers interface: iterable<ByteString, ByteString> +PASS Headers must be primary interface of new Headers() +PASS Stringification of new Headers() +PASS Headers interface: new Headers() must inherit property "append(ByteString, ByteString)" with the proper type +PASS Headers interface: calling append(ByteString, ByteString) on new Headers() with too few arguments must throw TypeError +PASS Headers interface: new Headers() must inherit property "delete(ByteString)" with the proper type +PASS Headers interface: calling delete(ByteString) on new Headers() with too few arguments must throw TypeError +PASS Headers interface: new Headers() must inherit property "get(ByteString)" with the proper type +PASS Headers interface: calling get(ByteString) on new Headers() with too few arguments must throw TypeError +PASS Headers interface: new Headers() must inherit property "has(ByteString)" with the proper type +PASS Headers interface: calling has(ByteString) on new Headers() with too few arguments must throw TypeError +PASS Headers interface: new Headers() must inherit property "set(ByteString, ByteString)" with the proper type +PASS Headers interface: calling set(ByteString, ByteString) on new Headers() with too few arguments must throw TypeError +PASS Request interface: existence and properties of interface object +PASS Request interface object length +PASS Request interface object name +PASS Request interface: existence and properties of interface prototype object +PASS Request interface: existence and properties of interface prototype object's "constructor" property +PASS Request interface: existence and properties of interface prototype object's @@unscopables property +PASS Request interface: attribute method +PASS Request interface: attribute url +PASS Request interface: attribute headers +PASS Request interface: attribute destination +PASS Request interface: attribute referrer +PASS Request interface: attribute referrerPolicy +PASS Request interface: attribute mode +PASS Request interface: attribute credentials +PASS Request interface: attribute cache +PASS Request interface: attribute redirect +PASS Request interface: attribute integrity +PASS Request interface: attribute keepalive +FAIL Request interface: attribute isReloadNavigation assert_true: The prototype object must have a property "isReloadNavigation" expected true got false +PASS Request interface: attribute isHistoryNavigation +PASS Request interface: attribute signal +PASS Request interface: operation clone() +PASS Request interface: attribute body +PASS Request interface: attribute bodyUsed +PASS Request interface: operation arrayBuffer() +PASS Request interface: operation blob() +PASS Request interface: operation formData() +PASS Request interface: operation json() +PASS Request interface: operation text() +PASS Request must be primary interface of new Request('about:blank') +PASS Stringification of new Request('about:blank') +PASS Request interface: new Request('about:blank') must inherit property "method" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "url" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "headers" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "destination" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "referrer" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "referrerPolicy" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "mode" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "credentials" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "cache" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "redirect" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "integrity" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "keepalive" with the proper type +FAIL Request interface: new Request('about:blank') must inherit property "isReloadNavigation" with the proper type assert_inherits: property "isReloadNavigation" not found in prototype chain +PASS Request interface: new Request('about:blank') must inherit property "isHistoryNavigation" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "signal" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "clone()" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "body" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "bodyUsed" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "arrayBuffer()" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "blob()" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "formData()" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "json()" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "text()" with the proper type +PASS Response interface: existence and properties of interface object +PASS Response interface object length +PASS Response interface object name +PASS Response interface: existence and properties of interface prototype object +PASS Response interface: existence and properties of interface prototype object's "constructor" property +PASS Response interface: existence and properties of interface prototype object's @@unscopables property +PASS Response interface: operation error() +PASS Response interface: operation redirect(USVString, optional unsigned short) +PASS Response interface: attribute type +PASS Response interface: attribute url +PASS Response interface: attribute redirected +PASS Response interface: attribute status +PASS Response interface: attribute ok +PASS Response interface: attribute statusText +PASS Response interface: attribute headers +PASS Response interface: operation clone() +PASS Response interface: attribute body +PASS Response interface: attribute bodyUsed +PASS Response interface: operation arrayBuffer() +PASS Response interface: operation blob() +PASS Response interface: operation formData() +PASS Response interface: operation json() +PASS Response interface: operation text() +PASS Response must be primary interface of new Response() +PASS Stringification of new Response() +PASS Response interface: new Response() must inherit property "error()" with the proper type +PASS Response interface: new Response() must inherit property "redirect(USVString, optional unsigned short)" with the proper type +PASS Response interface: calling redirect(USVString, optional unsigned short) on new Response() with too few arguments must throw TypeError +PASS Response interface: new Response() must inherit property "type" with the proper type +PASS Response interface: new Response() must inherit property "url" with the proper type +PASS Response interface: new Response() must inherit property "redirected" with the proper type +PASS Response interface: new Response() must inherit property "status" with the proper type +PASS Response interface: new Response() must inherit property "ok" with the proper type +PASS Response interface: new Response() must inherit property "statusText" with the proper type +PASS Response interface: new Response() must inherit property "headers" with the proper type +PASS Response interface: new Response() must inherit property "clone()" with the proper type +PASS Response interface: new Response() must inherit property "body" with the proper type +PASS Response interface: new Response() must inherit property "bodyUsed" with the proper type +PASS Response interface: new Response() must inherit property "arrayBuffer()" with the proper type +PASS Response interface: new Response() must inherit property "blob()" with the proper type +PASS Response interface: new Response() must inherit property "formData()" with the proper type +PASS Response interface: new Response() must inherit property "json()" with the proper type +PASS Response interface: new Response() must inherit property "text()" with the proper type +PASS WorkerGlobalScope interface: operation fetch(RequestInfo, optional RequestInit) +PASS WorkerGlobalScope interface: self must inherit property "fetch(RequestInfo, optional RequestInit)" with the proper type +PASS WorkerGlobalScope interface: calling fetch(RequestInfo, optional RequestInit) on self with too few arguments must throw TypeError +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/gamepad/idlharness.https.window-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/gamepad/idlharness.https.window-expected.txt new file mode 100644 index 0000000..1d8a0ea4 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/gamepad/idlharness.https.window-expected.txt
@@ -0,0 +1,77 @@ +This is a testharness.js-based test. +Found 73 tests; 66 PASS, 7 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface Navigator: original interface defined +PASS Partial interface Navigator: valid exposure set +PASS Partial interface Navigator: member names are unique +PASS Partial interface mixin WindowEventHandlers: original interface mixin defined +PASS Partial interface mixin WindowEventHandlers: member names are unique +PASS Partial interface mixin NavigatorID: member names are unique +PASS Partial interface HTMLBodyElement: member names are unique +PASS Partial interface Window: member names are unique +PASS HTMLElement includes GlobalEventHandlers: member names are unique +PASS HTMLElement includes DocumentAndElementEventHandlers: member names are unique +PASS HTMLElement includes ElementContentEditable: member names are unique +PASS HTMLElement includes HTMLOrSVGElement: member names are unique +PASS HTMLBodyElement includes WindowEventHandlers: member names are unique +PASS Window includes GlobalEventHandlers: member names are unique +PASS Window includes WindowEventHandlers: member names are unique +PASS Window includes WindowOrWorkerGlobalScope: member names are unique +PASS Navigator includes NavigatorID: member names are unique +PASS Navigator includes NavigatorLanguage: member names are unique +PASS Navigator includes NavigatorOnLine: member names are unique +PASS Navigator includes NavigatorContentUtils: member names are unique +PASS Navigator includes NavigatorCookies: member names are unique +PASS Navigator includes NavigatorPlugins: member names are unique +PASS Navigator includes NavigatorConcurrentHardware: member names are unique +PASS Window includes AnimationFrameProvider: member names are unique +PASS Window includes WindowSessionStorage: member names are unique +PASS Window includes WindowLocalStorage: member names are unique +PASS HTMLFrameSetElement includes WindowEventHandlers: member names are unique +PASS Element includes ParentNode: member names are unique +PASS Element includes NonDocumentTypeChildNode: member names are unique +PASS Element includes ChildNode: member names are unique +PASS Element includes Slottable: member names are unique +PASS Gamepad interface: existence and properties of interface object +PASS Gamepad interface object length +PASS Gamepad interface object name +PASS Gamepad interface: existence and properties of interface prototype object +PASS Gamepad interface: existence and properties of interface prototype object's "constructor" property +PASS Gamepad interface: existence and properties of interface prototype object's @@unscopables property +PASS Gamepad interface: attribute id +PASS Gamepad interface: attribute index +PASS Gamepad interface: attribute connected +PASS Gamepad interface: attribute timestamp +PASS Gamepad interface: attribute mapping +PASS Gamepad interface: attribute axes +PASS Gamepad interface: attribute buttons +PASS GamepadButton interface: existence and properties of interface object +PASS GamepadButton interface object length +PASS GamepadButton interface object name +PASS GamepadButton interface: existence and properties of interface prototype object +PASS GamepadButton interface: existence and properties of interface prototype object's "constructor" property +PASS GamepadButton interface: existence and properties of interface prototype object's @@unscopables property +PASS GamepadButton interface: attribute pressed +PASS GamepadButton interface: attribute touched +PASS GamepadButton interface: attribute value +PASS GamepadEvent interface: existence and properties of interface object +FAIL GamepadEvent interface object length assert_equals: wrong value for GamepadEvent.length expected 2 but got 1 +PASS GamepadEvent interface object name +PASS GamepadEvent interface: existence and properties of interface prototype object +PASS GamepadEvent interface: existence and properties of interface prototype object's "constructor" property +PASS GamepadEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS GamepadEvent interface: attribute gamepad +PASS GamepadEvent must be primary interface of new GamepadEvent("gamepad") +PASS Stringification of new GamepadEvent("gamepad") +PASS GamepadEvent interface: new GamepadEvent("gamepad") must inherit property "gamepad" with the proper type +FAIL HTMLBodyElement interface: attribute ongamepadconnected assert_true: The prototype object must have a property "ongamepadconnected" expected true got false +FAIL HTMLBodyElement interface: attribute ongamepaddisconnected assert_true: The prototype object must have a property "ongamepaddisconnected" expected true got false +FAIL Window interface: attribute ongamepadconnected assert_own_property: The global object must have a property "ongamepadconnected" expected property "ongamepadconnected" missing +FAIL Window interface: attribute ongamepaddisconnected assert_own_property: The global object must have a property "ongamepaddisconnected" expected property "ongamepaddisconnected" missing +PASS Navigator interface: operation getGamepads() +PASS Navigator interface: navigator must inherit property "getGamepads()" with the proper type +FAIL HTMLFrameSetElement interface: attribute ongamepadconnected assert_true: The prototype object must have a property "ongamepadconnected" expected true got false +FAIL HTMLFrameSetElement interface: attribute ongamepaddisconnected assert_true: The prototype object must have a property "ongamepaddisconnected" expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/storage/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/storage/idlharness.https.any.worker-expected.txt new file mode 100644 index 0000000..ea67f14d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.12/external/wpt/storage/idlharness.https.any.worker-expected.txt
@@ -0,0 +1,35 @@ +This is a testharness.js-based test. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface mixin NavigatorID: member names are unique +PASS Navigator includes NavigatorStorage: member names are unique +PASS WorkerNavigator includes NavigatorStorage: member names are unique +PASS Navigator includes NavigatorID: member names are unique +PASS Navigator includes NavigatorLanguage: member names are unique +PASS Navigator includes NavigatorOnLine: member names are unique +PASS Navigator includes NavigatorContentUtils: member names are unique +PASS Navigator includes NavigatorCookies: member names are unique +PASS Navigator includes NavigatorPlugins: member names are unique +PASS Navigator includes NavigatorConcurrentHardware: member names are unique +PASS WorkerNavigator includes NavigatorID: member names are unique +PASS WorkerNavigator includes NavigatorLanguage: member names are unique +PASS WorkerNavigator includes NavigatorOnLine: member names are unique +PASS WorkerNavigator includes NavigatorConcurrentHardware: member names are unique +FAIL StorageManager interface: existence and properties of interface object assert_equals: prototype of self's property "StorageManager" is not Function.prototype expected function "function () { [native code] }" but got function "function EventTarget() { [native code] }" +PASS StorageManager interface object length +PASS StorageManager interface object name +FAIL StorageManager interface: existence and properties of interface prototype object assert_equals: prototype of StorageManager.prototype is not Object.prototype expected object "[object Object]" but got object "[object EventTarget]" +PASS StorageManager interface: existence and properties of interface prototype object's "constructor" property +PASS StorageManager interface: existence and properties of interface prototype object's @@unscopables property +PASS StorageManager interface: operation persisted() +PASS StorageManager interface: member persist +PASS StorageManager interface: operation estimate() +PASS StorageManager must be primary interface of navigator.storage +PASS Stringification of navigator.storage +PASS StorageManager interface: navigator.storage must inherit property "persisted()" with the proper type +PASS StorageManager interface: navigator.storage must not have property "persist" +PASS StorageManager interface: navigator.storage must inherit property "estimate()" with the proper type +PASS WorkerNavigator interface: attribute storage +PASS WorkerNavigator interface: navigator must inherit property "storage" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png deleted file mode 100644 index 81e5ecf..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png deleted file mode 100644 index 5f36585..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/gpu/fast/canvas/image-object-in-canvas-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/gpu/fast/canvas/image-object-in-canvas-expected.png deleted file mode 100644 index 9f680a3..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/gpu/fast/canvas/image-object-in-canvas-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/fetch/api/idlharness.any.sharedworker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/fetch/api/idlharness.any.sharedworker-expected.txt new file mode 100644 index 0000000..3a6843f --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/fetch/api/idlharness.any.sharedworker-expected.txt
@@ -0,0 +1,142 @@ +This is a testharness.js-based test. +Found 138 tests; 136 PASS, 2 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface mixin WindowOrWorkerGlobalScope: original interface mixin defined +PASS Partial interface mixin WindowOrWorkerGlobalScope: member names are unique +PASS Partial interface Window: member names are unique +PASS Request includes Body: member names are unique +PASS Response includes Body: member names are unique +PASS Window includes GlobalEventHandlers: member names are unique +PASS Window includes WindowEventHandlers: member names are unique +PASS Window includes WindowOrWorkerGlobalScope: member names are unique +PASS WorkerGlobalScope includes WindowOrWorkerGlobalScope: member names are unique +PASS Window includes AnimationFrameProvider: member names are unique +PASS Window includes WindowSessionStorage: member names are unique +PASS Window includes WindowLocalStorage: member names are unique +PASS Headers interface: existence and properties of interface object +PASS Headers interface object length +PASS Headers interface object name +PASS Headers interface: existence and properties of interface prototype object +PASS Headers interface: existence and properties of interface prototype object's "constructor" property +PASS Headers interface: existence and properties of interface prototype object's @@unscopables property +PASS Headers interface: operation append(ByteString, ByteString) +PASS Headers interface: operation delete(ByteString) +PASS Headers interface: operation get(ByteString) +PASS Headers interface: operation has(ByteString) +PASS Headers interface: operation set(ByteString, ByteString) +PASS Headers interface: iterable<ByteString, ByteString> +PASS Headers must be primary interface of new Headers() +PASS Stringification of new Headers() +PASS Headers interface: new Headers() must inherit property "append(ByteString, ByteString)" with the proper type +PASS Headers interface: calling append(ByteString, ByteString) on new Headers() with too few arguments must throw TypeError +PASS Headers interface: new Headers() must inherit property "delete(ByteString)" with the proper type +PASS Headers interface: calling delete(ByteString) on new Headers() with too few arguments must throw TypeError +PASS Headers interface: new Headers() must inherit property "get(ByteString)" with the proper type +PASS Headers interface: calling get(ByteString) on new Headers() with too few arguments must throw TypeError +PASS Headers interface: new Headers() must inherit property "has(ByteString)" with the proper type +PASS Headers interface: calling has(ByteString) on new Headers() with too few arguments must throw TypeError +PASS Headers interface: new Headers() must inherit property "set(ByteString, ByteString)" with the proper type +PASS Headers interface: calling set(ByteString, ByteString) on new Headers() with too few arguments must throw TypeError +PASS Request interface: existence and properties of interface object +PASS Request interface object length +PASS Request interface object name +PASS Request interface: existence and properties of interface prototype object +PASS Request interface: existence and properties of interface prototype object's "constructor" property +PASS Request interface: existence and properties of interface prototype object's @@unscopables property +PASS Request interface: attribute method +PASS Request interface: attribute url +PASS Request interface: attribute headers +PASS Request interface: attribute destination +PASS Request interface: attribute referrer +PASS Request interface: attribute referrerPolicy +PASS Request interface: attribute mode +PASS Request interface: attribute credentials +PASS Request interface: attribute cache +PASS Request interface: attribute redirect +PASS Request interface: attribute integrity +PASS Request interface: attribute keepalive +FAIL Request interface: attribute isReloadNavigation assert_true: The prototype object must have a property "isReloadNavigation" expected true got false +PASS Request interface: attribute isHistoryNavigation +PASS Request interface: attribute signal +PASS Request interface: operation clone() +PASS Request interface: attribute body +PASS Request interface: attribute bodyUsed +PASS Request interface: operation arrayBuffer() +PASS Request interface: operation blob() +PASS Request interface: operation formData() +PASS Request interface: operation json() +PASS Request interface: operation text() +PASS Request must be primary interface of new Request('about:blank') +PASS Stringification of new Request('about:blank') +PASS Request interface: new Request('about:blank') must inherit property "method" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "url" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "headers" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "destination" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "referrer" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "referrerPolicy" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "mode" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "credentials" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "cache" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "redirect" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "integrity" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "keepalive" with the proper type +FAIL Request interface: new Request('about:blank') must inherit property "isReloadNavigation" with the proper type assert_inherits: property "isReloadNavigation" not found in prototype chain +PASS Request interface: new Request('about:blank') must inherit property "isHistoryNavigation" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "signal" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "clone()" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "body" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "bodyUsed" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "arrayBuffer()" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "blob()" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "formData()" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "json()" with the proper type +PASS Request interface: new Request('about:blank') must inherit property "text()" with the proper type +PASS Response interface: existence and properties of interface object +PASS Response interface object length +PASS Response interface object name +PASS Response interface: existence and properties of interface prototype object +PASS Response interface: existence and properties of interface prototype object's "constructor" property +PASS Response interface: existence and properties of interface prototype object's @@unscopables property +PASS Response interface: operation error() +PASS Response interface: operation redirect(USVString, optional unsigned short) +PASS Response interface: attribute type +PASS Response interface: attribute url +PASS Response interface: attribute redirected +PASS Response interface: attribute status +PASS Response interface: attribute ok +PASS Response interface: attribute statusText +PASS Response interface: attribute headers +PASS Response interface: operation clone() +PASS Response interface: attribute body +PASS Response interface: attribute bodyUsed +PASS Response interface: operation arrayBuffer() +PASS Response interface: operation blob() +PASS Response interface: operation formData() +PASS Response interface: operation json() +PASS Response interface: operation text() +PASS Response must be primary interface of new Response() +PASS Stringification of new Response() +PASS Response interface: new Response() must inherit property "error()" with the proper type +PASS Response interface: new Response() must inherit property "redirect(USVString, optional unsigned short)" with the proper type +PASS Response interface: calling redirect(USVString, optional unsigned short) on new Response() with too few arguments must throw TypeError +PASS Response interface: new Response() must inherit property "type" with the proper type +PASS Response interface: new Response() must inherit property "url" with the proper type +PASS Response interface: new Response() must inherit property "redirected" with the proper type +PASS Response interface: new Response() must inherit property "status" with the proper type +PASS Response interface: new Response() must inherit property "ok" with the proper type +PASS Response interface: new Response() must inherit property "statusText" with the proper type +PASS Response interface: new Response() must inherit property "headers" with the proper type +PASS Response interface: new Response() must inherit property "clone()" with the proper type +PASS Response interface: new Response() must inherit property "body" with the proper type +PASS Response interface: new Response() must inherit property "bodyUsed" with the proper type +PASS Response interface: new Response() must inherit property "arrayBuffer()" with the proper type +PASS Response interface: new Response() must inherit property "blob()" with the proper type +PASS Response interface: new Response() must inherit property "formData()" with the proper type +PASS Response interface: new Response() must inherit property "json()" with the proper type +PASS Response interface: new Response() must inherit property "text()" with the proper type +PASS WorkerGlobalScope interface: operation fetch(RequestInfo, optional RequestInit) +PASS WorkerGlobalScope interface: self must inherit property "fetch(RequestInfo, optional RequestInit)" with the proper type +PASS WorkerGlobalScope interface: calling fetch(RequestInfo, optional RequestInit) on self with too few arguments must throw TypeError +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/gamepad/idlharness.https.window-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/gamepad/idlharness.https.window-expected.txt new file mode 100644 index 0000000..1d8a0ea4 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/gamepad/idlharness.https.window-expected.txt
@@ -0,0 +1,77 @@ +This is a testharness.js-based test. +Found 73 tests; 66 PASS, 7 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface Navigator: original interface defined +PASS Partial interface Navigator: valid exposure set +PASS Partial interface Navigator: member names are unique +PASS Partial interface mixin WindowEventHandlers: original interface mixin defined +PASS Partial interface mixin WindowEventHandlers: member names are unique +PASS Partial interface mixin NavigatorID: member names are unique +PASS Partial interface HTMLBodyElement: member names are unique +PASS Partial interface Window: member names are unique +PASS HTMLElement includes GlobalEventHandlers: member names are unique +PASS HTMLElement includes DocumentAndElementEventHandlers: member names are unique +PASS HTMLElement includes ElementContentEditable: member names are unique +PASS HTMLElement includes HTMLOrSVGElement: member names are unique +PASS HTMLBodyElement includes WindowEventHandlers: member names are unique +PASS Window includes GlobalEventHandlers: member names are unique +PASS Window includes WindowEventHandlers: member names are unique +PASS Window includes WindowOrWorkerGlobalScope: member names are unique +PASS Navigator includes NavigatorID: member names are unique +PASS Navigator includes NavigatorLanguage: member names are unique +PASS Navigator includes NavigatorOnLine: member names are unique +PASS Navigator includes NavigatorContentUtils: member names are unique +PASS Navigator includes NavigatorCookies: member names are unique +PASS Navigator includes NavigatorPlugins: member names are unique +PASS Navigator includes NavigatorConcurrentHardware: member names are unique +PASS Window includes AnimationFrameProvider: member names are unique +PASS Window includes WindowSessionStorage: member names are unique +PASS Window includes WindowLocalStorage: member names are unique +PASS HTMLFrameSetElement includes WindowEventHandlers: member names are unique +PASS Element includes ParentNode: member names are unique +PASS Element includes NonDocumentTypeChildNode: member names are unique +PASS Element includes ChildNode: member names are unique +PASS Element includes Slottable: member names are unique +PASS Gamepad interface: existence and properties of interface object +PASS Gamepad interface object length +PASS Gamepad interface object name +PASS Gamepad interface: existence and properties of interface prototype object +PASS Gamepad interface: existence and properties of interface prototype object's "constructor" property +PASS Gamepad interface: existence and properties of interface prototype object's @@unscopables property +PASS Gamepad interface: attribute id +PASS Gamepad interface: attribute index +PASS Gamepad interface: attribute connected +PASS Gamepad interface: attribute timestamp +PASS Gamepad interface: attribute mapping +PASS Gamepad interface: attribute axes +PASS Gamepad interface: attribute buttons +PASS GamepadButton interface: existence and properties of interface object +PASS GamepadButton interface object length +PASS GamepadButton interface object name +PASS GamepadButton interface: existence and properties of interface prototype object +PASS GamepadButton interface: existence and properties of interface prototype object's "constructor" property +PASS GamepadButton interface: existence and properties of interface prototype object's @@unscopables property +PASS GamepadButton interface: attribute pressed +PASS GamepadButton interface: attribute touched +PASS GamepadButton interface: attribute value +PASS GamepadEvent interface: existence and properties of interface object +FAIL GamepadEvent interface object length assert_equals: wrong value for GamepadEvent.length expected 2 but got 1 +PASS GamepadEvent interface object name +PASS GamepadEvent interface: existence and properties of interface prototype object +PASS GamepadEvent interface: existence and properties of interface prototype object's "constructor" property +PASS GamepadEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS GamepadEvent interface: attribute gamepad +PASS GamepadEvent must be primary interface of new GamepadEvent("gamepad") +PASS Stringification of new GamepadEvent("gamepad") +PASS GamepadEvent interface: new GamepadEvent("gamepad") must inherit property "gamepad" with the proper type +FAIL HTMLBodyElement interface: attribute ongamepadconnected assert_true: The prototype object must have a property "ongamepadconnected" expected true got false +FAIL HTMLBodyElement interface: attribute ongamepaddisconnected assert_true: The prototype object must have a property "ongamepaddisconnected" expected true got false +FAIL Window interface: attribute ongamepadconnected assert_own_property: The global object must have a property "ongamepadconnected" expected property "ongamepadconnected" missing +FAIL Window interface: attribute ongamepaddisconnected assert_own_property: The global object must have a property "ongamepaddisconnected" expected property "ongamepaddisconnected" missing +PASS Navigator interface: operation getGamepads() +PASS Navigator interface: navigator must inherit property "getGamepads()" with the proper type +FAIL HTMLFrameSetElement interface: attribute ongamepadconnected assert_true: The prototype object must have a property "ongamepadconnected" expected true got false +FAIL HTMLFrameSetElement interface: attribute ongamepaddisconnected assert_true: The prototype object must have a property "ongamepaddisconnected" expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/input-device-capabilities/idlharness.window-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/input-device-capabilities/idlharness.window-expected.txt new file mode 100644 index 0000000..a164b00 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/input-device-capabilities/idlharness.window-expected.txt
@@ -0,0 +1,25 @@ +This is a testharness.js-based test. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface UIEvent: original interface defined +PASS Partial interface UIEvent: member names are unique +PASS Partial dictionary UIEventInit: original dictionary defined +PASS Partial dictionary UIEventInit: member names are unique +PASS Partial interface UIEvent[2]: member names are unique +PASS Partial interface UIEvent[3]: member names are unique +PASS Partial dictionary UIEventInit[2]: member names are unique +PASS InputDeviceCapabilities interface: existence and properties of interface object +PASS InputDeviceCapabilities interface object length +PASS InputDeviceCapabilities interface object name +PASS InputDeviceCapabilities interface: existence and properties of interface prototype object +PASS InputDeviceCapabilities interface: existence and properties of interface prototype object's "constructor" property +PASS InputDeviceCapabilities interface: existence and properties of interface prototype object's @@unscopables property +PASS InputDeviceCapabilities interface: attribute firesTouchEvents +FAIL InputDeviceCapabilities interface: attribute pointerMovementScrolls assert_true: The prototype object must have a property "pointerMovementScrolls" expected true got false +PASS InputDeviceCapabilities must be primary interface of new InputDeviceCapabilities +PASS Stringification of new InputDeviceCapabilities +PASS InputDeviceCapabilities interface: new InputDeviceCapabilities must inherit property "firesTouchEvents" with the proper type +FAIL InputDeviceCapabilities interface: new InputDeviceCapabilities must inherit property "pointerMovementScrolls" with the proper type assert_inherits: property "pointerMovementScrolls" not found in prototype chain +PASS UIEvent interface: attribute sourceCapabilities +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/periodic-background-sync/idlharness.https.any-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/periodic-background-sync/idlharness.https.any-expected.txt new file mode 100644 index 0000000..edc336c --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/periodic-background-sync/idlharness.https.any-expected.txt
@@ -0,0 +1,36 @@ +This is a testharness.js-based test. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface ServiceWorkerGlobalScope: original interface defined +PASS Partial interface ServiceWorkerGlobalScope: member names are unique +PASS Partial interface ServiceWorkerRegistration: original interface defined +PASS Partial interface ServiceWorkerRegistration: valid exposure set +PASS Partial interface ServiceWorkerRegistration: member names are unique +PASS WorkerGlobalScope includes WindowOrWorkerGlobalScope: member names are unique +PASS PeriodicSyncManager interface: existence and properties of interface object +PASS PeriodicSyncManager interface object length +PASS PeriodicSyncManager interface object name +PASS PeriodicSyncManager interface: existence and properties of interface prototype object +PASS PeriodicSyncManager interface: existence and properties of interface prototype object's "constructor" property +PASS PeriodicSyncManager interface: existence and properties of interface prototype object's @@unscopables property +PASS PeriodicSyncManager interface: operation register(DOMString, optional BackgroundSyncOptions) +PASS PeriodicSyncManager interface: operation getTags() +PASS PeriodicSyncManager interface: operation unregister(DOMString) +FAIL PeriodicSyncManager must be primary interface of registration.periodicSync assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: registration is not defined" +FAIL Stringification of registration.periodicSync assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: registration is not defined" +FAIL PeriodicSyncManager interface: registration.periodicSync must inherit property "register(DOMString, optional BackgroundSyncOptions)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: registration is not defined" +FAIL PeriodicSyncManager interface: calling register(DOMString, optional BackgroundSyncOptions) on registration.periodicSync with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: registration is not defined" +FAIL PeriodicSyncManager interface: registration.periodicSync must inherit property "getTags()" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: registration is not defined" +FAIL PeriodicSyncManager interface: registration.periodicSync must inherit property "unregister(DOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: registration is not defined" +FAIL PeriodicSyncManager interface: calling unregister(DOMString) on registration.periodicSync with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: registration is not defined" +PASS PeriodicSyncEvent interface: existence and properties of interface object +FAIL PeriodicSyncEvent must be primary interface of new PeriodicSyncEvent("tag") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: PeriodicSyncEvent is not defined" +FAIL Stringification of new PeriodicSyncEvent("tag") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: PeriodicSyncEvent is not defined" +FAIL PeriodicSyncEvent interface: new PeriodicSyncEvent("tag") must not have property "undefined" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: PeriodicSyncEvent is not defined" +FAIL PeriodicSyncEvent interface: new PeriodicSyncEvent("tag") must not have property "tag" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: PeriodicSyncEvent is not defined" +PASS ServiceWorkerRegistration interface: attribute periodicSync +FAIL ServiceWorkerRegistration interface: registration must inherit property "periodicSync" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: registration is not defined" +PASS ServiceWorkerGlobalScope interface: self must not have property "onperiodicsync" +FAIL ServiceWorkerGlobalScope interface: onperiodicsync must not have property "onperiodicsync" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: onperiodicsync is not defined" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/storage/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/storage/idlharness.https.any.worker-expected.txt new file mode 100644 index 0000000..ea67f14d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/storage/idlharness.https.any.worker-expected.txt
@@ -0,0 +1,35 @@ +This is a testharness.js-based test. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface mixin NavigatorID: member names are unique +PASS Navigator includes NavigatorStorage: member names are unique +PASS WorkerNavigator includes NavigatorStorage: member names are unique +PASS Navigator includes NavigatorID: member names are unique +PASS Navigator includes NavigatorLanguage: member names are unique +PASS Navigator includes NavigatorOnLine: member names are unique +PASS Navigator includes NavigatorContentUtils: member names are unique +PASS Navigator includes NavigatorCookies: member names are unique +PASS Navigator includes NavigatorPlugins: member names are unique +PASS Navigator includes NavigatorConcurrentHardware: member names are unique +PASS WorkerNavigator includes NavigatorID: member names are unique +PASS WorkerNavigator includes NavigatorLanguage: member names are unique +PASS WorkerNavigator includes NavigatorOnLine: member names are unique +PASS WorkerNavigator includes NavigatorConcurrentHardware: member names are unique +FAIL StorageManager interface: existence and properties of interface object assert_equals: prototype of self's property "StorageManager" is not Function.prototype expected function "function () { [native code] }" but got function "function EventTarget() { [native code] }" +PASS StorageManager interface object length +PASS StorageManager interface object name +FAIL StorageManager interface: existence and properties of interface prototype object assert_equals: prototype of StorageManager.prototype is not Object.prototype expected object "[object Object]" but got object "[object EventTarget]" +PASS StorageManager interface: existence and properties of interface prototype object's "constructor" property +PASS StorageManager interface: existence and properties of interface prototype object's @@unscopables property +PASS StorageManager interface: operation persisted() +PASS StorageManager interface: member persist +PASS StorageManager interface: operation estimate() +PASS StorageManager must be primary interface of navigator.storage +PASS Stringification of navigator.storage +PASS StorageManager interface: navigator.storage must inherit property "persisted()" with the proper type +PASS StorageManager interface: navigator.storage must not have property "persist" +PASS StorageManager interface: navigator.storage must inherit property "estimate()" with the proper type +PASS WorkerNavigator interface: attribute storage +PASS WorkerNavigator interface: navigator must inherit property "storage" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/gpu-rasterization/images/2-comp-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/gpu-rasterization/images/2-comp-expected.png deleted file mode 100644 index 63e409c..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/gpu-rasterization/images/2-comp-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png deleted file mode 100644 index 81e5ecf..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png deleted file mode 100644 index 5f36585..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/plz-dedicated-worker/external/wpt/service-workers/service-worker/fetch-event.https-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/plz-dedicated-worker/external/wpt/service-workers/service-worker/fetch-event.https-expected.txt new file mode 100644 index 0000000..3fe3911 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/plz-dedicated-worker/external/wpt/service-workers/service-worker/fetch-event.https-expected.txt
@@ -0,0 +1,49 @@ +This is a testharness.js-based test. +PASS global setup +PASS Service Worker headers in the request of a fetch event +PASS Service Worker responds to fetch event with string +PASS Service Worker responds to fetch event using request fragment with string +PASS Service Worker responds to fetch event with blob body +PASS Service Worker responds to fetch event with the referrer URL +PASS Service Worker responds to fetch event with an existing client id +PASS Service Worker responds to fetch event with the correct resulting client id +PASS Service Worker does not respond to fetch event +PASS Service Worker responds to fetch event with null response body +PASS Service Worker fetches other file in fetch event +PASS Service Worker responds to fetch event with POST form +PASS Service Worker falls back to network in fetch event with POST form +PASS Multiple calls of respondWith must throw InvalidStateErrors +PASS Service Worker event.respondWith must set the used flag +PASS Service Worker should expose FetchEvent URL fragments. +PASS Service Worker responds to fetch event with the correct cache types +PASS Service Worker should intercept EventSource +FAIL Service Worker responds to fetch event with the correct integrity_metadata assert_equals: integrity expected "gs0nqru8KbsrIt5YToQqS9fYao4GQJXtcId610g7cCU=" but got "" +PASS FetchEvent#body is a string +FAIL FetchEvent#body is a ReadableStream promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch" +PASS FetchEvent#body is a string and is passed to network fallback +FAIL FetchEvent#body is a ReadableStream and is passed to network fallback promise_test: Unhandled rejection with value: object "TypeError: Failed to fetch" +PASS FetchEvent#body is a none Uint8Array ReadableStream and is passed to a service worker +PASS FetchEvent#body is a string, used and passed to network fallback +PASS FetchEvent#body is a ReadableStream, used and passed to network fallback +PASS FetchEvent#body is a string, cloned and passed to network fallback +PASS FetchEvent#body is a ReadableStream, cloned and passed to network fallback +PASS FetchEvent#body is a blob +PASS FetchEvent#body is a blob and is passed to network fallback +PASS Service Worker responds to fetch event with the correct keepalive value +FAIL FetchEvent#request.isReloadNavigation is true (location.reload()) assert_equals: expected "method = GET, isReloadNavigation = false" but got "method = GET, isReloadNavigation = undefined" +FAIL FetchEvent#request.isReloadNavigation is true (history.go(0)) assert_equals: expected "method = GET, isReloadNavigation = false" but got "method = GET, isReloadNavigation = undefined" +FAIL FetchEvent#request.isReloadNavigation is true (POST + location.reload()) assert_equals: expected "method = GET, isReloadNavigation = false" but got "method = GET, isReloadNavigation = undefined" +FAIL FetchEvent#request.isReloadNavigation is true (with history traversal) assert_equals: expected "method = GET, isReloadNavigation = false" but got "method = GET, isReloadNavigation = undefined" +PASS FetchEvent#request.isHistoryNavigation is true (with history.go(-1)) +PASS FetchEvent#request.isHistoryNavigation is true (with history.go(1)) +PASS FetchEvent#request.isHistoryNavigation is false (with history.go(0)) +PASS FetchEvent#request.isHistoryNavigation is false (with location.reload) +PASS FetchEvent#request.isHistoryNavigation is true (with history.go(-2)) +PASS FetchEvent#request.isHistoryNavigation is true (with history.go(2)) +PASS FetchEvent#request.isHistoryNavigation is true (POST + history.go(-1)) +PASS XHR upload progress events for response coming from SW +PASS XHR upload progress events for network fallback +PASS Fetch with POST with text on sw 421 response should not be retried. +PASS restore global state +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/threaded/external/wpt/animation-worklet/idlharness.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/threaded/external/wpt/animation-worklet/idlharness.any.worker-expected.txt new file mode 100644 index 0000000..0a15a780 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/threaded/external/wpt/animation-worklet/idlharness.any.worker-expected.txt
@@ -0,0 +1,18 @@ +This is a testharness.js-based test. +PASS idl_test setup +PASS idl_test validation +PASS Partial namespace CSS: original namespace defined +PASS Partial namespace CSS: valid exposure set +PASS Partial namespace CSS: member names are unique +PASS AnimationWorkletGlobalScope interface: existence and properties of interface object +PASS WorkletAnimationEffect interface: existence and properties of interface object +PASS WorkletAnimation interface: existence and properties of interface object +FAIL WorkletAnimation must be primary interface of new WorkletAnimation("name") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WorkletAnimation is not defined" +FAIL Stringification of new WorkletAnimation("name") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WorkletAnimation is not defined" +FAIL WorkletAnimation interface: new WorkletAnimation("name") must not have property "undefined" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WorkletAnimation is not defined" +FAIL WorkletAnimation interface: new WorkletAnimation("name") must not have property "animatorName" assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WorkletAnimation is not defined" +PASS WorkletGroupEffect interface: existence and properties of interface object +FAIL CSS namespace: operation escape(CSSOMString) Cannot read property 'hasOwnProperty' of undefined +FAIL CSS namespace: attribute animationWorklet Cannot read property 'hasOwnProperty' of undefined +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.14/virtual/gpu-rasterization/images/2-comp-expected.png b/third_party/blink/web_tests/platform/mac-mac10.14/virtual/gpu-rasterization/images/2-comp-expected.png deleted file mode 100644 index 63e409c..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.14/virtual/gpu-rasterization/images/2-comp-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.14/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/mac-mac10.14/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png deleted file mode 100644 index 81e5ecf..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.14/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.14/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png b/third_party/blink/web_tests/platform/mac-mac10.14/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png deleted file mode 100644 index 5f36585..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.14/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/html/dom/idlharness.https_include=HTML._-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/html/dom/idlharness.https_include=HTML._-expected.txt new file mode 100644 index 0000000..b75995bc --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/html/dom/idlharness.https_include=HTML._-expected.txt
@@ -0,0 +1,3744 @@ +This is a testharness.js-based test. +Found 3740 tests; 3718 PASS, 22 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface Document: original interface defined +PASS Partial interface Document: member names are unique +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface mixin DocumentOrShadowRoot: member names are unique +PASS Partial interface mixin NavigatorID: original interface mixin defined +PASS Partial interface mixin NavigatorID: member names are unique +PASS Partial interface HTMLAnchorElement: original interface defined +PASS Partial interface HTMLAnchorElement: member names are unique +PASS Partial interface HTMLAreaElement: original interface defined +PASS Partial interface HTMLAreaElement: member names are unique +PASS Partial interface HTMLBodyElement: original interface defined +PASS Partial interface HTMLBodyElement: member names are unique +PASS Partial interface HTMLBRElement: original interface defined +PASS Partial interface HTMLBRElement: member names are unique +PASS Partial interface HTMLTableCaptionElement: original interface defined +PASS Partial interface HTMLTableCaptionElement: member names are unique +PASS Partial interface HTMLTableColElement: original interface defined +PASS Partial interface HTMLTableColElement: member names are unique +PASS Partial interface HTMLDivElement: original interface defined +PASS Partial interface HTMLDivElement: member names are unique +PASS Partial interface HTMLDListElement: original interface defined +PASS Partial interface HTMLDListElement: member names are unique +PASS Partial interface HTMLEmbedElement: original interface defined +PASS Partial interface HTMLEmbedElement: member names are unique +PASS Partial interface HTMLHeadingElement: original interface defined +PASS Partial interface HTMLHeadingElement: member names are unique +PASS Partial interface HTMLHRElement: original interface defined +PASS Partial interface HTMLHRElement: member names are unique +PASS Partial interface HTMLHtmlElement: original interface defined +PASS Partial interface HTMLHtmlElement: member names are unique +PASS Partial interface HTMLIFrameElement: original interface defined +PASS Partial interface HTMLIFrameElement: member names are unique +PASS Partial interface HTMLImageElement: original interface defined +PASS Partial interface HTMLImageElement: member names are unique +PASS Partial interface HTMLInputElement: original interface defined +PASS Partial interface HTMLInputElement: member names are unique +PASS Partial interface HTMLLegendElement: original interface defined +PASS Partial interface HTMLLegendElement: member names are unique +PASS Partial interface HTMLLIElement: original interface defined +PASS Partial interface HTMLLIElement: member names are unique +PASS Partial interface HTMLLinkElement: original interface defined +PASS Partial interface HTMLLinkElement: member names are unique +PASS Partial interface HTMLMenuElement: original interface defined +PASS Partial interface HTMLMenuElement: member names are unique +PASS Partial interface HTMLMetaElement: original interface defined +PASS Partial interface HTMLMetaElement: member names are unique +PASS Partial interface HTMLObjectElement: original interface defined +PASS Partial interface HTMLObjectElement: member names are unique +PASS Partial interface HTMLOListElement: original interface defined +PASS Partial interface HTMLOListElement: member names are unique +PASS Partial interface HTMLParagraphElement: original interface defined +PASS Partial interface HTMLParagraphElement: member names are unique +PASS Partial interface HTMLParamElement: original interface defined +PASS Partial interface HTMLParamElement: member names are unique +PASS Partial interface HTMLPreElement: original interface defined +PASS Partial interface HTMLPreElement: member names are unique +PASS Partial interface HTMLStyleElement: original interface defined +PASS Partial interface HTMLStyleElement: member names are unique +PASS Partial interface HTMLScriptElement: original interface defined +PASS Partial interface HTMLScriptElement: member names are unique +PASS Partial interface HTMLTableElement: original interface defined +PASS Partial interface HTMLTableElement: member names are unique +PASS Partial interface HTMLTableSectionElement: original interface defined +PASS Partial interface HTMLTableSectionElement: member names are unique +PASS Partial interface HTMLTableCellElement: original interface defined +PASS Partial interface HTMLTableCellElement: member names are unique +PASS Partial interface HTMLTableRowElement: original interface defined +PASS Partial interface HTMLTableRowElement: member names are unique +PASS Partial interface HTMLUListElement: original interface defined +PASS Partial interface HTMLUListElement: member names are unique +PASS Partial interface Document[2]: original interface defined +PASS Partial interface Document[2]: member names are unique +PASS Partial interface Window: original interface defined +PASS Partial interface Window: member names are unique +PASS Partial interface Document[3]: member names are unique +PASS Partial interface mixin DocumentOrShadowRoot[2]: member names are unique +PASS Partial interface UIEvent: member names are unique +PASS Partial interface MouseEvent: member names are unique +PASS Partial interface UIEvent[2]: member names are unique +PASS Partial dictionary UIEventInit: member names are unique +PASS Document includes GlobalEventHandlers: member names are unique +PASS Document includes DocumentAndElementEventHandlers: member names are unique +PASS Document includes NonElementParentNode: member names are unique +PASS Document includes DocumentOrShadowRoot: member names are unique +PASS Document includes ParentNode: member names are unique +PASS Document includes XPathEvaluatorBase: member names are unique +PASS HTMLElement includes GlobalEventHandlers: member names are unique +PASS HTMLElement includes DocumentAndElementEventHandlers: member names are unique +PASS HTMLElement includes ElementContentEditable: member names are unique +PASS HTMLElement includes HTMLOrSVGElement: member names are unique +PASS HTMLElement includes ElementCSSInlineStyle: member names are unique +PASS HTMLLinkElement includes LinkStyle: member names are unique +PASS HTMLStyleElement includes LinkStyle: member names are unique +PASS HTMLBodyElement includes WindowEventHandlers: member names are unique +PASS HTMLAnchorElement includes HTMLHyperlinkElementUtils: member names are unique +PASS HTMLAreaElement includes HTMLHyperlinkElementUtils: member names are unique +PASS CanvasRenderingContext2D includes CanvasState: member names are unique +PASS CanvasRenderingContext2D includes CanvasTransform: member names are unique +PASS CanvasRenderingContext2D includes CanvasCompositing: member names are unique +PASS CanvasRenderingContext2D includes CanvasImageSmoothing: member names are unique +PASS CanvasRenderingContext2D includes CanvasFillStrokeStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasShadowStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasFilters: member names are unique +PASS CanvasRenderingContext2D includes CanvasRect: member names are unique +PASS CanvasRenderingContext2D includes CanvasDrawPath: member names are unique +PASS CanvasRenderingContext2D includes CanvasUserInterface: member names are unique +PASS CanvasRenderingContext2D includes CanvasText: member names are unique +PASS CanvasRenderingContext2D includes CanvasDrawImage: member names are unique +PASS CanvasRenderingContext2D includes CanvasImageData: member names are unique +PASS CanvasRenderingContext2D includes CanvasPathDrawingStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasTextDrawingStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasPath: member names are unique +PASS Path2D includes CanvasPath: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasState: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasTransform: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasCompositing: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasImageSmoothing: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasFillStrokeStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasShadowStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasFilters: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasRect: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasDrawPath: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasText: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasDrawImage: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasImageData: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasPathDrawingStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasTextDrawingStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasPath: member names are unique +PASS ElementInternals includes ARIAMixin: member names are unique +PASS Window includes GlobalEventHandlers: member names are unique +PASS Window includes WindowEventHandlers: member names are unique +PASS Window includes WindowOrWorkerGlobalScope: member names are unique +PASS Window includes AnimationFrameProvider: member names are unique +PASS Window includes WindowSessionStorage: member names are unique +PASS Window includes WindowLocalStorage: member names are unique +PASS WorkerGlobalScope includes WindowOrWorkerGlobalScope: member names are unique +PASS Navigator includes NavigatorID: member names are unique +PASS Navigator includes NavigatorLanguage: member names are unique +PASS Navigator includes NavigatorOnLine: member names are unique +PASS Navigator includes NavigatorContentUtils: member names are unique +PASS Navigator includes NavigatorCookies: member names are unique +PASS Navigator includes NavigatorPlugins: member names are unique +PASS Navigator includes NavigatorConcurrentHardware: member names are unique +PASS DedicatedWorkerGlobalScope includes AnimationFrameProvider: member names are unique +PASS Worker includes AbstractWorker: member names are unique +PASS SharedWorker includes AbstractWorker: member names are unique +PASS WorkerNavigator includes NavigatorID: member names are unique +PASS WorkerNavigator includes NavigatorLanguage: member names are unique +PASS WorkerNavigator includes NavigatorOnLine: member names are unique +PASS WorkerNavigator includes NavigatorConcurrentHardware: member names are unique +PASS HTMLFrameSetElement includes WindowEventHandlers: member names are unique +PASS Element includes ARIAMixin: member names are unique +PASS Element includes ParentNode: member names are unique +PASS Element includes NonDocumentTypeChildNode: member names are unique +PASS Element includes ChildNode: member names are unique +PASS Element includes Slottable: member names are unique +PASS SVGElement includes GlobalEventHandlers: member names are unique +PASS SVGElement includes DocumentAndElementEventHandlers: member names are unique +PASS SVGElement includes SVGElementInstance: member names are unique +PASS SVGElement includes HTMLOrSVGElement: member names are unique +PASS SVGElement includes ElementCSSInlineStyle: member names are unique +PASS SVGGraphicsElement includes SVGTests: member names are unique +PASS SVGSVGElement includes SVGFitToViewBox: member names are unique +PASS SVGSVGElement includes WindowEventHandlers: member names are unique +PASS SVGImageElement includes SVGURIReference: member names are unique +PASS SVGScriptElement includes SVGURIReference: member names are unique +PASS DocumentFragment includes NonElementParentNode: member names are unique +PASS DocumentFragment includes ParentNode: member names are unique +PASS ShadowRoot includes DocumentOrShadowRoot: member names are unique +PASS HTMLAllCollection interface: existence and properties of interface object +PASS HTMLAllCollection interface object length +PASS HTMLAllCollection interface object name +PASS HTMLAllCollection interface: existence and properties of interface prototype object +PASS HTMLAllCollection interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLAllCollection interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLAllCollection interface: attribute length +PASS HTMLAllCollection interface: operation namedItem(DOMString) +PASS HTMLAllCollection interface: operation item(optional DOMString) +PASS HTMLAllCollection must be primary interface of document.all +PASS Stringification of document.all +PASS HTMLAllCollection interface: document.all must inherit property "length" with the proper type +PASS HTMLAllCollection interface: document.all must inherit property "namedItem(DOMString)" with the proper type +PASS HTMLAllCollection interface: calling namedItem(DOMString) on document.all with too few arguments must throw TypeError +PASS HTMLAllCollection interface: document.all must inherit property "item(optional DOMString)" with the proper type +PASS HTMLAllCollection interface: calling item(optional DOMString) on document.all with too few arguments must throw TypeError +PASS HTMLFormControlsCollection interface: existence and properties of interface object +PASS HTMLFormControlsCollection interface object length +PASS HTMLFormControlsCollection interface object name +PASS HTMLFormControlsCollection interface: existence and properties of interface prototype object +PASS HTMLFormControlsCollection interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFormControlsCollection interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFormControlsCollection interface: operation namedItem(DOMString) +PASS HTMLFormControlsCollection must be primary interface of document.createElement("form").elements +PASS Stringification of document.createElement("form").elements +PASS HTMLFormControlsCollection interface: document.createElement("form").elements must inherit property "namedItem(DOMString)" with the proper type +PASS HTMLFormControlsCollection interface: calling namedItem(DOMString) on document.createElement("form").elements with too few arguments must throw TypeError +PASS HTMLOptionsCollection interface: existence and properties of interface object +PASS HTMLOptionsCollection interface object length +PASS HTMLOptionsCollection interface object name +PASS HTMLOptionsCollection interface: existence and properties of interface prototype object +PASS HTMLOptionsCollection interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLOptionsCollection interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLOptionsCollection interface: attribute length +PASS HTMLOptionsCollection interface: operation add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?) +PASS HTMLOptionsCollection interface: operation remove(long) +PASS HTMLOptionsCollection interface: attribute selectedIndex +PASS HTMLOptionsCollection must be primary interface of document.createElement("select").options +PASS Stringification of document.createElement("select").options +PASS HTMLOptionsCollection interface: document.createElement("select").options must inherit property "length" with the proper type +PASS HTMLOptionsCollection interface: document.createElement("select").options must inherit property "add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?)" with the proper type +PASS HTMLOptionsCollection interface: calling add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?) on document.createElement("select").options with too few arguments must throw TypeError +PASS HTMLOptionsCollection interface: document.createElement("select").options must inherit property "remove(long)" with the proper type +PASS HTMLOptionsCollection interface: calling remove(long) on document.createElement("select").options with too few arguments must throw TypeError +PASS HTMLOptionsCollection interface: document.createElement("select").options must inherit property "selectedIndex" with the proper type +PASS HTMLElement interface: existence and properties of interface object +PASS HTMLElement interface object length +PASS HTMLElement interface object name +PASS HTMLElement interface: existence and properties of interface prototype object +PASS HTMLElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLElement interface: attribute title +PASS HTMLElement interface: attribute lang +PASS HTMLElement interface: attribute translate +PASS HTMLElement interface: attribute dir +PASS HTMLElement interface: attribute hidden +PASS HTMLElement interface: operation click() +PASS HTMLElement interface: attribute accessKey +FAIL HTMLElement interface: attribute accessKeyLabel assert_true: The prototype object must have a property "accessKeyLabel" expected true got false +PASS HTMLElement interface: attribute draggable +PASS HTMLElement interface: attribute spellcheck +PASS HTMLElement interface: attribute autocapitalize +PASS HTMLElement interface: attribute innerText +PASS HTMLElement interface: operation attachInternals() +PASS HTMLElement interface: attribute onabort +PASS HTMLElement interface: attribute onauxclick +PASS HTMLElement interface: attribute onblur +PASS HTMLElement interface: attribute oncancel +PASS HTMLElement interface: attribute oncanplay +PASS HTMLElement interface: attribute oncanplaythrough +PASS HTMLElement interface: attribute onchange +PASS HTMLElement interface: attribute onclick +PASS HTMLElement interface: attribute onclose +PASS HTMLElement interface: attribute oncontextmenu +PASS HTMLElement interface: attribute oncuechange +PASS HTMLElement interface: attribute ondblclick +PASS HTMLElement interface: attribute ondrag +PASS HTMLElement interface: attribute ondragend +PASS HTMLElement interface: attribute ondragenter +PASS HTMLElement interface: attribute ondragleave +PASS HTMLElement interface: attribute ondragover +PASS HTMLElement interface: attribute ondragstart +PASS HTMLElement interface: attribute ondrop +PASS HTMLElement interface: attribute ondurationchange +PASS HTMLElement interface: attribute onemptied +PASS HTMLElement interface: attribute onended +PASS HTMLElement interface: attribute onerror +PASS HTMLElement interface: attribute onfocus +PASS HTMLElement interface: attribute onformdata +PASS HTMLElement interface: attribute oninput +PASS HTMLElement interface: attribute oninvalid +PASS HTMLElement interface: attribute onkeydown +PASS HTMLElement interface: attribute onkeypress +PASS HTMLElement interface: attribute onkeyup +PASS HTMLElement interface: attribute onload +PASS HTMLElement interface: attribute onloadeddata +PASS HTMLElement interface: attribute onloadedmetadata +PASS HTMLElement interface: attribute onloadstart +PASS HTMLElement interface: attribute onmousedown +PASS HTMLElement interface: attribute onmouseenter +PASS HTMLElement interface: attribute onmouseleave +PASS HTMLElement interface: attribute onmousemove +PASS HTMLElement interface: attribute onmouseout +PASS HTMLElement interface: attribute onmouseover +PASS HTMLElement interface: attribute onmouseup +PASS HTMLElement interface: attribute onpause +PASS HTMLElement interface: attribute onplay +PASS HTMLElement interface: attribute onplaying +PASS HTMLElement interface: attribute onprogress +PASS HTMLElement interface: attribute onratechange +PASS HTMLElement interface: attribute onreset +PASS HTMLElement interface: attribute onresize +PASS HTMLElement interface: attribute onscroll +FAIL HTMLElement interface: attribute onsecuritypolicyviolation assert_true: The prototype object must have a property "onsecuritypolicyviolation" expected true got false +PASS HTMLElement interface: attribute onseeked +PASS HTMLElement interface: attribute onseeking +PASS HTMLElement interface: attribute onselect +FAIL HTMLElement interface: attribute onslotchange assert_true: The prototype object must have a property "onslotchange" expected true got false +PASS HTMLElement interface: attribute onstalled +PASS HTMLElement interface: attribute onsubmit +PASS HTMLElement interface: attribute onsuspend +PASS HTMLElement interface: attribute ontimeupdate +PASS HTMLElement interface: attribute ontoggle +PASS HTMLElement interface: attribute onvolumechange +PASS HTMLElement interface: attribute onwaiting +PASS HTMLElement interface: attribute onwebkitanimationend +PASS HTMLElement interface: attribute onwebkitanimationiteration +PASS HTMLElement interface: attribute onwebkitanimationstart +PASS HTMLElement interface: attribute onwebkittransitionend +PASS HTMLElement interface: attribute onwheel +PASS HTMLElement interface: attribute oncopy +PASS HTMLElement interface: attribute oncut +PASS HTMLElement interface: attribute onpaste +PASS HTMLElement interface: attribute contentEditable +PASS HTMLElement interface: attribute enterKeyHint +PASS HTMLElement interface: attribute isContentEditable +PASS HTMLElement interface: attribute inputMode +PASS HTMLElement interface: attribute dataset +PASS HTMLElement interface: attribute nonce +PASS HTMLElement interface: attribute autofocus +PASS HTMLElement interface: attribute tabIndex +PASS HTMLElement interface: operation focus(optional FocusOptions) +PASS HTMLElement interface: operation blur() +PASS HTMLElement must be primary interface of document.createElement("noscript") +PASS Stringification of document.createElement("noscript") +PASS HTMLElement interface: document.createElement("noscript") must inherit property "title" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "lang" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "translate" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "dir" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "hidden" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "click()" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "accessKey" with the proper type +FAIL HTMLElement interface: document.createElement("noscript") must inherit property "accessKeyLabel" with the proper type assert_inherits: property "accessKeyLabel" not found in prototype chain +PASS HTMLElement interface: document.createElement("noscript") must inherit property "draggable" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "spellcheck" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "autocapitalize" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "innerText" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "attachInternals()" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onabort" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onauxclick" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onblur" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncancel" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncanplay" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncanplaythrough" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onchange" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onclick" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onclose" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncontextmenu" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncuechange" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondblclick" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondrag" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragend" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragenter" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragleave" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragover" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragstart" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondrop" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondurationchange" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onemptied" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onended" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onerror" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onfocus" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onformdata" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oninput" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oninvalid" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeydown" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeypress" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeyup" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onload" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadeddata" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadedmetadata" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadstart" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmousedown" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseenter" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseleave" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmousemove" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseout" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseover" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseup" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onpause" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onplay" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onplaying" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onprogress" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onratechange" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onreset" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onresize" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onscroll" with the proper type +FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onsecuritypolicyviolation" with the proper type assert_inherits: property "onsecuritypolicyviolation" not found in prototype chain +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onseeked" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onseeking" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onselect" with the proper type +FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onslotchange" with the proper type assert_inherits: property "onslotchange" not found in prototype chain +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onstalled" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onsubmit" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onsuspend" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ontimeupdate" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ontoggle" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onvolumechange" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwaiting" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwebkitanimationend" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwebkitanimationiteration" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwebkitanimationstart" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwebkittransitionend" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwheel" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncopy" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncut" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onpaste" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "contentEditable" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "enterKeyHint" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "isContentEditable" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "inputMode" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "dataset" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "nonce" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "autofocus" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "tabIndex" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "focus(optional FocusOptions)" with the proper type +PASS HTMLElement interface: calling focus(optional FocusOptions) on document.createElement("noscript") with too few arguments must throw TypeError +PASS HTMLElement interface: document.createElement("noscript") must inherit property "blur()" with the proper type +PASS HTMLUnknownElement interface: existence and properties of interface object +PASS HTMLUnknownElement interface object length +PASS HTMLUnknownElement interface object name +PASS HTMLUnknownElement interface: existence and properties of interface prototype object +PASS HTMLUnknownElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLUnknownElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLUnknownElement must be primary interface of document.createElement("bgsound") +PASS Stringification of document.createElement("bgsound") +PASS HTMLHtmlElement interface: existence and properties of interface object +PASS HTMLHtmlElement interface object length +PASS HTMLHtmlElement interface object name +PASS HTMLHtmlElement interface: existence and properties of interface prototype object +PASS HTMLHtmlElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLHtmlElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLHtmlElement interface: attribute version +PASS HTMLHtmlElement must be primary interface of document.createElement("html") +PASS Stringification of document.createElement("html") +PASS HTMLHtmlElement interface: document.createElement("html") must inherit property "version" with the proper type +PASS HTMLHeadElement interface: existence and properties of interface object +PASS HTMLHeadElement interface object length +PASS HTMLHeadElement interface object name +PASS HTMLHeadElement interface: existence and properties of interface prototype object +PASS HTMLHeadElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLHeadElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLHeadElement must be primary interface of document.createElement("head") +PASS Stringification of document.createElement("head") +PASS HTMLTitleElement interface: existence and properties of interface object +PASS HTMLTitleElement interface object length +PASS HTMLTitleElement interface object name +PASS HTMLTitleElement interface: existence and properties of interface prototype object +PASS HTMLTitleElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTitleElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTitleElement interface: attribute text +PASS HTMLTitleElement must be primary interface of document.createElement("title") +PASS Stringification of document.createElement("title") +PASS HTMLTitleElement interface: document.createElement("title") must inherit property "text" with the proper type +PASS HTMLBaseElement interface: existence and properties of interface object +PASS HTMLBaseElement interface object length +PASS HTMLBaseElement interface object name +PASS HTMLBaseElement interface: existence and properties of interface prototype object +PASS HTMLBaseElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLBaseElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLBaseElement interface: attribute href +PASS HTMLBaseElement interface: attribute target +PASS HTMLBaseElement must be primary interface of document.createElement("base") +PASS Stringification of document.createElement("base") +PASS HTMLBaseElement interface: document.createElement("base") must inherit property "href" with the proper type +PASS HTMLBaseElement interface: document.createElement("base") must inherit property "target" with the proper type +PASS HTMLLinkElement interface: existence and properties of interface object +PASS HTMLLinkElement interface object length +PASS HTMLLinkElement interface object name +PASS HTMLLinkElement interface: existence and properties of interface prototype object +PASS HTMLLinkElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLLinkElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLLinkElement interface: attribute href +PASS HTMLLinkElement interface: attribute crossOrigin +PASS HTMLLinkElement interface: attribute rel +PASS HTMLLinkElement interface: attribute as +PASS HTMLLinkElement interface: attribute relList +PASS HTMLLinkElement interface: attribute media +PASS HTMLLinkElement interface: attribute integrity +PASS HTMLLinkElement interface: attribute hreflang +PASS HTMLLinkElement interface: attribute type +PASS HTMLLinkElement interface: attribute sizes +PASS HTMLLinkElement interface: attribute imageSrcset +PASS HTMLLinkElement interface: attribute imageSizes +PASS HTMLLinkElement interface: attribute referrerPolicy +PASS HTMLLinkElement interface: attribute disabled +PASS HTMLLinkElement interface: attribute charset +PASS HTMLLinkElement interface: attribute rev +PASS HTMLLinkElement interface: attribute target +PASS HTMLLinkElement must be primary interface of document.createElement("link") +PASS Stringification of document.createElement("link") +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "href" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "crossOrigin" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "rel" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "as" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "relList" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "media" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "integrity" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "hreflang" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "type" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "sizes" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "imageSrcset" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "imageSizes" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "referrerPolicy" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "disabled" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "charset" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "rev" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "target" with the proper type +PASS HTMLMetaElement interface: existence and properties of interface object +PASS HTMLMetaElement interface object length +PASS HTMLMetaElement interface object name +PASS HTMLMetaElement interface: existence and properties of interface prototype object +PASS HTMLMetaElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMetaElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMetaElement interface: attribute name +PASS HTMLMetaElement interface: attribute httpEquiv +PASS HTMLMetaElement interface: attribute content +PASS HTMLMetaElement interface: attribute scheme +PASS HTMLMetaElement must be primary interface of document.createElement("meta") +PASS Stringification of document.createElement("meta") +PASS HTMLMetaElement interface: document.createElement("meta") must inherit property "name" with the proper type +PASS HTMLMetaElement interface: document.createElement("meta") must inherit property "httpEquiv" with the proper type +PASS HTMLMetaElement interface: document.createElement("meta") must inherit property "content" with the proper type +PASS HTMLMetaElement interface: document.createElement("meta") must inherit property "scheme" with the proper type +PASS HTMLStyleElement interface: existence and properties of interface object +PASS HTMLStyleElement interface object length +PASS HTMLStyleElement interface object name +PASS HTMLStyleElement interface: existence and properties of interface prototype object +PASS HTMLStyleElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLStyleElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLStyleElement interface: attribute media +PASS HTMLStyleElement interface: attribute type +PASS HTMLStyleElement must be primary interface of document.createElement("style") +PASS Stringification of document.createElement("style") +PASS HTMLStyleElement interface: document.createElement("style") must inherit property "media" with the proper type +PASS HTMLStyleElement interface: document.createElement("style") must inherit property "type" with the proper type +PASS HTMLBodyElement interface: existence and properties of interface object +PASS HTMLBodyElement interface object length +PASS HTMLBodyElement interface object name +PASS HTMLBodyElement interface: existence and properties of interface prototype object +PASS HTMLBodyElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLBodyElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLBodyElement interface: attribute text +PASS HTMLBodyElement interface: attribute link +PASS HTMLBodyElement interface: attribute vLink +PASS HTMLBodyElement interface: attribute aLink +PASS HTMLBodyElement interface: attribute bgColor +PASS HTMLBodyElement interface: attribute background +PASS HTMLBodyElement interface: attribute onafterprint +PASS HTMLBodyElement interface: attribute onbeforeprint +PASS HTMLBodyElement interface: attribute onbeforeunload +PASS HTMLBodyElement interface: attribute onhashchange +PASS HTMLBodyElement interface: attribute onlanguagechange +PASS HTMLBodyElement interface: attribute onmessage +PASS HTMLBodyElement interface: attribute onmessageerror +PASS HTMLBodyElement interface: attribute onoffline +PASS HTMLBodyElement interface: attribute ononline +PASS HTMLBodyElement interface: attribute onpagehide +PASS HTMLBodyElement interface: attribute onpageshow +PASS HTMLBodyElement interface: attribute onpopstate +PASS HTMLBodyElement interface: attribute onrejectionhandled +PASS HTMLBodyElement interface: attribute onstorage +PASS HTMLBodyElement interface: attribute onunhandledrejection +PASS HTMLBodyElement interface: attribute onunload +PASS HTMLBodyElement must be primary interface of document.createElement("body") +PASS Stringification of document.createElement("body") +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "text" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "link" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "vLink" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "aLink" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "bgColor" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "background" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onafterprint" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onbeforeprint" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onbeforeunload" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onhashchange" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onlanguagechange" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onmessage" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onmessageerror" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onoffline" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "ononline" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onpagehide" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onpageshow" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onpopstate" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onrejectionhandled" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onstorage" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onunhandledrejection" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onunload" with the proper type +PASS HTMLHeadingElement interface: existence and properties of interface object +PASS HTMLHeadingElement interface object length +PASS HTMLHeadingElement interface object name +PASS HTMLHeadingElement interface: existence and properties of interface prototype object +PASS HTMLHeadingElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLHeadingElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLHeadingElement interface: attribute align +PASS HTMLHeadingElement must be primary interface of document.createElement("h1") +PASS Stringification of document.createElement("h1") +PASS HTMLHeadingElement interface: document.createElement("h1") must inherit property "align" with the proper type +PASS HTMLParagraphElement interface: existence and properties of interface object +PASS HTMLParagraphElement interface object length +PASS HTMLParagraphElement interface object name +PASS HTMLParagraphElement interface: existence and properties of interface prototype object +PASS HTMLParagraphElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLParagraphElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLParagraphElement interface: attribute align +PASS HTMLParagraphElement must be primary interface of document.createElement("p") +PASS Stringification of document.createElement("p") +PASS HTMLParagraphElement interface: document.createElement("p") must inherit property "align" with the proper type +PASS HTMLHRElement interface: existence and properties of interface object +PASS HTMLHRElement interface object length +PASS HTMLHRElement interface object name +PASS HTMLHRElement interface: existence and properties of interface prototype object +PASS HTMLHRElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLHRElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLHRElement interface: attribute align +PASS HTMLHRElement interface: attribute color +PASS HTMLHRElement interface: attribute noShade +PASS HTMLHRElement interface: attribute size +PASS HTMLHRElement interface: attribute width +PASS HTMLHRElement must be primary interface of document.createElement("hr") +PASS Stringification of document.createElement("hr") +PASS HTMLHRElement interface: document.createElement("hr") must inherit property "align" with the proper type +PASS HTMLHRElement interface: document.createElement("hr") must inherit property "color" with the proper type +PASS HTMLHRElement interface: document.createElement("hr") must inherit property "noShade" with the proper type +PASS HTMLHRElement interface: document.createElement("hr") must inherit property "size" with the proper type +PASS HTMLHRElement interface: document.createElement("hr") must inherit property "width" with the proper type +PASS HTMLPreElement interface: existence and properties of interface object +PASS HTMLPreElement interface object length +PASS HTMLPreElement interface object name +PASS HTMLPreElement interface: existence and properties of interface prototype object +PASS HTMLPreElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLPreElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLPreElement interface: attribute width +PASS HTMLPreElement must be primary interface of document.createElement("pre") +PASS Stringification of document.createElement("pre") +PASS HTMLPreElement interface: document.createElement("pre") must inherit property "width" with the proper type +PASS HTMLPreElement must be primary interface of document.createElement("listing") +PASS Stringification of document.createElement("listing") +PASS HTMLPreElement interface: document.createElement("listing") must inherit property "width" with the proper type +PASS HTMLPreElement must be primary interface of document.createElement("xmp") +PASS Stringification of document.createElement("xmp") +PASS HTMLPreElement interface: document.createElement("xmp") must inherit property "width" with the proper type +PASS HTMLQuoteElement interface: existence and properties of interface object +PASS HTMLQuoteElement interface object length +PASS HTMLQuoteElement interface object name +PASS HTMLQuoteElement interface: existence and properties of interface prototype object +PASS HTMLQuoteElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLQuoteElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLQuoteElement interface: attribute cite +PASS HTMLQuoteElement must be primary interface of document.createElement("blockquote") +PASS Stringification of document.createElement("blockquote") +PASS HTMLQuoteElement interface: document.createElement("blockquote") must inherit property "cite" with the proper type +PASS HTMLQuoteElement must be primary interface of document.createElement("q") +PASS Stringification of document.createElement("q") +PASS HTMLQuoteElement interface: document.createElement("q") must inherit property "cite" with the proper type +PASS HTMLOListElement interface: existence and properties of interface object +PASS HTMLOListElement interface object length +PASS HTMLOListElement interface object name +PASS HTMLOListElement interface: existence and properties of interface prototype object +PASS HTMLOListElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLOListElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLOListElement interface: attribute reversed +PASS HTMLOListElement interface: attribute start +PASS HTMLOListElement interface: attribute type +PASS HTMLOListElement interface: attribute compact +PASS HTMLUListElement interface: existence and properties of interface object +PASS HTMLUListElement interface object length +PASS HTMLUListElement interface object name +PASS HTMLUListElement interface: existence and properties of interface prototype object +PASS HTMLUListElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLUListElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLUListElement interface: attribute compact +PASS HTMLUListElement interface: attribute type +PASS HTMLMenuElement interface: existence and properties of interface object +PASS HTMLMenuElement interface object length +PASS HTMLMenuElement interface object name +PASS HTMLMenuElement interface: existence and properties of interface prototype object +PASS HTMLMenuElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMenuElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMenuElement interface: attribute compact +PASS HTMLMenuElement must be primary interface of document.createElement("menu") +PASS Stringification of document.createElement("menu") +PASS HTMLMenuElement interface: document.createElement("menu") must inherit property "compact" with the proper type +PASS HTMLLIElement interface: existence and properties of interface object +PASS HTMLLIElement interface object length +PASS HTMLLIElement interface object name +PASS HTMLLIElement interface: existence and properties of interface prototype object +PASS HTMLLIElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLLIElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLLIElement interface: attribute value +PASS HTMLLIElement interface: attribute type +PASS HTMLLIElement must be primary interface of document.createElement("li") +PASS Stringification of document.createElement("li") +PASS HTMLLIElement interface: document.createElement("li") must inherit property "value" with the proper type +PASS HTMLLIElement interface: document.createElement("li") must inherit property "type" with the proper type +PASS HTMLDListElement interface: existence and properties of interface object +PASS HTMLDListElement interface object length +PASS HTMLDListElement interface object name +PASS HTMLDListElement interface: existence and properties of interface prototype object +PASS HTMLDListElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDListElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDListElement interface: attribute compact +PASS HTMLDivElement interface: existence and properties of interface object +PASS HTMLDivElement interface object length +PASS HTMLDivElement interface object name +PASS HTMLDivElement interface: existence and properties of interface prototype object +PASS HTMLDivElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDivElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDivElement interface: attribute align +PASS HTMLDivElement must be primary interface of document.createElement("div") +PASS Stringification of document.createElement("div") +PASS HTMLDivElement interface: document.createElement("div") must inherit property "align" with the proper type +PASS HTMLAnchorElement interface: existence and properties of interface object +PASS HTMLAnchorElement interface object length +PASS HTMLAnchorElement interface object name +PASS HTMLAnchorElement interface: existence and properties of interface prototype object +PASS HTMLAnchorElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLAnchorElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLAnchorElement interface: attribute target +PASS HTMLAnchorElement interface: attribute download +PASS HTMLAnchorElement interface: attribute ping +PASS HTMLAnchorElement interface: attribute rel +PASS HTMLAnchorElement interface: attribute relList +PASS HTMLAnchorElement interface: attribute hreflang +PASS HTMLAnchorElement interface: attribute type +PASS HTMLAnchorElement interface: attribute text +PASS HTMLAnchorElement interface: attribute referrerPolicy +PASS HTMLAnchorElement interface: attribute coords +PASS HTMLAnchorElement interface: attribute charset +PASS HTMLAnchorElement interface: attribute name +PASS HTMLAnchorElement interface: attribute rev +PASS HTMLAnchorElement interface: attribute shape +PASS HTMLAnchorElement interface: attribute href +PASS HTMLAnchorElement interface: stringifier +PASS HTMLAnchorElement interface: attribute origin +PASS HTMLAnchorElement interface: attribute protocol +PASS HTMLAnchorElement interface: attribute username +PASS HTMLAnchorElement interface: attribute password +PASS HTMLAnchorElement interface: attribute host +PASS HTMLAnchorElement interface: attribute hostname +PASS HTMLAnchorElement interface: attribute port +PASS HTMLAnchorElement interface: attribute pathname +PASS HTMLAnchorElement interface: attribute search +PASS HTMLAnchorElement interface: attribute hash +PASS HTMLAnchorElement must be primary interface of document.createElement("a") +PASS Stringification of document.createElement("a") +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "target" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "download" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "ping" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "rel" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "relList" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "hreflang" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "type" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "text" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "referrerPolicy" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "coords" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "charset" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "name" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "rev" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "shape" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "href" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "origin" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "protocol" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "username" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "password" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "host" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "hostname" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "port" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "pathname" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "search" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "hash" with the proper type +PASS HTMLDataElement interface: existence and properties of interface object +PASS HTMLDataElement interface object length +PASS HTMLDataElement interface object name +PASS HTMLDataElement interface: existence and properties of interface prototype object +PASS HTMLDataElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDataElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDataElement interface: attribute value +PASS HTMLDataElement must be primary interface of document.createElement("data") +PASS Stringification of document.createElement("data") +PASS HTMLDataElement interface: document.createElement("data") must inherit property "value" with the proper type +PASS HTMLTimeElement interface: existence and properties of interface object +PASS HTMLTimeElement interface object length +PASS HTMLTimeElement interface object name +PASS HTMLTimeElement interface: existence and properties of interface prototype object +PASS HTMLTimeElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTimeElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTimeElement interface: attribute dateTime +PASS HTMLTimeElement must be primary interface of document.createElement("time") +PASS Stringification of document.createElement("time") +PASS HTMLTimeElement interface: document.createElement("time") must inherit property "dateTime" with the proper type +PASS HTMLSpanElement interface: existence and properties of interface object +PASS HTMLSpanElement interface object length +PASS HTMLSpanElement interface object name +PASS HTMLSpanElement interface: existence and properties of interface prototype object +PASS HTMLSpanElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLSpanElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLSpanElement must be primary interface of document.createElement("span") +PASS Stringification of document.createElement("span") +PASS HTMLBRElement interface: existence and properties of interface object +PASS HTMLBRElement interface object length +PASS HTMLBRElement interface object name +PASS HTMLBRElement interface: existence and properties of interface prototype object +PASS HTMLBRElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLBRElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLBRElement interface: attribute clear +PASS HTMLBRElement must be primary interface of document.createElement("br") +PASS Stringification of document.createElement("br") +PASS HTMLBRElement interface: document.createElement("br") must inherit property "clear" with the proper type +PASS HTMLModElement interface: existence and properties of interface object +PASS HTMLModElement interface object length +PASS HTMLModElement interface object name +PASS HTMLModElement interface: existence and properties of interface prototype object +PASS HTMLModElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLModElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLModElement interface: attribute cite +PASS HTMLModElement interface: attribute dateTime +PASS HTMLModElement must be primary interface of document.createElement("ins") +PASS Stringification of document.createElement("ins") +PASS HTMLModElement interface: document.createElement("ins") must inherit property "cite" with the proper type +PASS HTMLModElement interface: document.createElement("ins") must inherit property "dateTime" with the proper type +PASS HTMLModElement must be primary interface of document.createElement("del") +PASS Stringification of document.createElement("del") +PASS HTMLModElement interface: document.createElement("del") must inherit property "cite" with the proper type +PASS HTMLModElement interface: document.createElement("del") must inherit property "dateTime" with the proper type +PASS HTMLPictureElement interface: existence and properties of interface object +PASS HTMLPictureElement interface object length +PASS HTMLPictureElement interface object name +PASS HTMLPictureElement interface: existence and properties of interface prototype object +PASS HTMLPictureElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLPictureElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLPictureElement must be primary interface of document.createElement("picture") +PASS Stringification of document.createElement("picture") +PASS HTMLSourceElement interface: existence and properties of interface object +PASS HTMLSourceElement interface object length +PASS HTMLSourceElement interface object name +PASS HTMLSourceElement interface: existence and properties of interface prototype object +PASS HTMLSourceElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLSourceElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLSourceElement interface: attribute src +PASS HTMLSourceElement interface: attribute type +PASS HTMLSourceElement interface: attribute srcset +PASS HTMLSourceElement interface: attribute sizes +PASS HTMLSourceElement interface: attribute media +PASS HTMLSourceElement interface: attribute width +PASS HTMLSourceElement interface: attribute height +PASS HTMLSourceElement must be primary interface of document.createElement("source") +PASS Stringification of document.createElement("source") +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "src" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "type" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "srcset" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "sizes" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "media" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "width" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "height" with the proper type +PASS HTMLImageElement interface: existence and properties of interface object +PASS HTMLImageElement interface object length +PASS HTMLImageElement interface object name +PASS HTMLImageElement interface: named constructor +PASS HTMLImageElement interface: named constructor object +PASS HTMLImageElement interface: named constructor prototype property +PASS HTMLImageElement interface: named constructor name +PASS HTMLImageElement interface: named constructor length +PASS HTMLImageElement interface: named constructor without 'new' +PASS HTMLImageElement interface: existence and properties of interface prototype object +PASS HTMLImageElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLImageElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLImageElement interface: attribute alt +PASS HTMLImageElement interface: attribute src +PASS HTMLImageElement interface: attribute srcset +PASS HTMLImageElement interface: attribute sizes +PASS HTMLImageElement interface: attribute crossOrigin +PASS HTMLImageElement interface: attribute useMap +PASS HTMLImageElement interface: attribute isMap +PASS HTMLImageElement interface: attribute width +PASS HTMLImageElement interface: attribute height +PASS HTMLImageElement interface: attribute naturalWidth +PASS HTMLImageElement interface: attribute naturalHeight +PASS HTMLImageElement interface: attribute complete +PASS HTMLImageElement interface: attribute currentSrc +PASS HTMLImageElement interface: attribute referrerPolicy +PASS HTMLImageElement interface: attribute decoding +PASS HTMLImageElement interface: attribute loading +PASS HTMLImageElement interface: operation decode() +PASS HTMLImageElement interface: attribute name +PASS HTMLImageElement interface: attribute lowsrc +PASS HTMLImageElement interface: attribute align +PASS HTMLImageElement interface: attribute hspace +PASS HTMLImageElement interface: attribute vspace +PASS HTMLImageElement interface: attribute longDesc +PASS HTMLImageElement interface: attribute border +PASS HTMLImageElement must be primary interface of document.createElement("img") +PASS Stringification of document.createElement("img") +PASS HTMLImageElement interface: document.createElement("img") must inherit property "alt" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "src" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "srcset" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "sizes" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "crossOrigin" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "useMap" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "isMap" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "width" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "height" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "naturalWidth" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "naturalHeight" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "complete" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "currentSrc" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "referrerPolicy" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "decoding" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "name" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "lowsrc" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "align" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "hspace" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "vspace" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "longDesc" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "border" with the proper type +PASS HTMLImageElement must be primary interface of new Image() +PASS Stringification of new Image() +PASS HTMLImageElement interface: new Image() must inherit property "alt" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "src" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "srcset" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "sizes" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "crossOrigin" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "useMap" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "isMap" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "width" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "height" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "naturalWidth" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "naturalHeight" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "complete" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "currentSrc" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "referrerPolicy" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "decoding" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "loading" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "name" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "lowsrc" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "align" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "hspace" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "vspace" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "longDesc" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "border" with the proper type +PASS HTMLIFrameElement interface: existence and properties of interface object +PASS HTMLIFrameElement interface object length +PASS HTMLIFrameElement interface object name +PASS HTMLIFrameElement interface: existence and properties of interface prototype object +PASS HTMLIFrameElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLIFrameElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLIFrameElement interface: attribute src +PASS HTMLIFrameElement interface: attribute srcdoc +PASS HTMLIFrameElement interface: attribute name +PASS HTMLIFrameElement interface: attribute sandbox +PASS HTMLIFrameElement interface: attribute allow +PASS HTMLIFrameElement interface: attribute allowFullscreen +PASS HTMLIFrameElement interface: attribute width +PASS HTMLIFrameElement interface: attribute height +PASS HTMLIFrameElement interface: attribute referrerPolicy +PASS HTMLIFrameElement interface: attribute loading +PASS HTMLIFrameElement interface: attribute contentDocument +PASS HTMLIFrameElement interface: attribute contentWindow +PASS HTMLIFrameElement interface: operation getSVGDocument() +PASS HTMLIFrameElement interface: attribute align +PASS HTMLIFrameElement interface: attribute scrolling +PASS HTMLIFrameElement interface: attribute frameBorder +PASS HTMLIFrameElement interface: attribute longDesc +PASS HTMLIFrameElement interface: attribute marginHeight +PASS HTMLIFrameElement interface: attribute marginWidth +PASS HTMLEmbedElement interface: existence and properties of interface object +PASS HTMLEmbedElement interface object length +PASS HTMLEmbedElement interface object name +PASS HTMLEmbedElement interface: existence and properties of interface prototype object +PASS HTMLEmbedElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLEmbedElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLEmbedElement interface: attribute src +PASS HTMLEmbedElement interface: attribute type +PASS HTMLEmbedElement interface: attribute width +PASS HTMLEmbedElement interface: attribute height +PASS HTMLEmbedElement interface: operation getSVGDocument() +PASS HTMLEmbedElement interface: attribute align +PASS HTMLEmbedElement interface: attribute name +PASS HTMLEmbedElement must be primary interface of document.createElement("embed") +PASS Stringification of document.createElement("embed") +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "src" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "type" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "width" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "height" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "getSVGDocument()" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "align" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "name" with the proper type +PASS HTMLObjectElement interface: existence and properties of interface object +PASS HTMLObjectElement interface object length +PASS HTMLObjectElement interface object name +PASS HTMLObjectElement interface: existence and properties of interface prototype object +PASS HTMLObjectElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLObjectElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLObjectElement interface: attribute data +PASS HTMLObjectElement interface: attribute type +PASS HTMLObjectElement interface: attribute name +PASS HTMLObjectElement interface: attribute form +PASS HTMLObjectElement interface: attribute width +PASS HTMLObjectElement interface: attribute height +PASS HTMLObjectElement interface: attribute contentDocument +PASS HTMLObjectElement interface: attribute contentWindow +PASS HTMLObjectElement interface: operation getSVGDocument() +PASS HTMLObjectElement interface: attribute willValidate +PASS HTMLObjectElement interface: attribute validity +PASS HTMLObjectElement interface: attribute validationMessage +PASS HTMLObjectElement interface: operation checkValidity() +PASS HTMLObjectElement interface: operation reportValidity() +PASS HTMLObjectElement interface: operation setCustomValidity(DOMString) +PASS HTMLObjectElement interface: attribute align +PASS HTMLObjectElement interface: attribute archive +PASS HTMLObjectElement interface: attribute code +PASS HTMLObjectElement interface: attribute declare +PASS HTMLObjectElement interface: attribute hspace +PASS HTMLObjectElement interface: attribute standby +PASS HTMLObjectElement interface: attribute vspace +PASS HTMLObjectElement interface: attribute codeBase +PASS HTMLObjectElement interface: attribute codeType +PASS HTMLObjectElement interface: attribute useMap +PASS HTMLObjectElement interface: attribute border +PASS HTMLObjectElement must be primary interface of document.createElement("object") +PASS Stringification of document.createElement("object") +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "data" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "type" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "name" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "form" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "width" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "height" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "contentDocument" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "contentWindow" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "getSVGDocument()" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "willValidate" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "validity" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "validationMessage" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "checkValidity()" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "reportValidity()" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLObjectElement interface: calling setCustomValidity(DOMString) on document.createElement("object") with too few arguments must throw TypeError +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "align" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "archive" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "code" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "declare" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "hspace" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "standby" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "vspace" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "codeBase" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "codeType" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "useMap" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "border" with the proper type +PASS HTMLParamElement interface: existence and properties of interface object +PASS HTMLParamElement interface object length +PASS HTMLParamElement interface object name +PASS HTMLParamElement interface: existence and properties of interface prototype object +PASS HTMLParamElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLParamElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLParamElement interface: attribute name +PASS HTMLParamElement interface: attribute value +PASS HTMLParamElement interface: attribute type +PASS HTMLParamElement interface: attribute valueType +PASS HTMLParamElement must be primary interface of document.createElement("param") +PASS Stringification of document.createElement("param") +PASS HTMLParamElement interface: document.createElement("param") must inherit property "name" with the proper type +PASS HTMLParamElement interface: document.createElement("param") must inherit property "value" with the proper type +PASS HTMLParamElement interface: document.createElement("param") must inherit property "type" with the proper type +PASS HTMLParamElement interface: document.createElement("param") must inherit property "valueType" with the proper type +PASS HTMLVideoElement interface: existence and properties of interface object +PASS HTMLVideoElement interface object length +PASS HTMLVideoElement interface object name +PASS HTMLVideoElement interface: existence and properties of interface prototype object +PASS HTMLVideoElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLVideoElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLVideoElement interface: attribute width +PASS HTMLVideoElement interface: attribute height +PASS HTMLVideoElement interface: attribute videoWidth +PASS HTMLVideoElement interface: attribute videoHeight +PASS HTMLVideoElement interface: attribute poster +PASS HTMLVideoElement interface: attribute playsInline +PASS HTMLVideoElement must be primary interface of document.createElement("video") +PASS Stringification of document.createElement("video") +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "width" with the proper type +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "height" with the proper type +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "videoWidth" with the proper type +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "videoHeight" with the proper type +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "poster" with the proper type +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "playsInline" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "error" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "src" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "srcObject" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "currentSrc" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "crossOrigin" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "NETWORK_EMPTY" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "NETWORK_IDLE" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "NETWORK_LOADING" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "NETWORK_NO_SOURCE" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "networkState" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "preload" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "buffered" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "load()" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "canPlayType(DOMString)" with the proper type +PASS HTMLMediaElement interface: calling canPlayType(DOMString) on document.createElement("video") with too few arguments must throw TypeError +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_NOTHING" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_METADATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_CURRENT_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_FUTURE_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_ENOUGH_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "readyState" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "seeking" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "currentTime" with the proper type +FAIL HTMLMediaElement interface: document.createElement("video") must inherit property "fastSeek(double)" with the proper type assert_inherits: property "fastSeek" not found in prototype chain +FAIL HTMLMediaElement interface: calling fastSeek(double) on document.createElement("video") with too few arguments must throw TypeError assert_inherits: property "fastSeek" not found in prototype chain +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "duration" with the proper type +FAIL HTMLMediaElement interface: document.createElement("video") must inherit property "getStartDate()" with the proper type assert_inherits: property "getStartDate" not found in prototype chain +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "paused" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "defaultPlaybackRate" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "playbackRate" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "preservesPitch" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "played" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "seekable" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "ended" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "autoplay" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "loop" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "play()" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "pause()" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "controls" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "volume" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "muted" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "defaultMuted" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "audioTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "videoTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "textTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "addTextTrack(TextTrackKind, optional DOMString, optional DOMString)" with the proper type +PASS HTMLMediaElement interface: calling addTextTrack(TextTrackKind, optional DOMString, optional DOMString) on document.createElement("video") with too few arguments must throw TypeError +PASS HTMLAudioElement interface: existence and properties of interface object +PASS HTMLAudioElement interface object length +PASS HTMLAudioElement interface object name +PASS HTMLAudioElement interface: named constructor +PASS HTMLAudioElement interface: named constructor object +PASS HTMLAudioElement interface: named constructor prototype property +PASS HTMLAudioElement interface: named constructor name +PASS HTMLAudioElement interface: named constructor length +PASS HTMLAudioElement interface: named constructor without 'new' +PASS HTMLAudioElement interface: existence and properties of interface prototype object +PASS HTMLAudioElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLAudioElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLAudioElement must be primary interface of document.createElement("audio") +PASS Stringification of document.createElement("audio") +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "error" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "src" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "srcObject" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "currentSrc" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "crossOrigin" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "NETWORK_EMPTY" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "NETWORK_IDLE" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "NETWORK_LOADING" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "NETWORK_NO_SOURCE" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "networkState" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "preload" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "buffered" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "load()" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "canPlayType(DOMString)" with the proper type +PASS HTMLMediaElement interface: calling canPlayType(DOMString) on document.createElement("audio") with too few arguments must throw TypeError +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_NOTHING" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_METADATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_CURRENT_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_FUTURE_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_ENOUGH_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "readyState" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "seeking" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "currentTime" with the proper type +FAIL HTMLMediaElement interface: document.createElement("audio") must inherit property "fastSeek(double)" with the proper type assert_inherits: property "fastSeek" not found in prototype chain +FAIL HTMLMediaElement interface: calling fastSeek(double) on document.createElement("audio") with too few arguments must throw TypeError assert_inherits: property "fastSeek" not found in prototype chain +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "duration" with the proper type +FAIL HTMLMediaElement interface: document.createElement("audio") must inherit property "getStartDate()" with the proper type assert_inherits: property "getStartDate" not found in prototype chain +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "paused" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "defaultPlaybackRate" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "playbackRate" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "preservesPitch" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "played" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "seekable" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "ended" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "autoplay" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "loop" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "play()" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "pause()" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "controls" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "volume" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "muted" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "defaultMuted" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "audioTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "videoTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "textTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "addTextTrack(TextTrackKind, optional DOMString, optional DOMString)" with the proper type +PASS HTMLMediaElement interface: calling addTextTrack(TextTrackKind, optional DOMString, optional DOMString) on document.createElement("audio") with too few arguments must throw TypeError +PASS HTMLAudioElement must be primary interface of new Audio() +PASS Stringification of new Audio() +PASS HTMLMediaElement interface: new Audio() must inherit property "error" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "src" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "srcObject" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "currentSrc" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "crossOrigin" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "NETWORK_EMPTY" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "NETWORK_IDLE" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "NETWORK_LOADING" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "NETWORK_NO_SOURCE" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "networkState" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "preload" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "buffered" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "load()" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "canPlayType(DOMString)" with the proper type +PASS HTMLMediaElement interface: calling canPlayType(DOMString) on new Audio() with too few arguments must throw TypeError +PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_NOTHING" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_METADATA" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_CURRENT_DATA" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_FUTURE_DATA" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_ENOUGH_DATA" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "readyState" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "seeking" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "currentTime" with the proper type +FAIL HTMLMediaElement interface: new Audio() must inherit property "fastSeek(double)" with the proper type assert_inherits: property "fastSeek" not found in prototype chain +FAIL HTMLMediaElement interface: calling fastSeek(double) on new Audio() with too few arguments must throw TypeError assert_inherits: property "fastSeek" not found in prototype chain +PASS HTMLMediaElement interface: new Audio() must inherit property "duration" with the proper type +FAIL HTMLMediaElement interface: new Audio() must inherit property "getStartDate()" with the proper type assert_inherits: property "getStartDate" not found in prototype chain +PASS HTMLMediaElement interface: new Audio() must inherit property "paused" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "defaultPlaybackRate" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "playbackRate" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "preservesPitch" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "played" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "seekable" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "ended" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "autoplay" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "loop" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "play()" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "pause()" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "controls" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "volume" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "muted" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "defaultMuted" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "audioTracks" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "videoTracks" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "textTracks" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "addTextTrack(TextTrackKind, optional DOMString, optional DOMString)" with the proper type +PASS HTMLMediaElement interface: calling addTextTrack(TextTrackKind, optional DOMString, optional DOMString) on new Audio() with too few arguments must throw TypeError +PASS HTMLTrackElement interface: existence and properties of interface object +PASS HTMLTrackElement interface object length +PASS HTMLTrackElement interface object name +PASS HTMLTrackElement interface: existence and properties of interface prototype object +PASS HTMLTrackElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTrackElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTrackElement interface: attribute kind +PASS HTMLTrackElement interface: attribute src +PASS HTMLTrackElement interface: attribute srclang +PASS HTMLTrackElement interface: attribute label +PASS HTMLTrackElement interface: attribute default +PASS HTMLTrackElement interface: constant NONE on interface object +PASS HTMLTrackElement interface: constant NONE on interface prototype object +PASS HTMLTrackElement interface: constant LOADING on interface object +PASS HTMLTrackElement interface: constant LOADING on interface prototype object +PASS HTMLTrackElement interface: constant LOADED on interface object +PASS HTMLTrackElement interface: constant LOADED on interface prototype object +PASS HTMLTrackElement interface: constant ERROR on interface object +PASS HTMLTrackElement interface: constant ERROR on interface prototype object +PASS HTMLTrackElement interface: attribute readyState +PASS HTMLTrackElement interface: attribute track +PASS HTMLTrackElement must be primary interface of document.createElement("track") +PASS Stringification of document.createElement("track") +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "kind" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "src" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "srclang" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "label" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "default" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "NONE" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "LOADING" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "LOADED" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "ERROR" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "readyState" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "track" with the proper type +PASS HTMLMediaElement interface: existence and properties of interface object +PASS HTMLMediaElement interface object length +PASS HTMLMediaElement interface object name +PASS HTMLMediaElement interface: existence and properties of interface prototype object +PASS HTMLMediaElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMediaElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMediaElement interface: attribute error +PASS HTMLMediaElement interface: attribute src +PASS HTMLMediaElement interface: attribute srcObject +PASS HTMLMediaElement interface: attribute currentSrc +PASS HTMLMediaElement interface: attribute crossOrigin +PASS HTMLMediaElement interface: constant NETWORK_EMPTY on interface object +PASS HTMLMediaElement interface: constant NETWORK_EMPTY on interface prototype object +PASS HTMLMediaElement interface: constant NETWORK_IDLE on interface object +PASS HTMLMediaElement interface: constant NETWORK_IDLE on interface prototype object +PASS HTMLMediaElement interface: constant NETWORK_LOADING on interface object +PASS HTMLMediaElement interface: constant NETWORK_LOADING on interface prototype object +PASS HTMLMediaElement interface: constant NETWORK_NO_SOURCE on interface object +PASS HTMLMediaElement interface: constant NETWORK_NO_SOURCE on interface prototype object +PASS HTMLMediaElement interface: attribute networkState +PASS HTMLMediaElement interface: attribute preload +PASS HTMLMediaElement interface: attribute buffered +PASS HTMLMediaElement interface: operation load() +PASS HTMLMediaElement interface: operation canPlayType(DOMString) +PASS HTMLMediaElement interface: constant HAVE_NOTHING on interface object +PASS HTMLMediaElement interface: constant HAVE_NOTHING on interface prototype object +PASS HTMLMediaElement interface: constant HAVE_METADATA on interface object +PASS HTMLMediaElement interface: constant HAVE_METADATA on interface prototype object +PASS HTMLMediaElement interface: constant HAVE_CURRENT_DATA on interface object +PASS HTMLMediaElement interface: constant HAVE_CURRENT_DATA on interface prototype object +PASS HTMLMediaElement interface: constant HAVE_FUTURE_DATA on interface object +PASS HTMLMediaElement interface: constant HAVE_FUTURE_DATA on interface prototype object +PASS HTMLMediaElement interface: constant HAVE_ENOUGH_DATA on interface object +PASS HTMLMediaElement interface: constant HAVE_ENOUGH_DATA on interface prototype object +PASS HTMLMediaElement interface: attribute readyState +PASS HTMLMediaElement interface: attribute seeking +PASS HTMLMediaElement interface: attribute currentTime +FAIL HTMLMediaElement interface: operation fastSeek(double) assert_own_property: interface prototype object missing non-static operation expected property "fastSeek" missing +PASS HTMLMediaElement interface: attribute duration +FAIL HTMLMediaElement interface: operation getStartDate() assert_own_property: interface prototype object missing non-static operation expected property "getStartDate" missing +PASS HTMLMediaElement interface: attribute paused +PASS HTMLMediaElement interface: attribute defaultPlaybackRate +PASS HTMLMediaElement interface: attribute playbackRate +PASS HTMLMediaElement interface: attribute preservesPitch +PASS HTMLMediaElement interface: attribute played +PASS HTMLMediaElement interface: attribute seekable +PASS HTMLMediaElement interface: attribute ended +PASS HTMLMediaElement interface: attribute autoplay +PASS HTMLMediaElement interface: attribute loop +PASS HTMLMediaElement interface: operation play() +PASS HTMLMediaElement interface: operation pause() +PASS HTMLMediaElement interface: attribute controls +PASS HTMLMediaElement interface: attribute volume +PASS HTMLMediaElement interface: attribute muted +PASS HTMLMediaElement interface: attribute defaultMuted +PASS HTMLMediaElement interface: attribute audioTracks +PASS HTMLMediaElement interface: attribute videoTracks +PASS HTMLMediaElement interface: attribute textTracks +PASS HTMLMediaElement interface: operation addTextTrack(TextTrackKind, optional DOMString, optional DOMString) +PASS HTMLMapElement interface: existence and properties of interface object +PASS HTMLMapElement interface object length +PASS HTMLMapElement interface object name +PASS HTMLMapElement interface: existence and properties of interface prototype object +PASS HTMLMapElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMapElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMapElement interface: attribute name +PASS HTMLMapElement interface: attribute areas +PASS HTMLMapElement must be primary interface of document.createElement("map") +PASS Stringification of document.createElement("map") +PASS HTMLMapElement interface: document.createElement("map") must inherit property "name" with the proper type +PASS HTMLMapElement interface: document.createElement("map") must inherit property "areas" with the proper type +PASS HTMLAreaElement interface: existence and properties of interface object +PASS HTMLAreaElement interface object length +PASS HTMLAreaElement interface object name +PASS HTMLAreaElement interface: existence and properties of interface prototype object +PASS HTMLAreaElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLAreaElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLAreaElement interface: attribute alt +PASS HTMLAreaElement interface: attribute coords +PASS HTMLAreaElement interface: attribute shape +PASS HTMLAreaElement interface: attribute target +PASS HTMLAreaElement interface: attribute download +PASS HTMLAreaElement interface: attribute ping +PASS HTMLAreaElement interface: attribute rel +PASS HTMLAreaElement interface: attribute relList +PASS HTMLAreaElement interface: attribute referrerPolicy +PASS HTMLAreaElement interface: attribute noHref +PASS HTMLAreaElement interface: attribute href +PASS HTMLAreaElement interface: stringifier +PASS HTMLAreaElement interface: attribute origin +PASS HTMLAreaElement interface: attribute protocol +PASS HTMLAreaElement interface: attribute username +PASS HTMLAreaElement interface: attribute password +PASS HTMLAreaElement interface: attribute host +PASS HTMLAreaElement interface: attribute hostname +PASS HTMLAreaElement interface: attribute port +PASS HTMLAreaElement interface: attribute pathname +PASS HTMLAreaElement interface: attribute search +PASS HTMLAreaElement interface: attribute hash +PASS HTMLAreaElement must be primary interface of document.createElement("area") +PASS Stringification of document.createElement("area") +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "alt" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "coords" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "shape" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "target" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "download" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "ping" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "rel" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "relList" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "referrerPolicy" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "noHref" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "href" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "origin" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "protocol" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "username" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "password" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "host" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "hostname" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "port" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "pathname" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "search" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "hash" with the proper type +PASS HTMLTableElement interface: existence and properties of interface object +PASS HTMLTableElement interface object length +PASS HTMLTableElement interface object name +PASS HTMLTableElement interface: existence and properties of interface prototype object +PASS HTMLTableElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableElement interface: attribute caption +PASS HTMLTableElement interface: operation createCaption() +PASS HTMLTableElement interface: operation deleteCaption() +PASS HTMLTableElement interface: attribute tHead +PASS HTMLTableElement interface: operation createTHead() +PASS HTMLTableElement interface: operation deleteTHead() +PASS HTMLTableElement interface: attribute tFoot +PASS HTMLTableElement interface: operation createTFoot() +PASS HTMLTableElement interface: operation deleteTFoot() +PASS HTMLTableElement interface: attribute tBodies +PASS HTMLTableElement interface: operation createTBody() +PASS HTMLTableElement interface: attribute rows +PASS HTMLTableElement interface: operation insertRow(optional long) +PASS HTMLTableElement interface: operation deleteRow(long) +PASS HTMLTableElement interface: attribute align +PASS HTMLTableElement interface: attribute border +PASS HTMLTableElement interface: attribute frame +PASS HTMLTableElement interface: attribute rules +PASS HTMLTableElement interface: attribute summary +PASS HTMLTableElement interface: attribute width +PASS HTMLTableElement interface: attribute bgColor +PASS HTMLTableElement interface: attribute cellPadding +PASS HTMLTableElement interface: attribute cellSpacing +PASS HTMLTableElement must be primary interface of document.createElement("table") +PASS Stringification of document.createElement("table") +PASS HTMLTableElement interface: document.createElement("table") must inherit property "caption" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "createCaption()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "deleteCaption()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "tHead" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "createTHead()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "deleteTHead()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "tFoot" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "createTFoot()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "deleteTFoot()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "tBodies" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "createTBody()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "rows" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "insertRow(optional long)" with the proper type +PASS HTMLTableElement interface: calling insertRow(optional long) on document.createElement("table") with too few arguments must throw TypeError +PASS HTMLTableElement interface: document.createElement("table") must inherit property "deleteRow(long)" with the proper type +PASS HTMLTableElement interface: calling deleteRow(long) on document.createElement("table") with too few arguments must throw TypeError +PASS HTMLTableElement interface: document.createElement("table") must inherit property "align" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "border" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "frame" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "rules" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "summary" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "width" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "bgColor" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "cellPadding" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "cellSpacing" with the proper type +PASS HTMLTableCaptionElement interface: existence and properties of interface object +PASS HTMLTableCaptionElement interface object length +PASS HTMLTableCaptionElement interface object name +PASS HTMLTableCaptionElement interface: existence and properties of interface prototype object +PASS HTMLTableCaptionElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableCaptionElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableCaptionElement interface: attribute align +PASS HTMLTableCaptionElement must be primary interface of document.createElement("caption") +PASS Stringification of document.createElement("caption") +PASS HTMLTableCaptionElement interface: document.createElement("caption") must inherit property "align" with the proper type +PASS HTMLTableColElement interface: existence and properties of interface object +PASS HTMLTableColElement interface object length +PASS HTMLTableColElement interface object name +PASS HTMLTableColElement interface: existence and properties of interface prototype object +PASS HTMLTableColElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableColElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableColElement interface: attribute span +PASS HTMLTableColElement interface: attribute align +PASS HTMLTableColElement interface: attribute ch +PASS HTMLTableColElement interface: attribute chOff +PASS HTMLTableColElement interface: attribute vAlign +PASS HTMLTableColElement interface: attribute width +PASS HTMLTableColElement must be primary interface of document.createElement("colgroup") +PASS Stringification of document.createElement("colgroup") +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "span" with the proper type +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "align" with the proper type +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "ch" with the proper type +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "chOff" with the proper type +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "vAlign" with the proper type +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "width" with the proper type +PASS HTMLTableColElement must be primary interface of document.createElement("col") +PASS Stringification of document.createElement("col") +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "span" with the proper type +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "align" with the proper type +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "ch" with the proper type +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "chOff" with the proper type +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "vAlign" with the proper type +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "width" with the proper type +PASS HTMLTableSectionElement interface: existence and properties of interface object +PASS HTMLTableSectionElement interface object length +PASS HTMLTableSectionElement interface object name +PASS HTMLTableSectionElement interface: existence and properties of interface prototype object +PASS HTMLTableSectionElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableSectionElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableSectionElement interface: attribute rows +PASS HTMLTableSectionElement interface: operation insertRow(optional long) +PASS HTMLTableSectionElement interface: operation deleteRow(long) +PASS HTMLTableSectionElement interface: attribute align +PASS HTMLTableSectionElement interface: attribute ch +PASS HTMLTableSectionElement interface: attribute chOff +PASS HTMLTableSectionElement interface: attribute vAlign +PASS HTMLTableSectionElement must be primary interface of document.createElement("tbody") +PASS Stringification of document.createElement("tbody") +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "rows" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "insertRow(optional long)" with the proper type +PASS HTMLTableSectionElement interface: calling insertRow(optional long) on document.createElement("tbody") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "deleteRow(long)" with the proper type +PASS HTMLTableSectionElement interface: calling deleteRow(long) on document.createElement("tbody") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "align" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "ch" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "chOff" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "vAlign" with the proper type +PASS HTMLTableSectionElement must be primary interface of document.createElement("thead") +PASS Stringification of document.createElement("thead") +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "rows" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "insertRow(optional long)" with the proper type +PASS HTMLTableSectionElement interface: calling insertRow(optional long) on document.createElement("thead") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "deleteRow(long)" with the proper type +PASS HTMLTableSectionElement interface: calling deleteRow(long) on document.createElement("thead") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "align" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "ch" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "chOff" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "vAlign" with the proper type +PASS HTMLTableSectionElement must be primary interface of document.createElement("tfoot") +PASS Stringification of document.createElement("tfoot") +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "rows" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "insertRow(optional long)" with the proper type +PASS HTMLTableSectionElement interface: calling insertRow(optional long) on document.createElement("tfoot") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "deleteRow(long)" with the proper type +PASS HTMLTableSectionElement interface: calling deleteRow(long) on document.createElement("tfoot") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "align" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "ch" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "chOff" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "vAlign" with the proper type +PASS HTMLTableRowElement interface: existence and properties of interface object +PASS HTMLTableRowElement interface object length +PASS HTMLTableRowElement interface object name +PASS HTMLTableRowElement interface: existence and properties of interface prototype object +PASS HTMLTableRowElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableRowElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableRowElement interface: attribute rowIndex +PASS HTMLTableRowElement interface: attribute sectionRowIndex +PASS HTMLTableRowElement interface: attribute cells +PASS HTMLTableRowElement interface: operation insertCell(optional long) +PASS HTMLTableRowElement interface: operation deleteCell(long) +PASS HTMLTableRowElement interface: attribute align +PASS HTMLTableRowElement interface: attribute ch +PASS HTMLTableRowElement interface: attribute chOff +PASS HTMLTableRowElement interface: attribute vAlign +PASS HTMLTableRowElement interface: attribute bgColor +PASS HTMLTableRowElement must be primary interface of document.createElement("tr") +PASS Stringification of document.createElement("tr") +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "rowIndex" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "sectionRowIndex" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "cells" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "insertCell(optional long)" with the proper type +PASS HTMLTableRowElement interface: calling insertCell(optional long) on document.createElement("tr") with too few arguments must throw TypeError +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "deleteCell(long)" with the proper type +PASS HTMLTableRowElement interface: calling deleteCell(long) on document.createElement("tr") with too few arguments must throw TypeError +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "align" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "ch" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "chOff" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "vAlign" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "bgColor" with the proper type +PASS HTMLTableCellElement interface: existence and properties of interface object +PASS HTMLTableCellElement interface object length +PASS HTMLTableCellElement interface object name +PASS HTMLTableCellElement interface: existence and properties of interface prototype object +PASS HTMLTableCellElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableCellElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableCellElement interface: attribute colSpan +PASS HTMLTableCellElement interface: attribute rowSpan +PASS HTMLTableCellElement interface: attribute headers +PASS HTMLTableCellElement interface: attribute cellIndex +PASS HTMLTableCellElement interface: attribute scope +PASS HTMLTableCellElement interface: attribute abbr +PASS HTMLTableCellElement interface: attribute align +PASS HTMLTableCellElement interface: attribute axis +PASS HTMLTableCellElement interface: attribute height +PASS HTMLTableCellElement interface: attribute width +PASS HTMLTableCellElement interface: attribute ch +PASS HTMLTableCellElement interface: attribute chOff +PASS HTMLTableCellElement interface: attribute noWrap +PASS HTMLTableCellElement interface: attribute vAlign +PASS HTMLTableCellElement interface: attribute bgColor +PASS HTMLTableCellElement must be primary interface of document.createElement("td") +PASS Stringification of document.createElement("td") +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "colSpan" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "rowSpan" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "headers" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "cellIndex" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "scope" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "abbr" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "align" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "axis" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "height" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "width" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "ch" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "chOff" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "noWrap" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "vAlign" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "bgColor" with the proper type +PASS HTMLTableCellElement must be primary interface of document.createElement("th") +PASS Stringification of document.createElement("th") +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "colSpan" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "rowSpan" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "headers" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "cellIndex" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "scope" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "abbr" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "align" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "axis" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "height" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "width" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "ch" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "chOff" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "noWrap" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "vAlign" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "bgColor" with the proper type +PASS HTMLFormElement interface: existence and properties of interface object +PASS HTMLFormElement interface object length +PASS HTMLFormElement interface object name +PASS HTMLFormElement interface: existence and properties of interface prototype object +PASS HTMLFormElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFormElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFormElement interface: attribute acceptCharset +PASS HTMLFormElement interface: attribute action +PASS HTMLFormElement interface: attribute autocomplete +PASS HTMLFormElement interface: attribute enctype +PASS HTMLFormElement interface: attribute encoding +PASS HTMLFormElement interface: attribute method +PASS HTMLFormElement interface: attribute name +PASS HTMLFormElement interface: attribute noValidate +PASS HTMLFormElement interface: attribute target +FAIL HTMLFormElement interface: attribute rel assert_true: The prototype object must have a property "rel" expected true got false +FAIL HTMLFormElement interface: attribute relList assert_true: The prototype object must have a property "relList" expected true got false +PASS HTMLFormElement interface: attribute elements +PASS HTMLFormElement interface: attribute length +PASS HTMLFormElement interface: operation submit() +PASS HTMLFormElement interface: operation requestSubmit(optional HTMLElement?) +PASS HTMLFormElement interface: operation reset() +PASS HTMLFormElement interface: operation checkValidity() +PASS HTMLFormElement interface: operation reportValidity() +PASS HTMLFormElement must be primary interface of document.createElement("form") +PASS Stringification of document.createElement("form") +PASS HTMLFormElement interface: document.createElement("form") must inherit property "acceptCharset" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "action" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "autocomplete" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "enctype" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "encoding" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "method" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "name" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "noValidate" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "target" with the proper type +FAIL HTMLFormElement interface: document.createElement("form") must inherit property "rel" with the proper type assert_inherits: property "rel" not found in prototype chain +FAIL HTMLFormElement interface: document.createElement("form") must inherit property "relList" with the proper type assert_inherits: property "relList" not found in prototype chain +PASS HTMLFormElement interface: document.createElement("form") must inherit property "elements" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "length" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "submit()" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "requestSubmit(optional HTMLElement?)" with the proper type +PASS HTMLFormElement interface: calling requestSubmit(optional HTMLElement?) on document.createElement("form") with too few arguments must throw TypeError +PASS HTMLFormElement interface: document.createElement("form") must inherit property "reset()" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "checkValidity()" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "reportValidity()" with the proper type +PASS HTMLLabelElement interface: existence and properties of interface object +PASS HTMLLabelElement interface object length +PASS HTMLLabelElement interface object name +PASS HTMLLabelElement interface: existence and properties of interface prototype object +PASS HTMLLabelElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLLabelElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLLabelElement interface: attribute form +PASS HTMLLabelElement interface: attribute htmlFor +PASS HTMLLabelElement interface: attribute control +PASS HTMLLabelElement must be primary interface of document.createElement("label") +PASS Stringification of document.createElement("label") +PASS HTMLLabelElement interface: document.createElement("label") must inherit property "form" with the proper type +PASS HTMLLabelElement interface: document.createElement("label") must inherit property "htmlFor" with the proper type +PASS HTMLLabelElement interface: document.createElement("label") must inherit property "control" with the proper type +PASS HTMLInputElement interface: existence and properties of interface object +PASS HTMLInputElement interface object length +PASS HTMLInputElement interface object name +PASS HTMLInputElement interface: existence and properties of interface prototype object +PASS HTMLInputElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLInputElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLInputElement interface: attribute accept +PASS HTMLInputElement interface: attribute alt +PASS HTMLInputElement interface: attribute autocomplete +PASS HTMLInputElement interface: attribute defaultChecked +PASS HTMLInputElement interface: attribute checked +PASS HTMLInputElement interface: attribute dirName +PASS HTMLInputElement interface: attribute disabled +PASS HTMLInputElement interface: attribute form +PASS HTMLInputElement interface: attribute files +PASS HTMLInputElement interface: attribute formAction +PASS HTMLInputElement interface: attribute formEnctype +PASS HTMLInputElement interface: attribute formMethod +PASS HTMLInputElement interface: attribute formNoValidate +PASS HTMLInputElement interface: attribute formTarget +PASS HTMLInputElement interface: attribute height +PASS HTMLInputElement interface: attribute indeterminate +PASS HTMLInputElement interface: attribute list +PASS HTMLInputElement interface: attribute max +PASS HTMLInputElement interface: attribute maxLength +PASS HTMLInputElement interface: attribute min +PASS HTMLInputElement interface: attribute minLength +PASS HTMLInputElement interface: attribute multiple +PASS HTMLInputElement interface: attribute name +PASS HTMLInputElement interface: attribute pattern +PASS HTMLInputElement interface: attribute placeholder +PASS HTMLInputElement interface: attribute readOnly +PASS HTMLInputElement interface: attribute required +PASS HTMLInputElement interface: attribute size +PASS HTMLInputElement interface: attribute src +PASS HTMLInputElement interface: attribute step +PASS HTMLInputElement interface: attribute type +PASS HTMLInputElement interface: attribute defaultValue +PASS HTMLInputElement interface: attribute value +PASS HTMLInputElement interface: attribute valueAsDate +PASS HTMLInputElement interface: attribute valueAsNumber +PASS HTMLInputElement interface: attribute width +PASS HTMLInputElement interface: operation stepUp(optional long) +PASS HTMLInputElement interface: operation stepDown(optional long) +PASS HTMLInputElement interface: attribute willValidate +PASS HTMLInputElement interface: attribute validity +PASS HTMLInputElement interface: attribute validationMessage +PASS HTMLInputElement interface: operation checkValidity() +PASS HTMLInputElement interface: operation reportValidity() +PASS HTMLInputElement interface: operation setCustomValidity(DOMString) +PASS HTMLInputElement interface: attribute labels +PASS HTMLInputElement interface: operation select() +PASS HTMLInputElement interface: attribute selectionStart +PASS HTMLInputElement interface: attribute selectionEnd +PASS HTMLInputElement interface: attribute selectionDirection +PASS HTMLInputElement interface: operation setRangeText(DOMString) +PASS HTMLInputElement interface: operation setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) +PASS HTMLInputElement interface: operation setSelectionRange(unsigned long, unsigned long, optional DOMString) +PASS HTMLInputElement interface: attribute align +PASS HTMLInputElement interface: attribute useMap +PASS HTMLInputElement must be primary interface of document.createElement("input") +PASS Stringification of document.createElement("input") +PASS HTMLInputElement interface: document.createElement("input") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "form" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "files" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "height" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "list" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "max" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "min" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "name" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "required" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "size" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "src" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "step" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "type" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "value" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "width" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "align" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("text") +PASS Stringification of createInput("text") +PASS HTMLInputElement interface: createInput("text") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("hidden") +PASS Stringification of createInput("hidden") +PASS HTMLInputElement interface: createInput("hidden") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("search") +PASS Stringification of createInput("search") +PASS HTMLInputElement interface: createInput("search") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("tel") +PASS Stringification of createInput("tel") +PASS HTMLInputElement interface: createInput("tel") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("url") +PASS Stringification of createInput("url") +PASS HTMLInputElement interface: createInput("url") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("email") +PASS Stringification of createInput("email") +PASS HTMLInputElement interface: createInput("email") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("password") +PASS Stringification of createInput("password") +PASS HTMLInputElement interface: createInput("password") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("date") +PASS Stringification of createInput("date") +PASS HTMLInputElement interface: createInput("date") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("month") +PASS Stringification of createInput("month") +PASS HTMLInputElement interface: createInput("month") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("week") +PASS Stringification of createInput("week") +PASS HTMLInputElement interface: createInput("week") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("time") +PASS Stringification of createInput("time") +PASS HTMLInputElement interface: createInput("time") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("datetime-local") +PASS Stringification of createInput("datetime-local") +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("number") +PASS Stringification of createInput("number") +PASS HTMLInputElement interface: createInput("number") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("range") +PASS Stringification of createInput("range") +PASS HTMLInputElement interface: createInput("range") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("color") +PASS Stringification of createInput("color") +PASS HTMLInputElement interface: createInput("color") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("checkbox") +PASS Stringification of createInput("checkbox") +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("radio") +PASS Stringification of createInput("radio") +PASS HTMLInputElement interface: createInput("radio") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("file") +PASS Stringification of createInput("file") +PASS HTMLInputElement interface: createInput("file") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("submit") +PASS Stringification of createInput("submit") +PASS HTMLInputElement interface: createInput("submit") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("image") +PASS Stringification of createInput("image") +PASS HTMLInputElement interface: createInput("image") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("reset") +PASS Stringification of createInput("reset") +PASS HTMLInputElement interface: createInput("reset") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("button") +PASS Stringification of createInput("button") +PASS HTMLInputElement interface: createInput("button") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "useMap" with the proper type +PASS HTMLButtonElement interface: existence and properties of interface object +PASS HTMLButtonElement interface object length +PASS HTMLButtonElement interface object name +PASS HTMLButtonElement interface: existence and properties of interface prototype object +PASS HTMLButtonElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLButtonElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLButtonElement interface: attribute disabled +PASS HTMLButtonElement interface: attribute form +PASS HTMLButtonElement interface: attribute formAction +PASS HTMLButtonElement interface: attribute formEnctype +PASS HTMLButtonElement interface: attribute formMethod +PASS HTMLButtonElement interface: attribute formNoValidate +PASS HTMLButtonElement interface: attribute formTarget +PASS HTMLButtonElement interface: attribute name +PASS HTMLButtonElement interface: attribute type +PASS HTMLButtonElement interface: attribute value +PASS HTMLButtonElement interface: attribute willValidate +PASS HTMLButtonElement interface: attribute validity +PASS HTMLButtonElement interface: attribute validationMessage +PASS HTMLButtonElement interface: operation checkValidity() +PASS HTMLButtonElement interface: operation reportValidity() +PASS HTMLButtonElement interface: operation setCustomValidity(DOMString) +PASS HTMLButtonElement interface: attribute labels +PASS HTMLButtonElement must be primary interface of document.createElement("button") +PASS Stringification of document.createElement("button") +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "disabled" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "form" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "formAction" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "formEnctype" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "formMethod" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "formNoValidate" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "formTarget" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "name" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "type" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "value" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "willValidate" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "validity" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "validationMessage" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "checkValidity()" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "reportValidity()" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLButtonElement interface: calling setCustomValidity(DOMString) on document.createElement("button") with too few arguments must throw TypeError +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "labels" with the proper type +PASS HTMLSelectElement interface: existence and properties of interface object +PASS HTMLSelectElement interface object length +PASS HTMLSelectElement interface object name +PASS HTMLSelectElement interface: existence and properties of interface prototype object +PASS HTMLSelectElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLSelectElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLSelectElement interface: attribute autocomplete +PASS HTMLSelectElement interface: attribute disabled +PASS HTMLSelectElement interface: attribute form +PASS HTMLSelectElement interface: attribute multiple +PASS HTMLSelectElement interface: attribute name +PASS HTMLSelectElement interface: attribute required +PASS HTMLSelectElement interface: attribute size +PASS HTMLSelectElement interface: attribute type +PASS HTMLSelectElement interface: attribute options +PASS HTMLSelectElement interface: attribute length +PASS HTMLSelectElement interface: operation item(unsigned long) +PASS HTMLSelectElement interface: operation namedItem(DOMString) +PASS HTMLSelectElement interface: operation add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?) +PASS HTMLSelectElement interface: operation remove() +PASS HTMLSelectElement interface: operation remove(long) +PASS HTMLSelectElement interface: attribute selectedOptions +PASS HTMLSelectElement interface: attribute selectedIndex +PASS HTMLSelectElement interface: attribute value +PASS HTMLSelectElement interface: attribute willValidate +PASS HTMLSelectElement interface: attribute validity +PASS HTMLSelectElement interface: attribute validationMessage +PASS HTMLSelectElement interface: operation checkValidity() +PASS HTMLSelectElement interface: operation reportValidity() +PASS HTMLSelectElement interface: operation setCustomValidity(DOMString) +PASS HTMLSelectElement interface: attribute labels +PASS HTMLSelectElement must be primary interface of document.createElement("select") +PASS Stringification of document.createElement("select") +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "autocomplete" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "disabled" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "form" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "multiple" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "name" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "required" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "size" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "type" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "options" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "length" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "item(unsigned long)" with the proper type +PASS HTMLSelectElement interface: calling item(unsigned long) on document.createElement("select") with too few arguments must throw TypeError +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "namedItem(DOMString)" with the proper type +PASS HTMLSelectElement interface: calling namedItem(DOMString) on document.createElement("select") with too few arguments must throw TypeError +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?)" with the proper type +PASS HTMLSelectElement interface: calling add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?) on document.createElement("select") with too few arguments must throw TypeError +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "remove()" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "remove(long)" with the proper type +PASS HTMLSelectElement interface: calling remove(long) on document.createElement("select") with too few arguments must throw TypeError +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "selectedOptions" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "selectedIndex" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "value" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "willValidate" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "validity" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "validationMessage" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "checkValidity()" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "reportValidity()" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLSelectElement interface: calling setCustomValidity(DOMString) on document.createElement("select") with too few arguments must throw TypeError +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "labels" with the proper type +PASS HTMLDataListElement interface: existence and properties of interface object +PASS HTMLDataListElement interface object length +PASS HTMLDataListElement interface object name +PASS HTMLDataListElement interface: existence and properties of interface prototype object +PASS HTMLDataListElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDataListElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDataListElement interface: attribute options +PASS HTMLDataListElement must be primary interface of document.createElement("datalist") +PASS Stringification of document.createElement("datalist") +PASS HTMLDataListElement interface: document.createElement("datalist") must inherit property "options" with the proper type +PASS HTMLOptGroupElement interface: existence and properties of interface object +PASS HTMLOptGroupElement interface object length +PASS HTMLOptGroupElement interface object name +PASS HTMLOptGroupElement interface: existence and properties of interface prototype object +PASS HTMLOptGroupElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLOptGroupElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLOptGroupElement interface: attribute disabled +PASS HTMLOptGroupElement interface: attribute label +PASS HTMLOptGroupElement must be primary interface of document.createElement("optgroup") +PASS Stringification of document.createElement("optgroup") +PASS HTMLOptGroupElement interface: document.createElement("optgroup") must inherit property "disabled" with the proper type +PASS HTMLOptGroupElement interface: document.createElement("optgroup") must inherit property "label" with the proper type +PASS HTMLOptionElement interface: existence and properties of interface object +PASS HTMLOptionElement interface object length +PASS HTMLOptionElement interface object name +PASS HTMLOptionElement interface: named constructor +PASS HTMLOptionElement interface: named constructor object +PASS HTMLOptionElement interface: named constructor prototype property +PASS HTMLOptionElement interface: named constructor name +PASS HTMLOptionElement interface: named constructor length +PASS HTMLOptionElement interface: named constructor without 'new' +PASS HTMLOptionElement interface: existence and properties of interface prototype object +PASS HTMLOptionElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLOptionElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLOptionElement interface: attribute disabled +PASS HTMLOptionElement interface: attribute form +PASS HTMLOptionElement interface: attribute label +PASS HTMLOptionElement interface: attribute defaultSelected +PASS HTMLOptionElement interface: attribute selected +PASS HTMLOptionElement interface: attribute value +PASS HTMLOptionElement interface: attribute text +PASS HTMLOptionElement interface: attribute index +PASS HTMLOptionElement must be primary interface of document.createElement("option") +PASS Stringification of document.createElement("option") +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "disabled" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "form" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "label" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "defaultSelected" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "selected" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "value" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "text" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "index" with the proper type +PASS HTMLOptionElement must be primary interface of new Option() +PASS Stringification of new Option() +PASS HTMLOptionElement interface: new Option() must inherit property "disabled" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "form" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "label" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "defaultSelected" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "selected" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "value" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "text" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "index" with the proper type +PASS HTMLTextAreaElement interface: existence and properties of interface object +PASS HTMLTextAreaElement interface object length +PASS HTMLTextAreaElement interface object name +PASS HTMLTextAreaElement interface: existence and properties of interface prototype object +PASS HTMLTextAreaElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTextAreaElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTextAreaElement interface: attribute autocomplete +PASS HTMLTextAreaElement interface: attribute cols +PASS HTMLTextAreaElement interface: attribute dirName +PASS HTMLTextAreaElement interface: attribute disabled +PASS HTMLTextAreaElement interface: attribute form +PASS HTMLTextAreaElement interface: attribute maxLength +PASS HTMLTextAreaElement interface: attribute minLength +PASS HTMLTextAreaElement interface: attribute name +PASS HTMLTextAreaElement interface: attribute placeholder +PASS HTMLTextAreaElement interface: attribute readOnly +PASS HTMLTextAreaElement interface: attribute required +PASS HTMLTextAreaElement interface: attribute rows +PASS HTMLTextAreaElement interface: attribute wrap +PASS HTMLTextAreaElement interface: attribute type +PASS HTMLTextAreaElement interface: attribute defaultValue +PASS HTMLTextAreaElement interface: attribute value +PASS HTMLTextAreaElement interface: attribute textLength +PASS HTMLTextAreaElement interface: attribute willValidate +PASS HTMLTextAreaElement interface: attribute validity +PASS HTMLTextAreaElement interface: attribute validationMessage +PASS HTMLTextAreaElement interface: operation checkValidity() +PASS HTMLTextAreaElement interface: operation reportValidity() +PASS HTMLTextAreaElement interface: operation setCustomValidity(DOMString) +PASS HTMLTextAreaElement interface: attribute labels +PASS HTMLTextAreaElement interface: operation select() +PASS HTMLTextAreaElement interface: attribute selectionStart +PASS HTMLTextAreaElement interface: attribute selectionEnd +PASS HTMLTextAreaElement interface: attribute selectionDirection +PASS HTMLTextAreaElement interface: operation setRangeText(DOMString) +PASS HTMLTextAreaElement interface: operation setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) +PASS HTMLTextAreaElement interface: operation setSelectionRange(unsigned long, unsigned long, optional DOMString) +PASS HTMLTextAreaElement must be primary interface of document.createElement("textarea") +PASS Stringification of document.createElement("textarea") +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "autocomplete" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "cols" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "dirName" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "disabled" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "form" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "maxLength" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "minLength" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "name" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "placeholder" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "readOnly" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "required" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "rows" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "wrap" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "type" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "defaultValue" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "value" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "textLength" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "willValidate" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "validity" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "validationMessage" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "checkValidity()" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "reportValidity()" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLTextAreaElement interface: calling setCustomValidity(DOMString) on document.createElement("textarea") with too few arguments must throw TypeError +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "labels" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "select()" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "selectionStart" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "selectionEnd" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "selectionDirection" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLTextAreaElement interface: calling setRangeText(DOMString) on document.createElement("textarea") with too few arguments must throw TypeError +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLTextAreaElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on document.createElement("textarea") with too few arguments must throw TypeError +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLTextAreaElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on document.createElement("textarea") with too few arguments must throw TypeError +PASS HTMLOutputElement interface: existence and properties of interface object +PASS HTMLOutputElement interface object length +PASS HTMLOutputElement interface object name +PASS HTMLOutputElement interface: existence and properties of interface prototype object +PASS HTMLOutputElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLOutputElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLOutputElement interface: attribute htmlFor +PASS HTMLOutputElement interface: attribute form +PASS HTMLOutputElement interface: attribute name +PASS HTMLOutputElement interface: attribute type +PASS HTMLOutputElement interface: attribute defaultValue +PASS HTMLOutputElement interface: attribute value +PASS HTMLOutputElement interface: attribute willValidate +PASS HTMLOutputElement interface: attribute validity +PASS HTMLOutputElement interface: attribute validationMessage +PASS HTMLOutputElement interface: operation checkValidity() +PASS HTMLOutputElement interface: operation reportValidity() +PASS HTMLOutputElement interface: operation setCustomValidity(DOMString) +PASS HTMLOutputElement interface: attribute labels +PASS HTMLOutputElement must be primary interface of document.createElement("output") +PASS Stringification of document.createElement("output") +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "htmlFor" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "form" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "name" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "type" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "defaultValue" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "value" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "willValidate" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "validity" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "validationMessage" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "checkValidity()" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "reportValidity()" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLOutputElement interface: calling setCustomValidity(DOMString) on document.createElement("output") with too few arguments must throw TypeError +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "labels" with the proper type +PASS HTMLProgressElement interface: existence and properties of interface object +PASS HTMLProgressElement interface object length +PASS HTMLProgressElement interface object name +PASS HTMLProgressElement interface: existence and properties of interface prototype object +PASS HTMLProgressElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLProgressElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLProgressElement interface: attribute value +PASS HTMLProgressElement interface: attribute max +PASS HTMLProgressElement interface: attribute position +PASS HTMLProgressElement interface: attribute labels +PASS HTMLProgressElement must be primary interface of document.createElement("progress") +PASS Stringification of document.createElement("progress") +PASS HTMLProgressElement interface: document.createElement("progress") must inherit property "value" with the proper type +PASS HTMLProgressElement interface: document.createElement("progress") must inherit property "max" with the proper type +PASS HTMLProgressElement interface: document.createElement("progress") must inherit property "position" with the proper type +PASS HTMLProgressElement interface: document.createElement("progress") must inherit property "labels" with the proper type +PASS HTMLMeterElement interface: existence and properties of interface object +PASS HTMLMeterElement interface object length +PASS HTMLMeterElement interface object name +PASS HTMLMeterElement interface: existence and properties of interface prototype object +PASS HTMLMeterElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMeterElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMeterElement interface: attribute value +PASS HTMLMeterElement interface: attribute min +PASS HTMLMeterElement interface: attribute max +PASS HTMLMeterElement interface: attribute low +PASS HTMLMeterElement interface: attribute high +PASS HTMLMeterElement interface: attribute optimum +PASS HTMLMeterElement interface: attribute labels +PASS HTMLMeterElement must be primary interface of document.createElement("meter") +PASS Stringification of document.createElement("meter") +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "value" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "min" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "max" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "low" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "high" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "optimum" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "labels" with the proper type +PASS HTMLFieldSetElement interface: existence and properties of interface object +PASS HTMLFieldSetElement interface object length +PASS HTMLFieldSetElement interface object name +PASS HTMLFieldSetElement interface: existence and properties of interface prototype object +PASS HTMLFieldSetElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFieldSetElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFieldSetElement interface: attribute disabled +PASS HTMLFieldSetElement interface: attribute form +PASS HTMLFieldSetElement interface: attribute name +PASS HTMLFieldSetElement interface: attribute type +PASS HTMLFieldSetElement interface: attribute elements +PASS HTMLFieldSetElement interface: attribute willValidate +PASS HTMLFieldSetElement interface: attribute validity +PASS HTMLFieldSetElement interface: attribute validationMessage +PASS HTMLFieldSetElement interface: operation checkValidity() +PASS HTMLFieldSetElement interface: operation reportValidity() +PASS HTMLFieldSetElement interface: operation setCustomValidity(DOMString) +PASS HTMLLegendElement interface: existence and properties of interface object +PASS HTMLLegendElement interface object length +PASS HTMLLegendElement interface object name +PASS HTMLLegendElement interface: existence and properties of interface prototype object +PASS HTMLLegendElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLLegendElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLLegendElement interface: attribute form +PASS HTMLLegendElement interface: attribute align +PASS HTMLLegendElement must be primary interface of document.createElement("legend") +PASS Stringification of document.createElement("legend") +PASS HTMLLegendElement interface: document.createElement("legend") must inherit property "form" with the proper type +PASS HTMLLegendElement interface: document.createElement("legend") must inherit property "align" with the proper type +PASS HTMLDetailsElement interface: existence and properties of interface object +PASS HTMLDetailsElement interface object length +PASS HTMLDetailsElement interface object name +PASS HTMLDetailsElement interface: existence and properties of interface prototype object +PASS HTMLDetailsElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDetailsElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDetailsElement interface: attribute open +PASS HTMLDetailsElement must be primary interface of document.createElement("details") +PASS Stringification of document.createElement("details") +PASS HTMLDetailsElement interface: document.createElement("details") must inherit property "open" with the proper type +PASS HTMLDialogElement interface: existence and properties of interface object +PASS HTMLDialogElement interface object length +PASS HTMLDialogElement interface object name +PASS HTMLDialogElement interface: existence and properties of interface prototype object +PASS HTMLDialogElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDialogElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDialogElement interface: attribute open +PASS HTMLDialogElement interface: attribute returnValue +PASS HTMLDialogElement interface: operation show() +PASS HTMLDialogElement interface: operation showModal() +PASS HTMLDialogElement interface: operation close(optional DOMString) +PASS HTMLScriptElement interface: existence and properties of interface object +PASS HTMLScriptElement interface object length +PASS HTMLScriptElement interface object name +PASS HTMLScriptElement interface: existence and properties of interface prototype object +PASS HTMLScriptElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLScriptElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLScriptElement interface: attribute src +PASS HTMLScriptElement interface: attribute type +PASS HTMLScriptElement interface: attribute noModule +PASS HTMLScriptElement interface: attribute async +PASS HTMLScriptElement interface: attribute defer +PASS HTMLScriptElement interface: attribute crossOrigin +PASS HTMLScriptElement interface: attribute text +PASS HTMLScriptElement interface: attribute integrity +PASS HTMLScriptElement interface: attribute referrerPolicy +PASS HTMLScriptElement interface: attribute charset +PASS HTMLScriptElement interface: attribute event +PASS HTMLScriptElement interface: attribute htmlFor +PASS HTMLScriptElement must be primary interface of document.createElement("script") +PASS Stringification of document.createElement("script") +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "src" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "type" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "noModule" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "async" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "defer" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "crossOrigin" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "text" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "integrity" with the proper type +FAIL HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type assert_equals: expected "string" but got "object" +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "htmlFor" with the proper type +PASS HTMLTemplateElement interface: existence and properties of interface object +PASS HTMLTemplateElement interface object length +PASS HTMLTemplateElement interface object name +PASS HTMLTemplateElement interface: existence and properties of interface prototype object +PASS HTMLTemplateElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTemplateElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTemplateElement interface: attribute content +PASS HTMLTemplateElement must be primary interface of document.createElement("template") +PASS Stringification of document.createElement("template") +PASS HTMLTemplateElement interface: document.createElement("template") must inherit property "content" with the proper type +PASS HTMLSlotElement interface: existence and properties of interface object +PASS HTMLSlotElement interface object length +PASS HTMLSlotElement interface object name +PASS HTMLSlotElement interface: existence and properties of interface prototype object +PASS HTMLSlotElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLSlotElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLSlotElement interface: attribute name +PASS HTMLSlotElement interface: operation assignedNodes(optional AssignedNodesOptions) +PASS HTMLSlotElement interface: operation assignedElements(optional AssignedNodesOptions) +PASS HTMLSlotElement interface: operation assign((Element or Text)...) +PASS HTMLSlotElement must be primary interface of document.createElement("slot") +PASS Stringification of document.createElement("slot") +PASS HTMLSlotElement interface: document.createElement("slot") must inherit property "name" with the proper type +PASS HTMLSlotElement interface: document.createElement("slot") must inherit property "assignedNodes(optional AssignedNodesOptions)" with the proper type +PASS HTMLSlotElement interface: calling assignedNodes(optional AssignedNodesOptions) on document.createElement("slot") with too few arguments must throw TypeError +PASS HTMLSlotElement interface: document.createElement("slot") must inherit property "assignedElements(optional AssignedNodesOptions)" with the proper type +PASS HTMLSlotElement interface: calling assignedElements(optional AssignedNodesOptions) on document.createElement("slot") with too few arguments must throw TypeError +PASS HTMLSlotElement interface: document.createElement("slot") must inherit property "assign((Element or Text)...)" with the proper type +PASS HTMLSlotElement interface: calling assign((Element or Text)...) on document.createElement("slot") with too few arguments must throw TypeError +PASS HTMLCanvasElement interface: existence and properties of interface object +PASS HTMLCanvasElement interface object length +PASS HTMLCanvasElement interface object name +PASS HTMLCanvasElement interface: existence and properties of interface prototype object +PASS HTMLCanvasElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLCanvasElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLCanvasElement interface: attribute width +PASS HTMLCanvasElement interface: attribute height +PASS HTMLCanvasElement interface: operation getContext(DOMString, optional any) +PASS HTMLCanvasElement interface: operation toDataURL(optional DOMString, optional any) +PASS HTMLCanvasElement interface: operation toBlob(BlobCallback, optional DOMString, optional any) +PASS HTMLCanvasElement interface: operation transferControlToOffscreen() +PASS HTMLCanvasElement must be primary interface of document.createElement("canvas") +PASS Stringification of document.createElement("canvas") +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "width" with the proper type +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "height" with the proper type +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "getContext(DOMString, optional any)" with the proper type +PASS HTMLCanvasElement interface: calling getContext(DOMString, optional any) on document.createElement("canvas") with too few arguments must throw TypeError +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "toDataURL(optional DOMString, optional any)" with the proper type +PASS HTMLCanvasElement interface: calling toDataURL(optional DOMString, optional any) on document.createElement("canvas") with too few arguments must throw TypeError +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "toBlob(BlobCallback, optional DOMString, optional any)" with the proper type +PASS HTMLCanvasElement interface: calling toBlob(BlobCallback, optional DOMString, optional any) on document.createElement("canvas") with too few arguments must throw TypeError +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "transferControlToOffscreen()" with the proper type +PASS HTMLMarqueeElement interface: existence and properties of interface object +PASS HTMLMarqueeElement interface object length +PASS HTMLMarqueeElement interface object name +PASS HTMLMarqueeElement interface: existence and properties of interface prototype object +PASS HTMLMarqueeElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMarqueeElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMarqueeElement interface: attribute behavior +PASS HTMLMarqueeElement interface: attribute bgColor +PASS HTMLMarqueeElement interface: attribute direction +PASS HTMLMarqueeElement interface: attribute height +PASS HTMLMarqueeElement interface: attribute hspace +PASS HTMLMarqueeElement interface: attribute loop +PASS HTMLMarqueeElement interface: attribute scrollAmount +PASS HTMLMarqueeElement interface: attribute scrollDelay +PASS HTMLMarqueeElement interface: attribute trueSpeed +PASS HTMLMarqueeElement interface: attribute vspace +PASS HTMLMarqueeElement interface: attribute width +PASS HTMLMarqueeElement interface: operation start() +PASS HTMLMarqueeElement interface: operation stop() +PASS HTMLMarqueeElement must be primary interface of document.createElement("marquee") +PASS Stringification of document.createElement("marquee") +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "behavior" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "bgColor" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "direction" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "height" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "hspace" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "loop" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "scrollAmount" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "scrollDelay" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "trueSpeed" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "vspace" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "width" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "start()" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "stop()" with the proper type +PASS HTMLFrameSetElement interface: existence and properties of interface object +PASS HTMLFrameSetElement interface object length +PASS HTMLFrameSetElement interface object name +PASS HTMLFrameSetElement interface: existence and properties of interface prototype object +PASS HTMLFrameSetElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFrameSetElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFrameSetElement interface: attribute cols +PASS HTMLFrameSetElement interface: attribute rows +PASS HTMLFrameSetElement interface: attribute onafterprint +PASS HTMLFrameSetElement interface: attribute onbeforeprint +PASS HTMLFrameSetElement interface: attribute onbeforeunload +PASS HTMLFrameSetElement interface: attribute onhashchange +PASS HTMLFrameSetElement interface: attribute onlanguagechange +PASS HTMLFrameSetElement interface: attribute onmessage +PASS HTMLFrameSetElement interface: attribute onmessageerror +PASS HTMLFrameSetElement interface: attribute onoffline +PASS HTMLFrameSetElement interface: attribute ononline +PASS HTMLFrameSetElement interface: attribute onpagehide +PASS HTMLFrameSetElement interface: attribute onpageshow +PASS HTMLFrameSetElement interface: attribute onpopstate +PASS HTMLFrameSetElement interface: attribute onrejectionhandled +PASS HTMLFrameSetElement interface: attribute onstorage +PASS HTMLFrameSetElement interface: attribute onunhandledrejection +PASS HTMLFrameSetElement interface: attribute onunload +PASS HTMLFrameSetElement must be primary interface of document.createElement("frameset") +PASS Stringification of document.createElement("frameset") +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "cols" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "rows" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onafterprint" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onbeforeprint" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onbeforeunload" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onhashchange" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onlanguagechange" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onmessage" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onmessageerror" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onoffline" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "ononline" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onpagehide" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onpageshow" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onpopstate" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onrejectionhandled" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onstorage" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onunhandledrejection" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onunload" with the proper type +PASS HTMLFrameElement interface: existence and properties of interface object +PASS HTMLFrameElement interface object length +PASS HTMLFrameElement interface object name +PASS HTMLFrameElement interface: existence and properties of interface prototype object +PASS HTMLFrameElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFrameElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFrameElement interface: attribute name +PASS HTMLFrameElement interface: attribute scrolling +PASS HTMLFrameElement interface: attribute src +PASS HTMLFrameElement interface: attribute frameBorder +PASS HTMLFrameElement interface: attribute longDesc +PASS HTMLFrameElement interface: attribute noResize +PASS HTMLFrameElement interface: attribute contentDocument +PASS HTMLFrameElement interface: attribute contentWindow +PASS HTMLFrameElement interface: attribute marginHeight +PASS HTMLFrameElement interface: attribute marginWidth +PASS HTMLFrameElement must be primary interface of document.createElement("frame") +PASS Stringification of document.createElement("frame") +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "name" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "scrolling" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "src" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "frameBorder" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "longDesc" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "noResize" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "contentDocument" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "contentWindow" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "marginHeight" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "marginWidth" with the proper type +PASS HTMLDirectoryElement interface: existence and properties of interface object +PASS HTMLDirectoryElement interface object length +PASS HTMLDirectoryElement interface object name +PASS HTMLDirectoryElement interface: existence and properties of interface prototype object +PASS HTMLDirectoryElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDirectoryElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDirectoryElement interface: attribute compact +PASS HTMLDirectoryElement must be primary interface of document.createElement("dir") +PASS Stringification of document.createElement("dir") +PASS HTMLDirectoryElement interface: document.createElement("dir") must inherit property "compact" with the proper type +PASS HTMLFontElement interface: existence and properties of interface object +PASS HTMLFontElement interface object length +PASS HTMLFontElement interface object name +PASS HTMLFontElement interface: existence and properties of interface prototype object +PASS HTMLFontElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFontElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFontElement interface: attribute color +PASS HTMLFontElement interface: attribute face +PASS HTMLFontElement interface: attribute size +PASS HTMLFontElement must be primary interface of document.createElement("font") +PASS Stringification of document.createElement("font") +PASS HTMLFontElement interface: document.createElement("font") must inherit property "color" with the proper type +PASS HTMLFontElement interface: document.createElement("font") must inherit property "face" with the proper type +PASS HTMLFontElement interface: document.createElement("font") must inherit property "size" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/url/a-element-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/url/a-element-expected.txt deleted file mode 100644 index a4fcdfd..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/url/a-element-expected.txt +++ /dev/null
@@ -1,618 +0,0 @@ -This is a testharness.js-based test. -Found 604 tests; 363 PASS, 241 FAIL, 0 TIMEOUT, 0 NOTRUN. -PASS Loading data… -PASS Parsing: <http://example . -org> against <http://example.org/foo/bar> -PASS Parsing: <http://user:pass@foo:21/bar;par?b#c> against <http://example.org/foo/bar> -PASS Parsing: <https://test:@test> against <about:blank> -PASS Parsing: <https://:@test> against <about:blank> -FAIL Parsing: <non-special://test:@test/x> against <about:blank> assert_equals: href expected "non-special://test@test/x" but got "non-special://test:@test/x" -FAIL Parsing: <non-special://:@test/x> against <about:blank> assert_equals: href expected "non-special://test/x" but got "non-special://:@test/x" -PASS Parsing: <http:foo.com> against <http://example.org/foo/bar> -PASS Parsing: < :foo.com -> against <http://example.org/foo/bar> -PASS Parsing: < foo.com > against <http://example.org/foo/bar> -PASS Parsing: <a: foo.com> against <http://example.org/foo/bar> -PASS Parsing: <http://f:21/ b ? d # e > against <http://example.org/foo/bar> -FAIL Parsing: <lolscheme:x x#x x> against <about:blank> assert_equals: href expected "lolscheme:x x#x%20x" but got "lolscheme:x x#x x" -PASS Parsing: <http://f:/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:0/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:00000000000000/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:00000000000000000000080/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:b/c> against <http://example.org/foo/bar> -FAIL Parsing: <http://f: /c> against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://f: /c" but got "http://f:%20/c" -PASS Parsing: <http://f: -/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:fifty-two/c> against <http://example.org/foo/bar> -PASS Parsing: <http://f:999999/c> against <http://example.org/foo/bar> -FAIL Parsing: <non-special://f:999999/c> against <http://example.org/foo/bar> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://f: 21 / b ? d # e > against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://f: 21 / b ? d # e " but got "http://f:%2021%20/%20b%20?%20d%20#%20e" -PASS Parsing: <> against <http://example.org/foo/bar> -PASS Parsing: < > against <http://example.org/foo/bar> -PASS Parsing: <:foo.com/> against <http://example.org/foo/bar> -PASS Parsing: <:foo.com\> against <http://example.org/foo/bar> -PASS Parsing: <:> against <http://example.org/foo/bar> -PASS Parsing: <:a> against <http://example.org/foo/bar> -PASS Parsing: <:/> against <http://example.org/foo/bar> -PASS Parsing: <:\> against <http://example.org/foo/bar> -PASS Parsing: <:#> against <http://example.org/foo/bar> -PASS Parsing: <#> against <http://example.org/foo/bar> -PASS Parsing: <#/> against <http://example.org/foo/bar> -PASS Parsing: <#\> against <http://example.org/foo/bar> -PASS Parsing: <#;?> against <http://example.org/foo/bar> -PASS Parsing: <?> against <http://example.org/foo/bar> -PASS Parsing: </> against <http://example.org/foo/bar> -PASS Parsing: <:23> against <http://example.org/foo/bar> -PASS Parsing: </:23> against <http://example.org/foo/bar> -PASS Parsing: <::> against <http://example.org/foo/bar> -PASS Parsing: <::23> against <http://example.org/foo/bar> -FAIL Parsing: <foo://> against <http://example.org/foo/bar> assert_equals: pathname expected "" but got "//" -PASS Parsing: <http://a:b@c:29/d> against <http://example.org/foo/bar> -PASS Parsing: <http::@c:29> against <http://example.org/foo/bar> -PASS Parsing: <http://&a:foo(b]c@d:2/> against <http://example.org/foo/bar> -PASS Parsing: <http://::@c@d:2> against <http://example.org/foo/bar> -PASS Parsing: <http://foo.com:b@d/> against <http://example.org/foo/bar> -PASS Parsing: <http://foo.com/\@> against <http://example.org/foo/bar> -PASS Parsing: <http:\\foo.com\> against <http://example.org/foo/bar> -PASS Parsing: <http:\\a\b:c\d@foo.com\> against <http://example.org/foo/bar> -PASS Parsing: <foo:/> against <http://example.org/foo/bar> -PASS Parsing: <foo:/bar.com/> against <http://example.org/foo/bar> -FAIL Parsing: <foo://///////> against <http://example.org/foo/bar> assert_equals: pathname expected "///////" but got "/////////" -FAIL Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar> assert_equals: pathname expected "///////bar.com/" but got "/////////bar.com/" -FAIL Parsing: <foo:////://///> against <http://example.org/foo/bar> assert_equals: pathname expected "//://///" but got "////://///" -PASS Parsing: <c:/foo> against <http://example.org/foo/bar> -PASS Parsing: <//foo/bar> against <http://example.org/foo/bar> -PASS Parsing: <http://foo/path;a??e#f#g> against <http://example.org/foo/bar> -PASS Parsing: <http://foo/abcd?efgh?ijkl> against <http://example.org/foo/bar> -PASS Parsing: <http://foo/abcd#foo?bar> against <http://example.org/foo/bar> -PASS Parsing: <[61:24:74]:98> against <http://example.org/foo/bar> -PASS Parsing: <http:[61:27]/:foo> against <http://example.org/foo/bar> -FAIL Parsing: <http://[1::2]:3:4> against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://[1::2]:3:4" but got "http://[1::2]:3:4/" -FAIL Parsing: <http://2001::1> against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://2001::1" but got "http://2001::1/" -FAIL Parsing: <http://2001::1]> against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://2001::1]" but got "http://2001::1]/" -FAIL Parsing: <http://2001::1]:80> against <http://example.org/foo/bar> assert_equals: failure should set href to input expected "http://2001::1]:80" but got "http://2001::1]/" -PASS Parsing: <http://[2001::1]> against <http://example.org/foo/bar> -PASS Parsing: <http://[::127.0.0.1]> against <http://example.org/foo/bar> -PASS Parsing: <http://[0:0:0:0:0:0:13.1.68.3]> against <http://example.org/foo/bar> -PASS Parsing: <http://[2001::1]:80> against <http://example.org/foo/bar> -PASS Parsing: <http:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <ftp:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <https:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <madeupscheme:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <file:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <file://example:1/> against <about:blank> -PASS Parsing: <file://example:test/> against <about:blank> -FAIL Parsing: <file://example%/> against <about:blank> assert_equals: failure should set href to input expected "file://example%/" but got "file://example%25/" -PASS Parsing: <file://[example]/> against <about:blank> -PASS Parsing: <ftps:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <gopher:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <ws:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <wss:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <data:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <javascript:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <mailto:/example.com/> against <http://example.org/foo/bar> -PASS Parsing: <http:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <ftp:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <https:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <madeupscheme:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <ftps:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <gopher:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <ws:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <wss:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <data:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <javascript:example.com/> against <http://example.org/foo/bar> -PASS Parsing: <mailto:example.com/> against <http://example.org/foo/bar> -PASS Parsing: </a/b/c> against <http://example.org/foo/bar> -PASS Parsing: </a/ /c> against <http://example.org/foo/bar> -PASS Parsing: </a%2fc> against <http://example.org/foo/bar> -PASS Parsing: </a/%2f/c> against <http://example.org/foo/bar> -PASS Parsing: <#β> against <http://example.org/foo/bar> -PASS Parsing: <data:text/html,test#test> against <http://example.org/foo/bar> -PASS Parsing: <tel:1234567890> against <http://example.org/foo/bar> -FAIL Parsing: <ssh://example.com/foo/bar.git> against <http://example.org/> assert_equals: host expected "example.com" but got "" -FAIL Parsing: <file:c:\foo\bar.html> against <file:///tmp/mock/path> assert_equals: href expected "file:///c:/foo/bar.html" but got "file:///tmp/mock/c:/foo/bar.html" -FAIL Parsing: < File:c|////foo\bar.html> against <file:///tmp/mock/path> assert_equals: href expected "file:///c:////foo/bar.html" but got "file:///tmp/mock/c%7C////foo/bar.html" -FAIL Parsing: <C|/foo/bar> against <file:///tmp/mock/path> assert_equals: href expected "file:///C:/foo/bar" but got "file:///tmp/mock/C%7C/foo/bar" -FAIL Parsing: </C|\foo\bar> against <file:///tmp/mock/path> assert_equals: href expected "file:///C:/foo/bar" but got "file:///C%7C/foo/bar" -FAIL Parsing: <//C|/foo/bar> against <file:///tmp/mock/path> assert_equals: href expected "file:///C:/foo/bar" but got "file://c%7C/foo/bar" -PASS Parsing: <//server/file> against <file:///tmp/mock/path> -PASS Parsing: <\\server\file> against <file:///tmp/mock/path> -PASS Parsing: </\server/file> against <file:///tmp/mock/path> -PASS Parsing: <file:///foo/bar.txt> against <file:///tmp/mock/path> -PASS Parsing: <file:///home/me> against <file:///tmp/mock/path> -PASS Parsing: <//> against <file:///tmp/mock/path> -PASS Parsing: <///> against <file:///tmp/mock/path> -PASS Parsing: <///test> against <file:///tmp/mock/path> -PASS Parsing: <file://test> against <file:///tmp/mock/path> -FAIL Parsing: <file://localhost> against <file:///tmp/mock/path> assert_equals: href expected "file:///" but got "file://localhost/" -FAIL Parsing: <file://localhost/> against <file:///tmp/mock/path> assert_equals: href expected "file:///" but got "file://localhost/" -FAIL Parsing: <file://localhost/test> against <file:///tmp/mock/path> assert_equals: href expected "file:///test" but got "file://localhost/test" -PASS Parsing: <test> against <file:///tmp/mock/path> -PASS Parsing: <file:test> against <file:///tmp/mock/path> -PASS Parsing: <http://example.com/././foo> against <about:blank> -PASS Parsing: <http://example.com/./.foo> against <about:blank> -PASS Parsing: <http://example.com/foo/.> against <about:blank> -PASS Parsing: <http://example.com/foo/./> against <about:blank> -PASS Parsing: <http://example.com/foo/bar/..> against <about:blank> -PASS Parsing: <http://example.com/foo/bar/../> against <about:blank> -PASS Parsing: <http://example.com/foo/..bar> against <about:blank> -PASS Parsing: <http://example.com/foo/bar/../ton> against <about:blank> -PASS Parsing: <http://example.com/foo/bar/../ton/../../a> against <about:blank> -PASS Parsing: <http://example.com/foo/../../..> against <about:blank> -PASS Parsing: <http://example.com/foo/../../../ton> against <about:blank> -PASS Parsing: <http://example.com/foo/%2e> against <about:blank> -FAIL Parsing: <http://example.com/foo/%2e%2> against <about:blank> assert_equals: href expected "http://example.com/foo/%2e%2" but got "http://example.com/foo/.%2" -FAIL Parsing: <http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar> against <about:blank> assert_equals: href expected "http://example.com/%2e.bar" but got "http://example.com/..bar" -PASS Parsing: <http://example.com////../..> against <about:blank> -PASS Parsing: <http://example.com/foo/bar//../..> against <about:blank> -PASS Parsing: <http://example.com/foo/bar//..> against <about:blank> -PASS Parsing: <http://example.com/foo> against <about:blank> -PASS Parsing: <http://example.com/%20foo> against <about:blank> -PASS Parsing: <http://example.com/foo%> against <about:blank> -PASS Parsing: <http://example.com/foo%2> against <about:blank> -PASS Parsing: <http://example.com/foo%2zbar> against <about:blank> -PASS Parsing: <http://example.com/foo%2©zbar> against <about:blank> -FAIL Parsing: <http://example.com/foo%41%7a> against <about:blank> assert_equals: href expected "http://example.com/foo%41%7a" but got "http://example.com/fooAz" -PASS Parsing: <http://example.com/foo %91> against <about:blank> -FAIL Parsing: <http://example.com/foo%00%51> against <about:blank> assert_equals: href expected "http://example.com/foo%00%51" but got "http://example.com/foo%00Q" -PASS Parsing: <http://example.com/(%28:%3A%29)> against <about:blank> -PASS Parsing: <http://example.com/%3A%3a%3C%3c> against <about:blank> -PASS Parsing: <http://example.com/foo bar> against <about:blank> -PASS Parsing: <http://example.com\\foo\\bar> against <about:blank> -PASS Parsing: <http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd> against <about:blank> -PASS Parsing: <http://example.com/@asdf%40> against <about:blank> -PASS Parsing: <http://example.com/你好你好> against <about:blank> -PASS Parsing: <http://example.com/‥/foo> against <about:blank> -PASS Parsing: <http://example.com//foo> against <about:blank> -PASS Parsing: <http://example.com//foo//bar> against <about:blank> -PASS Parsing: <http://www.google.com/foo?bar=baz#> against <about:blank> -PASS Parsing: <http://www.google.com/foo?bar=baz# »> against <about:blank> -FAIL Parsing: <data:test# »> against <about:blank> assert_equals: href expected "data:test#%20%C2%BB" but got "data:test# %C2%BB" -PASS Parsing: <http://www.google.com> against <about:blank> -PASS Parsing: <http://192.0x00A80001> against <about:blank> -FAIL Parsing: <http://www/foo%2Ehtml> against <about:blank> assert_equals: href expected "http://www/foo%2Ehtml" but got "http://www/foo.html" -PASS Parsing: <http://www/foo/%2E/html> against <about:blank> -PASS Parsing: <http://user:pass@/> against <about:blank> -PASS Parsing: <http://%25DOMAIN:foobar@foodomain.com/> against <about:blank> -PASS Parsing: <http:\\www.google.com\foo> against <about:blank> -PASS Parsing: <http://foo:80/> against <about:blank> -PASS Parsing: <http://foo:81/> against <about:blank> -FAIL Parsing: <httpa://foo:80/> against <about:blank> assert_equals: host expected "foo:80" but got "" -PASS Parsing: <http://foo:-80/> against <about:blank> -PASS Parsing: <https://foo:443/> against <about:blank> -PASS Parsing: <https://foo:80/> against <about:blank> -PASS Parsing: <ftp://foo:21/> against <about:blank> -PASS Parsing: <ftp://foo:80/> against <about:blank> -FAIL Parsing: <gopher://foo:70/> against <about:blank> assert_equals: host expected "foo:70" but got "" -FAIL Parsing: <gopher://foo:443/> against <about:blank> assert_equals: host expected "foo:443" but got "" -PASS Parsing: <ws://foo:80/> against <about:blank> -PASS Parsing: <ws://foo:81/> against <about:blank> -PASS Parsing: <ws://foo:443/> against <about:blank> -PASS Parsing: <ws://foo:815/> against <about:blank> -PASS Parsing: <wss://foo:80/> against <about:blank> -PASS Parsing: <wss://foo:81/> against <about:blank> -PASS Parsing: <wss://foo:443/> against <about:blank> -PASS Parsing: <wss://foo:815/> against <about:blank> -PASS Parsing: <http:/example.com/> against <about:blank> -PASS Parsing: <ftp:/example.com/> against <about:blank> -PASS Parsing: <https:/example.com/> against <about:blank> -PASS Parsing: <madeupscheme:/example.com/> against <about:blank> -PASS Parsing: <file:/example.com/> against <about:blank> -PASS Parsing: <ftps:/example.com/> against <about:blank> -PASS Parsing: <gopher:/example.com/> against <about:blank> -PASS Parsing: <ws:/example.com/> against <about:blank> -PASS Parsing: <wss:/example.com/> against <about:blank> -PASS Parsing: <data:/example.com/> against <about:blank> -PASS Parsing: <javascript:/example.com/> against <about:blank> -PASS Parsing: <mailto:/example.com/> against <about:blank> -PASS Parsing: <http:example.com/> against <about:blank> -PASS Parsing: <ftp:example.com/> against <about:blank> -PASS Parsing: <https:example.com/> against <about:blank> -PASS Parsing: <madeupscheme:example.com/> against <about:blank> -PASS Parsing: <ftps:example.com/> against <about:blank> -PASS Parsing: <gopher:example.com/> against <about:blank> -PASS Parsing: <ws:example.com/> against <about:blank> -PASS Parsing: <wss:example.com/> against <about:blank> -PASS Parsing: <data:example.com/> against <about:blank> -PASS Parsing: <javascript:example.com/> against <about:blank> -PASS Parsing: <mailto:example.com/> against <about:blank> -PASS Parsing: <http:@www.example.com> against <about:blank> -PASS Parsing: <http:/@www.example.com> against <about:blank> -PASS Parsing: <http://@www.example.com> against <about:blank> -PASS Parsing: <http:a:b@www.example.com> against <about:blank> -PASS Parsing: <http:/a:b@www.example.com> against <about:blank> -PASS Parsing: <http://a:b@www.example.com> against <about:blank> -PASS Parsing: <http://@pple.com> against <about:blank> -PASS Parsing: <http::b@www.example.com> against <about:blank> -PASS Parsing: <http:/:b@www.example.com> against <about:blank> -PASS Parsing: <http://:b@www.example.com> against <about:blank> -FAIL Parsing: <http:/:@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:/:@/www.example.com" but got "http:///www.example.com" -PASS Parsing: <http://user@/www.example.com> against <about:blank> -FAIL Parsing: <http:@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:@/www.example.com" but got "http:///www.example.com" -FAIL Parsing: <http:/@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:/@/www.example.com" but got "http:///www.example.com" -FAIL Parsing: <http://@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http://@/www.example.com" but got "http:///www.example.com" -FAIL Parsing: <https:@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "https:@/www.example.com" but got "https:///www.example.com" -FAIL Parsing: <http:a:b@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:a:b@/www.example.com" but got "http://a:b@/www.example.com" -FAIL Parsing: <http:/a:b@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:/a:b@/www.example.com" but got "http://a:b@/www.example.com" -PASS Parsing: <http://a:b@/www.example.com> against <about:blank> -FAIL Parsing: <http::@/www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http::@/www.example.com" but got "http:///www.example.com" -PASS Parsing: <http:a:@www.example.com> against <about:blank> -PASS Parsing: <http:/a:@www.example.com> against <about:blank> -PASS Parsing: <http://a:@www.example.com> against <about:blank> -PASS Parsing: <http://www.@pple.com> against <about:blank> -FAIL Parsing: <http:@:www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:@:www.example.com" but got "http://:www.example.com/" -FAIL Parsing: <http:/@:www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http:/@:www.example.com" but got "http://:www.example.com/" -FAIL Parsing: <http://@:www.example.com> against <about:blank> assert_equals: failure should set href to input expected "http://@:www.example.com" but got "http://:www.example.com/" -PASS Parsing: <http://:@www.example.com> against <about:blank> -PASS Parsing: </> against <http://www.example.com/test> -PASS Parsing: </test.txt> against <http://www.example.com/test> -PASS Parsing: <.> against <http://www.example.com/test> -PASS Parsing: <..> against <http://www.example.com/test> -PASS Parsing: <test.txt> against <http://www.example.com/test> -PASS Parsing: <./test.txt> against <http://www.example.com/test> -PASS Parsing: <../test.txt> against <http://www.example.com/test> -PASS Parsing: <../aaa/test.txt> against <http://www.example.com/test> -PASS Parsing: <../../test.txt> against <http://www.example.com/test> -PASS Parsing: <中/test.txt> against <http://www.example.com/test> -PASS Parsing: <http://www.example2.com> against <http://www.example.com/test> -PASS Parsing: <//www.example2.com> against <http://www.example.com/test> -PASS Parsing: <file:...> against <http://www.example.com/test> -PASS Parsing: <file:..> against <http://www.example.com/test> -PASS Parsing: <file:a> against <http://www.example.com/test> -PASS Parsing: <http://ExAmPlE.CoM> against <http://other.com/> -FAIL Parsing: <http://example example.com> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://Goo%20 goo%7C|.com> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://[]> against <http://other.com/> assert_equals: failure should set href to input expected "http://[]" but got "http://[]/" -FAIL Parsing: <http://[:]> against <http://other.com/> assert_equals: failure should set href to input expected "http://[:]" but got "http://[:]/" -FAIL Parsing: <http://GOO goo.com> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <http://GOOgoo.com> against <http://other.com/> -PASS Parsing: <\0 http://example.com/ \r > against <about:blank> -PASS Parsing: <http://www.foo。bar.com> against <http://other.com/> -FAIL Parsing: <http://zyx.com> against <http://other.com/> assert_equals: failure should set href to input expected "http://zyx.com" but got "http://%EF%BF%BDzyx.com/" -FAIL Parsing: <http://%ef%b7%90zyx.com> against <http://other.com/> assert_equals: failure should set href to input expected "http://%ef%b7%90zyx.com" but got "http://%EF%BF%BDzyx.com/" -FAIL Parsing: <https://�> against <about:blank> assert_equals: failure should set href to input expected "https://\ufffd" but got "https://%EF%BF%BD/" -FAIL Parsing: <https://%EF%BF%BD> against <about:blank> assert_equals: failure should set href to input expected "https://%EF%BF%BD" but got "https://%EF%BF%BD/" -PASS Parsing: <https://x/�?�#�> against <about:blank> -PASS Parsing: <http://Go.com> against <http://other.com/> -FAIL Parsing: <http://%41.com> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://%ef%bc%85%ef%bc%94%ef%bc%91.com> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://%00.com> against <http://other.com/> assert_equals: failure should set href to input expected "http://%00.com" but got "http://%00.com/" -FAIL Parsing: <http://%ef%bc%85%ef%bc%90%ef%bc%90.com> against <http://other.com/> assert_equals: failure should set href to input expected "http://%ef%bc%85%ef%bc%90%ef%bc%90.com" but got "http://%00.com/" -PASS Parsing: <http://你好你好> against <http://other.com/> -FAIL Parsing: <https://faß.ExAmPlE/> against <about:blank> assert_equals: href expected "https://xn--fa-hia.example/" but got "https://fass.example/" -FAIL Parsing: <sc://faß.ExAmPlE/> against <about:blank> assert_equals: host expected "fa%C3%9F.ExAmPlE" but got "" -FAIL Parsing: <http://%zz%66%a.com> against <http://other.com/> assert_equals: failure should set href to input expected "http://%zz%66%a.com" but got "http://%25zzf%25a.com/" -FAIL Parsing: <http://%25> against <http://other.com/> assert_equals: failure should set href to input expected "http://%25" but got "http://%25/" -FAIL Parsing: <http://hello%00> against <http://other.com/> assert_equals: failure should set href to input expected "http://hello%00" but got "http://hello%00/" -PASS Parsing: <http://%30%78%63%30%2e%30%32%35%30.01> against <http://other.com/> -PASS Parsing: <http://%30%78%63%30%2e%30%32%35%30.01%2e> against <http://other.com/> -FAIL Parsing: <http://192.168.0.257> against <http://other.com/> assert_equals: failure should set href to input expected "http://192.168.0.257" but got "http://192.168.0.257/" -FAIL Parsing: <http://%3g%78%63%30%2e%30%32%35%30%2E.01> against <http://other.com/> assert_equals: failure should set href to input expected "http://%3g%78%63%30%2e%30%32%35%30%2E.01" but got "http://%253gxc0.0250..01/" -FAIL Parsing: <http://192.168.0.1 hello> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <https://x x:12> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <http://0Xc0.0250.01> against <http://other.com/> -PASS Parsing: <http://./> against <about:blank> -PASS Parsing: <http://../> against <about:blank> -PASS Parsing: <http://0..0x300/> against <about:blank> -PASS Parsing: <http://[www.google.com]/> against <about:blank> -FAIL Parsing: <http://[google.com]> against <http://other.com/> assert_equals: failure should set href to input expected "http://[google.com]" but got "http://[google.com]/" -FAIL Parsing: <http://[::1.2.3.4x]> against <http://other.com/> assert_equals: failure should set href to input expected "http://[::1.2.3.4x]" but got "http://[::1.2.3.4x]/" -FAIL Parsing: <http://[::1.2.3.]> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://[::1.2.]> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://[::1.]> against <http://other.com/> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <http://foo:💩@example.com/bar> against <http://other.com/> -PASS Parsing: <#> against <test:test> -PASS Parsing: <#x> against <mailto:x@x.com> -FAIL Parsing: <#x> against <data:,> assert_equals: href expected "data:,#x" but got "mailto:x@x.com#x" -PASS Parsing: <#x> against <about:blank> -PASS Parsing: <#> against <test:test?test> -PASS Parsing: <https://@test@test@example:800/> against <http://doesnotmatter/> -PASS Parsing: <https://@@@example> against <http://doesnotmatter/> -PASS Parsing: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> -PASS Parsing: <http://host/?'> against <about:blank> -FAIL Parsing: <notspecial://host/?'> against <about:blank> assert_equals: host expected "host" but got "" -PASS Parsing: </some/path> against <http://user@example.org/smth> -PASS Parsing: <> against <http://user:pass@example.org:21/smth> -PASS Parsing: </some/path> against <http://user:pass@example.org:21/smth> -FAIL Parsing: <i> against <sc:sd> assert_equals: failure should set href to input expected "i" but got "" -FAIL Parsing: <i> against <sc:sd/sd> assert_equals: failure should set href to input expected "i" but got "" -PASS Parsing: <i> against <sc:/pa/pa> -FAIL Parsing: <i> against <sc://ho/pa> assert_equals: host expected "ho" but got "" -FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/i" but got "///pa/i" -FAIL Parsing: <../i> against <sc:sd> assert_equals: failure should set href to input expected "../i" but got "" -FAIL Parsing: <../i> against <sc:sd/sd> assert_equals: failure should set href to input expected "../i" but got "" -PASS Parsing: <../i> against <sc:/pa/pa> -FAIL Parsing: <../i> against <sc://ho/pa> assert_equals: host expected "ho" but got "" -FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: href expected "sc:///i" but got "sc:///pa/i" -FAIL Parsing: </i> against <sc:sd> assert_equals: failure should set href to input expected "/i" but got "" -FAIL Parsing: </i> against <sc:sd/sd> assert_equals: failure should set href to input expected "/i" but got "" -PASS Parsing: </i> against <sc:/pa/pa> -FAIL Parsing: </i> against <sc://ho/pa> assert_equals: host expected "ho" but got "" -FAIL Parsing: </i> against <sc:///pa/pa> assert_equals: href expected "sc:///i" but got "sc:///pa/i" -FAIL Parsing: <?i> against <sc:sd> assert_equals: failure should set href to input expected "?i" but got "" -FAIL Parsing: <?i> against <sc:sd/sd> assert_equals: failure should set href to input expected "?i" but got "" -PASS Parsing: <?i> against <sc:/pa/pa> -FAIL Parsing: <?i> against <sc://ho/pa> assert_equals: host expected "ho" but got "" -FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa" -PASS Parsing: <#i> against <sc:sd> -PASS Parsing: <#i> against <sc:sd/sd> -PASS Parsing: <#i> against <sc:/pa/pa> -FAIL Parsing: <#i> against <sc://ho/pa> assert_equals: host expected "ho" but got "" -FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa" -FAIL Parsing: <about:/../> against <about:blank> assert_equals: href expected "about:/" but got "about:/../" -FAIL Parsing: <data:/../> against <about:blank> assert_equals: href expected "data:/" but got "data:/../" -FAIL Parsing: <javascript:/../> against <about:blank> assert_equals: href expected "javascript:/" but got "javascript:/../" -FAIL Parsing: <mailto:/../> against <about:blank> assert_equals: href expected "mailto:/" but got "mailto:/../" -FAIL Parsing: <sc://ñ.test/> against <about:blank> assert_equals: host expected "%C3%B1.test" but got "" -FAIL Parsing: <sc://\0/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc:// /> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://%/> against <about:blank> assert_equals: host expected "%" but got "" -FAIL Parsing: <sc://@/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://te@s:t@/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://:/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://:12/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://[/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://\/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <sc://]/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <x> against <sc://ñ> assert_equals: href expected "sc://%C3%B1/x" but got "sc://%C3%B1" -PASS Parsing: <sc:\../> against <about:blank> -PASS Parsing: <sc::a@example.net> against <about:blank> -PASS Parsing: <wow:%NBD> against <about:blank> -PASS Parsing: <wow:%1G> against <about:blank> -FAIL Parsing: <wow:> against <about:blank> assert_equals: href expected "wow:%EF%BF%BF" but got "wow:%EF%BF%BD" -FAIL Parsing: <http://example.com/U+d800U+dfff﷏ﷰ?U+d800U+dfff﷏ﷰ> against <about:blank> assert_equals: href expected "http://example.com/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%B7%90%EF%B7%8F%EF%B7%AF%EF%B7%B0%EF%BF%BE%EF%BF%BF" but got "http://example.com/%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%BF%BD%EF%B7%8F%EF%BF%BD%EF%B7%B0%EF%BF%BD%EF%BF%BD?%EF%BF%BD%F0%90%9F%BE%EF%BF%BD%EF%BF%BD%EF%B7%8F%EF%BF%BD%EF%B7%B0%EF%BF%BD%EF%BF%BD" -FAIL Parsing: <http://a<b> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://a>b> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://a^b> against <about:blank> assert_equals: failure should set href to input expected "http://a^b" but got "http://a%5Eb/" -FAIL Parsing: <non-special://a<b> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <non-special://a>b> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <non-special://a^b> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <http://!"$&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: href expected "http://\x1f!\"$&'()*+,-.;=_`{}~/" but got "http://%1F%21%22%24%26%27%28%29%2A+%2C-.%3B%3D_%60%7B%7D%7E/" -FAIL Parsing: <sc://!"$&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: host expected "%1F!\"$&'()*+,-.;=_`{}~" but got "" -FAIL Parsing: <ftp://example.com%80/> against <about:blank> assert_equals: failure should set href to input expected "ftp://example.com%80/" but got "ftp://example.com%EF%BF%BD/" -FAIL Parsing: <ftp://example.com%A0/> against <about:blank> assert_equals: failure should set href to input expected "ftp://example.com%A0/" but got "ftp://example.com%EF%BF%BD/" -FAIL Parsing: <https://example.com%80/> against <about:blank> assert_equals: failure should set href to input expected "https://example.com%80/" but got "https://example.com%EF%BF%BD/" -FAIL Parsing: <https://example.com%A0/> against <about:blank> assert_equals: failure should set href to input expected "https://example.com%A0/" but got "https://example.com%EF%BF%BD/" -PASS Parsing: <ftp://%e2%98%83> against <about:blank> -PASS Parsing: <https://%e2%98%83> against <about:blank> -PASS Parsing: <http://127.0.0.1:10100/relative_import.html> against <about:blank> -PASS Parsing: <http://facebook.com/?foo=%7B%22abc%22> against <about:blank> -PASS Parsing: <https://localhost:3000/jqueryui@1.2.3> against <about:blank> -PASS Parsing: <h t -t\rp://h o -s\rt:9 0 -0\r0/p a -t\rh?q u -e\rry#f r -a\rg> against <about:blank> -PASS Parsing: <?a=b&c=d> against <http://example.org/foo/bar> -PASS Parsing: <??a=b&c=d> against <http://example.org/foo/bar> -PASS Parsing: <http:> against <http://example.org/foo/bar> -PASS Parsing: <http:> against <https://example.org/foo/bar> -PASS Parsing: <sc:> against <https://example.org/foo/bar> -PASS Parsing: <http://foo.bar/baz?qux#foobar> against <about:blank> -PASS Parsing: <http://foo.bar/baz?qux#foo"bar> against <about:blank> -PASS Parsing: <http://foo.bar/baz?qux#foo<bar> against <about:blank> -PASS Parsing: <http://foo.bar/baz?qux#foo>bar> against <about:blank> -PASS Parsing: <http://foo.bar/baz?qux#foo`bar> against <about:blank> -PASS Parsing: <http://192.168.257> against <http://other.com/> -PASS Parsing: <http://192.168.257.com> against <http://other.com/> -PASS Parsing: <http://256> against <http://other.com/> -PASS Parsing: <http://256.com> against <http://other.com/> -PASS Parsing: <http://999999999> against <http://other.com/> -PASS Parsing: <http://999999999.com> against <http://other.com/> -FAIL Parsing: <http://10000000000> against <http://other.com/> assert_equals: failure should set href to input expected "http://10000000000" but got "http://10000000000/" -PASS Parsing: <http://10000000000.com> against <http://other.com/> -PASS Parsing: <http://4294967295> against <http://other.com/> -FAIL Parsing: <http://4294967296> against <http://other.com/> assert_equals: failure should set href to input expected "http://4294967296" but got "http://4294967296/" -PASS Parsing: <http://0xffffffff> against <http://other.com/> -FAIL Parsing: <http://0xffffffff1> against <http://other.com/> assert_equals: failure should set href to input expected "http://0xffffffff1" but got "http://0xffffffff1/" -FAIL Parsing: <http://256.256.256.256> against <http://other.com/> assert_equals: failure should set href to input expected "http://256.256.256.256" but got "http://256.256.256.256/" -PASS Parsing: <http://256.256.256.256.256> against <http://other.com/> -PASS Parsing: <https://0x.0x.0> against <about:blank> -PASS Parsing: <https://0x100000000/test> against <about:blank> -PASS Parsing: <https://256.0.0.1/test> against <about:blank> -PASS Parsing: <file:///C%3A/> against <about:blank> -PASS Parsing: <file:///C%7C/> against <about:blank> -FAIL Parsing: <file://%43%3A> against <about:blank> assert_equals: failure should set href to input expected "file://%43%3A" but got "file://c:/" -FAIL Parsing: <file://%43%7C> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <file://%43|> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <file://C%7C> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <file://%43%7C/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <https://%43%7C/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <asdf://%43|/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -FAIL Parsing: <asdf://%43%7C/> against <about:blank> assert_equals: host expected "%43%7C" but got "" -PASS Parsing: <pix/submit.gif> against <file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html> -FAIL Parsing: <..> against <file:///C:/> assert_equals: href expected "file:///C:/" but got "file:///" -PASS Parsing: <..> against <file:///> -FAIL Parsing: </> against <file:///C:/a/b> assert_equals: href expected "file:///C:/" but got "file:///" -FAIL Parsing: </> against <file://h/C:/a/b> assert_equals: href expected "file://h/C:/" but got "file:///" -FAIL Parsing: </> against <file://h/a/b> assert_equals: href expected "file://h/" but got "file:///" -FAIL Parsing: <//d:> against <file:///C:/a/b> assert_equals: href expected "file:///d:" but got "file://d:/" -FAIL Parsing: <//d:/..> against <file:///C:/a/b> assert_equals: href expected "file:///d:/" but got "file://d:/" -PASS Parsing: <..> against <file:///ab:/> -PASS Parsing: <..> against <file:///1:/> -PASS Parsing: <> against <file:///test?test#test> -PASS Parsing: <file:> against <file:///test?test#test> -PASS Parsing: <?x> against <file:///test?test#test> -PASS Parsing: <file:?x> against <file:///test?test#test> -PASS Parsing: <#x> against <file:///test?test#test> -PASS Parsing: <file:#x> against <file:///test?test#test> -FAIL Parsing: <file:\\//> against <about:blank> assert_equals: href expected "file:////" but got "file:///" -FAIL Parsing: <file:\\\\> against <about:blank> assert_equals: href expected "file:////" but got "file:///" -FAIL Parsing: <file:\\\\?fox> against <about:blank> assert_equals: href expected "file:////?fox" but got "file:///?fox" -FAIL Parsing: <file:\\\\#guppy> against <about:blank> assert_equals: href expected "file:////#guppy" but got "file:///#guppy" -PASS Parsing: <file://spider///> against <about:blank> -FAIL Parsing: <file:\\localhost//> against <about:blank> assert_equals: href expected "file:////" but got "file://localhost//" -PASS Parsing: <file:///localhost//cat> against <about:blank> -FAIL Parsing: <file://\/localhost//cat> against <about:blank> assert_equals: href expected "file:////localhost//cat" but got "file:///localhost//cat" -FAIL Parsing: <file://localhost//a//../..//> against <about:blank> assert_equals: href expected "file://///" but got "file://localhost///" -FAIL Parsing: </////mouse> against <file:///elephant> assert_equals: href expected "file://///mouse" but got "file:///mouse" -PASS Parsing: <\//pig> against <file://lion/> -FAIL Parsing: <\/localhost//pig> against <file://lion/> assert_equals: href expected "file:////pig" but got "file://localhost//pig" -FAIL Parsing: <//localhost//pig> against <file://lion/> assert_equals: href expected "file:////pig" but got "file://localhost//pig" -PASS Parsing: </..//localhost//pig> against <file://lion/> -PASS Parsing: <file://> against <file://ape/> -PASS Parsing: </rooibos> against <file://tea/> -PASS Parsing: </?chai> against <file://tea/> -FAIL Parsing: <C|> against <file://host/dir/file> assert_equals: href expected "file://host/C:" but got "file://host/dir/C%7C" -FAIL Parsing: <C|> against <file://host/D:/dir1/dir2/file> assert_equals: href expected "file://host/C:" but got "file://host/D:/dir1/dir2/C%7C" -FAIL Parsing: <C|#> against <file://host/dir/file> assert_equals: href expected "file://host/C:#" but got "file://host/dir/C%7C#" -FAIL Parsing: <C|?> against <file://host/dir/file> assert_equals: href expected "file://host/C:?" but got "file://host/dir/C%7C?" -FAIL Parsing: <C|/> against <file://host/dir/file> assert_equals: href expected "file://host/C:/" but got "file://host/dir/C%7C/" -FAIL Parsing: <C| -/> against <file://host/dir/file> assert_equals: href expected "file://host/C:/" but got "file://host/dir/C%7C/" -FAIL Parsing: <C|\> against <file://host/dir/file> assert_equals: href expected "file://host/C:/" but got "file://host/dir/C%7C/" -PASS Parsing: <C> against <file://host/dir/file> -FAIL Parsing: <C|a> against <file://host/dir/file> assert_equals: href expected "file://host/dir/C|a" but got "file://host/dir/C%7Ca" -PASS Parsing: </c:/foo/bar> against <file:///c:/baz/qux> -FAIL Parsing: </c|/foo/bar> against <file:///c:/baz/qux> assert_equals: href expected "file:///c:/foo/bar" but got "file:///c%7C/foo/bar" -PASS Parsing: <file:\c:\foo\bar> against <file:///c:/baz/qux> -PASS Parsing: </c:/foo/bar> against <file://host/path> -PASS Parsing: <file://example.net/C:/> against <about:blank> -PASS Parsing: <file://1.2.3.4/C:/> against <about:blank> -PASS Parsing: <file://[1::8]/C:/> against <about:blank> -FAIL Parsing: <C|/> against <file://host/> assert_equals: href expected "file://host/C:/" but got "file://host/C%7C/" -PASS Parsing: </C:/> against <file://host/> -PASS Parsing: <file:C:/> against <file://host/> -PASS Parsing: <file:/C:/> against <file://host/> -FAIL Parsing: <//C:/> against <file://host/> assert_equals: href expected "file:///C:/" but got "file://c:/" -FAIL Parsing: <file://C:/> against <file://host/> assert_equals: href expected "file:///C:/" but got "file://c:/" -PASS Parsing: <///C:/> against <file://host/> -PASS Parsing: <file:///C:/> against <file://host/> -FAIL Parsing: <file:/C|/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file:///C%7C/" -FAIL Parsing: <file://C|/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://c%7C/" -PASS Parsing: <file:> against <about:blank> -PASS Parsing: <file:?q=v> against <about:blank> -PASS Parsing: <file:#frag> against <about:blank> -PASS Parsing: <file:///Y:> against <about:blank> -PASS Parsing: <file:///Y:/> against <about:blank> -PASS Parsing: <file:///./Y> against <about:blank> -PASS Parsing: <file:///./Y:> against <about:blank> -FAIL Parsing: <\\\.\Y:> against <about:blank> assert_equals: failure should set href to input expected "\\\\\\.\\Y:" but got "" -PASS Parsing: <file:///y:> against <about:blank> -PASS Parsing: <file:///y:/> against <about:blank> -PASS Parsing: <file:///./y> against <about:blank> -PASS Parsing: <file:///./y:> against <about:blank> -FAIL Parsing: <\\\.\y:> against <about:blank> assert_equals: failure should set href to input expected "\\\\\\.\\y:" but got "" -FAIL Parsing: <file://localhost//a//../..//foo> against <about:blank> assert_equals: href expected "file://///foo" but got "file://localhost///foo" -FAIL Parsing: <file://localhost////foo> against <about:blank> assert_equals: href expected "file://////foo" but got "file://localhost////foo" -FAIL Parsing: <file:////foo> against <about:blank> assert_equals: href expected "file:////foo" but got "file:///foo" -PASS Parsing: <file:///one/two> against <file:///> -FAIL Parsing: <file:////one/two> against <file:///> assert_equals: href expected "file:////one/two" but got "file:///one/two" -PASS Parsing: <//one/two> against <file:///> -PASS Parsing: <///one/two> against <file:///> -FAIL Parsing: <////one/two> against <file:///> assert_equals: href expected "file:////one/two" but got "file:///one/two" -PASS Parsing: <file:///.//> against <file:////> -PASS Parsing: <file:.//p> against <about:blank> -PASS Parsing: <file:/.//p> against <about:blank> -PASS Parsing: <http://[1:0::]> against <http://example.net/> -FAIL Parsing: <http://[0:1:2:3:4:5:6:7:8]> against <http://example.net/> assert_equals: failure should set href to input expected "http://[0:1:2:3:4:5:6:7:8]" but got "http://[0:1:2:3:4:5:6:7:8]/" -FAIL Parsing: <https://[0::0::0]> against <about:blank> assert_equals: failure should set href to input expected "https://[0::0::0]" but got "https://[0::0::0]/" -FAIL Parsing: <https://[0:.0]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:.0]" but got "https://[0:.0]/" -FAIL Parsing: <https://[0:0:]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:0:]" but got "https://[0:0:]/" -FAIL Parsing: <https://[0:1:2:3:4:5:6:7.0.0.0.1]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:1:2:3:4:5:6:7.0.0.0.1]" but got "https://[0:1:2:3:4:5:6:7.0.0.0.1]/" -FAIL Parsing: <https://[0:1.00.0.0.0]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:1.00.0.0.0]" but got "https://[0:1.00.0.0.0]/" -FAIL Parsing: <https://[0:1.290.0.0.0]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:1.290.0.0.0]" but got "https://[0:1.290.0.0.0]/" -FAIL Parsing: <https://[0:1.23.23]> against <about:blank> assert_equals: failure should set href to input expected "https://[0:1.23.23]" but got "https://[0:1.23.23]/" -FAIL Parsing: <http://?> against <about:blank> assert_equals: failure should set href to input expected "http://?" but got "http:/?" -FAIL Parsing: <http://#> against <about:blank> assert_equals: failure should set href to input expected "http://#" but got "http:/#" -PASS Parsing: <http://f:4294967377/c> against <http://example.org/> -PASS Parsing: <http://f:18446744073709551697/c> against <http://example.org/> -PASS Parsing: <http://f:340282366920938463463374607431768211537/c> against <http://example.org/> -FAIL Parsing: <sc://ñ> against <about:blank> assert_equals: host expected "%C3%B1" but got "" -FAIL Parsing: <sc://ñ?x> against <about:blank> assert_equals: host expected "%C3%B1" but got "" -FAIL Parsing: <sc://ñ#x> against <about:blank> assert_equals: host expected "%C3%B1" but got "" -FAIL Parsing: <#x> against <sc://ñ> assert_equals: href expected "sc://%C3%B1#x" but got "sc://%C3%B1" -FAIL Parsing: <?x> against <sc://ñ> assert_equals: href expected "sc://%C3%B1?x" but got "sc://%C3%B1" -FAIL Parsing: <sc://?> against <about:blank> assert_equals: pathname expected "" but got "//" -FAIL Parsing: <sc://#> against <about:blank> assert_equals: pathname expected "" but got "//" -FAIL Parsing: <///> against <sc://x/> assert_equals: href expected "sc:///" but got "sc:" -FAIL Parsing: <////> against <sc://x/> assert_equals: href expected "sc:////" but got "sc:" -FAIL Parsing: <////x/> against <sc://x/> assert_equals: href expected "sc:////x/" but got "sc://x/" -FAIL Parsing: <tftp://foobar.com/someconfig;mode=netascii> against <about:blank> assert_equals: host expected "foobar.com" but got "" -FAIL Parsing: <telnet://user:pass@foobar.com:23/> against <about:blank> assert_equals: username expected "user" but got "" -FAIL Parsing: <ut2004://10.10.10.10:7777/Index.ut2> against <about:blank> assert_equals: host expected "10.10.10.10:7777" but got "" -FAIL Parsing: <redis://foo:bar@somehost:6379/0?baz=bam&qux=baz> against <about:blank> assert_equals: username expected "foo" but got "" -FAIL Parsing: <rsync://foo@host:911/sup> against <about:blank> assert_equals: username expected "foo" but got "" -FAIL Parsing: <git://github.com/foo/bar.git> against <about:blank> assert_equals: host expected "github.com" but got "" -FAIL Parsing: <irc://myserver.com:6999/channel?passwd> against <about:blank> assert_equals: host expected "myserver.com:6999" but got "" -FAIL Parsing: <dns://fw.example.org:9999/foo.bar.org?type=TXT> against <about:blank> assert_equals: host expected "fw.example.org:9999" but got "" -FAIL Parsing: <ldap://localhost:389/ou=People,o=JNDITutorial> against <about:blank> assert_equals: host expected "localhost:389" but got "" -FAIL Parsing: <git+https://github.com/foo/bar> against <about:blank> assert_equals: host expected "github.com" but got "" -PASS Parsing: <urn:ietf:rfc:2648> against <about:blank> -PASS Parsing: <tag:joe@example.org,2001:foo/bar> against <about:blank> -FAIL Parsing: <non-spec:/.//> against <about:blank> assert_equals: pathname expected "//" but got "/.//" -FAIL Parsing: <non-spec:/..//> against <about:blank> assert_equals: href expected "non-spec:/.//" but got "non-spec:/..//" -FAIL Parsing: <non-spec:/a/..//> against <about:blank> assert_equals: href expected "non-spec:/.//" but got "non-spec:/a/..//" -FAIL Parsing: <non-spec:/.//path> against <about:blank> assert_equals: pathname expected "//path" but got "/.//path" -FAIL Parsing: <non-spec:/..//path> against <about:blank> assert_equals: href expected "non-spec:/.//path" but got "non-spec:/..//path" -FAIL Parsing: <non-spec:/a/..//path> against <about:blank> assert_equals: href expected "non-spec:/.//path" but got "non-spec:/a/..//path" -FAIL Parsing: </.//path> against <non-spec:/p> assert_equals: href expected "non-spec:/.//path" but got "non-spec://path" -FAIL Parsing: </..//path> against <non-spec:/p> assert_equals: href expected "non-spec:/.//path" but got "non-spec://path" -FAIL Parsing: <..//path> against <non-spec:/p> assert_equals: href expected "non-spec:/.//path" but got "non-spec://path" -FAIL Parsing: <a/..//path> against <non-spec:/p> assert_equals: href expected "non-spec:/.//path" but got "non-spec://path" -FAIL Parsing: <> against <non-spec:/..//p> assert_equals: href expected "non-spec:/.//p" but got "non-spec:/..//p" -FAIL Parsing: <path> against <non-spec:/..//p> assert_equals: href expected "non-spec:/.//path" but got "non-spec:/..//path" -FAIL Parsing: <../path> against <non-spec:/.//p> assert_equals: href expected "non-spec:/path" but got "non-spec:/./path" -FAIL Parsing: <non-special://%E2%80%A0/> against <about:blank> assert_equals: host expected "%E2%80%A0" but got "" -FAIL Parsing: <non-special://H%4fSt/path> against <about:blank> assert_equals: host expected "H%4fSt" but got "" -FAIL Parsing: <non-special://[1:2:0:0:5:0:0:0]/> against <about:blank> assert_equals: href expected "non-special://[1:2:0:0:5::]/" but got "non-special://[1:2:0:0:5:0:0:0]/" -FAIL Parsing: <non-special://[1:2:0:0:0:0:0:3]/> against <about:blank> assert_equals: href expected "non-special://[1:2::3]/" but got "non-special://[1:2:0:0:0:0:0:3]/" -FAIL Parsing: <non-special://[1:2::3]:80/> against <about:blank> assert_equals: host expected "[1:2::3]:80" but got "" -FAIL Parsing: <non-special://[:80/> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <blob:https://example.com:443/> against <about:blank> -PASS Parsing: <blob:d3958f5c-0777-0845-9dcf-2cb28783acaf> against <about:blank> -PASS Parsing: <http://0177.0.0.0189> against <about:blank> -PASS Parsing: <http://0x7f.0.0.0x7g> against <about:blank> -PASS Parsing: <http://0X7F.0.0.0X7G> against <about:blank> -FAIL Parsing: <http://[::127.0.0.0.1]> against <about:blank> assert_equals: failure should set href to input expected "http://[::127.0.0.0.1]" but got "http://[::127.0.0.0.1]/" -PASS Parsing: <http://[0:1:0:1:0:1:0:1]> against <about:blank> -PASS Parsing: <http://[1:0:1:0:1:0:1:0]> against <about:blank> -PASS Parsing: <http://example.org/test?"> against <about:blank> -PASS Parsing: <http://example.org/test?#> against <about:blank> -PASS Parsing: <http://example.org/test?<> against <about:blank> -PASS Parsing: <http://example.org/test?>> against <about:blank> -PASS Parsing: <http://example.org/test?⌣> against <about:blank> -PASS Parsing: <http://example.org/test?%23%23> against <about:blank> -PASS Parsing: <http://example.org/test?%GH> against <about:blank> -PASS Parsing: <http://example.org/test?a#%EF> against <about:blank> -PASS Parsing: <http://example.org/test?a#%GH> against <about:blank> -FAIL Parsing: <a> against <about:blank> assert_equals: failure should set href to input expected "a" but got "" -FAIL Parsing: <a/> against <about:blank> assert_equals: failure should set href to input expected "a/" but got "" -FAIL Parsing: <a//> against <about:blank> assert_equals: failure should set href to input expected "a//" but got "" -FAIL Parsing: <test-a-colon.html> against <a:> assert_equals: failure should set href to input expected "test-a-colon.html" but got "" -FAIL Parsing: <test-a-colon-b.html> against <a:b> assert_equals: failure should set href to input expected "test-a-colon-b.html" but got "" -PASS Parsing: <test-a-colon-slash.html> against <a:/> -FAIL Parsing: <test-a-colon-slash-slash.html> against <a://> assert_equals: href expected "a:///test-a-colon-slash-slash.html" but got "" -PASS Parsing: <test-a-colon-slash-b.html> against <a:/b> -FAIL Parsing: <test-a-colon-slash-slash-b.html> against <a://b> assert_equals: href expected "a://b/test-a-colon-slash-slash-b.html" but got "a://b" -FAIL Parsing: <http://example.org/test?a#b\0c> against <about:blank> assert_equals: href expected "http://example.org/test?a#b%00c" but got "http://example.org/test?a#bc" -FAIL Parsing: <non-spec://example.org/test?a#b\0c> against <about:blank> assert_equals: host expected "example.org" but got "" -PASS Parsing: <non-spec:/test?a#b\0c> against <about:blank> -PASS Parsing: <10.0.0.7:8080/foo.html> against <file:///some/dir/bar.html> -PASS Parsing: <a!@$*=/foo.html> against <file:///some/dir/bar.html> -PASS Parsing: <a1234567890-+.:foo/bar> against <http://example.com/dir/file> -PASS Parsing: <file://ab/p> against <about:blank> -PASS Parsing: <file://a%C2%ADb/p> against <about:blank> -FAIL Parsing: <file:///p> against <about:blank> assert_equals: failure should set href to input expected "file:///p" but got "file://%C2%AD/p" -PASS Parsing: <file://%C2%AD/p> against <about:blank> -FAIL Parsing: <file://xn--/p> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code -PASS Parsing: <#link> against <https://example.org/##link> -PASS Parsing: <non-special:cannot-be-a-base-url-\0~> against <about:blank> -PASS Parsing: <https://www.example.com/path{path.html?query'=query#fragment<fragment> against <about:blank> -PASS Parsing: <https://user:pass[@foo/bar> against <http://example.org> -FAIL Parsing: <foo:// !"$%&'()*+,-.;<=>@[\]^_`{|}~@host/> against <about:blank> assert_equals: href expected "foo://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/" but got "foo:// !\"$%&'()*+,-.;<=>@[\\]^_`{|}~@host/" -FAIL Parsing: <wss:// !"$%&'()*+,-.;<=>@[]^_`{|}~@host/> against <about:blank> assert_equals: href expected "wss://%20!%22$%&'()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/" but got "wss://%20!%22$%&%27()*+,-.%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/" -FAIL Parsing: <foo://joe: !"$%&'()*+,-.:;<=>@[\]^_`{|}~@host/> against <about:blank> assert_equals: href expected "foo://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5C%5D%5E_%60%7B%7C%7D~@host/" but got "foo://joe: !\"$%&'()*+,-.:;<=>@[\\]^_`{|}~@host/" -FAIL Parsing: <wss://joe: !"$%&'()*+,-.:;<=>@[]^_`{|}~@host/> against <about:blank> assert_equals: href expected "wss://joe:%20!%22$%&'()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/" but got "wss://joe:%20!%22$%&%27()*+,-.%3A%3B%3C%3D%3E%40%5B%5D%5E_%60%7B%7C%7D~@host/" -FAIL Parsing: <foo://!"$%&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: host expected "!\"$%&'()*+,-.;=_`{}~" but got "" -FAIL Parsing: <wss://!"$&'()*+,-.;=_`{}~/> against <about:blank> assert_equals: href expected "wss://!\"$&'()*+,-.;=_`{}~/" but got "wss://%21%22%24%26%27%28%29%2A+%2C-.%3B%3D_%60%7B%7D%7E/" -FAIL Parsing: <foo://host/ !"$%&'()*+,-./:;<=>@[\]^_`{|}~> against <about:blank> assert_equals: href expected "foo://host/%20!%22$%&'()*+,-./:;%3C=%3E@[\\]^_%60%7B|%7D~" but got "foo://host/ !\"$%&'()*+,-./:;<=>@[\\]^_`{|}~" -FAIL Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\]^_`{|}~> against <about:blank> assert_equals: href expected "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%60%7B|%7D~" but got "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]%5E_%60%7B%7C%7D~" -FAIL Parsing: <foo://host/dir/? !"$%&'()*+,-./:;<=>?@[\]^_`{|}~> against <about:blank> assert_equals: href expected "foo://host/dir/?%20!%22$%&'()*+,-./:;%3C=%3E?@[\\]^_`{|}~" but got "foo://host/dir/? !\"$%&'()*+,-./:;<=>?@[\\]^_`{|}~" -PASS Parsing: <wss://host/dir/? !"$%&'()*+,-./:;<=>?@[\]^_`{|}~> against <about:blank> -FAIL Parsing: <foo://host/dir/# !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~> against <about:blank> assert_equals: href expected "foo://host/dir/#%20!%22#$%&'()*+,-./:;%3C=%3E?@[\\]^_%60{|}~" but got "foo://host/dir/# !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" -PASS Parsing: <wss://host/dir/# !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~> against <about:blank> -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/tables/mozilla/core/col_widths_auto_per-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/tables/mozilla/core/col_widths_auto_per-expected.png new file mode 100644 index 0000000..a27738cb9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.15/tables/mozilla/core/col_widths_auto_per-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/tables/mozilla/core/col_widths_fix_per-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/tables/mozilla/core/col_widths_fix_per-expected.png new file mode 100644 index 0000000..0630f43c --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.15/tables/mozilla/core/col_widths_fix_per-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/tables/mozilla_expected_failures/bugs/bug17826-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/tables/mozilla_expected_failures/bugs/bug17826-expected.png new file mode 100644 index 0000000..33317a1 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac10.15/tables/mozilla_expected_failures/bugs/bug17826-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png deleted file mode 100644 index 81e5ecf..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png deleted file mode 100644 index 5f36585..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/css/mediaqueries/test_media_queries-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/css/mediaqueries/test_media_queries-expected.txt new file mode 100644 index 0000000..d81c997 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/external/wpt/css/mediaqueries/test_media_queries-expected.txt
@@ -0,0 +1,785 @@ +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = Uncaught Error: assert_not_equals: overflow-block should be equivalent to not (overflow-block: none) got disallowed value false +Found 780 tests; 568 PASS, 212 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS subtest_1 +FAIL subtest_2 assert_true: expected true got false +PASS subtest_3 +PASS subtest_4 +PASS subtest_5 +PASS subtest_6 +PASS subtest_7 +PASS subtest_8 +FAIL subtest_9 assert_true: expected true got false +FAIL subtest_10 assert_true: expected true got false +PASS subtest_11 +PASS subtest_12 +PASS subtest_13 +PASS subtest_14 +PASS subtest_15 +PASS subtest_16 +PASS subtest_17 +PASS subtest_18 +PASS subtest_19 +PASS subtest_20 +PASS subtest_21 +PASS subtest_22 +PASS subtest_23 +PASS subtest_24 +PASS subtest_25 +PASS subtest_26 +PASS subtest_27 +PASS subtest_28 +PASS subtest_29 +PASS subtest_30 +PASS subtest_31 +PASS subtest_32 +FAIL subtest_33 assert_true: expected true got false +FAIL subtest_34 assert_true: expected true got false +FAIL subtest_35 assert_true: expected true got false +FAIL subtest_36 assert_true: expected true got false +FAIL subtest_37 assert_true: expected true got false +FAIL subtest_38 assert_true: expected true got false +FAIL subtest_39 assert_true: expected true got false +FAIL subtest_40 assert_true: expected true got false +PASS subtest_41 +PASS subtest_42 +PASS subtest_43 +PASS subtest_44 +PASS subtest_45 +PASS subtest_46 +PASS subtest_47 +FAIL subtest_48 assert_true: expected true got false +FAIL subtest_49 assert_true: expected true got false +FAIL subtest_50 assert_true: expected true got false +FAIL subtest_51 assert_true: expected true got false +FAIL subtest_52 assert_true: expected true got false +FAIL subtest_53 assert_true: expected true got false +FAIL subtest_54 assert_true: expected true got false +FAIL subtest_55 assert_true: expected true got false +PASS subtest_56 +PASS subtest_57 +PASS subtest_58 +PASS subtest_59 +PASS subtest_60 +PASS subtest_61 +PASS subtest_62 +PASS subtest_63 +FAIL subtest_64 assert_true: expected true got false +FAIL subtest_65 assert_true: expected true got false +FAIL subtest_66 assert_true: expected true got false +FAIL subtest_67 assert_true: expected true got false +FAIL subtest_68 assert_true: expected true got false +FAIL subtest_69 assert_true: expected true got false +FAIL subtest_70 assert_true: expected true got false +FAIL subtest_71 assert_true: expected true got false +PASS subtest_72 +PASS subtest_73 +PASS subtest_74 +PASS subtest_75 +PASS subtest_76 +PASS subtest_77 +PASS subtest_78 +FAIL subtest_79 assert_true: expected true got false +FAIL subtest_80 assert_true: expected true got false +FAIL subtest_81 assert_true: expected true got false +FAIL subtest_82 assert_true: expected true got false +FAIL subtest_83 assert_true: expected true got false +FAIL subtest_84 assert_true: expected true got false +FAIL subtest_85 assert_true: expected true got false +FAIL subtest_86 assert_true: expected true got false +PASS subtest_87 +PASS subtest_88 +PASS subtest_89 +PASS subtest_90 +PASS subtest_91 +PASS subtest_92 +PASS subtest_93 +PASS subtest_94 +FAIL subtest_95 assert_true: expected true got false +FAIL subtest_96 assert_true: expected true got false +FAIL subtest_97 assert_true: expected true got false +FAIL subtest_98 assert_true: expected true got false +FAIL subtest_99 assert_true: expected true got false +FAIL subtest_100 assert_true: expected true got false +FAIL subtest_101 assert_true: expected true got false +FAIL subtest_102 assert_true: expected true got false +PASS subtest_103 +PASS subtest_104 +PASS subtest_105 +PASS subtest_106 +PASS subtest_107 +PASS subtest_108 +PASS subtest_109 +PASS subtest_110 +PASS subtest_111 +PASS subtest_112 +PASS subtest_113 +PASS subtest_114 +PASS subtest_115 +PASS subtest_116 +PASS subtest_117 +PASS subtest_118 +PASS subtest_119 +PASS subtest_120 +PASS subtest_121 +PASS subtest_122 +PASS subtest_123 +PASS subtest_124 +PASS subtest_125 +PASS subtest_126 +PASS subtest_127 +FAIL subtest_128 assert_true: expected true got false +FAIL subtest_129 assert_true: expected true got false +FAIL subtest_130 assert_true: expected true got false +FAIL subtest_131 assert_true: expected true got false +FAIL subtest_132 assert_true: expected true got false +FAIL subtest_133 assert_true: expected true got false +FAIL subtest_134 assert_true: expected true got false +FAIL subtest_135 assert_true: expected true got false +PASS subtest_136 +PASS subtest_137 +PASS subtest_138 +PASS subtest_139 +PASS subtest_140 +PASS subtest_141 +PASS subtest_142 +FAIL subtest_143 assert_true: expected true got false +FAIL subtest_144 assert_true: expected true got false +FAIL subtest_145 assert_true: expected true got false +FAIL subtest_146 assert_true: expected true got false +FAIL subtest_147 assert_true: expected true got false +FAIL subtest_148 assert_true: expected true got false +FAIL subtest_149 assert_true: expected true got false +FAIL subtest_150 assert_true: expected true got false +PASS subtest_151 +PASS subtest_152 +PASS subtest_153 +PASS subtest_154 +PASS subtest_155 +PASS subtest_156 +PASS subtest_157 +PASS subtest_158 +FAIL subtest_159 assert_true: expected true got false +FAIL subtest_160 assert_true: expected true got false +FAIL subtest_161 assert_true: expected true got false +FAIL subtest_162 assert_true: expected true got false +FAIL subtest_163 assert_true: expected true got false +FAIL subtest_164 assert_true: expected true got false +FAIL subtest_165 assert_true: expected true got false +FAIL subtest_166 assert_true: expected true got false +PASS subtest_167 +PASS subtest_168 +PASS subtest_169 +PASS subtest_170 +PASS subtest_171 +PASS subtest_172 +PASS subtest_173 +FAIL subtest_174 assert_true: expected true got false +FAIL subtest_175 assert_true: expected true got false +FAIL subtest_176 assert_true: expected true got false +FAIL subtest_177 assert_true: expected true got false +FAIL subtest_178 assert_true: expected true got false +FAIL subtest_179 assert_true: expected true got false +FAIL subtest_180 assert_true: expected true got false +FAIL subtest_181 assert_true: expected true got false +PASS subtest_182 +PASS subtest_183 +PASS subtest_184 +PASS subtest_185 +PASS subtest_186 +PASS subtest_187 +PASS subtest_188 +PASS subtest_189 +FAIL subtest_190 assert_true: expected true got false +FAIL subtest_191 assert_true: expected true got false +FAIL subtest_192 assert_true: expected true got false +FAIL subtest_193 assert_true: expected true got false +FAIL subtest_194 assert_true: expected true got false +FAIL subtest_195 assert_true: expected true got false +FAIL subtest_196 assert_true: expected true got false +FAIL subtest_197 assert_true: expected true got false +PASS subtest_198 +PASS subtest_199 +PASS subtest_200 +PASS subtest_201 +PASS subtest_202 +PASS subtest_203 +PASS subtest_204 +PASS subtest_205 +PASS subtest_206 +PASS subtest_207 +PASS subtest_208 +PASS subtest_209 +PASS subtest_210 +PASS subtest_211 +PASS subtest_212 +PASS subtest_213 +PASS subtest_214 +PASS subtest_215 +PASS subtest_216 +PASS subtest_217 +PASS subtest_218 +PASS subtest_219 +PASS subtest_220 +PASS subtest_221 +PASS subtest_222 +FAIL subtest_223 assert_true: expected true got false +FAIL subtest_224 assert_true: expected true got false +FAIL subtest_225 assert_true: expected true got false +FAIL subtest_226 assert_true: expected true got false +FAIL subtest_227 assert_true: expected true got false +FAIL subtest_228 assert_true: expected true got false +FAIL subtest_229 assert_true: expected true got false +FAIL subtest_230 assert_true: expected true got false +PASS subtest_231 +PASS subtest_232 +PASS subtest_233 +PASS subtest_234 +PASS subtest_235 +PASS subtest_236 +PASS subtest_237 +FAIL subtest_238 assert_true: expected true got false +FAIL subtest_239 assert_true: expected true got false +FAIL subtest_240 assert_true: expected true got false +FAIL subtest_241 assert_true: expected true got false +FAIL subtest_242 assert_true: expected true got false +FAIL subtest_243 assert_true: expected true got false +FAIL subtest_244 assert_true: expected true got false +FAIL subtest_245 assert_true: expected true got false +PASS subtest_246 +PASS subtest_247 +PASS subtest_248 +PASS subtest_249 +PASS subtest_250 +PASS subtest_251 +PASS subtest_252 +PASS subtest_253 +FAIL subtest_254 assert_true: expected true got false +FAIL subtest_255 assert_true: expected true got false +FAIL subtest_256 assert_true: expected true got false +FAIL subtest_257 assert_true: expected true got false +FAIL subtest_258 assert_true: expected true got false +FAIL subtest_259 assert_true: expected true got false +FAIL subtest_260 assert_true: expected true got false +FAIL subtest_261 assert_true: expected true got false +PASS subtest_262 +PASS subtest_263 +PASS subtest_264 +PASS subtest_265 +PASS subtest_266 +PASS subtest_267 +PASS subtest_268 +FAIL subtest_269 assert_true: expected true got false +FAIL subtest_270 assert_true: expected true got false +FAIL subtest_271 assert_true: expected true got false +FAIL subtest_272 assert_true: expected true got false +FAIL subtest_273 assert_true: expected true got false +FAIL subtest_274 assert_true: expected true got false +FAIL subtest_275 assert_true: expected true got false +FAIL subtest_276 assert_true: expected true got false +PASS subtest_277 +PASS subtest_278 +PASS subtest_279 +PASS subtest_280 +PASS subtest_281 +PASS subtest_282 +PASS subtest_283 +PASS subtest_284 +FAIL subtest_285 assert_true: expected true got false +FAIL subtest_286 assert_true: expected true got false +FAIL subtest_287 assert_true: expected true got false +FAIL subtest_288 assert_true: expected true got false +FAIL subtest_289 assert_true: expected true got false +FAIL subtest_290 assert_true: expected true got false +FAIL subtest_291 assert_true: expected true got false +FAIL subtest_292 assert_true: expected true got false +PASS subtest_293 +PASS subtest_294 +PASS subtest_295 +PASS subtest_296 +PASS subtest_297 +PASS subtest_298 +PASS subtest_299 +PASS subtest_300 +PASS subtest_301 +PASS subtest_302 +PASS subtest_303 +PASS subtest_304 +PASS subtest_305 +PASS subtest_306 +PASS subtest_307 +PASS subtest_308 +PASS subtest_309 +PASS subtest_310 +PASS subtest_311 +PASS subtest_312 +PASS subtest_313 +PASS subtest_314 +PASS subtest_315 +PASS subtest_316 +PASS subtest_317 +FAIL subtest_318 assert_true: expected true got false +FAIL subtest_319 assert_true: expected true got false +FAIL subtest_320 assert_true: expected true got false +FAIL subtest_321 assert_true: expected true got false +FAIL subtest_322 assert_true: expected true got false +FAIL subtest_323 assert_true: expected true got false +FAIL subtest_324 assert_true: expected true got false +FAIL subtest_325 assert_true: expected true got false +PASS subtest_326 +PASS subtest_327 +PASS subtest_328 +PASS subtest_329 +PASS subtest_330 +PASS subtest_331 +PASS subtest_332 +FAIL subtest_333 assert_true: expected true got false +FAIL subtest_334 assert_true: expected true got false +FAIL subtest_335 assert_true: expected true got false +FAIL subtest_336 assert_true: expected true got false +FAIL subtest_337 assert_true: expected true got false +FAIL subtest_338 assert_true: expected true got false +FAIL subtest_339 assert_true: expected true got false +FAIL subtest_340 assert_true: expected true got false +PASS subtest_341 +PASS subtest_342 +PASS subtest_343 +PASS subtest_344 +PASS subtest_345 +PASS subtest_346 +PASS subtest_347 +PASS subtest_348 +FAIL subtest_349 assert_true: expected true got false +FAIL subtest_350 assert_true: expected true got false +FAIL subtest_351 assert_true: expected true got false +FAIL subtest_352 assert_true: expected true got false +FAIL subtest_353 assert_true: expected true got false +FAIL subtest_354 assert_true: expected true got false +FAIL subtest_355 assert_true: expected true got false +FAIL subtest_356 assert_true: expected true got false +PASS subtest_357 +PASS subtest_358 +PASS subtest_359 +PASS subtest_360 +PASS subtest_361 +PASS subtest_362 +PASS subtest_363 +FAIL subtest_364 assert_true: expected true got false +FAIL subtest_365 assert_true: expected true got false +FAIL subtest_366 assert_true: expected true got false +FAIL subtest_367 assert_true: expected true got false +FAIL subtest_368 assert_true: expected true got false +FAIL subtest_369 assert_true: expected true got false +FAIL subtest_370 assert_true: expected true got false +FAIL subtest_371 assert_true: expected true got false +PASS subtest_372 +PASS subtest_373 +PASS subtest_374 +PASS subtest_375 +PASS subtest_376 +PASS subtest_377 +PASS subtest_378 +PASS subtest_379 +FAIL subtest_380 assert_true: expected true got false +FAIL subtest_381 assert_true: expected true got false +FAIL subtest_382 assert_true: expected true got false +FAIL subtest_383 assert_true: expected true got false +FAIL subtest_384 assert_true: expected true got false +FAIL subtest_385 assert_true: expected true got false +FAIL subtest_386 assert_true: expected true got false +FAIL subtest_387 assert_true: expected true got false +PASS subtest_388 +PASS subtest_389 +PASS subtest_390 +PASS subtest_391 +PASS subtest_392 +PASS subtest_393 +PASS subtest_394 +PASS subtest_395: all and (width: 117px) should apply +FAIL subtest_396: all and (width = 117px) should apply assert_true: expected true got false +PASS subtest_397: all and (width: 118px) should not apply +PASS subtest_398: all and (width: 116px) should not apply +PASS subtest_399: all and (width = 118px) should not apply +PASS subtest_400: all and (width = 116px) should not apply +PASS subtest_401: all and (min-width: 117px) should apply +PASS subtest_402: all and (min-width: 118px) should not apply +PASS subtest_403: all and (min-width: 116px) should apply +PASS subtest_404: all and (max-width: 117px) should apply +PASS subtest_405: all and (max-width: 118px) should apply +PASS subtest_406: all and (max-width: 116px) should not apply +PASS subtest_407: all and (min-width: 9em) should not apply +PASS subtest_408: all and (min-width: 6em) should apply +PASS subtest_409: all and (max-width: 9em) should apply +PASS subtest_410: all and (max-width: 6em) should not apply +FAIL subtest_411: (width <= 117px) should apply assert_true: expected true got false +FAIL subtest_412: (width >= 117px) should apply assert_true: expected true got false +PASS subtest_413: (width < 117px) should not apply +PASS subtest_414: (width > 117px) should not apply +FAIL subtest_415: (width < 118px) should apply assert_true: expected true got false +FAIL subtest_416: (width <= 118px) should apply assert_true: expected true got false +PASS subtest_417: (width > 118px) should not apply +PASS subtest_418: (width >= 118px) should not apply +FAIL subtest_419: (width > 116px) should apply assert_true: expected true got false +FAIL subtest_420: (width >= 116px) should apply assert_true: expected true got false +PASS subtest_421: (width < 116px) should not apply +PASS subtest_422: (width <= 116px) should not apply +PASS subtest_423: all and (height: 76px) should apply +FAIL subtest_424: all and (height = 76px) should apply assert_true: expected true got false +PASS subtest_425: all and (height: 77px) should not apply +PASS subtest_426: all and (height: 75px) should not apply +PASS subtest_427: all and (height = 77px) should not apply +PASS subtest_428: all and (height = 75px) should not apply +PASS subtest_429: all and (min-height: 76px) should apply +PASS subtest_430: all and (min-height: 77px) should not apply +PASS subtest_431: all and (min-height: 75px) should apply +PASS subtest_432: all and (max-height: 76px) should apply +PASS subtest_433: all and (max-height: 77px) should apply +PASS subtest_434: all and (max-height: 75px) should not apply +PASS subtest_435: all and (min-height: 6em) should not apply +PASS subtest_436: all and (min-height: 3em) should apply +PASS subtest_437: all and (max-height: 6em) should apply +PASS subtest_438: all and (max-height: 3em) should not apply +FAIL subtest_439: (height <= 76px) should apply assert_true: expected true got false +FAIL subtest_440: (height >= 76px) should apply assert_true: expected true got false +PASS subtest_441: (height < 76px) should not apply +PASS subtest_442: (height > 76px) should not apply +FAIL subtest_443: (height < 77px) should apply assert_true: expected true got false +FAIL subtest_444: (height <= 77px) should apply assert_true: expected true got false +PASS subtest_445: (height > 77px) should not apply +PASS subtest_446: (height >= 77px) should not apply +FAIL subtest_447: (height > 75px) should apply assert_true: expected true got false +FAIL subtest_448: (height >= 75px) should apply assert_true: expected true got false +PASS subtest_449: (height < 75px) should not apply +PASS subtest_450: (height <= 75px) should not apply +PASS subtest_451: all and (device-width: 1280px) should apply +FAIL subtest_452: all and (device-width = 1280px) should apply assert_true: expected true got false +PASS subtest_453: all and (device-width: 1281px) should not apply +PASS subtest_454: all and (device-width: 1279px) should not apply +PASS subtest_455: all and (device-width = 1281px) should not apply +PASS subtest_456: all and (device-width = 1279px) should not apply +PASS subtest_457: all and (min-device-width: 1280px) should apply +PASS subtest_458: all and (min-device-width: 1281px) should not apply +PASS subtest_459: all and (min-device-width: 1279px) should apply +PASS subtest_460: all and (max-device-width: 1280px) should apply +PASS subtest_461: all and (max-device-width: 1281px) should apply +PASS subtest_462: all and (max-device-width: 1279px) should not apply +PASS subtest_463: all and (min-device-width: 81em) should not apply +PASS subtest_464: all and (min-device-width: 79em) should apply +PASS subtest_465: all and (max-device-width: 81em) should apply +PASS subtest_466: all and (max-device-width: 79em) should not apply +FAIL subtest_467: (device-width <= 1280px) should apply assert_true: expected true got false +FAIL subtest_468: (device-width >= 1280px) should apply assert_true: expected true got false +PASS subtest_469: (device-width < 1280px) should not apply +PASS subtest_470: (device-width > 1280px) should not apply +FAIL subtest_471: (device-width < 1281px) should apply assert_true: expected true got false +FAIL subtest_472: (device-width <= 1281px) should apply assert_true: expected true got false +PASS subtest_473: (device-width > 1281px) should not apply +PASS subtest_474: (device-width >= 1281px) should not apply +FAIL subtest_475: (device-width > 1279px) should apply assert_true: expected true got false +FAIL subtest_476: (device-width >= 1279px) should apply assert_true: expected true got false +PASS subtest_477: (device-width < 1279px) should not apply +PASS subtest_478: (device-width <= 1279px) should not apply +PASS subtest_479: all and (device-height: 1024px) should apply +FAIL subtest_480: all and (device-height = 1024px) should apply assert_true: expected true got false +PASS subtest_481: all and (device-height: 1025px) should not apply +PASS subtest_482: all and (device-height: 1023px) should not apply +PASS subtest_483: all and (device-height = 1025px) should not apply +PASS subtest_484: all and (device-height = 1023px) should not apply +PASS subtest_485: all and (min-device-height: 1024px) should apply +PASS subtest_486: all and (min-device-height: 1025px) should not apply +PASS subtest_487: all and (min-device-height: 1023px) should apply +PASS subtest_488: all and (max-device-height: 1024px) should apply +PASS subtest_489: all and (max-device-height: 1025px) should apply +PASS subtest_490: all and (max-device-height: 1023px) should not apply +PASS subtest_491: all and (min-device-height: 65em) should not apply +PASS subtest_492: all and (min-device-height: 63em) should apply +PASS subtest_493: all and (max-device-height: 65em) should apply +PASS subtest_494: all and (max-device-height: 63em) should not apply +FAIL subtest_495: (device-height <= 1024px) should apply assert_true: expected true got false +FAIL subtest_496: (device-height >= 1024px) should apply assert_true: expected true got false +PASS subtest_497: (device-height < 1024px) should not apply +PASS subtest_498: (device-height > 1024px) should not apply +FAIL subtest_499: (device-height < 1025px) should apply assert_true: expected true got false +FAIL subtest_500: (device-height <= 1025px) should apply assert_true: expected true got false +PASS subtest_501: (device-height > 1025px) should not apply +PASS subtest_502: (device-height >= 1025px) should not apply +FAIL subtest_503: (device-height > 1023px) should apply assert_true: expected true got false +FAIL subtest_504: (device-height >= 1023px) should apply assert_true: expected true got false +PASS subtest_505: (device-height < 1023px) should not apply +PASS subtest_506: (device-height <= 1023px) should not apply +PASS subtest_507: all and (height) should apply +PASS subtest_508: all and (width) should not apply +PASS subtest_509: all and (height) should not apply +PASS subtest_510: all and (width) should not apply +PASS subtest_511: all and (device-height) should apply +PASS subtest_512: all and (device-width) should apply +PASS subtest_513: all and (height) should not apply +PASS subtest_514: all and (width) should apply +PASS subtest_515: all and (height) should apply +PASS subtest_516: all and (width) should apply +PASS subtest_517 +PASS subtest_518 +PASS subtest_519 +PASS subtest_520 +PASS subtest_521 +PASS subtest_522 +PASS subtest_523 +PASS subtest_524 +PASS subtest_525 +PASS subtest_526: (orientation) should apply +PASS subtest_527: (orientation: landscape) should apply +PASS subtest_528: (orientation: portrait) should not apply +PASS subtest_529: not all and (orientation: portrait) should apply +PASS subtest_530: (orientation) should apply +PASS subtest_531: (orientation: landscape) should not apply +PASS subtest_532: not all and (orientation: landscape) should apply +PASS subtest_533: (orientation: portrait) should apply +PASS subtest_534: (aspect-ratio: 59/80) should apply +PASS subtest_535: (aspect-ratio: 58/80) should not apply +PASS subtest_536: (aspect-ratio: 59/81) should not apply +PASS subtest_537: (aspect-ratio: 60/80) should not apply +PASS subtest_538: (aspect-ratio: 59/79) should not apply +PASS subtest_539: (aspect-ratio: 177/240) should apply +PASS subtest_540: (aspect-ratio: 413/560) should apply +PASS subtest_541: (aspect-ratio: 5900/8000) should apply +PASS subtest_542: (aspect-ratio: 5901/8000) should not apply +PASS subtest_543: (aspect-ratio: 5899/8000) should not apply +PASS subtest_544: (aspect-ratio: 5900/8001) should not apply +PASS subtest_545: (aspect-ratio: 5900/7999) should not apply +PASS subtest_546: (aspect-ratio) should apply +PASS subtest_547: (min-aspect-ratio: 59/80) should apply +PASS subtest_548: (min-aspect-ratio: 58/80) should apply +PASS subtest_549: (min-aspect-ratio: 59/81) should apply +PASS subtest_550: (min-aspect-ratio: 60/80) should not apply +PASS subtest_551: (min-aspect-ratio: 59/79) should not apply +PASS subtest_552 +PASS subtest_553: (max-aspect-ratio: 59/80) should apply +PASS subtest_554: (max-aspect-ratio: 58/80) should not apply +PASS subtest_555: (max-aspect-ratio: 59/81) should not apply +PASS subtest_556: (max-aspect-ratio: 60/80) should apply +PASS subtest_557: (max-aspect-ratio: 59/79) should apply +PASS subtest_558 +PASS subtest_559: (device-aspect-ratio: 1280/1024) should apply +PASS subtest_560: not all and (device-aspect-ratio: 1281/1024) should apply +PASS subtest_561: all and (device-aspect-ratio: 1280/1023) should not apply +PASS subtest_562: all and (device-aspect-ratio: 1279/1024) should not apply +PASS subtest_563: not all and (device-aspect-ratio: 1280/1025) should apply +PASS subtest_564: (device-aspect-ratio) should apply +PASS subtest_565: (min-device-aspect-ratio: 1280/1024) should apply +PASS subtest_566: all and (min-device-aspect-ratio: 1281/1024) should not apply +PASS subtest_567: not all and (min-device-aspect-ratio: 1280/1023) should apply +PASS subtest_568: not all and (min-device-aspect-ratio: 1279/1024) should not apply +PASS subtest_569: all and (min-device-aspect-ratio: 1280/1025) should apply +PASS subtest_570 +PASS subtest_571: all and (max-device-aspect-ratio: 1280/1024) should apply +PASS subtest_572: (max-device-aspect-ratio: 1281/1024) should apply +PASS subtest_573: (max-device-aspect-ratio: 1280/1023) should apply +PASS subtest_574: all and (max-device-aspect-ratio: 1279/1024) should not apply +PASS subtest_575: not all and (max-device-aspect-ratio: 1280/1025) should apply +PASS subtest_576 +PASS subtest_577 +PASS subtest_578 +PASS subtest_579 +PASS subtest_580 +FAIL subtest_581 assert_true: expected true got false +FAIL subtest_582 assert_true: expected true got false +FAIL subtest_583 assert_true: expected true got false +FAIL subtest_584 assert_true: expected true got false +FAIL subtest_585 assert_true: expected true got false +FAIL subtest_586 assert_true: expected true got false +FAIL subtest_587 assert_true: expected true got false +FAIL subtest_588 assert_true: expected true got false +PASS subtest_589 +PASS subtest_590 +PASS subtest_591 +PASS subtest_592 +PASS subtest_593 +PASS subtest_594 +PASS subtest_595 +PASS subtest_596 +PASS subtest_597 +PASS subtest_598 +PASS subtest_599 +PASS subtest_600 +FAIL subtest_601 assert_true: expected true got false +FAIL subtest_602 assert_true: expected true got false +FAIL subtest_603 assert_true: expected true got false +FAIL subtest_604 assert_true: expected true got false +FAIL subtest_605 assert_true: expected true got false +FAIL subtest_606 assert_true: expected true got false +FAIL subtest_607 assert_true: expected true got false +FAIL subtest_608 assert_true: expected true got false +PASS subtest_609 +PASS subtest_610 +PASS subtest_611 +PASS subtest_612 +PASS subtest_613 +PASS subtest_614 +PASS subtest_615 +PASS subtest_616 +PASS monochrome_and_color +PASS find_depth +PASS subtest_617: all and (color:8) should apply +PASS subtest_618: all and (color:7) should not apply +PASS subtest_619: all and (color:9) should not apply +PASS subtest_620: all and (max-color:8) should apply +PASS subtest_621: all and (max-color:7) should not apply +PASS subtest_622: all and (max-color:9) should apply +PASS subtest_623: all and (color) should apply +PASS subtest_624 +PASS subtest_625 +PASS subtest_626: all and (monochrome) should not apply +PASS subtest_627 +PASS subtest_628 +PASS subtest_629: not all and (monochrome) should apply +PASS subtest_630: not all and (color) should not apply +PASS subtest_631: only all and (color) should apply +PASS subtest_632: only all and (monochrome) should not apply +PASS subtest_633 +PASS subtest_634 +PASS subtest_635 +PASS subtest_636 +PASS subtest_637 +PASS subtest_638 +PASS subtest_639 +PASS subtest_640 +PASS subtest_641 +PASS subtest_642 +PASS subtest_643 +PASS subtest_644 +PASS subtest_645 +PASS subtest_646 +PASS subtest_647 +PASS subtest_648 +PASS subtest_649 +PASS subtest_650 +PASS subtest_651: (color-index: 0) should apply +PASS subtest_652: (color-index: 1) should not apply +PASS subtest_653: (min-color-index: 0) should apply +PASS subtest_654: (min-color-index: 1) should not apply +PASS subtest_655: (max-color-index: 0) should apply +PASS subtest_656: (max-color-index: 1) should apply +PASS subtest_657: (max-color-index: 157) should apply +PASS subtest_658 +PASS subtest_659 +PASS subtest_660 +PASS subtest_661 +PASS subtest_662 +PASS subtest_663 +PASS subtest_664 +PASS subtest_665 +PASS subtest_666 +PASS subtest_667 +PASS subtest_668 +PASS subtest_669 +PASS subtest_670 +PASS subtest_671 +PASS subtest_672 +PASS subtest_673 +PASS subtest_674 +PASS subtest_675 +PASS subtest_676 +PASS subtest_677 +PASS subtest_678 +PASS subtest_679 +PASS subtest_680 +PASS subtest_681 +PASS subtest_682 +PASS subtest_683 +PASS subtest_684 +PASS subtest_685 +PASS subtest_686 +PASS subtest_687 +PASS subtest_688 +PASS subtest_689 +PASS subtest_690 +PASS subtest_691 +PASS subtest_692 +PASS subtest_693 +PASS subtest_694 +PASS subtest_695 +PASS subtest_696 +PASS subtest_697 +PASS subtest_698 +PASS subtest_699 +PASS find_resolution +PASS subtest_700: (resolution: 96dpi) should apply +PASS subtest_701: (resolution: 1dppx) should apply +PASS subtest_702: (resolution: 1x) should apply +PASS subtest_703: (resolution: 97dpi) should not apply +PASS subtest_704: (resolution: 95dpi) should not apply +PASS subtest_705: (min-resolution: 95dpi) should apply +PASS subtest_706: not all and (min-resolution: 95dpi) should not apply +PASS subtest_707: not all and (min-resolution: 97dpi) should apply +PASS subtest_708: all and (min-resolution: 97dpi) should not apply +PASS subtest_709: (min-resolution: 37dpcm) should apply +PASS subtest_710: (max-resolution: 39dpcm) should apply +PASS subtest_711: (max-resolution: 37dpcm) should not apply +PASS subtest_712: not all and (min-resolution: 39dpcm) should apply +PASS subtest_713 +PASS subtest_714 +PASS subtest_715 +PASS subtest_716 +PASS subtest_717 +PASS subtest_718 +PASS subtest_719 +PASS subtest_720: (scan) should not apply +PASS subtest_721: (scan: progressive) should not apply +PASS subtest_722: (scan: interlace) should not apply +PASS subtest_723: not all and (scan) should apply +PASS subtest_724: not all and (scan: progressive) should apply +PASS subtest_725: not all and (scan: interlace) should apply +PASS subtest_726 +PASS subtest_727 +PASS subtest_728 +PASS subtest_729 +PASS subtest_730 +PASS subtest_731 +PASS subtest_732 +PASS subtest_733 +PASS subtest_734 +PASS subtest_735: (grid) should not apply +PASS subtest_736: (grid: 0) should apply +PASS subtest_737: (grid: 1) should not apply +PASS subtest_738: (grid: 2) should not apply +PASS subtest_739: (grid: -1) should not apply +PASS subtest_740: (orientation should apply +PASS subtest_741: not all and (orientation should not apply +PASS subtest_742: (orientation: should not apply +PASS subtest_743: (orientation:) should not apply +PASS subtest_744: (orientation: ) should not apply +PASS subtest_745: all,(orientation: should apply +PASS subtest_746: (orientation:,all should not apply +PASS subtest_747: not all and (grid should apply +PASS subtest_748: only all and (grid should not apply +PASS subtest_749: (grid should not apply +PASS subtest_750: all,(grid should apply +PASS subtest_751: (grid,all should not apply +PASS subtest_752: ,all should apply +PASS subtest_753: all, should apply +PASS subtest_754: ,all, should apply +PASS subtest_755: all,badmedium should apply +PASS subtest_756: badmedium,all should apply +PASS subtest_757: ,badmedium, should not apply +PASS subtest_758: all,(badexpression) should apply +PASS subtest_759: (badexpression),all should apply +PASS subtest_760: (badexpression),badmedium should not apply +PASS subtest_761: badmedium,(badexpression) should not apply +PASS subtest_762: all,[badsyntax] should apply +PASS subtest_763: [badsyntax],all should apply +PASS subtest_764: badmedium,[badsyntax] should not apply +PASS subtest_765: [badsyntax],badmedium should not apply +PASS subtest_766 +PASS subtest_767 +PASS subtest_768: all and min-color : 1 should not apply +PASS subtest_769: (bogus) should not apply +PASS subtest_770: not all and (bogus) should not apply +PASS subtest_771: only all and (bogus) should not apply +FAIL subtest_772 assert_true: expected true got false +FAIL subtest_773 assert_true: expected true got false +FAIL subtest_774 assert_true: expected true got false +FAIL subtest_775 assert_true: expected true got false +FAIL subtest_776 assert_true: expected true got false +PASS subtest_777 +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/url/a-element-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/url/a-element-expected.txt index d8482c7..a4fcdfd 100644 --- a/third_party/blink/web_tests/platform/mac/external/wpt/url/a-element-expected.txt +++ b/third_party/blink/web_tests/platform/mac/external/wpt/url/a-element-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 596 tests; 358 PASS, 238 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 604 tests; 363 PASS, 241 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -472,6 +472,14 @@ PASS Parsing: <file://example.net/C:/> against <about:blank> PASS Parsing: <file://1.2.3.4/C:/> against <about:blank> PASS Parsing: <file://[1::8]/C:/> against <about:blank> +FAIL Parsing: <C|/> against <file://host/> assert_equals: href expected "file://host/C:/" but got "file://host/C%7C/" +PASS Parsing: </C:/> against <file://host/> +PASS Parsing: <file:C:/> against <file://host/> +PASS Parsing: <file:/C:/> against <file://host/> +FAIL Parsing: <//C:/> against <file://host/> assert_equals: href expected "file:///C:/" but got "file://c:/" +FAIL Parsing: <file://C:/> against <file://host/> assert_equals: href expected "file:///C:/" but got "file://c:/" +PASS Parsing: <///C:/> against <file://host/> +PASS Parsing: <file:///C:/> against <file://host/> FAIL Parsing: <file:/C|/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file:///C%7C/" FAIL Parsing: <file://C|/> against <about:blank> assert_equals: href expected "file:///C:/" but got "file://c%7C/" PASS Parsing: <file:> against <about:blank>
diff --git a/third_party/blink/web_tests/platform/mac/tables/mozilla/bugs/bug137388-2-expected.png b/third_party/blink/web_tests/platform/mac/tables/mozilla/bugs/bug137388-2-expected.png index c83c11bd..77559894 100644 --- a/third_party/blink/web_tests/platform/mac/tables/mozilla/bugs/bug137388-2-expected.png +++ b/third_party/blink/web_tests/platform/mac/tables/mozilla/bugs/bug137388-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png b/third_party/blink/web_tests/platform/mac/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png deleted file mode 100644 index 5f36585..0000000 --- a/third_party/blink/web_tests/platform/mac/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png b/third_party/blink/web_tests/platform/mac/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png deleted file mode 100644 index 0232744..0000000 --- a/third_party/blink/web_tests/platform/mac/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/css/mediaqueries/test_media_queries-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/css/mediaqueries/test_media_queries-expected.txt new file mode 100644 index 0000000..29041b82 --- /dev/null +++ b/third_party/blink/web_tests/platform/win/external/wpt/css/mediaqueries/test_media_queries-expected.txt
@@ -0,0 +1,785 @@ +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = Uncaught Error: assert_not_equals: overflow-block should be equivalent to not (overflow-block: none) got disallowed value false +Found 780 tests; 568 PASS, 212 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS subtest_1 +FAIL subtest_2 assert_true: expected true got false +PASS subtest_3 +PASS subtest_4 +PASS subtest_5 +PASS subtest_6 +PASS subtest_7 +PASS subtest_8 +FAIL subtest_9 assert_true: expected true got false +FAIL subtest_10 assert_true: expected true got false +PASS subtest_11 +PASS subtest_12 +PASS subtest_13 +PASS subtest_14 +PASS subtest_15 +PASS subtest_16 +PASS subtest_17 +PASS subtest_18 +PASS subtest_19 +PASS subtest_20 +PASS subtest_21 +PASS subtest_22 +PASS subtest_23 +PASS subtest_24 +PASS subtest_25 +PASS subtest_26 +PASS subtest_27 +PASS subtest_28 +PASS subtest_29 +PASS subtest_30 +PASS subtest_31 +PASS subtest_32 +FAIL subtest_33 assert_true: expected true got false +FAIL subtest_34 assert_true: expected true got false +FAIL subtest_35 assert_true: expected true got false +FAIL subtest_36 assert_true: expected true got false +FAIL subtest_37 assert_true: expected true got false +FAIL subtest_38 assert_true: expected true got false +FAIL subtest_39 assert_true: expected true got false +FAIL subtest_40 assert_true: expected true got false +PASS subtest_41 +PASS subtest_42 +PASS subtest_43 +PASS subtest_44 +PASS subtest_45 +PASS subtest_46 +PASS subtest_47 +FAIL subtest_48 assert_true: expected true got false +FAIL subtest_49 assert_true: expected true got false +FAIL subtest_50 assert_true: expected true got false +FAIL subtest_51 assert_true: expected true got false +FAIL subtest_52 assert_true: expected true got false +FAIL subtest_53 assert_true: expected true got false +FAIL subtest_54 assert_true: expected true got false +FAIL subtest_55 assert_true: expected true got false +PASS subtest_56 +PASS subtest_57 +PASS subtest_58 +PASS subtest_59 +PASS subtest_60 +PASS subtest_61 +PASS subtest_62 +PASS subtest_63 +FAIL subtest_64 assert_true: expected true got false +FAIL subtest_65 assert_true: expected true got false +FAIL subtest_66 assert_true: expected true got false +FAIL subtest_67 assert_true: expected true got false +FAIL subtest_68 assert_true: expected true got false +FAIL subtest_69 assert_true: expected true got false +FAIL subtest_70 assert_true: expected true got false +FAIL subtest_71 assert_true: expected true got false +PASS subtest_72 +PASS subtest_73 +PASS subtest_74 +PASS subtest_75 +PASS subtest_76 +PASS subtest_77 +PASS subtest_78 +FAIL subtest_79 assert_true: expected true got false +FAIL subtest_80 assert_true: expected true got false +FAIL subtest_81 assert_true: expected true got false +FAIL subtest_82 assert_true: expected true got false +FAIL subtest_83 assert_true: expected true got false +FAIL subtest_84 assert_true: expected true got false +FAIL subtest_85 assert_true: expected true got false +FAIL subtest_86 assert_true: expected true got false +PASS subtest_87 +PASS subtest_88 +PASS subtest_89 +PASS subtest_90 +PASS subtest_91 +PASS subtest_92 +PASS subtest_93 +PASS subtest_94 +FAIL subtest_95 assert_true: expected true got false +FAIL subtest_96 assert_true: expected true got false +FAIL subtest_97 assert_true: expected true got false +FAIL subtest_98 assert_true: expected true got false +FAIL subtest_99 assert_true: expected true got false +FAIL subtest_100 assert_true: expected true got false +FAIL subtest_101 assert_true: expected true got false +FAIL subtest_102 assert_true: expected true got false +PASS subtest_103 +PASS subtest_104 +PASS subtest_105 +PASS subtest_106 +PASS subtest_107 +PASS subtest_108 +PASS subtest_109 +PASS subtest_110 +PASS subtest_111 +PASS subtest_112 +PASS subtest_113 +PASS subtest_114 +PASS subtest_115 +PASS subtest_116 +PASS subtest_117 +PASS subtest_118 +PASS subtest_119 +PASS subtest_120 +PASS subtest_121 +PASS subtest_122 +PASS subtest_123 +PASS subtest_124 +PASS subtest_125 +PASS subtest_126 +PASS subtest_127 +FAIL subtest_128 assert_true: expected true got false +FAIL subtest_129 assert_true: expected true got false +FAIL subtest_130 assert_true: expected true got false +FAIL subtest_131 assert_true: expected true got false +FAIL subtest_132 assert_true: expected true got false +FAIL subtest_133 assert_true: expected true got false +FAIL subtest_134 assert_true: expected true got false +FAIL subtest_135 assert_true: expected true got false +PASS subtest_136 +PASS subtest_137 +PASS subtest_138 +PASS subtest_139 +PASS subtest_140 +PASS subtest_141 +PASS subtest_142 +FAIL subtest_143 assert_true: expected true got false +FAIL subtest_144 assert_true: expected true got false +FAIL subtest_145 assert_true: expected true got false +FAIL subtest_146 assert_true: expected true got false +FAIL subtest_147 assert_true: expected true got false +FAIL subtest_148 assert_true: expected true got false +FAIL subtest_149 assert_true: expected true got false +FAIL subtest_150 assert_true: expected true got false +PASS subtest_151 +PASS subtest_152 +PASS subtest_153 +PASS subtest_154 +PASS subtest_155 +PASS subtest_156 +PASS subtest_157 +PASS subtest_158 +FAIL subtest_159 assert_true: expected true got false +FAIL subtest_160 assert_true: expected true got false +FAIL subtest_161 assert_true: expected true got false +FAIL subtest_162 assert_true: expected true got false +FAIL subtest_163 assert_true: expected true got false +FAIL subtest_164 assert_true: expected true got false +FAIL subtest_165 assert_true: expected true got false +FAIL subtest_166 assert_true: expected true got false +PASS subtest_167 +PASS subtest_168 +PASS subtest_169 +PASS subtest_170 +PASS subtest_171 +PASS subtest_172 +PASS subtest_173 +FAIL subtest_174 assert_true: expected true got false +FAIL subtest_175 assert_true: expected true got false +FAIL subtest_176 assert_true: expected true got false +FAIL subtest_177 assert_true: expected true got false +FAIL subtest_178 assert_true: expected true got false +FAIL subtest_179 assert_true: expected true got false +FAIL subtest_180 assert_true: expected true got false +FAIL subtest_181 assert_true: expected true got false +PASS subtest_182 +PASS subtest_183 +PASS subtest_184 +PASS subtest_185 +PASS subtest_186 +PASS subtest_187 +PASS subtest_188 +PASS subtest_189 +FAIL subtest_190 assert_true: expected true got false +FAIL subtest_191 assert_true: expected true got false +FAIL subtest_192 assert_true: expected true got false +FAIL subtest_193 assert_true: expected true got false +FAIL subtest_194 assert_true: expected true got false +FAIL subtest_195 assert_true: expected true got false +FAIL subtest_196 assert_true: expected true got false +FAIL subtest_197 assert_true: expected true got false +PASS subtest_198 +PASS subtest_199 +PASS subtest_200 +PASS subtest_201 +PASS subtest_202 +PASS subtest_203 +PASS subtest_204 +PASS subtest_205 +PASS subtest_206 +PASS subtest_207 +PASS subtest_208 +PASS subtest_209 +PASS subtest_210 +PASS subtest_211 +PASS subtest_212 +PASS subtest_213 +PASS subtest_214 +PASS subtest_215 +PASS subtest_216 +PASS subtest_217 +PASS subtest_218 +PASS subtest_219 +PASS subtest_220 +PASS subtest_221 +PASS subtest_222 +FAIL subtest_223 assert_true: expected true got false +FAIL subtest_224 assert_true: expected true got false +FAIL subtest_225 assert_true: expected true got false +FAIL subtest_226 assert_true: expected true got false +FAIL subtest_227 assert_true: expected true got false +FAIL subtest_228 assert_true: expected true got false +FAIL subtest_229 assert_true: expected true got false +FAIL subtest_230 assert_true: expected true got false +PASS subtest_231 +PASS subtest_232 +PASS subtest_233 +PASS subtest_234 +PASS subtest_235 +PASS subtest_236 +PASS subtest_237 +FAIL subtest_238 assert_true: expected true got false +FAIL subtest_239 assert_true: expected true got false +FAIL subtest_240 assert_true: expected true got false +FAIL subtest_241 assert_true: expected true got false +FAIL subtest_242 assert_true: expected true got false +FAIL subtest_243 assert_true: expected true got false +FAIL subtest_244 assert_true: expected true got false +FAIL subtest_245 assert_true: expected true got false +PASS subtest_246 +PASS subtest_247 +PASS subtest_248 +PASS subtest_249 +PASS subtest_250 +PASS subtest_251 +PASS subtest_252 +PASS subtest_253 +FAIL subtest_254 assert_true: expected true got false +FAIL subtest_255 assert_true: expected true got false +FAIL subtest_256 assert_true: expected true got false +FAIL subtest_257 assert_true: expected true got false +FAIL subtest_258 assert_true: expected true got false +FAIL subtest_259 assert_true: expected true got false +FAIL subtest_260 assert_true: expected true got false +FAIL subtest_261 assert_true: expected true got false +PASS subtest_262 +PASS subtest_263 +PASS subtest_264 +PASS subtest_265 +PASS subtest_266 +PASS subtest_267 +PASS subtest_268 +FAIL subtest_269 assert_true: expected true got false +FAIL subtest_270 assert_true: expected true got false +FAIL subtest_271 assert_true: expected true got false +FAIL subtest_272 assert_true: expected true got false +FAIL subtest_273 assert_true: expected true got false +FAIL subtest_274 assert_true: expected true got false +FAIL subtest_275 assert_true: expected true got false +FAIL subtest_276 assert_true: expected true got false +PASS subtest_277 +PASS subtest_278 +PASS subtest_279 +PASS subtest_280 +PASS subtest_281 +PASS subtest_282 +PASS subtest_283 +PASS subtest_284 +FAIL subtest_285 assert_true: expected true got false +FAIL subtest_286 assert_true: expected true got false +FAIL subtest_287 assert_true: expected true got false +FAIL subtest_288 assert_true: expected true got false +FAIL subtest_289 assert_true: expected true got false +FAIL subtest_290 assert_true: expected true got false +FAIL subtest_291 assert_true: expected true got false +FAIL subtest_292 assert_true: expected true got false +PASS subtest_293 +PASS subtest_294 +PASS subtest_295 +PASS subtest_296 +PASS subtest_297 +PASS subtest_298 +PASS subtest_299 +PASS subtest_300 +PASS subtest_301 +PASS subtest_302 +PASS subtest_303 +PASS subtest_304 +PASS subtest_305 +PASS subtest_306 +PASS subtest_307 +PASS subtest_308 +PASS subtest_309 +PASS subtest_310 +PASS subtest_311 +PASS subtest_312 +PASS subtest_313 +PASS subtest_314 +PASS subtest_315 +PASS subtest_316 +PASS subtest_317 +FAIL subtest_318 assert_true: expected true got false +FAIL subtest_319 assert_true: expected true got false +FAIL subtest_320 assert_true: expected true got false +FAIL subtest_321 assert_true: expected true got false +FAIL subtest_322 assert_true: expected true got false +FAIL subtest_323 assert_true: expected true got false +FAIL subtest_324 assert_true: expected true got false +FAIL subtest_325 assert_true: expected true got false +PASS subtest_326 +PASS subtest_327 +PASS subtest_328 +PASS subtest_329 +PASS subtest_330 +PASS subtest_331 +PASS subtest_332 +FAIL subtest_333 assert_true: expected true got false +FAIL subtest_334 assert_true: expected true got false +FAIL subtest_335 assert_true: expected true got false +FAIL subtest_336 assert_true: expected true got false +FAIL subtest_337 assert_true: expected true got false +FAIL subtest_338 assert_true: expected true got false +FAIL subtest_339 assert_true: expected true got false +FAIL subtest_340 assert_true: expected true got false +PASS subtest_341 +PASS subtest_342 +PASS subtest_343 +PASS subtest_344 +PASS subtest_345 +PASS subtest_346 +PASS subtest_347 +PASS subtest_348 +FAIL subtest_349 assert_true: expected true got false +FAIL subtest_350 assert_true: expected true got false +FAIL subtest_351 assert_true: expected true got false +FAIL subtest_352 assert_true: expected true got false +FAIL subtest_353 assert_true: expected true got false +FAIL subtest_354 assert_true: expected true got false +FAIL subtest_355 assert_true: expected true got false +FAIL subtest_356 assert_true: expected true got false +PASS subtest_357 +PASS subtest_358 +PASS subtest_359 +PASS subtest_360 +PASS subtest_361 +PASS subtest_362 +PASS subtest_363 +FAIL subtest_364 assert_true: expected true got false +FAIL subtest_365 assert_true: expected true got false +FAIL subtest_366 assert_true: expected true got false +FAIL subtest_367 assert_true: expected true got false +FAIL subtest_368 assert_true: expected true got false +FAIL subtest_369 assert_true: expected true got false +FAIL subtest_370 assert_true: expected true got false +FAIL subtest_371 assert_true: expected true got false +PASS subtest_372 +PASS subtest_373 +PASS subtest_374 +PASS subtest_375 +PASS subtest_376 +PASS subtest_377 +PASS subtest_378 +PASS subtest_379 +FAIL subtest_380 assert_true: expected true got false +FAIL subtest_381 assert_true: expected true got false +FAIL subtest_382 assert_true: expected true got false +FAIL subtest_383 assert_true: expected true got false +FAIL subtest_384 assert_true: expected true got false +FAIL subtest_385 assert_true: expected true got false +FAIL subtest_386 assert_true: expected true got false +FAIL subtest_387 assert_true: expected true got false +PASS subtest_388 +PASS subtest_389 +PASS subtest_390 +PASS subtest_391 +PASS subtest_392 +PASS subtest_393 +PASS subtest_394 +PASS subtest_395: all and (width: 117px) should apply +FAIL subtest_396: all and (width = 117px) should apply assert_true: expected true got false +PASS subtest_397: all and (width: 118px) should not apply +PASS subtest_398: all and (width: 116px) should not apply +PASS subtest_399: all and (width = 118px) should not apply +PASS subtest_400: all and (width = 116px) should not apply +PASS subtest_401: all and (min-width: 117px) should apply +PASS subtest_402: all and (min-width: 118px) should not apply +PASS subtest_403: all and (min-width: 116px) should apply +PASS subtest_404: all and (max-width: 117px) should apply +PASS subtest_405: all and (max-width: 118px) should apply +PASS subtest_406: all and (max-width: 116px) should not apply +PASS subtest_407: all and (min-width: 9em) should not apply +PASS subtest_408: all and (min-width: 6em) should apply +PASS subtest_409: all and (max-width: 9em) should apply +PASS subtest_410: all and (max-width: 6em) should not apply +FAIL subtest_411: (width <= 117px) should apply assert_true: expected true got false +FAIL subtest_412: (width >= 117px) should apply assert_true: expected true got false +PASS subtest_413: (width < 117px) should not apply +PASS subtest_414: (width > 117px) should not apply +FAIL subtest_415: (width < 118px) should apply assert_true: expected true got false +FAIL subtest_416: (width <= 118px) should apply assert_true: expected true got false +PASS subtest_417: (width > 118px) should not apply +PASS subtest_418: (width >= 118px) should not apply +FAIL subtest_419: (width > 116px) should apply assert_true: expected true got false +FAIL subtest_420: (width >= 116px) should apply assert_true: expected true got false +PASS subtest_421: (width < 116px) should not apply +PASS subtest_422: (width <= 116px) should not apply +PASS subtest_423: all and (height: 76px) should apply +FAIL subtest_424: all and (height = 76px) should apply assert_true: expected true got false +PASS subtest_425: all and (height: 77px) should not apply +PASS subtest_426: all and (height: 75px) should not apply +PASS subtest_427: all and (height = 77px) should not apply +PASS subtest_428: all and (height = 75px) should not apply +PASS subtest_429: all and (min-height: 76px) should apply +PASS subtest_430: all and (min-height: 77px) should not apply +PASS subtest_431: all and (min-height: 75px) should apply +PASS subtest_432: all and (max-height: 76px) should apply +PASS subtest_433: all and (max-height: 77px) should apply +PASS subtest_434: all and (max-height: 75px) should not apply +PASS subtest_435: all and (min-height: 6em) should not apply +PASS subtest_436: all and (min-height: 3em) should apply +PASS subtest_437: all and (max-height: 6em) should apply +PASS subtest_438: all and (max-height: 3em) should not apply +FAIL subtest_439: (height <= 76px) should apply assert_true: expected true got false +FAIL subtest_440: (height >= 76px) should apply assert_true: expected true got false +PASS subtest_441: (height < 76px) should not apply +PASS subtest_442: (height > 76px) should not apply +FAIL subtest_443: (height < 77px) should apply assert_true: expected true got false +FAIL subtest_444: (height <= 77px) should apply assert_true: expected true got false +PASS subtest_445: (height > 77px) should not apply +PASS subtest_446: (height >= 77px) should not apply +FAIL subtest_447: (height > 75px) should apply assert_true: expected true got false +FAIL subtest_448: (height >= 75px) should apply assert_true: expected true got false +PASS subtest_449: (height < 75px) should not apply +PASS subtest_450: (height <= 75px) should not apply +PASS subtest_451: all and (device-width: 1024px) should apply +FAIL subtest_452: all and (device-width = 1024px) should apply assert_true: expected true got false +PASS subtest_453: all and (device-width: 1025px) should not apply +PASS subtest_454: all and (device-width: 1023px) should not apply +PASS subtest_455: all and (device-width = 1025px) should not apply +PASS subtest_456: all and (device-width = 1023px) should not apply +PASS subtest_457: all and (min-device-width: 1024px) should apply +PASS subtest_458: all and (min-device-width: 1025px) should not apply +PASS subtest_459: all and (min-device-width: 1023px) should apply +PASS subtest_460: all and (max-device-width: 1024px) should apply +PASS subtest_461: all and (max-device-width: 1025px) should apply +PASS subtest_462: all and (max-device-width: 1023px) should not apply +PASS subtest_463: all and (min-device-width: 65em) should not apply +PASS subtest_464: all and (min-device-width: 63em) should apply +PASS subtest_465: all and (max-device-width: 65em) should apply +PASS subtest_466: all and (max-device-width: 63em) should not apply +FAIL subtest_467: (device-width <= 1024px) should apply assert_true: expected true got false +FAIL subtest_468: (device-width >= 1024px) should apply assert_true: expected true got false +PASS subtest_469: (device-width < 1024px) should not apply +PASS subtest_470: (device-width > 1024px) should not apply +FAIL subtest_471: (device-width < 1025px) should apply assert_true: expected true got false +FAIL subtest_472: (device-width <= 1025px) should apply assert_true: expected true got false +PASS subtest_473: (device-width > 1025px) should not apply +PASS subtest_474: (device-width >= 1025px) should not apply +FAIL subtest_475: (device-width > 1023px) should apply assert_true: expected true got false +FAIL subtest_476: (device-width >= 1023px) should apply assert_true: expected true got false +PASS subtest_477: (device-width < 1023px) should not apply +PASS subtest_478: (device-width <= 1023px) should not apply +PASS subtest_479: all and (device-height: 768px) should apply +FAIL subtest_480: all and (device-height = 768px) should apply assert_true: expected true got false +PASS subtest_481: all and (device-height: 769px) should not apply +PASS subtest_482: all and (device-height: 767px) should not apply +PASS subtest_483: all and (device-height = 769px) should not apply +PASS subtest_484: all and (device-height = 767px) should not apply +PASS subtest_485: all and (min-device-height: 768px) should apply +PASS subtest_486: all and (min-device-height: 769px) should not apply +PASS subtest_487: all and (min-device-height: 767px) should apply +PASS subtest_488: all and (max-device-height: 768px) should apply +PASS subtest_489: all and (max-device-height: 769px) should apply +PASS subtest_490: all and (max-device-height: 767px) should not apply +PASS subtest_491: all and (min-device-height: 49em) should not apply +PASS subtest_492: all and (min-device-height: 47em) should apply +PASS subtest_493: all and (max-device-height: 49em) should apply +PASS subtest_494: all and (max-device-height: 47em) should not apply +FAIL subtest_495: (device-height <= 768px) should apply assert_true: expected true got false +FAIL subtest_496: (device-height >= 768px) should apply assert_true: expected true got false +PASS subtest_497: (device-height < 768px) should not apply +PASS subtest_498: (device-height > 768px) should not apply +FAIL subtest_499: (device-height < 769px) should apply assert_true: expected true got false +FAIL subtest_500: (device-height <= 769px) should apply assert_true: expected true got false +PASS subtest_501: (device-height > 769px) should not apply +PASS subtest_502: (device-height >= 769px) should not apply +FAIL subtest_503: (device-height > 767px) should apply assert_true: expected true got false +FAIL subtest_504: (device-height >= 767px) should apply assert_true: expected true got false +PASS subtest_505: (device-height < 767px) should not apply +PASS subtest_506: (device-height <= 767px) should not apply +PASS subtest_507: all and (height) should apply +PASS subtest_508: all and (width) should not apply +PASS subtest_509: all and (height) should not apply +PASS subtest_510: all and (width) should not apply +PASS subtest_511: all and (device-height) should apply +PASS subtest_512: all and (device-width) should apply +PASS subtest_513: all and (height) should not apply +PASS subtest_514: all and (width) should apply +PASS subtest_515: all and (height) should apply +PASS subtest_516: all and (width) should apply +PASS subtest_517 +PASS subtest_518 +PASS subtest_519 +PASS subtest_520 +PASS subtest_521 +PASS subtest_522 +PASS subtest_523 +PASS subtest_524 +PASS subtest_525 +PASS subtest_526: (orientation) should apply +PASS subtest_527: (orientation: landscape) should apply +PASS subtest_528: (orientation: portrait) should not apply +PASS subtest_529: not all and (orientation: portrait) should apply +PASS subtest_530: (orientation) should apply +PASS subtest_531: (orientation: landscape) should not apply +PASS subtest_532: not all and (orientation: landscape) should apply +PASS subtest_533: (orientation: portrait) should apply +PASS subtest_534: (aspect-ratio: 59/80) should apply +PASS subtest_535: (aspect-ratio: 58/80) should not apply +PASS subtest_536: (aspect-ratio: 59/81) should not apply +PASS subtest_537: (aspect-ratio: 60/80) should not apply +PASS subtest_538: (aspect-ratio: 59/79) should not apply +PASS subtest_539: (aspect-ratio: 177/240) should apply +PASS subtest_540: (aspect-ratio: 413/560) should apply +PASS subtest_541: (aspect-ratio: 5900/8000) should apply +PASS subtest_542: (aspect-ratio: 5901/8000) should not apply +PASS subtest_543: (aspect-ratio: 5899/8000) should not apply +PASS subtest_544: (aspect-ratio: 5900/8001) should not apply +PASS subtest_545: (aspect-ratio: 5900/7999) should not apply +PASS subtest_546: (aspect-ratio) should apply +PASS subtest_547: (min-aspect-ratio: 59/80) should apply +PASS subtest_548: (min-aspect-ratio: 58/80) should apply +PASS subtest_549: (min-aspect-ratio: 59/81) should apply +PASS subtest_550: (min-aspect-ratio: 60/80) should not apply +PASS subtest_551: (min-aspect-ratio: 59/79) should not apply +PASS subtest_552 +PASS subtest_553: (max-aspect-ratio: 59/80) should apply +PASS subtest_554: (max-aspect-ratio: 58/80) should not apply +PASS subtest_555: (max-aspect-ratio: 59/81) should not apply +PASS subtest_556: (max-aspect-ratio: 60/80) should apply +PASS subtest_557: (max-aspect-ratio: 59/79) should apply +PASS subtest_558 +PASS subtest_559: (device-aspect-ratio: 1024/768) should apply +PASS subtest_560: not all and (device-aspect-ratio: 1025/768) should apply +PASS subtest_561: all and (device-aspect-ratio: 1024/767) should not apply +PASS subtest_562: all and (device-aspect-ratio: 1023/768) should not apply +PASS subtest_563: not all and (device-aspect-ratio: 1024/769) should apply +PASS subtest_564: (device-aspect-ratio) should apply +PASS subtest_565: (min-device-aspect-ratio: 1024/768) should apply +PASS subtest_566: all and (min-device-aspect-ratio: 1025/768) should not apply +PASS subtest_567: not all and (min-device-aspect-ratio: 1024/767) should apply +PASS subtest_568: not all and (min-device-aspect-ratio: 1023/768) should not apply +PASS subtest_569: all and (min-device-aspect-ratio: 1024/769) should apply +PASS subtest_570 +PASS subtest_571: all and (max-device-aspect-ratio: 1024/768) should apply +PASS subtest_572: (max-device-aspect-ratio: 1025/768) should apply +PASS subtest_573: (max-device-aspect-ratio: 1024/767) should apply +PASS subtest_574: all and (max-device-aspect-ratio: 1023/768) should not apply +PASS subtest_575: not all and (max-device-aspect-ratio: 1024/769) should apply +PASS subtest_576 +PASS subtest_577 +PASS subtest_578 +PASS subtest_579 +PASS subtest_580 +FAIL subtest_581 assert_true: expected true got false +FAIL subtest_582 assert_true: expected true got false +FAIL subtest_583 assert_true: expected true got false +FAIL subtest_584 assert_true: expected true got false +FAIL subtest_585 assert_true: expected true got false +FAIL subtest_586 assert_true: expected true got false +FAIL subtest_587 assert_true: expected true got false +FAIL subtest_588 assert_true: expected true got false +PASS subtest_589 +PASS subtest_590 +PASS subtest_591 +PASS subtest_592 +PASS subtest_593 +PASS subtest_594 +PASS subtest_595 +PASS subtest_596 +PASS subtest_597 +PASS subtest_598 +PASS subtest_599 +PASS subtest_600 +FAIL subtest_601 assert_true: expected true got false +FAIL subtest_602 assert_true: expected true got false +FAIL subtest_603 assert_true: expected true got false +FAIL subtest_604 assert_true: expected true got false +FAIL subtest_605 assert_true: expected true got false +FAIL subtest_606 assert_true: expected true got false +FAIL subtest_607 assert_true: expected true got false +FAIL subtest_608 assert_true: expected true got false +PASS subtest_609 +PASS subtest_610 +PASS subtest_611 +PASS subtest_612 +PASS subtest_613 +PASS subtest_614 +PASS subtest_615 +PASS subtest_616 +PASS monochrome_and_color +PASS find_depth +PASS subtest_617: all and (color:8) should apply +PASS subtest_618: all and (color:7) should not apply +PASS subtest_619: all and (color:9) should not apply +PASS subtest_620: all and (max-color:8) should apply +PASS subtest_621: all and (max-color:7) should not apply +PASS subtest_622: all and (max-color:9) should apply +PASS subtest_623: all and (color) should apply +PASS subtest_624 +PASS subtest_625 +PASS subtest_626: all and (monochrome) should not apply +PASS subtest_627 +PASS subtest_628 +PASS subtest_629: not all and (monochrome) should apply +PASS subtest_630: not all and (color) should not apply +PASS subtest_631: only all and (color) should apply +PASS subtest_632: only all and (monochrome) should not apply +PASS subtest_633 +PASS subtest_634 +PASS subtest_635 +PASS subtest_636 +PASS subtest_637 +PASS subtest_638 +PASS subtest_639 +PASS subtest_640 +PASS subtest_641 +PASS subtest_642 +PASS subtest_643 +PASS subtest_644 +PASS subtest_645 +PASS subtest_646 +PASS subtest_647 +PASS subtest_648 +PASS subtest_649 +PASS subtest_650 +PASS subtest_651: (color-index: 0) should apply +PASS subtest_652: (color-index: 1) should not apply +PASS subtest_653: (min-color-index: 0) should apply +PASS subtest_654: (min-color-index: 1) should not apply +PASS subtest_655: (max-color-index: 0) should apply +PASS subtest_656: (max-color-index: 1) should apply +PASS subtest_657: (max-color-index: 157) should apply +PASS subtest_658 +PASS subtest_659 +PASS subtest_660 +PASS subtest_661 +PASS subtest_662 +PASS subtest_663 +PASS subtest_664 +PASS subtest_665 +PASS subtest_666 +PASS subtest_667 +PASS subtest_668 +PASS subtest_669 +PASS subtest_670 +PASS subtest_671 +PASS subtest_672 +PASS subtest_673 +PASS subtest_674 +PASS subtest_675 +PASS subtest_676 +PASS subtest_677 +PASS subtest_678 +PASS subtest_679 +PASS subtest_680 +PASS subtest_681 +PASS subtest_682 +PASS subtest_683 +PASS subtest_684 +PASS subtest_685 +PASS subtest_686 +PASS subtest_687 +PASS subtest_688 +PASS subtest_689 +PASS subtest_690 +PASS subtest_691 +PASS subtest_692 +PASS subtest_693 +PASS subtest_694 +PASS subtest_695 +PASS subtest_696 +PASS subtest_697 +PASS subtest_698 +PASS subtest_699 +PASS find_resolution +PASS subtest_700: (resolution: 96dpi) should apply +PASS subtest_701: (resolution: 1dppx) should apply +PASS subtest_702: (resolution: 1x) should apply +PASS subtest_703: (resolution: 97dpi) should not apply +PASS subtest_704: (resolution: 95dpi) should not apply +PASS subtest_705: (min-resolution: 95dpi) should apply +PASS subtest_706: not all and (min-resolution: 95dpi) should not apply +PASS subtest_707: not all and (min-resolution: 97dpi) should apply +PASS subtest_708: all and (min-resolution: 97dpi) should not apply +PASS subtest_709: (min-resolution: 37dpcm) should apply +PASS subtest_710: (max-resolution: 39dpcm) should apply +PASS subtest_711: (max-resolution: 37dpcm) should not apply +PASS subtest_712: not all and (min-resolution: 39dpcm) should apply +PASS subtest_713 +PASS subtest_714 +PASS subtest_715 +PASS subtest_716 +PASS subtest_717 +PASS subtest_718 +PASS subtest_719 +PASS subtest_720: (scan) should not apply +PASS subtest_721: (scan: progressive) should not apply +PASS subtest_722: (scan: interlace) should not apply +PASS subtest_723: not all and (scan) should apply +PASS subtest_724: not all and (scan: progressive) should apply +PASS subtest_725: not all and (scan: interlace) should apply +PASS subtest_726 +PASS subtest_727 +PASS subtest_728 +PASS subtest_729 +PASS subtest_730 +PASS subtest_731 +PASS subtest_732 +PASS subtest_733 +PASS subtest_734 +PASS subtest_735: (grid) should not apply +PASS subtest_736: (grid: 0) should apply +PASS subtest_737: (grid: 1) should not apply +PASS subtest_738: (grid: 2) should not apply +PASS subtest_739: (grid: -1) should not apply +PASS subtest_740: (orientation should apply +PASS subtest_741: not all and (orientation should not apply +PASS subtest_742: (orientation: should not apply +PASS subtest_743: (orientation:) should not apply +PASS subtest_744: (orientation: ) should not apply +PASS subtest_745: all,(orientation: should apply +PASS subtest_746: (orientation:,all should not apply +PASS subtest_747: not all and (grid should apply +PASS subtest_748: only all and (grid should not apply +PASS subtest_749: (grid should not apply +PASS subtest_750: all,(grid should apply +PASS subtest_751: (grid,all should not apply +PASS subtest_752: ,all should apply +PASS subtest_753: all, should apply +PASS subtest_754: ,all, should apply +PASS subtest_755: all,badmedium should apply +PASS subtest_756: badmedium,all should apply +PASS subtest_757: ,badmedium, should not apply +PASS subtest_758: all,(badexpression) should apply +PASS subtest_759: (badexpression),all should apply +PASS subtest_760: (badexpression),badmedium should not apply +PASS subtest_761: badmedium,(badexpression) should not apply +PASS subtest_762: all,[badsyntax] should apply +PASS subtest_763: [badsyntax],all should apply +PASS subtest_764: badmedium,[badsyntax] should not apply +PASS subtest_765: [badsyntax],badmedium should not apply +PASS subtest_766 +PASS subtest_767 +PASS subtest_768: all and min-color : 1 should not apply +PASS subtest_769: (bogus) should not apply +PASS subtest_770: not all and (bogus) should not apply +PASS subtest_771: only all and (bogus) should not apply +FAIL subtest_772 assert_true: expected true got false +FAIL subtest_773 assert_true: expected true got false +FAIL subtest_774 assert_true: expected true got false +FAIL subtest_775 assert_true: expected true got false +FAIL subtest_776 assert_true: expected true got false +PASS subtest_777 +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/html/dom/idlharness.https_include=HTML._-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/html/dom/idlharness.https_include=HTML._-expected.txt new file mode 100644 index 0000000..d10785d --- /dev/null +++ b/third_party/blink/web_tests/platform/win/external/wpt/html/dom/idlharness.https_include=HTML._-expected.txt
@@ -0,0 +1,3765 @@ +This is a testharness.js-based test. +Found 3761 tests; 3739 PASS, 22 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface Document: original interface defined +PASS Partial interface Document: member names are unique +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface mixin DocumentOrShadowRoot: member names are unique +PASS Partial interface mixin NavigatorID: original interface mixin defined +PASS Partial interface mixin NavigatorID: member names are unique +PASS Partial interface HTMLAnchorElement: original interface defined +PASS Partial interface HTMLAnchorElement: member names are unique +PASS Partial interface HTMLAreaElement: original interface defined +PASS Partial interface HTMLAreaElement: member names are unique +PASS Partial interface HTMLBodyElement: original interface defined +PASS Partial interface HTMLBodyElement: member names are unique +PASS Partial interface HTMLBRElement: original interface defined +PASS Partial interface HTMLBRElement: member names are unique +PASS Partial interface HTMLTableCaptionElement: original interface defined +PASS Partial interface HTMLTableCaptionElement: member names are unique +PASS Partial interface HTMLTableColElement: original interface defined +PASS Partial interface HTMLTableColElement: member names are unique +PASS Partial interface HTMLDivElement: original interface defined +PASS Partial interface HTMLDivElement: member names are unique +PASS Partial interface HTMLDListElement: original interface defined +PASS Partial interface HTMLDListElement: member names are unique +PASS Partial interface HTMLEmbedElement: original interface defined +PASS Partial interface HTMLEmbedElement: member names are unique +PASS Partial interface HTMLHeadingElement: original interface defined +PASS Partial interface HTMLHeadingElement: member names are unique +PASS Partial interface HTMLHRElement: original interface defined +PASS Partial interface HTMLHRElement: member names are unique +PASS Partial interface HTMLHtmlElement: original interface defined +PASS Partial interface HTMLHtmlElement: member names are unique +PASS Partial interface HTMLIFrameElement: original interface defined +PASS Partial interface HTMLIFrameElement: member names are unique +PASS Partial interface HTMLImageElement: original interface defined +PASS Partial interface HTMLImageElement: member names are unique +PASS Partial interface HTMLInputElement: original interface defined +PASS Partial interface HTMLInputElement: member names are unique +PASS Partial interface HTMLLegendElement: original interface defined +PASS Partial interface HTMLLegendElement: member names are unique +PASS Partial interface HTMLLIElement: original interface defined +PASS Partial interface HTMLLIElement: member names are unique +PASS Partial interface HTMLLinkElement: original interface defined +PASS Partial interface HTMLLinkElement: member names are unique +PASS Partial interface HTMLMenuElement: original interface defined +PASS Partial interface HTMLMenuElement: member names are unique +PASS Partial interface HTMLMetaElement: original interface defined +PASS Partial interface HTMLMetaElement: member names are unique +PASS Partial interface HTMLObjectElement: original interface defined +PASS Partial interface HTMLObjectElement: member names are unique +PASS Partial interface HTMLOListElement: original interface defined +PASS Partial interface HTMLOListElement: member names are unique +PASS Partial interface HTMLParagraphElement: original interface defined +PASS Partial interface HTMLParagraphElement: member names are unique +PASS Partial interface HTMLParamElement: original interface defined +PASS Partial interface HTMLParamElement: member names are unique +PASS Partial interface HTMLPreElement: original interface defined +PASS Partial interface HTMLPreElement: member names are unique +PASS Partial interface HTMLStyleElement: original interface defined +PASS Partial interface HTMLStyleElement: member names are unique +PASS Partial interface HTMLScriptElement: original interface defined +PASS Partial interface HTMLScriptElement: member names are unique +PASS Partial interface HTMLTableElement: original interface defined +PASS Partial interface HTMLTableElement: member names are unique +PASS Partial interface HTMLTableSectionElement: original interface defined +PASS Partial interface HTMLTableSectionElement: member names are unique +PASS Partial interface HTMLTableCellElement: original interface defined +PASS Partial interface HTMLTableCellElement: member names are unique +PASS Partial interface HTMLTableRowElement: original interface defined +PASS Partial interface HTMLTableRowElement: member names are unique +PASS Partial interface HTMLUListElement: original interface defined +PASS Partial interface HTMLUListElement: member names are unique +PASS Partial interface Document[2]: original interface defined +PASS Partial interface Document[2]: member names are unique +PASS Partial interface Window: original interface defined +PASS Partial interface Window: member names are unique +PASS Partial interface Document[3]: member names are unique +PASS Partial interface mixin DocumentOrShadowRoot[2]: member names are unique +PASS Partial interface UIEvent: member names are unique +PASS Partial interface MouseEvent: member names are unique +PASS Partial interface UIEvent[2]: member names are unique +PASS Partial dictionary UIEventInit: member names are unique +PASS Document includes GlobalEventHandlers: member names are unique +PASS Document includes DocumentAndElementEventHandlers: member names are unique +PASS HTMLElement includes GlobalEventHandlers: member names are unique +PASS HTMLElement includes DocumentAndElementEventHandlers: member names are unique +PASS HTMLElement includes ElementContentEditable: member names are unique +PASS HTMLElement includes HTMLOrSVGElement: member names are unique +PASS HTMLLinkElement includes LinkStyle: member names are unique +PASS HTMLStyleElement includes LinkStyle: member names are unique +PASS HTMLBodyElement includes WindowEventHandlers: member names are unique +PASS HTMLAnchorElement includes HTMLHyperlinkElementUtils: member names are unique +PASS HTMLAreaElement includes HTMLHyperlinkElementUtils: member names are unique +PASS CanvasRenderingContext2D includes CanvasState: member names are unique +PASS CanvasRenderingContext2D includes CanvasTransform: member names are unique +PASS CanvasRenderingContext2D includes CanvasCompositing: member names are unique +PASS CanvasRenderingContext2D includes CanvasImageSmoothing: member names are unique +PASS CanvasRenderingContext2D includes CanvasFillStrokeStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasShadowStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasFilters: member names are unique +PASS CanvasRenderingContext2D includes CanvasRect: member names are unique +PASS CanvasRenderingContext2D includes CanvasDrawPath: member names are unique +PASS CanvasRenderingContext2D includes CanvasUserInterface: member names are unique +PASS CanvasRenderingContext2D includes CanvasText: member names are unique +PASS CanvasRenderingContext2D includes CanvasDrawImage: member names are unique +PASS CanvasRenderingContext2D includes CanvasImageData: member names are unique +PASS CanvasRenderingContext2D includes CanvasPathDrawingStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasTextDrawingStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasPath: member names are unique +PASS Path2D includes CanvasPath: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasState: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasTransform: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasCompositing: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasImageSmoothing: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasFillStrokeStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasShadowStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasFilters: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasRect: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasDrawPath: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasText: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasDrawImage: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasImageData: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasPathDrawingStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasTextDrawingStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasPath: member names are unique +PASS ElementInternals includes ARIAMixin: member names are unique +PASS Window includes GlobalEventHandlers: member names are unique +PASS Window includes WindowEventHandlers: member names are unique +PASS Window includes WindowOrWorkerGlobalScope: member names are unique +PASS WorkerGlobalScope includes WindowOrWorkerGlobalScope: member names are unique +PASS Navigator includes NavigatorID: member names are unique +PASS Navigator includes NavigatorLanguage: member names are unique +PASS Navigator includes NavigatorOnLine: member names are unique +PASS Navigator includes NavigatorContentUtils: member names are unique +PASS Navigator includes NavigatorCookies: member names are unique +PASS Navigator includes NavigatorPlugins: member names are unique +PASS Navigator includes NavigatorConcurrentHardware: member names are unique +PASS Window includes AnimationFrameProvider: member names are unique +PASS DedicatedWorkerGlobalScope includes AnimationFrameProvider: member names are unique +PASS Worker includes AbstractWorker: member names are unique +PASS SharedWorker includes AbstractWorker: member names are unique +PASS WorkerNavigator includes NavigatorID: member names are unique +PASS WorkerNavigator includes NavigatorLanguage: member names are unique +PASS WorkerNavigator includes NavigatorOnLine: member names are unique +PASS WorkerNavigator includes NavigatorConcurrentHardware: member names are unique +PASS Window includes WindowSessionStorage: member names are unique +PASS Window includes WindowLocalStorage: member names are unique +PASS HTMLFrameSetElement includes WindowEventHandlers: member names are unique +PASS Element includes ARIAMixin: member names are unique +PASS SVGElement includes GlobalEventHandlers: member names are unique +PASS SVGElement includes DocumentAndElementEventHandlers: member names are unique +PASS SVGElement includes SVGElementInstance: member names are unique +PASS SVGElement includes HTMLOrSVGElement: member names are unique +PASS SVGGraphicsElement includes SVGTests: member names are unique +PASS SVGSVGElement includes SVGFitToViewBox: member names are unique +PASS SVGSVGElement includes WindowEventHandlers: member names are unique +PASS SVGImageElement includes SVGURIReference: member names are unique +PASS SVGScriptElement includes SVGURIReference: member names are unique +PASS HTMLElement includes ElementCSSInlineStyle: member names are unique +PASS SVGElement includes ElementCSSInlineStyle: member names are unique +PASS Document includes NonElementParentNode: member names are unique +PASS DocumentFragment includes NonElementParentNode: member names are unique +PASS Document includes DocumentOrShadowRoot: member names are unique +PASS ShadowRoot includes DocumentOrShadowRoot: member names are unique +PASS Document includes ParentNode: member names are unique +PASS DocumentFragment includes ParentNode: member names are unique +PASS Element includes ParentNode: member names are unique +PASS Element includes NonDocumentTypeChildNode: member names are unique +PASS Element includes ChildNode: member names are unique +PASS Element includes Slottable: member names are unique +PASS Document includes XPathEvaluatorBase: member names are unique +PASS HTMLAllCollection interface: existence and properties of interface object +PASS HTMLAllCollection interface object length +PASS HTMLAllCollection interface object name +PASS HTMLAllCollection interface: existence and properties of interface prototype object +PASS HTMLAllCollection interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLAllCollection interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLAllCollection interface: attribute length +PASS HTMLAllCollection interface: operation namedItem(DOMString) +PASS HTMLAllCollection interface: operation item(optional DOMString) +PASS HTMLAllCollection must be primary interface of document.all +PASS Stringification of document.all +PASS HTMLAllCollection interface: document.all must inherit property "length" with the proper type +PASS HTMLAllCollection interface: document.all must inherit property "namedItem(DOMString)" with the proper type +PASS HTMLAllCollection interface: calling namedItem(DOMString) on document.all with too few arguments must throw TypeError +PASS HTMLAllCollection interface: document.all must inherit property "item(optional DOMString)" with the proper type +PASS HTMLAllCollection interface: calling item(optional DOMString) on document.all with too few arguments must throw TypeError +PASS HTMLFormControlsCollection interface: existence and properties of interface object +PASS HTMLFormControlsCollection interface object length +PASS HTMLFormControlsCollection interface object name +PASS HTMLFormControlsCollection interface: existence and properties of interface prototype object +PASS HTMLFormControlsCollection interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFormControlsCollection interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFormControlsCollection interface: operation namedItem(DOMString) +PASS HTMLFormControlsCollection must be primary interface of document.createElement("form").elements +PASS Stringification of document.createElement("form").elements +PASS HTMLFormControlsCollection interface: document.createElement("form").elements must inherit property "namedItem(DOMString)" with the proper type +PASS HTMLFormControlsCollection interface: calling namedItem(DOMString) on document.createElement("form").elements with too few arguments must throw TypeError +PASS HTMLOptionsCollection interface: existence and properties of interface object +PASS HTMLOptionsCollection interface object length +PASS HTMLOptionsCollection interface object name +PASS HTMLOptionsCollection interface: existence and properties of interface prototype object +PASS HTMLOptionsCollection interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLOptionsCollection interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLOptionsCollection interface: attribute length +PASS HTMLOptionsCollection interface: operation add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?) +PASS HTMLOptionsCollection interface: operation remove(long) +PASS HTMLOptionsCollection interface: attribute selectedIndex +PASS HTMLOptionsCollection must be primary interface of document.createElement("select").options +PASS Stringification of document.createElement("select").options +PASS HTMLOptionsCollection interface: document.createElement("select").options must inherit property "length" with the proper type +PASS HTMLOptionsCollection interface: document.createElement("select").options must inherit property "add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?)" with the proper type +PASS HTMLOptionsCollection interface: calling add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?) on document.createElement("select").options with too few arguments must throw TypeError +PASS HTMLOptionsCollection interface: document.createElement("select").options must inherit property "remove(long)" with the proper type +PASS HTMLOptionsCollection interface: calling remove(long) on document.createElement("select").options with too few arguments must throw TypeError +PASS HTMLOptionsCollection interface: document.createElement("select").options must inherit property "selectedIndex" with the proper type +PASS HTMLElement interface: existence and properties of interface object +PASS HTMLElement interface object length +PASS HTMLElement interface object name +PASS HTMLElement interface: existence and properties of interface prototype object +PASS HTMLElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLElement interface: attribute title +PASS HTMLElement interface: attribute lang +PASS HTMLElement interface: attribute translate +PASS HTMLElement interface: attribute dir +PASS HTMLElement interface: attribute hidden +PASS HTMLElement interface: operation click() +PASS HTMLElement interface: attribute accessKey +FAIL HTMLElement interface: attribute accessKeyLabel assert_true: The prototype object must have a property "accessKeyLabel" expected true got false +PASS HTMLElement interface: attribute draggable +PASS HTMLElement interface: attribute spellcheck +PASS HTMLElement interface: attribute autocapitalize +PASS HTMLElement interface: attribute innerText +PASS HTMLElement interface: operation attachInternals() +PASS HTMLElement interface: attribute onabort +PASS HTMLElement interface: attribute onauxclick +PASS HTMLElement interface: attribute onblur +PASS HTMLElement interface: attribute oncancel +PASS HTMLElement interface: attribute oncanplay +PASS HTMLElement interface: attribute oncanplaythrough +PASS HTMLElement interface: attribute onchange +PASS HTMLElement interface: attribute onclick +PASS HTMLElement interface: attribute onclose +PASS HTMLElement interface: attribute oncontextmenu +PASS HTMLElement interface: attribute oncuechange +PASS HTMLElement interface: attribute ondblclick +PASS HTMLElement interface: attribute ondrag +PASS HTMLElement interface: attribute ondragend +PASS HTMLElement interface: attribute ondragenter +PASS HTMLElement interface: attribute ondragleave +PASS HTMLElement interface: attribute ondragover +PASS HTMLElement interface: attribute ondragstart +PASS HTMLElement interface: attribute ondrop +PASS HTMLElement interface: attribute ondurationchange +PASS HTMLElement interface: attribute onemptied +PASS HTMLElement interface: attribute onended +PASS HTMLElement interface: attribute onerror +PASS HTMLElement interface: attribute onfocus +PASS HTMLElement interface: attribute onformdata +PASS HTMLElement interface: attribute oninput +PASS HTMLElement interface: attribute oninvalid +PASS HTMLElement interface: attribute onkeydown +PASS HTMLElement interface: attribute onkeypress +PASS HTMLElement interface: attribute onkeyup +PASS HTMLElement interface: attribute onload +PASS HTMLElement interface: attribute onloadeddata +PASS HTMLElement interface: attribute onloadedmetadata +PASS HTMLElement interface: attribute onloadstart +PASS HTMLElement interface: attribute onmousedown +PASS HTMLElement interface: attribute onmouseenter +PASS HTMLElement interface: attribute onmouseleave +PASS HTMLElement interface: attribute onmousemove +PASS HTMLElement interface: attribute onmouseout +PASS HTMLElement interface: attribute onmouseover +PASS HTMLElement interface: attribute onmouseup +PASS HTMLElement interface: attribute onpause +PASS HTMLElement interface: attribute onplay +PASS HTMLElement interface: attribute onplaying +PASS HTMLElement interface: attribute onprogress +PASS HTMLElement interface: attribute onratechange +PASS HTMLElement interface: attribute onreset +PASS HTMLElement interface: attribute onresize +PASS HTMLElement interface: attribute onscroll +FAIL HTMLElement interface: attribute onsecuritypolicyviolation assert_true: The prototype object must have a property "onsecuritypolicyviolation" expected true got false +PASS HTMLElement interface: attribute onseeked +PASS HTMLElement interface: attribute onseeking +PASS HTMLElement interface: attribute onselect +FAIL HTMLElement interface: attribute onslotchange assert_true: The prototype object must have a property "onslotchange" expected true got false +PASS HTMLElement interface: attribute onstalled +PASS HTMLElement interface: attribute onsubmit +PASS HTMLElement interface: attribute onsuspend +PASS HTMLElement interface: attribute ontimeupdate +PASS HTMLElement interface: attribute ontoggle +PASS HTMLElement interface: attribute onvolumechange +PASS HTMLElement interface: attribute onwaiting +PASS HTMLElement interface: attribute onwebkitanimationend +PASS HTMLElement interface: attribute onwebkitanimationiteration +PASS HTMLElement interface: attribute onwebkitanimationstart +PASS HTMLElement interface: attribute onwebkittransitionend +PASS HTMLElement interface: attribute onwheel +PASS HTMLElement interface: attribute oncopy +PASS HTMLElement interface: attribute oncut +PASS HTMLElement interface: attribute onpaste +PASS HTMLElement interface: attribute contentEditable +PASS HTMLElement interface: attribute enterKeyHint +PASS HTMLElement interface: attribute isContentEditable +PASS HTMLElement interface: attribute inputMode +PASS HTMLElement interface: attribute dataset +PASS HTMLElement interface: attribute nonce +PASS HTMLElement interface: attribute autofocus +PASS HTMLElement interface: attribute tabIndex +PASS HTMLElement interface: operation focus(optional FocusOptions) +PASS HTMLElement interface: operation blur() +PASS HTMLElement must be primary interface of document.createElement("noscript") +PASS Stringification of document.createElement("noscript") +PASS HTMLElement interface: document.createElement("noscript") must inherit property "title" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "lang" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "translate" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "dir" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "hidden" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "click()" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "accessKey" with the proper type +FAIL HTMLElement interface: document.createElement("noscript") must inherit property "accessKeyLabel" with the proper type assert_inherits: property "accessKeyLabel" not found in prototype chain +PASS HTMLElement interface: document.createElement("noscript") must inherit property "draggable" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "spellcheck" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "autocapitalize" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "innerText" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "attachInternals()" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onabort" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onauxclick" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onblur" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncancel" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncanplay" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncanplaythrough" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onchange" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onclick" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onclose" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncontextmenu" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncuechange" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondblclick" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondrag" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragend" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragenter" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragleave" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragover" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondragstart" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondrop" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ondurationchange" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onemptied" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onended" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onerror" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onfocus" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onformdata" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oninput" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oninvalid" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeydown" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeypress" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onkeyup" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onload" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadeddata" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadedmetadata" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onloadstart" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmousedown" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseenter" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseleave" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmousemove" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseout" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseover" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onmouseup" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onpause" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onplay" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onplaying" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onprogress" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onratechange" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onreset" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onresize" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onscroll" with the proper type +FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onsecuritypolicyviolation" with the proper type assert_inherits: property "onsecuritypolicyviolation" not found in prototype chain +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onseeked" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onseeking" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onselect" with the proper type +FAIL HTMLElement interface: document.createElement("noscript") must inherit property "onslotchange" with the proper type assert_inherits: property "onslotchange" not found in prototype chain +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onstalled" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onsubmit" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onsuspend" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ontimeupdate" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "ontoggle" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onvolumechange" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwaiting" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwebkitanimationend" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwebkitanimationiteration" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwebkitanimationstart" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwebkittransitionend" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onwheel" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncopy" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "oncut" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "onpaste" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "contentEditable" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "enterKeyHint" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "isContentEditable" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "inputMode" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "dataset" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "nonce" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "autofocus" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "tabIndex" with the proper type +PASS HTMLElement interface: document.createElement("noscript") must inherit property "focus(optional FocusOptions)" with the proper type +PASS HTMLElement interface: calling focus(optional FocusOptions) on document.createElement("noscript") with too few arguments must throw TypeError +PASS HTMLElement interface: document.createElement("noscript") must inherit property "blur()" with the proper type +PASS HTMLUnknownElement interface: existence and properties of interface object +PASS HTMLUnknownElement interface object length +PASS HTMLUnknownElement interface object name +PASS HTMLUnknownElement interface: existence and properties of interface prototype object +PASS HTMLUnknownElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLUnknownElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLUnknownElement must be primary interface of document.createElement("bgsound") +PASS Stringification of document.createElement("bgsound") +PASS HTMLHtmlElement interface: existence and properties of interface object +PASS HTMLHtmlElement interface object length +PASS HTMLHtmlElement interface object name +PASS HTMLHtmlElement interface: existence and properties of interface prototype object +PASS HTMLHtmlElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLHtmlElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLHtmlElement interface: attribute version +PASS HTMLHtmlElement must be primary interface of document.createElement("html") +PASS Stringification of document.createElement("html") +PASS HTMLHtmlElement interface: document.createElement("html") must inherit property "version" with the proper type +PASS HTMLHeadElement interface: existence and properties of interface object +PASS HTMLHeadElement interface object length +PASS HTMLHeadElement interface object name +PASS HTMLHeadElement interface: existence and properties of interface prototype object +PASS HTMLHeadElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLHeadElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLHeadElement must be primary interface of document.createElement("head") +PASS Stringification of document.createElement("head") +PASS HTMLTitleElement interface: existence and properties of interface object +PASS HTMLTitleElement interface object length +PASS HTMLTitleElement interface object name +PASS HTMLTitleElement interface: existence and properties of interface prototype object +PASS HTMLTitleElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTitleElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTitleElement interface: attribute text +PASS HTMLTitleElement must be primary interface of document.createElement("title") +PASS Stringification of document.createElement("title") +PASS HTMLTitleElement interface: document.createElement("title") must inherit property "text" with the proper type +PASS HTMLBaseElement interface: existence and properties of interface object +PASS HTMLBaseElement interface object length +PASS HTMLBaseElement interface object name +PASS HTMLBaseElement interface: existence and properties of interface prototype object +PASS HTMLBaseElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLBaseElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLBaseElement interface: attribute href +PASS HTMLBaseElement interface: attribute target +PASS HTMLBaseElement must be primary interface of document.createElement("base") +PASS Stringification of document.createElement("base") +PASS HTMLBaseElement interface: document.createElement("base") must inherit property "href" with the proper type +PASS HTMLBaseElement interface: document.createElement("base") must inherit property "target" with the proper type +PASS HTMLLinkElement interface: existence and properties of interface object +PASS HTMLLinkElement interface object length +PASS HTMLLinkElement interface object name +PASS HTMLLinkElement interface: existence and properties of interface prototype object +PASS HTMLLinkElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLLinkElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLLinkElement interface: attribute href +PASS HTMLLinkElement interface: attribute crossOrigin +PASS HTMLLinkElement interface: attribute rel +PASS HTMLLinkElement interface: attribute as +PASS HTMLLinkElement interface: attribute relList +PASS HTMLLinkElement interface: attribute media +PASS HTMLLinkElement interface: attribute integrity +PASS HTMLLinkElement interface: attribute hreflang +PASS HTMLLinkElement interface: attribute type +PASS HTMLLinkElement interface: attribute sizes +PASS HTMLLinkElement interface: attribute imageSrcset +PASS HTMLLinkElement interface: attribute imageSizes +PASS HTMLLinkElement interface: attribute referrerPolicy +PASS HTMLLinkElement interface: attribute disabled +PASS HTMLLinkElement interface: attribute charset +PASS HTMLLinkElement interface: attribute rev +PASS HTMLLinkElement interface: attribute target +PASS HTMLLinkElement must be primary interface of document.createElement("link") +PASS Stringification of document.createElement("link") +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "href" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "crossOrigin" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "rel" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "as" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "relList" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "media" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "integrity" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "hreflang" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "type" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "sizes" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "imageSrcset" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "imageSizes" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "referrerPolicy" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "disabled" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "charset" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "rev" with the proper type +PASS HTMLLinkElement interface: document.createElement("link") must inherit property "target" with the proper type +PASS HTMLMetaElement interface: existence and properties of interface object +PASS HTMLMetaElement interface object length +PASS HTMLMetaElement interface object name +PASS HTMLMetaElement interface: existence and properties of interface prototype object +PASS HTMLMetaElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMetaElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMetaElement interface: attribute name +PASS HTMLMetaElement interface: attribute httpEquiv +PASS HTMLMetaElement interface: attribute content +PASS HTMLMetaElement interface: attribute scheme +PASS HTMLMetaElement must be primary interface of document.createElement("meta") +PASS Stringification of document.createElement("meta") +PASS HTMLMetaElement interface: document.createElement("meta") must inherit property "name" with the proper type +PASS HTMLMetaElement interface: document.createElement("meta") must inherit property "httpEquiv" with the proper type +PASS HTMLMetaElement interface: document.createElement("meta") must inherit property "content" with the proper type +PASS HTMLMetaElement interface: document.createElement("meta") must inherit property "scheme" with the proper type +PASS HTMLStyleElement interface: existence and properties of interface object +PASS HTMLStyleElement interface object length +PASS HTMLStyleElement interface object name +PASS HTMLStyleElement interface: existence and properties of interface prototype object +PASS HTMLStyleElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLStyleElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLStyleElement interface: attribute media +PASS HTMLStyleElement interface: attribute type +PASS HTMLStyleElement must be primary interface of document.createElement("style") +PASS Stringification of document.createElement("style") +PASS HTMLStyleElement interface: document.createElement("style") must inherit property "media" with the proper type +PASS HTMLStyleElement interface: document.createElement("style") must inherit property "type" with the proper type +PASS HTMLBodyElement interface: existence and properties of interface object +PASS HTMLBodyElement interface object length +PASS HTMLBodyElement interface object name +PASS HTMLBodyElement interface: existence and properties of interface prototype object +PASS HTMLBodyElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLBodyElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLBodyElement interface: attribute text +PASS HTMLBodyElement interface: attribute link +PASS HTMLBodyElement interface: attribute vLink +PASS HTMLBodyElement interface: attribute aLink +PASS HTMLBodyElement interface: attribute bgColor +PASS HTMLBodyElement interface: attribute background +PASS HTMLBodyElement interface: attribute onafterprint +PASS HTMLBodyElement interface: attribute onbeforeprint +PASS HTMLBodyElement interface: attribute onbeforeunload +PASS HTMLBodyElement interface: attribute onhashchange +PASS HTMLBodyElement interface: attribute onlanguagechange +PASS HTMLBodyElement interface: attribute onmessage +PASS HTMLBodyElement interface: attribute onmessageerror +PASS HTMLBodyElement interface: attribute onoffline +PASS HTMLBodyElement interface: attribute ononline +PASS HTMLBodyElement interface: attribute onpagehide +PASS HTMLBodyElement interface: attribute onpageshow +PASS HTMLBodyElement interface: attribute onpopstate +PASS HTMLBodyElement interface: attribute onrejectionhandled +PASS HTMLBodyElement interface: attribute onstorage +PASS HTMLBodyElement interface: attribute onunhandledrejection +PASS HTMLBodyElement interface: attribute onunload +PASS HTMLBodyElement must be primary interface of document.createElement("body") +PASS Stringification of document.createElement("body") +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "text" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "link" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "vLink" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "aLink" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "bgColor" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "background" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onafterprint" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onbeforeprint" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onbeforeunload" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onhashchange" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onlanguagechange" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onmessage" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onmessageerror" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onoffline" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "ononline" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onpagehide" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onpageshow" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onpopstate" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onrejectionhandled" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onstorage" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onunhandledrejection" with the proper type +PASS HTMLBodyElement interface: document.createElement("body") must inherit property "onunload" with the proper type +PASS HTMLHeadingElement interface: existence and properties of interface object +PASS HTMLHeadingElement interface object length +PASS HTMLHeadingElement interface object name +PASS HTMLHeadingElement interface: existence and properties of interface prototype object +PASS HTMLHeadingElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLHeadingElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLHeadingElement interface: attribute align +PASS HTMLHeadingElement must be primary interface of document.createElement("h1") +PASS Stringification of document.createElement("h1") +PASS HTMLHeadingElement interface: document.createElement("h1") must inherit property "align" with the proper type +PASS HTMLParagraphElement interface: existence and properties of interface object +PASS HTMLParagraphElement interface object length +PASS HTMLParagraphElement interface object name +PASS HTMLParagraphElement interface: existence and properties of interface prototype object +PASS HTMLParagraphElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLParagraphElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLParagraphElement interface: attribute align +PASS HTMLParagraphElement must be primary interface of document.createElement("p") +PASS Stringification of document.createElement("p") +PASS HTMLParagraphElement interface: document.createElement("p") must inherit property "align" with the proper type +PASS HTMLHRElement interface: existence and properties of interface object +PASS HTMLHRElement interface object length +PASS HTMLHRElement interface object name +PASS HTMLHRElement interface: existence and properties of interface prototype object +PASS HTMLHRElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLHRElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLHRElement interface: attribute align +PASS HTMLHRElement interface: attribute color +PASS HTMLHRElement interface: attribute noShade +PASS HTMLHRElement interface: attribute size +PASS HTMLHRElement interface: attribute width +PASS HTMLHRElement must be primary interface of document.createElement("hr") +PASS Stringification of document.createElement("hr") +PASS HTMLHRElement interface: document.createElement("hr") must inherit property "align" with the proper type +PASS HTMLHRElement interface: document.createElement("hr") must inherit property "color" with the proper type +PASS HTMLHRElement interface: document.createElement("hr") must inherit property "noShade" with the proper type +PASS HTMLHRElement interface: document.createElement("hr") must inherit property "size" with the proper type +PASS HTMLHRElement interface: document.createElement("hr") must inherit property "width" with the proper type +PASS HTMLPreElement interface: existence and properties of interface object +PASS HTMLPreElement interface object length +PASS HTMLPreElement interface object name +PASS HTMLPreElement interface: existence and properties of interface prototype object +PASS HTMLPreElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLPreElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLPreElement interface: attribute width +PASS HTMLPreElement must be primary interface of document.createElement("pre") +PASS Stringification of document.createElement("pre") +PASS HTMLPreElement interface: document.createElement("pre") must inherit property "width" with the proper type +PASS HTMLPreElement must be primary interface of document.createElement("listing") +PASS Stringification of document.createElement("listing") +PASS HTMLPreElement interface: document.createElement("listing") must inherit property "width" with the proper type +PASS HTMLPreElement must be primary interface of document.createElement("xmp") +PASS Stringification of document.createElement("xmp") +PASS HTMLPreElement interface: document.createElement("xmp") must inherit property "width" with the proper type +PASS HTMLQuoteElement interface: existence and properties of interface object +PASS HTMLQuoteElement interface object length +PASS HTMLQuoteElement interface object name +PASS HTMLQuoteElement interface: existence and properties of interface prototype object +PASS HTMLQuoteElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLQuoteElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLQuoteElement interface: attribute cite +PASS HTMLQuoteElement must be primary interface of document.createElement("blockquote") +PASS Stringification of document.createElement("blockquote") +PASS HTMLQuoteElement interface: document.createElement("blockquote") must inherit property "cite" with the proper type +PASS HTMLQuoteElement must be primary interface of document.createElement("q") +PASS Stringification of document.createElement("q") +PASS HTMLQuoteElement interface: document.createElement("q") must inherit property "cite" with the proper type +PASS HTMLOListElement interface: existence and properties of interface object +PASS HTMLOListElement interface object length +PASS HTMLOListElement interface object name +PASS HTMLOListElement interface: existence and properties of interface prototype object +PASS HTMLOListElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLOListElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLOListElement interface: attribute reversed +PASS HTMLOListElement interface: attribute start +PASS HTMLOListElement interface: attribute type +PASS HTMLOListElement interface: attribute compact +PASS HTMLUListElement interface: existence and properties of interface object +PASS HTMLUListElement interface object length +PASS HTMLUListElement interface object name +PASS HTMLUListElement interface: existence and properties of interface prototype object +PASS HTMLUListElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLUListElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLUListElement interface: attribute compact +PASS HTMLUListElement interface: attribute type +PASS HTMLMenuElement interface: existence and properties of interface object +PASS HTMLMenuElement interface object length +PASS HTMLMenuElement interface object name +PASS HTMLMenuElement interface: existence and properties of interface prototype object +PASS HTMLMenuElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMenuElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMenuElement interface: attribute compact +PASS HTMLMenuElement must be primary interface of document.createElement("menu") +PASS Stringification of document.createElement("menu") +PASS HTMLMenuElement interface: document.createElement("menu") must inherit property "compact" with the proper type +PASS HTMLLIElement interface: existence and properties of interface object +PASS HTMLLIElement interface object length +PASS HTMLLIElement interface object name +PASS HTMLLIElement interface: existence and properties of interface prototype object +PASS HTMLLIElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLLIElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLLIElement interface: attribute value +PASS HTMLLIElement interface: attribute type +PASS HTMLLIElement must be primary interface of document.createElement("li") +PASS Stringification of document.createElement("li") +PASS HTMLLIElement interface: document.createElement("li") must inherit property "value" with the proper type +PASS HTMLLIElement interface: document.createElement("li") must inherit property "type" with the proper type +PASS HTMLDListElement interface: existence and properties of interface object +PASS HTMLDListElement interface object length +PASS HTMLDListElement interface object name +PASS HTMLDListElement interface: existence and properties of interface prototype object +PASS HTMLDListElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDListElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDListElement interface: attribute compact +PASS HTMLDivElement interface: existence and properties of interface object +PASS HTMLDivElement interface object length +PASS HTMLDivElement interface object name +PASS HTMLDivElement interface: existence and properties of interface prototype object +PASS HTMLDivElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDivElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDivElement interface: attribute align +PASS HTMLDivElement must be primary interface of document.createElement("div") +PASS Stringification of document.createElement("div") +PASS HTMLDivElement interface: document.createElement("div") must inherit property "align" with the proper type +PASS HTMLAnchorElement interface: existence and properties of interface object +PASS HTMLAnchorElement interface object length +PASS HTMLAnchorElement interface object name +PASS HTMLAnchorElement interface: existence and properties of interface prototype object +PASS HTMLAnchorElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLAnchorElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLAnchorElement interface: attribute target +PASS HTMLAnchorElement interface: attribute download +PASS HTMLAnchorElement interface: attribute ping +PASS HTMLAnchorElement interface: attribute rel +PASS HTMLAnchorElement interface: attribute relList +PASS HTMLAnchorElement interface: attribute hreflang +PASS HTMLAnchorElement interface: attribute type +PASS HTMLAnchorElement interface: attribute text +PASS HTMLAnchorElement interface: attribute referrerPolicy +PASS HTMLAnchorElement interface: attribute coords +PASS HTMLAnchorElement interface: attribute charset +PASS HTMLAnchorElement interface: attribute name +PASS HTMLAnchorElement interface: attribute rev +PASS HTMLAnchorElement interface: attribute shape +PASS HTMLAnchorElement interface: attribute href +PASS HTMLAnchorElement interface: stringifier +PASS HTMLAnchorElement interface: attribute origin +PASS HTMLAnchorElement interface: attribute protocol +PASS HTMLAnchorElement interface: attribute username +PASS HTMLAnchorElement interface: attribute password +PASS HTMLAnchorElement interface: attribute host +PASS HTMLAnchorElement interface: attribute hostname +PASS HTMLAnchorElement interface: attribute port +PASS HTMLAnchorElement interface: attribute pathname +PASS HTMLAnchorElement interface: attribute search +PASS HTMLAnchorElement interface: attribute hash +PASS HTMLAnchorElement must be primary interface of document.createElement("a") +PASS Stringification of document.createElement("a") +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "target" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "download" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "ping" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "rel" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "relList" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "hreflang" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "type" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "text" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "referrerPolicy" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "coords" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "charset" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "name" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "rev" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "shape" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "href" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "origin" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "protocol" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "username" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "password" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "host" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "hostname" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "port" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "pathname" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "search" with the proper type +PASS HTMLAnchorElement interface: document.createElement("a") must inherit property "hash" with the proper type +PASS HTMLDataElement interface: existence and properties of interface object +PASS HTMLDataElement interface object length +PASS HTMLDataElement interface object name +PASS HTMLDataElement interface: existence and properties of interface prototype object +PASS HTMLDataElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDataElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDataElement interface: attribute value +PASS HTMLDataElement must be primary interface of document.createElement("data") +PASS Stringification of document.createElement("data") +PASS HTMLDataElement interface: document.createElement("data") must inherit property "value" with the proper type +PASS HTMLTimeElement interface: existence and properties of interface object +PASS HTMLTimeElement interface object length +PASS HTMLTimeElement interface object name +PASS HTMLTimeElement interface: existence and properties of interface prototype object +PASS HTMLTimeElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTimeElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTimeElement interface: attribute dateTime +PASS HTMLTimeElement must be primary interface of document.createElement("time") +PASS Stringification of document.createElement("time") +PASS HTMLTimeElement interface: document.createElement("time") must inherit property "dateTime" with the proper type +PASS HTMLSpanElement interface: existence and properties of interface object +PASS HTMLSpanElement interface object length +PASS HTMLSpanElement interface object name +PASS HTMLSpanElement interface: existence and properties of interface prototype object +PASS HTMLSpanElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLSpanElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLSpanElement must be primary interface of document.createElement("span") +PASS Stringification of document.createElement("span") +PASS HTMLBRElement interface: existence and properties of interface object +PASS HTMLBRElement interface object length +PASS HTMLBRElement interface object name +PASS HTMLBRElement interface: existence and properties of interface prototype object +PASS HTMLBRElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLBRElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLBRElement interface: attribute clear +PASS HTMLBRElement must be primary interface of document.createElement("br") +PASS Stringification of document.createElement("br") +PASS HTMLBRElement interface: document.createElement("br") must inherit property "clear" with the proper type +PASS HTMLModElement interface: existence and properties of interface object +PASS HTMLModElement interface object length +PASS HTMLModElement interface object name +PASS HTMLModElement interface: existence and properties of interface prototype object +PASS HTMLModElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLModElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLModElement interface: attribute cite +PASS HTMLModElement interface: attribute dateTime +PASS HTMLModElement must be primary interface of document.createElement("ins") +PASS Stringification of document.createElement("ins") +PASS HTMLModElement interface: document.createElement("ins") must inherit property "cite" with the proper type +PASS HTMLModElement interface: document.createElement("ins") must inherit property "dateTime" with the proper type +PASS HTMLModElement must be primary interface of document.createElement("del") +PASS Stringification of document.createElement("del") +PASS HTMLModElement interface: document.createElement("del") must inherit property "cite" with the proper type +PASS HTMLModElement interface: document.createElement("del") must inherit property "dateTime" with the proper type +PASS HTMLPictureElement interface: existence and properties of interface object +PASS HTMLPictureElement interface object length +PASS HTMLPictureElement interface object name +PASS HTMLPictureElement interface: existence and properties of interface prototype object +PASS HTMLPictureElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLPictureElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLPictureElement must be primary interface of document.createElement("picture") +PASS Stringification of document.createElement("picture") +PASS HTMLSourceElement interface: existence and properties of interface object +PASS HTMLSourceElement interface object length +PASS HTMLSourceElement interface object name +PASS HTMLSourceElement interface: existence and properties of interface prototype object +PASS HTMLSourceElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLSourceElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLSourceElement interface: attribute src +PASS HTMLSourceElement interface: attribute type +PASS HTMLSourceElement interface: attribute srcset +PASS HTMLSourceElement interface: attribute sizes +PASS HTMLSourceElement interface: attribute media +PASS HTMLSourceElement interface: attribute width +PASS HTMLSourceElement interface: attribute height +PASS HTMLSourceElement must be primary interface of document.createElement("source") +PASS Stringification of document.createElement("source") +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "src" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "type" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "srcset" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "sizes" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "media" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "width" with the proper type +PASS HTMLSourceElement interface: document.createElement("source") must inherit property "height" with the proper type +PASS HTMLImageElement interface: existence and properties of interface object +PASS HTMLImageElement interface object length +PASS HTMLImageElement interface object name +PASS HTMLImageElement interface: named constructor +PASS HTMLImageElement interface: named constructor object +PASS HTMLImageElement interface: named constructor prototype property +PASS HTMLImageElement interface: named constructor name +PASS HTMLImageElement interface: named constructor length +PASS HTMLImageElement interface: named constructor without 'new' +PASS HTMLImageElement interface: existence and properties of interface prototype object +PASS HTMLImageElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLImageElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLImageElement interface: attribute alt +PASS HTMLImageElement interface: attribute src +PASS HTMLImageElement interface: attribute srcset +PASS HTMLImageElement interface: attribute sizes +PASS HTMLImageElement interface: attribute crossOrigin +PASS HTMLImageElement interface: attribute useMap +PASS HTMLImageElement interface: attribute isMap +PASS HTMLImageElement interface: attribute width +PASS HTMLImageElement interface: attribute height +PASS HTMLImageElement interface: attribute naturalWidth +PASS HTMLImageElement interface: attribute naturalHeight +PASS HTMLImageElement interface: attribute complete +PASS HTMLImageElement interface: attribute currentSrc +PASS HTMLImageElement interface: attribute referrerPolicy +PASS HTMLImageElement interface: attribute decoding +PASS HTMLImageElement interface: attribute loading +PASS HTMLImageElement interface: operation decode() +PASS HTMLImageElement interface: attribute name +PASS HTMLImageElement interface: attribute lowsrc +PASS HTMLImageElement interface: attribute align +PASS HTMLImageElement interface: attribute hspace +PASS HTMLImageElement interface: attribute vspace +PASS HTMLImageElement interface: attribute longDesc +PASS HTMLImageElement interface: attribute border +PASS HTMLImageElement must be primary interface of document.createElement("img") +PASS Stringification of document.createElement("img") +PASS HTMLImageElement interface: document.createElement("img") must inherit property "alt" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "src" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "srcset" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "sizes" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "crossOrigin" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "useMap" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "isMap" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "width" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "height" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "naturalWidth" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "naturalHeight" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "complete" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "currentSrc" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "referrerPolicy" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "decoding" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "loading" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "decode()" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "name" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "lowsrc" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "align" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "hspace" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "vspace" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "longDesc" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "border" with the proper type +PASS HTMLImageElement must be primary interface of new Image() +PASS Stringification of new Image() +PASS HTMLImageElement interface: new Image() must inherit property "alt" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "src" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "srcset" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "sizes" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "crossOrigin" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "useMap" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "isMap" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "width" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "height" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "naturalWidth" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "naturalHeight" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "complete" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "currentSrc" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "referrerPolicy" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "decoding" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "loading" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "decode()" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "name" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "lowsrc" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "align" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "hspace" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "vspace" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "longDesc" with the proper type +PASS HTMLImageElement interface: new Image() must inherit property "border" with the proper type +PASS HTMLIFrameElement interface: existence and properties of interface object +PASS HTMLIFrameElement interface object length +PASS HTMLIFrameElement interface object name +PASS HTMLIFrameElement interface: existence and properties of interface prototype object +PASS HTMLIFrameElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLIFrameElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLIFrameElement interface: attribute src +PASS HTMLIFrameElement interface: attribute srcdoc +PASS HTMLIFrameElement interface: attribute name +PASS HTMLIFrameElement interface: attribute sandbox +PASS HTMLIFrameElement interface: attribute allow +PASS HTMLIFrameElement interface: attribute allowFullscreen +PASS HTMLIFrameElement interface: attribute width +PASS HTMLIFrameElement interface: attribute height +PASS HTMLIFrameElement interface: attribute referrerPolicy +PASS HTMLIFrameElement interface: attribute loading +PASS HTMLIFrameElement interface: attribute contentDocument +PASS HTMLIFrameElement interface: attribute contentWindow +PASS HTMLIFrameElement interface: operation getSVGDocument() +PASS HTMLIFrameElement interface: attribute align +PASS HTMLIFrameElement interface: attribute scrolling +PASS HTMLIFrameElement interface: attribute frameBorder +PASS HTMLIFrameElement interface: attribute longDesc +PASS HTMLIFrameElement interface: attribute marginHeight +PASS HTMLIFrameElement interface: attribute marginWidth +PASS HTMLIFrameElement must be primary interface of document.createElement("iframe") +PASS Stringification of document.createElement("iframe") +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "src" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "srcdoc" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "name" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "sandbox" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "allow" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "allowFullscreen" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "width" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "height" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "referrerPolicy" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "loading" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "contentDocument" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "contentWindow" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "getSVGDocument()" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "align" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "scrolling" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "frameBorder" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "longDesc" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "marginHeight" with the proper type +PASS HTMLIFrameElement interface: document.createElement("iframe") must inherit property "marginWidth" with the proper type +PASS HTMLEmbedElement interface: existence and properties of interface object +PASS HTMLEmbedElement interface object length +PASS HTMLEmbedElement interface object name +PASS HTMLEmbedElement interface: existence and properties of interface prototype object +PASS HTMLEmbedElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLEmbedElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLEmbedElement interface: attribute src +PASS HTMLEmbedElement interface: attribute type +PASS HTMLEmbedElement interface: attribute width +PASS HTMLEmbedElement interface: attribute height +PASS HTMLEmbedElement interface: operation getSVGDocument() +PASS HTMLEmbedElement interface: attribute align +PASS HTMLEmbedElement interface: attribute name +PASS HTMLEmbedElement must be primary interface of document.createElement("embed") +PASS Stringification of document.createElement("embed") +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "src" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "type" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "width" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "height" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "getSVGDocument()" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "align" with the proper type +PASS HTMLEmbedElement interface: document.createElement("embed") must inherit property "name" with the proper type +PASS HTMLObjectElement interface: existence and properties of interface object +PASS HTMLObjectElement interface object length +PASS HTMLObjectElement interface object name +PASS HTMLObjectElement interface: existence and properties of interface prototype object +PASS HTMLObjectElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLObjectElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLObjectElement interface: attribute data +PASS HTMLObjectElement interface: attribute type +PASS HTMLObjectElement interface: attribute name +PASS HTMLObjectElement interface: attribute form +PASS HTMLObjectElement interface: attribute width +PASS HTMLObjectElement interface: attribute height +PASS HTMLObjectElement interface: attribute contentDocument +PASS HTMLObjectElement interface: attribute contentWindow +PASS HTMLObjectElement interface: operation getSVGDocument() +PASS HTMLObjectElement interface: attribute willValidate +PASS HTMLObjectElement interface: attribute validity +PASS HTMLObjectElement interface: attribute validationMessage +PASS HTMLObjectElement interface: operation checkValidity() +PASS HTMLObjectElement interface: operation reportValidity() +PASS HTMLObjectElement interface: operation setCustomValidity(DOMString) +PASS HTMLObjectElement interface: attribute align +PASS HTMLObjectElement interface: attribute archive +PASS HTMLObjectElement interface: attribute code +PASS HTMLObjectElement interface: attribute declare +PASS HTMLObjectElement interface: attribute hspace +PASS HTMLObjectElement interface: attribute standby +PASS HTMLObjectElement interface: attribute vspace +PASS HTMLObjectElement interface: attribute codeBase +PASS HTMLObjectElement interface: attribute codeType +PASS HTMLObjectElement interface: attribute useMap +PASS HTMLObjectElement interface: attribute border +PASS HTMLObjectElement must be primary interface of document.createElement("object") +PASS Stringification of document.createElement("object") +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "data" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "type" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "name" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "form" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "width" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "height" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "contentDocument" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "contentWindow" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "getSVGDocument()" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "willValidate" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "validity" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "validationMessage" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "checkValidity()" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "reportValidity()" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLObjectElement interface: calling setCustomValidity(DOMString) on document.createElement("object") with too few arguments must throw TypeError +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "align" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "archive" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "code" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "declare" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "hspace" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "standby" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "vspace" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "codeBase" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "codeType" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "useMap" with the proper type +PASS HTMLObjectElement interface: document.createElement("object") must inherit property "border" with the proper type +PASS HTMLParamElement interface: existence and properties of interface object +PASS HTMLParamElement interface object length +PASS HTMLParamElement interface object name +PASS HTMLParamElement interface: existence and properties of interface prototype object +PASS HTMLParamElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLParamElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLParamElement interface: attribute name +PASS HTMLParamElement interface: attribute value +PASS HTMLParamElement interface: attribute type +PASS HTMLParamElement interface: attribute valueType +PASS HTMLParamElement must be primary interface of document.createElement("param") +PASS Stringification of document.createElement("param") +PASS HTMLParamElement interface: document.createElement("param") must inherit property "name" with the proper type +PASS HTMLParamElement interface: document.createElement("param") must inherit property "value" with the proper type +PASS HTMLParamElement interface: document.createElement("param") must inherit property "type" with the proper type +PASS HTMLParamElement interface: document.createElement("param") must inherit property "valueType" with the proper type +PASS HTMLVideoElement interface: existence and properties of interface object +PASS HTMLVideoElement interface object length +PASS HTMLVideoElement interface object name +PASS HTMLVideoElement interface: existence and properties of interface prototype object +PASS HTMLVideoElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLVideoElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLVideoElement interface: attribute width +PASS HTMLVideoElement interface: attribute height +PASS HTMLVideoElement interface: attribute videoWidth +PASS HTMLVideoElement interface: attribute videoHeight +PASS HTMLVideoElement interface: attribute poster +PASS HTMLVideoElement interface: attribute playsInline +PASS HTMLVideoElement must be primary interface of document.createElement("video") +PASS Stringification of document.createElement("video") +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "width" with the proper type +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "height" with the proper type +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "videoWidth" with the proper type +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "videoHeight" with the proper type +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "poster" with the proper type +PASS HTMLVideoElement interface: document.createElement("video") must inherit property "playsInline" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "error" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "src" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "srcObject" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "currentSrc" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "crossOrigin" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "NETWORK_EMPTY" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "NETWORK_IDLE" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "NETWORK_LOADING" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "NETWORK_NO_SOURCE" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "networkState" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "preload" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "buffered" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "load()" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "canPlayType(DOMString)" with the proper type +PASS HTMLMediaElement interface: calling canPlayType(DOMString) on document.createElement("video") with too few arguments must throw TypeError +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_NOTHING" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_METADATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_CURRENT_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_FUTURE_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "HAVE_ENOUGH_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "readyState" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "seeking" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "currentTime" with the proper type +FAIL HTMLMediaElement interface: document.createElement("video") must inherit property "fastSeek(double)" with the proper type assert_inherits: property "fastSeek" not found in prototype chain +FAIL HTMLMediaElement interface: calling fastSeek(double) on document.createElement("video") with too few arguments must throw TypeError assert_inherits: property "fastSeek" not found in prototype chain +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "duration" with the proper type +FAIL HTMLMediaElement interface: document.createElement("video") must inherit property "getStartDate()" with the proper type assert_inherits: property "getStartDate" not found in prototype chain +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "paused" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "defaultPlaybackRate" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "playbackRate" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "preservesPitch" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "played" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "seekable" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "ended" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "autoplay" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "loop" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "play()" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "pause()" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "controls" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "volume" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "muted" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "defaultMuted" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "audioTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "videoTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "textTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("video") must inherit property "addTextTrack(TextTrackKind, optional DOMString, optional DOMString)" with the proper type +PASS HTMLMediaElement interface: calling addTextTrack(TextTrackKind, optional DOMString, optional DOMString) on document.createElement("video") with too few arguments must throw TypeError +PASS HTMLAudioElement interface: existence and properties of interface object +PASS HTMLAudioElement interface object length +PASS HTMLAudioElement interface object name +PASS HTMLAudioElement interface: named constructor +PASS HTMLAudioElement interface: named constructor object +PASS HTMLAudioElement interface: named constructor prototype property +PASS HTMLAudioElement interface: named constructor name +PASS HTMLAudioElement interface: named constructor length +PASS HTMLAudioElement interface: named constructor without 'new' +PASS HTMLAudioElement interface: existence and properties of interface prototype object +PASS HTMLAudioElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLAudioElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLAudioElement must be primary interface of document.createElement("audio") +PASS Stringification of document.createElement("audio") +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "error" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "src" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "srcObject" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "currentSrc" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "crossOrigin" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "NETWORK_EMPTY" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "NETWORK_IDLE" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "NETWORK_LOADING" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "NETWORK_NO_SOURCE" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "networkState" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "preload" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "buffered" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "load()" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "canPlayType(DOMString)" with the proper type +PASS HTMLMediaElement interface: calling canPlayType(DOMString) on document.createElement("audio") with too few arguments must throw TypeError +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_NOTHING" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_METADATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_CURRENT_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_FUTURE_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "HAVE_ENOUGH_DATA" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "readyState" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "seeking" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "currentTime" with the proper type +FAIL HTMLMediaElement interface: document.createElement("audio") must inherit property "fastSeek(double)" with the proper type assert_inherits: property "fastSeek" not found in prototype chain +FAIL HTMLMediaElement interface: calling fastSeek(double) on document.createElement("audio") with too few arguments must throw TypeError assert_inherits: property "fastSeek" not found in prototype chain +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "duration" with the proper type +FAIL HTMLMediaElement interface: document.createElement("audio") must inherit property "getStartDate()" with the proper type assert_inherits: property "getStartDate" not found in prototype chain +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "paused" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "defaultPlaybackRate" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "playbackRate" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "preservesPitch" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "played" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "seekable" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "ended" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "autoplay" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "loop" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "play()" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "pause()" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "controls" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "volume" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "muted" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "defaultMuted" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "audioTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "videoTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "textTracks" with the proper type +PASS HTMLMediaElement interface: document.createElement("audio") must inherit property "addTextTrack(TextTrackKind, optional DOMString, optional DOMString)" with the proper type +PASS HTMLMediaElement interface: calling addTextTrack(TextTrackKind, optional DOMString, optional DOMString) on document.createElement("audio") with too few arguments must throw TypeError +PASS HTMLAudioElement must be primary interface of new Audio() +PASS Stringification of new Audio() +PASS HTMLMediaElement interface: new Audio() must inherit property "error" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "src" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "srcObject" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "currentSrc" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "crossOrigin" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "NETWORK_EMPTY" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "NETWORK_IDLE" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "NETWORK_LOADING" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "NETWORK_NO_SOURCE" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "networkState" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "preload" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "buffered" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "load()" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "canPlayType(DOMString)" with the proper type +PASS HTMLMediaElement interface: calling canPlayType(DOMString) on new Audio() with too few arguments must throw TypeError +PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_NOTHING" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_METADATA" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_CURRENT_DATA" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_FUTURE_DATA" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "HAVE_ENOUGH_DATA" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "readyState" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "seeking" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "currentTime" with the proper type +FAIL HTMLMediaElement interface: new Audio() must inherit property "fastSeek(double)" with the proper type assert_inherits: property "fastSeek" not found in prototype chain +FAIL HTMLMediaElement interface: calling fastSeek(double) on new Audio() with too few arguments must throw TypeError assert_inherits: property "fastSeek" not found in prototype chain +PASS HTMLMediaElement interface: new Audio() must inherit property "duration" with the proper type +FAIL HTMLMediaElement interface: new Audio() must inherit property "getStartDate()" with the proper type assert_inherits: property "getStartDate" not found in prototype chain +PASS HTMLMediaElement interface: new Audio() must inherit property "paused" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "defaultPlaybackRate" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "playbackRate" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "preservesPitch" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "played" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "seekable" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "ended" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "autoplay" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "loop" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "play()" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "pause()" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "controls" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "volume" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "muted" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "defaultMuted" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "audioTracks" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "videoTracks" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "textTracks" with the proper type +PASS HTMLMediaElement interface: new Audio() must inherit property "addTextTrack(TextTrackKind, optional DOMString, optional DOMString)" with the proper type +PASS HTMLMediaElement interface: calling addTextTrack(TextTrackKind, optional DOMString, optional DOMString) on new Audio() with too few arguments must throw TypeError +PASS HTMLTrackElement interface: existence and properties of interface object +PASS HTMLTrackElement interface object length +PASS HTMLTrackElement interface object name +PASS HTMLTrackElement interface: existence and properties of interface prototype object +PASS HTMLTrackElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTrackElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTrackElement interface: attribute kind +PASS HTMLTrackElement interface: attribute src +PASS HTMLTrackElement interface: attribute srclang +PASS HTMLTrackElement interface: attribute label +PASS HTMLTrackElement interface: attribute default +PASS HTMLTrackElement interface: constant NONE on interface object +PASS HTMLTrackElement interface: constant NONE on interface prototype object +PASS HTMLTrackElement interface: constant LOADING on interface object +PASS HTMLTrackElement interface: constant LOADING on interface prototype object +PASS HTMLTrackElement interface: constant LOADED on interface object +PASS HTMLTrackElement interface: constant LOADED on interface prototype object +PASS HTMLTrackElement interface: constant ERROR on interface object +PASS HTMLTrackElement interface: constant ERROR on interface prototype object +PASS HTMLTrackElement interface: attribute readyState +PASS HTMLTrackElement interface: attribute track +PASS HTMLTrackElement must be primary interface of document.createElement("track") +PASS Stringification of document.createElement("track") +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "kind" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "src" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "srclang" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "label" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "default" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "NONE" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "LOADING" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "LOADED" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "ERROR" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "readyState" with the proper type +PASS HTMLTrackElement interface: document.createElement("track") must inherit property "track" with the proper type +PASS HTMLMediaElement interface: existence and properties of interface object +PASS HTMLMediaElement interface object length +PASS HTMLMediaElement interface object name +PASS HTMLMediaElement interface: existence and properties of interface prototype object +PASS HTMLMediaElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMediaElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMediaElement interface: attribute error +PASS HTMLMediaElement interface: attribute src +PASS HTMLMediaElement interface: attribute srcObject +PASS HTMLMediaElement interface: attribute currentSrc +PASS HTMLMediaElement interface: attribute crossOrigin +PASS HTMLMediaElement interface: constant NETWORK_EMPTY on interface object +PASS HTMLMediaElement interface: constant NETWORK_EMPTY on interface prototype object +PASS HTMLMediaElement interface: constant NETWORK_IDLE on interface object +PASS HTMLMediaElement interface: constant NETWORK_IDLE on interface prototype object +PASS HTMLMediaElement interface: constant NETWORK_LOADING on interface object +PASS HTMLMediaElement interface: constant NETWORK_LOADING on interface prototype object +PASS HTMLMediaElement interface: constant NETWORK_NO_SOURCE on interface object +PASS HTMLMediaElement interface: constant NETWORK_NO_SOURCE on interface prototype object +PASS HTMLMediaElement interface: attribute networkState +PASS HTMLMediaElement interface: attribute preload +PASS HTMLMediaElement interface: attribute buffered +PASS HTMLMediaElement interface: operation load() +PASS HTMLMediaElement interface: operation canPlayType(DOMString) +PASS HTMLMediaElement interface: constant HAVE_NOTHING on interface object +PASS HTMLMediaElement interface: constant HAVE_NOTHING on interface prototype object +PASS HTMLMediaElement interface: constant HAVE_METADATA on interface object +PASS HTMLMediaElement interface: constant HAVE_METADATA on interface prototype object +PASS HTMLMediaElement interface: constant HAVE_CURRENT_DATA on interface object +PASS HTMLMediaElement interface: constant HAVE_CURRENT_DATA on interface prototype object +PASS HTMLMediaElement interface: constant HAVE_FUTURE_DATA on interface object +PASS HTMLMediaElement interface: constant HAVE_FUTURE_DATA on interface prototype object +PASS HTMLMediaElement interface: constant HAVE_ENOUGH_DATA on interface object +PASS HTMLMediaElement interface: constant HAVE_ENOUGH_DATA on interface prototype object +PASS HTMLMediaElement interface: attribute readyState +PASS HTMLMediaElement interface: attribute seeking +PASS HTMLMediaElement interface: attribute currentTime +FAIL HTMLMediaElement interface: operation fastSeek(double) assert_own_property: interface prototype object missing non-static operation expected property "fastSeek" missing +PASS HTMLMediaElement interface: attribute duration +FAIL HTMLMediaElement interface: operation getStartDate() assert_own_property: interface prototype object missing non-static operation expected property "getStartDate" missing +PASS HTMLMediaElement interface: attribute paused +PASS HTMLMediaElement interface: attribute defaultPlaybackRate +PASS HTMLMediaElement interface: attribute playbackRate +PASS HTMLMediaElement interface: attribute preservesPitch +PASS HTMLMediaElement interface: attribute played +PASS HTMLMediaElement interface: attribute seekable +PASS HTMLMediaElement interface: attribute ended +PASS HTMLMediaElement interface: attribute autoplay +PASS HTMLMediaElement interface: attribute loop +PASS HTMLMediaElement interface: operation play() +PASS HTMLMediaElement interface: operation pause() +PASS HTMLMediaElement interface: attribute controls +PASS HTMLMediaElement interface: attribute volume +PASS HTMLMediaElement interface: attribute muted +PASS HTMLMediaElement interface: attribute defaultMuted +PASS HTMLMediaElement interface: attribute audioTracks +PASS HTMLMediaElement interface: attribute videoTracks +PASS HTMLMediaElement interface: attribute textTracks +PASS HTMLMediaElement interface: operation addTextTrack(TextTrackKind, optional DOMString, optional DOMString) +PASS HTMLMapElement interface: existence and properties of interface object +PASS HTMLMapElement interface object length +PASS HTMLMapElement interface object name +PASS HTMLMapElement interface: existence and properties of interface prototype object +PASS HTMLMapElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMapElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMapElement interface: attribute name +PASS HTMLMapElement interface: attribute areas +PASS HTMLMapElement must be primary interface of document.createElement("map") +PASS Stringification of document.createElement("map") +PASS HTMLMapElement interface: document.createElement("map") must inherit property "name" with the proper type +PASS HTMLMapElement interface: document.createElement("map") must inherit property "areas" with the proper type +PASS HTMLAreaElement interface: existence and properties of interface object +PASS HTMLAreaElement interface object length +PASS HTMLAreaElement interface object name +PASS HTMLAreaElement interface: existence and properties of interface prototype object +PASS HTMLAreaElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLAreaElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLAreaElement interface: attribute alt +PASS HTMLAreaElement interface: attribute coords +PASS HTMLAreaElement interface: attribute shape +PASS HTMLAreaElement interface: attribute target +PASS HTMLAreaElement interface: attribute download +PASS HTMLAreaElement interface: attribute ping +PASS HTMLAreaElement interface: attribute rel +PASS HTMLAreaElement interface: attribute relList +PASS HTMLAreaElement interface: attribute referrerPolicy +PASS HTMLAreaElement interface: attribute noHref +PASS HTMLAreaElement interface: attribute href +PASS HTMLAreaElement interface: stringifier +PASS HTMLAreaElement interface: attribute origin +PASS HTMLAreaElement interface: attribute protocol +PASS HTMLAreaElement interface: attribute username +PASS HTMLAreaElement interface: attribute password +PASS HTMLAreaElement interface: attribute host +PASS HTMLAreaElement interface: attribute hostname +PASS HTMLAreaElement interface: attribute port +PASS HTMLAreaElement interface: attribute pathname +PASS HTMLAreaElement interface: attribute search +PASS HTMLAreaElement interface: attribute hash +PASS HTMLAreaElement must be primary interface of document.createElement("area") +PASS Stringification of document.createElement("area") +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "alt" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "coords" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "shape" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "target" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "download" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "ping" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "rel" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "relList" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "referrerPolicy" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "noHref" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "href" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "origin" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "protocol" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "username" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "password" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "host" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "hostname" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "port" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "pathname" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "search" with the proper type +PASS HTMLAreaElement interface: document.createElement("area") must inherit property "hash" with the proper type +PASS HTMLTableElement interface: existence and properties of interface object +PASS HTMLTableElement interface object length +PASS HTMLTableElement interface object name +PASS HTMLTableElement interface: existence and properties of interface prototype object +PASS HTMLTableElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableElement interface: attribute caption +PASS HTMLTableElement interface: operation createCaption() +PASS HTMLTableElement interface: operation deleteCaption() +PASS HTMLTableElement interface: attribute tHead +PASS HTMLTableElement interface: operation createTHead() +PASS HTMLTableElement interface: operation deleteTHead() +PASS HTMLTableElement interface: attribute tFoot +PASS HTMLTableElement interface: operation createTFoot() +PASS HTMLTableElement interface: operation deleteTFoot() +PASS HTMLTableElement interface: attribute tBodies +PASS HTMLTableElement interface: operation createTBody() +PASS HTMLTableElement interface: attribute rows +PASS HTMLTableElement interface: operation insertRow(optional long) +PASS HTMLTableElement interface: operation deleteRow(long) +PASS HTMLTableElement interface: attribute align +PASS HTMLTableElement interface: attribute border +PASS HTMLTableElement interface: attribute frame +PASS HTMLTableElement interface: attribute rules +PASS HTMLTableElement interface: attribute summary +PASS HTMLTableElement interface: attribute width +PASS HTMLTableElement interface: attribute bgColor +PASS HTMLTableElement interface: attribute cellPadding +PASS HTMLTableElement interface: attribute cellSpacing +PASS HTMLTableElement must be primary interface of document.createElement("table") +PASS Stringification of document.createElement("table") +PASS HTMLTableElement interface: document.createElement("table") must inherit property "caption" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "createCaption()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "deleteCaption()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "tHead" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "createTHead()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "deleteTHead()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "tFoot" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "createTFoot()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "deleteTFoot()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "tBodies" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "createTBody()" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "rows" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "insertRow(optional long)" with the proper type +PASS HTMLTableElement interface: calling insertRow(optional long) on document.createElement("table") with too few arguments must throw TypeError +PASS HTMLTableElement interface: document.createElement("table") must inherit property "deleteRow(long)" with the proper type +PASS HTMLTableElement interface: calling deleteRow(long) on document.createElement("table") with too few arguments must throw TypeError +PASS HTMLTableElement interface: document.createElement("table") must inherit property "align" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "border" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "frame" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "rules" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "summary" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "width" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "bgColor" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "cellPadding" with the proper type +PASS HTMLTableElement interface: document.createElement("table") must inherit property "cellSpacing" with the proper type +PASS HTMLTableCaptionElement interface: existence and properties of interface object +PASS HTMLTableCaptionElement interface object length +PASS HTMLTableCaptionElement interface object name +PASS HTMLTableCaptionElement interface: existence and properties of interface prototype object +PASS HTMLTableCaptionElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableCaptionElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableCaptionElement interface: attribute align +PASS HTMLTableCaptionElement must be primary interface of document.createElement("caption") +PASS Stringification of document.createElement("caption") +PASS HTMLTableCaptionElement interface: document.createElement("caption") must inherit property "align" with the proper type +PASS HTMLTableColElement interface: existence and properties of interface object +PASS HTMLTableColElement interface object length +PASS HTMLTableColElement interface object name +PASS HTMLTableColElement interface: existence and properties of interface prototype object +PASS HTMLTableColElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableColElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableColElement interface: attribute span +PASS HTMLTableColElement interface: attribute align +PASS HTMLTableColElement interface: attribute ch +PASS HTMLTableColElement interface: attribute chOff +PASS HTMLTableColElement interface: attribute vAlign +PASS HTMLTableColElement interface: attribute width +PASS HTMLTableColElement must be primary interface of document.createElement("colgroup") +PASS Stringification of document.createElement("colgroup") +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "span" with the proper type +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "align" with the proper type +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "ch" with the proper type +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "chOff" with the proper type +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "vAlign" with the proper type +PASS HTMLTableColElement interface: document.createElement("colgroup") must inherit property "width" with the proper type +PASS HTMLTableColElement must be primary interface of document.createElement("col") +PASS Stringification of document.createElement("col") +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "span" with the proper type +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "align" with the proper type +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "ch" with the proper type +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "chOff" with the proper type +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "vAlign" with the proper type +PASS HTMLTableColElement interface: document.createElement("col") must inherit property "width" with the proper type +PASS HTMLTableSectionElement interface: existence and properties of interface object +PASS HTMLTableSectionElement interface object length +PASS HTMLTableSectionElement interface object name +PASS HTMLTableSectionElement interface: existence and properties of interface prototype object +PASS HTMLTableSectionElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableSectionElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableSectionElement interface: attribute rows +PASS HTMLTableSectionElement interface: operation insertRow(optional long) +PASS HTMLTableSectionElement interface: operation deleteRow(long) +PASS HTMLTableSectionElement interface: attribute align +PASS HTMLTableSectionElement interface: attribute ch +PASS HTMLTableSectionElement interface: attribute chOff +PASS HTMLTableSectionElement interface: attribute vAlign +PASS HTMLTableSectionElement must be primary interface of document.createElement("tbody") +PASS Stringification of document.createElement("tbody") +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "rows" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "insertRow(optional long)" with the proper type +PASS HTMLTableSectionElement interface: calling insertRow(optional long) on document.createElement("tbody") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "deleteRow(long)" with the proper type +PASS HTMLTableSectionElement interface: calling deleteRow(long) on document.createElement("tbody") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "align" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "ch" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "chOff" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tbody") must inherit property "vAlign" with the proper type +PASS HTMLTableSectionElement must be primary interface of document.createElement("thead") +PASS Stringification of document.createElement("thead") +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "rows" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "insertRow(optional long)" with the proper type +PASS HTMLTableSectionElement interface: calling insertRow(optional long) on document.createElement("thead") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "deleteRow(long)" with the proper type +PASS HTMLTableSectionElement interface: calling deleteRow(long) on document.createElement("thead") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "align" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "ch" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "chOff" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("thead") must inherit property "vAlign" with the proper type +PASS HTMLTableSectionElement must be primary interface of document.createElement("tfoot") +PASS Stringification of document.createElement("tfoot") +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "rows" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "insertRow(optional long)" with the proper type +PASS HTMLTableSectionElement interface: calling insertRow(optional long) on document.createElement("tfoot") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "deleteRow(long)" with the proper type +PASS HTMLTableSectionElement interface: calling deleteRow(long) on document.createElement("tfoot") with too few arguments must throw TypeError +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "align" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "ch" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "chOff" with the proper type +PASS HTMLTableSectionElement interface: document.createElement("tfoot") must inherit property "vAlign" with the proper type +PASS HTMLTableRowElement interface: existence and properties of interface object +PASS HTMLTableRowElement interface object length +PASS HTMLTableRowElement interface object name +PASS HTMLTableRowElement interface: existence and properties of interface prototype object +PASS HTMLTableRowElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableRowElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableRowElement interface: attribute rowIndex +PASS HTMLTableRowElement interface: attribute sectionRowIndex +PASS HTMLTableRowElement interface: attribute cells +PASS HTMLTableRowElement interface: operation insertCell(optional long) +PASS HTMLTableRowElement interface: operation deleteCell(long) +PASS HTMLTableRowElement interface: attribute align +PASS HTMLTableRowElement interface: attribute ch +PASS HTMLTableRowElement interface: attribute chOff +PASS HTMLTableRowElement interface: attribute vAlign +PASS HTMLTableRowElement interface: attribute bgColor +PASS HTMLTableRowElement must be primary interface of document.createElement("tr") +PASS Stringification of document.createElement("tr") +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "rowIndex" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "sectionRowIndex" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "cells" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "insertCell(optional long)" with the proper type +PASS HTMLTableRowElement interface: calling insertCell(optional long) on document.createElement("tr") with too few arguments must throw TypeError +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "deleteCell(long)" with the proper type +PASS HTMLTableRowElement interface: calling deleteCell(long) on document.createElement("tr") with too few arguments must throw TypeError +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "align" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "ch" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "chOff" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "vAlign" with the proper type +PASS HTMLTableRowElement interface: document.createElement("tr") must inherit property "bgColor" with the proper type +PASS HTMLTableCellElement interface: existence and properties of interface object +PASS HTMLTableCellElement interface object length +PASS HTMLTableCellElement interface object name +PASS HTMLTableCellElement interface: existence and properties of interface prototype object +PASS HTMLTableCellElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTableCellElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTableCellElement interface: attribute colSpan +PASS HTMLTableCellElement interface: attribute rowSpan +PASS HTMLTableCellElement interface: attribute headers +PASS HTMLTableCellElement interface: attribute cellIndex +PASS HTMLTableCellElement interface: attribute scope +PASS HTMLTableCellElement interface: attribute abbr +PASS HTMLTableCellElement interface: attribute align +PASS HTMLTableCellElement interface: attribute axis +PASS HTMLTableCellElement interface: attribute height +PASS HTMLTableCellElement interface: attribute width +PASS HTMLTableCellElement interface: attribute ch +PASS HTMLTableCellElement interface: attribute chOff +PASS HTMLTableCellElement interface: attribute noWrap +PASS HTMLTableCellElement interface: attribute vAlign +PASS HTMLTableCellElement interface: attribute bgColor +PASS HTMLTableCellElement must be primary interface of document.createElement("td") +PASS Stringification of document.createElement("td") +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "colSpan" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "rowSpan" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "headers" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "cellIndex" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "scope" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "abbr" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "align" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "axis" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "height" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "width" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "ch" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "chOff" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "noWrap" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "vAlign" with the proper type +PASS HTMLTableCellElement interface: document.createElement("td") must inherit property "bgColor" with the proper type +PASS HTMLTableCellElement must be primary interface of document.createElement("th") +PASS Stringification of document.createElement("th") +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "colSpan" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "rowSpan" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "headers" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "cellIndex" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "scope" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "abbr" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "align" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "axis" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "height" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "width" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "ch" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "chOff" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "noWrap" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "vAlign" with the proper type +PASS HTMLTableCellElement interface: document.createElement("th") must inherit property "bgColor" with the proper type +PASS HTMLFormElement interface: existence and properties of interface object +PASS HTMLFormElement interface object length +PASS HTMLFormElement interface object name +PASS HTMLFormElement interface: existence and properties of interface prototype object +PASS HTMLFormElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFormElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFormElement interface: attribute acceptCharset +PASS HTMLFormElement interface: attribute action +PASS HTMLFormElement interface: attribute autocomplete +PASS HTMLFormElement interface: attribute enctype +PASS HTMLFormElement interface: attribute encoding +PASS HTMLFormElement interface: attribute method +PASS HTMLFormElement interface: attribute name +PASS HTMLFormElement interface: attribute noValidate +PASS HTMLFormElement interface: attribute target +FAIL HTMLFormElement interface: attribute rel assert_true: The prototype object must have a property "rel" expected true got false +FAIL HTMLFormElement interface: attribute relList assert_true: The prototype object must have a property "relList" expected true got false +PASS HTMLFormElement interface: attribute elements +PASS HTMLFormElement interface: attribute length +PASS HTMLFormElement interface: operation submit() +PASS HTMLFormElement interface: operation requestSubmit(optional HTMLElement?) +PASS HTMLFormElement interface: operation reset() +PASS HTMLFormElement interface: operation checkValidity() +PASS HTMLFormElement interface: operation reportValidity() +PASS HTMLFormElement must be primary interface of document.createElement("form") +PASS Stringification of document.createElement("form") +PASS HTMLFormElement interface: document.createElement("form") must inherit property "acceptCharset" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "action" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "autocomplete" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "enctype" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "encoding" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "method" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "name" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "noValidate" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "target" with the proper type +FAIL HTMLFormElement interface: document.createElement("form") must inherit property "rel" with the proper type assert_inherits: property "rel" not found in prototype chain +FAIL HTMLFormElement interface: document.createElement("form") must inherit property "relList" with the proper type assert_inherits: property "relList" not found in prototype chain +PASS HTMLFormElement interface: document.createElement("form") must inherit property "elements" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "length" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "submit()" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "requestSubmit(optional HTMLElement?)" with the proper type +PASS HTMLFormElement interface: calling requestSubmit(optional HTMLElement?) on document.createElement("form") with too few arguments must throw TypeError +PASS HTMLFormElement interface: document.createElement("form") must inherit property "reset()" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "checkValidity()" with the proper type +PASS HTMLFormElement interface: document.createElement("form") must inherit property "reportValidity()" with the proper type +PASS HTMLLabelElement interface: existence and properties of interface object +PASS HTMLLabelElement interface object length +PASS HTMLLabelElement interface object name +PASS HTMLLabelElement interface: existence and properties of interface prototype object +PASS HTMLLabelElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLLabelElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLLabelElement interface: attribute form +PASS HTMLLabelElement interface: attribute htmlFor +PASS HTMLLabelElement interface: attribute control +PASS HTMLLabelElement must be primary interface of document.createElement("label") +PASS Stringification of document.createElement("label") +PASS HTMLLabelElement interface: document.createElement("label") must inherit property "form" with the proper type +PASS HTMLLabelElement interface: document.createElement("label") must inherit property "htmlFor" with the proper type +PASS HTMLLabelElement interface: document.createElement("label") must inherit property "control" with the proper type +PASS HTMLInputElement interface: existence and properties of interface object +PASS HTMLInputElement interface object length +PASS HTMLInputElement interface object name +PASS HTMLInputElement interface: existence and properties of interface prototype object +PASS HTMLInputElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLInputElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLInputElement interface: attribute accept +PASS HTMLInputElement interface: attribute alt +PASS HTMLInputElement interface: attribute autocomplete +PASS HTMLInputElement interface: attribute defaultChecked +PASS HTMLInputElement interface: attribute checked +PASS HTMLInputElement interface: attribute dirName +PASS HTMLInputElement interface: attribute disabled +PASS HTMLInputElement interface: attribute form +PASS HTMLInputElement interface: attribute files +PASS HTMLInputElement interface: attribute formAction +PASS HTMLInputElement interface: attribute formEnctype +PASS HTMLInputElement interface: attribute formMethod +PASS HTMLInputElement interface: attribute formNoValidate +PASS HTMLInputElement interface: attribute formTarget +PASS HTMLInputElement interface: attribute height +PASS HTMLInputElement interface: attribute indeterminate +PASS HTMLInputElement interface: attribute list +PASS HTMLInputElement interface: attribute max +PASS HTMLInputElement interface: attribute maxLength +PASS HTMLInputElement interface: attribute min +PASS HTMLInputElement interface: attribute minLength +PASS HTMLInputElement interface: attribute multiple +PASS HTMLInputElement interface: attribute name +PASS HTMLInputElement interface: attribute pattern +PASS HTMLInputElement interface: attribute placeholder +PASS HTMLInputElement interface: attribute readOnly +PASS HTMLInputElement interface: attribute required +PASS HTMLInputElement interface: attribute size +PASS HTMLInputElement interface: attribute src +PASS HTMLInputElement interface: attribute step +PASS HTMLInputElement interface: attribute type +PASS HTMLInputElement interface: attribute defaultValue +PASS HTMLInputElement interface: attribute value +PASS HTMLInputElement interface: attribute valueAsDate +PASS HTMLInputElement interface: attribute valueAsNumber +PASS HTMLInputElement interface: attribute width +PASS HTMLInputElement interface: operation stepUp(optional long) +PASS HTMLInputElement interface: operation stepDown(optional long) +PASS HTMLInputElement interface: attribute willValidate +PASS HTMLInputElement interface: attribute validity +PASS HTMLInputElement interface: attribute validationMessage +PASS HTMLInputElement interface: operation checkValidity() +PASS HTMLInputElement interface: operation reportValidity() +PASS HTMLInputElement interface: operation setCustomValidity(DOMString) +PASS HTMLInputElement interface: attribute labels +PASS HTMLInputElement interface: operation select() +PASS HTMLInputElement interface: attribute selectionStart +PASS HTMLInputElement interface: attribute selectionEnd +PASS HTMLInputElement interface: attribute selectionDirection +PASS HTMLInputElement interface: operation setRangeText(DOMString) +PASS HTMLInputElement interface: operation setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) +PASS HTMLInputElement interface: operation setSelectionRange(unsigned long, unsigned long, optional DOMString) +PASS HTMLInputElement interface: attribute align +PASS HTMLInputElement interface: attribute useMap +PASS HTMLInputElement must be primary interface of document.createElement("input") +PASS Stringification of document.createElement("input") +PASS HTMLInputElement interface: document.createElement("input") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "form" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "files" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "height" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "list" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "max" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "min" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "name" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "required" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "size" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "src" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "step" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "type" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "value" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "width" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on document.createElement("input") with too few arguments must throw TypeError +PASS HTMLInputElement interface: document.createElement("input") must inherit property "align" with the proper type +PASS HTMLInputElement interface: document.createElement("input") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("text") +PASS Stringification of createInput("text") +PASS HTMLInputElement interface: createInput("text") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("text") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("text") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("text") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("hidden") +PASS Stringification of createInput("hidden") +PASS HTMLInputElement interface: createInput("hidden") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("hidden") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("hidden") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("hidden") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("search") +PASS Stringification of createInput("search") +PASS HTMLInputElement interface: createInput("search") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("search") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("search") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("search") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("tel") +PASS Stringification of createInput("tel") +PASS HTMLInputElement interface: createInput("tel") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("tel") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("tel") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("tel") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("url") +PASS Stringification of createInput("url") +PASS HTMLInputElement interface: createInput("url") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("url") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("url") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("url") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("email") +PASS Stringification of createInput("email") +PASS HTMLInputElement interface: createInput("email") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("email") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("email") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("email") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("password") +PASS Stringification of createInput("password") +PASS HTMLInputElement interface: createInput("password") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("password") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("password") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("password") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("date") +PASS Stringification of createInput("date") +PASS HTMLInputElement interface: createInput("date") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("date") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("date") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("date") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("month") +PASS Stringification of createInput("month") +PASS HTMLInputElement interface: createInput("month") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("month") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("month") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("month") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("week") +PASS Stringification of createInput("week") +PASS HTMLInputElement interface: createInput("week") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("week") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("week") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("week") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("time") +PASS Stringification of createInput("time") +PASS HTMLInputElement interface: createInput("time") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("time") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("time") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("time") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("datetime-local") +PASS Stringification of createInput("datetime-local") +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("datetime-local") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("datetime-local") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("number") +PASS Stringification of createInput("number") +PASS HTMLInputElement interface: createInput("number") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("number") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("number") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("number") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("range") +PASS Stringification of createInput("range") +PASS HTMLInputElement interface: createInput("range") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("range") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("range") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("range") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("color") +PASS Stringification of createInput("color") +PASS HTMLInputElement interface: createInput("color") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("color") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("color") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("color") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("checkbox") +PASS Stringification of createInput("checkbox") +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("checkbox") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("checkbox") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("radio") +PASS Stringification of createInput("radio") +PASS HTMLInputElement interface: createInput("radio") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("radio") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("radio") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("radio") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("file") +PASS Stringification of createInput("file") +PASS HTMLInputElement interface: createInput("file") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("file") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("file") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("file") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("submit") +PASS Stringification of createInput("submit") +PASS HTMLInputElement interface: createInput("submit") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("submit") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("submit") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("submit") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("image") +PASS Stringification of createInput("image") +PASS HTMLInputElement interface: createInput("image") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("image") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("image") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("image") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("reset") +PASS Stringification of createInput("reset") +PASS HTMLInputElement interface: createInput("reset") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("reset") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("reset") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("reset") must inherit property "useMap" with the proper type +PASS HTMLInputElement must be primary interface of createInput("button") +PASS Stringification of createInput("button") +PASS HTMLInputElement interface: createInput("button") must inherit property "accept" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "alt" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "autocomplete" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "defaultChecked" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "checked" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "dirName" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "disabled" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "form" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "files" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "formAction" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "formEnctype" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "formMethod" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "formNoValidate" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "formTarget" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "height" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "indeterminate" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "list" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "max" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "maxLength" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "min" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "minLength" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "multiple" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "name" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "pattern" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "placeholder" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "readOnly" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "required" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "size" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "src" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "step" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "type" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "defaultValue" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "value" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "valueAsDate" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "valueAsNumber" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "width" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "stepUp(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepUp(optional long) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "stepDown(optional long)" with the proper type +PASS HTMLInputElement interface: calling stepDown(optional long) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "willValidate" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "validity" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "validationMessage" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "checkValidity()" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "reportValidity()" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setCustomValidity(DOMString) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "labels" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "select()" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "selectionStart" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "selectionEnd" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "selectionDirection" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLInputElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLInputElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on createInput("button") with too few arguments must throw TypeError +PASS HTMLInputElement interface: createInput("button") must inherit property "align" with the proper type +PASS HTMLInputElement interface: createInput("button") must inherit property "useMap" with the proper type +PASS HTMLButtonElement interface: existence and properties of interface object +PASS HTMLButtonElement interface object length +PASS HTMLButtonElement interface object name +PASS HTMLButtonElement interface: existence and properties of interface prototype object +PASS HTMLButtonElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLButtonElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLButtonElement interface: attribute disabled +PASS HTMLButtonElement interface: attribute form +PASS HTMLButtonElement interface: attribute formAction +PASS HTMLButtonElement interface: attribute formEnctype +PASS HTMLButtonElement interface: attribute formMethod +PASS HTMLButtonElement interface: attribute formNoValidate +PASS HTMLButtonElement interface: attribute formTarget +PASS HTMLButtonElement interface: attribute name +PASS HTMLButtonElement interface: attribute type +PASS HTMLButtonElement interface: attribute value +PASS HTMLButtonElement interface: attribute willValidate +PASS HTMLButtonElement interface: attribute validity +PASS HTMLButtonElement interface: attribute validationMessage +PASS HTMLButtonElement interface: operation checkValidity() +PASS HTMLButtonElement interface: operation reportValidity() +PASS HTMLButtonElement interface: operation setCustomValidity(DOMString) +PASS HTMLButtonElement interface: attribute labels +PASS HTMLButtonElement must be primary interface of document.createElement("button") +PASS Stringification of document.createElement("button") +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "disabled" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "form" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "formAction" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "formEnctype" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "formMethod" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "formNoValidate" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "formTarget" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "name" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "type" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "value" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "willValidate" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "validity" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "validationMessage" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "checkValidity()" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "reportValidity()" with the proper type +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLButtonElement interface: calling setCustomValidity(DOMString) on document.createElement("button") with too few arguments must throw TypeError +PASS HTMLButtonElement interface: document.createElement("button") must inherit property "labels" with the proper type +PASS HTMLSelectElement interface: existence and properties of interface object +PASS HTMLSelectElement interface object length +PASS HTMLSelectElement interface object name +PASS HTMLSelectElement interface: existence and properties of interface prototype object +PASS HTMLSelectElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLSelectElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLSelectElement interface: attribute autocomplete +PASS HTMLSelectElement interface: attribute disabled +PASS HTMLSelectElement interface: attribute form +PASS HTMLSelectElement interface: attribute multiple +PASS HTMLSelectElement interface: attribute name +PASS HTMLSelectElement interface: attribute required +PASS HTMLSelectElement interface: attribute size +PASS HTMLSelectElement interface: attribute type +PASS HTMLSelectElement interface: attribute options +PASS HTMLSelectElement interface: attribute length +PASS HTMLSelectElement interface: operation item(unsigned long) +PASS HTMLSelectElement interface: operation namedItem(DOMString) +PASS HTMLSelectElement interface: operation add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?) +PASS HTMLSelectElement interface: operation remove() +PASS HTMLSelectElement interface: operation remove(long) +PASS HTMLSelectElement interface: attribute selectedOptions +PASS HTMLSelectElement interface: attribute selectedIndex +PASS HTMLSelectElement interface: attribute value +PASS HTMLSelectElement interface: attribute willValidate +PASS HTMLSelectElement interface: attribute validity +PASS HTMLSelectElement interface: attribute validationMessage +PASS HTMLSelectElement interface: operation checkValidity() +PASS HTMLSelectElement interface: operation reportValidity() +PASS HTMLSelectElement interface: operation setCustomValidity(DOMString) +PASS HTMLSelectElement interface: attribute labels +PASS HTMLSelectElement must be primary interface of document.createElement("select") +PASS Stringification of document.createElement("select") +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "autocomplete" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "disabled" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "form" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "multiple" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "name" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "required" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "size" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "type" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "options" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "length" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "item(unsigned long)" with the proper type +PASS HTMLSelectElement interface: calling item(unsigned long) on document.createElement("select") with too few arguments must throw TypeError +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "namedItem(DOMString)" with the proper type +PASS HTMLSelectElement interface: calling namedItem(DOMString) on document.createElement("select") with too few arguments must throw TypeError +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?)" with the proper type +PASS HTMLSelectElement interface: calling add((HTMLOptionElement or HTMLOptGroupElement), optional (HTMLElement or long)?) on document.createElement("select") with too few arguments must throw TypeError +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "remove()" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "remove(long)" with the proper type +PASS HTMLSelectElement interface: calling remove(long) on document.createElement("select") with too few arguments must throw TypeError +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "selectedOptions" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "selectedIndex" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "value" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "willValidate" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "validity" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "validationMessage" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "checkValidity()" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "reportValidity()" with the proper type +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLSelectElement interface: calling setCustomValidity(DOMString) on document.createElement("select") with too few arguments must throw TypeError +PASS HTMLSelectElement interface: document.createElement("select") must inherit property "labels" with the proper type +PASS HTMLDataListElement interface: existence and properties of interface object +PASS HTMLDataListElement interface object length +PASS HTMLDataListElement interface object name +PASS HTMLDataListElement interface: existence and properties of interface prototype object +PASS HTMLDataListElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDataListElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDataListElement interface: attribute options +PASS HTMLDataListElement must be primary interface of document.createElement("datalist") +PASS Stringification of document.createElement("datalist") +PASS HTMLDataListElement interface: document.createElement("datalist") must inherit property "options" with the proper type +PASS HTMLOptGroupElement interface: existence and properties of interface object +PASS HTMLOptGroupElement interface object length +PASS HTMLOptGroupElement interface object name +PASS HTMLOptGroupElement interface: existence and properties of interface prototype object +PASS HTMLOptGroupElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLOptGroupElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLOptGroupElement interface: attribute disabled +PASS HTMLOptGroupElement interface: attribute label +PASS HTMLOptGroupElement must be primary interface of document.createElement("optgroup") +PASS Stringification of document.createElement("optgroup") +PASS HTMLOptGroupElement interface: document.createElement("optgroup") must inherit property "disabled" with the proper type +PASS HTMLOptGroupElement interface: document.createElement("optgroup") must inherit property "label" with the proper type +PASS HTMLOptionElement interface: existence and properties of interface object +PASS HTMLOptionElement interface object length +PASS HTMLOptionElement interface object name +PASS HTMLOptionElement interface: named constructor +PASS HTMLOptionElement interface: named constructor object +PASS HTMLOptionElement interface: named constructor prototype property +PASS HTMLOptionElement interface: named constructor name +PASS HTMLOptionElement interface: named constructor length +PASS HTMLOptionElement interface: named constructor without 'new' +PASS HTMLOptionElement interface: existence and properties of interface prototype object +PASS HTMLOptionElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLOptionElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLOptionElement interface: attribute disabled +PASS HTMLOptionElement interface: attribute form +PASS HTMLOptionElement interface: attribute label +PASS HTMLOptionElement interface: attribute defaultSelected +PASS HTMLOptionElement interface: attribute selected +PASS HTMLOptionElement interface: attribute value +PASS HTMLOptionElement interface: attribute text +PASS HTMLOptionElement interface: attribute index +PASS HTMLOptionElement must be primary interface of document.createElement("option") +PASS Stringification of document.createElement("option") +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "disabled" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "form" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "label" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "defaultSelected" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "selected" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "value" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "text" with the proper type +PASS HTMLOptionElement interface: document.createElement("option") must inherit property "index" with the proper type +PASS HTMLOptionElement must be primary interface of new Option() +PASS Stringification of new Option() +PASS HTMLOptionElement interface: new Option() must inherit property "disabled" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "form" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "label" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "defaultSelected" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "selected" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "value" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "text" with the proper type +PASS HTMLOptionElement interface: new Option() must inherit property "index" with the proper type +PASS HTMLTextAreaElement interface: existence and properties of interface object +PASS HTMLTextAreaElement interface object length +PASS HTMLTextAreaElement interface object name +PASS HTMLTextAreaElement interface: existence and properties of interface prototype object +PASS HTMLTextAreaElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTextAreaElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTextAreaElement interface: attribute autocomplete +PASS HTMLTextAreaElement interface: attribute cols +PASS HTMLTextAreaElement interface: attribute dirName +PASS HTMLTextAreaElement interface: attribute disabled +PASS HTMLTextAreaElement interface: attribute form +PASS HTMLTextAreaElement interface: attribute maxLength +PASS HTMLTextAreaElement interface: attribute minLength +PASS HTMLTextAreaElement interface: attribute name +PASS HTMLTextAreaElement interface: attribute placeholder +PASS HTMLTextAreaElement interface: attribute readOnly +PASS HTMLTextAreaElement interface: attribute required +PASS HTMLTextAreaElement interface: attribute rows +PASS HTMLTextAreaElement interface: attribute wrap +PASS HTMLTextAreaElement interface: attribute type +PASS HTMLTextAreaElement interface: attribute defaultValue +PASS HTMLTextAreaElement interface: attribute value +PASS HTMLTextAreaElement interface: attribute textLength +PASS HTMLTextAreaElement interface: attribute willValidate +PASS HTMLTextAreaElement interface: attribute validity +PASS HTMLTextAreaElement interface: attribute validationMessage +PASS HTMLTextAreaElement interface: operation checkValidity() +PASS HTMLTextAreaElement interface: operation reportValidity() +PASS HTMLTextAreaElement interface: operation setCustomValidity(DOMString) +PASS HTMLTextAreaElement interface: attribute labels +PASS HTMLTextAreaElement interface: operation select() +PASS HTMLTextAreaElement interface: attribute selectionStart +PASS HTMLTextAreaElement interface: attribute selectionEnd +PASS HTMLTextAreaElement interface: attribute selectionDirection +PASS HTMLTextAreaElement interface: operation setRangeText(DOMString) +PASS HTMLTextAreaElement interface: operation setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) +PASS HTMLTextAreaElement interface: operation setSelectionRange(unsigned long, unsigned long, optional DOMString) +PASS HTMLTextAreaElement must be primary interface of document.createElement("textarea") +PASS Stringification of document.createElement("textarea") +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "autocomplete" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "cols" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "dirName" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "disabled" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "form" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "maxLength" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "minLength" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "name" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "placeholder" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "readOnly" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "required" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "rows" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "wrap" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "type" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "defaultValue" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "value" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "textLength" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "willValidate" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "validity" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "validationMessage" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "checkValidity()" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "reportValidity()" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLTextAreaElement interface: calling setCustomValidity(DOMString) on document.createElement("textarea") with too few arguments must throw TypeError +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "labels" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "select()" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "selectionStart" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "selectionEnd" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "selectionDirection" with the proper type +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setRangeText(DOMString)" with the proper type +PASS HTMLTextAreaElement interface: calling setRangeText(DOMString) on document.createElement("textarea") with too few arguments must throw TypeError +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode)" with the proper type +PASS HTMLTextAreaElement interface: calling setRangeText(DOMString, unsigned long, unsigned long, optional SelectionMode) on document.createElement("textarea") with too few arguments must throw TypeError +PASS HTMLTextAreaElement interface: document.createElement("textarea") must inherit property "setSelectionRange(unsigned long, unsigned long, optional DOMString)" with the proper type +PASS HTMLTextAreaElement interface: calling setSelectionRange(unsigned long, unsigned long, optional DOMString) on document.createElement("textarea") with too few arguments must throw TypeError +PASS HTMLOutputElement interface: existence and properties of interface object +PASS HTMLOutputElement interface object length +PASS HTMLOutputElement interface object name +PASS HTMLOutputElement interface: existence and properties of interface prototype object +PASS HTMLOutputElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLOutputElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLOutputElement interface: attribute htmlFor +PASS HTMLOutputElement interface: attribute form +PASS HTMLOutputElement interface: attribute name +PASS HTMLOutputElement interface: attribute type +PASS HTMLOutputElement interface: attribute defaultValue +PASS HTMLOutputElement interface: attribute value +PASS HTMLOutputElement interface: attribute willValidate +PASS HTMLOutputElement interface: attribute validity +PASS HTMLOutputElement interface: attribute validationMessage +PASS HTMLOutputElement interface: operation checkValidity() +PASS HTMLOutputElement interface: operation reportValidity() +PASS HTMLOutputElement interface: operation setCustomValidity(DOMString) +PASS HTMLOutputElement interface: attribute labels +PASS HTMLOutputElement must be primary interface of document.createElement("output") +PASS Stringification of document.createElement("output") +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "htmlFor" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "form" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "name" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "type" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "defaultValue" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "value" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "willValidate" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "validity" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "validationMessage" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "checkValidity()" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "reportValidity()" with the proper type +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "setCustomValidity(DOMString)" with the proper type +PASS HTMLOutputElement interface: calling setCustomValidity(DOMString) on document.createElement("output") with too few arguments must throw TypeError +PASS HTMLOutputElement interface: document.createElement("output") must inherit property "labels" with the proper type +PASS HTMLProgressElement interface: existence and properties of interface object +PASS HTMLProgressElement interface object length +PASS HTMLProgressElement interface object name +PASS HTMLProgressElement interface: existence and properties of interface prototype object +PASS HTMLProgressElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLProgressElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLProgressElement interface: attribute value +PASS HTMLProgressElement interface: attribute max +PASS HTMLProgressElement interface: attribute position +PASS HTMLProgressElement interface: attribute labels +PASS HTMLProgressElement must be primary interface of document.createElement("progress") +PASS Stringification of document.createElement("progress") +PASS HTMLProgressElement interface: document.createElement("progress") must inherit property "value" with the proper type +PASS HTMLProgressElement interface: document.createElement("progress") must inherit property "max" with the proper type +PASS HTMLProgressElement interface: document.createElement("progress") must inherit property "position" with the proper type +PASS HTMLProgressElement interface: document.createElement("progress") must inherit property "labels" with the proper type +PASS HTMLMeterElement interface: existence and properties of interface object +PASS HTMLMeterElement interface object length +PASS HTMLMeterElement interface object name +PASS HTMLMeterElement interface: existence and properties of interface prototype object +PASS HTMLMeterElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMeterElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMeterElement interface: attribute value +PASS HTMLMeterElement interface: attribute min +PASS HTMLMeterElement interface: attribute max +PASS HTMLMeterElement interface: attribute low +PASS HTMLMeterElement interface: attribute high +PASS HTMLMeterElement interface: attribute optimum +PASS HTMLMeterElement interface: attribute labels +PASS HTMLMeterElement must be primary interface of document.createElement("meter") +PASS Stringification of document.createElement("meter") +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "value" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "min" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "max" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "low" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "high" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "optimum" with the proper type +PASS HTMLMeterElement interface: document.createElement("meter") must inherit property "labels" with the proper type +PASS HTMLFieldSetElement interface: existence and properties of interface object +PASS HTMLFieldSetElement interface object length +PASS HTMLFieldSetElement interface object name +PASS HTMLFieldSetElement interface: existence and properties of interface prototype object +PASS HTMLFieldSetElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFieldSetElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFieldSetElement interface: attribute disabled +PASS HTMLFieldSetElement interface: attribute form +PASS HTMLFieldSetElement interface: attribute name +PASS HTMLFieldSetElement interface: attribute type +PASS HTMLFieldSetElement interface: attribute elements +PASS HTMLFieldSetElement interface: attribute willValidate +PASS HTMLFieldSetElement interface: attribute validity +PASS HTMLFieldSetElement interface: attribute validationMessage +PASS HTMLFieldSetElement interface: operation checkValidity() +PASS HTMLFieldSetElement interface: operation reportValidity() +PASS HTMLFieldSetElement interface: operation setCustomValidity(DOMString) +PASS HTMLLegendElement interface: existence and properties of interface object +PASS HTMLLegendElement interface object length +PASS HTMLLegendElement interface object name +PASS HTMLLegendElement interface: existence and properties of interface prototype object +PASS HTMLLegendElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLLegendElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLLegendElement interface: attribute form +PASS HTMLLegendElement interface: attribute align +PASS HTMLLegendElement must be primary interface of document.createElement("legend") +PASS Stringification of document.createElement("legend") +PASS HTMLLegendElement interface: document.createElement("legend") must inherit property "form" with the proper type +PASS HTMLLegendElement interface: document.createElement("legend") must inherit property "align" with the proper type +PASS HTMLDetailsElement interface: existence and properties of interface object +PASS HTMLDetailsElement interface object length +PASS HTMLDetailsElement interface object name +PASS HTMLDetailsElement interface: existence and properties of interface prototype object +PASS HTMLDetailsElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDetailsElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDetailsElement interface: attribute open +PASS HTMLDetailsElement must be primary interface of document.createElement("details") +PASS Stringification of document.createElement("details") +PASS HTMLDetailsElement interface: document.createElement("details") must inherit property "open" with the proper type +PASS HTMLDialogElement interface: existence and properties of interface object +PASS HTMLDialogElement interface object length +PASS HTMLDialogElement interface object name +PASS HTMLDialogElement interface: existence and properties of interface prototype object +PASS HTMLDialogElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDialogElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDialogElement interface: attribute open +PASS HTMLDialogElement interface: attribute returnValue +PASS HTMLDialogElement interface: operation show() +PASS HTMLDialogElement interface: operation showModal() +PASS HTMLDialogElement interface: operation close(optional DOMString) +PASS HTMLScriptElement interface: existence and properties of interface object +PASS HTMLScriptElement interface object length +PASS HTMLScriptElement interface object name +PASS HTMLScriptElement interface: existence and properties of interface prototype object +PASS HTMLScriptElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLScriptElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLScriptElement interface: attribute src +PASS HTMLScriptElement interface: attribute type +PASS HTMLScriptElement interface: attribute noModule +PASS HTMLScriptElement interface: attribute async +PASS HTMLScriptElement interface: attribute defer +PASS HTMLScriptElement interface: attribute crossOrigin +PASS HTMLScriptElement interface: attribute text +PASS HTMLScriptElement interface: attribute integrity +PASS HTMLScriptElement interface: attribute referrerPolicy +PASS HTMLScriptElement interface: attribute charset +PASS HTMLScriptElement interface: attribute event +PASS HTMLScriptElement interface: attribute htmlFor +PASS HTMLScriptElement must be primary interface of document.createElement("script") +PASS Stringification of document.createElement("script") +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "src" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "type" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "noModule" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "async" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "defer" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "crossOrigin" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "text" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "integrity" with the proper type +FAIL HTMLScriptElement interface: document.createElement("script") must inherit property "referrerPolicy" with the proper type assert_equals: expected "string" but got "object" +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type +PASS HTMLScriptElement interface: document.createElement("script") must inherit property "htmlFor" with the proper type +PASS HTMLTemplateElement interface: existence and properties of interface object +PASS HTMLTemplateElement interface object length +PASS HTMLTemplateElement interface object name +PASS HTMLTemplateElement interface: existence and properties of interface prototype object +PASS HTMLTemplateElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLTemplateElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLTemplateElement interface: attribute content +PASS HTMLTemplateElement must be primary interface of document.createElement("template") +PASS Stringification of document.createElement("template") +PASS HTMLTemplateElement interface: document.createElement("template") must inherit property "content" with the proper type +PASS HTMLSlotElement interface: existence and properties of interface object +PASS HTMLSlotElement interface object length +PASS HTMLSlotElement interface object name +PASS HTMLSlotElement interface: existence and properties of interface prototype object +PASS HTMLSlotElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLSlotElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLSlotElement interface: attribute name +PASS HTMLSlotElement interface: operation assignedNodes(optional AssignedNodesOptions) +PASS HTMLSlotElement interface: operation assignedElements(optional AssignedNodesOptions) +PASS HTMLSlotElement interface: operation assign((Element or Text)...) +PASS HTMLSlotElement must be primary interface of document.createElement("slot") +PASS Stringification of document.createElement("slot") +PASS HTMLSlotElement interface: document.createElement("slot") must inherit property "name" with the proper type +PASS HTMLSlotElement interface: document.createElement("slot") must inherit property "assignedNodes(optional AssignedNodesOptions)" with the proper type +PASS HTMLSlotElement interface: calling assignedNodes(optional AssignedNodesOptions) on document.createElement("slot") with too few arguments must throw TypeError +PASS HTMLSlotElement interface: document.createElement("slot") must inherit property "assignedElements(optional AssignedNodesOptions)" with the proper type +PASS HTMLSlotElement interface: calling assignedElements(optional AssignedNodesOptions) on document.createElement("slot") with too few arguments must throw TypeError +PASS HTMLSlotElement interface: document.createElement("slot") must inherit property "assign((Element or Text)...)" with the proper type +PASS HTMLSlotElement interface: calling assign((Element or Text)...) on document.createElement("slot") with too few arguments must throw TypeError +PASS HTMLCanvasElement interface: existence and properties of interface object +PASS HTMLCanvasElement interface object length +PASS HTMLCanvasElement interface object name +PASS HTMLCanvasElement interface: existence and properties of interface prototype object +PASS HTMLCanvasElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLCanvasElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLCanvasElement interface: attribute width +PASS HTMLCanvasElement interface: attribute height +PASS HTMLCanvasElement interface: operation getContext(DOMString, optional any) +PASS HTMLCanvasElement interface: operation toDataURL(optional DOMString, optional any) +PASS HTMLCanvasElement interface: operation toBlob(BlobCallback, optional DOMString, optional any) +PASS HTMLCanvasElement interface: operation transferControlToOffscreen() +PASS HTMLCanvasElement must be primary interface of document.createElement("canvas") +PASS Stringification of document.createElement("canvas") +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "width" with the proper type +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "height" with the proper type +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "getContext(DOMString, optional any)" with the proper type +PASS HTMLCanvasElement interface: calling getContext(DOMString, optional any) on document.createElement("canvas") with too few arguments must throw TypeError +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "toDataURL(optional DOMString, optional any)" with the proper type +PASS HTMLCanvasElement interface: calling toDataURL(optional DOMString, optional any) on document.createElement("canvas") with too few arguments must throw TypeError +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "toBlob(BlobCallback, optional DOMString, optional any)" with the proper type +PASS HTMLCanvasElement interface: calling toBlob(BlobCallback, optional DOMString, optional any) on document.createElement("canvas") with too few arguments must throw TypeError +PASS HTMLCanvasElement interface: document.createElement("canvas") must inherit property "transferControlToOffscreen()" with the proper type +PASS HTMLMarqueeElement interface: existence and properties of interface object +PASS HTMLMarqueeElement interface object length +PASS HTMLMarqueeElement interface object name +PASS HTMLMarqueeElement interface: existence and properties of interface prototype object +PASS HTMLMarqueeElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLMarqueeElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLMarqueeElement interface: attribute behavior +PASS HTMLMarqueeElement interface: attribute bgColor +PASS HTMLMarqueeElement interface: attribute direction +PASS HTMLMarqueeElement interface: attribute height +PASS HTMLMarqueeElement interface: attribute hspace +PASS HTMLMarqueeElement interface: attribute loop +PASS HTMLMarqueeElement interface: attribute scrollAmount +PASS HTMLMarqueeElement interface: attribute scrollDelay +PASS HTMLMarqueeElement interface: attribute trueSpeed +PASS HTMLMarqueeElement interface: attribute vspace +PASS HTMLMarqueeElement interface: attribute width +PASS HTMLMarqueeElement interface: operation start() +PASS HTMLMarqueeElement interface: operation stop() +PASS HTMLMarqueeElement must be primary interface of document.createElement("marquee") +PASS Stringification of document.createElement("marquee") +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "behavior" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "bgColor" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "direction" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "height" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "hspace" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "loop" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "scrollAmount" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "scrollDelay" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "trueSpeed" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "vspace" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "width" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "start()" with the proper type +PASS HTMLMarqueeElement interface: document.createElement("marquee") must inherit property "stop()" with the proper type +PASS HTMLFrameSetElement interface: existence and properties of interface object +PASS HTMLFrameSetElement interface object length +PASS HTMLFrameSetElement interface object name +PASS HTMLFrameSetElement interface: existence and properties of interface prototype object +PASS HTMLFrameSetElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFrameSetElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFrameSetElement interface: attribute cols +PASS HTMLFrameSetElement interface: attribute rows +PASS HTMLFrameSetElement interface: attribute onafterprint +PASS HTMLFrameSetElement interface: attribute onbeforeprint +PASS HTMLFrameSetElement interface: attribute onbeforeunload +PASS HTMLFrameSetElement interface: attribute onhashchange +PASS HTMLFrameSetElement interface: attribute onlanguagechange +PASS HTMLFrameSetElement interface: attribute onmessage +PASS HTMLFrameSetElement interface: attribute onmessageerror +PASS HTMLFrameSetElement interface: attribute onoffline +PASS HTMLFrameSetElement interface: attribute ononline +PASS HTMLFrameSetElement interface: attribute onpagehide +PASS HTMLFrameSetElement interface: attribute onpageshow +PASS HTMLFrameSetElement interface: attribute onpopstate +PASS HTMLFrameSetElement interface: attribute onrejectionhandled +PASS HTMLFrameSetElement interface: attribute onstorage +PASS HTMLFrameSetElement interface: attribute onunhandledrejection +PASS HTMLFrameSetElement interface: attribute onunload +PASS HTMLFrameSetElement must be primary interface of document.createElement("frameset") +PASS Stringification of document.createElement("frameset") +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "cols" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "rows" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onafterprint" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onbeforeprint" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onbeforeunload" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onhashchange" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onlanguagechange" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onmessage" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onmessageerror" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onoffline" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "ononline" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onpagehide" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onpageshow" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onpopstate" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onrejectionhandled" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onstorage" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onunhandledrejection" with the proper type +PASS HTMLFrameSetElement interface: document.createElement("frameset") must inherit property "onunload" with the proper type +PASS HTMLFrameElement interface: existence and properties of interface object +PASS HTMLFrameElement interface object length +PASS HTMLFrameElement interface object name +PASS HTMLFrameElement interface: existence and properties of interface prototype object +PASS HTMLFrameElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFrameElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFrameElement interface: attribute name +PASS HTMLFrameElement interface: attribute scrolling +PASS HTMLFrameElement interface: attribute src +PASS HTMLFrameElement interface: attribute frameBorder +PASS HTMLFrameElement interface: attribute longDesc +PASS HTMLFrameElement interface: attribute noResize +PASS HTMLFrameElement interface: attribute contentDocument +PASS HTMLFrameElement interface: attribute contentWindow +PASS HTMLFrameElement interface: attribute marginHeight +PASS HTMLFrameElement interface: attribute marginWidth +PASS HTMLFrameElement must be primary interface of document.createElement("frame") +PASS Stringification of document.createElement("frame") +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "name" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "scrolling" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "src" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "frameBorder" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "longDesc" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "noResize" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "contentDocument" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "contentWindow" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "marginHeight" with the proper type +PASS HTMLFrameElement interface: document.createElement("frame") must inherit property "marginWidth" with the proper type +PASS HTMLDirectoryElement interface: existence and properties of interface object +PASS HTMLDirectoryElement interface object length +PASS HTMLDirectoryElement interface object name +PASS HTMLDirectoryElement interface: existence and properties of interface prototype object +PASS HTMLDirectoryElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLDirectoryElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLDirectoryElement interface: attribute compact +PASS HTMLDirectoryElement must be primary interface of document.createElement("dir") +PASS Stringification of document.createElement("dir") +PASS HTMLDirectoryElement interface: document.createElement("dir") must inherit property "compact" with the proper type +PASS HTMLFontElement interface: existence and properties of interface object +PASS HTMLFontElement interface object length +PASS HTMLFontElement interface object name +PASS HTMLFontElement interface: existence and properties of interface prototype object +PASS HTMLFontElement interface: existence and properties of interface prototype object's "constructor" property +PASS HTMLFontElement interface: existence and properties of interface prototype object's @@unscopables property +PASS HTMLFontElement interface: attribute color +PASS HTMLFontElement interface: attribute face +PASS HTMLFontElement interface: attribute size +PASS HTMLFontElement must be primary interface of document.createElement("font") +PASS Stringification of document.createElement("font") +PASS HTMLFontElement interface: document.createElement("font") must inherit property "color" with the proper type +PASS HTMLFontElement interface: document.createElement("font") must inherit property "face" with the proper type +PASS HTMLFontElement interface: document.createElement("font") must inherit property "size" with the proper type +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-expected.txt index a73b57b..e98ba5a 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 604 tests; 349 PASS, 255 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 604 tests; 348 PASS, 256 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -493,7 +493,7 @@ FAIL Parsing: <file:///y:> against <about:blank> assert_equals: href expected "file:///y:" but got "file:///Y:" FAIL Parsing: <file:///y:/> against <about:blank> assert_equals: href expected "file:///y:/" but got "file:///Y:/" PASS Parsing: <file:///./y> against <about:blank> -PASS Parsing: <file:///./y:> against <about:blank> +FAIL Parsing: <file:///./y:> against <about:blank> assert_equals: href expected "file:///y:" but got "file:///Y:" FAIL Parsing: <\\\.\y:> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code FAIL Parsing: <file://localhost//a//../..//foo> against <about:blank> assert_equals: href expected "file://///foo" but got "file://localhost///foo" FAIL Parsing: <file://localhost////foo> against <about:blank> assert_equals: href expected "file://////foo" but got "file://localhost////foo"
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-xhtml-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-xhtml-expected.txt index e98ba5a..a73b57b 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-xhtml-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/url/a-element-xhtml-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 604 tests; 348 PASS, 256 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 604 tests; 349 PASS, 255 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -493,7 +493,7 @@ FAIL Parsing: <file:///y:> against <about:blank> assert_equals: href expected "file:///y:" but got "file:///Y:" FAIL Parsing: <file:///y:/> against <about:blank> assert_equals: href expected "file:///y:/" but got "file:///Y:/" PASS Parsing: <file:///./y> against <about:blank> -FAIL Parsing: <file:///./y:> against <about:blank> assert_equals: href expected "file:///y:" but got "file:///Y:" +PASS Parsing: <file:///./y:> against <about:blank> FAIL Parsing: <\\\.\y:> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code FAIL Parsing: <file://localhost//a//../..//foo> against <about:blank> assert_equals: href expected "file://///foo" but got "file://localhost///foo" FAIL Parsing: <file://localhost////foo> against <about:blank> assert_equals: href expected "file://////foo" but got "file://localhost////foo"
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any-expected.txt index bb793568..6ba861a 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 604 tests; 415 PASS, 189 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 604 tests; 416 PASS, 188 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -557,7 +557,7 @@ FAIL Parsing: <file:///y:> against <about:blank> assert_equals: href expected "file:///y:" but got "file:///Y:" FAIL Parsing: <file:///y:/> against <about:blank> assert_equals: href expected "file:///y:/" but got "file:///Y:/" PASS Parsing: <file:///./y> against <about:blank> -FAIL Parsing: <file:///./y:> against <about:blank> assert_equals: href expected "file:///y:" but got "file:///Y:" +PASS Parsing: <file:///./y:> against <about:blank> FAIL Parsing: <\\\.\y:> against <about:blank> assert_throws_js: function "function() { bURL(expected.input, expected.base) }" did not throw
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any.worker-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any.worker-expected.txt index bb793568..6ba861a 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/url/url-constructor.any.worker-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 604 tests; 415 PASS, 189 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 604 tests; 416 PASS, 188 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Loading data… PASS Parsing: <http://example . org> against <http://example.org/foo/bar> @@ -557,7 +557,7 @@ FAIL Parsing: <file:///y:> against <about:blank> assert_equals: href expected "file:///y:" but got "file:///Y:" FAIL Parsing: <file:///y:/> against <about:blank> assert_equals: href expected "file:///y:/" but got "file:///Y:/" PASS Parsing: <file:///./y> against <about:blank> -FAIL Parsing: <file:///./y:> against <about:blank> assert_equals: href expected "file:///y:" but got "file:///Y:" +PASS Parsing: <file:///./y:> against <about:blank> FAIL Parsing: <\\\.\y:> against <about:blank> assert_throws_js: function "function() { bURL(expected.input, expected.base) }" did not throw
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug137388-2-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug137388-2-expected.png index b39895f..f993e5f 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug137388-2-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/bugs/bug137388-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_auto_per-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_auto_per-expected.png index 17dd5db..9a6749d 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_auto_per-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_auto_per-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_fix_per-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_fix_per-expected.png index bc69e128..b89fe1c 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_fix_per-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla/core/col_widths_fix_per-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug17826-expected.png b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug17826-expected.png index 7e7b317..30b31bd 100644 --- a/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug17826-expected.png +++ b/third_party/blink/web_tests/platform/win/tables/mozilla_expected_failures/bugs/bug17826-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png b/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png deleted file mode 100644 index 5f6514fa..0000000 --- a/third_party/blink/web_tests/platform/win/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/external/wpt/css/mediaqueries/test_media_queries-expected.txt b/third_party/blink/web_tests/platform/win7/external/wpt/css/mediaqueries/test_media_queries-expected.txt new file mode 100644 index 0000000..4db8087 --- /dev/null +++ b/third_party/blink/web_tests/platform/win7/external/wpt/css/mediaqueries/test_media_queries-expected.txt
@@ -0,0 +1,785 @@ +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = Uncaught Error: assert_not_equals: overflow-block should be equivalent to not (overflow-block: none) got disallowed value false +Found 780 tests; 568 PASS, 212 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS subtest_1 +FAIL subtest_2 assert_true: expected true got false +PASS subtest_3 +PASS subtest_4 +PASS subtest_5 +PASS subtest_6 +PASS subtest_7 +PASS subtest_8 +FAIL subtest_9 assert_true: expected true got false +FAIL subtest_10 assert_true: expected true got false +PASS subtest_11 +PASS subtest_12 +PASS subtest_13 +PASS subtest_14 +PASS subtest_15 +PASS subtest_16 +PASS subtest_17 +PASS subtest_18 +PASS subtest_19 +PASS subtest_20 +PASS subtest_21 +PASS subtest_22 +PASS subtest_23 +PASS subtest_24 +PASS subtest_25 +PASS subtest_26 +PASS subtest_27 +PASS subtest_28 +PASS subtest_29 +PASS subtest_30 +PASS subtest_31 +PASS subtest_32 +FAIL subtest_33 assert_true: expected true got false +FAIL subtest_34 assert_true: expected true got false +FAIL subtest_35 assert_true: expected true got false +FAIL subtest_36 assert_true: expected true got false +FAIL subtest_37 assert_true: expected true got false +FAIL subtest_38 assert_true: expected true got false +FAIL subtest_39 assert_true: expected true got false +FAIL subtest_40 assert_true: expected true got false +PASS subtest_41 +PASS subtest_42 +PASS subtest_43 +PASS subtest_44 +PASS subtest_45 +PASS subtest_46 +PASS subtest_47 +FAIL subtest_48 assert_true: expected true got false +FAIL subtest_49 assert_true: expected true got false +FAIL subtest_50 assert_true: expected true got false +FAIL subtest_51 assert_true: expected true got false +FAIL subtest_52 assert_true: expected true got false +FAIL subtest_53 assert_true: expected true got false +FAIL subtest_54 assert_true: expected true got false +FAIL subtest_55 assert_true: expected true got false +PASS subtest_56 +PASS subtest_57 +PASS subtest_58 +PASS subtest_59 +PASS subtest_60 +PASS subtest_61 +PASS subtest_62 +PASS subtest_63 +FAIL subtest_64 assert_true: expected true got false +FAIL subtest_65 assert_true: expected true got false +FAIL subtest_66 assert_true: expected true got false +FAIL subtest_67 assert_true: expected true got false +FAIL subtest_68 assert_true: expected true got false +FAIL subtest_69 assert_true: expected true got false +FAIL subtest_70 assert_true: expected true got false +FAIL subtest_71 assert_true: expected true got false +PASS subtest_72 +PASS subtest_73 +PASS subtest_74 +PASS subtest_75 +PASS subtest_76 +PASS subtest_77 +PASS subtest_78 +FAIL subtest_79 assert_true: expected true got false +FAIL subtest_80 assert_true: expected true got false +FAIL subtest_81 assert_true: expected true got false +FAIL subtest_82 assert_true: expected true got false +FAIL subtest_83 assert_true: expected true got false +FAIL subtest_84 assert_true: expected true got false +FAIL subtest_85 assert_true: expected true got false +FAIL subtest_86 assert_true: expected true got false +PASS subtest_87 +PASS subtest_88 +PASS subtest_89 +PASS subtest_90 +PASS subtest_91 +PASS subtest_92 +PASS subtest_93 +PASS subtest_94 +FAIL subtest_95 assert_true: expected true got false +FAIL subtest_96 assert_true: expected true got false +FAIL subtest_97 assert_true: expected true got false +FAIL subtest_98 assert_true: expected true got false +FAIL subtest_99 assert_true: expected true got false +FAIL subtest_100 assert_true: expected true got false +FAIL subtest_101 assert_true: expected true got false +FAIL subtest_102 assert_true: expected true got false +PASS subtest_103 +PASS subtest_104 +PASS subtest_105 +PASS subtest_106 +PASS subtest_107 +PASS subtest_108 +PASS subtest_109 +PASS subtest_110 +PASS subtest_111 +PASS subtest_112 +PASS subtest_113 +PASS subtest_114 +PASS subtest_115 +PASS subtest_116 +PASS subtest_117 +PASS subtest_118 +PASS subtest_119 +PASS subtest_120 +PASS subtest_121 +PASS subtest_122 +PASS subtest_123 +PASS subtest_124 +PASS subtest_125 +PASS subtest_126 +PASS subtest_127 +FAIL subtest_128 assert_true: expected true got false +FAIL subtest_129 assert_true: expected true got false +FAIL subtest_130 assert_true: expected true got false +FAIL subtest_131 assert_true: expected true got false +FAIL subtest_132 assert_true: expected true got false +FAIL subtest_133 assert_true: expected true got false +FAIL subtest_134 assert_true: expected true got false +FAIL subtest_135 assert_true: expected true got false +PASS subtest_136 +PASS subtest_137 +PASS subtest_138 +PASS subtest_139 +PASS subtest_140 +PASS subtest_141 +PASS subtest_142 +FAIL subtest_143 assert_true: expected true got false +FAIL subtest_144 assert_true: expected true got false +FAIL subtest_145 assert_true: expected true got false +FAIL subtest_146 assert_true: expected true got false +FAIL subtest_147 assert_true: expected true got false +FAIL subtest_148 assert_true: expected true got false +FAIL subtest_149 assert_true: expected true got false +FAIL subtest_150 assert_true: expected true got false +PASS subtest_151 +PASS subtest_152 +PASS subtest_153 +PASS subtest_154 +PASS subtest_155 +PASS subtest_156 +PASS subtest_157 +PASS subtest_158 +FAIL subtest_159 assert_true: expected true got false +FAIL subtest_160 assert_true: expected true got false +FAIL subtest_161 assert_true: expected true got false +FAIL subtest_162 assert_true: expected true got false +FAIL subtest_163 assert_true: expected true got false +FAIL subtest_164 assert_true: expected true got false +FAIL subtest_165 assert_true: expected true got false +FAIL subtest_166 assert_true: expected true got false +PASS subtest_167 +PASS subtest_168 +PASS subtest_169 +PASS subtest_170 +PASS subtest_171 +PASS subtest_172 +PASS subtest_173 +FAIL subtest_174 assert_true: expected true got false +FAIL subtest_175 assert_true: expected true got false +FAIL subtest_176 assert_true: expected true got false +FAIL subtest_177 assert_true: expected true got false +FAIL subtest_178 assert_true: expected true got false +FAIL subtest_179 assert_true: expected true got false +FAIL subtest_180 assert_true: expected true got false +FAIL subtest_181 assert_true: expected true got false +PASS subtest_182 +PASS subtest_183 +PASS subtest_184 +PASS subtest_185 +PASS subtest_186 +PASS subtest_187 +PASS subtest_188 +PASS subtest_189 +FAIL subtest_190 assert_true: expected true got false +FAIL subtest_191 assert_true: expected true got false +FAIL subtest_192 assert_true: expected true got false +FAIL subtest_193 assert_true: expected true got false +FAIL subtest_194 assert_true: expected true got false +FAIL subtest_195 assert_true: expected true got false +FAIL subtest_196 assert_true: expected true got false +FAIL subtest_197 assert_true: expected true got false +PASS subtest_198 +PASS subtest_199 +PASS subtest_200 +PASS subtest_201 +PASS subtest_202 +PASS subtest_203 +PASS subtest_204 +PASS subtest_205 +PASS subtest_206 +PASS subtest_207 +PASS subtest_208 +PASS subtest_209 +PASS subtest_210 +PASS subtest_211 +PASS subtest_212 +PASS subtest_213 +PASS subtest_214 +PASS subtest_215 +PASS subtest_216 +PASS subtest_217 +PASS subtest_218 +PASS subtest_219 +PASS subtest_220 +PASS subtest_221 +PASS subtest_222 +FAIL subtest_223 assert_true: expected true got false +FAIL subtest_224 assert_true: expected true got false +FAIL subtest_225 assert_true: expected true got false +FAIL subtest_226 assert_true: expected true got false +FAIL subtest_227 assert_true: expected true got false +FAIL subtest_228 assert_true: expected true got false +FAIL subtest_229 assert_true: expected true got false +FAIL subtest_230 assert_true: expected true got false +PASS subtest_231 +PASS subtest_232 +PASS subtest_233 +PASS subtest_234 +PASS subtest_235 +PASS subtest_236 +PASS subtest_237 +FAIL subtest_238 assert_true: expected true got false +FAIL subtest_239 assert_true: expected true got false +FAIL subtest_240 assert_true: expected true got false +FAIL subtest_241 assert_true: expected true got false +FAIL subtest_242 assert_true: expected true got false +FAIL subtest_243 assert_true: expected true got false +FAIL subtest_244 assert_true: expected true got false +FAIL subtest_245 assert_true: expected true got false +PASS subtest_246 +PASS subtest_247 +PASS subtest_248 +PASS subtest_249 +PASS subtest_250 +PASS subtest_251 +PASS subtest_252 +PASS subtest_253 +FAIL subtest_254 assert_true: expected true got false +FAIL subtest_255 assert_true: expected true got false +FAIL subtest_256 assert_true: expected true got false +FAIL subtest_257 assert_true: expected true got false +FAIL subtest_258 assert_true: expected true got false +FAIL subtest_259 assert_true: expected true got false +FAIL subtest_260 assert_true: expected true got false +FAIL subtest_261 assert_true: expected true got false +PASS subtest_262 +PASS subtest_263 +PASS subtest_264 +PASS subtest_265 +PASS subtest_266 +PASS subtest_267 +PASS subtest_268 +FAIL subtest_269 assert_true: expected true got false +FAIL subtest_270 assert_true: expected true got false +FAIL subtest_271 assert_true: expected true got false +FAIL subtest_272 assert_true: expected true got false +FAIL subtest_273 assert_true: expected true got false +FAIL subtest_274 assert_true: expected true got false +FAIL subtest_275 assert_true: expected true got false +FAIL subtest_276 assert_true: expected true got false +PASS subtest_277 +PASS subtest_278 +PASS subtest_279 +PASS subtest_280 +PASS subtest_281 +PASS subtest_282 +PASS subtest_283 +PASS subtest_284 +FAIL subtest_285 assert_true: expected true got false +FAIL subtest_286 assert_true: expected true got false +FAIL subtest_287 assert_true: expected true got false +FAIL subtest_288 assert_true: expected true got false +FAIL subtest_289 assert_true: expected true got false +FAIL subtest_290 assert_true: expected true got false +FAIL subtest_291 assert_true: expected true got false +FAIL subtest_292 assert_true: expected true got false +PASS subtest_293 +PASS subtest_294 +PASS subtest_295 +PASS subtest_296 +PASS subtest_297 +PASS subtest_298 +PASS subtest_299 +PASS subtest_300 +PASS subtest_301 +PASS subtest_302 +PASS subtest_303 +PASS subtest_304 +PASS subtest_305 +PASS subtest_306 +PASS subtest_307 +PASS subtest_308 +PASS subtest_309 +PASS subtest_310 +PASS subtest_311 +PASS subtest_312 +PASS subtest_313 +PASS subtest_314 +PASS subtest_315 +PASS subtest_316 +PASS subtest_317 +FAIL subtest_318 assert_true: expected true got false +FAIL subtest_319 assert_true: expected true got false +FAIL subtest_320 assert_true: expected true got false +FAIL subtest_321 assert_true: expected true got false +FAIL subtest_322 assert_true: expected true got false +FAIL subtest_323 assert_true: expected true got false +FAIL subtest_324 assert_true: expected true got false +FAIL subtest_325 assert_true: expected true got false +PASS subtest_326 +PASS subtest_327 +PASS subtest_328 +PASS subtest_329 +PASS subtest_330 +PASS subtest_331 +PASS subtest_332 +FAIL subtest_333 assert_true: expected true got false +FAIL subtest_334 assert_true: expected true got false +FAIL subtest_335 assert_true: expected true got false +FAIL subtest_336 assert_true: expected true got false +FAIL subtest_337 assert_true: expected true got false +FAIL subtest_338 assert_true: expected true got false +FAIL subtest_339 assert_true: expected true got false +FAIL subtest_340 assert_true: expected true got false +PASS subtest_341 +PASS subtest_342 +PASS subtest_343 +PASS subtest_344 +PASS subtest_345 +PASS subtest_346 +PASS subtest_347 +PASS subtest_348 +FAIL subtest_349 assert_true: expected true got false +FAIL subtest_350 assert_true: expected true got false +FAIL subtest_351 assert_true: expected true got false +FAIL subtest_352 assert_true: expected true got false +FAIL subtest_353 assert_true: expected true got false +FAIL subtest_354 assert_true: expected true got false +FAIL subtest_355 assert_true: expected true got false +FAIL subtest_356 assert_true: expected true got false +PASS subtest_357 +PASS subtest_358 +PASS subtest_359 +PASS subtest_360 +PASS subtest_361 +PASS subtest_362 +PASS subtest_363 +FAIL subtest_364 assert_true: expected true got false +FAIL subtest_365 assert_true: expected true got false +FAIL subtest_366 assert_true: expected true got false +FAIL subtest_367 assert_true: expected true got false +FAIL subtest_368 assert_true: expected true got false +FAIL subtest_369 assert_true: expected true got false +FAIL subtest_370 assert_true: expected true got false +FAIL subtest_371 assert_true: expected true got false +PASS subtest_372 +PASS subtest_373 +PASS subtest_374 +PASS subtest_375 +PASS subtest_376 +PASS subtest_377 +PASS subtest_378 +PASS subtest_379 +FAIL subtest_380 assert_true: expected true got false +FAIL subtest_381 assert_true: expected true got false +FAIL subtest_382 assert_true: expected true got false +FAIL subtest_383 assert_true: expected true got false +FAIL subtest_384 assert_true: expected true got false +FAIL subtest_385 assert_true: expected true got false +FAIL subtest_386 assert_true: expected true got false +FAIL subtest_387 assert_true: expected true got false +PASS subtest_388 +PASS subtest_389 +PASS subtest_390 +PASS subtest_391 +PASS subtest_392 +PASS subtest_393 +PASS subtest_394 +PASS subtest_395: all and (width: 117px) should apply +FAIL subtest_396: all and (width = 117px) should apply assert_true: expected true got false +PASS subtest_397: all and (width: 118px) should not apply +PASS subtest_398: all and (width: 116px) should not apply +PASS subtest_399: all and (width = 118px) should not apply +PASS subtest_400: all and (width = 116px) should not apply +PASS subtest_401: all and (min-width: 117px) should apply +PASS subtest_402: all and (min-width: 118px) should not apply +PASS subtest_403: all and (min-width: 116px) should apply +PASS subtest_404: all and (max-width: 117px) should apply +PASS subtest_405: all and (max-width: 118px) should apply +PASS subtest_406: all and (max-width: 116px) should not apply +PASS subtest_407: all and (min-width: 9em) should not apply +PASS subtest_408: all and (min-width: 6em) should apply +PASS subtest_409: all and (max-width: 9em) should apply +PASS subtest_410: all and (max-width: 6em) should not apply +FAIL subtest_411: (width <= 117px) should apply assert_true: expected true got false +FAIL subtest_412: (width >= 117px) should apply assert_true: expected true got false +PASS subtest_413: (width < 117px) should not apply +PASS subtest_414: (width > 117px) should not apply +FAIL subtest_415: (width < 118px) should apply assert_true: expected true got false +FAIL subtest_416: (width <= 118px) should apply assert_true: expected true got false +PASS subtest_417: (width > 118px) should not apply +PASS subtest_418: (width >= 118px) should not apply +FAIL subtest_419: (width > 116px) should apply assert_true: expected true got false +FAIL subtest_420: (width >= 116px) should apply assert_true: expected true got false +PASS subtest_421: (width < 116px) should not apply +PASS subtest_422: (width <= 116px) should not apply +PASS subtest_423: all and (height: 76px) should apply +FAIL subtest_424: all and (height = 76px) should apply assert_true: expected true got false +PASS subtest_425: all and (height: 77px) should not apply +PASS subtest_426: all and (height: 75px) should not apply +PASS subtest_427: all and (height = 77px) should not apply +PASS subtest_428: all and (height = 75px) should not apply +PASS subtest_429: all and (min-height: 76px) should apply +PASS subtest_430: all and (min-height: 77px) should not apply +PASS subtest_431: all and (min-height: 75px) should apply +PASS subtest_432: all and (max-height: 76px) should apply +PASS subtest_433: all and (max-height: 77px) should apply +PASS subtest_434: all and (max-height: 75px) should not apply +PASS subtest_435: all and (min-height: 6em) should not apply +PASS subtest_436: all and (min-height: 3em) should apply +PASS subtest_437: all and (max-height: 6em) should apply +PASS subtest_438: all and (max-height: 3em) should not apply +FAIL subtest_439: (height <= 76px) should apply assert_true: expected true got false +FAIL subtest_440: (height >= 76px) should apply assert_true: expected true got false +PASS subtest_441: (height < 76px) should not apply +PASS subtest_442: (height > 76px) should not apply +FAIL subtest_443: (height < 77px) should apply assert_true: expected true got false +FAIL subtest_444: (height <= 77px) should apply assert_true: expected true got false +PASS subtest_445: (height > 77px) should not apply +PASS subtest_446: (height >= 77px) should not apply +FAIL subtest_447: (height > 75px) should apply assert_true: expected true got false +FAIL subtest_448: (height >= 75px) should apply assert_true: expected true got false +PASS subtest_449: (height < 75px) should not apply +PASS subtest_450: (height <= 75px) should not apply +PASS subtest_451: all and (device-width: 1272px) should apply +FAIL subtest_452: all and (device-width = 1272px) should apply assert_true: expected true got false +PASS subtest_453: all and (device-width: 1273px) should not apply +PASS subtest_454: all and (device-width: 1271px) should not apply +PASS subtest_455: all and (device-width = 1273px) should not apply +PASS subtest_456: all and (device-width = 1271px) should not apply +PASS subtest_457: all and (min-device-width: 1272px) should apply +PASS subtest_458: all and (min-device-width: 1273px) should not apply +PASS subtest_459: all and (min-device-width: 1271px) should apply +PASS subtest_460: all and (max-device-width: 1272px) should apply +PASS subtest_461: all and (max-device-width: 1273px) should apply +PASS subtest_462: all and (max-device-width: 1271px) should not apply +PASS subtest_463: all and (min-device-width: 81em) should not apply +PASS subtest_464: all and (min-device-width: 78em) should apply +PASS subtest_465: all and (max-device-width: 81em) should apply +PASS subtest_466: all and (max-device-width: 78em) should not apply +FAIL subtest_467: (device-width <= 1272px) should apply assert_true: expected true got false +FAIL subtest_468: (device-width >= 1272px) should apply assert_true: expected true got false +PASS subtest_469: (device-width < 1272px) should not apply +PASS subtest_470: (device-width > 1272px) should not apply +FAIL subtest_471: (device-width < 1273px) should apply assert_true: expected true got false +FAIL subtest_472: (device-width <= 1273px) should apply assert_true: expected true got false +PASS subtest_473: (device-width > 1273px) should not apply +PASS subtest_474: (device-width >= 1273px) should not apply +FAIL subtest_475: (device-width > 1271px) should apply assert_true: expected true got false +FAIL subtest_476: (device-width >= 1271px) should apply assert_true: expected true got false +PASS subtest_477: (device-width < 1271px) should not apply +PASS subtest_478: (device-width <= 1271px) should not apply +PASS subtest_479: all and (device-height: 855px) should apply +FAIL subtest_480: all and (device-height = 855px) should apply assert_true: expected true got false +PASS subtest_481: all and (device-height: 856px) should not apply +PASS subtest_482: all and (device-height: 854px) should not apply +PASS subtest_483: all and (device-height = 856px) should not apply +PASS subtest_484: all and (device-height = 854px) should not apply +PASS subtest_485: all and (min-device-height: 855px) should apply +PASS subtest_486: all and (min-device-height: 856px) should not apply +PASS subtest_487: all and (min-device-height: 854px) should apply +PASS subtest_488: all and (max-device-height: 855px) should apply +PASS subtest_489: all and (max-device-height: 856px) should apply +PASS subtest_490: all and (max-device-height: 854px) should not apply +PASS subtest_491: all and (min-device-height: 55em) should not apply +PASS subtest_492: all and (min-device-height: 52em) should apply +PASS subtest_493: all and (max-device-height: 55em) should apply +PASS subtest_494: all and (max-device-height: 52em) should not apply +FAIL subtest_495: (device-height <= 855px) should apply assert_true: expected true got false +FAIL subtest_496: (device-height >= 855px) should apply assert_true: expected true got false +PASS subtest_497: (device-height < 855px) should not apply +PASS subtest_498: (device-height > 855px) should not apply +FAIL subtest_499: (device-height < 856px) should apply assert_true: expected true got false +FAIL subtest_500: (device-height <= 856px) should apply assert_true: expected true got false +PASS subtest_501: (device-height > 856px) should not apply +PASS subtest_502: (device-height >= 856px) should not apply +FAIL subtest_503: (device-height > 854px) should apply assert_true: expected true got false +FAIL subtest_504: (device-height >= 854px) should apply assert_true: expected true got false +PASS subtest_505: (device-height < 854px) should not apply +PASS subtest_506: (device-height <= 854px) should not apply +PASS subtest_507: all and (height) should apply +PASS subtest_508: all and (width) should not apply +PASS subtest_509: all and (height) should not apply +PASS subtest_510: all and (width) should not apply +PASS subtest_511: all and (device-height) should apply +PASS subtest_512: all and (device-width) should apply +PASS subtest_513: all and (height) should not apply +PASS subtest_514: all and (width) should apply +PASS subtest_515: all and (height) should apply +PASS subtest_516: all and (width) should apply +PASS subtest_517 +PASS subtest_518 +PASS subtest_519 +PASS subtest_520 +PASS subtest_521 +PASS subtest_522 +PASS subtest_523 +PASS subtest_524 +PASS subtest_525 +PASS subtest_526: (orientation) should apply +PASS subtest_527: (orientation: landscape) should apply +PASS subtest_528: (orientation: portrait) should not apply +PASS subtest_529: not all and (orientation: portrait) should apply +PASS subtest_530: (orientation) should apply +PASS subtest_531: (orientation: landscape) should not apply +PASS subtest_532: not all and (orientation: landscape) should apply +PASS subtest_533: (orientation: portrait) should apply +PASS subtest_534: (aspect-ratio: 59/80) should apply +PASS subtest_535: (aspect-ratio: 58/80) should not apply +PASS subtest_536: (aspect-ratio: 59/81) should not apply +PASS subtest_537: (aspect-ratio: 60/80) should not apply +PASS subtest_538: (aspect-ratio: 59/79) should not apply +PASS subtest_539: (aspect-ratio: 177/240) should apply +PASS subtest_540: (aspect-ratio: 413/560) should apply +PASS subtest_541: (aspect-ratio: 5900/8000) should apply +PASS subtest_542: (aspect-ratio: 5901/8000) should not apply +PASS subtest_543: (aspect-ratio: 5899/8000) should not apply +PASS subtest_544: (aspect-ratio: 5900/8001) should not apply +PASS subtest_545: (aspect-ratio: 5900/7999) should not apply +PASS subtest_546: (aspect-ratio) should apply +PASS subtest_547: (min-aspect-ratio: 59/80) should apply +PASS subtest_548: (min-aspect-ratio: 58/80) should apply +PASS subtest_549: (min-aspect-ratio: 59/81) should apply +PASS subtest_550: (min-aspect-ratio: 60/80) should not apply +PASS subtest_551: (min-aspect-ratio: 59/79) should not apply +PASS subtest_552 +PASS subtest_553: (max-aspect-ratio: 59/80) should apply +PASS subtest_554: (max-aspect-ratio: 58/80) should not apply +PASS subtest_555: (max-aspect-ratio: 59/81) should not apply +PASS subtest_556: (max-aspect-ratio: 60/80) should apply +PASS subtest_557: (max-aspect-ratio: 59/79) should apply +PASS subtest_558 +PASS subtest_559: (device-aspect-ratio: 1272/855) should apply +PASS subtest_560: not all and (device-aspect-ratio: 1273/855) should apply +PASS subtest_561: all and (device-aspect-ratio: 1272/854) should not apply +PASS subtest_562: all and (device-aspect-ratio: 1271/855) should not apply +PASS subtest_563: not all and (device-aspect-ratio: 1272/856) should apply +PASS subtest_564: (device-aspect-ratio) should apply +PASS subtest_565: (min-device-aspect-ratio: 1272/855) should apply +PASS subtest_566: all and (min-device-aspect-ratio: 1273/855) should not apply +PASS subtest_567: not all and (min-device-aspect-ratio: 1272/854) should apply +PASS subtest_568: not all and (min-device-aspect-ratio: 1271/855) should not apply +PASS subtest_569: all and (min-device-aspect-ratio: 1272/856) should apply +PASS subtest_570 +PASS subtest_571: all and (max-device-aspect-ratio: 1272/855) should apply +PASS subtest_572: (max-device-aspect-ratio: 1273/855) should apply +PASS subtest_573: (max-device-aspect-ratio: 1272/854) should apply +PASS subtest_574: all and (max-device-aspect-ratio: 1271/855) should not apply +PASS subtest_575: not all and (max-device-aspect-ratio: 1272/856) should apply +PASS subtest_576 +PASS subtest_577 +PASS subtest_578 +PASS subtest_579 +PASS subtest_580 +FAIL subtest_581 assert_true: expected true got false +FAIL subtest_582 assert_true: expected true got false +FAIL subtest_583 assert_true: expected true got false +FAIL subtest_584 assert_true: expected true got false +FAIL subtest_585 assert_true: expected true got false +FAIL subtest_586 assert_true: expected true got false +FAIL subtest_587 assert_true: expected true got false +FAIL subtest_588 assert_true: expected true got false +PASS subtest_589 +PASS subtest_590 +PASS subtest_591 +PASS subtest_592 +PASS subtest_593 +PASS subtest_594 +PASS subtest_595 +PASS subtest_596 +PASS subtest_597 +PASS subtest_598 +PASS subtest_599 +PASS subtest_600 +FAIL subtest_601 assert_true: expected true got false +FAIL subtest_602 assert_true: expected true got false +FAIL subtest_603 assert_true: expected true got false +FAIL subtest_604 assert_true: expected true got false +FAIL subtest_605 assert_true: expected true got false +FAIL subtest_606 assert_true: expected true got false +FAIL subtest_607 assert_true: expected true got false +FAIL subtest_608 assert_true: expected true got false +PASS subtest_609 +PASS subtest_610 +PASS subtest_611 +PASS subtest_612 +PASS subtest_613 +PASS subtest_614 +PASS subtest_615 +PASS subtest_616 +PASS monochrome_and_color +PASS find_depth +PASS subtest_617: all and (color:8) should apply +PASS subtest_618: all and (color:7) should not apply +PASS subtest_619: all and (color:9) should not apply +PASS subtest_620: all and (max-color:8) should apply +PASS subtest_621: all and (max-color:7) should not apply +PASS subtest_622: all and (max-color:9) should apply +PASS subtest_623: all and (color) should apply +PASS subtest_624 +PASS subtest_625 +PASS subtest_626: all and (monochrome) should not apply +PASS subtest_627 +PASS subtest_628 +PASS subtest_629: not all and (monochrome) should apply +PASS subtest_630: not all and (color) should not apply +PASS subtest_631: only all and (color) should apply +PASS subtest_632: only all and (monochrome) should not apply +PASS subtest_633 +PASS subtest_634 +PASS subtest_635 +PASS subtest_636 +PASS subtest_637 +PASS subtest_638 +PASS subtest_639 +PASS subtest_640 +PASS subtest_641 +PASS subtest_642 +PASS subtest_643 +PASS subtest_644 +PASS subtest_645 +PASS subtest_646 +PASS subtest_647 +PASS subtest_648 +PASS subtest_649 +PASS subtest_650 +PASS subtest_651: (color-index: 0) should apply +PASS subtest_652: (color-index: 1) should not apply +PASS subtest_653: (min-color-index: 0) should apply +PASS subtest_654: (min-color-index: 1) should not apply +PASS subtest_655: (max-color-index: 0) should apply +PASS subtest_656: (max-color-index: 1) should apply +PASS subtest_657: (max-color-index: 157) should apply +PASS subtest_658 +PASS subtest_659 +PASS subtest_660 +PASS subtest_661 +PASS subtest_662 +PASS subtest_663 +PASS subtest_664 +PASS subtest_665 +PASS subtest_666 +PASS subtest_667 +PASS subtest_668 +PASS subtest_669 +PASS subtest_670 +PASS subtest_671 +PASS subtest_672 +PASS subtest_673 +PASS subtest_674 +PASS subtest_675 +PASS subtest_676 +PASS subtest_677 +PASS subtest_678 +PASS subtest_679 +PASS subtest_680 +PASS subtest_681 +PASS subtest_682 +PASS subtest_683 +PASS subtest_684 +PASS subtest_685 +PASS subtest_686 +PASS subtest_687 +PASS subtest_688 +PASS subtest_689 +PASS subtest_690 +PASS subtest_691 +PASS subtest_692 +PASS subtest_693 +PASS subtest_694 +PASS subtest_695 +PASS subtest_696 +PASS subtest_697 +PASS subtest_698 +PASS subtest_699 +PASS find_resolution +PASS subtest_700: (resolution: 96dpi) should apply +PASS subtest_701: (resolution: 1dppx) should apply +PASS subtest_702: (resolution: 1x) should apply +PASS subtest_703: (resolution: 97dpi) should not apply +PASS subtest_704: (resolution: 95dpi) should not apply +PASS subtest_705: (min-resolution: 95dpi) should apply +PASS subtest_706: not all and (min-resolution: 95dpi) should not apply +PASS subtest_707: not all and (min-resolution: 97dpi) should apply +PASS subtest_708: all and (min-resolution: 97dpi) should not apply +PASS subtest_709: (min-resolution: 37dpcm) should apply +PASS subtest_710: (max-resolution: 39dpcm) should apply +PASS subtest_711: (max-resolution: 37dpcm) should not apply +PASS subtest_712: not all and (min-resolution: 39dpcm) should apply +PASS subtest_713 +PASS subtest_714 +PASS subtest_715 +PASS subtest_716 +PASS subtest_717 +PASS subtest_718 +PASS subtest_719 +PASS subtest_720: (scan) should not apply +PASS subtest_721: (scan: progressive) should not apply +PASS subtest_722: (scan: interlace) should not apply +PASS subtest_723: not all and (scan) should apply +PASS subtest_724: not all and (scan: progressive) should apply +PASS subtest_725: not all and (scan: interlace) should apply +PASS subtest_726 +PASS subtest_727 +PASS subtest_728 +PASS subtest_729 +PASS subtest_730 +PASS subtest_731 +PASS subtest_732 +PASS subtest_733 +PASS subtest_734 +PASS subtest_735: (grid) should not apply +PASS subtest_736: (grid: 0) should apply +PASS subtest_737: (grid: 1) should not apply +PASS subtest_738: (grid: 2) should not apply +PASS subtest_739: (grid: -1) should not apply +PASS subtest_740: (orientation should apply +PASS subtest_741: not all and (orientation should not apply +PASS subtest_742: (orientation: should not apply +PASS subtest_743: (orientation:) should not apply +PASS subtest_744: (orientation: ) should not apply +PASS subtest_745: all,(orientation: should apply +PASS subtest_746: (orientation:,all should not apply +PASS subtest_747: not all and (grid should apply +PASS subtest_748: only all and (grid should not apply +PASS subtest_749: (grid should not apply +PASS subtest_750: all,(grid should apply +PASS subtest_751: (grid,all should not apply +PASS subtest_752: ,all should apply +PASS subtest_753: all, should apply +PASS subtest_754: ,all, should apply +PASS subtest_755: all,badmedium should apply +PASS subtest_756: badmedium,all should apply +PASS subtest_757: ,badmedium, should not apply +PASS subtest_758: all,(badexpression) should apply +PASS subtest_759: (badexpression),all should apply +PASS subtest_760: (badexpression),badmedium should not apply +PASS subtest_761: badmedium,(badexpression) should not apply +PASS subtest_762: all,[badsyntax] should apply +PASS subtest_763: [badsyntax],all should apply +PASS subtest_764: badmedium,[badsyntax] should not apply +PASS subtest_765: [badsyntax],badmedium should not apply +PASS subtest_766 +PASS subtest_767 +PASS subtest_768: all and min-color : 1 should not apply +PASS subtest_769: (bogus) should not apply +PASS subtest_770: not all and (bogus) should not apply +PASS subtest_771: only all and (bogus) should not apply +FAIL subtest_772 assert_true: expected true got false +FAIL subtest_773 assert_true: expected true got false +FAIL subtest_774 assert_true: expected true got false +FAIL subtest_775 assert_true: expected true got false +FAIL subtest_776 assert_true: expected true got false +PASS subtest_777 +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/win7/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png b/third_party/blink/web_tests/platform/win7/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png deleted file mode 100644 index 5f6514fa..0000000 --- a/third_party/blink/web_tests/platform/win7/virtual/gpu-rasterization/images/cross-fade-overflow-position-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/blink/web_tests/platform/win7/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png deleted file mode 100644 index 470cb20..0000000 --- a/third_party/blink/web_tests/platform/win7/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png b/third_party/blink/web_tests/platform/win7/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png deleted file mode 100644 index 55e7b29..0000000 --- a/third_party/blink/web_tests/platform/win7/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png b/third_party/blink/web_tests/platform/win7/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png deleted file mode 100644 index 40566c28..0000000 --- a/third_party/blink/web_tests/platform/win7/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/resources/gesture-util.js b/third_party/blink/web_tests/resources/gesture-util.js index 9d29dc2..31b60b0 100644 --- a/third_party/blink/web_tests/resources/gesture-util.js +++ b/third_party/blink/web_tests/resources/gesture-util.js
@@ -150,16 +150,29 @@ }) } -function waitForScrollEvent(eventTarget) { +function waitForEvent(eventTarget, eventName, timeoutMs = 1000) { return new Promise((resolve, reject) => { - const scrollListener = () => { - eventTarget.removeEventListener('scroll', scrollListener); - resolve(); + const eventListener = (evt) => { + clearTimeout(timeout); + eventTarget.removeEventListener(eventName, eventListener); + resolve(evt); }; - eventTarget.addEventListener('scroll', scrollListener); + let timeout = setTimeout(() => { + eventTarget.removeEventListener(eventName, eventListener); + reject(`Timeout waiting for ${eventName} event`); + }, timeoutMs); + eventTarget.addEventListener(eventName, eventListener); }); } +function waitForScrollEvent(eventTarget, timeoutMs = 1000) { + return waitForEvent(eventTarget, 'scroll', timeoutMs); +} + +function waitForScrollendEvent(eventTarget, timeoutMs = 1000) { + return waitForEvent(eventTarget, 'scrollend', timeoutMs); +} + // Event driven scroll promise. This method has the advantage over timing // methods, as it is more forgiving to delays in event dispatch or between // chained smooth scrolls. It has an additional advantage of completing sooner
diff --git a/third_party/blink/web_tests/shadow-dom/crashes/imperative-api.html b/third_party/blink/web_tests/shadow-dom/crashes/imperative-api.html index f5445793..f16c05e 100644 --- a/third_party/blink/web_tests/shadow-dom/crashes/imperative-api.html +++ b/third_party/blink/web_tests/shadow-dom/crashes/imperative-api.html
@@ -19,8 +19,8 @@ shadow_root.appendChild(slot2); test(() => { - slot2.assign([child1]); - slot1.assign([child1]); + slot2.assign(child1); + slot1.assign(child1); slot1.remove(); slot2.remove();
diff --git a/third_party/blink/web_tests/shadow-dom/imperative-apis/custom-detail-summary.js b/third_party/blink/web_tests/shadow-dom/imperative-apis/custom-detail-summary.js index 734a3c5..66c9466 100644 --- a/third_party/blink/web_tests/shadow-dom/imperative-apis/custom-detail-summary.js +++ b/third_party/blink/web_tests/shadow-dom/imperative-apis/custom-detail-summary.js
@@ -27,13 +27,13 @@ slot2.style.display = "block"; child2.innerHTML = "▾ "; child1.innerText = ""; - slot2.assign(target.childNodes); + slot2.assign(...target.childNodes); }); child2.addEventListener('click', (e) => { slot2.style.display = "none"; child1.innerHTML = "▸ "; child2.innerText = ""; - slot1.assign([child1,child2, target.querySelector(':scope > my-summary')]); + slot1.assign(child1,child2, target.querySelector(':scope > my-summary')); }); const shadowRoot = target.shadowRoot; shadowRoot.appendChild(slot1); @@ -43,9 +43,9 @@ //Get the first <my-summary> element from <my-detail>'s direct children const my_summary = target.querySelector(':scope > my-summary'); if (my_summary) { - slot1.assign([child1,child2,my_summary]); + slot1.assign(child1,child2,my_summary); } else { - slot1.assign([child1,child2]); + slot1.assign(child1,child2); } }); observer.observe(this, {childList: true});
diff --git a/third_party/blink/web_tests/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png b/third_party/blink/web_tests/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png deleted file mode 100644 index d67d3cb..0000000 --- a/third_party/blink/web_tests/virtual/gpu/fast/canvas/canvas-drawImage-video-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png b/third_party/blink/web_tests/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png deleted file mode 100644 index d67d3cb..0000000 --- a/third_party/blink/web_tests/virtual/gpu/fast/canvas/canvas-drawImage-video-reset-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/effect-reference-hidpi-hw-expected.png b/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/effect-reference-hidpi-hw-expected.png new file mode 100644 index 0000000..10c080f --- /dev/null +++ b/third_party/blink/web_tests/virtual/scalefactor200/css3/filters/effect-reference-hidpi-hw-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/pixelated-expected.png b/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/pixelated-expected.png new file mode 100644 index 0000000..791a4cf --- /dev/null +++ b/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/pixelated-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-expected.png b/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-expected.png new file mode 100644 index 0000000..d8d3ac81 --- /dev/null +++ b/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-repaint-expected.png b/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-repaint-expected.png new file mode 100644 index 0000000..c5d6b655 --- /dev/null +++ b/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-repaint-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-tabswitching-expected.png b/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-tabswitching-expected.png new file mode 100644 index 0000000..6f0d4ea --- /dev/null +++ b/third_party/blink/web_tests/virtual/shared_array_buffer_on_desktop/fast/webgl/webgl-composite-modes-tabswitching-expected.png Binary files differ
diff --git a/third_party/closure_compiler/externs/accessibility_private.js b/third_party/closure_compiler/externs/accessibility_private.js index 98ad90e6..16a3c1f9 100644 --- a/third_party/closure_compiler/externs/accessibility_private.js +++ b/third_party/closure_compiler/externs/accessibility_private.js
@@ -555,3 +555,9 @@ * @type {!ChromeEvent} */ chrome.accessibilityPrivate.onCustomSpokenFeedbackToggled; + +/** + * Fired when ChromeVox should show its tutorial + * @type {!ChromeEvent} + */ +chrome.accessibilityPrivate.onShowChromeVoxTutorial;
diff --git a/third_party/libxslt/README.chromium b/third_party/libxslt/README.chromium index 44d1d95..67b8197 100644 --- a/third_party/libxslt/README.chromium +++ b/third_party/libxslt/README.chromium
@@ -1,6 +1,6 @@ Name: libxslt URL: http://xmlsoft.org/XSLT -Version: 7238299d64847e44bfe92170af1c7c57e26d469a +Version: 5430f5d7bf030d6de49be33ce3b9c0a43d035b39 CPEPrefix: cpe:/a:xmlsoft:libxslt:1.1.34 Security Critical: yes License: MIT
diff --git a/third_party/libxslt/mac/config.h b/third_party/libxslt/mac/config.h index b756b61..6e0d655b 100644 --- a/third_party/libxslt/mac/config.h +++ b/third_party/libxslt/mac/config.h
@@ -61,8 +61,8 @@ /* Define to 1 if you have the <math.h> header file. */ #define HAVE_MATH_H 1 -/* Define to 1 if you have the <memory.h> header file. */ -#define HAVE_MEMORY_H 1 +/* Define to 1 if you have the <minix/config.h> header file. */ +/* #undef HAVE_MINIX_CONFIG_H */ /* Define to 1 if you have the <nan.h> header file. */ /* #undef HAVE_NAN_H */ @@ -94,6 +94,9 @@ /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 +/* Define to 1 if you have the <stdio.h> header file. */ +#define HAVE_STDIO_H 1 + /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 @@ -139,6 +142,9 @@ /* Define to 1 if you have the `vsprintf' function. */ #define HAVE_VSPRINTF 1 +/* Define to 1 if you have the <wchar.h> header file. */ +#define HAVE_WCHAR_H 1 + /* Define to 1 if you have the <xlocale.h> header file. */ #define HAVE_XLOCALE_H 1 @@ -169,28 +175,96 @@ /* Define to the version of this package. */ #define PACKAGE_VERSION "1.1.34" -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #define STDC_HEADERS 1 /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 #endif +/* Enable general extensions on macOS. */ +#ifndef _DARWIN_C_SOURCE +# define _DARWIN_C_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif -/* Enable threading extensions on Solaris. */ +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# define _HPUX_ALT_XOPEN_SOCKET_API 1 +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +/* # undef _MINIX */ +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ +#ifndef _NETBSD_SOURCE +# define _NETBSD_SOURCE 1 +#endif +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ +#ifndef _OPENBSD_SOURCE +# define _OPENBSD_SOURCE 1 +#endif +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +/* # undef _POSIX_SOURCE */ +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +/* # undef _POSIX_1_SOURCE */ +#endif +/* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # define _POSIX_PTHREAD_SEMANTICS 1 #endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# define __STDC_WANT_IEC_60559_BFP_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# define __STDC_WANT_IEC_60559_DFP_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1 +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# define __STDC_WANT_LIB_EXT2__ 1 +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# define __STDC_WANT_MATH_SPEC_FUNCS__ 1 +#endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # define _TANDEM_SOURCE 1 #endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# define __EXTENSIONS__ 1 +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ +#ifndef _XOPEN_SOURCE +/* # undef _XOPEN_SOURCE */ #endif @@ -202,13 +276,3 @@ /* Define if profiling support is enabled */ #define WITH_PROFILER /**/ - -/* Define to 1 if on MINIX. */ -/* #undef _MINIX */ - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -/* #undef _POSIX_1_SOURCE */ - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -/* #undef _POSIX_SOURCE */
diff --git a/third_party/libxslt/src/CMakeLists.txt b/third_party/libxslt/src/CMakeLists.txt index 7d990784..541cbc5 100644 --- a/third_party/libxslt/src/CMakeLists.txt +++ b/third_party/libxslt/src/CMakeLists.txt
@@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.15) -project(libxslt1 C) +project(libxslt1 VERSION 1.1.34 LANGUAGES C) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) @@ -8,28 +8,10 @@ include(CheckFunctionExists) include(CheckIncludeFiles) include(CheckLibraryExists) +include(CheckSymbolExists) include(CMakePackageConfigHelpers) include(GNUInstallDirs) -set(LIBEXSLT_MAJOR_VERSION 0) -set(LIBEXSLT_MINOR_VERSION 8) -set(LIBEXSLT_MICRO_VERSION 20) - -set(LIBEXSLT_DOTTED_VERSION ${LIBEXSLT_MAJOR_VERSION}.${LIBEXSLT_MINOR_VERSION}.${LIBEXSLT_MICRO_VERSION}) -math(EXPR LIBEXSLT_VERSION_NUMBER "${LIBEXSLT_MAJOR_VERSION} * 10000 + ${LIBEXSLT_MINOR_VERSION} * 100 + ${LIBEXSLT_MICRO_VERSION}") -set(LIBEXSLT_VERSION_EXTRA "") - -set(LIBXSLT_MAJOR_VERSION 1) -set(LIBXSLT_MINOR_VERSION 1) -set(LIBXSLT_MICRO_VERSION 34) - -set(LIBXSLT_DOTTED_VERSION "${LIBXSLT_MAJOR_VERSION}.${LIBXSLT_MINOR_VERSION}.${LIBXSLT_MICRO_VERSION}") -math(EXPR LIBXSLT_VERSION_NUMBER "${LIBXSLT_MAJOR_VERSION} * 10000 + ${LIBXSLT_MINOR_VERSION} * 100 + ${LIBXSLT_MICRO_VERSION}") -set(LIBXSLT_VERSION_EXTRA "") - -set(VERSION ${LIBXSLT_DOTTED_VERSION}) -set(LIBEXSLT_VERSION ${LIBEXSLT_DOTTED_VERSION}) - find_package(LibXml2 CONFIG REQUIRED) option(BUILD_SHARED_LIBS "Build shared libraries" ON) @@ -49,8 +31,17 @@ endif() if(LIBXSLT_WITH_PYTHON) - find_package(Python2 COMPONENTS Interpreter Development REQUIRED) - set(LIBXSLT_PYTHON_INSTALL_DIR ${Python2_SITEARCH} CACHE PATH "Python bindings install directory") + check_include_files(unistd.h HAVE_UNISTD_H) + check_symbol_exists(F_GETFL fcntl.h HAVE_F_GETFL) + if(HAVE_UNISTD_H AND HAVE_F_GETFL) + find_package(Python COMPONENTS Interpreter Development REQUIRED) + else() + find_package(Python2 COMPONENTS Interpreter Development REQUIRED) + add_library(Python::Python ALIAS Python2::Python) + set(Python_EXECUTABLE ${Python2_EXECUTABLE}) + set(Python_SITEARCH ${Python2_SITEARCH}) + endif() + set(LIBXSLT_PYTHON_INSTALL_DIR ${Python_SITEARCH} CACHE PATH "Python bindings install directory") endif() if(LIBXSLT_WITH_THREADS) @@ -65,6 +56,25 @@ endif() endforeach() +set(LIBEXSLT_MAJOR_VERSION 0) +set(LIBEXSLT_MINOR_VERSION 8) +set(LIBEXSLT_MICRO_VERSION 20) + +set(LIBEXSLT_DOTTED_VERSION ${LIBEXSLT_MAJOR_VERSION}.${LIBEXSLT_MINOR_VERSION}.${LIBEXSLT_MICRO_VERSION}) +math(EXPR LIBEXSLT_VERSION_NUMBER "${LIBEXSLT_MAJOR_VERSION} * 10000 + ${LIBEXSLT_MINOR_VERSION} * 100 + ${LIBEXSLT_MICRO_VERSION}") +set(LIBEXSLT_VERSION_EXTRA "") + +set(LIBXSLT_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}) +set(LIBXSLT_MINOR_VERSION ${PROJECT_VERSION_MINOR}) +set(LIBXSLT_MICRO_VERSION ${PROJECT_VERSION_PATCH}) + +set(LIBXSLT_DOTTED_VERSION "${LIBXSLT_MAJOR_VERSION}.${LIBXSLT_MINOR_VERSION}.${LIBXSLT_MICRO_VERSION}") +math(EXPR LIBXSLT_VERSION_NUMBER "${LIBXSLT_MAJOR_VERSION} * 10000 + ${LIBXSLT_MINOR_VERSION} * 100 + ${LIBXSLT_MICRO_VERSION}") +set(LIBXSLT_VERSION_EXTRA "") + +set(VERSION ${LIBXSLT_DOTTED_VERSION}) +set(LIBEXSLT_VERSION ${LIBEXSLT_DOTTED_VERSION}) + set(MODULE_EXTENSION "${CMAKE_SHARED_LIBRARY_SUFFIX}") if(LIBXSLT_WITH_CRYPTO) @@ -230,10 +240,10 @@ OUTPUT_NAME xslt POSITION_INDEPENDENT_CODE ON PREFIX lib - VERSION ${VERSION} + VERSION ${PROJECT_VERSION} ) -if(WIN32) +if(MSVC) if(BUILD_SHARED_LIBS) set_target_properties( LibXslt @@ -315,7 +325,7 @@ VERSION ${LIBEXSLT_VERSION} ) -if(WIN32) +if(MSVC) if(BUILD_SHARED_LIBS) set_target_properties( LibExslt @@ -366,7 +376,7 @@ set(ENV{SRCDIR} ${CMAKE_CURRENT_SOURCE_DIR}/python) execute_process( COMMAND - ${Python2_EXECUTABLE} + ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/python/generator.py ${CMAKE_CURRENT_SOURCE_DIR}/doc/libxslt-api.xml ${CMAKE_CURRENT_SOURCE_DIR}/python/libxslt-python-api.xml @@ -393,14 +403,14 @@ PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/python> ) - target_link_libraries(LibXsltMod LibXslt LibExslt Python2::Python) + target_link_libraries(LibXsltMod LibXslt LibExslt Python::Python) set_target_properties( LibXsltMod PROPERTIES IMPORT_PREFIX lib OUTPUT_NAME xsltmod PREFIX lib - VERSION ${VERSION} + VERSION ${PROJECT_VERSION} ) install( TARGETS LibXsltMod @@ -420,35 +430,35 @@ install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libxslt COMPONENT documentation PATTERN Makefile.* EXCLUDE) if(LIBXSLT_WITH_CRYPTO) - install(FILES FindGcrypt.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${VERSION} COMPONENT development) + install(FILES FindGcrypt.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION} COMPONENT development) endif() configure_package_config_file( libxslt-config.cmake.cmake.in libxslt-config.cmake - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${VERSION} + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION} ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libxslt-config.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${VERSION} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION} COMPONENT development ) write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/libxslt-config-version.cmake - VERSION ${VERSION} + VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libxslt-config-version.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${VERSION} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION} COMPONENT development ) install( EXPORT LibXslt - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${VERSION} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxslt-${PROJECT_VERSION} NAMESPACE LibXslt:: FILE libxslt-export.cmake COMPONENT development
diff --git a/third_party/libxslt/src/libxslt.spec b/third_party/libxslt/src/libxslt.spec index 5311410..17ea441 100644 --- a/third_party/libxslt/src/libxslt.spec +++ b/third_party/libxslt/src/libxslt.spec
@@ -128,5 +128,5 @@ %doc python/tests/*.xsl %changelog -* Mon Feb 1 2021 Daniel Veillard <veillard@redhat.com> +* Mon May 3 2021 Daniel Veillard <veillard@redhat.com> - upstream release 1.1.34 see http://xmlsoft.org/XSLT/news.html
diff --git a/third_party/libxslt/src/libxslt/preproc.c b/third_party/libxslt/src/libxslt/preproc.c index bd654da..7d2fa22 100644 --- a/third_party/libxslt/src/libxslt/preproc.c +++ b/third_party/libxslt/src/libxslt/preproc.c
@@ -1494,6 +1494,8 @@ comp->numdata.groupingCharacterLen = xmlStrlen(prop); comp->numdata.groupingCharacter = xsltGetUTF8Char(prop, &(comp->numdata.groupingCharacterLen)); + if (comp->numdata.groupingCharacter < 0) + comp->numdata.groupingCharacter = 0; } prop = xsltGetCNsProp(style, cur, (const xmlChar *)"grouping-size", XSLT_NAMESPACE);
diff --git a/third_party/libxslt/src/libxslt/xslt.c b/third_party/libxslt/src/libxslt/xslt.c index 7a1ce011..69116f2 100644 --- a/third_party/libxslt/src/libxslt/xslt.c +++ b/third_party/libxslt/src/libxslt/xslt.c
@@ -3656,12 +3656,8 @@ (!xsltCheckExtURI(style, cur->ns->href))) { goto skip_children; } else if (cur->children != NULL) { - if ((cur->children->type != XML_ENTITY_DECL) && - (cur->children->type != XML_ENTITY_REF_NODE) && - (cur->children->type != XML_ENTITY_NODE)) { - cur = cur->children; - continue; - } + cur = cur->children; + continue; } skip_children:
diff --git a/third_party/usrsctp/README.chromium b/third_party/usrsctp/README.chromium index cf4b05b..bd87e34 100644 --- a/third_party/usrsctp/README.chromium +++ b/third_party/usrsctp/README.chromium
@@ -2,8 +2,8 @@ URL: http://github.com/sctplab/usrsctp Version: 0 CPEPrefix: cpe:/a:usrsctp_project:usrsctp:2019-12-20 -Date: Apr 6, 2021 -Revision: 70d42ae95a1de83bd317c8cc9503f894671d1392 +Date: May 3, 2021 +Revision: 0bd8b8110bc1a388649e504de1e673114e91013f License: New BSD License File: LICENSE Security Critical: yes
diff --git a/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml b/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml index 56b88ed..a4be45a 100644 --- a/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml +++ b/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml
@@ -38,7 +38,7 @@ reset. </description> - <interface name="zcr_remote_shell_v1" version="32"> + <interface name="zcr_remote_shell_v1" version="33"> <description summary="remote_shell"> The global interface that allows clients to turn a wl_surface into a "real window" which is remotely managed but can be stacked, activated @@ -212,7 +212,7 @@ <event name="workspace_info" since="20"> <description summary="area of remote shell in pixels"> - Sends display information such as size, work area and its related information. + [Deprecated] Sends display information such as size, work area and its related information. Each series of "workspace_info" events must be terminated by a "configure" event. </description> <arg name="display_id_hi" type="uint"/> @@ -294,7 +294,7 @@ </interface> - <interface name="zcr_remote_surface_v1" version="31"> + <interface name="zcr_remote_surface_v1" version="33"> <description summary="A desktop window"> An interface that may be implemented by a wl_surface, for implementations that provide a desktop-style user interface @@ -757,7 +757,7 @@ <event name="bounds_changed" since="10"> <description summary="The compositor requested to change the bounds"> - The compositor requested to change its + [Deprecated] The compositor requested to change its bounds. "bounds_change_reason" specifies the cause of the bounds change. The client may apply the different move/resize strategy depending on the reason. @@ -1008,7 +1008,7 @@ <request name="set_bounds" since="18"> <description summary="set window bounds"> - Set the "visible bounds" of a window from the user's perspective. + [Deprecated] Set the "visible bounds" of a window from the user's perspective. Client-side decorations often have invisible portions like drop shadows which should be ignored for the purposes of aligning, placing and constraining windows. @@ -1142,6 +1142,61 @@ time wl_surface.commit of the corresponding wl_surface is called. </description> </request> + + <!-- Version 33 additions --> + + <event name="bounds_changed_in_output" since="33"> + <description summary="The compositor requested to change the bounds"> + The compositor requested to change its + bounds. "bounds_change_reason" specifies the cause of the + bounds change. The client may apply the different move/resize + strategy depending on the reason. + + The "output" specifies the wayland output in which the suface should live. + + The client responds with set_window_geometry request, with the + bounds it is resized to (this may be different from the bounds + requested). + + The client may ignore move request depending on the state, + e.g, if it becomes resizable or other constrants. + </description> + <arg name="output" type="object" interface="wl_output" summary="the output"/> + <arg name="x" type="int"/> + <arg name="y" type="int"/> + <arg name="width" type="int"/> + <arg name="height" type="int"/> + <arg name="bounds_change_reason" type="uint"/> + </event> + + <request name="set_bounds_in_output" since="33"> + <description summary="set window bounds"> + Set the "visible bounds" of a window from the user's perspective. + Client-side decorations often have invisible portions like drop shadows + which should be ignored for the purposes of aligning, placing and + constraining windows. + + The bounds are double buffered, and will be applied at the + time wl_surface.commit of the corresponding wl_surface is called. + + Once the bounds are set, it is not possible to unset them, and they will + remain the same until set_bounds is called again, even if a new sub- + surface or buffer is attached. + + If never set, the value is the surface content bounds. This updates + dynamically on every commit. + + The bounds are relative to the given display. If the display is invalid, + they are assumed to be relative to the primary display. + + The width and height must be greater than zero. + </description> + <arg name="output" type="object" interface="wl_output" summary="the output"/> + <arg name="x" type="int"/> + <arg name="y" type="int"/> + <arg name="width" type="int"/> + <arg name="height" type="int"/> + </request> </interface> <interface name="zcr_notification_surface_v1" version="16"> @@ -1166,7 +1221,7 @@ </request> </interface> - <interface name="zcr_input_method_surface_v1" version="18"> + <interface name="zcr_input_method_surface_v1" version="33"> <description summary="An input method window"> An interface that may be implemented by a wl_surface to host IME contents. </description> @@ -1181,7 +1236,7 @@ <request name="set_bounds" since="18"> <description summary="set window bounds"> - Set the "visible bounds" of a window from the user's perspective. + [Deprecated] Set the "visible bounds" of a window from the user's perspective. The bounds are double buffered, and will be applied at the time wl_surface.commit of the corresponding wl_surface is called. @@ -1205,9 +1260,37 @@ <arg name="width" type="int"/> <arg name="height" type="int"/> </request> + + <!-- Version 33 additions --> + + <request name="set_bounds_in_output" since="33"> + <description summary="set window bounds"> + Set the "visible bounds" of a window from the user's perspective. + + The bounds are double buffered, and will be applied at the + time wl_surface.commit of the corresponding wl_surface is called. + + Once the bounds are set, it is not possible to unset them, and they will + remain the same until set_bounds is called again, even if a new sub- + surface or buffer is attached. + + If never set, the value is the surface content bounds. This updates + dynamically on every commit. + + The bounds are relative to the given display. If the display is invalid, + they are assumed to be relative to the primary display. + + The width and height must be greater than zero. + </description> + <arg name="output" type="object" interface="wl_output" summary="the output"/> + <arg name="x" type="int"/> + <arg name="y" type="int"/> + <arg name="width" type="int"/> + <arg name="height" type="int"/> + </request> </interface> - <interface name="zcr_toast_surface_v1" version="28"> + <interface name="zcr_toast_surface_v1" version="33"> <description summary="A toast window"> An interface that may be implemented by a wl_surface to host toast contents. @@ -1221,7 +1304,7 @@ <request name="set_position"> <description summary="set toast bounds position"> - Set the position of bounds of a window from the user's perspective. + [Deprecated] Set the position of bounds of a window from the user's perspective. The bounds are double buffered, and will be applied at the time wl_surface.commit of the corresponding wl_surface is called. @@ -1243,7 +1326,7 @@ <request name="set_size"> <description summary="set toast bounds size"> - Set the size of bounds of a window from the user's perspective. + [Deprecated] Set the size of bounds of a window from the user's perspective. The bounds are double buffered, and will be applied at the time wl_surface.commit of the corresponding wl_surface is called. @@ -1260,6 +1343,31 @@ <arg name="width" type="int"/> <arg name="height" type="int"/> </request> + + <!-- Version 33 additions --> + + <request name="set_bounds_in_output" since="33"> + <description summary="set toast bounds position"> + Set the bounds of a toast window from the user's perspective. + + The bounds are double buffered, and will be applied at the + time wl_surface.commit of the corresponding wl_surface is called. + + Once the bounds are set, it is not possible to unset them, and they will + remain the same until set_bounds is called again, even if a new sub- + surface or buffer is attached. + + If never set, the compositor will determine the toast position. + + The bounds are relative to the given display. If the display is invalid, + they are assumed to be relative to the primary display. + </description> + <arg name="output" type="object" interface="wl_output" summary="the output"/> + <arg name="x" type="int"/> + <arg name="y" type="int"/> + <arg name="width" type="int"/> + <arg name="height" type="int"/> + </request> </interface> <interface name="zcr_remote_output_v1" version="32"> @@ -1276,7 +1384,7 @@ <event name="display_id" since="29"> <description summary="the identifier for the display"> - Sends the display identifier used by the server for the display. + [Deprecated] Sends the display identifier used by the server for the display. </description> <arg name="display_id_hi" type="uint"/> <arg name="display_id_lo" type="uint"/>
diff --git a/third_party/zxcvbn-cpp/README.chromium b/third_party/zxcvbn-cpp/README.chromium index 78219dd..2d2e5a89 100644 --- a/third_party/zxcvbn-cpp/README.chromium +++ b/third_party/zxcvbn-cpp/README.chromium
@@ -45,6 +45,8 @@ - Removed Python sources, unneeded config files, JavaScript bindings, C wrapper and incomplete C++ entrypoints from native-src, since they are unused / not necessary for Chromium, includes applying patches/no-c-api.diff. +- patches/reduce_memory_usage.diff: Reduce browser memory usage by ~2.0 MiB on + 64bit, ~0.65 MiB on 32bit (https://crrev.com/c/2842124). Ran the following commands to generate adjacency graphs: $ python ./data-scripts/build_keyboard_adjacency_graphs.py ./native-src/zxcvbn/adjacency_graphs.hpp
diff --git a/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.cpp b/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.cpp index 332673d..db6744c 100644 --- a/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.cpp +++ b/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.cpp
@@ -1,5 +1,6 @@ #include <zxcvbn/frequency_lists.hpp> +#include <algorithm> #include <memory> #include <utility>
diff --git a/third_party/zxcvbn-cpp/patches/reduce_memory_usage.diff b/third_party/zxcvbn-cpp/patches/reduce_memory_usage.diff new file mode 100644 index 0000000..1e3803f --- /dev/null +++ b/third_party/zxcvbn-cpp/patches/reduce_memory_usage.diff
@@ -0,0 +1,1191 @@ +diff --git a/chrome/browser/component_updater/zxcvbn_data_component_installer.cc b/chrome/browser/component_updater/zxcvbn_data_component_installer.cc +index 47822d9f0e53..a7c92e252e20 100644 +--- a/chrome/browser/component_updater/zxcvbn_data_component_installer.cc ++++ b/chrome/browser/component_updater/zxcvbn_data_component_installer.cc +@@ -20,6 +20,7 @@ + #include "base/logging.h" + #include "base/memory/scoped_refptr.h" + #include "base/ranges/algorithm.h" ++#include "base/strings/string_piece.h" + #include "base/strings/string_split.h" + #include "base/task/post_task.h" + #include "base/task/thread_pool.h" +@@ -31,7 +32,6 @@ + #include "components/update_client/update_client_errors.h" + #include "components/update_client/utils.h" + #include "third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.hpp" +-#include "third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists_common.hpp" + + namespace component_updater { + +@@ -50,46 +50,39 @@ constexpr base::FilePath::StringPieceType + + namespace { + +-// Small struct linking a dictionary tag with the corresponding filename. +-struct TagAndFileName { +- zxcvbn::DictionaryTag tag; +- base::FilePath::StringPieceType file_name; +-}; +- +-constexpr std::array<TagAndFileName, 6> kTagAndFileNamePairs = {{ +- {zxcvbn::DictionaryTag::ENGLISH_WIKIPEDIA, +- ZxcvbnDataComponentInstallerPolicy::kEnglishWikipediaTxtFileName}, +- {zxcvbn::DictionaryTag::FEMALE_NAMES, +- ZxcvbnDataComponentInstallerPolicy::kFemaleNamesTxtFileName}, +- {zxcvbn::DictionaryTag::MALE_NAMES, +- ZxcvbnDataComponentInstallerPolicy::kMaleNamesTxtFileName}, +- {zxcvbn::DictionaryTag::PASSWORDS, +- ZxcvbnDataComponentInstallerPolicy::kPasswordsTxtFileName}, +- {zxcvbn::DictionaryTag::SURNAMES, +- ZxcvbnDataComponentInstallerPolicy::kSurnamesTxtFileName}, +- {zxcvbn::DictionaryTag::US_TV_AND_FILM, +- ZxcvbnDataComponentInstallerPolicy::kUsTvAndFilmTxtFileName}, ++constexpr std::array<base::FilePath::StringPieceType, 6> kFileNames = {{ ++ ZxcvbnDataComponentInstallerPolicy::kEnglishWikipediaTxtFileName, ++ ZxcvbnDataComponentInstallerPolicy::kFemaleNamesTxtFileName, ++ ZxcvbnDataComponentInstallerPolicy::kMaleNamesTxtFileName, ++ ZxcvbnDataComponentInstallerPolicy::kPasswordsTxtFileName, ++ ZxcvbnDataComponentInstallerPolicy::kSurnamesTxtFileName, ++ ZxcvbnDataComponentInstallerPolicy::kUsTvAndFilmTxtFileName, + }}; + +-using RankedDictionaries = +- base::flat_map<zxcvbn::DictionaryTag, zxcvbn::RankedDict>; +-RankedDictionaries ParseRankedDictionaries(const base::FilePath& install_dir) { +- RankedDictionaries result; +- for (const auto& pair : kTagAndFileNamePairs) { +- base::FilePath dictionary_path = install_dir.Append(pair.file_name); ++zxcvbn::RankedDicts ParseRankedDictionaries(const base::FilePath& install_dir) { ++ std::vector<std::string> raw_dicts; ++ for (const auto& file_name : kFileNames) { ++ base::FilePath dictionary_path = install_dir.Append(file_name); + DVLOG(1) << "Reading Dictionary from file: " << dictionary_path; + + std::string dictionary; + if (base::ReadFileToString(dictionary_path, &dictionary)) { +- result.emplace(pair.tag, zxcvbn::build_ranked_dict(base::SplitStringPiece( +- dictionary, "\r\n", base::TRIM_WHITESPACE, +- base::SPLIT_WANT_NONEMPTY))); ++ raw_dicts.push_back(std::move(dictionary)); + } else { + VLOG(1) << "Failed reading from " << dictionary_path; + } + } + +- return result; ++ // The contained StringPieces hold references to the strings in raw_dicts. ++ std::vector<std::vector<base::StringPiece>> dicts; ++ for (const auto& raw_dict : raw_dicts) { ++ dicts.push_back(base::SplitStringPiece( ++ raw_dict, "\r\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)); ++ } ++ ++ // This copies the words; after this call, the original strings can be ++ // discarded. ++ return zxcvbn::RankedDicts(dicts); + } + + // The SHA256 of the SubjectPublicKeyInfo used to sign the extension. +@@ -105,8 +98,8 @@ constexpr std::array<uint8_t, 32> kZxcvbnDataPublicKeySha256 = { + bool ZxcvbnDataComponentInstallerPolicy::VerifyInstallation( + const base::DictionaryValue& manifest, + const base::FilePath& install_dir) const { +- return base::ranges::all_of(kTagAndFileNamePairs, [&](const auto& pair) { +- return base::PathExists(install_dir.Append(pair.file_name)); ++ return base::ranges::all_of(kFileNames, [&](const auto& file_name) { ++ return base::PathExists(install_dir.Append(file_name)); + }); + } + +diff --git a/chrome/browser/component_updater/zxcvbn_data_component_installer_unittest.cc b/chrome/browser/component_updater/zxcvbn_data_component_installer_unittest.cc +index 2f9600abfb2f..3689a5f2504c 100644 +--- a/chrome/browser/component_updater/zxcvbn_data_component_installer_unittest.cc ++++ b/chrome/browser/component_updater/zxcvbn_data_component_installer_unittest.cc +@@ -7,6 +7,7 @@ + #include "base/files/file_path.h" + #include "base/files/file_util.h" + #include "base/files/scoped_temp_dir.h" ++#include "base/optional.h" + #include "base/test/task_environment.h" + #include "base/values.h" + #include "testing/gmock/include/gmock/gmock.h" +@@ -97,7 +98,6 @@ TEST_F(ZxcvbnDataComponentInstallerPolicyTest, ComponentReady) { + // Empty / non-existent files should result in empty dictionaries. + policy().ComponentReady(version(), GetPath(), nullptr); + task_env().RunUntilIdle(); +- EXPECT_THAT(zxcvbn::default_ranked_dicts(), ::testing::IsEmpty()); + + // Populated files should be read and fed to the correct ranked zxcvbn + // dictionary. +@@ -108,11 +108,11 @@ TEST_F(ZxcvbnDataComponentInstallerPolicyTest, ComponentReady) { + base::WriteFile( + GetPath().Append( + ZxcvbnDataComponentInstallerPolicy::kFemaleNamesTxtFileName), +- "female\nnames"); ++ "female\nfnames"); + base::WriteFile( + GetPath().Append( + ZxcvbnDataComponentInstallerPolicy::kMaleNamesTxtFileName), +- "male\nnames"); ++ "male\nmnames"); + base::WriteFile( + GetPath().Append( + ZxcvbnDataComponentInstallerPolicy::kPasswordsTxtFileName), +@@ -128,27 +128,19 @@ TEST_F(ZxcvbnDataComponentInstallerPolicyTest, ComponentReady) { + policy().ComponentReady(version(), GetPath(), nullptr); + task_env().RunUntilIdle(); + +- zxcvbn::RankedDicts ranked_dicts = zxcvbn::default_ranked_dicts(); +- EXPECT_THAT( +- zxcvbn::default_ranked_dicts(), +- UnorderedElementsAre( +- Pair(zxcvbn::DictionaryTag::ENGLISH_WIKIPEDIA, +- Pointee(UnorderedElementsAre(Pair("english", 1), +- Pair("wikipedia", 2)))), +- Pair(zxcvbn::DictionaryTag::FEMALE_NAMES, +- Pointee( +- UnorderedElementsAre(Pair("female", 1), Pair("names", 2)))), +- Pair( +- zxcvbn::DictionaryTag::MALE_NAMES, +- Pointee(UnorderedElementsAre(Pair("male", 1), Pair("names", 2)))), +- Pair(zxcvbn::DictionaryTag::PASSWORDS, +- Pointee(UnorderedElementsAre(Pair("passwords", 1)))), +- Pair(zxcvbn::DictionaryTag::SURNAMES, +- Pointee(UnorderedElementsAre(Pair("surnames", 1)))), +- Pair( +- zxcvbn::DictionaryTag::US_TV_AND_FILM, +- Pointee(UnorderedElementsAre(Pair("us", 1), Pair("tv", 2), +- Pair("and", 3), Pair("film", 4)))))); ++ zxcvbn::RankedDicts& ranked_dicts = zxcvbn::default_ranked_dicts(); ++ EXPECT_EQ(ranked_dicts.Find("english"), 1UL); ++ EXPECT_EQ(ranked_dicts.Find("wikipedia"), 2UL); ++ EXPECT_EQ(ranked_dicts.Find("female"), 1UL); ++ EXPECT_EQ(ranked_dicts.Find("fnames"), 2UL); ++ EXPECT_EQ(ranked_dicts.Find("male"), 1UL); ++ EXPECT_EQ(ranked_dicts.Find("mnames"), 2UL); ++ EXPECT_EQ(ranked_dicts.Find("passwords"), 1UL); ++ EXPECT_EQ(ranked_dicts.Find("surnames"), 1UL); ++ EXPECT_EQ(ranked_dicts.Find("us"), 1UL); ++ EXPECT_EQ(ranked_dicts.Find("tv"), 2UL); ++ EXPECT_EQ(ranked_dicts.Find("and"), 3UL); ++ EXPECT_EQ(ranked_dicts.Find("film"), 4UL); + } + + } // namespace component_updater +diff --git a/third_party/zxcvbn-cpp/BUILD.gn b/third_party/zxcvbn-cpp/BUILD.gn +index 65a04ddb9d76..eae90999c976 100644 +--- a/third_party/zxcvbn-cpp/BUILD.gn ++++ b/third_party/zxcvbn-cpp/BUILD.gn +@@ -14,11 +14,8 @@ source_set("zxcvbn-cpp") { + "native-src/zxcvbn/adjacency_graphs.cpp", + "native-src/zxcvbn/adjacency_graphs.hpp", + "native-src/zxcvbn/common.hpp", +- "native-src/zxcvbn/feedback.cpp", +- "native-src/zxcvbn/feedback.hpp", + "native-src/zxcvbn/frequency_lists.cpp", + "native-src/zxcvbn/frequency_lists.hpp", +- "native-src/zxcvbn/frequency_lists_common.hpp", + "native-src/zxcvbn/matching.cpp", + "native-src/zxcvbn/matching.hpp", + "native-src/zxcvbn/optional.hpp", +diff --git a/third_party/zxcvbn-cpp/native-src/zxcvbn/common.hpp b/third_party/zxcvbn-cpp/native-src/zxcvbn/common.hpp +index 31e2f7fa937c..1f66367112aa 100644 +--- a/third_party/zxcvbn-cpp/native-src/zxcvbn/common.hpp ++++ b/third_party/zxcvbn-cpp/native-src/zxcvbn/common.hpp +@@ -66,7 +66,6 @@ enum class MatchPattern { + struct DictionaryMatch { + static constexpr auto pattern = MatchPattern::DICTIONARY; + +- DictionaryTag dictionary_tag; + std::string matched_word; + rank_t rank; + bool l33t; +diff --git a/third_party/zxcvbn-cpp/native-src/zxcvbn/feedback.cpp b/third_party/zxcvbn-cpp/native-src/zxcvbn/feedback.cpp +deleted file mode 100644 +index 08198d740a48..000000000000 +--- a/third_party/zxcvbn-cpp/native-src/zxcvbn/feedback.cpp ++++ /dev/null +@@ -1,172 +0,0 @@ +-#include <zxcvbn/feedback.hpp> +- +-#include <zxcvbn/frequency_lists.hpp> +-#include <zxcvbn/optional.hpp> +-#include <zxcvbn/scoring.hpp> +-#include <zxcvbn/util.hpp> +- +-#include <regex> +- +-namespace zxcvbn { +- +-static +-optional::optional<Feedback> get_match_feedback(const Match & match, bool is_sole_match); +- +-static +-Feedback get_dictionary_match_feedback(const Match & match, bool is_sole_match); +- +-Feedback get_feedback(score_t score, +- const std::vector<Match> & sequence) { +- // starting feedback +- if (!sequence.size()) { +- return { +- "", +- { +- "Use a few words, avoid common phrases", +- "No need for symbols, digits, or uppercase letters", +- }, +- }; +- } +- +- // no feedback if score is good or great. +- if (score > 2) return {"", {}}; +- +- // tie feedback to the longest match for longer sequences +- auto longest_match = sequence.begin(); +- for (auto match = longest_match + 1; match != sequence.end(); ++match) { +- if (match->token.length() > longest_match->token.length()) { +- longest_match = match; +- } +- } +- +- auto maybe_feedback = get_match_feedback(*longest_match, sequence.size() == 1); +- auto extra_feedback = "Add another word or two. Uncommon words are better."; +- if (maybe_feedback) { +- auto & feedback = *maybe_feedback; +- +- feedback.suggestions.insert(maybe_feedback->suggestions.begin(), +- extra_feedback); +- +- return feedback; +- } +- else { +- return {"", {extra_feedback}}; +- } +-} +- +-optional::optional<Feedback> get_match_feedback(const Match & match_, bool is_sole_match) { +- switch (match_.get_pattern()) { +- case MatchPattern::DICTIONARY: { +- return get_dictionary_match_feedback(match_, is_sole_match); +- } +- +- case MatchPattern::SPATIAL: { +- auto & match = match_.get_spatial(); +- auto warning = (match.turns == 1) +- ? "Straight rows of keys are easy to guess" +- : "Short keyboard patterns are easy to guess"; +- +- return Feedback{warning, { +- "Use a longer keyboard pattern with more turns", +- }}; +- } +- +- case MatchPattern::REPEAT: { +- auto warning = (match_.get_repeat().base_token.length() == 1) +- ? "Repeats like \"aaa\" are easy to guess" +- : "Repeats like \"abcabcabc\" are only slightly harder to guess than \"abc\""; +- +- return Feedback{warning, { +- "Avoid repeated words and characters", +- }}; +- } +- +- case MatchPattern::SEQUENCE: { +- return Feedback{"Sequences like abc or 6543 are easy to guess", +- {"Avoid sequences"}, +- }; +- } +- +- case MatchPattern::REGEX: { +- auto & match = match_.get_regex(); +- if (match.regex_tag == RegexTag::RECENT_YEAR) { +- return Feedback{"Recent years are easy to guess", { +- "Avoid recent years", +- "Avoid years that are associated with you", +- }}; +- } +- break; +- } +- +- case MatchPattern::DATE: { +- return Feedback{"Dates are often easy to guess", { +- "Avoid dates and years that are associated with you", +- }}; +- } +- default: +- break; +- } +- return optional::nullopt; +-} +- +-static +-Feedback get_dictionary_match_feedback(const Match & match_, bool is_sole_match) { +- assert(match_.get_pattern() == MatchPattern::DICTIONARY); +- auto & match = match_.get_dictionary(); +- auto warning = [&] { +- if (match.dictionary_tag == DictionaryTag::PASSWORDS) { +- if (is_sole_match and !match.l33t and !match.reversed) { +- if (match.rank <= 10) { +- return "This is a top-10 common password"; +- } +- else if (match.rank <= 100) { +- return "This is a top-100 common password"; +- } +- else { +- return "This is a very common password"; +- } +- } +- else if (match_.guesses_log10 <= 4) { +- return "This is similar to a commonly used password"; +- } +- } +- else if (match.dictionary_tag == DictionaryTag::ENGLISH_WIKIPEDIA) { +- if (is_sole_match) { +- return "A word by itself is easy to guess"; +- } +- } +- else if (match.dictionary_tag == DictionaryTag::SURNAMES || +- match.dictionary_tag == DictionaryTag::MALE_NAMES || +- match.dictionary_tag == DictionaryTag::FEMALE_NAMES) { +- if (is_sole_match) { +- return "Names and surnames by themselves are easy to guess"; +- } +- else { +- return "Common names and surnames are easy to guess"; +- } +- } +- +- return ""; +- }(); +- +- std::vector<std::string> suggestions; +- auto & word = match_.token; +- if (std::regex_search(word, START_UPPER())) { +- suggestions.push_back("Capitalization doesn't help very much"); +- } else if (std::regex_search(word, ALL_UPPER()) and +- // XXX: UTF-8 +- util::ascii_lower(word) == word) { +- suggestions.push_back("All-uppercase is almost as easy to guess as all-lowercase"); +- } +- +- if (match.reversed and match_.token.length() >= 4) { +- suggestions.push_back("Reversed words aren't much harder to guess"); +- } +- if (match.l33t) { +- suggestions.push_back("Predictable substitutions like '@' instead of 'a' don't help very much"); +- } +- +- return {warning, suggestions}; +-} +- +-} +diff --git a/third_party/zxcvbn-cpp/native-src/zxcvbn/feedback.hpp b/third_party/zxcvbn-cpp/native-src/zxcvbn/feedback.hpp +deleted file mode 100644 +index 6f6b62b9da05..000000000000 +--- a/third_party/zxcvbn-cpp/native-src/zxcvbn/feedback.hpp ++++ /dev/null +@@ -1,20 +0,0 @@ +-#ifndef __ZXCVBN__FEEDBACK_HPP +-#define __ZXCVBN__FEEDBACK_HPP +- +-#include <zxcvbn/common.hpp> +- +-#include <string> +-#include <vector> +- +-namespace zxcvbn { +- +-struct Feedback { +- std::string warning; +- std::vector<std::string> suggestions; +-}; +- +-Feedback get_feedback(score_t score, const std::vector<Match> & sequence); +- +-} +- +-#endif +diff --git a/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.cpp b/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.cpp +index 4996f7959be4..332673d93f77 100644 +--- a/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.cpp ++++ b/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.cpp +@@ -1,39 +1,206 @@ + #include <zxcvbn/frequency_lists.hpp> + ++#include <algorithm> ++#include <memory> + #include <utility> + +-#include "base/containers/flat_map.h" ++#include "base/check.h" ++#include "base/logging.h" + #include "base/no_destructor.h" ++#include "base/notreached.h" + + namespace zxcvbn { + + namespace { + +-base::flat_map<DictionaryTag, RankedDict>& ranked_dicts() { +- static base::NoDestructor<base::flat_map<DictionaryTag, RankedDict>> +- ranked_dicts; +- return *ranked_dicts; +-} ++// A big-endian 16-bit value, consisting of a 15-bit number and a marker bit in ++// the most significant position (in the first byte). ++// No alignment requirements. ++// This is used to store a "rank", which is the position at which a word ++// occurred in a wordlist. ++class MarkedBigEndianU15 { ++ public: ++ static constexpr size_t MAX_VALUE = (1 << 15) - 1; ++ static constexpr uint8_t MARKER_BIT = 0x80; ++ uint16_t get() const { ++ return (encoded_value[0] & ~MARKER_BIT) * 256 + encoded_value[1]; ++ } ++ static void AppendToVector(uint16_t value, std::vector<char>& vec) { ++ CHECK(value <= MAX_VALUE); ++ vec.push_back((value >> 8) | MARKER_BIT); ++ vec.push_back(value & 0xff); ++ } ++ // Check whether the given byte has the high bit set. ++ // This always returns true for the first byte of a MarkedBigEndianU15, but ++ // may also be false-positive for the second byte. ++ // To reliably determine whether a given byte really is the start of a ++ // MarkedBigEndianU15, you need to also check the preceding byte if this ++ // returns true. ++ static bool IsPossibleMarkerByte(uint8_t c) { return (c & MARKER_BIT) != 0; } ++ ++ private: ++ uint8_t encoded_value[2]; ++}; ++static_assert( ++ sizeof(MarkedBigEndianU15) == 2, ++ "object layout must fit with assumptions in the rest of this file"); ++ ++struct MergedEntry { ++ size_t rank; ++ base::StringPiece value; ++}; ++ ++// A reference to an entry inside a dictionary. ++// The entry consists of a MarkedBigEndianU15 representing the word's rank ++// (the position at which the word appears in the original wordlist) and an ++// inline string (ASCII, terminated with a byte that has the MARKER_BIT set) ++// that stores the actual word. ++class RankedDictEntryRef { ++ public: ++ explicit RankedDictEntryRef(const std::vector<char>& vec, size_t offset) { ++ CHECK_LT(offset + sizeof(MarkedBigEndianU15), vec.size()); ++ const char* raw_rank = vec.data() + offset; ++ rank_ = reinterpret_cast<const MarkedBigEndianU15*>(raw_rank)->get(); ++ ++ size_t value_start = offset + sizeof(MarkedBigEndianU15); ++ size_t value_end = value_start; ++ while (true) { ++ CHECK_LT(value_end, vec.size()); ++ if (MarkedBigEndianU15::IsPossibleMarkerByte(vec[value_end])) ++ break; ++ value_end++; ++ } ++ value_ = ++ base::StringPiece(vec.data() + value_start, value_end - value_start); ++ } ++ RankedDictEntryRef(RankedDictEntryRef&) = delete; ++ RankedDictEntryRef& operator=(const RankedDictEntryRef&) = delete; ++ ++ uint16_t rank() const { return rank_; } ++ base::StringPiece value() const { return value_; } ++ ++ static void AppendToVector(MergedEntry entry, std::vector<char>& vec) { ++ if (entry.rank > MarkedBigEndianU15::MAX_VALUE) { ++ LOG(ERROR) << "MarkedBigEndianU15 clamping"; ++ entry.rank = MarkedBigEndianU15::MAX_VALUE; ++ } ++ MarkedBigEndianU15::AppendToVector(entry.rank, vec); ++ vec.insert(vec.end(), entry.value.begin(), entry.value.end()); ++ } + ++ private: ++ size_t rank_; ++ base::StringPiece value_; ++}; + } // namespace + +-void SetRankedDicts(base::flat_map<DictionaryTag, RankedDict> dicts) { +- ranked_dicts() = std::move(dicts); ++RankedDicts::RankedDicts( ++ const std::vector<std::vector<base::StringPiece>>& ordered_dicts) { ++ std::vector<MergedEntry> merged_dicts; ++ for (const std::vector<base::StringPiece>& strings : ordered_dicts) { ++ size_t rank = 1; ++ for (const base::StringPiece& s : strings) { ++ bool clean_string = true; ++ for (char c : s) { ++ if (MarkedBigEndianU15::IsPossibleMarkerByte(c)) { ++ NOTREACHED() << "RankedDicts bad character " ++ << static_cast<unsigned char>(c); ++ clean_string = false; ++ } ++ } ++ if (clean_string) { ++ merged_dicts.push_back({rank++, s}); ++ } ++ } ++ } ++ std::sort(merged_dicts.begin(), merged_dicts.end(), ++ [](MergedEntry& a, MergedEntry& b) { return a.value < b.value; }); ++ ++ if (merged_dicts.size() == 0) ++ return; ++ ++ // first pass: calculate required total size ++ size_t dict_size = sizeof(MarkedBigEndianU15) * merged_dicts.size(); ++ for (MergedEntry& entry : merged_dicts) ++ dict_size += entry.value.size(); ++ ++ // 1 byte at the end for trailing marker byte (for finding last string size) ++ data_.reserve(dict_size + 1); ++ ++ // second pass: place elements in allocated array ++ for (MergedEntry& entry : merged_dicts) ++ RankedDictEntryRef::AppendToVector(entry, data_); ++ CHECK_EQ(data_.size(), dict_size); ++ data_.push_back(MarkedBigEndianU15::MARKER_BIT); + } + +-RankedDicts convert_to_ranked_dicts( +- base::flat_map<DictionaryTag, RankedDict>& ranked_dicts) { +- RankedDicts build; ++// Performs a binary search over an array of variable-size elements. ++// To find an element in the middle between two others, we first locate the ++// *byte* in the middle, then seek forward until we hit a marker byte that ++// will only appear at the start of an allocation. ++base::Optional<rank_t> RankedDicts::Find(base::StringPiece needle) const { ++ // special case for empty dictionary ++ if (data_.size() == 0) ++ return base::nullopt; ++ CHECK_GE(data_.size(), 3UL); // 2 bytes header, 1 byte trailing marker + +- for (const auto & item : ranked_dicts) { +- build.emplace(item.first, &item.second); ++ // Create a range whose start and end point to marker bytes. ++ size_t range_start = 0; ++ size_t range_last = data_.size() - 2; ++ CHECK(IsRealMarker(0)); ++ while (!IsRealMarker(range_last)) ++ range_last--; ++ ++ while (true) { ++ size_t midpoint = range_start + (range_last - range_start) / 2; ++ // Find a marker byte from the midpoint onwards. (There must be one, since ++ // there is one at range_last.) ++ size_t adjusted_midpoint = midpoint; ++ while (!IsRealMarker(adjusted_midpoint)) ++ adjusted_midpoint++; ++ ++ // Perform the actual comparison. ++ RankedDictEntryRef mid_entry(data_, adjusted_midpoint); ++ base::StringPiece mid_value = mid_entry.value(); ++ int cmp_result = mid_value.compare(needle); ++ if (cmp_result == 0) ++ return mid_entry.rank(); ++ if (cmp_result < 0) { ++ if (adjusted_midpoint == range_last) ++ return base::nullopt; ++ range_start = adjusted_midpoint + 1; ++ while (!IsRealMarker(range_start)) ++ range_start++; ++ } else { ++ if (adjusted_midpoint == range_start) ++ return base::nullopt; ++ range_last = adjusted_midpoint - 1; ++ while (!IsRealMarker(range_last)) ++ range_last--; ++ } + } ++} + +- return build; ++// Determine whether an entry starts at the given offset; in other words, ++// determine whether a MarkedBigEndianU15 starts there. ++bool RankedDicts::IsRealMarker(size_t offset) const { ++ CHECK_LT(offset, data_.size()); ++ if (MarkedBigEndianU15::IsPossibleMarkerByte(data_[offset])) { ++ if (offset == 0) ++ return true; ++ if (!MarkedBigEndianU15::IsPossibleMarkerByte(data_[offset - 1])) ++ return true; ++ } ++ return false; + } + +-RankedDicts default_ranked_dicts() { +- return convert_to_ranked_dicts(ranked_dicts()); ++void SetRankedDicts(RankedDicts dicts) { ++ default_ranked_dicts() = std::move(dicts); + } + ++RankedDicts& default_ranked_dicts() { ++ static base::NoDestructor<RankedDicts> default_dicts; ++ return *default_dicts; + } ++ ++} // namespace zxcvbn +diff --git a/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.hpp b/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.hpp +index 3757483251e5..2b0f00f9cf35 100644 +--- a/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.hpp ++++ b/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.hpp +@@ -1,36 +1,52 @@ + #ifndef __ZXCVBN__FREQUENCY_LISTS_HPP + #define __ZXCVBN__FREQUENCY_LISTS_HPP + +-#include <zxcvbn/frequency_lists_common.hpp> +- + #include <cstdint> ++#include <memory> ++#include <vector> + ++#include "base/optional.h" + #include "base/strings/string_piece.h" +-#include "base/containers/flat_map.h" + + namespace zxcvbn { + +-enum class DictionaryTag { +- ENGLISH_WIKIPEDIA, +- FEMALE_NAMES, +- MALE_NAMES, +- PASSWORDS, +- SURNAMES, +- US_TV_AND_FILM, +- USER_INPUTS ++using rank_t = std::size_t; ++ ++// Stores words from a set of dictionaries (originally ordered by word ++// frequency) in a sorted flat array. ++// Lookups run in roughly logarithmic time and, when a match is found, return ++// the position of the word in the original dictionary. ++// This data structure is optimized for memory efficiency over lookup speed. ++// It does not contain any pointers and its format is target-independent, so it ++// could theoretically directly be mapped from disk. ++// ++// Since this data structure sorts words alphabetically, the lookup code could ++// be extended to also answer the question "are there any entries that start ++// with the given prefix", which should permit speeding up dictionary_match(). ++// That isn't implemented yet though. ++class RankedDicts { ++ public: ++ explicit RankedDicts(const std::vector<std::vector<base::StringPiece>> &ordered_dicts); ++ RankedDicts() = default; ++ RankedDicts(RankedDicts &&) = default; ++ RankedDicts(RankedDicts &) = delete; ++ ++ RankedDicts& operator=(RankedDicts &&) = default; ++ RankedDicts& operator=(const RankedDicts &) = delete; ++ ++ base::Optional<rank_t> Find(base::StringPiece needle) const; ++ ++ private: ++ bool IsRealMarker(size_t offset) const; ++ // Buffer storing the dictionaries, see RankedDictEntryRef and the rest of ++ // frequency_lists.cpp for documentation of the data structure. ++ std::vector<char> data_; + }; + +-} +- +-namespace zxcvbn { +- +-using RankedDicts = base::flat_map<DictionaryTag, const RankedDict*>; +- +-void SetRankedDicts(base::flat_map<DictionaryTag, RankedDict> dicts); ++void SetRankedDicts(RankedDicts dicts); + +-RankedDicts convert_to_ranked_dicts(base::flat_map<DictionaryTag, RankedDict> & ranked_dicts); +-RankedDicts default_ranked_dicts(); ++RankedDicts &default_ranked_dicts(); + +-} ++} // namespace zxcvbn + + #endif +diff --git a/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists_common.hpp b/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists_common.hpp +deleted file mode 100644 +index d1c5177fb183..000000000000 +--- a/third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists_common.hpp ++++ /dev/null +@@ -1,29 +0,0 @@ +-#ifndef __ZXCVBN__FREQUENCY_LISTS_COMMON_HPP +-#define __ZXCVBN__FREQUENCY_LISTS_COMMON_HPP +- +-#include <cstdint> +-#include <string> +-#include <vector> +- +-#include "base/containers/flat_map.h" +- +-namespace zxcvbn { +- +-using rank_t = std::size_t; +-using RankedDict = base::flat_map<std::string, rank_t>; +- +-template<class T> +-RankedDict build_ranked_dict(const T & ordered_list) { +- std::vector<RankedDict::value_type> items; +- items.reserve(ordered_list.size()); +- rank_t idx = 1; // rank starts at 1, not 0 +- for (const auto & word : ordered_list) { +- items.emplace_back(word, idx); +- idx += 1; +- } +- return RankedDict(std::move(items)); +-} +- +-} +- +-#endif +diff --git a/third_party/zxcvbn-cpp/native-src/zxcvbn/matching.cpp b/third_party/zxcvbn-cpp/native-src/zxcvbn/matching.cpp +index 3d09857fa5fa..1692fe8b4e88 100644 +--- a/third_party/zxcvbn-cpp/native-src/zxcvbn/matching.cpp ++++ b/third_party/zxcvbn-cpp/native-src/zxcvbn/matching.cpp +@@ -122,13 +122,8 @@ std::string dict_normalize(const std::string & str) { + return util::ascii_lower(str); + } + +-std::vector<Match> omnimatch(const std::string & password, +- const std::vector<std::string> & ordered_list) { +- auto ranked_dictionaries = default_ranked_dicts(); +- +- auto ranked_dict = build_ranked_dict(ordered_list); +- ranked_dictionaries.insert( +- std::make_pair(DictionaryTag::USER_INPUTS, &ranked_dict)); ++std::vector<Match> omnimatch(const std::string& password) { ++ RankedDicts& ranked_dictionaries = default_ranked_dicts(); + + std::vector<Match> matches; + std::function<std::vector<Match>(const std::string&)> matchers[] = { +@@ -158,29 +153,22 @@ std::vector<Match> omnimatch(const std::string & password, + std::vector<Match> dictionary_match(const std::string & password, + const RankedDicts & ranked_dictionaries) { + std::vector<Match> matches; +- auto len = password.length(); +- auto password_lower = dict_normalize(password); +- for (const auto & item : ranked_dictionaries) { +- auto dictionary_tag = item.first; +- auto& ranked_dict = *item.second; +- for (decltype(len) i = 0, idx = 0; idx < len; util::utf8_decode(password, idx), ++i) { +- for (decltype(len) j = i, jdx = idx; jdx < len; ++j) { +- // j is inclusive, but jdx is not so eagerly iterate jdx +- util::utf8_decode(password, jdx); +- +- auto word = password_lower.substr(idx, jdx - idx); +- auto it = ranked_dict.find(word); +- if (it != ranked_dict.end()) { +- auto rank = it->second; +- matches.push_back(Match(i, j, password.substr(idx, jdx - idx), +- DictionaryMatch{ +- dictionary_tag, +- word, rank, +- false, +- false, {}, ""})); +- matches.back().idx = idx; +- matches.back().jdx = jdx; +- } ++ size_t len = password.length(); ++ std::string password_lower = dict_normalize(password); ++ for (size_t i = 0, idx = 0; idx < len; ++ util::utf8_decode(password, idx), ++i) { ++ for (size_t j = i, jdx = idx; jdx < len; ++j) { ++ // j is inclusive, but jdx is not so eagerly iterate jdx ++ util::utf8_decode(password, jdx); ++ ++ std::string word = password_lower.substr(idx, jdx - idx); ++ base::Optional<rank_t> result = ranked_dictionaries.Find(word); ++ if (result.has_value()) { ++ rank_t rank = *result; ++ matches.emplace_back(i, j, password.substr(idx, jdx - idx), ++ DictionaryMatch{word, rank, false, false, {}, ""}); ++ matches.back().idx = idx; ++ matches.back().jdx = jdx; + } + } + } +diff --git a/third_party/zxcvbn-cpp/native-src/zxcvbn/matching.hpp b/third_party/zxcvbn-cpp/native-src/zxcvbn/matching.hpp +index ba73b909157c..448603892a5e 100644 +--- a/third_party/zxcvbn-cpp/native-src/zxcvbn/matching.hpp ++++ b/third_party/zxcvbn-cpp/native-src/zxcvbn/matching.hpp +@@ -39,8 +39,7 @@ std::vector<Match> regex_match(const std::string & password, + + std::vector<Match> date_match(const std::string & password); + +-std::vector<Match> omnimatch(const std::string & password, +- const std::vector<std::string> & ordered_list = {}); ++std::vector<Match> omnimatch(const std::string & password); + + } + +diff --git a/third_party/zxcvbn-cpp/test/matching_unittest.cc b/third_party/zxcvbn-cpp/test/matching_unittest.cc +index ec21c413cbf1..1437216c0f5e 100644 +--- a/third_party/zxcvbn-cpp/test/matching_unittest.cc ++++ b/third_party/zxcvbn-cpp/test/matching_unittest.cc +@@ -14,7 +14,6 @@ + #include "third_party/zxcvbn-cpp/native-src/zxcvbn/adjacency_graphs.hpp" + #include "third_party/zxcvbn-cpp/native-src/zxcvbn/common.hpp" + #include "third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists.hpp" +-#include "third_party/zxcvbn-cpp/native-src/zxcvbn/frequency_lists_common.hpp" + + using ::testing::ElementsAre; + using ::testing::IsEmpty; +@@ -59,7 +58,6 @@ struct ExpectedDictionaryMatch { + idx_t j; + std::string token; + +- DictionaryTag dictionary_tag; + std::string matched_word; + rank_t rank; + bool l33t; +@@ -70,7 +68,6 @@ struct ExpectedDictionaryMatch { + bool operator==(const Match& lhs, const ExpectedDictionaryMatch& rhs) { + return lhs.i == rhs.i && lhs.j == rhs.j && lhs.token == rhs.token && + lhs.get_pattern() == MatchPattern::DICTIONARY && +- lhs.get_dictionary().dictionary_tag == rhs.dictionary_tag && + lhs.get_dictionary().matched_word == rhs.matched_word && + lhs.get_dictionary().rank == rhs.rank && + lhs.get_dictionary().l33t == rhs.l33t && +@@ -162,38 +159,22 @@ bool operator==(const Match& lhs, const ExpectedDateMatch& rhs) { + } // namespace + + TEST(ZxcvbnTest, DictionaryMatching) { +- auto dict_1 = static_cast<DictionaryTag>(0); +- auto dict_2 = static_cast<DictionaryTag>(1); +- base::flat_map<DictionaryTag, RankedDict> test_dicts = { +- {dict_1, +- { +- {"motherboard", 1}, +- {"mother", 2}, +- {"board", 3}, +- {"abcd", 4}, +- {"cdef", 5}, +- }}, +- {dict_2, +- { +- {"z", 1}, +- {"8", 2}, +- {"99", 3}, +- {"$", 4}, +- {"asdf1234&*", 5}, +- }}, ++ std::vector<std::vector<base::StringPiece>> test_dicts = { ++ {"motherboard", "mother", "board", "abcd", "cdef"}, ++ {"z", "8", "99", "$", "asdf1234&*"}, + }; + + { + // matches words that contain other words + std::string password = "motherboard"; ++ RankedDicts test_dicts_processed(test_dicts); + std::vector<Match> matches = +- dictionary_match(password, convert_to_ranked_dicts(test_dicts)); ++ dictionary_match(password, test_dicts_processed); + EXPECT_THAT(matches, ElementsAre( + ExpectedDictionaryMatch{ + .i = 0, + .j = 5, + .token = "mother", +- .dictionary_tag = dict_1, + .matched_word = "mother", + .rank = 2, + }, +@@ -201,7 +182,6 @@ TEST(ZxcvbnTest, DictionaryMatching) { + .i = 0, + .j = 10, + .token = "motherboard", +- .dictionary_tag = dict_1, + .matched_word = "motherboard", + .rank = 1, + }, +@@ -209,7 +189,6 @@ TEST(ZxcvbnTest, DictionaryMatching) { + .i = 6, + .j = 10, + .token = "board", +- .dictionary_tag = dict_1, + .matched_word = "board", + .rank = 3, + })); +@@ -219,13 +198,12 @@ TEST(ZxcvbnTest, DictionaryMatching) { + // matches multiple words when they overlap + std::string password = "abcdef"; + std::vector<Match> matches = +- dictionary_match(password, convert_to_ranked_dicts(test_dicts)); ++ dictionary_match(password, RankedDicts(test_dicts)); + EXPECT_THAT(matches, ElementsAre( + ExpectedDictionaryMatch{ + .i = 0, + .j = 3, + .token = "abcd", +- .dictionary_tag = dict_1, + .matched_word = "abcd", + .rank = 4, + }, +@@ -233,7 +211,6 @@ TEST(ZxcvbnTest, DictionaryMatching) { + .i = 2, + .j = 5, + .token = "cdef", +- .dictionary_tag = dict_1, + .matched_word = "cdef", + .rank = 5, + })); +@@ -243,13 +220,12 @@ TEST(ZxcvbnTest, DictionaryMatching) { + // ignores uppercasing + std::string password = "BoaRdZ"; + std::vector<Match> matches = +- dictionary_match(password, convert_to_ranked_dicts(test_dicts)); ++ dictionary_match(password, RankedDicts(test_dicts)); + EXPECT_THAT(matches, ElementsAre( + ExpectedDictionaryMatch{ + .i = 0, + .j = 4, + .token = "BoaRd", +- .dictionary_tag = dict_1, + .matched_word = "board", + .rank = 3, + }, +@@ -257,7 +233,6 @@ TEST(ZxcvbnTest, DictionaryMatching) { + .i = 5, + .j = 5, + .token = "Z", +- .dictionary_tag = dict_2, + .matched_word = "z", + .rank = 1, + })); +@@ -267,13 +242,12 @@ TEST(ZxcvbnTest, DictionaryMatching) { + // identifies words surrounded by non-words + std::string word = "asdf1234&*"; + for (const auto& variation : gen_pws(word, {"q", "%%"}, {"%", "qq"})) { +- std::vector<Match> matches = dictionary_match( +- variation.password, convert_to_ranked_dicts(test_dicts)); ++ std::vector<Match> matches = ++ dictionary_match(variation.password, RankedDicts(test_dicts)); + EXPECT_THAT(matches, ElementsAre(ExpectedDictionaryMatch{ + .i = variation.i, + .j = variation.j, + .token = word, +- .dictionary_tag = dict_2, + .matched_word = word, + .rank = 5, + })); +@@ -283,20 +257,21 @@ TEST(ZxcvbnTest, DictionaryMatching) { + { + // matches against all words in provided dictionaries + for (const auto& test_dict : test_dicts) { +- for (const auto& ranked_word : test_dict.second) { ++ rank_t expected_rank = 0; ++ for (base::StringPiece ranked_word : test_dict) { ++ expected_rank++; + // skip words that contain others +- if (ranked_word.first == "motherboard") ++ if (ranked_word == "motherboard") + continue; + +- std::vector<Match> matches = dictionary_match( +- ranked_word.first, convert_to_ranked_dicts(test_dicts)); ++ std::vector<Match> matches = ++ dictionary_match(std::string(ranked_word), RankedDicts(test_dicts)); + EXPECT_THAT(matches, ElementsAre(ExpectedDictionaryMatch{ + .i = 0, +- .j = ranked_word.first.size() - 1, +- .token = ranked_word.first, +- .dictionary_tag = test_dict.first, +- .matched_word = ranked_word.first, +- .rank = ranked_word.second, ++ .j = ranked_word.size() - 1, ++ .token = std::string(ranked_word), ++ .matched_word = std::string(ranked_word), ++ .rank = expected_rank, + })); + } + } +@@ -304,66 +279,33 @@ TEST(ZxcvbnTest, DictionaryMatching) { + + { + // default dictionaries +- SetRankedDicts({{DictionaryTag::US_TV_AND_FILM, {{"wow", 1}}}}); ++ SetRankedDicts(RankedDicts({{"wow"}})); + std::vector<Match> matches = + dictionary_match("wow", default_ranked_dicts()); + EXPECT_THAT(matches, ElementsAre(ExpectedDictionaryMatch{ + .i = 0, + .j = 2, + .token = "wow", +- .dictionary_tag = DictionaryTag::US_TV_AND_FILM, + .matched_word = "wow", + .rank = 1, + })); + } +- +- { +- // matches with provided user input dictionary +- SetRankedDicts({{DictionaryTag::USER_INPUTS, {{"foo", 1}, {"bar", 2}}}}); +- std::vector<Match> matches = +- dictionary_match("foobar", default_ranked_dicts()); +- EXPECT_THAT(matches, ElementsAre( +- ExpectedDictionaryMatch{ +- .i = 0, +- .j = 2, +- .token = "foo", +- .dictionary_tag = DictionaryTag::USER_INPUTS, +- .matched_word = "foo", +- .rank = 1, +- }, +- ExpectedDictionaryMatch{ +- .i = 3, +- .j = 5, +- .token = "bar", +- .dictionary_tag = DictionaryTag::USER_INPUTS, +- .matched_word = "bar", +- .rank = 2, +- })); +- } + } + + TEST(ZxcvbnTest, ReverseDictionaryMatching) { +- auto dict_1 = static_cast<DictionaryTag>(0); +- base::flat_map<DictionaryTag, RankedDict> test_dicts = { +- {dict_1, +- { +- {"123", 1}, +- {"321", 2}, +- {"456", 3}, +- {"654", 4}, +- }}, ++ std::vector<std::vector<base::StringPiece>> test_dicts = { ++ {"123", "321", "456", "654"}, + }; + + // matches against reversed words + std::string password = "0123456789"; + std::vector<Match> matches = +- reverse_dictionary_match(password, convert_to_ranked_dicts(test_dicts)); ++ reverse_dictionary_match(password, RankedDicts(test_dicts)); + EXPECT_THAT(matches, ElementsAre( + ExpectedDictionaryMatch{ + .i = 1, + .j = 3, + .token = "123", +- .dictionary_tag = dict_1, + .matched_word = "321", + .rank = 2, + .reversed = true, +@@ -372,7 +314,6 @@ TEST(ZxcvbnTest, ReverseDictionaryMatching) { + .i = 4, + .j = 6, + .token = "456", +- .dictionary_tag = dict_1, + .matched_word = "654", + .rank = 4, + .reversed = true, +@@ -428,24 +369,13 @@ TEST(ZxcvbnTest, L33tMatching) { + } + + { +- auto words = static_cast<DictionaryTag>(0); +- auto words2 = static_cast<DictionaryTag>(1); +- base::flat_map<DictionaryTag, RankedDict> dicts = { +- {words, +- { +- {"aac", 1}, +- {"password", 3}, +- {"paassword", 4}, +- {"asdf0", 5}, +- }}, +- {words2, +- { +- {"cgo", 1}, +- }}, ++ std::vector<std::vector<base::StringPiece>> dicts = { ++ {"aac", "password", "paassword", "asdf0"}, ++ {"cgo"}, + }; + + auto lm = [&](const std::string& password) { +- return l33t_match(password, convert_to_ranked_dicts(dicts), test_table); ++ return l33t_match(password, RankedDicts(dicts), test_table); + }; + + // doesn't match "" +@@ -459,29 +389,14 @@ TEST(ZxcvbnTest, L33tMatching) { + std::string password; + std::string pattern; + std::string word; +- DictionaryTag dictionary_tag; + rank_t rank; + idx_t i; + idx_t j; + std::unordered_map<std::string, std::string> sub; + } tests[] = { +- {"p4ssword", "p4ssword", "password", words, 3, 0, 7, {{"4", "a"}}}, +- {"p@ssw0rd", +- "p@ssw0rd", +- "password", +- words, +- 3, +- 0, +- 7, +- {{"@", "a"}, {"0", "o"}}}, +- {"aSdfO{G0asDfO", +- "{G0", +- "cgo", +- words2, +- 1, +- 5, +- 7, +- {{"{", "c"}, {"0", "o"}}}, ++ {"p4ssword", "p4ssword", "password", 2, 0, 7, {{"4", "a"}}}, ++ {"p@ssw0rd", "p@ssw0rd", "password", 2, 0, 7, {{"@", "a"}, {"0", "o"}}}, ++ {"aSdfO{G0asDfO", "{G0", "cgo", 1, 5, 7, {{"{", "c"}, {"0", "o"}}}, + }; + + for (const auto& test : tests) { +@@ -489,7 +404,6 @@ TEST(ZxcvbnTest, L33tMatching) { + .i = test.i, + .j = test.j, + .token = test.pattern, +- .dictionary_tag = test.dictionary_tag, + .matched_word = test.word, + .rank = test.rank, + .l33t = true, +@@ -503,7 +417,6 @@ TEST(ZxcvbnTest, L33tMatching) { + .i = 0, + .j = 2, + .token = "@a(", +- .dictionary_tag = words, + .matched_word = "aac", + .rank = 1, + .l33t = true, +@@ -513,7 +426,6 @@ TEST(ZxcvbnTest, L33tMatching) { + .i = 2, + .j = 4, + .token = "(go", +- .dictionary_tag = words2, + .matched_word = "cgo", + .rank = 1, + .l33t = true, +@@ -523,7 +435,6 @@ TEST(ZxcvbnTest, L33tMatching) { + .i = 5, + .j = 7, + .token = "{G0", +- .dictionary_tag = words2, + .matched_word = "cgo", + .rank = 1, + .l33t = true, +@@ -1018,8 +929,7 @@ TEST(ZxcvbnTest, DateMatching) { + TEST(ZxcvbnTest, Omnimatch) { + EXPECT_THAT(omnimatch(""), IsEmpty()); + +- SetRankedDicts( +- {{DictionaryTag::ENGLISH_WIKIPEDIA, {{"rosebud", 1}, {"maelstrom", 2}}}}); ++ SetRankedDicts(RankedDicts({{"rosebud", "maelstrom"}})); + std::string password = "r0sebudmaelstrom11/20/91aaaa"; + std::vector<Match> matches = omnimatch(password); +
diff --git a/tools/autotest.py b/tools/autotest.py index a964cd1..6372616 100755 --- a/tools/autotest.py +++ b/tools/autotest.py
@@ -456,8 +456,10 @@ # Note that this can happen, for example, if you rename a test target. print('gn config was changed, trying to build again', file=sys.stderr) targets = new_targets - build_ok = BuildTestTargetsWithNinja(out_dir, targets, args.dry_run) - if not build_ok: sys.exit(1) + if not BuildTestTargetsWithNinja(out_dir, targets, args.dry_run): + sys.exit(1) + else: # cache still valid, quit if the build failed + if not build_ok: sys.exit(1) RunTestTargets(out_dir, targets, gtest_filter, _extras, args.dry_run)
diff --git a/tools/clang/scripts/build.py b/tools/clang/scripts/build.py index a279ffe..74b0117c 100755 --- a/tools/clang/scripts/build.py +++ b/tools/clang/scripts/build.py
@@ -591,6 +591,8 @@ '-DENABLE_X86_RELAX_RELOCATIONS=NO', # See crbug.com/1126219: Use native symbolizer instead of DIA '-DLLVM_ENABLE_DIA_SDK=OFF', + # See crbug.com/1205046: don't build scudo (and others we don't need). + '-DCOMPILER_RT_SANITIZERS_TO_BUILD=asan;dfsan;msan;hwasan;tsan;cfi', ] if args.gcc_toolchain:
diff --git a/tools/json_schema_compiler/util.cc b/tools/json_schema_compiler/util.cc index c606085..0d144ca6 100644 --- a/tools/json_schema_compiler/util.cc +++ b/tools/json_schema_compiler/util.cc
@@ -40,12 +40,18 @@ } bool PopulateItem(const base::Value& from, bool* out) { - return from.GetAsBoolean(out); + if (out && from.is_bool()) { + *out = from.GetBool(); + return true; + } + return from.is_bool(); } bool PopulateItem(const base::Value& from, bool* out, std::u16string* error) { - if (!from.GetAsBoolean(out)) + if (!from.is_bool()) return ReportError(from, base::Value::Type::BOOLEAN, error); + if (out) + *out = from.GetBool(); return true; }
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index b833347..e7595c5 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -311,6 +311,8 @@ 'Site Isolation Android': 'android_release_bot_minimal_symbols_arm64', 'TSAN Debug (reclient)': 'tsan_disable_nacl_debug_bot_reclient', + 'TSAN Release (core-32) (goma)': 'tsan_disable_nacl_release_bot_reclient', + 'TSAN Release (core-32) (reclient)': 'tsan_disable_nacl_release_bot_reclient', 'TSAN Release (deps-cache) (reclient)': 'tsan_disable_nacl_release_bot_reclient', 'TSAN Release (deps-cache-full-files) (reclient)': 'tsan_disable_nacl_release_bot_reclient', 'TSAN Release (j-250) (reclient)': 'tsan_disable_nacl_release_bot_reclient', @@ -544,8 +546,6 @@ 'chromium.memory': { 'Android CFI': 'android_cfi_full_cfi_diag_thin_lto_release_static_dcheck_always_on_goma', - # TODO(crbug.com/1200574): Remove after migration. - 'Linux ASan LSan (bionic)': 'asan_lsan_release_trybot', 'Linux ASan LSan Builder': 'asan_lsan_release_trybot', 'Linux CFI': 'cfi_full_cfi_icall_cfi_diag_thin_lto_release_static_dcheck_always_on_goma', 'Linux Chromium OS ASan LSan Builder': 'asan_lsan_chromeos_release_trybot', @@ -1043,8 +1043,6 @@ 'linux-xenial-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', 'linux_chromium_archive_rel_ng': 'release_bot', 'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot', - # TODO(crbug.com/1200574): Remove after migration. - 'linux_chromium_asan_rel_ng_bionic': 'asan_lsan_release_trybot', 'linux_chromium_cfi_rel_ng': 'cfi_full_cfi_icall_cfi_diag_thin_lto_release_static_dcheck_always_on_goma', 'linux_chromium_chromeos_asan_rel_ng': 'asan_lsan_chromeos_release_trybot', 'linux_chromium_chromeos_msan_rel_ng': 'chromeos_msan_release_bot',
diff --git a/tools/mb/mb_config_expectations/chromium.fyi.json b/tools/mb/mb_config_expectations/chromium.fyi.json index 8486384a..ab0c491 100644 --- a/tools/mb/mb_config_expectations/chromium.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.fyi.json
@@ -243,6 +243,24 @@ "use_rbe": true } }, + "TSAN Release (core-32) (goma)": { + "gn_args": { + "enable_nacl": false, + "is_component_build": false, + "is_debug": false, + "is_tsan": true, + "use_rbe": true + } + }, + "TSAN Release (core-32) (reclient)": { + "gn_args": { + "enable_nacl": false, + "is_component_build": false, + "is_debug": false, + "is_tsan": true, + "use_rbe": true + } + }, "TSAN Release (deps-cache) (reclient)": { "gn_args": { "enable_nacl": false,
diff --git a/tools/mb/mb_config_expectations/chromium.memory.json b/tools/mb/mb_config_expectations/chromium.memory.json index d99e024..7ec65649 100644 --- a/tools/mb/mb_config_expectations/chromium.memory.json +++ b/tools/mb/mb_config_expectations/chromium.memory.json
@@ -14,17 +14,6 @@ "use_thin_lto": true } }, - "Linux ASan LSan (bionic)": { - "gn_args": { - "dcheck_always_on": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "symbol_level": 1, - "use_goma": true - } - }, "Linux ASan LSan Builder": { "gn_args": { "dcheck_always_on": true,
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.linux.json b/tools/mb/mb_config_expectations/tryserver.chromium.linux.json index 40190dbf..86355c0 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.linux.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.linux.json
@@ -799,17 +799,6 @@ "use_goma": true } }, - "linux_chromium_asan_rel_ng_bionic": { - "gn_args": { - "dcheck_always_on": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "symbol_level": 1, - "use_goma": true - } - }, "linux_chromium_cfi_rel_ng": { "gn_args": { "dcheck_always_on": true,
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index e5762b99..79cff3d 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -896,6 +896,13 @@ <description>Please enter the description of this user action.</description> </action> +<action name="Accel_Open_Calculator"> + <owner>cros-peripherals@google.com</owner> + <description> + Records when the calculator is launched from an accelerator. + </description> +</action> + <action name="Accel_Open_Crosh"> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <description>Please enter the description of this user action.</description> @@ -28205,6 +28212,8 @@ label="For the Previews UI in the Android Omnibox feature."/> <suffix name="ProfileSwitch" label="In product help for switching profiles using the profile menu."/> + <suffix name="PwaInstallAvailableFeature" + label="For Android PWA install menu."/> <suffix name="QuietNotificationPrompts" label="For the quiet notification prompts feature."/> <suffix name="ReadingListDiscovery"
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index a861ed5..4ddc2202 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -10297,6 +10297,9 @@ </enum> <enum name="CellularConnectResult"> + <obsolete> + Deprecated as of 04/2021. + </obsolete> <int value="0" label="Unknown"/> <int value="1" label="Invalid GUID"/> <int value="2" label="Invalid state"/> @@ -24351,6 +24354,7 @@ <int value="855" label="LacrosAvailability"/> <int value="856" label="DataLeakPreventionReportingEnabled"/> <int value="857" label="AdditionalDnsQueryTypesEnabled"/> + <int value="858" label="TripleDESEnabled"/> </enum> <enum name="EnterprisePolicyDeviceIdValidity"> @@ -25610,6 +25614,7 @@ <int value="474" label="TAB_GROUPS_ON_UPDATED"/> <int value="475" label="FILE_MANAGER_PRIVATE_ON_DRIVE_CONFIRM_DIALOG"/> <int value="476" label="TTS_ENGINE_ON_SPEAK_WITH_AUDIO_STREAM"/> + <int value="477" label="ACCESSIBILITY_PRIVATE_ON_SHOW_CHROMEVOX_TUTORIAL"/> </enum> <enum name="ExtensionFileWriteResult"> @@ -32368,6 +32373,7 @@ <int value="3888" label="WebGPU"/> <int value="3889" label="CSSFilterColorMatrix"/> <int value="3890" label="HTMLFencedFrameElement"/> + <int value="3891" label="CSSFilterLuminanceToAlpha"/> </enum> <enum name="FeaturePolicyAllowlistType"> @@ -45741,6 +45747,7 @@ <int value="-907234795" label="NewAudioRenderingMixingStrategy:disabled"/> <int value="-905538983" label="SimplifyHttpsIndicator:disabled"/> <int value="-902125579" label="ImmersiveUiMode:disabled"/> + <int value="-900871741" label="DesktopPWAsNotificationIconAndTitle:disabled"/> <int value="-899915066" label="ImprovedKeyboardShortcuts:disabled"/> <int value="-899393472" label="enable-new-app-menu-icon"/> <int value="-899334103" label="disable-fast-text-autosizing"/> @@ -46906,6 +46913,7 @@ label="HappinessTrackingSurveysForDesktopDevToolsIssuesCookiesSameSite:enabled"/> <int value="139569991" label="SharingDeviceExpiration:disabled"/> <int value="143725809" label="DownloadProgressInfoBar:enabled"/> + <int value="144868136" label="DesktopPWAsNotificationIconAndTitle:enabled"/> <int value="146229312" label="WebPaymentsExperimentalFeatures:enabled"/> <int value="146553675" label="BookmarkBottomSheet:disabled"/> <int value="147342055" label="ChromeHomeClearUrlOnOpen:disabled"/> @@ -57068,6 +57076,14 @@ <int value="7" label="Cancelled"/> </enum> +<enum name="OfflineMeasurementsUserState"> + <int value="0" label="Invalid"/> + <int value="1" label="Phone is off"/> + <int value="2" label="Phone is on, but screen is off"/> + <int value="3" label="Screen is on, Chrome is not in the foreground"/> + <int value="4" label="Screen is on, Chrome is in the foreground"/> +</enum> + <enum name="OfflinePagePrefetchNotificationAction"> <int value="0" label="Attempt to show pending content check"/> <int value="1" label="Showed notification"/> @@ -63974,9 +63990,9 @@ <int value="8" label="REGISTER_PROMO_SELECTED"/> <int value="9" label="ACCOUNT_CHANGED"/> <int value="10" label="ADD_ACCOUNT_SELECTED"/> - <int value="11" label="INVITATION_AVAILABLE"/> - <int value="12" label="INVITATION_ACCEPTED"/> - <int value="13" label="INVITATION_REJECTED"/> + <int value="11" label="INVITATION_AVAILABLE_DEPRECATED"/> + <int value="12" label="INVITATION_ACCEPTED_DEPRECATED"/> + <int value="13" label="INVITATION_REJECTED_DEPRECATED"/> <int value="14" label="MANAGE_BUTTON_CLICKED"/> </enum> @@ -71672,6 +71688,25 @@ <int value="4" label="Drag is canceled instead of ending normally"/> </enum> +<enum name="ShillCellularConnectResult"> + <int value="0" label="Success"/> + <int value="1" label="Unknown"/> + <int value="2" label="Failed to connect"/> + <int value="3" label="DHCP Failure"/> + <int value="4" label="DNS Lookup Failure"/> + <int value="5" label="EAP Authentication"/> + <int value="6" label="Eap Local Tls"/> + <int value="7" label="Eap Remote Tls"/> + <int value="8" label="Out of Range"/> + <int value="9" label="Pin Missing"/> + <int value="10" label="No failure"/> + <int value="11" label="Not Associated"/> + <int value="12" label="Not Authenticated"/> + <int value="13" label="Too Many STAs"/> + <int value="14" label="Bad Passphrase"/> + <int value="15" label="Bad Wep Key"/> +</enum> + <enum name="ShillSuspendTerminationDarkResumeActionResult"> <summary> The termination/suspend/dark resume action result types come from @@ -75721,6 +75756,9 @@ </enum> <enum name="SurveyDownloadResponseCodes"> + <obsolete> + Removed as of 05/2021. + </obsolete> <int value="-1" label="Response code missing"/> <int value="0" label="Survey downloaded"/> <int value="1" label="No survey available"/> @@ -79773,6 +79811,24 @@ <int value="3" label="Not required and not available"/> </enum> +<enum name="UserInitiatedCellularConnectResult"> + <int value="0" label="Success"/> + <int value="1" label="Unknown"/> + <int value="2" label="Invalid GUID"/> + <int value="3" label="Invalid State"/> + <int value="4" label="Canceled"/> + <int value="5" label="Not configured"/> + <int value="6" label="Blocked"/> + <int value="7" label="Cellular Inhibit Failure"/> + <int value="8" label="ESim profile issue"/> + <int value="9" label="Cellular out of credits"/> + <int value="10" label="Sim locked"/> + <int value="11" label="Connect failed"/> + <int value="12" label="Not connected"/> + <int value="13" label="Activate Failed"/> + <int value="14" label="Enabled or disabled when not available"/> +</enum> + <enum name="UserInitiatedEvent"> <int value="0" label="WiFi Scan"/> </enum>
diff --git a/tools/metrics/histograms/histograms_xml/METRIC_REVIEWER_OWNERS b/tools/metrics/histograms/histograms_xml/METRIC_REVIEWER_OWNERS index cdaa440..86bfe951 100644 --- a/tools/metrics/histograms/histograms_xml/METRIC_REVIEWER_OWNERS +++ b/tools/metrics/histograms/histograms_xml/METRIC_REVIEWER_OWNERS
@@ -7,8 +7,10 @@ cthomp@chromium.org curranmax@chromium.org dschinazi@chromium.org +eirage@chromium.org ender@chromium.org harrisonsean@chromium.org +iclelland@chromium.org javierrobles@chromium.org lizeb@chromium.org lyf@chromium.org
diff --git a/tools/metrics/histograms/histograms_xml/accessibility/histograms.xml b/tools/metrics/histograms/histograms_xml/accessibility/histograms.xml index 6796d3e..fee65cc 100644 --- a/tools/metrics/histograms/histograms_xml/accessibility/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/accessibility/histograms.xml
@@ -999,6 +999,40 @@ </summary> </histogram> +<histogram name="Accessibility.Performance.ProcessDeferredAccessibilityEvents" + units="ms" expires_after="M93"> + <owner>dmazzoni@chromium.org</owner> + <owner>janewman@microsoft.com</owner> + <owner>chrome-a11y-core@google.com</owner> + <summary> + Tracks time spent on the render process processing deferred accessibility + events. Logged each time the method is run during the accessbility document + lifecycle. + </summary> +</histogram> + +<histogram name="Accessibility.Performance.SendPendingAccessibilityEvents" + units="ms" expires_after="M93"> + <owner>dmazzoni@chromium.org</owner> + <owner>janewman@microsoft.com</owner> + <owner>chrome-a11y-core@google.com</owner> + <summary> + Tracks time spent on the render process sending pending accessibility + events. Logged each time the method is run without returning early. + </summary> +</histogram> + +<histogram name="Accessibility.Performance.Tree.Unserialize" units="ms" + expires_after="M93"> + <owner>dmazzoni@chromium.org</owner> + <owner>janewman@microsoft.com</owner> + <owner>chrome-a11y-core@google.com</owner> + <summary> + Tracks time spent on the browser process unserializing accessibility + updates. Logged each time the method is run without returning early. + </summary> +</histogram> + <histogram name="Accessibility.Performance.WinAPIs.{API}" units="microseconds" expires_after="M93"> <owner>dmazzoni@chromium.org</owner>
diff --git a/tools/metrics/histograms/histograms_xml/android/histograms.xml b/tools/metrics/histograms/histograms_xml/android/histograms.xml index 99a4ad26..5fcb7d2 100644 --- a/tools/metrics/histograms/histograms_xml/android/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/android/histograms.xml
@@ -2347,6 +2347,9 @@ <histogram name="Android.Survey.DownloadRequested" enum="BooleanRequested" expires_after="2021-06-01"> + <obsolete> + Deprecated as of 05/2021. Replaced with Android.Survey.DownloadRequested2 + </obsolete> <owner>twellington@chromium.org</owner> <owner>clank-app-team@google.com</owner> <summary> @@ -2355,16 +2358,32 @@ </summary> </histogram> +<histogram name="Android.Survey.DownloadRequested2" enum="BooleanRequested" + expires_after="2022-06-01"> + <owner>twellington@chromium.org</owner> + <owner>wenyufu@chromium.org</owner> + <owner>clank-app-team@google.com</owner> + <summary> + Recorded when a survey download is requested. If the download has been + attemped, but the download request is not sent (e.g. user is not signed-in), + 'not requested' will be recorded. + </summary> +</histogram> + <histogram name="Android.Survey.DownloadResponseCode" enum="SurveyDownloadResponseCodes" expires_after="2021-06-01"> + <obsolete> + Deprecated as of 05/2021. + </obsolete> <owner>twellington@chromium.org</owner> <owner>clank-app-team@google.com</owner> <summary>The response code of the completed survey download request.</summary> </histogram> <histogram name="Android.Survey.InfoBarClosingState" - enum="InfoBarClosingStates" expires_after="2021-06-01"> + enum="InfoBarClosingStates" expires_after="2022-06-01"> <owner>twellington@chromium.org</owner> + <owner>wenyufu@chromium.org</owner> <owner>clank-app-team@google.com</owner> <summary> If the infobar was visible when it was closed and if it was closed directly @@ -2373,8 +2392,9 @@ </histogram> <histogram name="Android.Survey.ShowSurvey" enum="BooleanSuccess" - expires_after="2021-06-01"> + expires_after="2022-06-01"> <owner>twellington@chromium.org</owner> + <owner>wenyufu@chromium.org</owner> <owner>clank-app-team@google.com</owner> <summary> Whether or not the survey was successfully shown after its download. @@ -2382,8 +2402,9 @@ </histogram> <histogram name="Android.Survey.SurveyFilteringResults" - enum="SurveyFilteringResult" expires_after="2021-10-04"> + enum="SurveyFilteringResult" expires_after="2022-06-01"> <owner>twellington@chromium.org</owner> + <owner>wenyufu@chromium.org</owner> <owner>clank-app-team@google.com</owner> <summary> The result of the survey filtering process. Each enum represents a different
diff --git a/tools/metrics/histograms/histograms_xml/apps/histograms.xml b/tools/metrics/histograms/histograms_xml/apps/histograms.xml index 3416ecd..1144233 100644 --- a/tools/metrics/histograms/histograms_xml/apps/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/apps/histograms.xml
@@ -2019,6 +2019,18 @@ <token key="AppType" variants="AppType"/> </histogram> +<histogram name="Apps.RunningPercentage.{AppType}" units="%" + expires_after="2021-10-28"> + <owner>dominickn@chromium.org</owner> + <owner>nancylingwang@chromium.org</owner> + <summary> + Recorded the app running duration percentage for {AppType} in Chrome OS. + This is logged when more than 24 hours pass after last log, or during the + system startup phase if more than 24 hours passed after last log. + </summary> + <token key="AppType" variants="AppType"/> +</histogram> + <histogram name="Apps.ScrollableShelf.AnimationSmoothness" units="%" expires_after="2021-08-01"> <!-- Name completed by histogram suffixes
diff --git a/tools/metrics/histograms/histograms_xml/arc/histograms.xml b/tools/metrics/histograms/histograms_xml/arc/histograms.xml index 7110d03..4b2d3ad9 100644 --- a/tools/metrics/histograms/histograms_xml/arc/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/arc/histograms.xml
@@ -837,7 +837,7 @@ </histogram> <histogram name="Arc.PrintPreview.PreviewEvent" enum="PrintPreviewHelperEvents" - expires_after="2021-06-01"> + expires_after="2021-10-04"> <owner>bmgordon@chromium.org</owner> <owner>project-bolton@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/histograms_xml/assistant/histograms.xml b/tools/metrics/histograms/histograms_xml/assistant/histograms.xml index 5d28213..a90254d 100644 --- a/tools/metrics/histograms/histograms_xml/assistant/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/assistant/histograms.xml
@@ -53,7 +53,7 @@ </histogram> <histogram name="Assistant.ButtonClickCount" enum="AssistantButtonId" - expires_after="2021-04-11"> + expires_after="2022-04-11"> <owner>xiaohuic@chromium.org</owner> <owner>meilinw@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/histograms_xml/blink/OWNERS b/tools/metrics/histograms/histograms_xml/blink/OWNERS index c4e3f2e..86fc249 100644 --- a/tools/metrics/histograms/histograms_xml/blink/OWNERS +++ b/tools/metrics/histograms/histograms_xml/blink/OWNERS
@@ -2,6 +2,7 @@ # Prefer sending CLs to the owners listed below. # Use chromium-metrics-reviews@google.com as a backup. +iclelland@chromium.org schenney@chromium.org # For BlinkGC.* and related changes. mlippautz@chromium.org
diff --git a/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml b/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml index b97f7fc..dd25941 100644 --- a/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml +++ b/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml
@@ -8235,6 +8235,8 @@ label="In product help for the Previews UI in the Android Omnibox."/> <suffix name="IPH_ProfileSwitch" label="In product help for switching profiles using the profile menu."/> + <suffix name="IPH_PwaInstallAvailableFeature" + label="In product help for surfacing the Android PWA install option."/> <suffix name="IPH_QuietNotificationPrompts" label="For the quiet notification prompts feature."/> <suffix name="IPH_ReadingListDiscovery"
diff --git a/tools/metrics/histograms/histograms_xml/input/histograms.xml b/tools/metrics/histograms/histograms_xml/input/histograms.xml index c90fcca4..41244a7a 100644 --- a/tools/metrics/histograms/histograms_xml/input/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/input/histograms.xml
@@ -156,7 +156,7 @@ </histogram> <histogram name="InputMethod.Assistive.NotAllowed" enum="IMEAssistiveAction" - expires_after="2021-05-16"> + expires_after="2021-09-19"> <owner>jiwan@google.com</owner> <owner>essential-inputs-team@google.com</owner> <summary> @@ -490,6 +490,28 @@ </summary> </histogram> +<histogram name="InputMethod.MouseWheel.ScrollCharacters" units="characters" + expires_after="2021-11-01"> + <owner>flackr@chromium.org</owner> + <owner>shawnpi@microsoft.com</owner> + <summary> + Records for each horizontal mouse wheel event the Windows system setting for + number of characters to horizontally scroll for each wheel tick. Used to + determine how this system setting impacts scroll velocity. + </summary> +</histogram> + +<histogram name="InputMethod.MouseWheel.ScrollLines" units="lines" + expires_after="2021-11-01"> + <owner>flackr@chromium.org</owner> + <owner>shawnpi@microsoft.com</owner> + <summary> + Records for each vertical mouse wheel event the Windows system setting for + number of lines to vertically scroll for each wheel tick. Used to determine + how this system setting impacts scroll velocity. + </summary> +</histogram> + <histogram name="InputMethod.MultilingualExperiment.Autocorrect.Actions" enum="IMEAutocorrectActions" expires_after="2021-06-30"> <owner>tranbaoduy@google.com</owner>
diff --git a/tools/metrics/histograms/histograms_xml/media/histograms.xml b/tools/metrics/histograms/histograms_xml/media/histograms.xml index fa2fa3bc..0d64f9ff 100644 --- a/tools/metrics/histograms/histograms_xml/media/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/media/histograms.xml
@@ -3452,10 +3452,16 @@ </summary> </histogram> -<histogram name="Media.RTCVideoDecoderError" enum="VideoDecodeAcceleratorError" - expires_after="M82"> +<histogram name="Media.RTCVideoDecoderError" enum="MediaStatusCode" + expires_after="2021-08-15"> <owner>posciak@chromium.org</owner> - <summary>Counts of video decode errors reported to RTCVideoDecoder.</summary> + <owner>liberato@chromium.org</owner> + <owner>webrtc-video@google.com</owner> + <summary> + Counts of video decode errors reported to RTCVideoDecoder, recorded when an + error is reportd to RTCVideoDecoder. Also used for DecoderStream. Expired in + M83 and re-added in M92. + </summary> </histogram> <histogram name="Media.RTCVideoDecoderFallbackReason.{Codecs}" @@ -3464,6 +3470,7 @@ <owner>webrtc-video@google.com</owner> <summary> The reason for fallback to software decoding for the codec {Codecs}. + Reported when a fallback to software decoding occurs. </summary> <token key="Codecs"> <variant name="H264" summary=""/> @@ -3525,6 +3532,16 @@ </summary> </histogram> +<histogram name="Media.RTCVideoDecoderStream.Error.OnFrameReady" + enum="MediaStatusCode" expires_after="2021-08-15"> + <owner>liberato@chromium.org</owner> + <owner>webrtc-video@google.com</owner> + <summary> + This records the media::StatusCode from the RTCVideoDecoderStreamAdapter. It + is emitted when the adapter encounters an error during decoding. + </summary> +</histogram> + <histogram name="Media.RTCVideoEncoderInitEncodeSuccess" enum="BooleanSuccess" expires_after="never"> <!-- expires-never: WebRTC health metric. -->
diff --git a/tools/metrics/histograms/histograms_xml/network/histograms.xml b/tools/metrics/histograms/histograms_xml/network/histograms.xml index 60e8892..808b49de 100644 --- a/tools/metrics/histograms/histograms_xml/network/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/network/histograms.xml
@@ -340,8 +340,46 @@ </token> </histogram> +<histogram name="Network.Cellular.{SimType}.ConnectionResult.All" + enum="ShillCellularConnectResult" expires_after="2022-04-01"> + <owner>azeemarshad@chromium.org</owner> + <owner>cros-connectivity@google.com</owner> + <owner>hsuregan@chromium.org</owner> + <summary> + Tracks the result of all connection attempts. A success is emitted when a + {SimType} network becomes connected from a non-connected state. When a + {SimType} network goes from a connecting state to a disconnected state, a + shill failure reason is emitted. + </summary> + <token key="SimType"> + <variant name="ESim"/> + <variant name="PSim"/> + </token> +</histogram> + +<histogram name="Network.Cellular.{SimType}.ConnectionResult.UserInitiated" + enum="UserInitiatedCellularConnectResult" expires_after="2022-04-01"> + <owner>azeemarshad@chromium.org</owner> + <owner>cros-connectivity@google.com</owner> + <owner>hsuregan@chromium.org</owner> + <summary> + Tracks the result of a user initiated connection attempt. Logged when a + {SimType} connection succeeds or fails. This histogram logs failure reasons + exposed by NetworkConnectionHandler. + </summary> + <token key="SimType"> + <variant name="ESim"/> + <variant name="PSim"/> + </token> +</histogram> + <histogram name="Network.Cellular.{SimType}.ConnectionSuccess" enum="CellularConnectResult" expires_after="2022-03-01"> + <obsolete> + Removed 04/2021. Split to + Network.Cellular.{SimType}.ConnectionResult.UserInitiated and + Network.Cellular.{SimType}.ConnectionResult.All. + </obsolete> <owner>azeemarshad@chromium.org</owner> <owner>cros-connectivity@google.com</owner> <owner>hsuregan@chromium.org</owner>
diff --git a/tools/metrics/histograms/histograms_xml/offline/histograms.xml b/tools/metrics/histograms/histograms_xml/offline/histograms.xml index 0cf1f9b..fb60e85 100644 --- a/tools/metrics/histograms/histograms_xml/offline/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/offline/histograms.xml
@@ -90,6 +90,21 @@ </summary> </histogram> +<histogram name="Offline.Measurements.UserState" + enum="OfflineMeasurementsUserState" expires_after="M95"> + <owner>curranmax@chromium.org</owner> + <owner>tbansal@chromium.org</owner> + <summary> + The state of the phone and how the user is interacting with it when the + Offline Measurements background task runs. + + Each time the background task runs, it determines the user state, and then + that value is stored to prefs. At a later time, when Chrome is starting up, + all stored values are recorded to this histogram. The stored values are then + cleared so they are only recorded once each. + </summary> +</histogram> + <histogram name="OfflineIndicator.ConnectivityChanged.DeviceState.Offline" enum="OfflineIndicatorSurfaceState" expires_after="2021-09-12"> <owner>curranmax@chromium.org</owner>
diff --git a/tools/metrics/histograms/histograms_xml/others/OWNERS b/tools/metrics/histograms/histograms_xml/others/OWNERS index 41f197a7..1d1d14ac5 100644 --- a/tools/metrics/histograms/histograms_xml/others/OWNERS +++ b/tools/metrics/histograms/histograms_xml/others/OWNERS
@@ -8,3 +8,5 @@ sebmarchand@chromium.org # For display, mouse, and input related histograms. zentaro@chromium.org +# For the TrustedWebActivity.* histograms: +eirage@chromium.org
diff --git a/tools/metrics/histograms/histograms_xml/renderer/histograms.xml b/tools/metrics/histograms/histograms_xml/renderer/histograms.xml index 9d8ea90..5f1bc88 100644 --- a/tools/metrics/histograms/histograms_xml/renderer/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/renderer/histograms.xml
@@ -271,6 +271,20 @@ </summary> </histogram> +<histogram name="Renderer.ProcessLifetime.{Resolution}" units="ms" + expires_after="2021-08-29"> + <owner>olivierli@chromium.org</owner> + <owner>catan-team@chromium.org</owner> + <summary> + The total time for which a renderer process was live. Recorded when the + browser identifies the process as having gone away. + </summary> + <token key="Resolution"> + <variant name="HighResolution" summary="Tops out at 5 minutes."/> + <variant name="LowResolution" summary="Tops out at 24 hours"/> + </token> +</histogram> + <histogram name="Renderer.ViewportZoomBugCount" enum="BooleanHit" expires_after="M77"> <owner>kkhorimoto@chromium.org</owner>
diff --git a/tools/metrics/histograms/histograms_xml/uma/histograms.xml b/tools/metrics/histograms/histograms_xml/uma/histograms.xml index 74e8316..d8f2d9d 100644 --- a/tools/metrics/histograms/histograms_xml/uma/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/uma/histograms.xml
@@ -64,7 +64,7 @@ </histogram> <histogram name="UMA.CleanExitBeaconConsistency" enum="UmaCleanExitConsistency" - expires_after="2021-07-22"> + expires_after="2021-10-31"> <owner>asvitkine@chromium.org</owner> <owner>justincohen@chromium.org</owner> <owner>olivierrobin@chromium.org</owner> @@ -145,7 +145,7 @@ </histogram> <histogram name="UMA.FileMetricsProvider.MergeHistogram.{Type}" - enum="HistogramNameHash" expires_after="2021-06-20"> + enum="HistogramNameHash" expires_after="2021-10-31"> <owner>asvitkine@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -287,7 +287,7 @@ </histogram> <histogram name="UMA.LogUpload.ResponseOrErrorCode.HTTP" - enum="CombinedHttpResponseAndNetErrorCode" expires_after="2021-08-22"> + enum="CombinedHttpResponseAndNetErrorCode" expires_after="2021-10-31"> <owner>holte@chromium.org</owner> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> @@ -351,7 +351,7 @@ </histogram> <histogram name="UMA.MetricsReporting.Toggle" enum="MetricsReportingChange" - expires_after="2021-04-15"> + expires_after="2021-10-31"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -361,7 +361,7 @@ </histogram> <histogram name="UMA.MetricsService.Initialize" enum="Boolean" - expires_after="2021-08-15"> + expires_after="2021-10-31"> <owner>rkaplow@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -371,14 +371,14 @@ </histogram> <histogram name="UMA.MetricsService.Initialize.Time" units="ms" - expires_after="2021-06-13"> + expires_after="2021-10-31"> <owner>asvitkine@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary>Time taken by MetricsService::InitializeMetricsState().</summary> </histogram> <histogram name="UMA.NegativeSamples.Histogram" enum="HistogramNameHash" - expires_after="2021-10-25"> + expires_after="2021-10-31"> <owner>asvitkine@chromium.org</owner> <owner>bcwhite@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> @@ -388,7 +388,7 @@ </histogram> <histogram name="UMA.NegativeSamples.Increment" units="increment" - expires_after="2021-04-15"> + expires_after="2021-10-31"> <owner>asvitkine@chromium.org</owner> <owner>bcwhite@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> @@ -398,7 +398,7 @@ </histogram> <histogram name="UMA.NegativeSamples.Reason" enum="NegativeSampleReason" - expires_after="2021-04-15"> + expires_after="2021-10-31"> <owner>asvitkine@chromium.org</owner> <owner>bcwhite@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> @@ -433,7 +433,7 @@ </histogram> <histogram name="UMA.PersistentHistograms.HistogramsInStartupFile" - enum="HistogramNameHash" expires_after="2021-06-20"> + enum="HistogramNameHash" expires_after="2021-10-31"> <owner>asvitkine@chromium.org</owner> <owner>chrome-metrics-team@google.com</owner> <summary> @@ -609,7 +609,7 @@ </histogram> <histogram name="UMA.UnsentLogs.DroppedSize" units="bytes" - expires_after="2021-08-30"> + expires_after="2021-10-31"> <owner>akirabaruah@chromium.org</owner> <owner>rkaplow@chromium.org</owner> <owner>asvitkine@chromium.org</owner>
diff --git a/tools/metrics/histograms/histograms_xml/web_apk/OWNERS b/tools/metrics/histograms/histograms_xml/web_apk/OWNERS index 3249a7e3..536ddeb 100644 --- a/tools/metrics/histograms/histograms_xml/web_apk/OWNERS +++ b/tools/metrics/histograms/histograms_xml/web_apk/OWNERS
@@ -2,4 +2,5 @@ # Prefer sending CLs to the owners listed below. # Use chromium-metrics-reviews@google.com as a backup. +eirage@chromium.org rayankans@chromium.org
diff --git a/tools/metrics/histograms/histograms_xml/web_apk/histograms.xml b/tools/metrics/histograms/histograms_xml/web_apk/histograms.xml index 64d9a74..09c4f3b0 100644 --- a/tools/metrics/histograms/histograms_xml/web_apk/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/web_apk/histograms.xml
@@ -203,9 +203,7 @@ The length of a WebAPK session (launch/foregrounding to backgrounding) in milliseconds. {WebApkDistributorType} </summary> - <token key="WebApkDistributorType" variants="WebApkDistributorType"> - <variant name=""/> - </token> + <token key="WebApkDistributorType" variants="WebApkDistributorType"/> </histogram> <histogram name="WebApk.ShellApkVersion2{WebApkDistributorType}" units="units"
diff --git a/tools/perf/benchmark.csv b/tools/perf/benchmark.csv index 4058d27..0406a40f 100644 --- a/tools/perf/benchmark.csv +++ b/tools/perf/benchmark.csv
@@ -3,10 +3,10 @@ Googlers can view additional information about internal perf infrastructure at,https://goto.google.com/chrome-benchmarking-sheet Benchmark name,Individual owners,Component,Documentation,Tags UNSCHEDULED_blink_perf.performance_apis,yoavweiss@chromium.org,Blink>PerformanceAPIs,https://bit.ly/blink-perf-benchmarks,all -UNSCHEDULED_blink_perf.service_worker,"shimazu@chromium.org, falken@chromium.org, ting.shao@intel.com",Blink>ServiceWorker,https://bit.ly/blink-perf-benchmarks,all -UNSCHEDULED_loading.mbi,blink-isolation-dev@chromium.org,Blink>Internals>Modularization,https://bit.ly/loading-benchmarks,"all,many_agents" -UNSCHEDULED_v8.loading_desktop,"mythria@chromium.org, tmrts@chromium.org, almuthanna@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2016,2018,2019,2020,all,emerging_market,health_check,international,javascript_heavy" -UNSCHEDULED_v8.loading_mobile,"mythria@chromium.org, tmrts@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2016,2018,2019,2020,all,emerging_market,health_check,international,javascript_heavy" +UNSCHEDULED_blink_perf.service_worker,"shimazu@chromium.org, falken@chromium.org, ting.shao@intel.com",Blink>ServiceWorker,https://bit.ly/blink-perf-benchmarks, +UNSCHEDULED_loading.mbi,blink-isolation-dev@chromium.org,Blink>Internals>Modularization,https://bit.ly/loading-benchmarks,many_agents +UNSCHEDULED_v8.loading_desktop,"mythria@chromium.org, tmrts@chromium.org, almuthanna@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2016,2018,2019,2020,emerging_market,health_check,international,javascript_heavy" +UNSCHEDULED_v8.loading_mobile,"mythria@chromium.org, tmrts@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2016,2018,2019,2020,emerging_market,health_check,international,javascript_heavy" base_perftests,"skyostil@chromium.org, gab@chromium.org",Internals>SequenceManager,https://chromium.googlesource.com/chromium/src/+/HEAD/base/README.md#performance-testing, blink_perf.accessibility,dmazzoni@chromium.org,Blink>Accessibility,https://bit.ly/blink-perf-benchmarks,all blink_perf.bindings,"jbroman@chromium.org, yukishiino@chromium.org, haraken@chromium.org",Blink>Bindings,https://bit.ly/blink-perf-benchmarks,all @@ -23,34 +23,34 @@ blink_perf.shadow_dom,masonf@chromium.org,Blink>DOM>ShadowDOM,https://bit.ly/blink-perf-benchmarks,all blink_perf.svg,"fs@opera.com, pdr@chromium.org",Blink>SVG,https://bit.ly/blink-perf-benchmarks,all blink_perf.webaudio,"hongchan@chromium.org, rtoy@chromium.org",Blink>WebAudio,https://bit.ly/blink-perf-benchmarks,all -blink_perf.webgl,"kbr@chromium.org, enga@chromium.org, webgl-team@google.com",Blink>WebGL,https://bit.ly/blink-perf-benchmarks,all -blink_perf.webgl_fast_call,"kbr@chromium.org, enga@chromium.org, mslekova@chromium.org, webgl-team@google.com",Blink>WebGL,https://bit.ly/blink-perf-benchmarks,all -blink_perf.webgpu,"enga@chromium.org, cwallez@chromium.org, webgpu-developers@google.com",Blink>WebGPU,https://bit.ly/blink-perf-benchmarks,all -blink_perf.webgpu_fast_call,"enga@chromium.org, cwallez@chromium.org, mslekova@chromium.org, webgpu-developers@google.com",Blink>WebGPU,https://bit.ly/blink-perf-benchmarks,all +blink_perf.webgl,"kbr@chromium.org, enga@chromium.org, webgl-team@google.com",Blink>WebGL,https://bit.ly/blink-perf-benchmarks, +blink_perf.webgl_fast_call,"kbr@chromium.org, enga@chromium.org, mslekova@chromium.org, webgl-team@google.com",Blink>WebGL,https://bit.ly/blink-perf-benchmarks, +blink_perf.webgpu,"enga@chromium.org, cwallez@chromium.org, webgpu-developers@google.com",Blink>WebGPU,https://bit.ly/blink-perf-benchmarks, +blink_perf.webgpu_fast_call,"enga@chromium.org, cwallez@chromium.org, mslekova@chromium.org, webgpu-developers@google.com",Blink>WebGPU,https://bit.ly/blink-perf-benchmarks, chrome_sizes,"heiserya@chromium.org, johnchen@chromium.org",Build,https://chromium.googlesource.com/chromium/src/+/HEAD/tools/binary_size/README.md#resource_sizes_py, components_perftests,csharrison@chromium.org,,, dawn_perf_tests,"enga@chromium.org, chrome-gpu-perf-owners@chromium.org",Internals>GPU>Dawn,https://dawn.googlesource.com/dawn/+/HEAD/src/tests/perf_tests/README.md, -desktop_ui,"yuhengh@chromium.org, tluk@chromium.org, romanarora@chromium.org",UI>Browser,https://chromium.googlesource.com/chromium/src/+/master/docs/speed/benchmark/harnesses/desktop_ui.md,all -dromaeo,"jbroman@chromium.org, yukishiino@chromium.org, haraken@chromium.org",Blink>Bindings,,all -dummy_benchmark.noisy_benchmark_1,"johnchen@chromium.org, wenbinzhang@google.com",Test>Telemetry,,all -dummy_benchmark.stable_benchmark_1,"johnchen@chromium.org, wenbinzhang@google.com",Test>Telemetry,,all +desktop_ui,"yuhengh@chromium.org, tluk@chromium.org, romanarora@chromium.org",UI>Browser,https://chromium.googlesource.com/chromium/src/+/main/docs/speed/benchmark/harnesses/desktop_ui.md, +dromaeo,"jbroman@chromium.org, yukishiino@chromium.org, haraken@chromium.org",Blink>Bindings,, +dummy_benchmark.noisy_benchmark_1,"johnchen@chromium.org, wenbinzhang@google.com",Test>Telemetry,, +dummy_benchmark.stable_benchmark_1,"johnchen@chromium.org, wenbinzhang@google.com",Test>Telemetry,, gpu_perftests,"reveman@chromium.org, chrome-gpu-perf-owners@chromium.org",Internals>GPU,, -jetstream,hablich@chromium.org,Blink>JavaScript,,all -jetstream2,"hablich@chromium.org, tcwang@chromium.org",Blink>JavaScript,https://browserbench.org/JetStream/in-depth.html,all -kraken,hablich@chromium.org,Blink>JavaScript,,all +jetstream,hablich@chromium.org,Blink>JavaScript,, +jetstream2,"hablich@chromium.org, tcwang@chromium.org",Blink>JavaScript,https://browserbench.org/JetStream/in-depth.html, +kraken,hablich@chromium.org,Blink>JavaScript,, load_library_perf_tests,"xhwang@chromium.org, jrummell@chromium.org",Internals>Media>Encrypted,, -loading.desktop,"kouhei@chromium.org, ksakamoto@chromium.org",Blink>Loader,https://bit.ly/loading-benchmarks,"abridged,all,cache_temperature_cold,cache_temperature_warm,international,intl_ar_fa_he,intl_es_fr_pt_BR,intl_hi_ru,intl_ja_zh,intl_ko_th_vi,typical" -loading.mobile,"kouhei@chromium.org, ksakamoto@chromium.org",Blink>Loader,https://bit.ly/loading-benchmarks,"abridged,all,cache_temperature_cold,cache_temperature_hot,cache_temperature_warm,easy_ttfmp,easy_tti,global,pwa,tough_ttfmp,tough_tti" -media.desktop,dalecurtis@chromium.org,Internals>Media,https://chromium.googlesource.com/chromium/src/+/master/docs/speed/benchmark/harnesses/media.md,"aac,all,audio_only,audio_video,av1,background,beginning_to_end,busyjs,cns,h264,is_2min,is_4k,is_50fps,mp3,mse,opus,seek,src,video_only,vorbis,vp8,vp9" -media.mobile,dalecurtis@chromium.org,Internals>Media,https://chromium.googlesource.com/chromium/src/+/master/docs/speed/benchmark/harnesses/media.md,"aac,all,audio_only,audio_video,background,beginning_to_end,busyjs,cns,h264,is_2min,mp3,mse,opus,seek,src,video_only,vorbis,vp9" -memory.desktop,erikchen@chromium.org,,,all -octane,hablich@chromium.org,Blink>JavaScript,,all +loading.desktop,"kouhei@chromium.org, ksakamoto@chromium.org",Blink>Loader,https://bit.ly/loading-benchmarks,"abridged,cache_temperature_cold,cache_temperature_warm,international,intl_ar_fa_he,intl_es_fr_pt_BR,intl_hi_ru,intl_ja_zh,intl_ko_th_vi,typical" +loading.mobile,"kouhei@chromium.org, ksakamoto@chromium.org",Blink>Loader,https://bit.ly/loading-benchmarks,"abridged,cache_temperature_cold,cache_temperature_hot,cache_temperature_warm,easy_ttfmp,easy_tti,global,pwa,tough_ttfmp,tough_tti" +media.desktop,dalecurtis@chromium.org,Internals>Media,https://chromium.googlesource.com/chromium/src/+/main/docs/speed/benchmark/harnesses/media.md,"aac,audio_only,audio_video,av1,background,beginning_to_end,busyjs,cns,h264,is_2min,is_4k,is_50fps,mp3,mse,opus,seek,src,video_only,vorbis,vp8,vp9" +media.mobile,dalecurtis@chromium.org,Internals>Media,https://chromium.googlesource.com/chromium/src/+/main/docs/speed/benchmark/harnesses/media.md,"aac,audio_only,audio_video,background,beginning_to_end,busyjs,cns,h264,is_2min,mp3,mse,opus,seek,src,video_only,vorbis,vp9" +memory.desktop,erikchen@chromium.org,,, +octane,hablich@chromium.org,Blink>JavaScript,, performance_browser_tests,"johnchen@chromium.org, jophba@chromium.org",Internals>Media>ScreenCapture,, -power.desktop,brucedawson@chromium.org,,https://bit.ly/power-benchmarks,all -power.mobile,chrometto-team@google.com,,https://goto.google.com/power-mobile-benchmark,"2018,2019,2021,all,health_check,infinite_scroll,javascript_heavy" -rasterize_and_record_micro.top_25,"pdr@chromium.org, wangxianzhu@chromium.org, vmpstr@chromium.org",Internals>Compositing>Rasterization,https://bit.ly/rasterize-and-record-benchmark,all -rendering.desktop,"behdadb@chromium.org, jonross@chromium.org, sadrul@chromium.org",Internals>GPU>Metrics,https://bit.ly/rendering-benchmarks,"all,backdrop_filter,gpu_rasterization,image_decoding,key_desktop_move,maps,motionmark,motionmark_ramp,repaint_desktop,representative_mac_desktop,representative_mobile,representative_win_desktop,required_webgl,simple_canvas,throughput_test,top_real_world_desktop,tough_animation,tough_canvas,tough_compositor,tough_filters,tough_image_decode,tough_path_rendering,tough_pinch_zoom,tough_scheduling,tough_scrolling,tough_texture_upload,tough_webgl,use_fake_camera_device" -rendering.mobile,"behdadb@chromium.org, jonross@chromium.org, sadrul@chromium.org",Internals>GPU>Metrics,https://bit.ly/rendering-benchmarks,"all,backdrop_filter,fastpath,gpu_rasterization,image_decoding,key_hit_test,key_idle_power,key_noop,key_silk,maps,motionmark,motionmark_ramp,pathological_mobile_sites,polymer,representative_mac_desktop,representative_mobile,representative_win_desktop,required_webgl,simple_canvas,simple_mobile_sites,throughput_test,top_real_world_desktop,top_real_world_mobile,tough_animation,tough_canvas,tough_compositor,tough_filters,tough_image_decode,tough_path_rendering,tough_pinch_zoom_mobile,tough_scheduling,tough_scrolling,tough_texture_upload,tough_webgl,use_fake_camera_device" +power.desktop,brucedawson@chromium.org,,https://bit.ly/power-benchmarks, +power.mobile,chrometto-team@google.com,,https://goto.google.com/power-mobile-benchmark,"2018,2019,2021,health_check,infinite_scroll,javascript_heavy" +rasterize_and_record_micro.top_25,"pdr@chromium.org, wangxianzhu@chromium.org, vmpstr@chromium.org",Internals>Compositing>Rasterization,https://bit.ly/rasterize-and-record-benchmark, +rendering.desktop,"behdadb@chromium.org, jonross@chromium.org, sadrul@chromium.org",Internals>GPU>Metrics,https://bit.ly/rendering-benchmarks,"backdrop_filter,gpu_rasterization,image_decoding,key_desktop_move,maps,motionmark,motionmark_ramp,repaint_desktop,representative_mac_desktop,representative_mobile,representative_win_desktop,required_webgl,simple_canvas,throughput_test,top_real_world_desktop,tough_animation,tough_canvas,tough_compositor,tough_filters,tough_image_decode,tough_path_rendering,tough_pinch_zoom,tough_scheduling,tough_scrolling,tough_texture_upload,tough_webgl,use_fake_camera_device" +rendering.mobile,"behdadb@chromium.org, jonross@chromium.org, sadrul@chromium.org",Internals>GPU>Metrics,https://bit.ly/rendering-benchmarks,"backdrop_filter,fastpath,gpu_rasterization,image_decoding,key_hit_test,key_idle_power,key_noop,key_silk,maps,motionmark,motionmark_ramp,pathological_mobile_sites,polymer,representative_mac_desktop,representative_mobile,representative_win_desktop,required_webgl,simple_canvas,simple_mobile_sites,throughput_test,top_real_world_desktop,top_real_world_mobile,tough_animation,tough_canvas,tough_compositor,tough_filters,tough_image_decode,tough_path_rendering,tough_pinch_zoom_mobile,tough_scheduling,tough_scrolling,tough_texture_upload,tough_webgl,use_fake_camera_device" resource_sizes_chrome_modern_minimal_apks,"agrieve@chromium.org, jbudorick@chromium.org",Build,https://chromium.googlesource.com/chromium/src/+/HEAD/tools/binary_size/README.md#resource_sizes_py, resource_sizes_chrome_modern_public_minimal_apks,"agrieve@chromium.org, jbudorick@chromium.org",Build,https://chromium.googlesource.com/chromium/src/+/HEAD/tools/binary_size/README.md#resource_sizes_py, resource_sizes_chromecast,"juke@chromium.org, eliribble@chromium.org",Chromecast,https://chromium.googlesource.com/chromium/src/+/HEAD/tools/binary_size/README.md#resource_sizes_py, @@ -61,27 +61,27 @@ resource_sizes_system_webview_google_bundle,"agrieve@chromium.org, jbudorick@chromium.org",Build,https://chromium.googlesource.com/chromium/src/+/HEAD/tools/binary_size/README.md#resource_sizes_py, resource_sizes_trichrome,"agrieve@chromium.org, jbudorick@chromium.org",Build,https://chromium.googlesource.com/chromium/src/+/HEAD/tools/binary_size/README.md#resource_sizes_py, resource_sizes_trichrome_google,"agrieve@chromium.org, jbudorick@chromium.org",Build,https://chromium.googlesource.com/chromium/src/+/HEAD/tools/binary_size/README.md#resource_sizes_py, -speedometer,hablich@chromium.org,Blink,,all -speedometer-future,hablich@chromium.org,Blink,,all -speedometer2,hablich@chromium.org,Blink,,all -speedometer2-future,hablich@chromium.org,Blink,,all -speedometer2-pcscan,tmrts@chromium.org,Blink,,all -startup.mobile,"pasko@chromium.org, lizeb@chromium.org",Speed>Metrics>SystemHealthRegressions,,all -system_health.common_desktop,"charliea@chromium.org, sullivan@chromium.org, tdresser@chromium.org, chrome-speed-metrics-dev@chromium.org",Speed>Metrics>SystemHealthRegressions,https://bit.ly/system-health-benchmarks,"2016,2018,2019,2020,2021,accessibility,all,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy,keyboard_input,scroll,tabs_switching,wasm,webgl" -system_health.common_mobile,"charliea@chromium.org, sullivan@chromium.org, tdresser@chromium.org, chrome-speed-metrics-dev@chromium.org",Speed>Metrics>SystemHealthRegressions,https://bit.ly/system-health-benchmarks,"2016,2018,2019,2020,2021,all,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy" -system_health.memory_desktop,"pasko@chromium.org, lizeb@chromium.org",,https://bit.ly/system-health-benchmarks,"2016,2018,2019,2020,2021,accessibility,all,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy,keyboard_input,scroll,tabs_switching,wasm,webgl" -system_health.memory_mobile,"pasko@chromium.org, lizeb@chromium.org",,https://bit.ly/system-health-benchmarks,"2016,2018,2019,2020,2021,all,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy" -system_health.pcscan,"tmrts@chromium.org, mlippautz@chromium.org",Blink,https://bit.ly/36XBtpn,"2021,all,health_check,javascript_heavy" -system_health.weblayer_startup,"cduvall@chromium.org, weblayer-team@chromium.org",Internals>WebLayer,https://bit.ly/36XBtpn,"2016,all" -system_health.webview_startup,"oksamyt@chromium.org, torne@chromium.org, changwan@chromium.org",Mobile>WebView>Perf,,"2016,all" -tab_switching.typical_25,vovoy@chromium.org,OS>Performance,,"2016,all,tabs_switching" -tracing.tracing_with_background_memory_infra,ssid@chromium.org,,,all +speedometer,hablich@chromium.org,Blink,, +speedometer-future,hablich@chromium.org,Blink,, +speedometer2,hablich@chromium.org,Blink,, +speedometer2-future,hablich@chromium.org,Blink,, +speedometer2-pcscan,tmrts@chromium.org,Blink,, +startup.mobile,"pasko@chromium.org, lizeb@chromium.org",Speed>Metrics>SystemHealthRegressions,, +system_health.common_desktop,"charliea@chromium.org, sullivan@chromium.org, tdresser@chromium.org, chrome-speed-metrics-dev@chromium.org",Speed>Metrics>SystemHealthRegressions,https://bit.ly/system-health-benchmarks,"2016,2018,2019,2020,2021,accessibility,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy,keyboard_input,scroll,tabs_switching,wasm,webgl" +system_health.common_mobile,"charliea@chromium.org, sullivan@chromium.org, tdresser@chromium.org, chrome-speed-metrics-dev@chromium.org",Speed>Metrics>SystemHealthRegressions,https://bit.ly/system-health-benchmarks,"2016,2018,2019,2020,2021,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy" +system_health.memory_desktop,"pasko@chromium.org, lizeb@chromium.org",,https://bit.ly/system-health-benchmarks,"2016,2018,2019,2020,2021,accessibility,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy,keyboard_input,scroll,tabs_switching,wasm,webgl" +system_health.memory_mobile,"pasko@chromium.org, lizeb@chromium.org",,https://bit.ly/system-health-benchmarks,"2016,2018,2019,2020,2021,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy" +system_health.pcscan,"tmrts@chromium.org, mlippautz@chromium.org",Blink,https://bit.ly/36XBtpn,"2021,health_check,javascript_heavy" +system_health.weblayer_startup,"cduvall@chromium.org, weblayer-team@chromium.org",Internals>WebLayer,https://bit.ly/36XBtpn,2016 +system_health.webview_startup,"oksamyt@chromium.org, torne@chromium.org, changwan@chromium.org",Mobile>WebView>Perf,,2016 +tab_switching.typical_25,vovoy@chromium.org,OS>Performance,,"2016,tabs_switching" +tracing.tracing_with_background_memory_infra,ssid@chromium.org,,, tracing_perftests,"eseckler@chromium.org, oysteine@chromium.org",Speed>Tracing,, -v8.browsing_desktop,"mythria@chromium.org, tmrts@chromium.org, almuthanna@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2016,2018,2019,2020,2021,all,health_check,images,infinite_scroll,international,javascript_heavy,keyboard_input,wasm,webgl" -v8.browsing_desktop-future,"mythria@chromium.org, tmrts@chromium.org, almuthanna@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2016,2018,2019,2020,2021,all,health_check,images,infinite_scroll,international,javascript_heavy,keyboard_input,wasm,webgl" -v8.browsing_mobile,"mythria@chromium.org, tmrts@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2018,2019,2021,all,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy" -v8.browsing_mobile-future,"mythria@chromium.org, tmrts@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2018,2019,2021,all,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy" -v8.runtime_stats.top_25,"mythria@chromium.org, ulan@chromium.org",Blink>JavaScript,,"all,cold,hot,warm" +v8.browsing_desktop,"mythria@chromium.org, tmrts@chromium.org, almuthanna@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2016,2018,2019,2020,2021,health_check,images,infinite_scroll,international,javascript_heavy,keyboard_input,wasm,webgl" +v8.browsing_desktop-future,"mythria@chromium.org, tmrts@chromium.org, almuthanna@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2016,2018,2019,2020,2021,health_check,images,infinite_scroll,international,javascript_heavy,keyboard_input,wasm,webgl" +v8.browsing_mobile,"mythria@chromium.org, tmrts@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2018,2019,2021,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy" +v8.browsing_mobile-future,"mythria@chromium.org, tmrts@chromium.org",Blink>JavaScript,https://bit.ly/system-health-v8-benchmarks,"2018,2019,2021,emerging_market,health_check,images,infinite_scroll,international,javascript_heavy" +v8.runtime_stats.top_25,"mythria@chromium.org, ulan@chromium.org",Blink>JavaScript,,"cold,hot,warm" views_perftests,tapted@chromium.org,Internals>Views,, -wasmpspdfkit,ahaas@chromium.org,Blink>JavaScript>WebAssembly,,all -webrtc,"qiangchen@chromium.org, mbonadei@chromium.org",Blink>WebRTC,http://bit.ly/webrtc-benchmark,"all,datachannel,getusermedia,insertableStreams,pauseplay,sdp,smoothness,stress,videoConstraints" +wasmpspdfkit,ahaas@chromium.org,Blink>JavaScript>WebAssembly,, +webrtc,"qiangchen@chromium.org, mbonadei@chromium.org",Blink>WebRTC,http://bit.ly/webrtc-benchmark,"datachannel,getusermedia,insertableStreams,pauseplay,sdp,smoothness,stress,videoConstraints"
diff --git a/tools/perf/benchmarks/desktop_ui.py b/tools/perf/benchmarks/desktop_ui.py index d37a6a6d2..04bf8a09 100644 --- a/tools/perf/benchmarks/desktop_ui.py +++ b/tools/perf/benchmarks/desktop_ui.py
@@ -18,7 +18,7 @@ ], component='UI>Browser', documentation_url= - 'https://chromium.googlesource.com/chromium/src/+/master/docs/speed/benchmark/harnesses/desktop_ui.md' + 'https://chromium.googlesource.com/chromium/src/+/main/docs/speed/benchmark/harnesses/desktop_ui.md' ) class DesktopUI(perf_benchmark.PerfBenchmark): """Desktop UI Benchmark."""
diff --git a/tools/perf/benchmarks/media.py b/tools/perf/benchmarks/media.py index 593bcfdb..dac49a36 100644 --- a/tools/perf/benchmarks/media.py +++ b/tools/perf/benchmarks/media.py
@@ -48,7 +48,7 @@ @benchmark.Info(emails=['dalecurtis@chromium.org'], component='Internals>Media', - documentation_url='https://chromium.googlesource.com/chromium/src/+/master/docs/speed/benchmark/harnesses/media.md') # pylint: disable=line-too-long + documentation_url='https://chromium.googlesource.com/chromium/src/+/main/docs/speed/benchmark/harnesses/media.md') # pylint: disable=line-too-long class MediaDesktop(_MediaBenchmark): """Obtains media performance for key user scenarios on desktop.""" # TODO(rmhasan): Remove the SUPPORTED_PLATFORMS lists. @@ -68,7 +68,7 @@ # If any story is failing on svelte, please only disable on svelte. @benchmark.Info(emails=['dalecurtis@chromium.org'], component='Internals>Media', - documentation_url='https://chromium.googlesource.com/chromium/src/+/master/docs/speed/benchmark/harnesses/media.md') # pylint: disable=line-too-long + documentation_url='https://chromium.googlesource.com/chromium/src/+/main/docs/speed/benchmark/harnesses/media.md') # pylint: disable=line-too-long class MediaMobile(_MediaBenchmark): """Obtains media performance for key user scenarios on mobile devices."""
diff --git a/tools/perf/core/results_processor/README.md b/tools/perf/core/results_processor/README.md index d18c4baf..fb561b4 100644 --- a/tools/perf/core/results_processor/README.md +++ b/tools/perf/core/results_processor/README.md
@@ -15,7 +15,7 @@ ## Test results file The `_test_results.jsonl` file tries to follow the -[LUCI test results format](https://chromium.googlesource.com/infra/luci/luci-go/+/HEAD/resultdb/proto/sink/v1/test_result.proto). +[LUCI test results format](https://source.chromium.org/chromium/infra/infra/+/master:go/src/go.chromium.org/luci/resultdb/sink/proto/v1/test_result.proto). Its every line is a json message of the `testResult` type. There are following additional conventions:
diff --git a/tools/perf/core/results_processor/util.py b/tools/perf/core/results_processor/util.py index 5eb7ab2..5b6f7c9 100644 --- a/tools/perf/core/results_processor/util.py +++ b/tools/perf/core/results_processor/util.py
@@ -105,9 +105,11 @@ def TryUploadingResultToResultSink(results): def buildSummaryHtml(artifacts): - summary_html = '' - for artifact_id, _ in artifacts.items(): - summary_html += '<p><text-artifact artifact-id="%s"></p>' % artifact_id + # Using test log as the summary. It is stored in an artifact named logs.txt. + if artifacts.has_key('logs.txt'): + summary_html = '<p><text-artifact artifact-id="logs.txt"></p>' + else: + summary_html = '' return summary_html def buildArtifacts(artifacts):
diff --git a/tools/perf/expectations.config b/tools/perf/expectations.config index a3f91343..c9067c4e 100644 --- a/tools/perf/expectations.config +++ b/tools/perf/expectations.config
@@ -393,6 +393,8 @@ crbug.com/1173122 [ linux ] system_health.memory_desktop/load:tools:chat:2020 [ Skip ] crbug.com/1173122 [ linux ] system_health.memory_desktop/load:tools:gmail:2019 [ Skip ] crbug.com/1173972 [ linux ] system_health.memory_desktop/browse:news:nytimes:2020 [ Skip ] +crbug.com/903417 [ mac ] system_health.memory_desktop/long_running:tools:gmail-background [ Skip ] +crbug.com/903417 [ mac ] system_health.memory_desktop/long_running:tools:gmail-foreground [ Skip ] # Memory dumps don't work at the moment for Google Earth and AutoCAD, see the issue. crbug.com/1057035 system_health.memory_desktop/browse:tools:earth:2020 [ Skip ]
diff --git a/tools/perf/system_health_stories.csv b/tools/perf/system_health_stories.csv index b4fc6ff0..562c71e 100644 --- a/tools/perf/system_health_stories.csv +++ b/tools/perf/system_health_stories.csv
@@ -1,127 +1,127 @@ AUTOGENERATED FILE DO NOT EDIT See //tools/perf/core/perf_data_generator.py to make changes Story,Description,Platforms,Tags -background:media:imgur:2019,,mobile,"2019,all" -background:news:nytimes:2019,,mobile,"2019,all,javascript_heavy" -background:search:google:2019,,mobile,"2019,all" -background:social:facebook:2019,,mobile,"2019,all,health_check" -background:tools:gmail:2019,,mobile,"2019,all,health_check" -browse:chrome:newtab:2019,Story that loads new tab page and performs searches.,mobile,"2019,all,emerging_market" -browse:chrome:omnibox:2019,Story that peforms search by using omnibox search provider,mobile,"2019,all,emerging_market" -browse:media:facebook_photos:2019,Load a photo page from Rihanna's facebook page then navigate a few next,mobile,"2019,all,emerging_market" -browse:media:flickr_infinite_scroll:2019,,mobile,"2019,all,infinite_scroll" -browse:media:googleplaystore:2019,"Navigate to the movies page of Google Play Store, scroll to the bottom,",mobile,"2019,all,emerging_market,images" -browse:media:googleplaystore:2021,"Navigate to the movies page of Google Play Store, scroll to the bottom,",desktop,"2018,all,images" -browse:media:imgur,,desktop,"2016,all" -browse:media:imgur:2019,,mobile,"2019,all,emerging_market" -browse:media:pinterest:2018,,desktop,"2018,all" -browse:media:tiktok_infinite_scroll:2021,,mobile,"2021,all,infinite_scroll" -browse:media:tumblr:2018,,desktop,"2018,all" -browse:media:youtube:2019,Load a typical YouTube video then navigate to a next few videos. Stop and,"desktop,mobile","2019,all,emerging_market,javascript_heavy" -browse:media:youtubetv:2019,Load a typical YouTube TV video then navigate to a next few videos. Stop,desktop,"2019,all" -browse:media:youtubetv_watch:2020,Load a typical YouTube TV video then navigate to a next few videos. Stop,desktop,"2020,all" -browse:news:businessinsider:2021,A newsite where we've seen janky performance in bug reports,mobile,"2021,all,javascript_heavy" -browse:news:cnn:2021,The second top website in http://www.alexa.com/topsites/category/News,"desktop,mobile","2021,all,health_check,javascript_heavy" -browse:news:cricbuzz:2019,,mobile,"2019,all,emerging_market" -browse:news:flipboard:2020,,desktop,"2020,all" -browse:news:globo:2019,,mobile,"2019,all,emerging_market" -browse:news:hackernews:2020,,desktop,"2020,all" -browse:news:nytimes:2019,The third top website in http://www.alexa.com/topsites/category/News,mobile,"2019,all" -browse:news:nytimes:2020,The third top website in http://www.alexa.com/topsites/category/News,desktop,"2020,all" -browse:news:qq:2019,,mobile,"2019,all,international" -browse:news:reddit:2019,,mobile,"2019,all,health_check" -browse:news:reddit:2020,The top website in http://www.alexa.com/topsites/category/News,desktop,"2020,all" -browse:news:toi:2019,,mobile,"2019,all,emerging_market" -browse:news:washingtonpost:2019,Progressive website,mobile,"2019,all" -browse:search:amp:2018,Story for Google's Accelerated Mobile Pages (AMP).,mobile,"2018,all" -browse:search:amp:sxg:2019,Story for Google's Signed Exchange (SXG) Accelerated Mobile Pages (AMP).,mobile,"2019,all" -browse:search:google:2020,A typical google search story:,desktop,"2020,all" -browse:search:google_india:2021,A typical google search story in India:,desktop,"2021,all,international" -browse:shopping:amazon:2019,,mobile,"2019,all,emerging_market" -browse:shopping:avito:2019,,mobile,"2019,all,emerging_market" -browse:shopping:flipkart:2019,,mobile,"2019,all,emerging_market" -browse:shopping:lazada:2019,,mobile,"2019,all,emerging_market" -browse:social:facebook:2019,,mobile,"2019,all,emerging_market" -browse:social:facebook_infinite_scroll:2018,,"desktop,mobile","2018,all,infinite_scroll" -browse:social:instagram:2019,,mobile,"2019,all,emerging_market" -browse:social:pinterest_infinite_scroll:2021,,mobile,"2021,all,health_check,infinite_scroll" -browse:social:tumblr_infinite_scroll:2018,,"desktop,mobile","2018,all,health_check,infinite_scroll,javascript_heavy" -browse:social:twitter:2018,,desktop,"2018,all" -browse:social:twitter:2019,,mobile,"2019,all,health_check" -browse:social:twitter_infinite_scroll:2018,,desktop,"2018,all,infinite_scroll" -browse:tech:discourse_infinite_scroll:2018,,"desktop,mobile","2018,all,infinite_scroll" -browse:tools:autocad:2021,"AutoCAD desktop story,",desktop,"2021,all,keyboard_input,wasm,webgl" -browse:tools:docs_scrolling,Google Docs scrolling story:,desktop,"2020,all,javascript_heavy" -browse:tools:earth:2020,Load Google Earth and search for the Empire State Building. Watch the,desktop,"2020,all,keyboard_input,wasm,webgl" -browse:tools:gmail-compose:2020,,desktop,"2020,all" -browse:tools:gmail-labelclick:2020,,desktop,"2020,all" -browse:tools:gmail-openconversation:2020,,desktop,"2020,all" -browse:tools:gmail-search:2020,,desktop,"2020,all" -browse:tools:maps:2019,Google maps story:,"desktop,mobile","2019,all,emerging_market,health_check,javascript_heavy,webgl" -browse:tools:sheets:2019,,desktop,"2019,all,health_check,javascript_heavy" -browse_accessibility:media:youtube,Tests interacting with the YouTube home page.,desktop,"2016,accessibility,all,keyboard_input" -browse_accessibility:tech:codesearch:2018,Tests scrolling an element within a page.,desktop,"2018,accessibility,all,scroll" -load:chrome:blank,Story that loads the about:blank page.,"desktop,mobile","2016,all" -load:games:alphabetty:2018,,desktop,"2018,all" -load:games:bubbles:2020,"Load ""smarty bubbles"" game on famobi.com","desktop,mobile","2020,all" -load:games:lazors,,"desktop,mobile","2016,all" -load:games:miniclip:2018,,desktop,"2018,all" -load:games:spychase:2018,,"desktop,mobile","2018,all" -load:media:9gag,,desktop,"2016,all" -load:media:dailymotion:2019,,"desktop,mobile","2019,all" -load:media:facebook_feed:desktop:2020,Load facebook main page,desktop,"2020,all" -load:media:facebook_feed:mobile:2020,Load a page of national park,mobile,"2020,all" -load:media:facebook_photos:2018,Load a page of rihanna's facebook with a photo.,desktop,"2018,all" -load:media:facebook_photos:2019,Load a page of rihanna's facebook with a photo.,mobile,"2019,all,emerging_market" -load:media:facebook_photos:desktop:2020,Load a page of rihanna's facebook with a photo.,desktop,"2020,all" -load:media:facebook_photos:mobile:2020,Load a page of rihanna's facebook with a photo.,mobile,"2020,all" -load:media:flickr:2018,,"desktop,mobile","2018,all" -load:media:google_images:2018,,"desktop,mobile","2018,all" -load:media:imgur:2018,,"desktop,mobile","2018,all" -load:media:soundcloud:2018,,"desktop,mobile","2018,all" -load:media:youtube:2018,,"desktop,mobile","2018,all,emerging_market,health_check" -load:media:youtubelivingroom:2020,,desktop,"2020,all,health_check" -load:news:bbc:2018,,desktop,"2018,all" -load:news:bbc:2019,,mobile,"2019,all" -load:news:cnn:2020,,"desktop,mobile","2020,all,health_check,javascript_heavy" -load:news:flipboard,,desktop,"2016,all" -load:news:hackernews:2018,,desktop,"2018,all" -load:news:irctc:2019,,mobile,"2019,all,emerging_market" -load:news:nytimes:2018,,desktop,"2018,all" -load:news:nytimes:2019,,mobile,"2019,all" -load:news:qq:2018,,desktop,"2018,all,international" -load:news:qq:2019,,mobile,"2019,all,international" -load:news:reddit:2018,,desktop,"2018,all" -load:news:reddit:2019,,mobile,"2019,all" -load:news:washingtonpost:2019,,mobile,"2019,all" -load:news:wikipedia:2018,,"desktop,mobile","2018,all,emerging_market" -load:search:amazon:2018,,desktop,"2018,all" -load:search:amazon:2019,,mobile,"2019,all" -load:search:baidu:2018,,"desktop,mobile","2018,all,international" -load:search:ebay:2018,,"desktop,mobile","2018,all" -load:search:flipkart:2018,,desktop,"2018,all,international" -load:search:google:2018,,"desktop,mobile","2018,all" -load:search:taobao:2018,,desktop,"2018,all,international" -load:search:taobao:2019,,mobile,"2019,all,international" -load:search:yahoo:2018,,"desktop,mobile","2018,all" -load:search:yandex:2018,,"desktop,mobile","2018,all,international" -load:social:instagram:2018,,desktop,"2018,all,health_check" -load:social:instagram:2019,,mobile,"2019,all" -load:social:pinterest:2019,,"desktop,mobile","2019,all,javascript_heavy" -load:social:twitter:2019,,mobile,"2019,all" -load:social:vk:2018,,desktop,"2018,all,health_check,international" -load:tools:chat:2020,,desktop,"2020,all" -load:tools:docs:2019,Load a typical google doc page (2019).,"desktop,mobile","2019,all" -load:tools:drive:2019,,"desktop,mobile","2019,all,javascript_heavy" -load:tools:dropbox:2019,,mobile,"2019,all" -load:tools:gmail:2019,,"desktop,mobile","2019,all,health_check" -load:tools:stackoverflow:2018,Load a typical question & answer page of stackoverflow.com,"desktop,mobile","2018,all" -load:tools:weather:2019,,"desktop,mobile","2019,all,health_check,javascript_heavy" -load_accessibility:media:wikipedia:2018,"Wikipedia page on Accessibility. Long, but very simple, clean layout.",desktop,"2018,accessibility,all" -load_accessibility:shopping:amazon:2018,Amazon results page. Good example of a site with a data table.,desktop,"2018,accessibility,all" -long_running:tools:gmail-background,,"desktop,mobile","2016,all" -long_running:tools:gmail-foreground,,"desktop,mobile","2016,all,health_check" -multitab:misc:typical24,"Load 24 different web sites in 24 tabs, then cycle through each tab.",desktop,"2016,all,tabs_switching" -multitab:misc:typical24:2018,"Load 24 different web sites in 24 tabs, then cycle through each tab.",desktop,"2018,all,international,tabs_switching" -play:media:google_play_music,"Browse the songs list in music.google.com, then play a song.",desktop,"2016,all,health_check" -play:media:soundcloud:2018,"Load soundcloud.com, search for ""Smooth Jazz"", then play a song.",desktop,"2018,all" +background:media:imgur:2019,,mobile,2019 +background:news:nytimes:2019,,mobile,"2019,javascript_heavy" +background:search:google:2019,,mobile,2019 +background:social:facebook:2019,,mobile,"2019,health_check" +background:tools:gmail:2019,,mobile,"2019,health_check" +browse:chrome:newtab:2019,Story that loads new tab page and performs searches.,mobile,"2019,emerging_market" +browse:chrome:omnibox:2019,Story that peforms search by using omnibox search provider,mobile,"2019,emerging_market" +browse:media:facebook_photos:2019,Load a photo page from Rihanna's facebook page then navigate a few next,mobile,"2019,emerging_market" +browse:media:flickr_infinite_scroll:2019,,mobile,"2019,infinite_scroll" +browse:media:googleplaystore:2019,"Navigate to the movies page of Google Play Store, scroll to the bottom,",mobile,"2019,emerging_market,images" +browse:media:googleplaystore:2021,"Navigate to the movies page of Google Play Store, scroll to the bottom,",desktop,"2018,images" +browse:media:imgur,,desktop,2016 +browse:media:imgur:2019,,mobile,"2019,emerging_market" +browse:media:pinterest:2018,,desktop,2018 +browse:media:tiktok_infinite_scroll:2021,,mobile,"2021,infinite_scroll" +browse:media:tumblr:2018,,desktop,2018 +browse:media:youtube:2019,Load a typical YouTube video then navigate to a next few videos. Stop and,"desktop,mobile","2019,emerging_market,javascript_heavy" +browse:media:youtubetv:2019,Load a typical YouTube TV video then navigate to a next few videos. Stop,desktop,2019 +browse:media:youtubetv_watch:2020,Load a typical YouTube TV video then navigate to a next few videos. Stop,desktop,2020 +browse:news:businessinsider:2021,A newsite where we've seen janky performance in bug reports,mobile,"2021,javascript_heavy" +browse:news:cnn:2021,The second top website in http://www.alexa.com/topsites/category/News,"desktop,mobile","2021,health_check,javascript_heavy" +browse:news:cricbuzz:2019,,mobile,"2019,emerging_market" +browse:news:flipboard:2020,,desktop,2020 +browse:news:globo:2019,,mobile,"2019,emerging_market" +browse:news:hackernews:2020,,desktop,2020 +browse:news:nytimes:2019,The third top website in http://www.alexa.com/topsites/category/News,mobile,2019 +browse:news:nytimes:2020,The third top website in http://www.alexa.com/topsites/category/News,desktop,2020 +browse:news:qq:2019,,mobile,"2019,international" +browse:news:reddit:2019,,mobile,"2019,health_check" +browse:news:reddit:2020,The top website in http://www.alexa.com/topsites/category/News,desktop,2020 +browse:news:toi:2019,,mobile,"2019,emerging_market" +browse:news:washingtonpost:2019,Progressive website,mobile,2019 +browse:search:amp:2018,Story for Google's Accelerated Mobile Pages (AMP).,mobile,2018 +browse:search:amp:sxg:2019,Story for Google's Signed Exchange (SXG) Accelerated Mobile Pages (AMP).,mobile,2019 +browse:search:google:2020,A typical google search story:,desktop,2020 +browse:search:google_india:2021,A typical google search story in India:,desktop,"2021,international" +browse:shopping:amazon:2019,,mobile,"2019,emerging_market" +browse:shopping:avito:2019,,mobile,"2019,emerging_market" +browse:shopping:flipkart:2019,,mobile,"2019,emerging_market" +browse:shopping:lazada:2019,,mobile,"2019,emerging_market" +browse:social:facebook:2019,,mobile,"2019,emerging_market" +browse:social:facebook_infinite_scroll:2018,,"desktop,mobile","2018,infinite_scroll" +browse:social:instagram:2019,,mobile,"2019,emerging_market" +browse:social:pinterest_infinite_scroll:2021,,mobile,"2021,health_check,infinite_scroll" +browse:social:tumblr_infinite_scroll:2018,,"desktop,mobile","2018,health_check,infinite_scroll,javascript_heavy" +browse:social:twitter:2018,,desktop,2018 +browse:social:twitter:2019,,mobile,"2019,health_check" +browse:social:twitter_infinite_scroll:2018,,desktop,"2018,infinite_scroll" +browse:tech:discourse_infinite_scroll:2018,,"desktop,mobile","2018,infinite_scroll" +browse:tools:autocad:2021,"AutoCAD desktop story,",desktop,"2021,keyboard_input,wasm,webgl" +browse:tools:docs_scrolling,Google Docs scrolling story:,desktop,"2020,javascript_heavy" +browse:tools:earth:2020,Load Google Earth and search for the Empire State Building. Watch the,desktop,"2020,keyboard_input,wasm,webgl" +browse:tools:gmail-compose:2020,,desktop,2020 +browse:tools:gmail-labelclick:2020,,desktop,2020 +browse:tools:gmail-openconversation:2020,,desktop,2020 +browse:tools:gmail-search:2020,,desktop,2020 +browse:tools:maps:2019,Google maps story:,"desktop,mobile","2019,emerging_market,health_check,javascript_heavy,webgl" +browse:tools:sheets:2019,,desktop,"2019,health_check,javascript_heavy" +browse_accessibility:media:youtube,Tests interacting with the YouTube home page.,desktop,"2016,accessibility,keyboard_input" +browse_accessibility:tech:codesearch:2018,Tests scrolling an element within a page.,desktop,"2018,accessibility,scroll" +load:chrome:blank,Story that loads the about:blank page.,"desktop,mobile",2016 +load:games:alphabetty:2018,,desktop,2018 +load:games:bubbles:2020,"Load ""smarty bubbles"" game on famobi.com","desktop,mobile",2020 +load:games:lazors,,"desktop,mobile",2016 +load:games:miniclip:2018,,desktop,2018 +load:games:spychase:2018,,"desktop,mobile",2018 +load:media:9gag,,desktop,2016 +load:media:dailymotion:2019,,"desktop,mobile",2019 +load:media:facebook_feed:desktop:2020,Load facebook main page,desktop,2020 +load:media:facebook_feed:mobile:2020,Load a page of national park,mobile,2020 +load:media:facebook_photos:2018,Load a page of rihanna's facebook with a photo.,desktop,2018 +load:media:facebook_photos:2019,Load a page of rihanna's facebook with a photo.,mobile,"2019,emerging_market" +load:media:facebook_photos:desktop:2020,Load a page of rihanna's facebook with a photo.,desktop,2020 +load:media:facebook_photos:mobile:2020,Load a page of rihanna's facebook with a photo.,mobile,2020 +load:media:flickr:2018,,"desktop,mobile",2018 +load:media:google_images:2018,,"desktop,mobile",2018 +load:media:imgur:2018,,"desktop,mobile",2018 +load:media:soundcloud:2018,,"desktop,mobile",2018 +load:media:youtube:2018,,"desktop,mobile","2018,emerging_market,health_check" +load:media:youtubelivingroom:2020,,desktop,"2020,health_check" +load:news:bbc:2018,,desktop,2018 +load:news:bbc:2019,,mobile,2019 +load:news:cnn:2020,,"desktop,mobile","2020,health_check,javascript_heavy" +load:news:flipboard,,desktop,2016 +load:news:hackernews:2018,,desktop,2018 +load:news:irctc:2019,,mobile,"2019,emerging_market" +load:news:nytimes:2018,,desktop,2018 +load:news:nytimes:2019,,mobile,2019 +load:news:qq:2018,,desktop,"2018,international" +load:news:qq:2019,,mobile,"2019,international" +load:news:reddit:2018,,desktop,2018 +load:news:reddit:2019,,mobile,2019 +load:news:washingtonpost:2019,,mobile,2019 +load:news:wikipedia:2018,,"desktop,mobile","2018,emerging_market" +load:search:amazon:2018,,desktop,2018 +load:search:amazon:2019,,mobile,2019 +load:search:baidu:2018,,"desktop,mobile","2018,international" +load:search:ebay:2018,,"desktop,mobile",2018 +load:search:flipkart:2018,,desktop,"2018,international" +load:search:google:2018,,"desktop,mobile",2018 +load:search:taobao:2018,,desktop,"2018,international" +load:search:taobao:2019,,mobile,"2019,international" +load:search:yahoo:2018,,"desktop,mobile",2018 +load:search:yandex:2018,,"desktop,mobile","2018,international" +load:social:instagram:2018,,desktop,"2018,health_check" +load:social:instagram:2019,,mobile,2019 +load:social:pinterest:2019,,"desktop,mobile","2019,javascript_heavy" +load:social:twitter:2019,,mobile,2019 +load:social:vk:2018,,desktop,"2018,health_check,international" +load:tools:chat:2020,,desktop,2020 +load:tools:docs:2019,Load a typical google doc page (2019).,"desktop,mobile",2019 +load:tools:drive:2019,,"desktop,mobile","2019,javascript_heavy" +load:tools:dropbox:2019,,mobile,2019 +load:tools:gmail:2019,,"desktop,mobile","2019,health_check" +load:tools:stackoverflow:2018,Load a typical question & answer page of stackoverflow.com,"desktop,mobile",2018 +load:tools:weather:2019,,"desktop,mobile","2019,health_check,javascript_heavy" +load_accessibility:media:wikipedia:2018,"Wikipedia page on Accessibility. Long, but very simple, clean layout.",desktop,"2018,accessibility" +load_accessibility:shopping:amazon:2018,Amazon results page. Good example of a site with a data table.,desktop,"2018,accessibility" +long_running:tools:gmail-background,,"desktop,mobile",2016 +long_running:tools:gmail-foreground,,"desktop,mobile","2016,health_check" +multitab:misc:typical24,"Load 24 different web sites in 24 tabs, then cycle through each tab.",desktop,"2016,tabs_switching" +multitab:misc:typical24:2018,"Load 24 different web sites in 24 tabs, then cycle through each tab.",desktop,"2018,international,tabs_switching" +play:media:google_play_music,"Browse the songs list in music.google.com, then play a song.",desktop,"2016,health_check" +play:media:soundcloud:2018,"Load soundcloud.com, search for ""Smooth Jazz"", then play a song.",desktop,2018
diff --git a/ui/accessibility/ax_tree.cc b/ui/accessibility/ax_tree.cc index b9ac1d2..6596a22 100644 --- a/ui/accessibility/ax_tree.cc +++ b/ui/accessibility/ax_tree.cc
@@ -15,6 +15,7 @@ #include "base/command_line.h" #include "base/containers/contains.h" #include "base/memory/ptr_util.h" +#include "base/metrics/histogram_macros.h" #include "base/no_destructor.h" #include "base/notreached.h" #include "base/strings/stringprintf.h" @@ -942,6 +943,9 @@ if (!ComputePendingChanges(update, &update_state)) return false; + // Log unserialize perf after early returns. + SCOPED_UMA_HISTOGRAM_TIMER("Accessibility.Performance.Tree.Unserialize"); + // Notify observers of subtrees and nodes that are about to be destroyed or // reparented, this must be done before applying any updates to the tree. for (auto&& pair : update_state.node_id_to_pending_data) {
diff --git a/ui/accessibility/ax_tree_unittest.cc b/ui/accessibility/ax_tree_unittest.cc index 69227b2..c7365bf 100644 --- a/ui/accessibility/ax_tree_unittest.cc +++ b/ui/accessibility/ax_tree_unittest.cc
@@ -411,6 +411,9 @@ initial_state.nodes[2].id = 3; AXTree tree(initial_state); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.Tree.Unserialize", 1); + // This should fail because we delete a subtree rooted at id=2 // but never update it. AXTreeUpdate update; @@ -422,6 +425,8 @@ histogram_tester.ExpectUniqueSample( "Accessibility.Reliability.Tree.UnserializeError", AXTreeUnserializeError::kPendingNodes, 1); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.Tree.Unserialize", 2); } TEST(AXTreeTest, LeaveOrphanedNewChildFails) { @@ -432,6 +437,9 @@ initial_state.nodes[0].id = 1; AXTree tree(initial_state); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.Tree.Unserialize", 1); + // This should fail because we add a new child to the root node // but never update it. AXTreeUpdate update; @@ -443,6 +451,8 @@ histogram_tester.ExpectUniqueSample( "Accessibility.Reliability.Tree.UnserializeError", AXTreeUnserializeError::kPendingNodes, 1); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.Tree.Unserialize", 2); } TEST(AXTreeTest, DuplicateChildIdFails) { @@ -453,6 +463,9 @@ initial_state.nodes[0].id = 1; AXTree tree(initial_state); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.Tree.Unserialize", 1); + // This should fail because a child id appears twice. AXTreeUpdate update; update.nodes.resize(2); @@ -465,6 +478,8 @@ histogram_tester.ExpectUniqueSample( "Accessibility.Reliability.Tree.UnserializeError", AXTreeUnserializeError::kDuplicateChild, 1); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.Tree.Unserialize", 1); } TEST(AXTreeTest, InvalidReparentingFails) { @@ -480,6 +495,9 @@ AXTree tree(initial_state); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.Tree.Unserialize", 1); + // This should fail because node 3 is reparented from node 2 to node 1 // without deleting node 1's subtree first. AXTreeUpdate update; @@ -495,6 +513,8 @@ histogram_tester.ExpectUniqueSample( "Accessibility.Reliability.Tree.UnserializeError", AXTreeUnserializeError::kReparent, 1); + histogram_tester.ExpectTotalCount( + "Accessibility.Performance.Tree.Unserialize", 1); } TEST(AXTreeTest, NoReparentingOfRootIfNoNewRoot) {
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn index 2bcb3fd..195e6a8 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn
@@ -113,6 +113,16 @@ "l10n/time_format.h", "layout.cc", "layout.h", + "metadata/base_type_conversion.cc", + "metadata/base_type_conversion.h", + "metadata/metadata_cache.cc", + "metadata/metadata_cache.h", + "metadata/metadata_header_macros.h", + "metadata/metadata_impl_macros.h", + "metadata/metadata_macros_internal.h", + "metadata/metadata_types.cc", + "metadata/metadata_types.h", + "metadata/property_metadata.h", "models/button_menu_item_model.cc", "models/button_menu_item_model.h", "models/combobox_model.cc", @@ -875,6 +885,8 @@ "l10n/l10n_util_unittest.cc", "l10n/time_format_unittest.cc", "layout_unittest.cc", + "metadata/base_type_conversion_unittest.cc", + "metadata/metadata_unittest.cc", "models/image_model_unittest.cc", "models/simple_combobox_model_unittest.cc", "models/simple_menu_model_unittest.cc",
diff --git a/ui/base/DEPS b/ui/base/DEPS index 4271111..32d9216 100644 --- a/ui/base/DEPS +++ b/ui/base/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+components/system_media_controls", "+media/media_buildflags.h", "+net", "+skia/ext",
diff --git a/ui/base/ime/BUILD.gn b/ui/base/ime/BUILD.gn index 194c838..3a18c6b 100644 --- a/ui/base/ime/BUILD.gn +++ b/ui/base/ime/BUILD.gn
@@ -21,6 +21,8 @@ "candidate_window.h", "composition_text.cc", "composition_text.h", + "grammar_fragment.cc", + "grammar_fragment.h", "ime_text_span.cc", "ime_text_span.h", "infolist_entry.cc",
diff --git a/ui/base/ime/chromeos/ime_keymap.cc b/ui/base/ime/chromeos/ime_keymap.cc index 016fe6a..3490652 100644 --- a/ui/base/ime/chromeos/ime_keymap.cc +++ b/ui/base/ime/chromeos/ime_keymap.cc
@@ -139,7 +139,8 @@ {VKEY_BRIGHTNESS_DOWN, "BrightnessDown"}, {VKEY_BRIGHTNESS_UP, "BrightnessUp"}, {VKEY_MEDIA_LAUNCH_APP1, "ChromeOSSwitchWindow"}, - {VKEY_MEDIA_LAUNCH_APP2, "ChromeOSFullscreen"}, + // LaunchApplication2 is calculator. + {VKEY_MEDIA_LAUNCH_APP2, "LaunchApplication2"}, {VKEY_MEDIA_NEXT_TRACK, "MediaTrackNext"}, {VKEY_MEDIA_PREV_TRACK, "MediaTrackPrevious"}, {VKEY_MEDIA_STOP, "MediaStop"}, @@ -155,7 +156,8 @@ {VKEY_OEM_4, "BracketLeft"}, {VKEY_OEM_5, "Backslash"}, {VKEY_OEM_6, "BracketRight"}, - {VKEY_OEM_7, "Quote"}}; + {VKEY_OEM_7, "Quote"}, + {VKEY_ZOOM, "ChromeOSFullscreen"}}; class KeyCodeMap { public:
diff --git a/ui/base/ime/fuchsia/input_method_fuchsia.cc b/ui/base/ime/fuchsia/input_method_fuchsia.cc index aaa5a1e..4d88241 100644 --- a/ui/base/ime/fuchsia/input_method_fuchsia.cc +++ b/ui/base/ime/fuchsia/input_method_fuchsia.cc
@@ -49,9 +49,19 @@ return dispatch_details; } -void InputMethodFuchsia::OnCaretBoundsChanged(const TextInputClient* client) {} +void InputMethodFuchsia::CancelComposition(const TextInputClient* client) { + // FIDL asynchronicity makes it impossible to know whether a recent + // visibility update might be in flight, so always call Dismiss. + virtual_keyboard_controller_.DismissVirtualKeyboard(); +} -void InputMethodFuchsia::CancelComposition(const TextInputClient* client) {} +void InputMethodFuchsia::OnTextInputTypeChanged(const TextInputClient* client) { + InputMethodBase::OnTextInputTypeChanged(client); + + virtual_keyboard_controller_.UpdateTextType(); +} + +void InputMethodFuchsia::OnCaretBoundsChanged(const TextInputClient* client) {} bool InputMethodFuchsia::IsCandidatePopupOpen() const { return false;
diff --git a/ui/base/ime/fuchsia/input_method_fuchsia.h b/ui/base/ime/fuchsia/input_method_fuchsia.h index d31ccd9f..52b2b6b 100644 --- a/ui/base/ime/fuchsia/input_method_fuchsia.h +++ b/ui/base/ime/fuchsia/input_method_fuchsia.h
@@ -34,8 +34,9 @@ // InputMethodBase interface implementation. VirtualKeyboardController* GetVirtualKeyboardController() final; ui::EventDispatchDetails DispatchKeyEvent(ui::KeyEvent* event) final; - void OnCaretBoundsChanged(const TextInputClient* client) final; void CancelComposition(const TextInputClient* client) final; + void OnTextInputTypeChanged(const TextInputClient* client) final; + void OnCaretBoundsChanged(const TextInputClient* client) final; bool IsCandidatePopupOpen() const final; private:
diff --git a/ui/base/ime/fuchsia/virtual_keyboard_controller_fuchsia.cc b/ui/base/ime/fuchsia/virtual_keyboard_controller_fuchsia.cc index 7003199..25de7d0 100644 --- a/ui/base/ime/fuchsia/virtual_keyboard_controller_fuchsia.cc +++ b/ui/base/ime/fuchsia/virtual_keyboard_controller_fuchsia.cc
@@ -15,27 +15,6 @@ namespace ui { namespace { -// Returns the FIDL enum representation of the current InputMode. -fuchsia::input::virtualkeyboard::TextType ConvertTextInputMode( - ui::TextInputMode mode) { - switch (mode) { - case TEXT_INPUT_MODE_NUMERIC: - case TEXT_INPUT_MODE_DECIMAL: - return fuchsia::input::virtualkeyboard::TextType::NUMERIC; - - case TEXT_INPUT_MODE_TEL: - return fuchsia::input::virtualkeyboard::TextType::PHONE; - - case TEXT_INPUT_MODE_DEFAULT: - case TEXT_INPUT_MODE_NONE: - case TEXT_INPUT_MODE_TEXT: - case TEXT_INPUT_MODE_URL: - case TEXT_INPUT_MODE_EMAIL: - case TEXT_INPUT_MODE_SEARCH: - return fuchsia::input::virtualkeyboard::TextType::ALPHANUMERIC; - } -} - } // namespace VirtualKeyboardControllerFuchsia::VirtualKeyboardControllerFuchsia( @@ -47,13 +26,11 @@ base::ComponentContextForProcess() ->svc() ->Connect<fuchsia::input::virtualkeyboard::ControllerCreator>() - ->Create(std::move(view_ref), - ConvertTextInputMode(input_method_->GetTextInputMode()), + ->Create(std::move(view_ref), requested_type_, controller_service_.NewRequest()); - controller_service_.set_error_handler([this](zx_status_t status) { + controller_service_.set_error_handler([](zx_status_t status) { ZX_LOG(ERROR, status) << "virtualkeyboard::Controller disconnected"; - keyboard_visible_ = false; }); WatchVisibility(); @@ -62,22 +39,29 @@ VirtualKeyboardControllerFuchsia::~VirtualKeyboardControllerFuchsia() = default; bool VirtualKeyboardControllerFuchsia::DisplayVirtualKeyboard() { + DVLOG(1) << "DisplayVirtualKeyboard (visible= " << keyboard_visible_ << ")"; + if (!controller_service_) return false; - controller_service_->SetTextType( - ConvertTextInputMode(input_method_->GetTextInputMode())); + UpdateTextType(); - if (!keyboard_visible_) - controller_service_->RequestShow(); + requested_visible_ = true; + controller_service_->RequestShow(); return true; } void VirtualKeyboardControllerFuchsia::DismissVirtualKeyboard() { + DVLOG(1) << "DismissVirtualKeyboard (visible= " << keyboard_visible_ << ")"; + if (!controller_service_) return; + if (!requested_visible_ && !keyboard_visible_) + return; + + requested_visible_ = false; controller_service_->RequestHide(); } @@ -100,8 +84,40 @@ } void VirtualKeyboardControllerFuchsia::OnVisibilityChange(bool is_visible) { + DVLOG(1) << "OnVisibilityChange " << is_visible; keyboard_visible_ = is_visible; WatchVisibility(); } +// Returns the FIDL enum representation of the current InputMode. +fuchsia::input::virtualkeyboard::TextType +VirtualKeyboardControllerFuchsia::GetFocusedTextType() const { + switch (input_method_->GetTextInputMode()) { + case TEXT_INPUT_MODE_NUMERIC: + case TEXT_INPUT_MODE_DECIMAL: + return fuchsia::input::virtualkeyboard::TextType::NUMERIC; + + case TEXT_INPUT_MODE_TEL: + return fuchsia::input::virtualkeyboard::TextType::PHONE; + + case TEXT_INPUT_MODE_DEFAULT: + case TEXT_INPUT_MODE_NONE: + case TEXT_INPUT_MODE_TEXT: + case TEXT_INPUT_MODE_URL: + case TEXT_INPUT_MODE_EMAIL: + case TEXT_INPUT_MODE_SEARCH: + return fuchsia::input::virtualkeyboard::TextType::ALPHANUMERIC; + } +} + +void VirtualKeyboardControllerFuchsia::UpdateTextType() { + // Only send updates if the type has changed. + auto new_type = GetFocusedTextType(); + if (new_type != requested_type_) { + DVLOG(1) << "SetTextType " << static_cast<int>(new_type); + controller_service_->SetTextType(new_type); + requested_type_ = new_type; + } +} + } // namespace ui
diff --git a/ui/base/ime/fuchsia/virtual_keyboard_controller_fuchsia.h b/ui/base/ime/fuchsia/virtual_keyboard_controller_fuchsia.h index 1adc5692..4f96003 100644 --- a/ui/base/ime/fuchsia/virtual_keyboard_controller_fuchsia.h +++ b/ui/base/ime/fuchsia/virtual_keyboard_controller_fuchsia.h
@@ -29,6 +29,8 @@ VirtualKeyboardControllerFuchsia operator=( VirtualKeyboardControllerFuchsia&) = delete; + void UpdateTextType(); + // VirtualKeyboardController implementation. bool DisplayVirtualKeyboard() override; void DismissVirtualKeyboard() override; @@ -43,9 +45,15 @@ // Handles the visibility change response from the service. void OnVisibilityChange(bool is_visible); + // Gets the Fuchsia TextType corresponding to the currently focused field. + fuchsia::input::virtualkeyboard::TextType GetFocusedTextType() const; + ui::InputMethodBase* const input_method_; + fuchsia::input::virtualkeyboard::TextType requested_type_ = + fuchsia::input::virtualkeyboard::TextType::ALPHANUMERIC; fuchsia::input::virtualkeyboard::ControllerPtr controller_service_; bool keyboard_visible_ = false; + bool requested_visible_ = false; }; } // namespace ui
diff --git a/ui/base/ime/grammar_fragment.cc b/ui/base/ime/grammar_fragment.cc new file mode 100644 index 0000000..36a005e --- /dev/null +++ b/ui/base/ime/grammar_fragment.cc
@@ -0,0 +1,25 @@ +// Copyright (c) 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. + +#include "ui/base/ime/grammar_fragment.h" + +namespace ui { + +GrammarFragment::GrammarFragment(const gfx::Range& range, + const std::string& suggestion) + : range(range), suggestion(suggestion) {} + +GrammarFragment::GrammarFragment(const GrammarFragment& other) = default; + +GrammarFragment::~GrammarFragment() = default; + +bool GrammarFragment::operator==(const GrammarFragment& other) const { + return range == other.range && suggestion == other.suggestion; +} + +bool GrammarFragment::operator!=(const GrammarFragment& other) const { + return !(*this == other); +} + +} // namespace ui
diff --git a/ui/base/ime/grammar_fragment.h b/ui/base/ime/grammar_fragment.h new file mode 100644 index 0000000..b97cadc --- /dev/null +++ b/ui/base/ime/grammar_fragment.h
@@ -0,0 +1,34 @@ +// Copyright (c) 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. + +#ifndef UI_BASE_IME_GRAMMAR_FRAGMENT_H_ +#define UI_BASE_IME_GRAMMAR_FRAGMENT_H_ + +#include <string> + +#include "base/component_export.h" +#include "ui/gfx/range/range.h" + +namespace ui { + +// A struct represents a fragment of grammar edit suggestion. +struct COMPONENT_EXPORT(UI_BASE_IME_TYPES) GrammarFragment { + GrammarFragment(const gfx::Range& range, const std::string& suggestion); + GrammarFragment(const GrammarFragment& other); + ~GrammarFragment(); + + bool operator==(const GrammarFragment& other) const; + bool operator!=(const GrammarFragment& other) const; + + // The range of the marker, visual indications such as underlining are + // expected to show in this range. + gfx::Range range; + + // The replacement text suggested by the grammar model. + std::string suggestion; +}; + +} // namespace ui + +#endif // UI_BASE_IME_GRAMMAR_FRAGMENT_H_
diff --git a/ui/base/ime/text_input_client.cc b/ui/base/ime/text_input_client.cc index 2fb370e..f0af80c 100644 --- a/ui/base/ime/text_input_client.cc +++ b/ui/base/ime/text_input_client.cc
@@ -9,4 +9,20 @@ TextInputClient::~TextInputClient() { } +#if BUILDFLAG(IS_CHROMEOS_ASH) +base::Optional<GrammarFragment> TextInputClient::GetGrammarFragment( + const gfx::Range& range) { + return base::nullopt; +} + +bool TextInputClient::ClearGrammarFragments(const gfx::Range& range) { + return false; +} + +bool TextInputClient::AddGrammarFragments( + const std::vector<GrammarFragment>& fragments) { + return false; +} +#endif + } // namespace ui
diff --git a/ui/base/ime/text_input_client.h b/ui/base/ime/text_input_client.h index 4f8f661..cad732d 100644 --- a/ui/base/ime/text_input_client.h +++ b/ui/base/ime/text_input_client.h
@@ -20,6 +20,7 @@ #include "build/chromeos_buildflags.h" #include "services/metrics/public/cpp/ukm_source_id.h" #include "ui/base/ime/composition_text.h" +#include "ui/base/ime/grammar_fragment.h" #include "ui/base/ime/input_method_delegate.h" #include "ui/base/ime/text_input_mode.h" #include "ui/base/ime/text_input_type.h" @@ -265,6 +266,21 @@ // Returns true if the operation was successful. If |range| is invalid, then // no modifications are made and this function returns false. virtual bool SetAutocorrectRange(const gfx::Range& range) = 0; + + // Returns the grammar fragment which contains |range|. If non-existent, + // returns an empty Fragment. + virtual base::Optional<GrammarFragment> GetGrammarFragment( + const gfx::Range& range); + + // Clears all the grammar fragments in |range|, returns whether the operation + // is successful. Should return true if the there is no fragment in the range. + virtual bool ClearGrammarFragments(const gfx::Range& range); + + // Adds new grammar markers according to |fragments|. Clients should show + // some visual indications such as underlining. Returns whether the operation + // is successful. + virtual bool AddGrammarFragments( + const std::vector<GrammarFragment>& fragments); #endif #if defined(OS_WIN)
diff --git a/ui/base/metadata/OWNERS b/ui/base/metadata/OWNERS new file mode 100644 index 0000000..657bd63 --- /dev/null +++ b/ui/base/metadata/OWNERS
@@ -0,0 +1 @@ +kylixrd@chromium.org
diff --git a/ui/base/metadata/base_type_conversion.cc b/ui/base/metadata/base_type_conversion.cc new file mode 100644 index 0000000..647d4a89 --- /dev/null +++ b/ui/base/metadata/base_type_conversion.cc
@@ -0,0 +1,590 @@ +// Copyright 2019 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 "ui/base/metadata/base_type_conversion.h" + +#include <cmath> +#include <string> + +#include "base/containers/fixed_flat_set.h" +#include "base/no_destructor.h" +#include "base/numerics/ranges.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" +#include "base/strings/string_tokenizer.h" +#include "base/strings/string_util.h" +#include "base/strings/stringprintf.h" +#include "base/strings/sys_string_conversions.h" +#include "base/strings/utf_string_conversions.h" +#include "third_party/skia/include/core/SkScalar.h" +#include "ui/gfx/color_utils.h" +#include "ui/gfx/geometry/rect.h" + +namespace ui { +namespace metadata { + +const char kNoPrefix[] = ""; +const char kSkColorPrefix[] = "--"; + +std::u16string PointerToString(const void* pointer_val) { + return pointer_val ? u"(assigned)" : u"(not assigned)"; +} + +const std::u16string& GetNullOptStr() { + static const base::NoDestructor<std::u16string> kNullOptStr(u"<Empty>"); + return *kNullOptStr; +} + +/***** String Conversions *****/ + +#define CONVERT_NUMBER_TO_STRING(T) \ + std::u16string TypeConverter<T>::ToString(T source_value) { \ + return base::NumberToString16(source_value); \ + } + +CONVERT_NUMBER_TO_STRING(int8_t) +CONVERT_NUMBER_TO_STRING(int16_t) +CONVERT_NUMBER_TO_STRING(int32_t) +CONVERT_NUMBER_TO_STRING(int64_t) +CONVERT_NUMBER_TO_STRING(uint8_t) +CONVERT_NUMBER_TO_STRING(uint16_t) +CONVERT_NUMBER_TO_STRING(uint32_t) +CONVERT_NUMBER_TO_STRING(uint64_t) +CONVERT_NUMBER_TO_STRING(float) +CONVERT_NUMBER_TO_STRING(double) + +std::u16string TypeConverter<bool>::ToString(bool source_value) { + return source_value ? u"true" : u"false"; +} + +ValidStrings TypeConverter<bool>::GetValidStrings() { + return {u"false", u"true"}; +} + +std::u16string TypeConverter<const char*>::ToString(const char* source_value) { + return base::UTF8ToUTF16(source_value); +} + +std::u16string TypeConverter<base::FilePath>::ToString( + const base::FilePath& source_value) { + return source_value.AsUTF16Unsafe(); +} + +std::u16string TypeConverter<std::u16string>::ToString( + const std::u16string& source_value) { + return source_value; +} + +std::u16string TypeConverter<base::TimeDelta>::ToString( + const base::TimeDelta& source_value) { + return base::NumberToString16(source_value.InSecondsF()) + u"s"; +} + +std::u16string TypeConverter<gfx::Insets>::ToString( + const gfx::Insets& source_value) { + return base::ASCIIToUTF16(source_value.ToString()); +} + +std::u16string TypeConverter<gfx::Point>::ToString( + const gfx::Point& source_value) { + return base::ASCIIToUTF16(source_value.ToString()); +} + +std::u16string TypeConverter<gfx::PointF>::ToString( + const gfx::PointF& source_value) { + return base::ASCIIToUTF16(source_value.ToString()); +} + +std::u16string TypeConverter<gfx::Range>::ToString( + const gfx::Range& source_value) { + return base::ASCIIToUTF16(source_value.ToString()); +} + +std::u16string TypeConverter<gfx::Rect>::ToString( + const gfx::Rect& source_value) { + return base::ASCIIToUTF16(source_value.ToString()); +} + +std::u16string TypeConverter<gfx::RectF>::ToString( + const gfx::RectF& source_value) { + return base::ASCIIToUTF16(source_value.ToString()); +} + +std::u16string TypeConverter<gfx::ShadowValues>::ToString( + const gfx::ShadowValues& source_value) { + std::u16string ret = u"["; + for (auto shadow_value : source_value) { + ret += u" " + base::ASCIIToUTF16(shadow_value.ToString()) + u";"; + } + + ret[ret.length() - 1] = ' '; + ret += u"]"; + return ret; +} + +std::u16string TypeConverter<gfx::Size>::ToString( + const gfx::Size& source_value) { + return base::ASCIIToUTF16(source_value.ToString()); +} + +std::u16string TypeConverter<gfx::SizeF>::ToString( + const gfx::SizeF& source_value) { + return base::ASCIIToUTF16(source_value.ToString()); +} + +std::u16string TypeConverter<url::Component>::ToString( + const url::Component& source_value) { + return base::ASCIIToUTF16( + base::StringPrintf("{%d,%d}", source_value.begin, source_value.len)); +} + +base::Optional<int8_t> TypeConverter<int8_t>::FromString( + const std::u16string& source_value) { + int32_t ret = 0; + if (base::StringToInt(source_value, &ret) && + base::IsValueInRangeForNumericType<int8_t>(ret)) { + return static_cast<int8_t>(ret); + } + return base::nullopt; +} + +base::Optional<int16_t> TypeConverter<int16_t>::FromString( + const std::u16string& source_value) { + int32_t ret = 0; + if (base::StringToInt(source_value, &ret) && + base::IsValueInRangeForNumericType<int16_t>(ret)) { + return static_cast<int16_t>(ret); + } + return base::nullopt; +} + +base::Optional<int32_t> TypeConverter<int32_t>::FromString( + const std::u16string& source_value) { + int value; + return base::StringToInt(source_value, &value) ? base::make_optional(value) + : base::nullopt; +} + +base::Optional<int64_t> TypeConverter<int64_t>::FromString( + const std::u16string& source_value) { + int64_t value; + return base::StringToInt64(source_value, &value) ? base::make_optional(value) + : base::nullopt; +} + +base::Optional<uint8_t> TypeConverter<uint8_t>::FromString( + const std::u16string& source_value) { + unsigned ret = 0; + if (base::StringToUint(source_value, &ret) && + base::IsValueInRangeForNumericType<uint8_t>(ret)) { + return static_cast<uint8_t>(ret); + } + return base::nullopt; +} + +base::Optional<uint16_t> TypeConverter<uint16_t>::FromString( + const std::u16string& source_value) { + unsigned ret = 0; + if (base::StringToUint(source_value, &ret) && + base::IsValueInRangeForNumericType<uint16_t>(ret)) { + return static_cast<uint16_t>(ret); + } + return base::nullopt; +} + +base::Optional<uint32_t> TypeConverter<uint32_t>::FromString( + const std::u16string& source_value) { + unsigned value; + return base::StringToUint(source_value, &value) ? base::make_optional(value) + : base::nullopt; +} + +base::Optional<uint64_t> TypeConverter<uint64_t>::FromString( + const std::u16string& source_value) { + uint64_t value; + return base::StringToUint64(source_value, &value) ? base::make_optional(value) + : base::nullopt; +} + +base::Optional<float> TypeConverter<float>::FromString( + const std::u16string& source_value) { + if (base::Optional<double> temp = + TypeConverter<double>::FromString(source_value)) + return static_cast<float>(temp.value()); + return base::nullopt; +} + +base::Optional<double> TypeConverter<double>::FromString( + const std::u16string& source_value) { + double value; + return base::StringToDouble(base::UTF16ToUTF8(source_value), &value) + ? base::make_optional(value) + : base::nullopt; +} + +base::Optional<bool> TypeConverter<bool>::FromString( + const std::u16string& source_value) { + const bool is_true = source_value == u"true"; + if (is_true || source_value == u"false") + return is_true; + return base::nullopt; +} + +base::Optional<std::u16string> TypeConverter<std::u16string>::FromString( + const std::u16string& source_value) { + return source_value; +} + +base::Optional<base::FilePath> TypeConverter<base::FilePath>::FromString( + const std::u16string& source_value) { + return base::FilePath::FromUTF16Unsafe(source_value); +} + +base::Optional<base::TimeDelta> TypeConverter<base::TimeDelta>::FromString( + const std::u16string& source_value) { + std::string source = base::UTF16ToUTF8(source_value); + return base::TimeDelta::FromString(source); +} + +base::Optional<gfx::Insets> TypeConverter<gfx::Insets>::FromString( + const std::u16string& source_value) { + const auto values = base::SplitStringPiece( + source_value, u",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + int top, left, bottom, right; + if ((values.size() == 4) && base::StringToInt(values[0], &top) && + base::StringToInt(values[1], &left) && + base::StringToInt(values[2], &bottom) && + base::StringToInt(values[3], &right)) { + return gfx::Insets(top, left, bottom, right); + } + return base::nullopt; +} + +base::Optional<gfx::Point> TypeConverter<gfx::Point>::FromString( + const std::u16string& source_value) { + const auto values = base::SplitStringPiece( + source_value, u",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + int x, y; + if ((values.size() == 2) && base::StringToInt(values[0], &x) && + base::StringToInt(values[1], &y)) { + return gfx::Point(x, y); + } + return base::nullopt; +} + +base::Optional<gfx::PointF> TypeConverter<gfx::PointF>::FromString( + const std::u16string& source_value) { + const auto values = base::SplitStringPiece( + source_value, u",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + double x, y; + if ((values.size() == 2) && base::StringToDouble(values[0], &x) && + base::StringToDouble(values[1], &y)) { + return gfx::PointF(x, y); + } + return base::nullopt; +} + +base::Optional<gfx::Range> TypeConverter<gfx::Range>::FromString( + const std::u16string& source_value) { + const auto values = base::SplitStringPiece( + source_value, u"{,}", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + unsigned min, max; + if ((values.size() == 2) && base::StringToUint(values[0], &min) && + base::StringToUint(values[1], &max)) { + return gfx::Range(min, max); + } + return base::nullopt; +} + +base::Optional<gfx::Rect> TypeConverter<gfx::Rect>::FromString( + const std::u16string& source_value) { + const auto values = base::SplitString( + source_value, u" ", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + if (values.size() != 2) + return base::nullopt; + const base::Optional<gfx::Point> origin = + TypeConverter<gfx::Point>::FromString(values[0]); + const base::Optional<gfx::Size> size = + TypeConverter<gfx::Size>::FromString(values[1]); + if (origin && size) + return gfx::Rect(*origin, *size); + return base::nullopt; +} + +base::Optional<gfx::RectF> TypeConverter<gfx::RectF>::FromString( + const std::u16string& source_value) { + const auto values = base::SplitString( + source_value, u" ", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + if (values.size() != 2) + return base::nullopt; + const base::Optional<gfx::PointF> origin = + TypeConverter<gfx::PointF>::FromString(values[0]); + const base::Optional<gfx::SizeF> size = + TypeConverter<gfx::SizeF>::FromString(values[1]); + if (origin && size) + return gfx::RectF(*origin, *size); + return base::nullopt; +} + +base::Optional<gfx::ShadowValues> TypeConverter<gfx::ShadowValues>::FromString( + const std::u16string& source_value) { + gfx::ShadowValues ret; + const auto shadow_value_strings = base::SplitStringPiece( + source_value, u"[;]", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + + for (auto v : shadow_value_strings) { + std::u16string value = std::u16string(v); + base::String16Tokenizer tokenizer( + value, u"(,)", base::String16Tokenizer::WhitespacePolicy::kSkipOver); + tokenizer.set_options(base::String16Tokenizer::RETURN_DELIMS); + int x, y; + double blur; + if (tokenizer.GetNext() && tokenizer.token_piece() == u"(" && + tokenizer.GetNext() && base::StringToInt(tokenizer.token_piece(), &x) && + tokenizer.GetNext() && tokenizer.token_piece() == u"," && + tokenizer.GetNext() && base::StringToInt(tokenizer.token_piece(), &y) && + tokenizer.GetNext() && tokenizer.token_piece() == u")" && + tokenizer.GetNext() && tokenizer.token_piece() == u"," && + tokenizer.GetNext() && + base::StringToDouble(tokenizer.token_piece(), &blur) && + tokenizer.GetNext() && tokenizer.token_piece() == u"," && + tokenizer.GetNext()) { + const auto color = + SkColorConverter::GetNextColor(tokenizer.token_begin(), value.cend()); + if (color) + ret.emplace_back(gfx::Vector2d(x, y), blur, color.value()); + } + } + return ret; +} + +base::Optional<gfx::Size> TypeConverter<gfx::Size>::FromString( + const std::u16string& source_value) { + const auto values = base::SplitStringPiece( + source_value, u"x", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + int width, height; + if ((values.size() == 2) && base::StringToInt(values[0], &width) && + base::StringToInt(values[1], &height)) { + return gfx::Size(width, height); + } + return base::nullopt; +} + +base::Optional<gfx::SizeF> TypeConverter<gfx::SizeF>::FromString( + const std::u16string& source_value) { + const auto values = base::SplitStringPiece( + source_value, u"x", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + double width, height; + if ((values.size() == 2) && base::StringToDouble(values[0], &width) && + base::StringToDouble(values[1], &height)) { + return gfx::SizeF(width, height); + } + return base::nullopt; +} + +base::Optional<url::Component> TypeConverter<url::Component>::FromString( + const std::u16string& source_value) { + const auto values = base::SplitStringPiece( + source_value, u"{,}", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + int begin, len; + if ((values.size() == 2) && base::StringToInt(values[0], &begin) && + base::StringToInt(values[1], &len) && len >= -1) { + return url::Component(begin, len); + } + return base::nullopt; +} + +std::u16string TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::ToString( + SkColor source_value) { + return base::UTF8ToUTF16(color_utils::SkColorToRgbaString(source_value)); +} + +base::Optional<SkColor> TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::FromString( + const std::u16string& source_value) { + return GetNextColor(source_value.cbegin(), source_value.cend()); +} + +ValidStrings TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::GetValidStrings() { + return {}; +} + +bool TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::GetNextColor( + std::u16string::const_iterator start, + std::u16string::const_iterator end, + std::u16string& color, + std::u16string::const_iterator& next_token) { + static const auto open_paren = u'('; + static const auto close_paren = u')'; + static constexpr auto schemes = base::MakeFixedFlatSet<base::StringPiece16>( + {u"hsl", u"hsla", u"rgb", u"rgba"}); + + base::String16Tokenizer tokenizer( + start, end, u"(,)", base::String16Tokenizer::WhitespacePolicy::kSkipOver); + tokenizer.set_options(base::String16Tokenizer::RETURN_DELIMS); + for (; tokenizer.GetNext();) { + if (!tokenizer.token_is_delim()) { + base::StringPiece16 token = tokenizer.token_piece(); + std::u16string::const_iterator start_color = tokenizer.token_begin(); + if (base::ranges::find(schemes.begin(), schemes.end(), token) != + schemes.end()) { + if (!tokenizer.GetNext() || *tokenizer.token_begin() != open_paren) + return false; + for (; + tokenizer.GetNext() && *tokenizer.token_begin() != close_paren;) { + } + if (*tokenizer.token_begin() != close_paren) + return false; + } + next_token = tokenizer.token_end(); + color = std::u16string(start_color, next_token); + return true; + } + } + return false; +} + +bool TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::GetNextColor( + std::u16string::const_iterator start, + std::u16string::const_iterator end, + std::u16string& color) { + std::u16string::const_iterator next_token; + return GetNextColor(start, end, color, next_token); +} + +base::Optional<SkColor> TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::GetNextColor( + std::u16string::const_iterator start, + std::u16string::const_iterator end, + std::u16string::const_iterator& next_token) { + std::u16string color; + if (GetNextColor(start, end, color, next_token)) { + if (base::StartsWith(color, u"hsl", base::CompareCase::SENSITIVE)) + return ParseHslString(color); + if (base::StartsWith(color, u"rgb", base::CompareCase::SENSITIVE)) + return ParseRgbString(color); + if (base::StartsWith(color, u"0x", base::CompareCase::INSENSITIVE_ASCII)) + return ParseHexString(color); + SkColor value; + if (base::StringToUint(color, &value)) + return base::make_optional(value); + } + return base::nullopt; +} + +base::Optional<SkColor> TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::GetNextColor( + std::u16string::const_iterator start, + std::u16string::const_iterator end) { + std::u16string::const_iterator next_token; + return GetNextColor(start, end, next_token); +} + +base::Optional<SkColor> +TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::RgbaPiecesToSkColor( + const std::vector<base::StringPiece16>& pieces, + size_t start_piece) { + int r, g, b; + double a; + return ((pieces.size() >= start_piece + 4) && + base::StringToInt(pieces[start_piece], &r) && + base::IsValueInRangeForNumericType<uint8_t>(r) && + base::StringToInt(pieces[start_piece + 1], &g) && + base::IsValueInRangeForNumericType<uint8_t>(g) && + base::StringToInt(pieces[start_piece + 2], &b) && + base::IsValueInRangeForNumericType<uint8_t>(b) && + base::StringToDouble(pieces[start_piece + 3], &a) && a >= 0.0 && + a <= 1.0) + ? base::make_optional(SkColorSetARGB( + base::ClampRound<SkAlpha>(a * SK_AlphaOPAQUE), r, g, b)) + : base::nullopt; +} + +base::Optional<SkColor> +TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::ParseHexString( + const std::u16string& hex_string) { + SkColor value; + if (base::HexStringToUInt(base::UTF16ToUTF8(hex_string), &value)) { + // Add in a 1.0 alpha channel if it wasn't included in the input. + if (hex_string.length() <= 8) + value = SkColorSetA(value, 0xFF); + return base::make_optional(value); + } + return base::nullopt; +} + +base::Optional<SkColor> +TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::ParseHslString( + const std::u16string& hsl_string) { + std::u16string pruned_string; + base::RemoveChars(hsl_string, u"(%)hsla", &pruned_string); + const auto values = base::SplitStringPiece( + pruned_string, u", ", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + double h, s, v; + double a = 1.0; + if (values.size() >= 3 && values.size() <= 4 && + base::StringToDouble(values[0], &h) && + base::StringToDouble(values[1], &s) && + base::StringToDouble(values[2], &v) && + (values.size() == 3 || + (base::StringToDouble(values[3], &a) && a >= 0.0 && a <= 1.0))) { + SkScalar hsv[3]; + hsv[0] = base::ClampToRange(std::fmod(h, 360.0), 0.0, 360.0); + hsv[1] = s > 1.0 ? base::ClampToRange(s, 0.0, 100.0) / 100.0 + : base::ClampToRange(s, 0.0, 1.0); + hsv[2] = v > 1.0 ? base::ClampToRange(v, 0.0, 100.0) / 100.0 + : base::ClampToRange(v, 0.0, 1.0); + return base::make_optional( + SkHSVToColor(base::ClampRound<SkAlpha>(a * SK_AlphaOPAQUE), hsv)); + } + return base::nullopt; +} + +base::Optional<SkColor> +TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::ParseRgbString( + const std::u16string& rgb_string) { + // Declare a constant string here for use below since it might trigger an + // ASAN error due to the stack temp going out of scope before the call to + // RgbaPiecesToSkColor. + std::u16string pruned_string; + base::RemoveChars(rgb_string, u"()rgba", &pruned_string); + auto values = base::SplitStringPiece( + pruned_string, u", ", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + // if it was just an rgb string, add the 1.0 alpha + if (values.size() == 3) + values.push_back(u"1.0"); + return RgbaPiecesToSkColor(values, 0); +} + +} // namespace metadata +} // namespace ui + +DEFINE_ENUM_CONVERTERS(gfx::HorizontalAlignment, + {gfx::HorizontalAlignment::ALIGN_LEFT, u"ALIGN_LEFT"}, + {gfx::HorizontalAlignment::ALIGN_CENTER, + u"ALIGN_CENTER"}, + {gfx::HorizontalAlignment::ALIGN_RIGHT, u"ALIGN_RIGHT"}, + {gfx::HorizontalAlignment::ALIGN_TO_HEAD, + u"ALIGN_TO_HEAD"}) + +DEFINE_ENUM_CONVERTERS(gfx::VerticalAlignment, + {gfx::VerticalAlignment::ALIGN_TOP, u"ALIGN_TOP"}, + {gfx::VerticalAlignment::ALIGN_MIDDLE, u"ALIGN_MIDDLE"}, + {gfx::VerticalAlignment::ALIGN_BOTTOM, u"ALIGN_BOTTOM"}) + +DEFINE_ENUM_CONVERTERS(gfx::ElideBehavior, + {gfx::ElideBehavior::NO_ELIDE, u"NO_ELIDE"}, + {gfx::ElideBehavior::TRUNCATE, u"TRUNCATE"}, + {gfx::ElideBehavior::ELIDE_HEAD, u"ELIDE_HEAD"}, + {gfx::ElideBehavior::ELIDE_MIDDLE, u"ELIDE_MIDDLE"}, + {gfx::ElideBehavior::ELIDE_TAIL, u"ELIDE_TAIL"}, + {gfx::ElideBehavior::ELIDE_EMAIL, u"ELIDE_EMAIL"}, + {gfx::ElideBehavior::FADE_TAIL, u"FADE_TAIL"}) + +DEFINE_ENUM_CONVERTERS( + ui::MenuSeparatorType, + {ui::MenuSeparatorType::NORMAL_SEPARATOR, u"NORMAL_SEPARATOR"}, + {ui::MenuSeparatorType::DOUBLE_SEPARATOR, u"DOUBLE_SEPARATOR"}, + {ui::MenuSeparatorType::UPPER_SEPARATOR, u"UPPER_SEPARATOR"}, + {ui::MenuSeparatorType::LOWER_SEPARATOR, u"LOWER_SEPARATOR"}, + {ui::MenuSeparatorType::SPACING_SEPARATOR, u"SPACING_SEPARATOR"}, + {ui::MenuSeparatorType::VERTICAL_SEPARATOR, u"VERTICAL_SEPARATOR"}, + {ui::MenuSeparatorType::PADDED_SEPARATOR, u"PADDED_SEPARATOR"})
diff --git a/ui/base/metadata/base_type_conversion.h b/ui/base/metadata/base_type_conversion.h new file mode 100644 index 0000000..f5670f5 --- /dev/null +++ b/ui/base/metadata/base_type_conversion.h
@@ -0,0 +1,377 @@ +// 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. + +#ifndef UI_BASE_METADATA_BASE_TYPE_CONVERSION_H_ +#define UI_BASE_METADATA_BASE_TYPE_CONVERSION_H_ + +#include <stdint.h> + +#include <algorithm> // Silence broken lint check +#include <memory> +#include <string> +#include <utility> +#include <vector> + +#include "base/component_export.h" +#include "base/containers/fixed_flat_map.h" +#include "base/files/file_path.h" +#include "base/optional.h" +#include "base/ranges/algorithm.h" +#include "base/ranges/ranges.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_piece.h" +#include "base/strings/string_split.h" +#include "base/strings/string_util.h" +#include "base/strings/stringprintf.h" +#include "base/strings/sys_string_conversions.h" +#include "base/strings/utf_string_conversions.h" +#include "base/time/time.h" +#include "third_party/skia/include/core/SkColor.h" +#include "ui/base/models/menu_separator_types.h" +#include "ui/gfx/geometry/insets.h" +#include "ui/gfx/geometry/point.h" +#include "ui/gfx/geometry/point_f.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/gfx/geometry/rect_f.h" +#include "ui/gfx/geometry/size.h" +#include "ui/gfx/geometry/size_f.h" +#include "ui/gfx/range/range.h" +#include "ui/gfx/shadow_value.h" +#include "ui/gfx/text_constants.h" +#include "url/gurl.h" +#include "url/third_party/mozilla/url_parse.h" + +namespace ui { +namespace metadata { + +using ValidStrings = std::vector<std::u16string>; + +// Various metadata methods pass types either by value or const ref depending on +// whether the types are "small" (defined as "fundamental, enum, or pointer"). +// ArgType<T> gives the appropriate type to use as an argument in such cases. +template <typename T> +using ArgType = + typename std::conditional<std::is_fundamental<T>::value || + std::is_enum<T>::value || + std::is_pointer<T>::value || + (std::is_move_assignable<T>::value && + std::is_move_constructible<T>::value && + !std::is_copy_assignable<T>::value && + !std::is_copy_constructible<T>::value), + T, + const T&>::type; + +COMPONENT_EXPORT(UI_BASE) extern const char kNoPrefix[]; +COMPONENT_EXPORT(UI_BASE) extern const char kSkColorPrefix[]; + +// General Type Conversion Template Functions --------------------------------- +template <bool serializable, + bool read_only = false, + const char* name_prefix = kNoPrefix> +struct BaseTypeConverter { + static constexpr bool is_serializable = serializable; + static constexpr bool is_read_only = read_only; + static bool IsSerializable() { return is_serializable; } + static bool IsReadOnly() { return is_read_only; } + static const char* PropertyNamePrefix() { return name_prefix; } +}; + +template <typename T> +struct TypeConverter : BaseTypeConverter<std::is_enum<T>::value> { + static std::u16string ToString(ArgType<T> source_value); + static base::Optional<T> FromString(const std::u16string& source_value); + static ValidStrings GetValidStrings(); +}; + +// The following definitions and macros are needed only in cases where a type +// is a mere alias to a POD type AND a specialized type converter is also needed +// to handle different the string conversions different from the existing POD +// type converter. See SkColor below as an example of their use. +// NOTE: This should be a rare occurrence and if possible use a unique type and +// a TypeConverter specialization based on that unique type. + +template <typename T, typename K> +struct Uniquifier { + using type = T; + using tag = K; +}; + +#define MAKE_TYPE_UNIQUE(type_name) \ + struct type_name##Tag {}; \ + using type_name##Unique = \ + ::ui::metadata::Uniquifier<type_name, type_name##Tag> + +#define _UNIQUE_TYPE_NAME1(type_name) type_name##Unique + +#define _UNIQUE_TYPE_NAME2(qualifier, type_name) qualifier::type_name##Unique + +#define _GET_TYPE_MACRO(_1, _2, NAME, ...) NAME + +#define UNIQUE_TYPE_NAME(name, ...) \ + _GET_TYPE_MACRO(name, ##__VA_ARGS__, _UNIQUE_TYPE_NAME2, _UNIQUE_TYPE_NAME1) \ + (name, ##__VA_ARGS__) + +// Types and macros for generating enum converters ---------------------------- +template <typename T> +struct EnumStringsMap; + +// ***************************************************************** +// * NOTE: The ENUM macros *must* be placed outside any namespace. * +// ***************************************************************** +// +// Use this macro only if your enum converters need to be accessible across +// modules. Place this in the header file for the module and use the other macro +// below as described. +// +#define EXPORT_ENUM_CONVERTERS(T, EXPORT) \ + template <> \ + EXPORT std::u16string ui::metadata::TypeConverter<T>::ToString( \ + ui::metadata::ArgType<T> source_value); \ + \ + template <> \ + EXPORT base::Optional<T> ui::metadata::TypeConverter<T>::FromString( \ + const std::u16string& str); \ + \ + template <> \ + EXPORT ui::metadata::ValidStrings \ + ui::metadata::TypeConverter<T>::GetValidStrings(); + +// Generate the code to define a enum type to and from std::u16string +// conversions. The first argument is the type T, and the rest of the argument +// should have the enum value and string pairs defined in a format like +// "{enum_value0, string16_value0}, {enum_value1, string16_value1} ...". +// Both enum_values and string16_values need to be compile time constants. +// +#define DEFINE_ENUM_CONVERTERS(T, ...) \ + template <> \ + struct ui::metadata::EnumStringsMap<T> { \ + static_assert(std::is_enum<T>::value, "Error: " #T " is not an enum."); \ + \ + static const auto& Get() { \ + static constexpr auto kMap = \ + base::MakeFixedFlatMap<T, base::StringPiece16>({__VA_ARGS__}); \ + return kMap; \ + } \ + }; \ + \ + template <> \ + std::u16string ui::metadata::TypeConverter<T>::ToString( \ + ui::metadata::ArgType<T> source_value) { \ + const auto& map = EnumStringsMap<T>::Get(); \ + auto* it = map.find(source_value); \ + return it != map.end() ? std::u16string(it->second) : std::u16string(); \ + } \ + \ + template <> \ + base::Optional<T> ui::metadata::TypeConverter<T>::FromString( \ + const std::u16string& str) { \ + const auto& map = EnumStringsMap<T>::Get(); \ + using Pair = base::ranges::range_value_t<decltype(map)>; \ + auto* it = base::ranges::find(map, str, &Pair::second); \ + return it != map.end() ? base::make_optional(it->first) : base::nullopt; \ + } \ + \ + template <> \ + ui::metadata::ValidStrings \ + ui::metadata::TypeConverter<T>::GetValidStrings() { \ + ValidStrings string_values; \ + base::ranges::transform( \ + EnumStringsMap<T>::Get(), std::back_inserter(string_values), \ + [](const auto& pair) { return std::u16string(pair.second); }); \ + return string_values; \ + } + +// String Conversions --------------------------------------------------------- + +COMPONENT_EXPORT(UI_BASE) +std::u16string PointerToString(const void* pointer_val); + +#define DECLARE_CONVERSIONS(T) \ + template <> \ + struct COMPONENT_EXPORT(UI_BASE) \ + TypeConverter<T> : BaseTypeConverter<true> { \ + static std::u16string ToString(ArgType<T> source_value); \ + static base::Optional<T> FromString(const std::u16string& source_value); \ + static ValidStrings GetValidStrings() { return {}; } \ + }; + +DECLARE_CONVERSIONS(int8_t) +DECLARE_CONVERSIONS(int16_t) +DECLARE_CONVERSIONS(int32_t) +DECLARE_CONVERSIONS(int64_t) +DECLARE_CONVERSIONS(uint8_t) +DECLARE_CONVERSIONS(uint16_t) +DECLARE_CONVERSIONS(uint32_t) +DECLARE_CONVERSIONS(uint64_t) +DECLARE_CONVERSIONS(float) +DECLARE_CONVERSIONS(double) +DECLARE_CONVERSIONS(const char*) +DECLARE_CONVERSIONS(base::FilePath) +DECLARE_CONVERSIONS(std::u16string) +DECLARE_CONVERSIONS(base::TimeDelta) +DECLARE_CONVERSIONS(gfx::Insets) +DECLARE_CONVERSIONS(gfx::Point) +DECLARE_CONVERSIONS(gfx::PointF) +DECLARE_CONVERSIONS(gfx::Range) +DECLARE_CONVERSIONS(gfx::Rect) +DECLARE_CONVERSIONS(gfx::RectF) +DECLARE_CONVERSIONS(gfx::ShadowValues) +DECLARE_CONVERSIONS(gfx::Size) +DECLARE_CONVERSIONS(gfx::SizeF) +DECLARE_CONVERSIONS(url::Component) + +#undef DECLARE_CONVERSIONS + +template <> +struct COMPONENT_EXPORT(UI_BASE) TypeConverter<bool> : BaseTypeConverter<true> { + static std::u16string ToString(bool source_value); + static base::Optional<bool> FromString(const std::u16string& source_value); + static ValidStrings GetValidStrings(); +}; + +// Special conversions for wrapper types -------------------------------------- + +COMPONENT_EXPORT(UI_BASE) const std::u16string& GetNullOptStr(); + +template <typename T> +struct TypeConverter<base::Optional<T>> + : BaseTypeConverter<TypeConverter<T>::is_serializable> { + static std::u16string ToString(ArgType<base::Optional<T>> source_value) { + if (!source_value) + return GetNullOptStr(); + return TypeConverter<T>::ToString(source_value.value()); + } + static base::Optional<base::Optional<T>> FromString( + const std::u16string& source_value) { + if (source_value == GetNullOptStr()) + return base::make_optional<base::Optional<T>>(base::nullopt); + + auto ret = TypeConverter<T>::FromString(source_value); + return ret ? base::make_optional(ret) : base::nullopt; + } + static ValidStrings GetValidStrings() { return {}; } +}; + +// Special Conversions for std:unique_ptr<T> and T* types ---------------------- + +template <typename T> +struct TypeConverter<std::unique_ptr<T>> : BaseTypeConverter<false, true> { + static std::u16string ToString(const std::unique_ptr<T>& source_value) { + return PointerToString(source_value.get()); + } + static std::u16string ToString(const T* source_value) { + return PointerToString(source_value); + } + static base::Optional<std::unique_ptr<T>> FromString( + const std::u16string& source_value) { + DCHECK(false) << "Type converter cannot convert from string."; + return base::nullopt; + } + static ValidStrings GetValidStrings() { return {}; } +}; + +template <typename T> +struct TypeConverter<T*> : BaseTypeConverter<false, true> { + static std::u16string ToString(ArgType<T*> source_value) { + return PointerToString(source_value); + } + static base::Optional<T*> FromString(const std::u16string& source_value) { + DCHECK(false) << "Type converter cannot convert from string."; + return base::nullopt; + } + static ValidStrings GetValidStrings() { return {}; } +}; + +template <typename T> +struct TypeConverter<std::vector<T>> + : BaseTypeConverter<TypeConverter<T>::is_serializable> { + static std::u16string ToString(ArgType<std::vector<T>> source_value) { + std::vector<std::u16string> serialized; + base::ranges::transform(source_value, std::back_inserter(serialized), + &TypeConverter<T>::ToString); + return u"{" + base::JoinString(serialized, u",") + u"}"; + } + static base::Optional<std::vector<T>> FromString( + const std::u16string& source_value) { + if (source_value.empty() || source_value.front() != u'{' || + source_value.back() != u'}') + return base::nullopt; + const auto values = + base::SplitString(source_value.substr(1, source_value.length() - 2), + u",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); + std::vector<T> output; + for (const auto& value : values) { + auto ret = TypeConverter<T>::FromString(value); + if (!ret) + return base::nullopt; + output.push_back(*ret); + } + return base::make_optional(output); + } + static ValidStrings GetValidStrings() { return {}; } +}; + +MAKE_TYPE_UNIQUE(SkColor); + +template <> +struct COMPONENT_EXPORT(UI_BASE) TypeConverter<UNIQUE_TYPE_NAME(SkColor)> + : BaseTypeConverter<true, false, kSkColorPrefix> { + static std::u16string ToString(SkColor source_value); + static base::Optional<SkColor> FromString(const std::u16string& source_value); + static ValidStrings GetValidStrings(); + + // Parses a string within |start| and |end| for a color string in the forms + // rgb(r, g, b), rgba(r, g, b, a), hsl(h, s%, l%), hsla(h, s%, l%, a), + // 0xXXXXXX, 0xXXXXXXXX, <decimal number> + // Returns the full string in |color| and the position immediately following + // the last token in |next_token|. + // Returns false if the input string cannot be properly parsed. |color| and + // |next_token| will be undefined. + static bool GetNextColor(std::u16string::const_iterator start, + std::u16string::const_iterator end, + std::u16string& color, + std::u16string::const_iterator& next_token); + static bool GetNextColor(std::u16string::const_iterator start, + std::u16string::const_iterator end, + std::u16string& color); + + // Same as above, except returns the color string converted into an |SkColor|. + // Returns base::nullopt if the color string cannot be properly parsed or the + // string cannot be converted into a valid SkColor and |next_token| may be + // undefined. + static base::Optional<SkColor> GetNextColor( + std::u16string::const_iterator start, + std::u16string::const_iterator end, + std::u16string::const_iterator& next_token); + static base::Optional<SkColor> GetNextColor( + std::u16string::const_iterator start, + std::u16string::const_iterator end); + + // Converts the four elements of |pieces| beginning at |start_piece| to an + // SkColor by assuming the pieces are split from a string like + // "rgba(r,g,b,a)". Returns nullopt if conversion was unsuccessful. + static base::Optional<SkColor> RgbaPiecesToSkColor( + const std::vector<base::StringPiece16>& pieces, + size_t start_piece); + + private: + static base::Optional<SkColor> ParseHexString( + const std::u16string& hex_string); + static base::Optional<SkColor> ParseHslString( + const std::u16string& hsl_string); + static base::Optional<SkColor> ParseRgbString( + const std::u16string& rgb_string); +}; + +using SkColorConverter = TypeConverter<UNIQUE_TYPE_NAME(SkColor)>; + +} // namespace metadata +} // namespace ui + +EXPORT_ENUM_CONVERTERS(gfx::HorizontalAlignment, COMPONENT_EXPORT(UI_BASE)) +EXPORT_ENUM_CONVERTERS(gfx::VerticalAlignment, COMPONENT_EXPORT(UI_BASE)) +EXPORT_ENUM_CONVERTERS(gfx::ElideBehavior, COMPONENT_EXPORT(UI_BASE)) +EXPORT_ENUM_CONVERTERS(ui::MenuSeparatorType, COMPONENT_EXPORT(UI_BASE)) + +#endif // UI_BASE_METDATA_BASE_TYPE_CONVERSION_H_ \ No newline at end of file
diff --git a/ui/base/metadata/base_type_conversion_unittest.cc b/ui/base/metadata/base_type_conversion_unittest.cc new file mode 100644 index 0000000..8cd8ef7 --- /dev/null +++ b/ui/base/metadata/base_type_conversion_unittest.cc
@@ -0,0 +1,258 @@ +// Copyright 2019 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 "ui/base/metadata/base_type_conversion.h" + +#include "base/ranges/ranges.h" +#include "base/strings/string_tokenizer.h" +#include "base/strings/utf_string_conversions.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "testing/platform_test.h" +#include "ui/gfx/geometry/insets.h" +#include "ui/gfx/geometry/rect.h" +//#include "ui/views/controls/button/button.h" + +using TypeConversionTest = PlatformTest; + +// Used in CheckIsSerializable test case. +enum TestResult { + TEST_TRUE, + TEST_FALSE, +}; +DEFINE_ENUM_CONVERTERS(TestResult, {TEST_TRUE, u"TRUE"}, {TEST_FALSE, u"FALSE"}) + +TEST_F(TypeConversionTest, TestConversion_IntToString) { + int from_int = 5; + std::u16string to_string = + ui::metadata::TypeConverter<int>::ToString(from_int); + + EXPECT_EQ(to_string, u"5"); +} + +TEST_F(TypeConversionTest, TestConversion_StringToInt) { + std::u16string from_string = u"10"; + EXPECT_EQ(ui::metadata::TypeConverter<int>::FromString(from_string), 10); +} + +// This tests whether the converter handles a bogus input string, in which case +// the return value should be nullopt. +TEST_F(TypeConversionTest, TestConversion_BogusStringToInt) { + std::u16string from_string = u"Foo"; + EXPECT_EQ(ui::metadata::TypeConverter<int>::FromString(from_string), + base::nullopt); +} + +TEST_F(TypeConversionTest, TestConversion_BogusStringToFloat) { + std::u16string from_string = u"1.2"; + EXPECT_EQ(ui::metadata::TypeConverter<float>::FromString(from_string), 1.2f); +} + +TEST_F(TypeConversionTest, TestConversion_OptionalIntToString) { + base::Optional<int> src; + std::u16string to_string = + ui::metadata::TypeConverter<base::Optional<int>>::ToString(src); + EXPECT_EQ(to_string, ui::metadata::GetNullOptStr()); + + src = 5; + to_string = ui::metadata::TypeConverter<base::Optional<int>>::ToString(src); + EXPECT_EQ(to_string, u"5"); +} + +TEST_F(TypeConversionTest, TestConversion_StringToOptionalInt) { + base::Optional<int> ret; + EXPECT_EQ(ui::metadata::TypeConverter<base::Optional<int>>::FromString( + ui::metadata::GetNullOptStr()), + base::make_optional(ret)); + + EXPECT_EQ(ui::metadata::TypeConverter<base::Optional<int>>::FromString(u"10"), + 10); + + EXPECT_EQ( + ui::metadata::TypeConverter<base::Optional<int>>::FromString(u"ab0"), + base::nullopt); +} + +TEST_F(TypeConversionTest, TestConversion_ShadowValuesToString) { + gfx::ShadowValues shadow_values; + shadow_values.emplace_back(gfx::Vector2d(1, 2), .3, + SkColorSetARGB(128, 255, 0, 0)); + + EXPECT_EQ( + ui::metadata::TypeConverter<gfx::ShadowValues>::ToString(shadow_values), + u"[ (1,2),0.30,rgba(255,0,0,128) ]"); + + shadow_values.emplace_back(gfx::Vector2d(9, 8), .76, + SkColorSetARGB(20, 0, 64, 255)); + + EXPECT_EQ( + ui::metadata::TypeConverter<gfx::ShadowValues>::ToString(shadow_values), + u"[ (1,2),0.30,rgba(255,0,0,128); (9,8),0.76,rgba(0,64,255,20) ]"); +} + +TEST_F(TypeConversionTest, TestConversion_StringToShadowValues) { + base::Optional<gfx::ShadowValues> opt_result = + ui::metadata::TypeConverter<gfx::ShadowValues>::FromString( + u"[ (6,4),0.53,rgba(23,44,0,1); (93,83),4.33,rgba(10,20,0,0.059) ]"); + + EXPECT_EQ(opt_result.has_value(), true); + gfx::ShadowValues result = opt_result.value(); + EXPECT_EQ(result.size(), 2U); + + EXPECT_EQ(result[0].color(), SkColorSetARGB(255, 23, 44, 0)); + EXPECT_EQ(result[1].color(), SkColorSetARGB(15, 10, 20, 0)); + + EXPECT_EQ(result[0].x(), 6); + EXPECT_EQ(result[1].x(), 93); + + EXPECT_EQ(result[0].y(), 4); + EXPECT_EQ(result[1].y(), 83); + + EXPECT_EQ(result[0].blur(), 0.53); + EXPECT_EQ(result[1].blur(), 4.33); +} + +TEST_F(TypeConversionTest, TestConversion_SkColorConversions) { + // Check conversion from rgb hex string + base::Optional<SkColor> result = + ui::metadata::SkColorConverter::FromString(u"0x112233"); + EXPECT_TRUE(result); + EXPECT_EQ(result.value(), SkColorSetRGB(0x11, 0x22, 0x33)); + + // Check conversion from argb hex string + result = ui::metadata::SkColorConverter::FromString(u"0x7F112233"); + EXPECT_TRUE(result); + EXPECT_EQ(result.value(), SkColorSetARGB(0x7F, 0x11, 0x22, 0x33)); + + // Check conversion from rgb(r,g,b) string + result = ui::metadata::SkColorConverter::FromString(u"rgb(0, 128, 192)"); + EXPECT_TRUE(result); + EXPECT_EQ(result.value(), SkColorSetRGB(0, 128, 192)); + + // Check conversion from rgba(r,g,b,a) string + result = + ui::metadata::SkColorConverter::FromString(u"rgba(0, 128, 192, 0.5)"); + EXPECT_TRUE(result); + EXPECT_EQ(result.value(), SkColorSetARGB(128, 0, 128, 192)); + + // Check conversion from hsl(h,s,l) string + result = ui::metadata::SkColorConverter::FromString(u"hsl(195, 100%, 50%)"); + EXPECT_TRUE(result); + const SkScalar hsv[3] = {195.0, 1.0, 0.5}; + EXPECT_EQ(result.value(), SkHSVToColor(hsv)); + + // Check conversion from hsla(h,s,l,a) string + result = + ui::metadata::SkColorConverter::FromString(u"hsl(195, 100%, 50%, 0.5)"); + EXPECT_TRUE(result); + EXPECT_EQ(result.value(), SkHSVToColor(128, hsv)); + + // Check conversion from a decimal integer value + result = ui::metadata::SkColorConverter::FromString(u"4278239231"); + EXPECT_TRUE(result); + EXPECT_EQ(result.value(), SkColorSetARGB(255, 0, 191, 255)); + + // Check without commas. + result = ui::metadata::SkColorConverter::FromString(u"rgba(92 92 92 1)"); + EXPECT_TRUE(result); + EXPECT_EQ(result.value(), SkColorSetARGB(255, 92, 92, 92)); + + // Don't support the CSS hash color style + result = ui::metadata::SkColorConverter::FromString(u"#03254"); + EXPECT_FALSE(result); + + // Don't support some common invalid values + result = ui::metadata::SkColorConverter::FromString(u"rgba(1,2,3,4)"); + EXPECT_FALSE(result); + + result = ui::metadata::SkColorConverter::FromString(u"rgba(1,2,3,4"); + EXPECT_FALSE(result); + + result = ui::metadata::SkColorConverter::FromString(u"hsla(1,2,3,4)"); + EXPECT_FALSE(result); +} + +TEST_F(TypeConversionTest, TestConversion_ColorParserTest) { + using converter = ui::metadata::SkColorConverter; + std::u16string color; + const std::u16string source = + u"rgb(0, 128, 192), hsl(90, 100%, 30%), rgba(128, 128, 128, 0.5), " + u"hsla(240, 100%, 50%, 0.5)"; + auto start_pos = source.cbegin(); + EXPECT_TRUE( + converter::GetNextColor(start_pos, source.cend(), color, start_pos)); + EXPECT_EQ(color, u"rgb(0, 128, 192)"); + EXPECT_TRUE( + converter::GetNextColor(start_pos, source.cend(), color, start_pos)); + EXPECT_EQ(color, u"hsl(90, 100%, 30%)"); + EXPECT_TRUE( + converter::GetNextColor(start_pos, source.cend(), color, start_pos)); + EXPECT_EQ(color, u"rgba(128, 128, 128, 0.5)"); + EXPECT_TRUE(converter::GetNextColor(start_pos, source.cend(), color)); + EXPECT_EQ(color, u"hsla(240, 100%, 50%, 0.5)"); +} + +TEST_F(TypeConversionTest, TestConversion_InsetsToString) { + constexpr gfx::Insets kInsets(3, 5, 7, 9); + + std::u16string to_string = + ui::metadata::TypeConverter<gfx::Insets>::ToString(kInsets); + + EXPECT_EQ(to_string, base::ASCIIToUTF16(kInsets.ToString())); +} + +TEST_F(TypeConversionTest, TestConversion_StringToInsets) { + std::u16string from_string = u"2,3,4,5"; + EXPECT_EQ(ui::metadata::TypeConverter<gfx::Insets>::FromString(from_string), + gfx::Insets(2, 3, 4, 5)); +} + +TEST_F(TypeConversionTest, TestConversion_VectorToString) { + const std::vector<int> kVector{3, 5, 7, 9}; + + std::u16string to_string = + ui::metadata::TypeConverter<std::vector<int>>::ToString(kVector); + + EXPECT_EQ(to_string, u"{3,5,7,9}"); +} + +TEST_F(TypeConversionTest, TestConversion_StringToVector) { + std::u16string from_string = u"{2,3,4,5}"; + EXPECT_EQ( + ui::metadata::TypeConverter<std::vector<int>>::FromString(from_string), + std::vector<int>({2, 3, 4, 5})); +} + +TEST_F(TypeConversionTest, CheckIsSerializable) { + // Test types with explicitly added converters. + EXPECT_TRUE(ui::metadata::TypeConverter<int8_t>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<int16_t>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<int32_t>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<int64_t>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<uint8_t>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<uint16_t>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<uint32_t>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<uint64_t>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<float>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<double>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<bool>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<const char*>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<std::u16string>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<gfx::ShadowValues>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<gfx::Size>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<gfx::Range>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<gfx::Insets>::IsSerializable()); + + // Test enum type. + EXPECT_TRUE(ui::metadata::TypeConverter<TestResult>::IsSerializable()); + + // Test aliased types. + EXPECT_TRUE(ui::metadata::TypeConverter<int>::IsSerializable()); + EXPECT_TRUE(ui::metadata::TypeConverter<SkColor>::IsSerializable()); + + // Test base::Optional type. + EXPECT_TRUE(ui::metadata::TypeConverter< + base::Optional<const char*>>::IsSerializable()); + EXPECT_TRUE( + ui::metadata::TypeConverter<base::Optional<int>>::IsSerializable()); +}
diff --git a/ui/views/metadata/metadata_cache.cc b/ui/base/metadata/metadata_cache.cc similarity index 90% rename from ui/views/metadata/metadata_cache.cc rename to ui/base/metadata/metadata_cache.cc index d37abba..4a848f4 100644 --- a/ui/views/metadata/metadata_cache.cc +++ b/ui/base/metadata/metadata_cache.cc
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/views/metadata/metadata_cache.h" +#include "ui/base/metadata/metadata_cache.h" #include <algorithm> #include "base/check_op.h" #include "base/no_destructor.h" -#include "ui/views/metadata/metadata_types.h" +#include "ui/base/metadata/metadata_types.h" -namespace views { +namespace ui { namespace metadata { MetaDataCache::MetaDataCache() = default; @@ -47,4 +47,4 @@ } } // namespace metadata -} // namespace views +} // namespace ui
diff --git a/ui/views/metadata/metadata_cache.h b/ui/base/metadata/metadata_cache.h similarity index 81% rename from ui/views/metadata/metadata_cache.h rename to ui/base/metadata/metadata_cache.h index f30874d6..70ceaa6e 100644 --- a/ui/views/metadata/metadata_cache.h +++ b/ui/base/metadata/metadata_cache.h
@@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_VIEWS_METADATA_METADATA_CACHE_H_ -#define UI_VIEWS_METADATA_METADATA_CACHE_H_ +#ifndef UI_BASE_METADATA_METADATA_CACHE_H_ +#define UI_BASE_METADATA_METADATA_CACHE_H_ #include <memory> #include <utility> #include <vector> +#include "base/component_export.h" #include "base/macros.h" -#include "ui/views/metadata/metadata_types.h" -#include "ui/views/views_export.h" +#include "ui/base/metadata/metadata_types.h" -namespace views { +namespace ui { namespace metadata { class ClassMetaData; @@ -23,7 +23,7 @@ // MetaDataCache is implemented as a singleton. This also implies that each // instance of ClassMetaData registered into the cache represents one and only // one class type. -class VIEWS_EXPORT MetaDataCache { +class COMPONENT_EXPORT(UI_BASE) MetaDataCache { public: MetaDataCache(); @@ -46,7 +46,8 @@ // // Registers the class metadata into the global cache. Will DCHECK if the // metadata for a class is already registered. -VIEWS_EXPORT void RegisterClassInfo(std::unique_ptr<ClassMetaData> meta_data); +COMPONENT_EXPORT(UI_BASE) +void RegisterClassInfo(std::unique_ptr<ClassMetaData> meta_data); // Help function for creating and registering the metadata container into the // global cache for a given class. The metadata information is owned by the @@ -60,6 +61,6 @@ } } // namespace metadata -} // namespace views +} // namespace ui -#endif // UI_VIEWS_METADATA_METADATA_CACHE_H_ +#endif // UI_BASE_METADATA_METADATA_CACHE_H_
diff --git a/ui/views/metadata/metadata_header_macros.h b/ui/base/metadata/metadata_header_macros.h similarity index 77% rename from ui/views/metadata/metadata_header_macros.h rename to ui/base/metadata/metadata_header_macros.h index f983ac9..dba286e 100644 --- a/ui/views/metadata/metadata_header_macros.h +++ b/ui/base/metadata/metadata_header_macros.h
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_VIEWS_METADATA_METADATA_HEADER_MACROS_H_ -#define UI_VIEWS_METADATA_METADATA_HEADER_MACROS_H_ +#ifndef UI_BASE_METADATA_METADATA_HEADER_MACROS_H_ +#define UI_BASE_METADATA_METADATA_HEADER_MACROS_H_ -#include "ui/views/metadata/metadata_macros_internal.h" +#include "ui/base/metadata/metadata_macros_internal.h" // Generate Metadata's accessor functions and internal class declaration. // This should be used in a header file of the View class or its subclasses. @@ -19,4 +19,4 @@ METADATA_ACCESSORS_INTERNAL_BASE(class_name) \ METADATA_CLASS_INTERNAL(class_name, __FILE__, __LINE__) -#endif // UI_VIEWS_METADATA_METADATA_HEADER_MACROS_H_ +#endif // UI_BASE_METADATA_METADATA_HEADER_MACROS_H_
diff --git a/ui/views/metadata/metadata_impl_macros.h b/ui/base/metadata/metadata_impl_macros.h similarity index 92% rename from ui/views/metadata/metadata_impl_macros.h rename to ui/base/metadata/metadata_impl_macros.h index 640d83e6..162b8940 100644 --- a/ui/views/metadata/metadata_impl_macros.h +++ b/ui/base/metadata/metadata_impl_macros.h
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_VIEWS_METADATA_METADATA_IMPL_MACROS_H_ -#define UI_VIEWS_METADATA_METADATA_IMPL_MACROS_H_ +#ifndef UI_BASE_METADATA_METADATA_IMPL_MACROS_H_ +#define UI_BASE_METADATA_METADATA_IMPL_MACROS_H_ #include <memory> #include <string> #include <utility> -#include "ui/views/metadata/metadata_cache.h" -#include "ui/views/metadata/metadata_macros_internal.h" -#include "ui/views/metadata/property_metadata.h" +#include "ui/base/metadata/metadata_cache.h" +#include "ui/base/metadata/metadata_macros_internal.h" +#include "ui/base/metadata/property_metadata.h" // Generate the implementation of the metadata accessors and internal class with // additional macros for defining the class' properties. @@ -78,4 +78,4 @@ #property_type); \ AddMemberData(std::move(property_key##_prop)); -#endif // UI_VIEWS_METADATA_METADATA_IMPL_MACROS_H_ +#endif // UI_BASE_METADATA_METADATA_IMPL_MACROS_H_
diff --git a/ui/views/metadata/metadata_macros_internal.h b/ui/base/metadata/metadata_macros_internal.h similarity index 68% rename from ui/views/metadata/metadata_macros_internal.h rename to ui/base/metadata/metadata_macros_internal.h index 0fb4f6f..a87c087 100644 --- a/ui/views/metadata/metadata_macros_internal.h +++ b/ui/base/metadata/metadata_macros_internal.h
@@ -2,92 +2,93 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_VIEWS_METADATA_METADATA_MACROS_INTERNAL_H_ -#define UI_VIEWS_METADATA_METADATA_MACROS_INTERNAL_H_ +#ifndef UI_BASE_METADATA_METADATA_MACROS_INTERNAL_H_ +#define UI_BASE_METADATA_METADATA_MACROS_INTERNAL_H_ #include <string> #include <utility> #include "base/compiler_specific.h" -#include "ui/views/metadata/metadata_types.h" +#include "ui/base/metadata/metadata_types.h" +#include "ui/base/metadata/property_metadata.h" // Internal Metadata Generation Helpers --------------------------------------- #define METADATA_CLASS_NAME_INTERNAL(class_name) class_name##_MetaData // Metadata Accessors --------------------------------------------------------- -#define METADATA_ACCESSORS_INTERNAL(class_name) \ - static const char kViewClassName[]; \ - const char* GetClassName() const override; \ - static views::metadata::ClassMetaData* MetaData(); \ - views::metadata::ClassMetaData* GetClassMetaData() override; +#define METADATA_ACCESSORS_INTERNAL(class_name) \ + static const char kViewClassName[]; \ + const char* GetClassName() const override; \ + static ui::metadata::ClassMetaData* MetaData(); \ + ui::metadata::ClassMetaData* GetClassMetaData() override; // A version of METADATA_ACCESSORS_INTERNAL for View, the root of the metadata // hierarchy; here GetClassName() is not declared as an override. #define METADATA_ACCESSORS_INTERNAL_BASE(class_name) \ static const char kViewClassName[]; \ virtual const char* GetClassName() const; \ - static views::metadata::ClassMetaData* MetaData(); \ - views::metadata::ClassMetaData* GetClassMetaData() override; + static ui::metadata::ClassMetaData* MetaData(); \ + ui::metadata::ClassMetaData* GetClassMetaData() override; // Metadata Class ------------------------------------------------------------- -#define METADATA_CLASS_INTERNAL(class_name, file, line) \ - class METADATA_CLASS_NAME_INTERNAL(class_name) \ - : public views::metadata::ClassMetaData { \ - public: \ - using ViewClass = class_name; \ - explicit METADATA_CLASS_NAME_INTERNAL(class_name)() \ - : ClassMetaData(file, line) { \ - BuildMetaData(); \ - } \ - METADATA_CLASS_NAME_INTERNAL(class_name) \ - (const METADATA_CLASS_NAME_INTERNAL(class_name) &) = delete; \ - METADATA_CLASS_NAME_INTERNAL(class_name) & operator=( \ - const METADATA_CLASS_NAME_INTERNAL(class_name) &) = delete; \ - \ - private: \ - friend class class_name; \ - virtual void BuildMetaData(); \ - static views::metadata::ClassMetaData* meta_data_ ALLOW_UNUSED_TYPE; \ +#define METADATA_CLASS_INTERNAL(class_name, file, line) \ + class METADATA_CLASS_NAME_INTERNAL(class_name) \ + : public ui::metadata::ClassMetaData { \ + public: \ + using TheClass = class_name; \ + explicit METADATA_CLASS_NAME_INTERNAL(class_name)() \ + : ClassMetaData(file, line) { \ + BuildMetaData(); \ + } \ + METADATA_CLASS_NAME_INTERNAL(class_name) \ + (const METADATA_CLASS_NAME_INTERNAL(class_name) &) = delete; \ + METADATA_CLASS_NAME_INTERNAL(class_name) & operator=( \ + const METADATA_CLASS_NAME_INTERNAL(class_name) &) = delete; \ + \ + private: \ + friend class class_name; \ + virtual void BuildMetaData(); \ + static ui::metadata::ClassMetaData* meta_data_ ALLOW_UNUSED_TYPE; \ } #define METADATA_PROPERTY_TYPE_INTERNAL(property_type, property_name, ...) \ - views::metadata::ObjectPropertyMetaData< \ - ViewClass, property_type, decltype(&ViewClass::Set##property_name), \ - &ViewClass::Set##property_name, \ - decltype(std::declval<ViewClass>().Get##property_name()), \ - &ViewClass::Get##property_name, ##__VA_ARGS__> + ui::metadata::ObjectPropertyMetaData< \ + TheClass, property_type, decltype(&TheClass::Set##property_name), \ + &TheClass::Set##property_name, \ + decltype(std::declval<TheClass>().Get##property_name()), \ + &TheClass::Get##property_name, ##__VA_ARGS__> #define METADATA_READONLY_PROPERTY_TYPE_INTERNAL(property_type, property_name, \ ...) \ - views::metadata::ObjectPropertyReadOnlyMetaData< \ - ViewClass, property_type, \ - decltype(std::declval<ViewClass>().Get##property_name()), \ - &ViewClass::Get##property_name, ##__VA_ARGS__> + ui::metadata::ObjectPropertyReadOnlyMetaData< \ + TheClass, property_type, \ + decltype(std::declval<TheClass>().Get##property_name()), \ + &TheClass::Get##property_name, ##__VA_ARGS__> #define METADATA_CLASS_PROPERTY_TYPE_INTERNAL(property_type, property_key, \ ...) \ - views::metadata::ClassPropertyMetaData<decltype(property_key), \ - property_type, ##__VA_ARGS__> + ui::metadata::ClassPropertyMetaData<TheClass, decltype(property_key), \ + property_type, ##__VA_ARGS__> #define BEGIN_METADATA_INTERNAL(qualified_class_name, metadata_class_name, \ parent_class_name) \ - views::metadata::ClassMetaData* \ + ui::metadata::ClassMetaData* \ qualified_class_name::metadata_class_name::meta_data_ = nullptr; \ \ - views::metadata::ClassMetaData* qualified_class_name::MetaData() { \ + ui::metadata::ClassMetaData* qualified_class_name::MetaData() { \ static_assert( \ std::is_base_of<parent_class_name, qualified_class_name>::value, \ "class not child of parent"); \ if (!qualified_class_name::metadata_class_name::meta_data_) { \ qualified_class_name::metadata_class_name::meta_data_ = \ - views::metadata::MakeAndRegisterClassInfo< \ + ui::metadata::MakeAndRegisterClassInfo< \ qualified_class_name::metadata_class_name>(); \ } \ return qualified_class_name::metadata_class_name::meta_data_; \ } \ \ - views::metadata::ClassMetaData* qualified_class_name::GetClassMetaData() { \ + ui::metadata::ClassMetaData* qualified_class_name::GetClassMetaData() { \ return MetaData(); \ } \ \ @@ -102,4 +103,4 @@ #define METADATA_PARENT_CLASS_INTERNAL(parent_class_name) \ SetParentClassMetaData(parent_class_name::MetaData()); -#endif // UI_VIEWS_METADATA_METADATA_MACROS_INTERNAL_H_ +#endif // UI_BASE_METADATA_METADATA_MACROS_INTERNAL_H_
diff --git a/ui/views/metadata/metadata_types.cc b/ui/base/metadata/metadata_types.cc similarity index 77% rename from ui/views/metadata/metadata_types.cc rename to ui/base/metadata/metadata_types.cc index 591b1bbd..39862c35 100644 --- a/ui/views/metadata/metadata_types.cc +++ b/ui/base/metadata/metadata_types.cc
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/views/metadata/metadata_types.h" +#include "ui/base/metadata/metadata_types.h" #include <utility> #include "base/check_op.h" #include "base/notreached.h" #include "base/strings/string_util.h" -#include "ui/views/metadata/type_conversion.h" +#include "ui/base/metadata/base_type_conversion.h" -namespace views { +namespace ui { namespace metadata { PropertyFlags operator|(PropertyFlags op1, PropertyFlags op2) { @@ -33,6 +33,33 @@ return !static_cast<bool>(op); } +MetaDataProvider::MetaDataProvider() = default; + +MetaDataProvider::~MetaDataProvider() = default; + +base::CallbackListSubscription MetaDataProvider::AddPropertyChangedCallback( + PropertyKey property, + PropertyChangedCallback callback) { + auto entry = property_changed_vectors_.find(property); + if (entry == property_changed_vectors_.end()) { + entry = property_changed_vectors_ + .emplace(property, std::make_unique<PropertyChangedCallbacks>()) + .first; + } + PropertyChangedCallbacks* property_changed_callbacks = entry->second.get(); + + return property_changed_callbacks->Add(std::move(callback)); +} + +void MetaDataProvider::TriggerChangedCallback(PropertyKey property) { + auto entry = property_changed_vectors_.find(property); + if (entry == property_changed_vectors_.end()) + return; + + PropertyChangedCallbacks* property_changed_callbacks = entry->second.get(); + property_changed_callbacks->Notify(); +} + ClassMetaData::ClassMetaData() = default; ClassMetaData::ClassMetaData(std::string file, int line) : line_(line) { @@ -91,14 +118,14 @@ current_collection_ == rhs.current_collection_; } -ClassMetaData::ClassMemberIterator& ClassMetaData::ClassMemberIterator:: -operator++() { +ClassMetaData::ClassMemberIterator& +ClassMetaData::ClassMemberIterator::operator++() { IncrementHelper(); return *this; } -ClassMetaData::ClassMemberIterator ClassMetaData::ClassMemberIterator:: -operator++(int) { +ClassMetaData::ClassMemberIterator +ClassMetaData::ClassMemberIterator::operator++(int) { ClassMetaData::ClassMemberIterator tmp(*this); IncrementHelper(); return tmp; @@ -151,4 +178,4 @@ } } // namespace metadata -} // namespace views +} // namespace ui
diff --git a/ui/views/metadata/metadata_types.h b/ui/base/metadata/metadata_types.h similarity index 78% rename from ui/views/metadata/metadata_types.h rename to ui/base/metadata/metadata_types.h index a566e1f..b28cb57d 100644 --- a/ui/views/metadata/metadata_types.h +++ b/ui/base/metadata/metadata_types.h
@@ -2,20 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_VIEWS_METADATA_METADATA_TYPES_H_ -#define UI_VIEWS_METADATA_METADATA_TYPES_H_ +#ifndef UI_BASE_METADATA_METADATA_TYPES_H_ +#define UI_BASE_METADATA_METADATA_TYPES_H_ +#include <map> #include <memory> #include <string> #include <vector> +#include "base/callback.h" +#include "base/callback_list.h" +#include "base/compiler_specific.h" +#include "base/component_export.h" #include "base/macros.h" -#include "ui/views/views_export.h" -namespace views { - -class View; - +namespace ui { namespace metadata { enum class PropertyFlags : uint32_t { @@ -34,30 +35,51 @@ kSerializable = 0x100, }; -VIEWS_EXPORT extern PropertyFlags operator|(PropertyFlags op1, - PropertyFlags op2); -VIEWS_EXPORT extern PropertyFlags operator&(PropertyFlags op1, - PropertyFlags op2); -VIEWS_EXPORT extern PropertyFlags operator^(PropertyFlags op1, - PropertyFlags op2); -VIEWS_EXPORT extern bool operator!(PropertyFlags op); +COMPONENT_EXPORT(UI_BASE) +extern PropertyFlags operator|(PropertyFlags op1, PropertyFlags op2); +COMPONENT_EXPORT(UI_BASE) +extern PropertyFlags operator&(PropertyFlags op1, PropertyFlags op2); +COMPONENT_EXPORT(UI_BASE) +extern PropertyFlags operator^(PropertyFlags op1, PropertyFlags op2); +COMPONENT_EXPORT(UI_BASE) extern bool operator!(PropertyFlags op); + +// Used to identify the CallbackList<> within the PropertyChangedVectors map. +using PropertyKey = const void*; + +using PropertyChangedCallbacks = base::RepeatingClosureList; +using PropertyChangedCallback = PropertyChangedCallbacks::CallbackType; // Interface for classes that provide ClassMetaData (via macros in // metadata_header_macros.h). GetClassMetaData() is automatically overridden and // implemented in the relevant macros, so a class must merely have // MetaDataProvider somewhere in its ancestry. -class MetaDataProvider { +class COMPONENT_EXPORT(UI_BASE) MetaDataProvider { public: + MetaDataProvider(); + ~MetaDataProvider(); virtual class ClassMetaData* GetClassMetaData() = 0; + + protected: + base::CallbackListSubscription AddPropertyChangedCallback( + PropertyKey property, + PropertyChangedCallback callback) WARN_UNUSED_RESULT; + void TriggerChangedCallback(PropertyKey property); + + private: + using PropertyChangedVectors = + std::map<PropertyKey, std::unique_ptr<PropertyChangedCallbacks>>; + + // Property Changed Callbacks ------------------------------------------------ + PropertyChangedVectors property_changed_vectors_; }; class MemberMetaDataBase; // Represents the 'meta data' that describes a class. Using the appropriate -// macros in ui/views/metadata/metadata_impl_macros.h, a descendant of this +// macros in ui/base/metadata/metadata_impl_macros.h, a descendant of this // class is declared within the scope of the containing class. See information // about using the macros in the comment for the views::View class. -class VIEWS_EXPORT ClassMetaData { +class COMPONENT_EXPORT(UI_BASE) ClassMetaData { public: ClassMetaData(); ClassMetaData(std::string file, int line); @@ -89,7 +111,7 @@ // for(views::MemberMetaDataBase* member : class_meta_data) { // OperateOn(member); // } - class VIEWS_EXPORT ClassMemberIterator + class COMPONENT_EXPORT(UI_BASE) ClassMemberIterator : public std::iterator<std::forward_iterator_tag, MemberMetaDataBase*> { public: ClassMemberIterator(const ClassMemberIterator& other); @@ -143,7 +165,7 @@ // Abstract base class to represent meta data about class members. // Provides basic information (such as the name of the member), and templated // accessors to get/set the value of the member on an object. -class VIEWS_EXPORT MemberMetaDataBase { +class COMPONENT_EXPORT(UI_BASE) MemberMetaDataBase { public: using ValueStrings = std::vector<std::u16string>; MemberMetaDataBase(const std::string& member_name, @@ -186,6 +208,6 @@ }; // class MemberMetaDataBase } // namespace metadata -} // namespace views +} // namespace ui -#endif // UI_VIEWS_METADATA_METADATA_TYPES_H_ +#endif // UI_BASE_METADATA_METADATA_TYPES_H_
diff --git a/ui/views/metadata/metadata_unittest.cc b/ui/base/metadata/metadata_unittest.cc similarity index 60% rename from ui/views/metadata/metadata_unittest.cc rename to ui/base/metadata/metadata_unittest.cc index 511a629..a987df4 100644 --- a/ui/views/metadata/metadata_unittest.cc +++ b/ui/base/metadata/metadata_unittest.cc
@@ -5,17 +5,17 @@ #include <string> #include "base/bind.h" +#include "base/callback_list.h" #include "base/strings/string_number_conversions.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" #include "ui/base/class_property.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_types.h" #include "ui/gfx/geometry/insets.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" -#include "ui/views/metadata/metadata_types.h" -#include "ui/views/view.h" -namespace VM = views::metadata; +namespace UM = ui::metadata; class MetadataTest : public PlatformTest { public: @@ -27,13 +27,13 @@ protected: template <typename T> - VM::MemberMetaDataBase* GetMemberMetaData(T* obj, + UM::MemberMetaDataBase* GetMemberMetaData(T* obj, const std::string& member_name) { - VM::ClassMetaData* meta_data = obj->GetClassMetaData(); + UM::ClassMetaData* meta_data = obj->GetClassMetaData(); if (meta_data == nullptr) return nullptr; - VM::MemberMetaDataBase* member_data = + UM::MemberMetaDataBase* member_data = meta_data->FindMemberData(member_name); return member_data; } @@ -42,24 +42,25 @@ bool float_property_changed_ = false; }; -// Base view in which a simple hierarchy is created for testing metadata +// Base class in which a simple hierarchy is created for testing metadata // iteration across class types. -class MetadataTestBaseView : public views::View { +class MetadataTestBaseClass : public ui::metadata::MetaDataProvider, + public ui::PropertyHandler { public: - MetadataTestBaseView() = default; - ~MetadataTestBaseView() override = default; + MetadataTestBaseClass() = default; + ~MetadataTestBaseClass() override = default; - METADATA_HEADER(MetadataTestBaseView); + METADATA_HEADER_BASE(MetadataTestBaseClass); void SetIntProperty(int new_value) { if (new_value == int_property_) return; int_property_ = new_value; - OnPropertyChanged(&int_property_, views::kPropertyEffectsNone); + TriggerChangedCallback(&int_property_); } int GetIntProperty() const { return int_property_; } base::CallbackListSubscription AddIntPropertyChangedCallback( - views::PropertyChangedCallback callback) WARN_UNUSED_RESULT { + ui::metadata::PropertyChangedCallback callback) WARN_UNUSED_RESULT { return AddPropertyChangedCallback(&int_property_, std::move(callback)); } @@ -67,28 +68,28 @@ int int_property_ = 0; }; -BEGIN_METADATA(MetadataTestBaseView, views::View) +BEGIN_METADATA_BASE(MetadataTestBaseClass) ADD_PROPERTY_METADATA(int, IntProperty) END_METADATA -// Descendent view in the simple hierarchy. The inherited properties are visible -// within the metadata. -class MetadataTestView : public MetadataTestBaseView { +// Descendent class in the simple hierarchy. The inherited properties are +// visible within the metadata. +class MetadataTestClass : public MetadataTestBaseClass { public: - MetadataTestView() = default; - ~MetadataTestView() override = default; + MetadataTestClass() = default; + ~MetadataTestClass() override = default; - METADATA_HEADER(MetadataTestView); + METADATA_HEADER(MetadataTestClass); void SetFloatProperty(float new_value) { if (float_property_ == new_value) return; float_property_ = new_value; - OnPropertyChanged(&float_property_, views::kPropertyEffectsNone); + TriggerChangedCallback(&float_property_); } float GetFloatProperty() const { return float_property_; } base::CallbackListSubscription AddFloatPropertyChangedCallback( - views::PropertyChangedCallback callback) WARN_UNUSED_RESULT { + ui::metadata::PropertyChangedCallback callback) WARN_UNUSED_RESULT { return AddPropertyChangedCallback(&float_property_, std::move(callback)); } @@ -96,17 +97,17 @@ float float_property_ = 0.f; }; -BEGIN_METADATA(MetadataTestView, MetadataTestBaseView) +BEGIN_METADATA(MetadataTestClass, MetadataTestBaseClass) ADD_PROPERTY_METADATA(float, FloatProperty) END_METADATA // Test view to which class properties are attached. -class ClassPropertyMetaDataTestView : public views::View { +class ClassPropertyMetaDataTestClass : public MetadataTestBaseClass { public: - ClassPropertyMetaDataTestView() = default; - ~ClassPropertyMetaDataTestView() override = default; + ClassPropertyMetaDataTestClass() = default; + ~ClassPropertyMetaDataTestClass() override = default; - METADATA_HEADER(ClassPropertyMetaDataTestView); + METADATA_HEADER(ClassPropertyMetaDataTestClass); }; DEFINE_UI_CLASS_PROPERTY_KEY(int, kIntKey, -1) @@ -114,8 +115,9 @@ DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Insets, kOwnedInsetsKey2, nullptr) DEFINE_UI_CLASS_PROPERTY_KEY(gfx::Insets*, kInsetsKey1, nullptr) DEFINE_UI_CLASS_PROPERTY_KEY(gfx::Insets*, kInsetsKey2, nullptr) +DEFINE_UI_CLASS_PROPERTY_TYPE(gfx::Insets*) -BEGIN_METADATA(ClassPropertyMetaDataTestView, views::View) +BEGIN_METADATA(ClassPropertyMetaDataTestClass, MetadataTestBaseClass) ADD_CLASS_PROPERTY_METADATA(int, kIntKey) ADD_CLASS_PROPERTY_METADATA(gfx::Insets, kOwnedInsetsKey1) ADD_CLASS_PROPERTY_METADATA(gfx::Insets*, kOwnedInsetsKey2) @@ -126,57 +128,57 @@ TEST_F(MetadataTest, TestFloatMetadataPropertyAccess) { const float start_value = 12.34f; - MetadataTestView test_obj; + MetadataTestClass test_obj; test_obj.SetFloatProperty(start_value); - VM::MemberMetaDataBase* member_data = + UM::MemberMetaDataBase* member_data = GetMemberMetaData(&test_obj, "FloatProperty"); ASSERT_TRUE(member_data); std::u16string member_value = member_data->GetValueAsString(&test_obj); - CHECK_EQ(member_value, base::NumberToString16(start_value)); + EXPECT_EQ(member_value, base::NumberToString16(start_value)); } TEST_F(MetadataTest, TestFloatPropertyChangedCallback) { const float start_value = 12.34f; - MetadataTestView test_obj; + MetadataTestClass test_obj; base::CallbackListSubscription callback = test_obj.AddFloatPropertyChangedCallback(base::BindRepeating( &MetadataTest::OnFloatPropertyChanged, base::Unretained(this))); - VM::MemberMetaDataBase* member_data = + UM::MemberMetaDataBase* member_data = GetMemberMetaData(&test_obj, "FloatProperty"); ASSERT_TRUE(member_data); member_data->SetValueAsString(&test_obj, base::NumberToString16(start_value)); - CHECK(float_property_changed()); + EXPECT_TRUE(float_property_changed()); std::u16string member_value = member_data->GetValueAsString(&test_obj); - CHECK_EQ(member_value, base::NumberToString16(start_value)); + EXPECT_EQ(member_value, base::NumberToString16(start_value)); } TEST_F(MetadataTest, TestMetaDataParentClassTracking) { - VM::ClassMetaData* base_class_meta_data = MetadataTestBaseView::MetaData(); - VM::ClassMetaData* derived_class_meta_data = MetadataTestView::MetaData(); + UM::ClassMetaData* base_class_meta_data = MetadataTestBaseClass::MetaData(); + UM::ClassMetaData* derived_class_meta_data = MetadataTestClass::MetaData(); - CHECK_EQ(base_class_meta_data, - derived_class_meta_data->parent_class_meta_data()); + EXPECT_EQ(base_class_meta_data, + derived_class_meta_data->parent_class_meta_data()); } TEST_F(MetadataTest, TestMetaDataFindParentClassMember) { - VM::ClassMetaData* derived_class_meta_data = MetadataTestView::MetaData(); + UM::ClassMetaData* derived_class_meta_data = MetadataTestClass::MetaData(); - VM::MemberMetaDataBase* member_data = + UM::MemberMetaDataBase* member_data = derived_class_meta_data->FindMemberData("IntProperty"); - CHECK_NE(member_data, nullptr); + EXPECT_NE(member_data, nullptr); } TEST_F(MetadataTest, TestMetaDataMemberIterator) { - VM::ClassMetaData* derived_class_meta_data = MetadataTestView::MetaData(); + UM::ClassMetaData* derived_class_meta_data = MetadataTestClass::MetaData(); std::string derived_class_member_name = "IntProperty"; bool found_derived_class_member = false; @@ -184,7 +186,7 @@ std::string base_class_member_name = "IntProperty"; bool found_base_class_member = false; - for (VM::MemberMetaDataBase* member_data : *derived_class_meta_data) { + for (UM::MemberMetaDataBase* member_data : *derived_class_meta_data) { if (member_data->member_name() == derived_class_member_name) found_derived_class_member = true; @@ -192,29 +194,29 @@ found_base_class_member = true; } - CHECK(found_derived_class_member); - CHECK(found_base_class_member); + EXPECT_TRUE(found_derived_class_member); + EXPECT_TRUE(found_base_class_member); } TEST_F(MetadataTest, TestTypeCacheContainsTestClass) { - VM::MetaDataCache* cache = VM::MetaDataCache::GetInstance(); + UM::MetaDataCache* cache = UM::MetaDataCache::GetInstance(); ASSERT_TRUE(cache != nullptr); - VM::ClassMetaData* test_class_meta = MetadataTestView::MetaData(); + UM::ClassMetaData* test_class_meta = MetadataTestClass::MetaData(); const auto& cache_meta = cache->GetCachedTypes(); - CHECK(std::find(cache_meta.begin(), cache_meta.end(), test_class_meta) != - cache_meta.end()); + EXPECT_NE(std::find(cache_meta.begin(), cache_meta.end(), test_class_meta), + cache_meta.end()); } TEST_F(MetadataTest, TestMetaDataFile) { - VM::ClassMetaData* metadata = MetadataTestBaseView::MetaData(); + UM::ClassMetaData* metadata = MetadataTestBaseClass::MetaData(); - CHECK_EQ(metadata->file(), "ui/views/metadata/metadata_unittest.cc"); + EXPECT_EQ(metadata->file(), "ui/base/metadata/metadata_unittest.cc"); } TEST_F(MetadataTest, TestClassPropertyMetaData) { - ClassPropertyMetaDataTestView view; + ClassPropertyMetaDataTestClass test_class; gfx::Insets insets1(8, 8, 8, 8), insets2 = insets1; std::map<std::string, std::u16string> expected_kv = { @@ -225,24 +227,24 @@ {"kInsetsKey2", u"(not assigned)"}}; auto verify = [&]() { - views::metadata::ClassMetaData* metadata = view.GetClassMetaData(); + ui::metadata::ClassMetaData* metadata = test_class.GetClassMetaData(); for (auto member = metadata->begin(); member != metadata->end(); member++) { std::string key = (*member)->member_name(); if (expected_kv.count(key)) { - EXPECT_EQ((*member)->GetValueAsString(&view), expected_kv[key]); + EXPECT_EQ((*member)->GetValueAsString(&test_class), expected_kv[key]); expected_kv.erase(key); } } - EXPECT_EQ(expected_kv.empty(), true); + EXPECT_TRUE(expected_kv.empty()); }; verify(); - view.SetProperty(kIntKey, 1); - view.SetProperty(kOwnedInsetsKey1, insets1); - view.SetProperty(kOwnedInsetsKey2, insets1); - view.SetProperty(kInsetsKey1, &insets1); - view.SetProperty(kInsetsKey2, &insets2); + test_class.SetProperty(kIntKey, 1); + test_class.SetProperty(kOwnedInsetsKey1, insets1); + test_class.SetProperty(kOwnedInsetsKey2, insets1); + test_class.SetProperty(kInsetsKey1, &insets1); + test_class.SetProperty(kInsetsKey2, &insets2); expected_kv = {{"kIntKey", u"1"}, {"kOwnedInsetsKey1", u"8,8,8,8"},
diff --git a/ui/views/metadata/property_metadata.h b/ui/base/metadata/property_metadata.h similarity index 76% rename from ui/views/metadata/property_metadata.h rename to ui/base/metadata/property_metadata.h index 95846b6..54a475d 100644 --- a/ui/views/metadata/property_metadata.h +++ b/ui/base/metadata/property_metadata.h
@@ -2,23 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_VIEWS_METADATA_PROPERTY_METADATA_H_ -#define UI_VIEWS_METADATA_PROPERTY_METADATA_H_ +#ifndef UI_BASE_METADATA_PROPERTY_METADATA_H_ +#define UI_BASE_METADATA_PROPERTY_METADATA_H_ #include <string> #include <type_traits> #include <utility> +#include "base/component_export.h" #include "base/macros.h" #include "ui/base/class_property.h" -#include "ui/views/metadata/metadata_cache.h" -#include "ui/views/metadata/metadata_types.h" -#include "ui/views/metadata/type_conversion.h" -#include "ui/views/view.h" -#include "ui/views/view_utils.h" -#include "ui/views/views_export.h" +#include "ui/base/metadata/base_type_conversion.h" +#include "ui/base/metadata/metadata_cache.h" +#include "ui/base/metadata/metadata_types.h" -namespace views { +namespace ui { namespace metadata { namespace internal { @@ -63,8 +61,8 @@ typename TValue, typename TRet, TRet (TClass::*Get)() const, - typename TConverter = TypeConverter<TValue>> -class ObjectPropertyReadOnlyMetaData : public MemberMetaDataBase { + typename TConverter = ui::metadata::TypeConverter<TValue>> +class ObjectPropertyReadOnlyMetaData : public ui::metadata::MemberMetaDataBase { public: using MemberMetaDataBase::MemberMetaDataBase; ObjectPropertyReadOnlyMetaData(const ObjectPropertyReadOnlyMetaData&) = @@ -79,10 +77,10 @@ return TConverter::ToString((static_cast<TClass*>(obj)->*Get)()); } - PropertyFlags GetPropertyFlags() const override { - return kTypeIsSerializable - ? (PropertyFlags::kReadOnly | PropertyFlags::kSerializable) - : PropertyFlags::kReadOnly; + ui::metadata::PropertyFlags GetPropertyFlags() const override { + return kTypeIsSerializable ? (ui::metadata::PropertyFlags::kReadOnly | + ui::metadata::PropertyFlags::kSerializable) + : ui::metadata::PropertyFlags::kReadOnly; } const char* GetMemberNamePrefix() const override { @@ -105,7 +103,7 @@ TSig Set, typename TRet, TRet (TClass::*Get)() const, - typename TConverter = TypeConverter<TValue>> + typename TConverter = ui::metadata::TypeConverter<TValue>> class ObjectPropertyMetaData : public ObjectPropertyReadOnlyMetaData<TClass, TValue, @@ -127,18 +125,19 @@ } } - MemberMetaDataBase::ValueStrings GetValidValues() const override { + ui::metadata::MemberMetaDataBase::ValueStrings GetValidValues() + const override { if (!kTypeIsSerializable) return {}; return TConverter::GetValidStrings(); } - PropertyFlags GetPropertyFlags() const override { - PropertyFlags flags = PropertyFlags::kEmpty; + ui::metadata::PropertyFlags GetPropertyFlags() const override { + ui::metadata::PropertyFlags flags = ui::metadata::PropertyFlags::kEmpty; if (kTypeIsSerializable) - flags = flags | PropertyFlags::kSerializable; + flags = flags | ui::metadata::PropertyFlags::kSerializable; if (kTypeIsReadOnly) - flags = flags | PropertyFlags::kReadOnly; + flags = flags | ui::metadata::PropertyFlags::kReadOnly; return flags; } @@ -150,10 +149,11 @@ // Represents metadata for a ui::ClassProperty attached on a class instance. // Converts property value to |TValue| when possible. This allows inspecting // the actual value when the property is a pointer of type |TValue*|. -template <typename TKey, +template <typename TClass, + typename TKey, typename TValue, - typename TConverter = TypeConverter<TValue>> -class ClassPropertyMetaData : public MemberMetaDataBase { + typename TConverter = ui::metadata::TypeConverter<TValue>> +class ClassPropertyMetaData : public ui::metadata::MemberMetaDataBase { public: using TypeHelper = internal::ClassPropertyMetaDataTypeHelper<TKey, TValue>; ClassPropertyMetaData(TKey key, const std::string& property_type) @@ -166,12 +166,8 @@ // If the property value is an pointer of type |TKValue*| and // |TKValue| == |TValue|, dereferences the pointer. std::u16string GetValueAsString(void* obj) const override { - // This cast (here and below) is needed since the direct cast to - // ui::PropertyHandler* won't work due to the MI nature of View. - DCHECK(views::IsViewClass<View>(static_cast<View*>(obj))); typename TypeHelper::TKValue value = - static_cast<ui::PropertyHandler*>(static_cast<View*>(obj)) - ->GetProperty(key_); + static_cast<TClass*>(obj)->GetProperty(key_); if (std::is_pointer<typename TypeHelper::TKValue>::value && !value) { return u"(not assigned)"; } else { @@ -184,19 +180,16 @@ void SetValueAsString(void* obj, const std::u16string& new_value) override { base::Optional<TValue> value = TConverter::FromString(new_value); - if (value) { - DCHECK(views::IsViewClass<View>(static_cast<View*>(obj))); - static_cast<ui::PropertyHandler*>(static_cast<View*>(obj)) - ->SetProperty(key_, *value); - } + if (value) + static_cast<TClass*>(obj)->SetProperty(key_, *value); } - PropertyFlags GetPropertyFlags() const override { - PropertyFlags flags = PropertyFlags::kEmpty; + ui::metadata::PropertyFlags GetPropertyFlags() const override { + ui::metadata::PropertyFlags flags = ui::metadata::PropertyFlags::kEmpty; if (kTypeIsSerializable) - flags = flags | PropertyFlags::kSerializable; + flags = flags | ui::metadata::PropertyFlags::kSerializable; if (kTypeIsReadOnly) - flags = flags | PropertyFlags::kReadOnly; + flags = flags | ui::metadata::PropertyFlags::kReadOnly; return flags; } @@ -208,6 +201,6 @@ }; } // namespace metadata -} // namespace views +} // namespace ui -#endif // UI_VIEWS_METADATA_PROPERTY_METADATA_H_ +#endif // UI_BASE_METADATA_PROPERTY_METADATA_H_
diff --git a/ui/chromeos/events/event_rewriter_chromeos.cc b/ui/chromeos/events/event_rewriter_chromeos.cc index 8bd1f00..9591eff0 100644 --- a/ui/chromeos/events/event_rewriter_chromeos.cc +++ b/ui/chromeos/events/event_rewriter_chromeos.cc
@@ -1486,23 +1486,6 @@ CHECK(key_event.type() == ET_KEY_PRESSED || key_event.type() == ET_KEY_RELEASED); - // Some action key codes are mapped to standard VKEY and DomCode values - // during event to KeyEvent translation. However, in Chrome, different VKEY - // combinations trigger those actions. This table maps event VKEYs to the - // right action VKEYs. - // TODO(dtor): Either add proper accelerators for VKEY_ZOOM or move - // from VKEY_MEDIA_LAUNCH_APP2 to VKEY_ZOOM. - static const KeyboardRemapping kActionToActionKeys[] = { - // Zoom toggle is actually through VKEY_MEDIA_LAUNCH_APP2. - {{EF_NONE, VKEY_ZOOM}, - {EF_NONE, DomCode::ZOOM_TOGGLE, DomKey::ZOOM_TOGGLE, - VKEY_MEDIA_LAUNCH_APP2}}, - }; - - // Map certain action keys to the right VKey and modifier. - RewriteWithKeyboardRemappings(kActionToActionKeys, - base::size(kActionToActionKeys), *state, state); - // Some key codes have a Dom code but no VKEY value assigned. They're mapped // to VKEY values here. if (state->key_code == VKEY_UNKNOWN) { @@ -1511,9 +1494,9 @@ state->key_code = VKEY_MEDIA_LAUNCH_APP1; state->key = DomKey::F4; } else if (state->code == DomCode::DISPLAY_TOGGLE_INT_EXT) { - // Display toggle is through control + VKEY_MEDIA_LAUNCH_APP2. + // Display toggle is through control + VKEY_ZOOM. state->flags |= EF_CONTROL_DOWN; - state->key_code = VKEY_MEDIA_LAUNCH_APP2; + state->key_code = VKEY_ZOOM; state->key = DomKey::F12; } } @@ -1557,8 +1540,7 @@ {EF_NONE, DomCode::BROWSER_REFRESH, DomKey::BROWSER_REFRESH, VKEY_BROWSER_REFRESH}}, {{EF_NONE, VKEY_F4}, - {EF_NONE, DomCode::ZOOM_TOGGLE, DomKey::ZOOM_TOGGLE, - VKEY_MEDIA_LAUNCH_APP2}}, + {EF_NONE, DomCode::ZOOM_TOGGLE, DomKey::ZOOM_TOGGLE, VKEY_ZOOM}}, {{EF_NONE, VKEY_F5}, {EF_NONE, DomCode::SELECT_TASK, DomKey::LAUNCH_MY_COMPUTER, VKEY_MEDIA_LAUNCH_APP1}}, @@ -1587,8 +1569,7 @@ {EF_NONE, DomCode::BROWSER_REFRESH, DomKey::BROWSER_REFRESH, VKEY_BROWSER_REFRESH}}, {{EF_NONE, VKEY_F3}, - {EF_NONE, DomCode::ZOOM_TOGGLE, DomKey::ZOOM_TOGGLE, - VKEY_MEDIA_LAUNCH_APP2}}, + {EF_NONE, DomCode::ZOOM_TOGGLE, DomKey::ZOOM_TOGGLE, VKEY_ZOOM}}, {{EF_NONE, VKEY_F4}, {EF_NONE, DomCode::SELECT_TASK, DomKey::LAUNCH_MY_COMPUTER, VKEY_MEDIA_LAUNCH_APP1}}, @@ -1984,10 +1965,9 @@ {{EF_NONE, VKEY_F2}, {EF_NONE, DomCode::BROWSER_REFRESH, DomKey::BROWSER_REFRESH, VKEY_BROWSER_REFRESH}}, - // Map F3 to VKEY_MEDIA_LAUNCH_APP2 + EF_NONE == toggle full screen: + // Map F3 to VKEY_ZOOM + EF_NONE == toggle full screen: {{EF_NONE, VKEY_F3}, - {EF_NONE, DomCode::ZOOM_TOGGLE, DomKey::ZOOM_TOGGLE, - VKEY_MEDIA_LAUNCH_APP2}}, + {EF_NONE, DomCode::ZOOM_TOGGLE, DomKey::ZOOM_TOGGLE, VKEY_ZOOM}}, // Map F4 to VKEY_MEDIA_LAUNCH_APP1 + EF_NONE == overview: {{EF_NONE, VKEY_F4}, {EF_NONE, DomCode::F4, DomKey::F4, VKEY_MEDIA_LAUNCH_APP1}}, @@ -2010,9 +1990,9 @@ {{EF_NONE, VKEY_F10}, {EF_NONE, DomCode::F10, DomKey::F10, VKEY_F10}}, {{EF_NONE, VKEY_F11}, {EF_NONE, DomCode::F11, DomKey::F11, VKEY_F11}}, {{EF_NONE, VKEY_F12}, - // Map F12 to VKEY_MEDIA_LAUNCH_APP2 + EF_CONTROL_DOWN == toggle mirror + // Map F12 to VKEY_ZOOM + EF_CONTROL_DOWN == toggle mirror // mode: - {EF_CONTROL_DOWN, DomCode::F12, DomKey::F12, VKEY_MEDIA_LAUNCH_APP2}}, + {EF_CONTROL_DOWN, DomCode::F12, DomKey::F12, VKEY_ZOOM}}, }; // When the kernel issues an action key (default mode) and the search key is @@ -2036,12 +2016,11 @@ {EF_NONE, DomCode::F8, DomKey::F8, VKEY_F8}}, {{EF_NONE, VKEY_VOLUME_UP}, {EF_NONE, DomCode::F9, DomKey::F9, VKEY_F9}}, // Do not change the order of the next two entries. The remapping of - // VKEY_MEDIA_LAUNCH_APP2 with Control held down must appear before - // VKEY_MEDIA_LAUNCH_APP2 by itself to be considered. - {{EF_CONTROL_DOWN, VKEY_MEDIA_LAUNCH_APP2}, + // VKEY_ZOOM with Control held down must appear before + // VKEY_ZOOM by itself to be considered. + {{EF_CONTROL_DOWN, VKEY_ZOOM}, {EF_NONE, DomCode::F12, DomKey::F12, VKEY_F12}}, - {{EF_NONE, VKEY_MEDIA_LAUNCH_APP2}, - {EF_NONE, DomCode::F3, DomKey::F3, VKEY_F3}}, + {{EF_NONE, VKEY_ZOOM}, {EF_NONE, DomCode::F3, DomKey::F3, VKEY_F3}}, // VKEY_PRIVACY_SCREEN_TOGGLE shares a key with F12 on Drallion. {{EF_NONE, VKEY_PRIVACY_SCREEN_TOGGLE}, {EF_NONE, DomCode::F12, DomKey::F12, VKEY_F12}}, @@ -2077,8 +2056,7 @@ if (search_is_pressed != ForceTopRowAsFunctionKeys()) { // On Drallion, mirror mode toggle is on its own key so don't remap it. if (layout == kKbdTopRowLayoutDrallion && - MatchKeyboardRemapping(*state, - {EF_CONTROL_DOWN, VKEY_MEDIA_LAUNCH_APP2})) { + MatchKeyboardRemapping(*state, {EF_CONTROL_DOWN, VKEY_ZOOM})) { // Clear command flag before returning state->flags = (state->flags & ~EF_COMMAND_DOWN); return true;
diff --git a/ui/events/blink/web_input_event_builders_win.cc b/ui/events/blink/web_input_event_builders_win.cc index 619602f..155402f 100644 --- a/ui/events/blink/web_input_event_builders_win.cc +++ b/ui/events/blink/web_input_event_builders_win.cc
@@ -4,6 +4,8 @@ #include "ui/events/blink/web_input_event_builders_win.h" +#include "base/metrics/histogram_functions.h" +#include "base/trace_event/trace_event.h" #include "base/win/windowsx_shim.h" #include "ui/base/ui_base_features.h" #include "ui/display/win/screen_win.h" @@ -289,10 +291,18 @@ if (horizontal_scroll) { unsigned long scroll_chars = kDefaultScrollCharsPerWheelDelta; SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &scroll_chars, 0); + TRACE_EVENT1("input", "WebMouseWheelEventBuilder::Build", "scroll_chars", + scroll_chars); + base::UmaHistogramCounts10M("InputMethod.MouseWheel.ScrollCharacters", + base::saturated_cast<int>(scroll_chars)); scroll_delta *= static_cast<float>(scroll_chars); } else { unsigned long scroll_lines = kDefaultScrollLinesPerWheelDelta; SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scroll_lines, 0); + TRACE_EVENT1("input", "WebMouseWheelEventBuilder::Build", "scroll_lines", + scroll_lines); + base::UmaHistogramCounts10M("InputMethod.MouseWheel.ScrollLines", + base::saturated_cast<int>(scroll_lines)); if (scroll_lines == WHEEL_PAGESCROLL) result.delta_units = ui::ScrollGranularity::kScrollByPage; else
diff --git a/ui/events/blink/web_input_event_builders_win_unittest.cc b/ui/events/blink/web_input_event_builders_win_unittest.cc index b1002c1..97feeb3 100644 --- a/ui/events/blink/web_input_event_builders_win_unittest.cc +++ b/ui/events/blink/web_input_event_builders_win_unittest.cc
@@ -4,6 +4,7 @@ #include "ui/events/blink/web_input_event_builders_win.h" #include "base/command_line.h" +#include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "base/time/time.h" #include "base/win/windows_version.h" @@ -88,4 +89,54 @@ EXPECT_FLOAT_EQ(0.f, mouse_wheel.wheel_ticks_y); } +void VerifyWebMouseWheelEventBuilderHistograms( + UINT message, + blink::WebPointerProperties::PointerType type, + const char* histogram, + std::vector<int>& event_timestamps_in_ms, + std::map<int, int>& histogram_expectations) { + base::HistogramTester histogram_tester; + + EXPECT_TRUE(event_timestamps_in_ms.size() > 0 && + histogram_expectations.size() > 0); + for (int event_timestamp : event_timestamps_in_ms) { + WebMouseWheelEventBuilder::Build( + ::GetDesktopWindow(), message, MAKEWPARAM(0, -WHEEL_DELTA), + MAKELPARAM(0, 0), + base::TimeTicks() + base::TimeDelta::FromMilliseconds(event_timestamp), + type); + } + + for (std::map<int, int>::iterator it = histogram_expectations.begin(); + it != histogram_expectations.end(); ++it) { + // Key is the (unique) velocity bucket. + // Value is the count of data points for that bucket. + EXPECT_EQ(histogram_tester.GetBucketCount(histogram, it->first), + it->second); + } +} + +TEST(WebInputEventBuilderTest, TestMouseWheelScrollHistograms) { + // Tests mouse wheel horizontal scrolling logging. + unsigned long scroll_chars = 1; + SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &scroll_chars, 0); + std::vector<int> event_timestamps = {300, 600, 900, 1200}; + std::map<int, int> histogram_expectations = { + {scroll_chars - 1, 0}, {scroll_chars, 4}, {scroll_chars + 1, 0}}; + VerifyWebMouseWheelEventBuilderHistograms( + WM_HSCROLL, blink::WebPointerProperties::PointerType::kTouch, + "InputMethod.MouseWheel.ScrollCharacters", event_timestamps, + histogram_expectations); + // Tests mouse wheel vertical scrolling logging. + unsigned long scroll_lines = 1; + SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scroll_lines, 0); + histogram_expectations.clear(); + histogram_expectations = { + {scroll_lines - 1, 0}, {scroll_lines, 4}, {scroll_lines + 1, 0}}; + VerifyWebMouseWheelEventBuilderHistograms( + WM_VSCROLL, blink::WebPointerProperties::PointerType::kTouch, + "InputMethod.MouseWheel.ScrollLines", event_timestamps, + histogram_expectations); +} + } // namespace ui
diff --git a/ui/events/event.cc b/ui/events/event.cc index 5ab3109..ff0f77a 100644 --- a/ui/events/event.cc +++ b/ui/events/event.cc
@@ -759,13 +759,19 @@ const gfx::Transform& inverted_local_transform) { LocatedEvent::UpdateForRootTransform(inverted_root_transform, inverted_local_transform); - gfx::DecomposedTransform decomp; - bool success = gfx::DecomposeTransform(&decomp, inverted_root_transform); - DCHECK(success); - if (decomp.scale[0]) - pointer_details_.radius_x *= decomp.scale[0]; - if (decomp.scale[1]) - pointer_details_.radius_y *= decomp.scale[1]; + + // We could create a vector and then rely on Transform::TransformVector , but + // that ends up creating a 4 dimensional vector and applying a 4 dim + // transform. Really what we're looking at is only in the (x,y) plane, and + // given that we can run this relatively frequently we will inline execute the + // matrix here. + const auto& matrix = inverted_root_transform.matrix(); + const double new_x = fabs(pointer_details_.radius_x * matrix.get(0, 0) + + pointer_details_.radius_y * matrix.get(0, 1)); + const double new_y = fabs(pointer_details_.radius_x * matrix.get(1, 0) + + pointer_details_.radius_y * matrix.get(1, 1)); + pointer_details_.radius_x = new_x; + pointer_details_.radius_y = new_y; } void TouchEvent::DisableSynchronousHandling() {
diff --git a/ui/events/event_unittest.cc b/ui/events/event_unittest.cc index 0aede5b9..e081b9ba43 100644 --- a/ui/events/event_unittest.cc +++ b/ui/events/event_unittest.cc
@@ -671,6 +671,8 @@ gfx::Transform identity_transform; const gfx::Point location(10, 10); const gfx::Point root_location(20, 20); + const gfx::PointF f_location(10, 10); + const gfx::PointF f_root_location(20, 20); // A mouse event that is untargeted should reset the root location when // transformed. Though the events start out with different locations and @@ -683,6 +685,67 @@ ui::test::TestEventTarget target; + // A touch event should behave the same way as others. + { + PointerDetails pointer_details(EventPointerType::kTouch, 0 /* pointer id */, + 3, 4, 50, 0 /* twist */, 0, 0); + ui::TouchEvent targeted(ET_TOUCH_PRESSED, f_location, f_root_location, + EventTimeForNow(), pointer_details); + targeted.UpdateForRootTransform(identity_transform, identity_transform); + EXPECT_EQ(location, targeted.location()); + EXPECT_EQ(location, targeted.root_location()); + EXPECT_EQ(pointer_details, targeted.pointer_details()); + } + + // A touch event should scale the same way as others. + { + // Targeted event with 2x and 3x scales. + gfx::Transform transform2x; + transform2x.Scale(2, 2); + gfx::Transform transform3x; + transform3x.Scale(3, 3); + PointerDetails pointer_details(EventPointerType::kTouch, 0 /* pointer id */, + 3, 4, 50, 0 /* twist */, 0, 0); + ui::TouchEvent targeted(ET_TOUCH_PRESSED, f_location, f_root_location, + EventTimeForNow(), pointer_details); + targeted.UpdateForRootTransform(transform2x, transform3x); + auto updated_location = ScalePoint(f_location, 2.0f); + EXPECT_EQ(updated_location, targeted.location_f()); + EXPECT_EQ(updated_location, targeted.root_location_f()); + auto updated_pointer_details(pointer_details); + updated_pointer_details.radius_x *= 2; + updated_pointer_details.radius_y *= 2; + EXPECT_EQ(updated_pointer_details, targeted.pointer_details()) + << " orig: " << pointer_details.ToString() << " vs " + << targeted.pointer_details().ToString(); + } + + // A touch event should rotate appropriately. + { + // Rotate by 90 degrees, then scale by a half or 0.75 (depending on axis), + // and then offset by 720/1080. Note that the offset should have no impact + // on vectors, i.e. radius. + // The scale happens after rotation, so x should be 0.75 * the y. + gfx::Transform rotate90; + rotate90.Rotate(90.0f); + rotate90.Translate(gfx::Vector2dF(720.0f, 1080.0f)); + rotate90.Scale(0.5, 0.75); + gfx::Transform transform3x; + transform3x.Scale(3, 3); + PointerDetails pointer_details(EventPointerType::kTouch, 0 /* pointer id */, + 3, 4, 50, 0 /* twist */, 0, 0); + ui::TouchEvent targeted(ET_TOUCH_PRESSED, f_location, f_root_location, + EventTimeForNow(), pointer_details); + Event::DispatcherApi(&targeted).set_target(&target); + targeted.UpdateForRootTransform(rotate90, transform3x); + auto updated_pointer_details(pointer_details); + updated_pointer_details.radius_x = pointer_details.radius_y * 0.75; + updated_pointer_details.radius_y = pointer_details.radius_x * 0.5; + EXPECT_EQ(updated_pointer_details, targeted.pointer_details()) + << " orig: " << updated_pointer_details.ToString() << " vs " + << targeted.pointer_details().ToString(); + } + // A mouse event that is targeted should not set the root location to the // local location. They start with different locations and should stay // unequal after a transform is applied.
diff --git a/ui/events/keycodes/keyboard_code_conversion_x.cc b/ui/events/keycodes/keyboard_code_conversion_x.cc index b38af7a..4bd961d 100644 --- a/ui/events/keycodes/keyboard_code_conversion_x.cc +++ b/ui/events/keycodes/keyboard_code_conversion_x.cc
@@ -1177,7 +1177,12 @@ case 0xB5: // KEY_REFRESH return VKEY_BROWSER_REFRESH; case 0xD4: // KEY_DASHBOARD - return VKEY_MEDIA_LAUNCH_APP2; + // This was changed from VKEY_MEDIA_LAUNCH_APP2 when the full screen + // key was moved to VKEY_ZOOM with crbug.com/1204710. In order to + // maintain existing behavior this was kept consistent but it + // seems like this should have been VKEY_MEDIA_LAUNCH_APP1 aka + // overview in the first place. + return VKEY_ZOOM; case 0xE8: // KEY_BRIGHTNESSDOWN return VKEY_BRIGHTNESS_DOWN; case 0xE9: // KEY_BRIGHTNESSUP
diff --git a/ui/events/pointer_details.cc b/ui/events/pointer_details.cc index b83926f7..3d51033 100644 --- a/ui/events/pointer_details.cc +++ b/ui/events/pointer_details.cc
@@ -5,6 +5,7 @@ #include "ui/events/pointer_details.h" #include <cmath> +#include <sstream> namespace ui { @@ -55,4 +56,13 @@ twist == other.twist && id == other.id && offset == other.offset; } +std::string PointerDetails::ToString() const { + std::ostringstream ss; + + ss << "radius x/y: " << radius_x << "/" << radius_y << std::endl; + ss << "force/twist: " << force << "/" << twist << std::endl; + ss << "tilt x/y: " << tilt_x << "/" << tilt_y << std::endl; + return ss.str(); +} + } // namespace ui
diff --git a/ui/events/pointer_details.h b/ui/events/pointer_details.h index d03db11..131dfaa 100644 --- a/ui/events/pointer_details.h +++ b/ui/events/pointer_details.h
@@ -44,6 +44,8 @@ bool operator==(const PointerDetails& other) const; + std::string ToString() const; + // The type of pointer device. EventPointerType pointer_type = EventPointerType::kUnknown;
diff --git a/ui/gl/DEPS b/ui/gl/DEPS index a135d3b..ca1a801 100644 --- a/ui/gl/DEPS +++ b/ui/gl/DEPS
@@ -1,6 +1,5 @@ include_rules = [ "+cc/base", - "+components/viz/common/resources/resource_format.h", "+mojo/public/cpp/bindings", "+third_party/khronos", "+third_party/libsync",
diff --git a/ui/gl/direct_composition_surface_win_unittest.cc b/ui/gl/direct_composition_surface_win_unittest.cc index 7502a02..63fc30a 100644 --- a/ui/gl/direct_composition_surface_win_unittest.cc +++ b/ui/gl/direct_composition_surface_win_unittest.cc
@@ -1213,9 +1213,8 @@ ASSERT_TRUE(front_buffer_texture); auto front_buffer_image = base::MakeRefCounted<GLImageD3D>( - swap_chain_size, GL_BGRA_EXT, GL_UNSIGNED_BYTE, - gfx::ColorSpace::CreateSRGB(), front_buffer_texture, - /*array_slice=*/0, /*plane_index=*/0, swap_chain); + swap_chain_size, GL_BGRA_EXT, GL_UNSIGNED_BYTE, front_buffer_texture, + swap_chain); ASSERT_TRUE(front_buffer_image->Initialize()); Microsoft::WRL::ComPtr<ID3D11Texture2D> back_buffer_texture;
diff --git a/ui/gl/gl_image_d3d.cc b/ui/gl/gl_image_d3d.cc index 75fc087c..976ab720 100644 --- a/ui/gl/gl_image_d3d.cc +++ b/ui/gl/gl_image_d3d.cc
@@ -11,30 +11,49 @@ #ifndef EGL_ANGLE_image_d3d11_texture #define EGL_D3D11_TEXTURE_ANGLE 0x3484 #define EGL_TEXTURE_INTERNAL_FORMAT_ANGLE 0x345D -#define EGL_D3D11_TEXTURE_PLANE_ANGLE 0x3492 -#define EGL_D3D11_TEXTURE_ARRAY_SLICE_ANGLE 0x3493 #endif /* EGL_ANGLE_image_d3d11_texture */ namespace gl { +namespace { + +bool ValidGLInternalFormat(unsigned internal_format) { + switch (internal_format) { + case GL_RGB: + case GL_RGBA: + case GL_BGRA_EXT: + return true; + default: + return false; + } +} + +bool ValidGLDataType(unsigned data_type) { + switch (data_type) { + case GL_UNSIGNED_BYTE: + case GL_HALF_FLOAT_OES: + return true; + default: + return false; + } +} + +} // namespace + GLImageD3D::GLImageD3D(const gfx::Size& size, unsigned internal_format, unsigned data_type, - const gfx::ColorSpace& color_space, Microsoft::WRL::ComPtr<ID3D11Texture2D> texture, - size_t array_slice, - size_t plane_index, Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain) : GLImage(), size_(size), internal_format_(internal_format), data_type_(data_type), texture_(std::move(texture)), - array_slice_(array_slice), - plane_index_(plane_index), swap_chain_(std::move(swap_chain)) { - GLImage::SetColorSpace(color_space); DCHECK(texture_); + DCHECK(ValidGLInternalFormat(internal_format_)); + DCHECK(ValidGLDataType(data_type_)); } GLImageD3D::~GLImageD3D() { @@ -50,12 +69,7 @@ bool GLImageD3D::Initialize() { DCHECK_EQ(egl_image_, EGL_NO_IMAGE_KHR); const EGLint attribs[] = {EGL_TEXTURE_INTERNAL_FORMAT_ANGLE, - internal_format_, - EGL_D3D11_TEXTURE_ARRAY_SLICE_ANGLE, - array_slice_, - EGL_D3D11_TEXTURE_PLANE_ANGLE, - plane_index_, - EGL_NONE}; + GetInternalFormat(), EGL_NONE}; egl_image_ = eglCreateImageKHR(GLSurfaceEGL::GetHardwareDisplay(), EGL_NO_CONTEXT, EGL_D3D11_TEXTURE_ANGLE,
diff --git a/ui/gl/gl_image_d3d.h b/ui/gl/gl_image_d3d.h index fa62f42..6c5b2166 100644 --- a/ui/gl/gl_image_d3d.h +++ b/ui/gl/gl_image_d3d.h
@@ -22,19 +22,13 @@ // |internal_format| and |data_type| are passed to ANGLE and used for GL // operations. |internal_format| may be different from the internal format // associated with the DXGI_FORMAT of the texture (e.g. RGB instead of - // BGRA_EXT for DXGI_FORMAT_B8G8R8A8_UNORM). |data_type| should match the data - // type accociated with the DXGI_FORMAT of the texture. |array_slice| is used - // when the |texture| is a D3D11 texture array, and |plane_index| is used for - // specifying the plane to bind to for multi-planar YUV textures. - // See EGL_ANGLE_d3d_texture_client_buffer spec for format restrictions. + // BGRA_EXT for DXGI_FORMAT_B8G8R8A8_UNORM). |data_type| should match the + // data type accociated with the DXGI_FORMAT of the texture. GLImageD3D(const gfx::Size& size, unsigned internal_format, unsigned data_type, - const gfx::ColorSpace& color_space, Microsoft::WRL::ComPtr<ID3D11Texture2D> texture, - size_t array_slice = 0, - size_t plane_index = 0, - Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain = nullptr); + Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain); // Safe downcast. Returns nullptr on failure. static GLImageD3D* FromGLImage(GLImage* image); @@ -68,27 +62,20 @@ const Microsoft::WRL::ComPtr<ID3D11Texture2D>& texture() const { return texture_; } + const Microsoft::WRL::ComPtr<IDXGISwapChain1>& swap_chain() const { return swap_chain_; } - size_t array_slice() const { return array_slice_; } - size_t plane_index() const { return plane_index_; } - - protected: - const gfx::Size size_; - const unsigned internal_format_; // GLenum - const unsigned data_type_; // GLenum - - Microsoft::WRL::ComPtr<ID3D11Texture2D> texture_; - const size_t array_slice_; - const size_t plane_index_; - - Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain_; private: ~GLImageD3D() override; - void* egl_image_ = nullptr; // EGLImageKHR + const gfx::Size size_; + const unsigned internal_format_; // GLenum + const unsigned data_type_; // GLenum + void* egl_image_ = nullptr; // EGLImageKHR + Microsoft::WRL::ComPtr<ID3D11Texture2D> texture_; + Microsoft::WRL::ComPtr<IDXGISwapChain1> swap_chain_; DISALLOW_COPY_AND_ASSIGN(GLImageD3D); };
diff --git a/ui/gl/gl_image_d3d_unittest.cc b/ui/gl/gl_image_d3d_unittest.cc index 4b047f4d..febd42ee 100644 --- a/ui/gl/gl_image_d3d_unittest.cc +++ b/ui/gl/gl_image_d3d_unittest.cc
@@ -52,8 +52,7 @@ EXPECT_TRUE(SUCCEEDED(hr)); auto image = base::MakeRefCounted<GLImageD3D>( - size, internal_format, data_type, gfx::ColorSpace::CreateSRGB(), - std::move(d3d11_texture)); + size, internal_format, data_type, std::move(d3d11_texture), nullptr); EXPECT_TRUE(image->Initialize()); return image; }
diff --git a/ui/gl/gl_implementation.cc b/ui/gl/gl_implementation.cc index 0204c54..5acbd036 100644 --- a/ui/gl/gl_implementation.cc +++ b/ui/gl/gl_implementation.cc
@@ -182,12 +182,7 @@ } GLImplementationParts GetSoftwareGLForTestsImplementation() { -#if defined(OS_WIN) || \ - (defined(OS_LINUX) && !defined(OS_FUCHSIA) && !defined(USE_OZONE)) - return GetSoftwareGLImplementation(); -#else return GetLegacySoftwareGLImplementation(); -#endif } bool IsSoftwareGLImplementation(GLImplementationParts implementation) {
diff --git a/ui/gl/gl_switches.cc b/ui/gl/gl_switches.cc index f95cc05..7341e37 100644 --- a/ui/gl/gl_switches.cc +++ b/ui/gl/gl_switches.cc
@@ -211,7 +211,7 @@ // is large enough and allows DWM to consider the main backbuffer as an // an overlay candidate. const base::Feature kDirectCompositionForceFullDamage{ - "DirectCompositionForceFullDamage", base::FEATURE_DISABLED_BY_DEFAULT}; + "DirectCompositionForceFullDamage", base::FEATURE_ENABLED_BY_DEFAULT}; // Use presentation feedback event queries (must be enabled) to limit latency. const base::Feature kDirectCompositionLowLatencyPresentation{
diff --git a/ui/gl/swap_chain_presenter.cc b/ui/gl/swap_chain_presenter.cc index 4067ff7..5c36e7e9 100644 --- a/ui/gl/swap_chain_presenter.cc +++ b/ui/gl/swap_chain_presenter.cc
@@ -638,28 +638,23 @@ } bool SwapChainPresenter::TryPresentToDecodeSwapChain( - Microsoft::WRL::ComPtr<ID3D11Texture2D> texture, - unsigned array_slice, - const gfx::ColorSpace& color_space, + GLImageDXGI* nv12_image, const gfx::Rect& content_rect, - const gfx::Size& swap_chain_size, - DXGI_FORMAT swap_chain_format) { + const gfx::Size& swap_chain_size) { if (ShouldUseVideoProcessorScaling()) return false; auto not_used_reason = DecodeSwapChainNotUsedReason::kFailedToPresent; bool nv12_supported = - (swap_chain_format == DXGI_FORMAT_NV12) && (DXGI_FORMAT_NV12 == DirectCompositionSurfaceWin::GetOverlayFormatUsedForSDR()); // TODO(sunnyps): Try using decode swap chain for uploaded video images. - if (texture && nv12_supported && !failed_to_present_decode_swapchain_) { + if (nv12_image && nv12_supported && !failed_to_present_decode_swapchain_) { D3D11_TEXTURE2D_DESC texture_desc = {}; - texture->GetDesc(&texture_desc); + nv12_image->texture()->GetDesc(&texture_desc); - bool is_decoder_texture = (texture_desc.Format == DXGI_FORMAT_NV12) && - (texture_desc.BindFlags & D3D11_BIND_DECODER); + bool is_decoder_texture = texture_desc.BindFlags & D3D11_BIND_DECODER; // Decode swap chains do not support shared resources. // TODO(sunnyps): Find a workaround for when the decoder moves to its own @@ -693,10 +688,8 @@ if (is_decoder_texture && !is_shared_texture && !is_unitary_texture_array && is_overlay_supported_transform) { - if (PresentToDecodeSwapChain(texture, array_slice, color_space, - content_rect, swap_chain_size)) { + if (PresentToDecodeSwapChain(nv12_image, content_rect, swap_chain_size)) return true; - } ReleaseSwapChainResources(); failed_to_present_decode_swapchain_ = true; not_used_reason = DecodeSwapChainNotUsedReason::kFailedToPresent; @@ -711,7 +704,7 @@ } else if (!is_overlay_supported_transform) { not_used_reason = DecodeSwapChainNotUsedReason::kIncompatibleTransform; } - } else if (!texture) { + } else if (!nv12_image) { not_used_reason = DecodeSwapChainNotUsedReason::kSoftwareFrame; } else if (!nv12_supported) { not_used_reason = DecodeSwapChainNotUsedReason::kNv12NotSupported; @@ -725,9 +718,7 @@ } bool SwapChainPresenter::PresentToDecodeSwapChain( - Microsoft::WRL::ComPtr<ID3D11Texture2D> texture, - unsigned array_slice, - const gfx::ColorSpace& color_space, + GLImageDXGI* nv12_image, const gfx::Rect& content_rect, const gfx::Size& swap_chain_size) { DCHECK(!swap_chain_size.IsEmpty()); @@ -737,7 +728,7 @@ swap_chain_size.ToString()); Microsoft::WRL::ComPtr<IDXGIResource> decode_resource; - texture.As(&decode_resource); + nv12_image->texture().As(&decode_resource); DCHECK(decode_resource); if (!decode_swap_chain_ || decode_resource_ != decode_resource) { @@ -799,6 +790,10 @@ content_visual_->SetContent(decode_surface_.Get()); layer_tree_->SetNeedsRebuildVisualTree(); + } else if (last_presented_images_[kNV12ImageIndex] == nv12_image && + swap_chain_size_ == swap_chain_size) { + // Early out if we're presenting the same image again. + return true; } RECT source_rect = content_rect.ToRECT(); @@ -809,6 +804,10 @@ RECT target_rect = gfx::Rect(swap_chain_size).ToRECT(); decode_swap_chain_->SetTargetRect(&target_rect); + gfx::ColorSpace color_space = nv12_image->color_space(); + if (!color_space.IsValid()) + color_space = gfx::ColorSpace::CreateREC709(); + // TODO(sunnyps): Move this to gfx::ColorSpaceWin helper where we can access // internal color space state and do a better job. // Common color spaces have primaries and transfer function similar to BT 709 @@ -816,8 +815,7 @@ int color_space_flags = DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_BT709; // Proper Rec 709 and 601 have limited or nominal color range. if (color_space == gfx::ColorSpace::CreateREC709() || - color_space == gfx::ColorSpace::CreateREC601() || - !color_space.IsValid()) { + color_space == gfx::ColorSpace::CreateREC601()) { color_space_flags |= DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_NOMINAL_RANGE; } // xvYCC allows colors outside nominal range to encode negative colors that @@ -829,7 +827,8 @@ static_cast<DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS>(color_space_flags)); UINT present_flags = DXGI_PRESENT_USE_DURATION; - HRESULT hr = decode_swap_chain_->PresentBuffer(array_slice, 1, present_flags); + HRESULT hr = + decode_swap_chain_->PresentBuffer(nv12_image->level(), 1, present_flags); // Ignore DXGI_STATUS_OCCLUDED since that's not an error but only indicates // that the window is occluded and we can stop rendering. if (FAILED(hr) && hr != DXGI_STATUS_OCCLUDED) { @@ -837,6 +836,8 @@ return false; } + last_presented_images_ = ui::DCRendererLayerParams::OverlayImages(); + last_presented_images_[kNV12ImageIndex] = nv12_image; swap_chain_size_ = swap_chain_size; if (swap_chain_format_ == DXGI_FORMAT_NV12) { frames_since_color_space_change_++; @@ -855,20 +856,14 @@ const ui::DCRendererLayerParams& params) { GLImageDXGI* image_dxgi = GLImageDXGI::FromGLImage(params.images[kNV12ImageIndex].get()); - GLImageD3D* image_d3d = - GLImageD3D::FromGLImage(params.images[kNV12ImageIndex].get()); - GLImageMemory* y_image_memory = GLImageMemory::FromGLImage(params.images[kYPlaneImageIndex].get()); GLImageMemory* uv_image_memory = GLImageMemory::FromGLImage(params.images[kUVPlaneImageIndex].get()); - GLImageD3D* swap_chain_image = GLImageD3D::FromGLImage(params.images[kSwapChainImageIndex].get()); - if (swap_chain_image && !swap_chain_image->swap_chain()) - swap_chain_image = nullptr; - if (!image_dxgi && !image_d3d && (!y_image_memory || !uv_image_memory) && + if (!image_dxgi && (!y_image_memory || !uv_image_memory) && !swap_chain_image) { DLOG(ERROR) << "Video GLImages are missing"; ReleaseSwapChainResources(); @@ -878,8 +873,7 @@ return true; } - if ((image_dxgi && !image_dxgi->texture()) || - (image_d3d && !image_d3d->texture())) { + if (image_dxgi && !image_dxgi->texture()) { // We can't proceed if |image_dxgi| has no underlying d3d11 texture. It's // unclear how we get into this state, but we do observe crashes due to it. // Just stop here instead, and render incorrectly. @@ -889,14 +883,11 @@ return true; } - std::string image_type; - if (swap_chain_image) { - image_type = "swap chain"; - } else if (image_d3d || image_dxgi) { + std::string image_type = "software video frame"; + if (image_dxgi) image_type = "hardware video frame"; - } else { - image_type = "software video frame"; - } + if (swap_chain_image) + image_type = "swap chain"; gfx::Transform transform = params.transform; gfx::Rect clip_rect = params.clip_rect.value_or(gfx::Rect()); @@ -913,29 +904,12 @@ TRACE_EVENT2("gpu", "SwapChainPresenter::PresentToSwapChain", "image_type", image_type, "swap_chain_size", swap_chain_size.ToString()); - Microsoft::WRL::ComPtr<ID3D11Texture2D> input_texture; - unsigned input_level = 0u; - Microsoft::WRL::ComPtr<IDXGIKeyedMutex> keyed_mutex; - gfx::ColorSpace input_color_space; - if (image_dxgi) { - input_texture = image_dxgi->texture(); - input_level = image_dxgi->level(); - // Keyed mutex may not exist. - keyed_mutex = image_dxgi->keyed_mutex(); - input_color_space = image_dxgi->color_space(); - } else if (image_d3d) { - input_texture = image_d3d->texture(); - input_level = image_d3d->array_slice(); - input_color_space = image_d3d->color_space(); - } - if (!input_color_space.IsValid()) - input_color_space = gfx::ColorSpace::CreateREC709(); - - bool content_is_hdr = input_color_space.IsHDR(); + bool content_is_hdr = image_dxgi && image_dxgi->color_space().IsHDR(); // Do not create a swap chain if swap chain size will be empty. if (swap_chain_size.IsEmpty()) { swap_chain_size_ = swap_chain_size; if (swap_chain_) { + last_presented_images_ = ui::DCRendererLayerParams::OverlayImages(); ReleaseSwapChainResources(); content_visual_->SetContent(nullptr); layer_tree_->SetNeedsRebuildVisualTree(); @@ -948,16 +922,20 @@ // Swap chain image already has a swap chain that's presented by the client // e.g. for webgl/canvas low-latency/desynchronized mode. if (swap_chain_image) { - DCHECK(swap_chain_image->swap_chain()); content_visual_->SetContent(swap_chain_image->swap_chain().Get()); - if (last_presented_images_ != params.images) { - ReleaseSwapChainResources(); + if (last_presented_images_[kSwapChainImageIndex] != swap_chain_image) { last_presented_images_ = params.images; + ReleaseSwapChainResources(); layer_tree_->SetNeedsRebuildVisualTree(); } return true; } + if (TryPresentToDecodeSwapChain(image_dxgi, params.content_rect, + swap_chain_size)) { + return true; + } + bool swap_chain_resized = swap_chain_size_ != swap_chain_size; DXGI_FORMAT swap_chain_format = @@ -966,21 +944,6 @@ bool toggle_protected_video = protected_video_type_ != params.protected_video_type; - if (swap_chain_ && !swap_chain_resized && !swap_chain_format_changed && - !toggle_protected_video && last_presented_images_ == params.images) { - // The swap chain is presenting the same images as last swap, which means - // that the images were never returned to the video decoder and should - // have the same contents as last time. It shouldn't need to be redrawn. - return true; - } - - if (TryPresentToDecodeSwapChain(input_texture, input_level, input_color_space, - params.content_rect, swap_chain_size, - swap_chain_format)) { - last_presented_images_ = params.images; - return true; - } - // Try reallocating swap chain if resizing fails. if (!swap_chain_ || swap_chain_resized || swap_chain_format_changed || toggle_protected_video) { @@ -991,9 +954,22 @@ } content_visual_->SetContent(swap_chain_.Get()); layer_tree_->SetNeedsRebuildVisualTree(); + } else if (last_presented_images_ == params.images) { + // The swap chain is presenting the same images as last swap, which means + // that the images were never returned to the video decoder and should + // have the same contents as last time. It shouldn't need to be redrawn. + return true; } + last_presented_images_ = params.images; - if (input_texture) { + Microsoft::WRL::ComPtr<ID3D11Texture2D> input_texture; + UINT input_level; + Microsoft::WRL::ComPtr<IDXGIKeyedMutex> keyed_mutex; + if (image_dxgi) { + input_texture = image_dxgi->texture(); + input_level = static_cast<UINT>(image_dxgi->level()); + // Keyed mutex may not exist. + keyed_mutex = image_dxgi->keyed_mutex(); staging_texture_.Reset(); copy_texture_.Reset(); } else { @@ -1084,7 +1060,6 @@ DLOG(ERROR) << "Present failed with error 0x" << std::hex << hr; return false; } - last_presented_images_ = params.images; frames_since_color_space_change_++; RecordPresentationStatistics(); return true; @@ -1314,7 +1289,6 @@ } void SwapChainPresenter::ReleaseSwapChainResources() { - last_presented_images_ = ui::DCRendererLayerParams::OverlayImages(); output_view_.Reset(); swap_chain_.Reset(); decode_surface_.Reset();
diff --git a/ui/gl/swap_chain_presenter.h b/ui/gl/swap_chain_presenter.h index 20858ee..d6b7faf 100644 --- a/ui/gl/swap_chain_presenter.h +++ b/ui/gl/swap_chain_presenter.h
@@ -19,6 +19,7 @@ namespace gl { class DCLayerTree; +class GLImageDXGI; class GLImageMemory; // SwapChainPresenter holds a swap chain, direct composition visuals, and other @@ -160,20 +161,14 @@ // Try presenting to a decode swap chain based on various conditions such as // global state (e.g. finch, NV12 support), texture flags, and transform. // Returns true on success. See PresentToDecodeSwapChain() for more info. - bool TryPresentToDecodeSwapChain( - Microsoft::WRL::ComPtr<ID3D11Texture2D> texture, - unsigned array_slice, - const gfx::ColorSpace& color_space, - const gfx::Rect& content_rect, - const gfx::Size& swap_chain_size, - DXGI_FORMAT swap_chain_format); + bool TryPresentToDecodeSwapChain(GLImageDXGI* nv12_image, + const gfx::Rect& content_rect, + const gfx::Size& swap_chain_size); // Present to a decode swap chain created from compatible video decoder // buffers using given |nv12_image| with destination size |swap_chain_size|. // Returns true on success. - bool PresentToDecodeSwapChain(Microsoft::WRL::ComPtr<ID3D11Texture2D> texture, - unsigned array_slice, - const gfx::ColorSpace& color_space, + bool PresentToDecodeSwapChain(GLImageDXGI* nv12_image, const gfx::Rect& content_rect, const gfx::Size& swap_chain_size);
diff --git a/ui/gtk/gtk_util.cc b/ui/gtk/gtk_util.cc index 4deeabf..efc9d18 100644 --- a/ui/gtk/gtk_util.cc +++ b/ui/gtk/gtk_util.cc
@@ -750,6 +750,7 @@ case ui::kColorNotificationActionsBackground: case ui::kColorNotificationBackgroundActive: case ui::kColorNotificationImageBackground: + case ui::kColorSyncInfoBackground: return GetBgColor("#statusbar"); // FocusableBorder @@ -929,6 +930,7 @@ "GtkTreeView#treeview.view " "GtkTreeView#treeview.view.cell:selected:focus GtkLabel#label"); case ui::kColorButtonBackgroundProminentDisabled: + case ui::kColorButtonBorderDisabled: return GetBgColor("GtkButton#button.text-button:disabled"); case ui::kColorButtonBorder: return GetBorderColor("GtkButton#button.text-button");
diff --git a/ui/message_center/views/message_popup_view.cc b/ui/message_center/views/message_popup_view.cc index 0192307..d963c0f 100644 --- a/ui/message_center/views/message_popup_view.cc +++ b/ui/message_center/views/message_popup_view.cc
@@ -8,6 +8,7 @@ #include "build/chromeos_buildflags.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/display/display.h" #include "ui/display/screen.h" @@ -16,7 +17,6 @@ #include "ui/message_center/views/message_view.h" #include "ui/message_center/views/message_view_factory.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #if defined(OS_WIN)
diff --git a/ui/message_center/views/notification_control_buttons_view.cc b/ui/message_center/views/notification_control_buttons_view.cc index 2844ead..e7d57e4c 100644 --- a/ui/message_center/views/notification_control_buttons_view.cc +++ b/ui/message_center/views/notification_control_buttons_view.cc
@@ -8,6 +8,7 @@ #include "build/chromeos_buildflags.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/events/event.h" #include "ui/gfx/color_palette.h" @@ -20,7 +21,6 @@ #include "ui/strings/grit/ui_strings.h" #include "ui/views/background.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace message_center {
diff --git a/ui/message_center/views/notification_header_view.cc b/ui/message_center/views/notification_header_view.cc index 129ede8..b37ecb5 100644 --- a/ui/message_center/views/notification_header_view.cc +++ b/ui/message_center/views/notification_header_view.cc
@@ -13,6 +13,8 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/font_list.h" #include "ui/gfx/paint_vector_icon.h" @@ -27,8 +29,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/view_class_properties.h"
diff --git a/ui/message_center/views/notification_header_view.h b/ui/message_center/views/notification_header_view.h index 1d16fe5..a78374db 100644 --- a/ui/message_center/views/notification_header_view.h +++ b/ui/message_center/views/notification_header_view.h
@@ -7,11 +7,11 @@ #include "base/optional.h" #include "base/timer/timer.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/text_constants.h" #include "ui/message_center/message_center_export.h" #include "ui/message_center/public/cpp/message_center_constants.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class ImageView;
diff --git a/ui/message_center/views/notification_view_md.cc b/ui/message_center/views/notification_view_md.cc index b4b11174..1c23c05 100644 --- a/ui/message_center/views/notification_view_md.cc +++ b/ui/message_center/views/notification_view_md.cc
@@ -9,6 +9,7 @@ #include <memory> #include <utility> +#include "base/bind.h" #include "base/i18n/case_conversion.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" @@ -16,6 +17,7 @@ #include "ui/base/class_property.h" #include "ui/base/cursor/cursor.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/base_event_utils.h" #include "ui/events/gesture_detection/gesture_provider_config_helper.h" #include "ui/gfx/canvas.h" @@ -55,7 +57,6 @@ #include "ui/views/focus/focus_manager.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/native_cursor.h" #include "ui/views/style/typography.h" #include "ui/views/widget/widget.h" @@ -572,7 +573,12 @@ SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kVertical, gfx::Insets(), 0)); - SetInkDropVisibleOpacity(1); + SetInkDropVisibleOpacity(1.0f); + SetCreateInkDropCallback(base::BindRepeating( + [](InkDropHostView* host) -> std::unique_ptr<views::InkDrop> { + return std::make_unique<NotificationInkDropImpl>(host, host->size()); + }, + this)); AddChildView(ink_drop_container_); @@ -1473,10 +1479,6 @@ AnimateInkDrop(views::InkDropState::HIDDEN, nullptr); } -std::unique_ptr<views::InkDrop> NotificationViewMD::CreateInkDrop() { - return std::make_unique<NotificationInkDropImpl>(this, size()); -} - std::unique_ptr<views::InkDropRipple> NotificationViewMD::CreateInkDropRipple() const { return std::make_unique<views::FloodFillInkDropRipple>(
diff --git a/ui/message_center/views/notification_view_md.h b/ui/message_center/views/notification_view_md.h index bcb07e96..af14dcba 100644 --- a/ui/message_center/views/notification_view_md.h +++ b/ui/message_center/views/notification_view_md.h
@@ -13,12 +13,12 @@ #include "base/macros.h" #include "base/optional.h" #include "base/time/time.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/message_center/message_center_export.h" #include "ui/message_center/views/message_view.h" #include "ui/views/animation/ink_drop_observer.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/controls/textfield/textfield_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace views { class ImageButton; @@ -192,7 +192,6 @@ void OnMouseEvent(ui::MouseEvent* event) override; void OnGestureEvent(ui::GestureEvent* event) override; void PreferredSizeChanged() override; - std::unique_ptr<views::InkDrop> CreateInkDrop() override; std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; SkColor GetInkDropBaseColor() const override; void UpdateWithNotification(const Notification& notification) override;
diff --git a/ui/message_center/views/padded_button.cc b/ui/message_center/views/padded_button.cc index 60560934..661624a9 100644 --- a/ui/message_center/views/padded_button.cc +++ b/ui/message_center/views/padded_button.cc
@@ -7,6 +7,7 @@ #include <memory> #include "build/chromeos_buildflags.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" #include "ui/message_center/public/cpp/message_center_constants.h" @@ -17,7 +18,6 @@ #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace message_center { @@ -29,12 +29,8 @@ SetInkDropMode(InkDropMode::ON); SetInkDropVisibleOpacity(0.12f); SetHasInkDropActionOnClick(true); -} - -std::unique_ptr<views::InkDrop> PaddedButton::CreateInkDrop() { - return views::InkDrop::CreateInkDropForSquareRipple( - this, - /*highlight_on_hover=*/false); + views::InkDrop::UseInkDropForSquareRipple(this, + /*highlight_on_hover=*/false); } void PaddedButton::OnThemeChanged() {
diff --git a/ui/message_center/views/padded_button.h b/ui/message_center/views/padded_button.h index 1732d33..c7ac846 100644 --- a/ui/message_center/views/padded_button.h +++ b/ui/message_center/views/padded_button.h
@@ -5,10 +5,10 @@ #ifndef UI_MESSAGE_CENTER_VIEWS_PADDED_BUTTON_H_ #define UI_MESSAGE_CENTER_VIEWS_PADDED_BUTTON_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/message_center/message_center_export.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/controls/button/image_button.h" -#include "ui/views/metadata/metadata_header_macros.h" namespace message_center { @@ -29,7 +29,6 @@ ~PaddedButton() override = default; // views::ImageButton: - std::unique_ptr<views::InkDrop> CreateInkDrop() override; void OnThemeChanged() override; };
diff --git a/ui/message_center/views/proportional_image_view.cc b/ui/message_center/views/proportional_image_view.cc index df2febe..128a3d1 100644 --- a/ui/message_center/views/proportional_image_view.cc +++ b/ui/message_center/views/proportional_image_view.cc
@@ -4,10 +4,10 @@ #include "ui/message_center/views/proportional_image_view.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/message_center/message_center_style.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace message_center {
diff --git a/ui/ozone/platform/scenic/sysmem_buffer_manager.cc b/ui/ozone/platform/scenic/sysmem_buffer_manager.cc index d971a58..7434a3b 100644 --- a/ui/ozone/platform/scenic/sysmem_buffer_manager.cc +++ b/ui/ozone/platform/scenic/sysmem_buffer_manager.cc
@@ -12,6 +12,17 @@ namespace ui { +namespace { + +std::string GetProcessName() { + char name[ZX_MAX_NAME_LEN] = {}; + zx_status_t status = + zx::process::self()->get_property(ZX_PROP_NAME, name, sizeof(name)); + return (status == ZX_OK) ? std::string(name) : ""; +} + +} // namespace + SysmemBufferManager::SysmemBufferManager( ScenicSurfaceFactory* scenic_surface_factory) : scenic_surface_factory_(scenic_surface_factory) {} @@ -26,6 +37,8 @@ DCHECK(collections_.empty()); DCHECK(!allocator_); allocator_.Bind(std::move(allocator)); + allocator_->SetDebugClientInfo(GetProcessName() + "-SysmemBufferManager", + base::GetCurrentProcId()); } void SysmemBufferManager::Shutdown() {
diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn index 57b600a..05e9087 100644 --- a/ui/ozone/platform/wayland/BUILD.gn +++ b/ui/ozone/platform/wayland/BUILD.gn
@@ -180,6 +180,7 @@ "//mojo/public/cpp/bindings", "//mojo/public/cpp/system", "//skia", + "//third_party/wayland:wayland_util", "//third_party/wayland-protocols:cursor_shapes_protocol", "//third_party/wayland-protocols:extended_drag", "//third_party/wayland-protocols:gtk_primary_selection_protocol",
diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc index 43d19b0a..1fa7600 100644 --- a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc +++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.cc
@@ -46,20 +46,33 @@ return false; const uint32_t fourcc_format = GetFourCCFormatFromBufferFormat(format); - auto gbm_usage = ui::BufferUsageToGbmFlags(usage); - std::vector<uint64_t> modifiers; - if (!(gbm_usage & GBM_BO_USE_LINEAR)) - modifiers = buffer_manager_->GetModifiersForBufferFormat(format); + const uint32_t gbm_flags = ui::BufferUsageToGbmFlags(usage); + auto modifiers = buffer_manager_->GetModifiersForBufferFormat(format); - gbm_bo_ = buffer_manager_->gbm_device()->CreateBufferWithModifiers( - fourcc_format, size, gbm_usage, modifiers); + // Create buffer object without format modifiers unless they are explicitly + // advertised by the Wayland compositor, via linux-dmabuf protocol. + if (modifiers.empty()) { + gbm_bo_ = buffer_manager_->gbm_device()->CreateBuffer(fourcc_format, size, + gbm_flags); + } else { + // When buffer |usage| implies on GBM_BO_USE_LINEAR, pass in + // DRM_FORMAT_MOD_LINEAR, i.e: no tiling, when creating gbm buffers, + // otherwise it fails to create BOs. + if (gbm_flags & GBM_BO_USE_LINEAR) + modifiers = {DRM_FORMAT_MOD_LINEAR}; + gbm_bo_ = buffer_manager_->gbm_device()->CreateBufferWithModifiers( + fourcc_format, size, gbm_flags, modifiers); + } + if (!gbm_bo_) { LOG(ERROR) << "Cannot create bo with format= " - << gfx::BufferFormatToString(format) << " and usage " - << gfx::BufferUsageToString(usage); + << gfx::BufferFormatToString(format) + << " and usage=" << gfx::BufferUsageToString(usage); return false; } + DVLOG(3) << "Created gbm bo. format= " << gfx::BufferFormatToString(format) + << " usage=" << gfx::BufferUsageToString(usage); CreateDmabufBasedBuffer(); return true; } @@ -119,11 +132,21 @@ bool enable_blend, std::vector<gfx::GpuFence> acquire_fences, std::vector<gfx::GpuFence> release_fences) { - // If the widget this pixmap backs has not been assigned before, do it now. - if (widget_ == gfx::kNullAcceleratedWidget) - SetAcceleratedWiget(widget); + DCHECK_NE(widget, gfx::kNullAcceleratedWidget); - DCHECK_EQ(widget_, widget); + // It's possible for a buffer to be attached to a different widget or + // wl_surface if this buffer represents an overlay and is being tab-dragged to + // a different window. Recreate wl_buffer handle if this happens. + // TODO(fangzhoug): Remove this workaround once better buffer management is + // implemented. + z_order_ = z_order_set_ ? z_order_ : plane_z_order; + if (widget_ != widget || z_order_ != plane_z_order) { + buffer_manager_->DestroyBuffer(widget_, buffer_id_); + CreateDmabufBasedBuffer(); + widget_ = widget; + z_order_ = plane_z_order; + } + z_order_set_ = true; auto* surface = buffer_manager_->GetSurface(widget); // This must never be hit.
diff --git a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h index a9b3932b..9ee2aaf 100644 --- a/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h +++ b/ui/ozone/platform/wayland/gpu/gbm_pixmap_wayland.h
@@ -71,6 +71,11 @@ // A unique ID to identify the buffer for this pixmap. const uint32_t buffer_id_; + // Represents the z-axis order of the wayland surface this buffer is attach + // to. + int32_t z_order_ = 0; + bool z_order_set_ = false; + DISALLOW_COPY_AND_ASSIGN(GbmPixmapWayland); };
diff --git a/ui/ozone/platform/wayland/gpu/wayland_surface_factory_unittest.cc b/ui/ozone/platform/wayland/gpu/wayland_surface_factory_unittest.cc index 64331f7..7c24257 100644 --- a/ui/ozone/platform/wayland/gpu/wayland_surface_factory_unittest.cc +++ b/ui/ozone/platform/wayland/gpu/wayland_surface_factory_unittest.cc
@@ -2,14 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <drm_fourcc.h> + +#include <cstdint> #include <memory> #include <utility> +#include <vector> +#include "base/containers/flat_map.h" #include "base/memory/scoped_refptr.h" #include "base/run_loop.h" #include "base/test/mock_callback.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkSurface.h" +#include "ui/gfx/buffer_types.h" #include "ui/gfx/linux/gbm_buffer.h" #include "ui/gfx/linux/gbm_device.h" #include "ui/gfx/linux/test/mock_gbm_device.h" @@ -175,11 +181,18 @@ ~WaylandSurfaceFactoryTest() override = default; void SetUp() override { + const base::flat_map<gfx::BufferFormat, std::vector<uint64_t>> + kSupportedFormatsWithModifiers{ + {gfx::BufferFormat::BGRA_8888, {DRM_FORMAT_MOD_LINEAR}}}; + WaylandTest::SetUp(); auto manager_ptr = connection_->buffer_manager_host()->BindInterface(); - buffer_manager_gpu_->Initialize(std::move(manager_ptr), {}, false, true, - false); + buffer_manager_gpu_->Initialize(std::move(manager_ptr), + kSupportedFormatsWithModifiers, + /*supports_dma_buf=*/false, + /*supports_viewporter=*/true, + /*supports_acquire_fence=*/false); // Wait until initialization and mojo calls go through. base::RunLoop().RunUntilIdle();
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc b/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc index bd1e523..99e5c1b 100644 --- a/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc +++ b/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc
@@ -228,7 +228,8 @@ continue; submitted_buffers_.push_back( - SubmissionInfo{pending_commit.buffer->buffer_id, /*acked=*/false}); + SubmissionInfo{pending_commit.buffer->buffer_id, + /*acked=*/submitted_buffers_.empty() ? true : false}); if (connection_->presentation()) { feedback_queue_.push_back( {wl::Object<struct wp_presentation_feedback>(),
diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc index 64256c1c..2d7686ef 100644 --- a/ui/ozone/platform/wayland/host/wayland_connection.cc +++ b/ui/ozone/platform/wayland/host/wayland_connection.cc
@@ -587,7 +587,8 @@ } connection->wayland_zwp_pointer_gestures_ = std::make_unique<WaylandZwpPointerGestures>( - zwp_pointer_gestures_v1.release(), connection); + zwp_pointer_gestures_v1.release(), connection, + connection->event_source()); } else if (!connection->xdg_decoration_manager_ && strcmp(interface, "zxdg_decoration_manager_v1") == 0) { connection->xdg_decoration_manager_ =
diff --git a/ui/ozone/platform/wayland/host/wayland_event_source.cc b/ui/ozone/platform/wayland/host/wayland_event_source.cc index 34b5e3a..f52c9de 100644 --- a/ui/ozone/platform/wayland/host/wayland_event_source.cc +++ b/ui/ozone/platform/wayland/host/wayland_event_source.cc
@@ -315,6 +315,23 @@ touch_points_.clear(); } +void WaylandEventSource::OnPinchEvent(EventType event_type, + const gfx::Vector2dF& delta, + base::TimeTicks timestamp, + int device_id, + base::Optional<float> scale) { + GestureEventDetails details(event_type); + details.set_device_type(GestureDeviceType::DEVICE_TOUCHPAD); + if (scale) + details.set_scale(*scale); + + auto location = pointer_location_ + delta; + GestureEvent event(location.x(), location.y(), 0 /* flags */, timestamp, + details); + event.set_source_device_id(device_id); + DispatchEvent(&event); +} + bool WaylandEventSource::IsPointerButtonPressed(EventFlags button) const { DCHECK(HasAnyPointerButtonFlag(button)); return pointer_flags_ & button;
diff --git a/ui/ozone/platform/wayland/host/wayland_event_source.h b/ui/ozone/platform/wayland/host/wayland_event_source.h index 1ad26e2..32e7ee9 100644 --- a/ui/ozone/platform/wayland/host/wayland_event_source.h +++ b/ui/ozone/platform/wayland/host/wayland_event_source.h
@@ -22,13 +22,14 @@ #include "ui/ozone/platform/wayland/host/wayland_keyboard.h" #include "ui/ozone/platform/wayland/host/wayland_pointer.h" #include "ui/ozone/platform/wayland/host/wayland_touch.h" -#include "ui/ozone/platform/wayland/host/wayland_window_manager.h" #include "ui/ozone/platform/wayland/host/wayland_window_observer.h" +#include "ui/ozone/platform/wayland/host/wayland_zwp_pointer_gestures.h" struct wl_display; namespace gfx { class Vector2d; +class Vector2dF; } namespace ui { @@ -47,7 +48,8 @@ public WaylandWindowObserver, public WaylandKeyboard::Delegate, public WaylandPointer::Delegate, - public WaylandTouch::Delegate { + public WaylandTouch::Delegate, + public WaylandZwpPointerGestures::Delegate { public: WaylandEventSource(wl_display* display, wl_event_queue* event_queue, @@ -120,6 +122,13 @@ PointerId id) override; void OnTouchCancelEvent() override; + // WaylandZwpPointerGesture::Delegate: + void OnPinchEvent(EventType event_type, + const gfx::Vector2dF& delta, + base::TimeTicks timestamp, + int device_id, + base::Optional<float> scale) override; + private: struct PointerFrame { uint32_t axis_source = WL_POINTER_AXIS_SOURCE_WHEEL;
diff --git a/ui/ozone/platform/wayland/host/wayland_window.cc b/ui/ozone/platform/wayland/host/wayland_window.cc index dfbd68f..6b778ffe 100644 --- a/ui/ozone/platform/wayland/host/wayland_window.cc +++ b/ui/ozone/platform/wayland/host/wayland_window.cc
@@ -358,7 +358,7 @@ } bool WaylandWindow::CanDispatchEvent(const PlatformEvent& event) { - if (event->IsMouseEvent()) + if (event->IsMouseEvent() || event->IsPinchEvent()) return has_pointer_focus_; if (event->IsKeyEvent()) return has_keyboard_focus_; @@ -708,6 +708,9 @@ bool WaylandWindow::CommitOverlays( std::vector<ui::ozone::mojom::WaylandOverlayConfigPtr>& overlays) { + if (overlays.empty()) + return true; + // |overlays| is sorted from bottom to top. std::sort(overlays.begin(), overlays.end(), OverlayStackOrderCompare); @@ -731,8 +734,10 @@ if (!ArrangeSubsurfaceStack(above, below)) return false; - if (wayland_overlay_delegation_enabled_) + if (wayland_overlay_delegation_enabled_) { + primary_subsurface()->Show(); connection_->buffer_manager_host()->StartFrame(root_surface()); + } { // Iterate through |subsurface_stack_below_|, setup subsurfaces and place @@ -800,7 +805,7 @@ } } - if (!num_primary_planes && overlays.front()->z_order == INT32_MIN) + if (split == overlays.end() && overlays.front()->z_order == INT32_MIN) split = overlays.begin(); UpdateVisualSize((*split)->bounds_rect.size()); @@ -823,7 +828,9 @@ // with viewport.destination == buffer.size. So do not set // viewport.destination to primary planes if crop_rect is uniform. // TODO(fangzhoug): Refactor some of this logic s.t. the decision of whether - // to apply viewport.destination is made at commit time. + // to apply viewport.destination is made at commit time. Right now PIP + // would have incorrect size b/c it is fullscreen overlay scheduled at + // z_order=0. primary_subsurface_->ConfigureAndShowSurface( (*split)->transform, (*split)->crop_rect, (*split)->crop_rect == gfx::RectF(1.f, 1.f) ? gfx::Rect()
diff --git a/ui/ozone/platform/wayland/host/wayland_zwp_pointer_gestures.cc b/ui/ozone/platform/wayland/host/wayland_zwp_pointer_gestures.cc index a5351e52..a98a2d6 100644 --- a/ui/ozone/platform/wayland/host/wayland_zwp_pointer_gestures.cc +++ b/ui/ozone/platform/wayland/host/wayland_zwp_pointer_gestures.cc
@@ -5,18 +5,25 @@ #include "ui/ozone/platform/wayland/host/wayland_zwp_pointer_gestures.h" #include <pointer-gestures-unstable-v1-client-protocol.h> +#include <wayland-util.h> +#include "ui/gfx/geometry/vector2d_f.h" +#include "ui/ozone/platform/wayland/common/wayland_util.h" #include "ui/ozone/platform/wayland/host/wayland_connection.h" +#include "ui/ozone/platform/wayland/host/wayland_cursor_position.h" #include "ui/ozone/platform/wayland/host/wayland_pointer.h" +#include "ui/ozone/platform/wayland/host/wayland_window_manager.h" namespace ui { WaylandZwpPointerGestures::WaylandZwpPointerGestures( zwp_pointer_gestures_v1* pointer_gestures, - WaylandConnection* connection) - : obj_(pointer_gestures), connection_(connection) { + WaylandConnection* connection, + Delegate* delegate) + : obj_(pointer_gestures), connection_(connection), delegate_(delegate) { DCHECK(obj_); DCHECK(connection_); + DCHECK(delegate_); } WaylandZwpPointerGestures::~WaylandZwpPointerGestures() = default; @@ -45,7 +52,14 @@ uint32_t time, struct wl_surface* surface, uint32_t fingers) { - NOTIMPLEMENTED_LOG_ONCE(); + auto* thiz = static_cast<WaylandZwpPointerGestures*>(data); + + base::TimeTicks timestamp = + base::TimeTicks() + base::TimeDelta::FromMilliseconds(time); + + thiz->delegate_->OnPinchEvent(ET_GESTURE_PINCH_BEGIN, + gfx::Vector2dF() /*delta*/, timestamp, + thiz->obj_.id()); } // static @@ -57,7 +71,14 @@ wl_fixed_t dy, wl_fixed_t scale, wl_fixed_t rotation) { - NOTIMPLEMENTED_LOG_ONCE(); + auto* thiz = static_cast<WaylandZwpPointerGestures*>(data); + + base::TimeTicks timestamp = + base::TimeTicks() + base::TimeDelta::FromMilliseconds(time); + + gfx::Vector2dF delta = {wl_fixed_to_double(dx), wl_fixed_to_double(dy)}; + thiz->delegate_->OnPinchEvent(ET_GESTURE_PINCH_UPDATE, delta, timestamp, + thiz->obj_.id(), wl_fixed_to_double(scale)); } void WaylandZwpPointerGestures::OnPinchEnd( @@ -66,7 +87,14 @@ uint32_t serial, uint32_t time, int32_t cancelled) { - NOTIMPLEMENTED_LOG_ONCE(); + auto* thiz = static_cast<WaylandZwpPointerGestures*>(data); + + base::TimeTicks timestamp = + base::TimeTicks() + base::TimeDelta::FromMilliseconds(time); + + thiz->delegate_->OnPinchEvent(ET_GESTURE_PINCH_END, + gfx::Vector2dF() /*delta*/, timestamp, + thiz->obj_.id()); } } // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_zwp_pointer_gestures.h b/ui/ozone/platform/wayland/host/wayland_zwp_pointer_gestures.h index 5a174f1..8739a1c 100644 --- a/ui/ozone/platform/wayland/host/wayland_zwp_pointer_gestures.h +++ b/ui/ozone/platform/wayland/host/wayland_zwp_pointer_gestures.h
@@ -5,8 +5,14 @@ #ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_ZWP_POINTER_GESTURES_H_ #define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_ZWP_POINTER_GESTURES_H_ +#include "base/time/time.h" +#include "ui/events/types/event_type.h" #include "ui/ozone/platform/wayland/common/wayland_object.h" +namespace gfx { +class Vector2dF; +} + namespace ui { class WaylandConnection; @@ -14,8 +20,11 @@ // Wraps the zwp_pointer_gestures and zwp_pointer_gesture_pinch_v1 objects. class WaylandZwpPointerGestures { public: + class Delegate; + WaylandZwpPointerGestures(zwp_pointer_gestures_v1* pointer_gestures, - WaylandConnection* connection); + WaylandConnection* connection, + Delegate* delegate); WaylandZwpPointerGestures(const WaylandZwpPointerGestures&) = delete; WaylandZwpPointerGestures& operator=(const WaylandZwpPointerGestures&) = delete; @@ -52,6 +61,16 @@ wl::Object<zwp_pointer_gestures_v1> obj_; wl::Object<zwp_pointer_gesture_pinch_v1> pinch_; WaylandConnection* const connection_; + Delegate* const delegate_; +}; + +class WaylandZwpPointerGestures::Delegate { + public: + virtual void OnPinchEvent(EventType event_type, + const gfx::Vector2dF& delta, + base::TimeTicks timestamp, + int device_id, + base::Optional<float> scale = base::nullopt) = 0; }; } // namespace ui
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn index b0404a8..6a80a1e 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn
@@ -212,12 +212,6 @@ "layout/normalized_geometry.h", "layout/proposed_layout.h", "masked_targeter_delegate.h", - "metadata/metadata_cache.h", - "metadata/metadata_header_macros.h", - "metadata/metadata_impl_macros.h", - "metadata/metadata_macros_internal.h", - "metadata/metadata_types.h", - "metadata/property_metadata.h", "metadata/type_conversion.h", "metadata/view_factory.h", "metadata/view_factory_internal.h", @@ -421,8 +415,6 @@ "layout/normalized_geometry.cc", "layout/proposed_layout.cc", "masked_targeter_delegate.cc", - "metadata/metadata_cache.cc", - "metadata/metadata_types.cc", "metadata/type_conversion.cc", "metadata/view_factory_internal.cc", "metrics.cc", @@ -1175,7 +1167,6 @@ "layout/layout_manager_base_unittest.cc", "layout/normalized_geometry_unittest.cc", "layout/proposed_layout_unittest.cc", - "metadata/metadata_unittest.cc", "metadata/type_conversion_unittest.cc", "metadata/view_factory_unittest.cc", "paint_info_unittest.cc",
diff --git a/ui/views/accessible_pane_view.cc b/ui/views/accessible_pane_view.cc index fa9a820..f3d4bc2 100644 --- a/ui/views/accessible_pane_view.cc +++ b/ui/views/accessible_pane_view.cc
@@ -8,8 +8,8 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/focus/focus_search.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_tracker.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/animation/ink_drop.cc b/ui/views/animation/ink_drop.cc index db36425..2b7ecd8c 100644 --- a/ui/views/animation/ink_drop.cc +++ b/ui/views/animation/ink_drop.cc
@@ -6,11 +6,13 @@ #include <memory> +#include "base/bind.h" +#include "base/callback.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/views/animation/ink_drop_host_view.h" #include "ui/views/animation/ink_drop_impl.h" #include "ui/views/animation/ink_drop_observer.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views { @@ -42,6 +44,14 @@ highlight_on_hover, highlight_on_focus); } +void InkDrop::UseInkDropForSquareRipple(InkDropHostView* host, + bool highlight_on_hover, + bool highlight_on_focus) { + host->SetCreateInkDropCallback( + base::BindRepeating(&InkDrop::CreateInkDropForSquareRipple, host, + highlight_on_hover, highlight_on_focus)); +} + std::unique_ptr<InkDrop> InkDrop::CreateInkDropForFloodFillRipple( InkDropHostView* host, bool highlight_on_hover, @@ -50,6 +60,14 @@ highlight_on_hover, highlight_on_focus); } +void InkDrop::UseInkDropForFloodFillRipple(InkDropHostView* host, + bool highlight_on_hover, + bool highlight_on_focus) { + host->SetCreateInkDropCallback( + base::BindRepeating(&InkDrop::CreateInkDropForFloodFillRipple, host, + highlight_on_hover, highlight_on_focus)); +} + std::unique_ptr<InkDrop> InkDrop::CreateInkDropWithoutAutoHighlight( InkDropHostView* host, bool highlight_on_hover, @@ -58,6 +76,14 @@ highlight_on_hover, highlight_on_focus); } +void InkDrop::UseInkDropWithoutAutoHighlight(InkDropHostView* host, + bool highlight_on_hover, + bool highlight_on_focus) { + host->SetCreateInkDropCallback( + base::BindRepeating(&InkDrop::CreateInkDropWithoutAutoHighlight, host, + highlight_on_hover, highlight_on_focus)); +} + void InkDrop::AddObserver(InkDropObserver* observer) { CHECK(observer); observers_.AddObserver(observer);
diff --git a/ui/views/animation/ink_drop.h b/ui/views/animation/ink_drop.h index f892547..48aa47f 100644 --- a/ui/views/animation/ink_drop.h +++ b/ui/views/animation/ink_drop.h
@@ -7,13 +7,14 @@ #include <memory> +#include "base/callback.h" #include "base/time/time.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/compositor/layer_tree_owner.h" #include "ui/events/event_handler.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" #include "ui/views/animation/ink_drop_state.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/views_export.h" @@ -38,6 +39,11 @@ bool highlight_on_hover = true, bool highlight_on_focus = false); + // Configure `host` to use CreateInkDropForSquareRipple(). + static void UseInkDropForSquareRipple(InkDropHostView* host, + bool highlight_on_hover = true, + bool highlight_on_focus = false); + // Create an InkDrop appropriate for the "flood-fill" InkDropRipple effect. // This InkDrop shows as a response to the ripple effect. static std::unique_ptr<InkDrop> CreateInkDropForFloodFillRipple( @@ -45,12 +51,22 @@ bool highlight_on_hover = true, bool highlight_on_focus = false); + // Configure `host` to use CreateInkDropForFloodFillRipple(). + static void UseInkDropForFloodFillRipple(InkDropHostView* host, + bool highlight_on_hover = true, + bool highlight_on_focus = false); + // Create an InkDrop whose highlight does not react to its ripple. static std::unique_ptr<InkDrop> CreateInkDropWithoutAutoHighlight( InkDropHostView* host, bool highlight_on_hover = true, bool highlight_on_focus = false); + // Configure `host` to use CreateInkDropWithoutAutoHighlight(). + static void UseInkDropWithoutAutoHighlight(InkDropHostView* host, + bool highlight_on_hover = true, + bool highlight_on_focus = false); + // Called by ink drop hosts when their size is changed. virtual void HostSizeChanged(const gfx::Size& new_size) = 0;
diff --git a/ui/views/animation/ink_drop_host_view.cc b/ui/views/animation/ink_drop_host_view.cc index 2ee967a..11290b9 100644 --- a/ui/views/animation/ink_drop_host_view.cc +++ b/ui/views/animation/ink_drop_host_view.cc
@@ -6,6 +6,7 @@ #include <utility> +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/events/scoped_target_handler.h" #include "ui/gfx/color_palette.h" @@ -19,7 +20,6 @@ #include "ui/views/animation/square_ink_drop_ripple.h" #include "ui/views/controls/focus_ring.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/view_class_properties.h"
diff --git a/ui/views/animation/ink_drop_host_view.h b/ui/views/animation/ink_drop_host_view.h index a355b71..99a57abe 100644 --- a/ui/views/animation/ink_drop_host_view.h +++ b/ui/views/animation/ink_drop_host_view.h
@@ -58,14 +58,9 @@ // Removes |ink_drop_layer| from the layer tree. virtual void RemoveInkDropLayer(ui::Layer* ink_drop_layer); - // Returns a configured InkDrop. In general subclasses will return an - // InkDropImpl instance that will use the CreateInkDropRipple() and - // CreateInkDropHighlight() methods to create the visual effects. - // - // Subclasses should override this if they need to configure any properties - // specific to the InkDrop instance. e.g. the AutoHighlightMode of an - // InkDropImpl instance. - virtual std::unique_ptr<InkDrop> CreateInkDrop(); + // Returns a configured InkDrop. To override default behavior call + // SetCreateInkDropRippleCallback(). + std::unique_ptr<InkDrop> CreateInkDrop(); // Callback version of CreateInkDrop(). Note that this is called in the base // implementation of CreateInkDrop(), so if "it's not working", check the
diff --git a/ui/views/animation/ink_drop_host_view_unittest.cc b/ui/views/animation/ink_drop_host_view_unittest.cc index 9c958983..6f67c53 100644 --- a/ui/views/animation/ink_drop_host_view_unittest.cc +++ b/ui/views/animation/ink_drop_host_view_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "base/bind.h" #include "base/macros.h" #include "base/memory/ptr_util.h" #include "build/build_config.h" @@ -33,7 +34,15 @@ class TestInkDropHostView : public InkDropHostView { public: - TestInkDropHostView() = default; + TestInkDropHostView() { + SetCreateInkDropCallback(base::BindRepeating( + [](TestInkDropHostView* host) -> std::unique_ptr<InkDrop> { + auto ink_drop = std::make_unique<TestInkDrop>(); + host->last_created_inkdrop_ = ink_drop.get(); + return ink_drop; + }, + this)); + } // Accessors to InkDropHostView internals. ui::EventHandler* GetTargetHandler() { return target_handler(); } @@ -43,16 +52,11 @@ TestInkDrop* last_created_inkdrop() const { return last_created_inkdrop_; } protected: + // InkDropHostView: SkColor GetInkDropBaseColor() const override { return gfx::kPlaceholderColor; } - // InkDropHostView: - std::unique_ptr<InkDrop> CreateInkDrop() override { - last_created_inkdrop_ = new TestInkDrop(); - return base::WrapUnique(last_created_inkdrop_); - } - private: int on_ink_drop_created_count_ = 0; TestInkDrop* last_created_inkdrop_ = nullptr;
diff --git a/ui/views/animation/test/test_ink_drop_host.cc b/ui/views/animation/test/test_ink_drop_host.cc index bc244f98..986d351 100644 --- a/ui/views/animation/test/test_ink_drop_host.cc +++ b/ui/views/animation/test/test_ink_drop_host.cc
@@ -76,7 +76,9 @@ } // namespace -TestInkDropHost::TestInkDropHost() = default; +TestInkDropHost::TestInkDropHost() { + InkDrop::UseInkDropWithoutAutoHighlight(this); +} TestInkDropHost::~TestInkDropHost() = default; @@ -88,10 +90,6 @@ ++num_ink_drop_layers_removed_; } -std::unique_ptr<InkDrop> TestInkDropHost::CreateInkDrop() { - return std::make_unique<InkDropImpl>(this, gfx::Size()); -} - std::unique_ptr<InkDropRipple> TestInkDropHost::CreateInkDropRipple() const { std::unique_ptr<InkDropRipple> ripple(new TestInkDropRipple( size(), 0, size(), 0, gfx::Point(), SK_ColorBLACK, 0.175f));
diff --git a/ui/views/animation/test/test_ink_drop_host.h b/ui/views/animation/test/test_ink_drop_host.h index 6048012..099e92d89 100644 --- a/ui/views/animation/test/test_ink_drop_host.h +++ b/ui/views/animation/test/test_ink_drop_host.h
@@ -45,7 +45,6 @@ // InkDropHostView: void AddInkDropLayer(ui::Layer* ink_drop_layer) override; void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; - std::unique_ptr<InkDrop> CreateInkDrop() override; std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override;
diff --git a/ui/views/bubble/bubble_dialog_delegate_view.cc b/ui/views/bubble/bubble_dialog_delegate_view.cc index 91352cf..85ab5aa 100644 --- a/ui/views/bubble/bubble_dialog_delegate_view.cc +++ b/ui/views/bubble/bubble_dialog_delegate_view.cc
@@ -14,6 +14,7 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_role_properties.h" #include "ui/base/default_style.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_element.h" @@ -26,7 +27,6 @@ #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/layout/layout_manager.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/bubble/bubble_dialog_delegate_view.h b/ui/views/bubble/bubble_dialog_delegate_view.h index c6bcdda5..b99a1f86 100644 --- a/ui/views/bubble/bubble_dialog_delegate_view.h +++ b/ui/views/bubble/bubble_dialog_delegate_view.h
@@ -12,9 +12,9 @@ #include "build/build_config.h" #include "ui/accessibility/ax_enums.mojom-forward.h" #include "ui/base/class_property.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/bubble/bubble_frame_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view_tracker.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/bubble/bubble_dialog_model_host.cc b/ui/views/bubble/bubble_dialog_model_host.cc index 6f85320c..28f41efc 100644 --- a/ui/views/bubble/bubble_dialog_model_host.cc +++ b/ui/views/bubble/bubble_dialog_model_host.cc
@@ -9,6 +9,8 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/base/class_property.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/combobox_model.h" #include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/button/label_button_border.h" @@ -21,8 +23,6 @@ #include "ui/views/layout/box_layout_view.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace views {
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc index c7b515e2..d25e285 100644 --- a/ui/views/bubble/bubble_frame_view.cc +++ b/ui/views/bubble/bubble_frame_view.cc
@@ -13,6 +13,7 @@ #include "ui/base/default_style.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/layer.h" #include "ui/compositor/paint_recorder.h" @@ -34,7 +35,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/paint_info.h" #include "ui/views/resources/grit/views_resources.h" #include "ui/views/view_class_properties.h" @@ -936,9 +936,7 @@ PreferredArrowAdjustment) ADD_PROPERTY_METADATA(int, CornerRadius) ADD_PROPERTY_METADATA(BubbleBorder::Arrow, Arrow) -ADD_PROPERTY_METADATA(SkColor, - BackgroundColor, - views::metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, BackgroundColor, ui::metadata::SkColorConverter) END_METADATA } // namespace views
diff --git a/ui/views/bubble/bubble_frame_view.h b/ui/views/bubble/bubble_frame_view.h index fae2a20..0f883d43 100644 --- a/ui/views/bubble/bubble_frame_view.h +++ b/ui/views/bubble/bubble_frame_view.h
@@ -11,6 +11,7 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/time/time.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/font_list.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/bubble/bubble_border.h" @@ -18,7 +19,6 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/progress_bar.h" #include "ui/views/input_event_activation_protector.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/window/non_client_view.h" namespace gfx {
diff --git a/ui/views/bubble/footnote_container_view.cc b/ui/views/bubble/footnote_container_view.cc index 29962a7..f1c11f7 100644 --- a/ui/views/bubble/footnote_container_view.cc +++ b/ui/views/bubble/footnote_container_view.cc
@@ -8,6 +8,7 @@ #include <utility> #include "cc/paint/paint_flags.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/geometry/rect_f.h" @@ -15,7 +16,6 @@ #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views {
diff --git a/ui/views/bubble/info_bubble.cc b/ui/views/bubble/info_bubble.cc index 8126ba8..874d69c 100644 --- a/ui/views/bubble/info_bubble.cc +++ b/ui/views/bubble/info_bubble.cc
@@ -7,6 +7,7 @@ #include <memory> #include <utility> +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" @@ -15,7 +16,6 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace views {
diff --git a/ui/views/bubble/tooltip_icon.cc b/ui/views/bubble/tooltip_icon.cc index 6b4f5f5..ad55cfa 100644 --- a/ui/views/bubble/tooltip_icon.cc +++ b/ui/views/bubble/tooltip_icon.cc
@@ -8,10 +8,10 @@ #include "components/vector_icons/vector_icons.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/bubble/info_bubble.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/mouse_watcher_view_host.h" namespace views {
diff --git a/ui/views/color_chooser/color_chooser_view.cc b/ui/views/color_chooser/color_chooser_view.cc index c92dde7..4fd58ee 100644 --- a/ui/views/color_chooser/color_chooser_view.cc +++ b/ui/views/color_chooser/color_chooser_view.cc
@@ -22,6 +22,8 @@ #include "third_party/skia/include/core/SkPath.h" #include "third_party/skia/include/effects/SkGradientShader.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/gfx/canvas.h" @@ -36,8 +38,6 @@ #include "ui/views/controls/textfield/textfield_controller.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/ui/views/controls/button/button.cc b/ui/views/controls/button/button.cc index 6f74547..11fc16a 100644 --- a/ui/views/controls/button/button.cc +++ b/ui/views/controls/button/button.cc
@@ -6,10 +6,12 @@ #include <utility> +#include "base/bind.h" #include "base/strings/utf_string_conversions.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/class_property.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" #include "ui/events/keycodes/keyboard_codes.h" @@ -27,7 +29,6 @@ #include "ui/views/controls/button/radio_button.h" #include "ui/views/controls/button/toggle_button.h" #include "ui/views/controls/focus_ring.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/style/platform_style.h" @@ -686,19 +687,13 @@ } } -DEFINE_ENUM_CONVERTERS(Button::ButtonState, - {Button::STATE_NORMAL, u"STATE_NORMAL"}, - {Button::STATE_HOVERED, u"STATE_HOVERED"}, - {Button::STATE_PRESSED, u"STATE_PRESSED"}, - {Button::STATE_DISABLED, u"STATE_DISABLED"}) - BEGIN_METADATA(Button, InkDropHostView) ADD_PROPERTY_METADATA(std::u16string, AccessibleName) ADD_PROPERTY_METADATA(PressedCallback, Callback) ADD_PROPERTY_METADATA(bool, AnimateOnStateChange) ADD_PROPERTY_METADATA(bool, HasInkDropActionOnClick) ADD_PROPERTY_METADATA(bool, HideInkDropWhenShowingContextMenu) -ADD_PROPERTY_METADATA(SkColor, InkDropBaseColor, metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, InkDropBaseColor, ui::metadata::SkColorConverter) ADD_PROPERTY_METADATA(bool, InstallFocusRingOnFocus) ADD_PROPERTY_METADATA(bool, RequestFocusOnPress) ADD_PROPERTY_METADATA(ButtonState, State) @@ -707,3 +702,9 @@ END_METADATA } // namespace views + +DEFINE_ENUM_CONVERTERS(views::Button::ButtonState, + {views::Button::STATE_NORMAL, u"STATE_NORMAL"}, + {views::Button::STATE_HOVERED, u"STATE_HOVERED"}, + {views::Button::STATE_PRESSED, u"STATE_PRESSED"}, + {views::Button::STATE_DISABLED, u"STATE_DISABLED"})
diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc index c9a39c2..38324337 100644 --- a/ui/views/controls/button/checkbox.cc +++ b/ui/views/controls/button/checkbox.cc
@@ -10,6 +10,7 @@ #include <utility> #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" @@ -24,7 +25,6 @@ #include "ui/views/controls/focus_ring.h" #include "ui/views/controls/highlight_path_generator.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/resources/grit/views_resources.h" #include "ui/views/style/platform_style.h" @@ -53,6 +53,8 @@ SetRequestFocusOnPress(false); SetInkDropMode(InkDropMode::ON); SetHasInkDropActionOnClick(true); + views::InkDrop::UseInkDropWithoutAutoHighlight(this, + /*highlight_on_hover=*/false); // Limit the checkbox height to match the legacy appearance. const gfx::Size preferred_size(LabelButton::CalculatePreferredSize()); @@ -153,11 +155,6 @@ UpdateImage(); } -std::unique_ptr<InkDrop> Checkbox::CreateInkDrop() { - return views::InkDrop::CreateInkDropWithoutAutoHighlight( - this, /*highlight_on_hover=*/false); -} - std::unique_ptr<InkDropRipple> Checkbox::CreateInkDropRipple() const { // The "small" size is 21dp, the large size is 1.33 * 21dp = 28dp. return CreateInkDropForSquareRipple(
diff --git a/ui/views/controls/button/checkbox.h b/ui/views/controls/button/checkbox.h index 1030986..9b834f9b 100644 --- a/ui/views/controls/button/checkbox.h +++ b/ui/views/controls/button/checkbox.h
@@ -58,7 +58,6 @@ // LabelButton: void OnThemeChanged() override; - std::unique_ptr<InkDrop> CreateInkDrop() override; std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; SkColor GetInkDropBaseColor() const override;
diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc index 0505a98d..d5cf20d 100644 --- a/ui/views/controls/button/image_button.cc +++ b/ui/views/controls/button/image_button.cc
@@ -10,12 +10,12 @@ #include "base/trace_event/trace_event.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/scoped_canvas.h" #include "ui/views/background.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/widget/widget.h" @@ -335,17 +335,6 @@ } } -DEFINE_ENUM_CONVERTERS( - ImageButton::HorizontalAlignment, - {ImageButton::HorizontalAlignment::ALIGN_LEFT, u"ALIGN_LEFT"}, - {ImageButton::HorizontalAlignment::ALIGN_CENTER, u"ALIGN_CENTER"}, - {ImageButton::HorizontalAlignment::ALIGN_RIGHT, u"ALIGN_RIGHT"}) -DEFINE_ENUM_CONVERTERS( - ImageButton::VerticalAlignment, - {ImageButton::VerticalAlignment::ALIGN_TOP, u"ALIGN_TOP"}, - {ImageButton::VerticalAlignment::ALIGN_MIDDLE, u"ALIGN_MIDDLE"}, - {ImageButton::VerticalAlignment::ALIGN_BOTTOM, u"ALIGN_BOTTOM"}) - BEGIN_METADATA(ImageButton, Button) ADD_PROPERTY_METADATA(HorizontalAlignment, ImageHorizontalAlignment) ADD_PROPERTY_METADATA(VerticalAlignment, ImageVerticalAlignment) @@ -360,3 +349,14 @@ END_METADATA } // namespace views + +DEFINE_ENUM_CONVERTERS( + views::ImageButton::HorizontalAlignment, + {views::ImageButton::HorizontalAlignment::ALIGN_LEFT, u"ALIGN_LEFT"}, + {views::ImageButton::HorizontalAlignment::ALIGN_CENTER, u"ALIGN_CENTER"}, + {views::ImageButton::HorizontalAlignment::ALIGN_RIGHT, u"ALIGN_RIGHT"}) +DEFINE_ENUM_CONVERTERS( + views::ImageButton::VerticalAlignment, + {views::ImageButton::VerticalAlignment::ALIGN_TOP, u"ALIGN_TOP"}, + {views::ImageButton::VerticalAlignment::ALIGN_MIDDLE, u"ALIGN_MIDDLE"}, + {views::ImageButton::VerticalAlignment::ALIGN_BOTTOM, u"ALIGN_BOTTOM"})
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc index 1a6a2c91..5134118 100644 --- a/ui/views/controls/button/label_button.cc +++ b/ui/views/controls/button/label_button.cc
@@ -14,6 +14,7 @@ #include "build/build_config.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/animation/throb_animation.h" #include "ui/gfx/canvas.h" @@ -26,7 +27,6 @@ #include "ui/views/background.h" #include "ui/views/controls/button/label_button_border.h" #include "ui/views/image_model_utils.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/style/platform_style.h" #include "ui/views/view_class_properties.h"
diff --git a/ui/views/controls/button/label_button_label.cc b/ui/views/controls/button/label_button_label.cc index 3f203d3..aa20a61b 100644 --- a/ui/views/controls/button/label_button_label.cc +++ b/ui/views/controls/button/label_button_label.cc
@@ -4,7 +4,7 @@ #include "ui/views/controls/button/label_button_label.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" namespace views {
diff --git a/ui/views/controls/button/label_button_label.h b/ui/views/controls/button/label_button_label.h index 207336cf..1dfd3ee8 100644 --- a/ui/views/controls/button/label_button_label.h +++ b/ui/views/controls/button/label_button_label.h
@@ -10,9 +10,9 @@ #include "base/bind.h" #include "base/optional.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/color_palette.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/views_export.h" namespace views {
diff --git a/ui/views/controls/button/md_text_button.cc b/ui/views/controls/button/md_text_button.cc index a4a2d5d..59be7db 100644 --- a/ui/views/controls/button/md_text_button.cc +++ b/ui/views/controls/button/md_text_button.cc
@@ -11,6 +11,7 @@ #include "base/i18n/case_conversion.h" #include "base/memory/ptr_util.h" #include "build/build_config.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" @@ -23,7 +24,6 @@ #include "ui/views/border.h" #include "ui/views/controls/focus_ring.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/style/platform_style.h" #include "ui/views/style/typography.h"
diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc index 3eece12..960b272a 100644 --- a/ui/views/controls/button/menu_button.cc +++ b/ui/views/controls/button/menu_button.cc
@@ -7,10 +7,10 @@ #include <memory> #include <utility> +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/views/controls/button/button_controller_delegate.h" #include "ui/views/controls/button/menu_button_controller.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views {
diff --git a/ui/views/controls/button/menu_button.h b/ui/views/controls/button/menu_button.h index eedab1ae..a88c2f17 100644 --- a/ui/views/controls/button/menu_button.h +++ b/ui/views/controls/button/menu_button.h
@@ -7,8 +7,8 @@ #include <string> +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/label_button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" namespace views {
diff --git a/ui/views/controls/button/radio_button.cc b/ui/views/controls/button/radio_button.cc index 73ecc93..d6d08e66 100644 --- a/ui/views/controls/button/radio_button.cc +++ b/ui/views/controls/button/radio_button.cc
@@ -7,12 +7,12 @@ #include "base/check.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/events/event_utils.h" #include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/skia_util.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/resources/grit/views_resources.h" #include "ui/views/vector_icons.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/controls/button/toggle_button.cc b/ui/views/controls/button/toggle_button.cc index 669cf2f..5bda00e 100644 --- a/ui/views/controls/button/toggle_button.cc +++ b/ui/views/controls/button/toggle_button.cc
@@ -12,6 +12,7 @@ #include "third_party/skia/include/core/SkDrawLooper.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/color_utils.h" @@ -22,7 +23,6 @@ #include "ui/views/animation/ink_drop_ripple.h" #include "ui/views/border.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" namespace views { @@ -134,6 +134,8 @@ // desirable. SetInstallFocusRingOnFocus(false); SetHasInkDropActionOnClick(true); + views::InkDrop::UseInkDropForSquareRipple(this, + /*highlight_on_hover=*/false); } ToggleButton::~ToggleButton() { @@ -323,12 +325,6 @@ thumb_view_->RemoveInkDropLayer(ink_drop_layer); } -std::unique_ptr<InkDrop> ToggleButton::CreateInkDrop() { - return views::InkDrop::CreateInkDropForSquareRipple( - this, - /*highlight_on_hover=*/false); -} - std::unique_ptr<InkDropRipple> ToggleButton::CreateInkDropRipple() const { gfx::Rect rect = thumb_view_->GetLocalBounds(); rect.Inset(-ThumbView::GetShadowOutsets());
diff --git a/ui/views/controls/button/toggle_button.h b/ui/views/controls/button/toggle_button.h index b734019e..82bcb7c 100644 --- a/ui/views/controls/button/toggle_button.h +++ b/ui/views/controls/button/toggle_button.h
@@ -71,7 +71,6 @@ void PaintButtonContents(gfx::Canvas* canvas) override; void AddInkDropLayer(ui::Layer* ink_drop_layer) override; void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; - std::unique_ptr<InkDrop> CreateInkDrop() override; std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; SkColor GetInkDropBaseColor() const override;
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc index 3b5e587b..84bbcf5 100644 --- a/ui/views/controls/combobox/combobox.cc +++ b/ui/views/controls/combobox/combobox.cc
@@ -15,6 +15,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/ime/input_method.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h" #include "ui/base/models/menu_model.h" #include "ui/base/ui_base_types.h" @@ -39,7 +40,6 @@ #include "ui/views/controls/prefix_selector.h" #include "ui/views/image_model_utils.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/mouse_constants.h" #include "ui/views/style/platform_style.h" #include "ui/views/style/typography.h" @@ -68,7 +68,10 @@ SetInkDropMode(InkDropMode::ON); SetHasInkDropActionOnClick(true); + InkDrop::UseInkDropForSquareRipple(this, + /*highlight_on_hover=*/false); } + ~TransparentButton() override = default; bool OnMousePressed(const ui::MouseEvent& mouse_event) override { @@ -85,13 +88,6 @@ } // Button: - std::unique_ptr<InkDrop> CreateInkDrop() override { - std::unique_ptr<InkDrop> ink_drop = - InkDrop::CreateInkDropForSquareRipple(this); - ink_drop->SetShowHighlightOnHover(false); - return ink_drop; - } - std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override { return std::unique_ptr<views::InkDropRipple>( new views::FloodFillInkDropRipple(
diff --git a/ui/views/controls/dot_indicator.cc b/ui/views/controls/dot_indicator.cc index d1b3e44..413bd049 100644 --- a/ui/views/controls/dot_indicator.cc +++ b/ui/views/controls/dot_indicator.cc
@@ -7,12 +7,12 @@ #include <algorithm> #include <utility> +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/point_f.h" #include "ui/gfx/geometry/rect_f.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views {
diff --git a/ui/views/controls/editable_combobox/editable_combobox.cc b/ui/views/controls/editable_combobox/editable_combobox.cc index 71eadb21..360fbc3 100644 --- a/ui/views/controls/editable_combobox/editable_combobox.cc +++ b/ui/views/controls/editable_combobox/editable_combobox.cc
@@ -19,6 +19,8 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/ime/text_input_type.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/combobox_model.h" #include "ui/base/models/combobox_model_observer.h" #include "ui/base/models/menu_model.h" @@ -52,8 +54,6 @@ #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/layout_manager.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/style/typography.h" #include "ui/views/view.h" @@ -73,8 +73,13 @@ button_controller()->set_notify_action( ButtonController::NotifyAction::kOnPress); + // TODO(pbos): Share ink-drop configuration code between here and + // Combobox's TransparentButton. + // Similar to Combobox's TransparentButton. SetInkDropMode(InkDropMode::ON); SetHasInkDropActionOnClick(true); + InkDrop::UseInkDropForSquareRipple(this, + /*highlight_on_hover=*/false); } Arrow(const Arrow&) = delete; Arrow& operator=(const Arrow&) = delete; @@ -86,14 +91,6 @@ // Button: // Similar to Combobox's TransparentButton. - std::unique_ptr<InkDrop> CreateInkDrop() override { - std::unique_ptr<InkDrop> ink_drop = - InkDrop::CreateInkDropForSquareRipple(this); - ink_drop->SetShowHighlightOnHover(false); - return ink_drop; - } - - // Similar to Combobox's TransparentButton. std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override { return std::make_unique<views::FloodFillInkDropRipple>( size(), GetInkDropCenterBasedOnLastEvent(),
diff --git a/ui/views/controls/editable_combobox/editable_combobox.h b/ui/views/controls/editable_combobox/editable_combobox.h index 1fb0326..8f4744ef5 100644 --- a/ui/views/controls/editable_combobox/editable_combobox.h +++ b/ui/views/controls/editable_combobox/editable_combobox.h
@@ -13,11 +13,11 @@ #include "base/macros.h" #include "base/scoped_observation.h" #include "build/build_config.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/image_model.h" #include "ui/base/ui_base_types.h" #include "ui/views/controls/textfield/textfield_controller.h" #include "ui/views/layout/animating_layout_manager.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/style/typography.h" #include "ui/views/view.h" #include "ui/views/view_observer.h"
diff --git a/ui/views/controls/focus_ring.cc b/ui/views/controls/focus_ring.cc index cdd61f4..6f1dca7 100644 --- a/ui/views/controls/focus_ring.cc +++ b/ui/views/controls/focus_ring.cc
@@ -11,11 +11,11 @@ #include "base/notreached.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/views/controls/focusable_border.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/view_class_properties.h" #include "ui/views/view_utils.h"
diff --git a/ui/views/controls/image_view.cc b/ui/views/controls/image_view.cc index a98289d..09b1573 100644 --- a/ui/views/controls/image_view.cc +++ b/ui/views/controls/image_view.cc
@@ -12,11 +12,11 @@ #include "skia/ext/image_operations.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/native_theme/themed_vector_icon.h" #include "ui/views/image_model_utils.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views { @@ -289,11 +289,6 @@ return scaled_image_; } -DEFINE_ENUM_CONVERTERS(ImageView::Alignment, - {ImageView::Alignment::kLeading, u"kLeading"}, - {ImageView::Alignment::kCenter, u"kCenter"}, - {ImageView::Alignment::kTrailing, u"kTrailing"}) - BEGIN_METADATA(ImageView, View) ADD_PROPERTY_METADATA(Alignment, HorizontalAlignment) ADD_PROPERTY_METADATA(Alignment, VerticalAlignment) @@ -302,3 +297,8 @@ END_METADATA } // namespace views + +DEFINE_ENUM_CONVERTERS(views::ImageView::Alignment, + {views::ImageView::Alignment::kLeading, u"kLeading"}, + {views::ImageView::Alignment::kCenter, u"kCenter"}, + {views::ImageView::Alignment::kTrailing, u"kTrailing"})
diff --git a/ui/views/controls/image_view.h b/ui/views/controls/image_view.h index 877e510..05fc330 100644 --- a/ui/views/controls/image_view.h +++ b/ui/views/controls/image_view.h
@@ -9,9 +9,9 @@ #include <utility> #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/image_model.h" #include "ui/gfx/image/image_skia.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h" #include "ui/views/views_export.h"
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc index e223f7b..18b1e24 100644 --- a/ui/views/controls/label.cc +++ b/ui/views/controls/label.cc
@@ -24,6 +24,7 @@ #include "ui/base/clipboard/scoped_clipboard_writer.h" #include "ui/base/cursor/cursor.h" #include "ui/base/default_style.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" @@ -35,7 +36,6 @@ #include "ui/views/background.h" #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/focus/focus_manager.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/native_cursor.h" #include "ui/views/selection_controller.h" @@ -1248,13 +1248,15 @@ ADD_PROPERTY_METADATA(int, TextContext) ADD_PROPERTY_METADATA(int, TextStyle) ADD_PROPERTY_METADATA(bool, AutoColorReadabilityEnabled) -ADD_PROPERTY_METADATA(SkColor, EnabledColor, metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, EnabledColor, ui::metadata::SkColorConverter) ADD_PROPERTY_METADATA(gfx::ElideBehavior, ElideBehavior) -ADD_PROPERTY_METADATA(SkColor, BackgroundColor, metadata::SkColorConverter) -ADD_PROPERTY_METADATA(SkColor, SelectionTextColor, metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, BackgroundColor, ui::metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, + SelectionTextColor, + ui::metadata::SkColorConverter) ADD_PROPERTY_METADATA(SkColor, SelectionBackgroundColor, - metadata::SkColorConverter) + ui::metadata::SkColorConverter) ADD_PROPERTY_METADATA(bool, SubpixelRenderingEnabled) ADD_PROPERTY_METADATA(bool, SkipSubpixelRenderingOpacityCheck) ADD_PROPERTY_METADATA(gfx::ShadowValues, Shadows)
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h index 269425e..304ecb85 100644 --- a/ui/views/controls/label.h +++ b/ui/views/controls/label.h
@@ -12,12 +12,12 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/optional.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/simple_menu_model.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/render_text.h" #include "ui/gfx/text_constants.h" #include "ui/views/context_menu_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/selection_controller_delegate.h" #include "ui/views/style/typography.h"
diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc index 651ca9a..7ec4787 100644 --- a/ui/views/controls/link.cc +++ b/ui/views/controls/link.cc
@@ -11,13 +11,13 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/cursor/cursor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/font_list.h" #include "ui/native_theme/native_theme.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/native_cursor.h" #include "ui/views/style/platform_style.h" @@ -230,9 +230,7 @@ } BEGIN_METADATA(Link, Label) -ADD_READONLY_PROPERTY_METADATA(SkColor, - Color, - views::metadata::SkColorConverter) +ADD_READONLY_PROPERTY_METADATA(SkColor, Color, ui::metadata::SkColorConverter) END_METADATA } // namespace views
diff --git a/ui/views/controls/menu/menu_host_root_view.cc b/ui/views/controls/menu/menu_host_root_view.cc index 83a09ec..7ce1179 100644 --- a/ui/views/controls/menu/menu_host_root_view.cc +++ b/ui/views/controls/menu/menu_host_root_view.cc
@@ -4,10 +4,10 @@ #include "ui/views/controls/menu/menu_host_root_view.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/menu/menu_controller.h" #include "ui/views/controls/menu/menu_item_view.h" #include "ui/views/controls/menu/submenu_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views {
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc index f9ff1757..1c96f7a 100644 --- a/ui/views/controls/menu/menu_item_view.cc +++ b/ui/views/controls/menu/menu_item_view.cc
@@ -21,6 +21,7 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/platform/ax_platform_node.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/menu_model.h" #include "ui/base/ui_base_features.h" #include "ui/events/base_event_utils.h" @@ -46,7 +47,6 @@ #include "ui/views/controls/menu/submenu_view.h" #include "ui/views/controls/separator.h" #include "ui/views/image_model_utils.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/typography.h" #include "ui/views/vector_icons.h" #include "ui/views/view_class_properties.h"
diff --git a/ui/views/controls/menu/menu_scroll_view_container.cc b/ui/views/controls/menu/menu_scroll_view_container.cc index a5e146b..8522b0b4 100644 --- a/ui/views/controls/menu/menu_scroll_view_container.cc +++ b/ui/views/controls/menu/menu_scroll_view_container.cc
@@ -15,6 +15,8 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_palette.h" #include "ui/views/border.h" @@ -24,8 +26,6 @@ #include "ui/views/controls/menu/menu_item_view.h" #include "ui/views/controls/menu/submenu_view.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/round_rect_painter.h" #include "ui/views/view.h" #include "ui/views/view_class_properties.h"
diff --git a/ui/views/controls/menu/menu_separator.cc b/ui/views/controls/menu/menu_separator.cc index 98343f8..4ecf738 100644 --- a/ui/views/controls/menu/menu_separator.cc +++ b/ui/views/controls/menu/menu_separator.cc
@@ -8,10 +8,10 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/native_theme/native_theme.h" #include "ui/views/controls/menu/menu_config.h" -#include "ui/views/metadata/metadata_impl_macros.h" #if defined(OS_WIN) #include "ui/display/win/dpi.h"
diff --git a/ui/views/controls/menu/menu_separator.h b/ui/views/controls/menu/menu_separator.h index edf5c24..73d160b 100644 --- a/ui/views/controls/menu/menu_separator.h +++ b/ui/views/controls/menu/menu_separator.h
@@ -7,8 +7,8 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/models/menu_separator_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/views_export.h"
diff --git a/ui/views/controls/menu/submenu_view.cc b/ui/views/controls/menu/submenu_view.cc index 21d195a..bd268333 100644 --- a/ui/views/controls/menu/submenu_view.cc +++ b/ui/views/controls/menu/submenu_view.cc
@@ -13,6 +13,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/ime/input_method.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/paint_recorder.h" #include "ui/events/event.h" #include "ui/gfx/canvas.h" @@ -22,7 +23,6 @@ #include "ui/views/controls/menu/menu_host.h" #include "ui/views/controls/menu/menu_item_view.h" #include "ui/views/controls/menu/menu_scroll_view_container.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/root_view.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/controls/message_box_view.cc b/ui/views/controls/message_box_view.cc index 4ca2c0e..d94b81c0 100644 --- a/ui/views/controls/message_box_view.cc +++ b/ui/views/controls/message_box_view.cc
@@ -16,6 +16,7 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/clipboard/scoped_clipboard_writer.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/border.h" @@ -27,7 +28,6 @@ #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/window/client_view.h" #include "ui/views/window/dialog_delegate.h"
diff --git a/ui/views/controls/native/native_view_host.cc b/ui/views/controls/native/native_view_host.cc index 52f9b87..1a85a7b 100644 --- a/ui/views/controls/native/native_view_host.cc +++ b/ui/views/controls/native/native_view_host.cc
@@ -10,9 +10,9 @@ #include "base/check.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/base/cursor/cursor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/views/controls/native/native_view_host_wrapper.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/controls/progress_bar.cc b/ui/views/controls/progress_bar.cc index 16ec0eab..a4d431ae 100644 --- a/ui/views/controls/progress_bar.cc +++ b/ui/views/controls/progress_bar.cc
@@ -17,12 +17,12 @@ #include "third_party/skia/include/effects/SkGradientShader.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/skia_util.h" #include "ui/native_theme/native_theme.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace views { @@ -265,8 +265,8 @@ } BEGIN_METADATA(ProgressBar, View) -ADD_PROPERTY_METADATA(SkColor, ForegroundColor, metadata::SkColorConverter) -ADD_PROPERTY_METADATA(SkColor, BackgroundColor, metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, ForegroundColor, ui::metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, BackgroundColor, ui::metadata::SkColorConverter) END_METADATA } // namespace views
diff --git a/ui/views/controls/resize_area.cc b/ui/views/controls/resize_area.cc index 10d404f..a0f9004 100644 --- a/ui/views/controls/resize_area.cc +++ b/ui/views/controls/resize_area.cc
@@ -7,8 +7,8 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/cursor/cursor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/resize_area_delegate.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/native_cursor.h" namespace views {
diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc index 4a73588c..129b2c0e 100644 --- a/ui/views/controls/scroll_view.cc +++ b/ui/views/controls/scroll_view.cc
@@ -15,6 +15,8 @@ #include "ui/accessibility/ax_action_data.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_features.h" #include "ui/compositor/layer.h" #include "ui/compositor/overscroll/scroll_input_handler.h" @@ -24,8 +26,6 @@ #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/controls/focus_ring.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/controls/scrollbar/base_scroll_bar_button.cc b/ui/views/controls/scrollbar/base_scroll_bar_button.cc index b8099acc..7f9fbd0 100644 --- a/ui/views/controls/scrollbar/base_scroll_bar_button.cc +++ b/ui/views/controls/scrollbar/base_scroll_bar_button.cc
@@ -8,9 +8,9 @@ #include "base/bind.h" #include "base/callback_helpers.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/screen.h" #include "ui/events/event_utils.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views {
diff --git a/ui/views/controls/scrollbar/base_scroll_bar_thumb.cc b/ui/views/controls/scrollbar/base_scroll_bar_thumb.cc index 0c222e30..cdd20fa8d 100644 --- a/ui/views/controls/scrollbar/base_scroll_bar_thumb.cc +++ b/ui/views/controls/scrollbar/base_scroll_bar_thumb.cc
@@ -4,10 +4,10 @@ #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/controls/scrollbar/scroll_bar.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace { // The distance the mouse can be dragged outside the bounds of the thumb during
diff --git a/ui/views/controls/scrollbar/cocoa_scroll_bar.mm b/ui/views/controls/scrollbar/cocoa_scroll_bar.mm index e2fd6a5..d4d3e57 100644 --- a/ui/views/controls/scrollbar/cocoa_scroll_bar.mm +++ b/ui/views/controls/scrollbar/cocoa_scroll_bar.mm
@@ -9,12 +9,12 @@ #include "cc/paint/paint_shader.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/effects/SkGradientShader.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_animator.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/canvas.h" #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views {
diff --git a/ui/views/controls/scrollbar/overlay_scroll_bar.cc b/ui/views/controls/scrollbar/overlay_scroll_bar.cc index d39ed0a..22cf1cd0 100644 --- a/ui/views/controls/scrollbar/overlay_scroll_bar.cc +++ b/ui/views/controls/scrollbar/overlay_scroll_bar.cc
@@ -10,6 +10,7 @@ #include "base/macros.h" #include "cc/paint/paint_flags.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/canvas.h" @@ -17,7 +18,6 @@ #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views { namespace {
diff --git a/ui/views/controls/scrollbar/scroll_bar.cc b/ui/views/controls/scrollbar/scroll_bar.cc index e7965de..08eefeb9 100644 --- a/ui/views/controls/scrollbar/scroll_bar.cc +++ b/ui/views/controls/scrollbar/scroll_bar.cc
@@ -21,6 +21,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/gfx/canvas.h" @@ -29,7 +30,6 @@ #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/controls/scroll_view.h" #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace views {
diff --git a/ui/views/controls/scrollbar/scroll_bar_views.cc b/ui/views/controls/scrollbar/scroll_bar_views.cc index 45683aa9..3674a64 100644 --- a/ui/views/controls/scrollbar/scroll_bar_views.cc +++ b/ui/views/controls/scrollbar/scroll_bar_views.cc
@@ -10,6 +10,7 @@ #include "base/check.h" #include "base/notreached.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/gfx/canvas.h" #include "ui/views/controls/button/button.h" @@ -18,7 +19,6 @@ #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h" #include "ui/views/controls/scrollbar/scroll_bar.h" #include "ui/views/layout/flex_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace views {
diff --git a/ui/views/controls/separator.cc b/ui/views/controls/separator.cc index 84baccc..3acf5bb 100644 --- a/ui/views/controls/separator.cc +++ b/ui/views/controls/separator.cc
@@ -6,10 +6,10 @@ #include <algorithm> +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/scoped_canvas.h" #include "ui/native_theme/native_theme.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views { @@ -95,7 +95,7 @@ } BEGIN_METADATA(Separator, View) -ADD_PROPERTY_METADATA(SkColor, Color, metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, Color, ui::metadata::SkColorConverter) ADD_PROPERTY_METADATA(int, PreferredHeight) END_METADATA
diff --git a/ui/views/controls/slider.cc b/ui/views/controls/slider.cc index 0d58c41..0dd29353 100644 --- a/ui/views/controls/slider.cc +++ b/ui/views/controls/slider.cc
@@ -21,13 +21,13 @@ #include "ui/accessibility/ax_action_data.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/events/event.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "ui/native_theme/native_theme.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" namespace views {
diff --git a/ui/views/controls/styled_label.cc b/ui/views/controls/styled_label.cc index 74491ff..fdc5f8a 100644 --- a/ui/views/controls/styled_label.cc +++ b/ui/views/controls/styled_label.cc
@@ -15,12 +15,12 @@ #include "base/strings/string_util.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/font_list.h" #include "ui/gfx/text_elider.h" #include "ui/gfx/text_utils.h" #include "ui/native_theme/native_theme.h" #include "ui/views/controls/label.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" namespace views {
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.cc b/ui/views/controls/tabbed_pane/tabbed_pane.cc index 2a18529..4e8a167 100644 --- a/ui/views/controls/tabbed_pane/tabbed_pane.cc +++ b/ui/views/controls/tabbed_pane/tabbed_pane.cc
@@ -17,6 +17,7 @@ #include "ui/accessibility/ax_action_data.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/default_style.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/gfx/animation/tween.h" @@ -34,7 +35,6 @@ #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/layout_manager.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/widget/widget.h" @@ -489,14 +489,6 @@ ui::NativeTheme::kColorId_TabSelectedBorderColor)); } -DEFINE_ENUM_CONVERTERS(TabbedPane::Orientation, - {TabbedPane::Orientation::kHorizontal, u"HORIZONTAL"}, - {TabbedPane::Orientation::kVertical, u"VERTICAL"}) - -DEFINE_ENUM_CONVERTERS(TabbedPane::TabStripStyle, - {TabbedPane::TabStripStyle::kBorder, u"BORDER"}, - {TabbedPane::TabStripStyle::kHighlight, u"HIGHLIGHT"}) - BEGIN_METADATA(TabStrip, View) ADD_READONLY_PROPERTY_METADATA(int, SelectedTabIndex) ADD_READONLY_PROPERTY_METADATA(TabbedPane::Orientation, Orientation) @@ -629,3 +621,13 @@ END_METADATA } // namespace views + +DEFINE_ENUM_CONVERTERS(views::TabbedPane::Orientation, + {views::TabbedPane::Orientation::kHorizontal, + u"HORIZONTAL"}, + {views::TabbedPane::Orientation::kVertical, u"VERTICAL"}) + +DEFINE_ENUM_CONVERTERS(views::TabbedPane::TabStripStyle, + {views::TabbedPane::TabStripStyle::kBorder, u"BORDER"}, + {views::TabbedPane::TabStripStyle::kHighlight, + u"HIGHLIGHT"})
diff --git a/ui/views/controls/table/table_header.cc b/ui/views/controls/table/table_header.cc index 113ed48a..b680c03c 100644 --- a/ui/views/controls/table/table_header.cc +++ b/ui/views/controls/table/table_header.cc
@@ -14,13 +14,13 @@ #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/base/cursor/cursor.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" #include "ui/gfx/text_utils.h" #include "ui/native_theme/native_theme.h" #include "ui/views/background.h" #include "ui/views/controls/table/table_utils.h" #include "ui/views/controls/table/table_view.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/native_cursor.h" namespace views {
diff --git a/ui/views/controls/table/table_header.h b/ui/views/controls/table/table_header.h index a79cd242..a7e975c 100644 --- a/ui/views/controls/table/table_header.h +++ b/ui/views/controls/table/table_header.h
@@ -8,9 +8,9 @@ #include <memory> #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/font_list.h" #include "ui/views/controls/table/table_view.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/view.h" #include "ui/views/views_export.h"
diff --git a/ui/views/controls/table/table_view.cc b/ui/views/controls/table/table_view.cc index f691d19..d08a3bd1 100644 --- a/ui/views/controls/table/table_view.cc +++ b/ui/views/controls/table/table_view.cc
@@ -23,6 +23,7 @@ #include "cc/paint/paint_flags.h" #include "ui/accessibility/ax_action_data.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/rect_conversions.h" @@ -41,7 +42,6 @@ #include "ui/views/controls/table/table_utils.h" #include "ui/views/controls/table/table_view_observer.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/style/typography.h" @@ -1707,10 +1707,6 @@ return i->get(); } -DEFINE_ENUM_CONVERTERS(TableTypes, - {TableTypes::TEXT_ONLY, u"TEXT_ONLY"}, - {TableTypes::ICON_AND_TEXT, u"ICON_AND_TEXT"}) - BEGIN_METADATA(TableView, View) ADD_READONLY_PROPERTY_METADATA(int, RowCount) ADD_READONLY_PROPERTY_METADATA(int, FirstSelectedRow) @@ -1724,3 +1720,7 @@ END_METADATA } // namespace views + +DEFINE_ENUM_CONVERTERS(views::TableTypes, + {views::TableTypes::TEXT_ONLY, u"TEXT_ONLY"}, + {views::TableTypes::ICON_AND_TEXT, u"ICON_AND_TEXT"})
diff --git a/ui/views/controls/textarea/textarea.cc b/ui/views/controls/textarea/textarea.cc index de01539..b2a2947 100644 --- a/ui/views/controls/textarea/textarea.cc +++ b/ui/views/controls/textarea/textarea.cc
@@ -6,9 +6,9 @@ #include "base/logging.h" #include "ui/base/ime/text_edit_commands.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/events/keycodes/keyboard_codes.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views {
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc index 1bdee5f..c855ee6 100644 --- a/ui/views/controls/textfield/textfield.cc +++ b/ui/views/controls/textfield/textfield.cc
@@ -32,6 +32,7 @@ #include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h" #include "ui/base/ime/constants.h" #include "ui/base/ime/input_method.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_switches.h" #include "ui/base/ui_base_switches_util.h" @@ -59,7 +60,6 @@ #include "ui/views/controls/views_text_services_context_menu.h" #include "ui/views/drag_utils.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/native_cursor.h" #include "ui/views/painter.h" #include "ui/views/style/platform_style.h" @@ -2667,12 +2667,14 @@ ADD_PROPERTY_METADATA(std::u16string, Text) ADD_PROPERTY_METADATA(ui::TextInputType, TextInputType) ADD_PROPERTY_METADATA(int, TextInputFlags) -ADD_PROPERTY_METADATA(SkColor, TextColor, metadata::SkColorConverter) -ADD_PROPERTY_METADATA(SkColor, SelectionTextColor, metadata::SkColorConverter) -ADD_PROPERTY_METADATA(SkColor, BackgroundColor, metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, TextColor, ui::metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, + SelectionTextColor, + ui::metadata::SkColorConverter) +ADD_PROPERTY_METADATA(SkColor, BackgroundColor, ui::metadata::SkColorConverter) ADD_PROPERTY_METADATA(SkColor, SelectionBackgroundColor, - metadata::SkColorConverter) + ui::metadata::SkColorConverter) ADD_PROPERTY_METADATA(bool, CursorEnabled) ADD_PROPERTY_METADATA(std::u16string, PlaceholderText) ADD_PROPERTY_METADATA(bool, Invalid)
diff --git a/ui/views/controls/theme_tracking_image_view.cc b/ui/views/controls/theme_tracking_image_view.cc index 18895f66..660ce10 100644 --- a/ui/views/controls/theme_tracking_image_view.cc +++ b/ui/views/controls/theme_tracking_image_view.cc
@@ -4,9 +4,9 @@ #include "ui/views/controls/theme_tracking_image_view.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_utils.h" #include "ui/native_theme/native_theme.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views {
diff --git a/ui/views/controls/throbber.cc b/ui/views/controls/throbber.cc index 924a718..8d46b6b48 100644 --- a/ui/views/controls/throbber.cc +++ b/ui/views/controls/throbber.cc
@@ -7,6 +7,7 @@ #include "base/bind.h" #include "base/location.h" #include "components/vector_icons/vector_icons.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/animation/tween.h" #include "ui/gfx/canvas.h" @@ -16,7 +17,6 @@ #include "ui/gfx/paint_vector_icon.h" #include "ui/native_theme/common_theme.h" #include "ui/native_theme/native_theme.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views {
diff --git a/ui/views/controls/tree/tree_view.cc b/ui/views/controls/tree/tree_view.cc index 08a33bc..d23eea9 100644 --- a/ui/views/controls/tree/tree_view.cc +++ b/ui/views/controls/tree/tree_view.cc
@@ -17,6 +17,7 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/ime/input_method.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/events/event.h" #include "ui/events/keycodes/keyboard_codes.h" @@ -41,7 +42,6 @@ #include "ui/views/controls/scroll_view.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/tree/tree_view_controller.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" using ui::TreeModel;
diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc index 9b312a06..cd3f3c8 100644 --- a/ui/views/controls/webview/web_dialog_view.cc +++ b/ui/views/controls/webview/web_dialog_view.cc
@@ -16,11 +16,11 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "third_party/blink/public/mojom/loader/resource_load_info.mojom.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/native_widget_private.h" #include "ui/views/widget/root_view.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/controls/webview/web_dialog_view.h b/ui/views/controls/webview/web_dialog_view.h index 8c5edd6..96896f5 100644 --- a/ui/views/controls/webview/web_dialog_view.h +++ b/ui/views/controls/webview/web_dialog_view.h
@@ -13,11 +13,11 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/geometry/size.h" #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/controls/webview/webview_export.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/window/client_view.h" #include "ui/web_dialogs/web_dialog_delegate.h"
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc index 2f4e77f..75c1f03c 100644 --- a/ui/views/controls/webview/webview.cc +++ b/ui/views/controls/webview/webview.cc
@@ -20,10 +20,10 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/platform/ax_platform_node.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/event.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/focus/focus_manager.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/views_delegate.h" namespace views {
diff --git a/ui/views/corewm/DEPS b/ui/views/corewm/DEPS index 15ef6f50..e862b12 100644 --- a/ui/views/corewm/DEPS +++ b/ui/views/corewm/DEPS
@@ -14,10 +14,10 @@ ], "tooltip_aura.cc": [ + "+ui/base/metadata/metadata_header_macros.h", + "+ui/base/metadata/metadata_impl_macros.h", "+ui/views/background.h", "+ui/views/border.h", - "+ui/views/metadata/metadata_header_macros.h", - "+ui/views/metadata/metadata_impl_macros.h", "+ui/views/painter.h", "+ui/views/widget/widget.h", "+ui/views/view.h",
diff --git a/ui/views/corewm/tooltip_aura.cc b/ui/views/corewm/tooltip_aura.cc index e99822f..22a883bf 100644 --- a/ui/views/corewm/tooltip_aura.cc +++ b/ui/views/corewm/tooltip_aura.cc
@@ -16,6 +16,8 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/gfx/canvas.h" @@ -26,8 +28,6 @@ #include "ui/native_theme/native_theme.h" #include "ui/views/background.h" #include "ui/views/border.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/painter.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/layout/box_layout_view.cc b/ui/views/layout/box_layout_view.cc index 1133609e..2291e36 100644 --- a/ui/views/layout/box_layout_view.cc +++ b/ui/views/layout/box_layout_view.cc
@@ -6,9 +6,9 @@ #include <memory> +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" #include "ui/views/layout/layout_manager.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views { @@ -133,21 +133,6 @@ InvalidateLayout(); } -DEFINE_ENUM_CONVERTERS(BoxLayout::Orientation, - {BoxLayout::Orientation::kHorizontal, u"kHorizontal"}, - {BoxLayout::Orientation::kVertical, u"kVertical"}) - -DEFINE_ENUM_CONVERTERS(BoxLayout::MainAxisAlignment, - {BoxLayout::MainAxisAlignment::kStart, u"kStart"}, - {BoxLayout::MainAxisAlignment::kCenter, u"kCenter"}, - {BoxLayout::MainAxisAlignment::kEnd, u"kEnd"}) - -DEFINE_ENUM_CONVERTERS(BoxLayout::CrossAxisAlignment, - {BoxLayout::CrossAxisAlignment::kStretch, u"kStretch"}, - {BoxLayout::CrossAxisAlignment::kStart, u"kStart"}, - {BoxLayout::CrossAxisAlignment::kCenter, u"kCenter"}, - {BoxLayout::CrossAxisAlignment::kEnd, u"kEnd"}) - BEGIN_METADATA(BoxLayoutView, View) ADD_PROPERTY_METADATA(BoxLayout::Orientation, Orientation) ADD_PROPERTY_METADATA(BoxLayout::MainAxisAlignment, MainAxisAlignment) @@ -160,3 +145,21 @@ END_METADATA } // namespace views + +DEFINE_ENUM_CONVERTERS(views::BoxLayout::Orientation, + {views::BoxLayout::Orientation::kHorizontal, + u"kHorizontal"}, + {views::BoxLayout::Orientation::kVertical, u"kVertical"}) + +DEFINE_ENUM_CONVERTERS(views::BoxLayout::MainAxisAlignment, + {views::BoxLayout::MainAxisAlignment::kStart, u"kStart"}, + {views::BoxLayout::MainAxisAlignment::kCenter, + u"kCenter"}, + {views::BoxLayout::MainAxisAlignment::kEnd, u"kEnd"}) + +DEFINE_ENUM_CONVERTERS( + views::BoxLayout::CrossAxisAlignment, + {views::BoxLayout::CrossAxisAlignment::kStretch, u"kStretch"}, + {views::BoxLayout::CrossAxisAlignment::kStart, u"kStart"}, + {views::BoxLayout::CrossAxisAlignment::kCenter, u"kCenter"}, + {views::BoxLayout::CrossAxisAlignment::kEnd, u"kEnd"})
diff --git a/ui/views/layout/box_layout_view.h b/ui/views/layout/box_layout_view.h index 36dc2ec0..9536b31 100644 --- a/ui/views/layout/box_layout_view.h +++ b/ui/views/layout/box_layout_view.h
@@ -5,8 +5,8 @@ #ifndef UI_VIEWS_LAYOUT_BOX_LAYOUT_VIEW_H_ #define UI_VIEWS_LAYOUT_BOX_LAYOUT_VIEW_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h"
diff --git a/ui/views/layout/flex_layout_view.cc b/ui/views/layout/flex_layout_view.cc index 33d9eb3..5f85086 100644 --- a/ui/views/layout/flex_layout_view.cc +++ b/ui/views/layout/flex_layout_view.cc
@@ -6,9 +6,9 @@ #include <memory> +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/flex_layout_types.h" #include "ui/views/layout/layout_types.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/metadata/type_conversion.h" namespace views { @@ -145,20 +145,6 @@ return layout_->GetDefaultFlexRule(); } -DEFINE_ENUM_CONVERTERS(LayoutOrientation, - {LayoutOrientation::kHorizontal, u"kHorizontal"}, - {LayoutOrientation::kVertical, u"kVertical"}) - -DEFINE_ENUM_CONVERTERS(LayoutAlignment, - {LayoutAlignment::kStart, u"kStart"}, - {LayoutAlignment::kCenter, u"kCenter"}, - {LayoutAlignment::kEnd, u"kEnd"}, - {LayoutAlignment::kStretch, u"kStretch"}) - -DEFINE_ENUM_CONVERTERS(FlexAllocationOrder, - {FlexAllocationOrder::kNormal, u"kNormal"}, - {FlexAllocationOrder::kReverse, u"kReverse"}) - BEGIN_METADATA(FlexLayoutView, View) ADD_PROPERTY_METADATA(LayoutOrientation, Orientation) ADD_PROPERTY_METADATA(LayoutAlignment, MainAxisAlignment) @@ -172,3 +158,17 @@ END_METADATA } // namespace views + +DEFINE_ENUM_CONVERTERS(views::LayoutOrientation, + {views::LayoutOrientation::kHorizontal, u"kHorizontal"}, + {views::LayoutOrientation::kVertical, u"kVertical"}) + +DEFINE_ENUM_CONVERTERS(views::LayoutAlignment, + {views::LayoutAlignment::kStart, u"kStart"}, + {views::LayoutAlignment::kCenter, u"kCenter"}, + {views::LayoutAlignment::kEnd, u"kEnd"}, + {views::LayoutAlignment::kStretch, u"kStretch"}) + +DEFINE_ENUM_CONVERTERS(views::FlexAllocationOrder, + {views::FlexAllocationOrder::kNormal, u"kNormal"}, + {views::FlexAllocationOrder::kReverse, u"kReverse"})
diff --git a/ui/views/layout/flex_layout_view.h b/ui/views/layout/flex_layout_view.h index 0645a5dd..d76ee9f 100644 --- a/ui/views/layout/flex_layout_view.h +++ b/ui/views/layout/flex_layout_view.h
@@ -5,9 +5,9 @@ #ifndef UI_VIEWS_LAYOUT_FLEX_LAYOUT_VIEW_H_ #define UI_VIEWS_LAYOUT_FLEX_LAYOUT_VIEW_H_ +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/flex_layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h" #include "ui/views/views_export.h"
diff --git a/ui/views/metadata/type_conversion.cc b/ui/views/metadata/type_conversion.cc index 3a7682e..e78c72c0 100644 --- a/ui/views/metadata/type_conversion.cc +++ b/ui/views/metadata/type_conversion.cc
@@ -4,632 +4,32 @@ #include "ui/views/metadata/type_conversion.h" -#include <cmath> #include <string> -#include "base/numerics/ranges.h" -#include "base/strings/string_number_conversions.h" -#include "base/strings/string_split.h" -#include "base/strings/string_tokenizer.h" -#include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" -#include "base/strings/sys_string_conversions.h" -#include "base/strings/utf_string_conversions.h" #include "components/url_formatter/url_fixer.h" -#include "third_party/skia/include/core/SkScalar.h" #include "ui/base/ime/text_input_type.h" -#include "ui/gfx/color_utils.h" -#include "ui/gfx/geometry/rect.h" #include "ui/native_theme/native_theme.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/scroll_view.h" -namespace views { -namespace metadata { - -const char kNoPrefix[] = ""; -const char kSkColorPrefix[] = "--"; - -std::u16string PointerToString(const void* pointer_val) { - return pointer_val ? u"(assigned)" : u"(not assigned)"; -} - -const std::u16string& GetNullOptStr() { - static const base::NoDestructor<std::u16string> kNullOptStr(u"<Empty>"); - return *kNullOptStr; -} - -/***** String Conversions *****/ - -#define CONVERT_NUMBER_TO_STRING(T) \ - std::u16string TypeConverter<T>::ToString(T source_value) { \ - return base::NumberToString16(source_value); \ - } - -CONVERT_NUMBER_TO_STRING(int8_t) -CONVERT_NUMBER_TO_STRING(int16_t) -CONVERT_NUMBER_TO_STRING(int32_t) -CONVERT_NUMBER_TO_STRING(int64_t) -CONVERT_NUMBER_TO_STRING(uint8_t) -CONVERT_NUMBER_TO_STRING(uint16_t) -CONVERT_NUMBER_TO_STRING(uint32_t) -CONVERT_NUMBER_TO_STRING(uint64_t) -CONVERT_NUMBER_TO_STRING(float) -CONVERT_NUMBER_TO_STRING(double) - -std::u16string TypeConverter<bool>::ToString(bool source_value) { - return source_value ? u"true" : u"false"; -} - -ValidStrings TypeConverter<bool>::GetValidStrings() { - return {u"false", u"true"}; -} - -std::u16string TypeConverter<const char*>::ToString(const char* source_value) { - return base::UTF8ToUTF16(source_value); -} - -std::u16string TypeConverter<base::FilePath>::ToString( - const base::FilePath& source_value) { - return source_value.AsUTF16Unsafe(); -} - -std::u16string TypeConverter<std::u16string>::ToString( - const std::u16string& source_value) { - return source_value; -} - -std::u16string TypeConverter<base::TimeDelta>::ToString( - const base::TimeDelta& source_value) { - return base::NumberToString16(source_value.InSecondsF()) + u"s"; -} - -std::u16string TypeConverter<gfx::Insets>::ToString( - const gfx::Insets& source_value) { - return base::ASCIIToUTF16(source_value.ToString()); -} - -std::u16string TypeConverter<gfx::Point>::ToString( - const gfx::Point& source_value) { - return base::ASCIIToUTF16(source_value.ToString()); -} - -std::u16string TypeConverter<gfx::PointF>::ToString( - const gfx::PointF& source_value) { - return base::ASCIIToUTF16(source_value.ToString()); -} - -std::u16string TypeConverter<gfx::Range>::ToString( - const gfx::Range& source_value) { - return base::ASCIIToUTF16(source_value.ToString()); -} - -std::u16string TypeConverter<gfx::Rect>::ToString( - const gfx::Rect& source_value) { - return base::ASCIIToUTF16(source_value.ToString()); -} - -std::u16string TypeConverter<gfx::RectF>::ToString( - const gfx::RectF& source_value) { - return base::ASCIIToUTF16(source_value.ToString()); -} - -std::u16string TypeConverter<gfx::ShadowValues>::ToString( - const gfx::ShadowValues& source_value) { - std::u16string ret = u"["; - for (auto shadow_value : source_value) { - ret += u" " + base::ASCIIToUTF16(shadow_value.ToString()) + u";"; - } - - ret[ret.length() - 1] = ' '; - ret += u"]"; - return ret; -} - -std::u16string TypeConverter<gfx::Size>::ToString( - const gfx::Size& source_value) { - return base::ASCIIToUTF16(source_value.ToString()); -} - -std::u16string TypeConverter<gfx::SizeF>::ToString( - const gfx::SizeF& source_value) { - return base::ASCIIToUTF16(source_value.ToString()); -} - -std::u16string TypeConverter<GURL>::ToString(const GURL& source_value) { +std::u16string ui::metadata::TypeConverter<GURL>::ToString( + const GURL& source_value) { return base::ASCIIToUTF16(source_value.possibly_invalid_spec()); } -std::u16string TypeConverter<url::Component>::ToString( - const url::Component& source_value) { - return base::ASCIIToUTF16( - base::StringPrintf("{%d,%d}", source_value.begin, source_value.len)); -} - -base::Optional<int8_t> TypeConverter<int8_t>::FromString( - const std::u16string& source_value) { - int32_t ret = 0; - if (base::StringToInt(source_value, &ret) && - base::IsValueInRangeForNumericType<int8_t>(ret)) { - return static_cast<int8_t>(ret); - } - return base::nullopt; -} - -base::Optional<int16_t> TypeConverter<int16_t>::FromString( - const std::u16string& source_value) { - int32_t ret = 0; - if (base::StringToInt(source_value, &ret) && - base::IsValueInRangeForNumericType<int16_t>(ret)) { - return static_cast<int16_t>(ret); - } - return base::nullopt; -} - -base::Optional<int32_t> TypeConverter<int32_t>::FromString( - const std::u16string& source_value) { - int value; - return base::StringToInt(source_value, &value) ? base::make_optional(value) - : base::nullopt; -} - -base::Optional<int64_t> TypeConverter<int64_t>::FromString( - const std::u16string& source_value) { - int64_t value; - return base::StringToInt64(source_value, &value) ? base::make_optional(value) - : base::nullopt; -} - -base::Optional<uint8_t> TypeConverter<uint8_t>::FromString( - const std::u16string& source_value) { - unsigned ret = 0; - if (base::StringToUint(source_value, &ret) && - base::IsValueInRangeForNumericType<uint8_t>(ret)) { - return static_cast<uint8_t>(ret); - } - return base::nullopt; -} - -base::Optional<uint16_t> TypeConverter<uint16_t>::FromString( - const std::u16string& source_value) { - unsigned ret = 0; - if (base::StringToUint(source_value, &ret) && - base::IsValueInRangeForNumericType<uint16_t>(ret)) { - return static_cast<uint16_t>(ret); - } - return base::nullopt; -} - -base::Optional<uint32_t> TypeConverter<uint32_t>::FromString( - const std::u16string& source_value) { - unsigned value; - return base::StringToUint(source_value, &value) ? base::make_optional(value) - : base::nullopt; -} - -base::Optional<uint64_t> TypeConverter<uint64_t>::FromString( - const std::u16string& source_value) { - uint64_t value; - return base::StringToUint64(source_value, &value) ? base::make_optional(value) - : base::nullopt; -} - -base::Optional<float> TypeConverter<float>::FromString( - const std::u16string& source_value) { - if (base::Optional<double> temp = - TypeConverter<double>::FromString(source_value)) - return static_cast<float>(temp.value()); - return base::nullopt; -} - -base::Optional<double> TypeConverter<double>::FromString( - const std::u16string& source_value) { - double value; - return base::StringToDouble(base::UTF16ToUTF8(source_value), &value) - ? base::make_optional(value) - : base::nullopt; -} - -base::Optional<bool> TypeConverter<bool>::FromString( - const std::u16string& source_value) { - const bool is_true = source_value == u"true"; - if (is_true || source_value == u"false") - return is_true; - return base::nullopt; -} - -base::Optional<std::u16string> TypeConverter<std::u16string>::FromString( - const std::u16string& source_value) { - return source_value; -} - -base::Optional<base::FilePath> TypeConverter<base::FilePath>::FromString( - const std::u16string& source_value) { - return base::FilePath::FromUTF16Unsafe(source_value); -} - -base::Optional<base::TimeDelta> TypeConverter<base::TimeDelta>::FromString( - const std::u16string& source_value) { - std::string source = base::UTF16ToUTF8(source_value); - return base::TimeDelta::FromString(source); -} - -base::Optional<gfx::Insets> TypeConverter<gfx::Insets>::FromString( - const std::u16string& source_value) { - const auto values = base::SplitStringPiece( - source_value, u",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - int top, left, bottom, right; - if ((values.size() == 4) && base::StringToInt(values[0], &top) && - base::StringToInt(values[1], &left) && - base::StringToInt(values[2], &bottom) && - base::StringToInt(values[3], &right)) { - return gfx::Insets(top, left, bottom, right); - } - return base::nullopt; -} - -base::Optional<gfx::Point> TypeConverter<gfx::Point>::FromString( - const std::u16string& source_value) { - const auto values = base::SplitStringPiece( - source_value, u",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - int x, y; - if ((values.size() == 2) && base::StringToInt(values[0], &x) && - base::StringToInt(values[1], &y)) { - return gfx::Point(x, y); - } - return base::nullopt; -} - -base::Optional<gfx::PointF> TypeConverter<gfx::PointF>::FromString( - const std::u16string& source_value) { - const auto values = base::SplitStringPiece( - source_value, u",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - double x, y; - if ((values.size() == 2) && base::StringToDouble(values[0], &x) && - base::StringToDouble(values[1], &y)) { - return gfx::PointF(x, y); - } - return base::nullopt; -} - -base::Optional<gfx::Range> TypeConverter<gfx::Range>::FromString( - const std::u16string& source_value) { - const auto values = base::SplitStringPiece( - source_value, u"{,}", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - unsigned min, max; - if ((values.size() == 2) && base::StringToUint(values[0], &min) && - base::StringToUint(values[1], &max)) { - return gfx::Range(min, max); - } - return base::nullopt; -} - -base::Optional<gfx::Rect> TypeConverter<gfx::Rect>::FromString( - const std::u16string& source_value) { - const auto values = base::SplitString( - source_value, u" ", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - if (values.size() != 2) - return base::nullopt; - const base::Optional<gfx::Point> origin = - TypeConverter<gfx::Point>::FromString(values[0]); - const base::Optional<gfx::Size> size = - TypeConverter<gfx::Size>::FromString(values[1]); - if (origin && size) - return gfx::Rect(*origin, *size); - return base::nullopt; -} - -base::Optional<gfx::RectF> TypeConverter<gfx::RectF>::FromString( - const std::u16string& source_value) { - const auto values = base::SplitString( - source_value, u" ", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - if (values.size() != 2) - return base::nullopt; - const base::Optional<gfx::PointF> origin = - TypeConverter<gfx::PointF>::FromString(values[0]); - const base::Optional<gfx::SizeF> size = - TypeConverter<gfx::SizeF>::FromString(values[1]); - if (origin && size) - return gfx::RectF(*origin, *size); - return base::nullopt; -} - -base::Optional<gfx::ShadowValues> TypeConverter<gfx::ShadowValues>::FromString( - const std::u16string& source_value) { - gfx::ShadowValues ret; - const auto shadow_value_strings = base::SplitStringPiece( - source_value, u"[;]", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - - for (auto v : shadow_value_strings) { - std::u16string value = std::u16string(v); - base::String16Tokenizer tokenizer( - value, u"(,)", base::String16Tokenizer::WhitespacePolicy::kSkipOver); - tokenizer.set_options(base::String16Tokenizer::RETURN_DELIMS); - int x, y; - double blur; - if (tokenizer.GetNext() && tokenizer.token_piece() == u"(" && - tokenizer.GetNext() && base::StringToInt(tokenizer.token_piece(), &x) && - tokenizer.GetNext() && tokenizer.token_piece() == u"," && - tokenizer.GetNext() && base::StringToInt(tokenizer.token_piece(), &y) && - tokenizer.GetNext() && tokenizer.token_piece() == u")" && - tokenizer.GetNext() && tokenizer.token_piece() == u"," && - tokenizer.GetNext() && - base::StringToDouble(tokenizer.token_piece(), &blur) && - tokenizer.GetNext() && tokenizer.token_piece() == u"," && - tokenizer.GetNext()) { - const auto color = - SkColorConverter::GetNextColor(tokenizer.token_begin(), value.cend()); - if (color) - ret.emplace_back(gfx::Vector2d(x, y), blur, color.value()); - } - } - return ret; -} - -base::Optional<gfx::Size> TypeConverter<gfx::Size>::FromString( - const std::u16string& source_value) { - const auto values = base::SplitStringPiece( - source_value, u"x", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - int width, height; - if ((values.size() == 2) && base::StringToInt(values[0], &width) && - base::StringToInt(values[1], &height)) { - return gfx::Size(width, height); - } - return base::nullopt; -} - -base::Optional<gfx::SizeF> TypeConverter<gfx::SizeF>::FromString( - const std::u16string& source_value) { - const auto values = base::SplitStringPiece( - source_value, u"x", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - double width, height; - if ((values.size() == 2) && base::StringToDouble(values[0], &width) && - base::StringToDouble(values[1], &height)) { - return gfx::SizeF(width, height); - } - return base::nullopt; -} - -base::Optional<GURL> TypeConverter<GURL>::FromString( +base::Optional<GURL> ui::metadata::TypeConverter<GURL>::FromString( const std::u16string& source_value) { const GURL url = url_formatter::FixupURL(base::UTF16ToUTF8(source_value), std::string()); return url.is_valid() ? base::make_optional(url) : base::nullopt; } -base::Optional<url::Component> TypeConverter<url::Component>::FromString( - const std::u16string& source_value) { - const auto values = base::SplitStringPiece( - source_value, u"{,}", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - int begin, len; - if ((values.size() == 2) && base::StringToInt(values[0], &begin) && - base::StringToInt(values[1], &len) && len >= -1) { - return url::Component(begin, len); - } - return base::nullopt; -} - -std::u16string TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::ToString( - SkColor source_value) { - return base::UTF8ToUTF16(color_utils::SkColorToRgbaString(source_value)); -} - -base::Optional<SkColor> TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::FromString( - const std::u16string& source_value) { - return GetNextColor(source_value.cbegin(), source_value.cend()); -} - -ValidStrings TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::GetValidStrings() { +ui::metadata::ValidStrings +ui::metadata::TypeConverter<GURL>::GetValidStrings() { return {}; } -bool TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::GetNextColor( - std::u16string::const_iterator start, - std::u16string::const_iterator end, - std::u16string& color, - std::u16string::const_iterator& next_token) { - static const auto open_paren = u'('; - static const auto close_paren = u')'; - static const std::vector<std::u16string> schemes = {u"hsl", u"hsla", u"rgb", - u"rgba"}; - base::String16Tokenizer tokenizer( - start, end, u"(,)", base::String16Tokenizer::WhitespacePolicy::kSkipOver); - tokenizer.set_options(base::String16Tokenizer::RETURN_DELIMS); - for (; tokenizer.GetNext();) { - if (!tokenizer.token_is_delim()) { - base::StringPiece16 token = tokenizer.token_piece(); - std::u16string::const_iterator start_color = tokenizer.token_begin(); - if (base::ranges::find(schemes.begin(), schemes.end(), token) != - schemes.end()) { - if (!tokenizer.GetNext() || *tokenizer.token_begin() != open_paren) - return false; - for (; - tokenizer.GetNext() && *tokenizer.token_begin() != close_paren;) { - } - if (*tokenizer.token_begin() != close_paren) - return false; - } - next_token = tokenizer.token_end(); - color = std::u16string(start_color, next_token); - return true; - } - } - return false; -} - -bool TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::GetNextColor( - std::u16string::const_iterator start, - std::u16string::const_iterator end, - std::u16string& color) { - std::u16string::const_iterator next_token; - return GetNextColor(start, end, color, next_token); -} - -base::Optional<SkColor> TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::GetNextColor( - std::u16string::const_iterator start, - std::u16string::const_iterator end, - std::u16string::const_iterator& next_token) { - std::u16string color; - if (GetNextColor(start, end, color, next_token)) { - if (base::StartsWith(color, u"hsl", base::CompareCase::SENSITIVE)) - return ParseHslString(color); - if (base::StartsWith(color, u"rgb", base::CompareCase::SENSITIVE)) - return ParseRgbString(color); - if (base::StartsWith(color, u"0x", base::CompareCase::INSENSITIVE_ASCII)) - return ParseHexString(color); - SkColor value; - if (base::StringToUint(color, &value)) - return base::make_optional(value); - } - return base::nullopt; -} - -base::Optional<SkColor> TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::GetNextColor( - std::u16string::const_iterator start, - std::u16string::const_iterator end) { - std::u16string::const_iterator next_token; - return GetNextColor(start, end, next_token); -} - -base::Optional<SkColor> -TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::RgbaPiecesToSkColor( - const std::vector<base::StringPiece16>& pieces, - size_t start_piece) { - int r, g, b; - double a; - return ((pieces.size() >= start_piece + 4) && - base::StringToInt(pieces[start_piece], &r) && - base::IsValueInRangeForNumericType<uint8_t>(r) && - base::StringToInt(pieces[start_piece + 1], &g) && - base::IsValueInRangeForNumericType<uint8_t>(g) && - base::StringToInt(pieces[start_piece + 2], &b) && - base::IsValueInRangeForNumericType<uint8_t>(b) && - base::StringToDouble(pieces[start_piece + 3], &a) && a >= 0.0 && - a <= 1.0) - ? base::make_optional(SkColorSetARGB( - base::ClampRound<SkAlpha>(a * SK_AlphaOPAQUE), r, g, b)) - : base::nullopt; -} - -base::Optional<SkColor> -TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::ParseHexString( - const std::u16string& hex_string) { - SkColor value; - if (base::HexStringToUInt(base::UTF16ToUTF8(hex_string), &value)) { - // Add in a 1.0 alpha channel if it wasn't included in the input. - if (hex_string.length() <= 8) - value = SkColorSetA(value, 0xFF); - return base::make_optional(value); - } - return base::nullopt; -} - -base::Optional<SkColor> -TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::ParseHslString( - const std::u16string& hsl_string) { - std::u16string pruned_string; - base::RemoveChars(hsl_string, u"(%)hsla", &pruned_string); - const auto values = base::SplitStringPiece( - pruned_string, u", ", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - double h, s, v; - double a = 1.0; - if (values.size() >= 3 && values.size() <= 4 && - base::StringToDouble(values[0], &h) && - base::StringToDouble(values[1], &s) && - base::StringToDouble(values[2], &v) && - (values.size() == 3 || - (base::StringToDouble(values[3], &a) && a >= 0.0 && a <= 1.0))) { - SkScalar hsv[3]; - hsv[0] = base::ClampToRange(std::fmod(h, 360.0), 0.0, 360.0); - hsv[1] = s > 1.0 ? base::ClampToRange(s, 0.0, 100.0) / 100.0 - : base::ClampToRange(s, 0.0, 1.0); - hsv[2] = v > 1.0 ? base::ClampToRange(v, 0.0, 100.0) / 100.0 - : base::ClampToRange(v, 0.0, 1.0); - return base::make_optional( - SkHSVToColor(base::ClampRound<SkAlpha>(a * SK_AlphaOPAQUE), hsv)); - } - return base::nullopt; -} - -base::Optional<SkColor> -TypeConverter<UNIQUE_TYPE_NAME(SkColor)>::ParseRgbString( - const std::u16string& rgb_string) { - // Declare a constant string here for use below since it might trigger an - // ASAN error due to the stack temp going out of scope before the call to - // RgbaPiecesToSkColor. - std::u16string pruned_string; - base::RemoveChars(rgb_string, u"()rgba", &pruned_string); - auto values = base::SplitStringPiece( - pruned_string, u", ", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); - // if it was just an rgb string, add the 1.0 alpha - if (values.size() == 3) - values.push_back(u"1.0"); - return RgbaPiecesToSkColor(values, 0); -} - -} // namespace metadata -} // namespace views - -DEFINE_ENUM_CONVERTERS(gfx::HorizontalAlignment, - {gfx::HorizontalAlignment::ALIGN_LEFT, u"ALIGN_LEFT"}, - {gfx::HorizontalAlignment::ALIGN_CENTER, - u"ALIGN_CENTER"}, - {gfx::HorizontalAlignment::ALIGN_RIGHT, u"ALIGN_RIGHT"}, - {gfx::HorizontalAlignment::ALIGN_TO_HEAD, - u"ALIGN_TO_HEAD"}) - -DEFINE_ENUM_CONVERTERS(gfx::VerticalAlignment, - {gfx::VerticalAlignment::ALIGN_TOP, u"ALIGN_TOP"}, - {gfx::VerticalAlignment::ALIGN_MIDDLE, u"ALIGN_MIDDLE"}, - {gfx::VerticalAlignment::ALIGN_BOTTOM, u"ALIGN_BOTTOM"}) - -DEFINE_ENUM_CONVERTERS(gfx::ElideBehavior, - {gfx::ElideBehavior::NO_ELIDE, u"NO_ELIDE"}, - {gfx::ElideBehavior::TRUNCATE, u"TRUNCATE"}, - {gfx::ElideBehavior::ELIDE_HEAD, u"ELIDE_HEAD"}, - {gfx::ElideBehavior::ELIDE_MIDDLE, u"ELIDE_MIDDLE"}, - {gfx::ElideBehavior::ELIDE_TAIL, u"ELIDE_TAIL"}, - {gfx::ElideBehavior::ELIDE_EMAIL, u"ELIDE_EMAIL"}, - {gfx::ElideBehavior::FADE_TAIL, u"FADE_TAIL"}) - -DEFINE_ENUM_CONVERTERS( - ui::TextInputType, - {ui::TextInputType::TEXT_INPUT_TYPE_NONE, u"TEXT_INPUT_TYPE_NONE"}, - {ui::TextInputType::TEXT_INPUT_TYPE_TEXT, u"TEXT_INPUT_TYPE_TEXT"}, - {ui::TextInputType::TEXT_INPUT_TYPE_PASSWORD, u"TEXT_INPUT_TYPE_PASSWORD"}, - {ui::TextInputType::TEXT_INPUT_TYPE_SEARCH, u"TEXT_INPUT_TYPE_SEARCH"}, - {ui::TextInputType::TEXT_INPUT_TYPE_EMAIL, u"EXT_INPUT_TYPE_EMAIL"}, - {ui::TextInputType::TEXT_INPUT_TYPE_NUMBER, u"TEXT_INPUT_TYPE_NUMBER"}, - {ui::TextInputType::TEXT_INPUT_TYPE_TELEPHONE, - u"TEXT_INPUT_TYPE_TELEPHONE"}, - {ui::TextInputType::TEXT_INPUT_TYPE_URL, u"TEXT_INPUT_TYPE_URL"}, - {ui::TextInputType::TEXT_INPUT_TYPE_DATE, u"TEXT_INPUT_TYPE_DATE"}, - {ui::TextInputType::TEXT_INPUT_TYPE_DATE_TIME, - u"TEXT_INPUT_TYPE_DATE_TIME"}, - {ui::TextInputType::TEXT_INPUT_TYPE_DATE_TIME_LOCAL, - u"TEXT_INPUT_TYPE_DATE_TIME_LOCAL"}, - {ui::TextInputType::TEXT_INPUT_TYPE_MONTH, u"TEXT_INPUT_TYPE_MONTH"}, - {ui::TextInputType::TEXT_INPUT_TYPE_TIME, u"TEXT_INPUT_TYPE_TIME"}, - {ui::TextInputType::TEXT_INPUT_TYPE_WEEK, u"TEXT_INPUT_TYPE_WEEK"}, - {ui::TextInputType::TEXT_INPUT_TYPE_TEXT_AREA, - u"TEXT_INPUT_TYPE_TEXT_AREA"}, - {ui::TextInputType::TEXT_INPUT_TYPE_CONTENT_EDITABLE, - u"TEXT_INPUT_TYPE_CONTENT_EDITABLE"}, - {ui::TextInputType::TEXT_INPUT_TYPE_DATE_TIME_FIELD, - u"TEXT_INPUT_TYPE_DATE_TIME_FIELD"}, - {ui::TextInputType::TEXT_INPUT_TYPE_NULL, u"TEXT_INPUT_TYPE_NULL"}) - -DEFINE_ENUM_CONVERTERS( - ui::MenuSeparatorType, - {ui::MenuSeparatorType::NORMAL_SEPARATOR, u"NORMAL_SEPARATOR"}, - {ui::MenuSeparatorType::DOUBLE_SEPARATOR, u"DOUBLE_SEPARATOR"}, - {ui::MenuSeparatorType::UPPER_SEPARATOR, u"UPPER_SEPARATOR"}, - {ui::MenuSeparatorType::LOWER_SEPARATOR, u"LOWER_SEPARATOR"}, - {ui::MenuSeparatorType::SPACING_SEPARATOR, u"SPACING_SEPARATOR"}, - {ui::MenuSeparatorType::VERTICAL_SEPARATOR, u"VERTICAL_SEPARATOR"}, - {ui::MenuSeparatorType::PADDED_SEPARATOR, u"PADDED_SEPARATOR"}) - DEFINE_ENUM_CONVERTERS( views::ScrollView::ScrollBarMode, {views::ScrollView::ScrollBarMode::kDisabled, u"kDisabled"}, @@ -658,6 +58,33 @@ {views::BubbleBorder::Arrow::NONE, u"NONE"}, {views::BubbleBorder::Arrow::FLOAT, u"FLOAT"}) +DEFINE_ENUM_CONVERTERS( + ui::TextInputType, + {ui::TextInputType::TEXT_INPUT_TYPE_NONE, u"TEXT_INPUT_TYPE_NONE"}, + {ui::TextInputType::TEXT_INPUT_TYPE_TEXT, u"TEXT_INPUT_TYPE_TEXT"}, + {ui::TextInputType::TEXT_INPUT_TYPE_PASSWORD, u"TEXT_INPUT_TYPE_PASSWORD"}, + {ui::TextInputType::TEXT_INPUT_TYPE_SEARCH, u"TEXT_INPUT_TYPE_SEARCH"}, + {ui::TextInputType::TEXT_INPUT_TYPE_EMAIL, u"EXT_INPUT_TYPE_EMAIL"}, + {ui::TextInputType::TEXT_INPUT_TYPE_NUMBER, u"TEXT_INPUT_TYPE_NUMBER"}, + {ui::TextInputType::TEXT_INPUT_TYPE_TELEPHONE, + u"TEXT_INPUT_TYPE_TELEPHONE"}, + {ui::TextInputType::TEXT_INPUT_TYPE_URL, u"TEXT_INPUT_TYPE_URL"}, + {ui::TextInputType::TEXT_INPUT_TYPE_DATE, u"TEXT_INPUT_TYPE_DATE"}, + {ui::TextInputType::TEXT_INPUT_TYPE_DATE_TIME, + u"TEXT_INPUT_TYPE_DATE_TIME"}, + {ui::TextInputType::TEXT_INPUT_TYPE_DATE_TIME_LOCAL, + u"TEXT_INPUT_TYPE_DATE_TIME_LOCAL"}, + {ui::TextInputType::TEXT_INPUT_TYPE_MONTH, u"TEXT_INPUT_TYPE_MONTH"}, + {ui::TextInputType::TEXT_INPUT_TYPE_TIME, u"TEXT_INPUT_TYPE_TIME"}, + {ui::TextInputType::TEXT_INPUT_TYPE_WEEK, u"TEXT_INPUT_TYPE_WEEK"}, + {ui::TextInputType::TEXT_INPUT_TYPE_TEXT_AREA, + u"TEXT_INPUT_TYPE_TEXT_AREA"}, + {ui::TextInputType::TEXT_INPUT_TYPE_CONTENT_EDITABLE, + u"TEXT_INPUT_TYPE_CONTENT_EDITABLE"}, + {ui::TextInputType::TEXT_INPUT_TYPE_DATE_TIME_FIELD, + u"TEXT_INPUT_TYPE_DATE_TIME_FIELD"}, + {ui::TextInputType::TEXT_INPUT_TYPE_NULL, u"TEXT_INPUT_TYPE_NULL"}) + #define OP(enum_name) \ { ui::NativeTheme::enum_name, u## #enum_name } DEFINE_ENUM_CONVERTERS(ui::NativeTheme::ColorId, NATIVE_THEME_COLOR_IDS)
diff --git a/ui/views/metadata/type_conversion.h b/ui/views/metadata/type_conversion.h index 65b7f0a..7cc09309 100644 --- a/ui/views/metadata/type_conversion.h +++ b/ui/views/metadata/type_conversion.h
@@ -5,343 +5,16 @@ #ifndef UI_VIEWS_METADATA_TYPE_CONVERSION_H_ #define UI_VIEWS_METADATA_TYPE_CONVERSION_H_ -#include <stdint.h> - -#include <algorithm> // Silence broken lint check -#include <memory> -#include <string> -#include <utility> -#include <vector> - -#include "base/containers/fixed_flat_map.h" -#include "base/files/file_path.h" -#include "base/optional.h" -#include "base/ranges/algorithm.h" -#include "base/ranges/ranges.h" -#include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" -#include "base/strings/string_split.h" -#include "base/strings/string_util.h" -#include "base/strings/sys_string_conversions.h" -#include "base/strings/utf_string_conversions.h" -#include "base/time/time.h" -#include "third_party/skia/include/core/SkColor.h" -#include "ui/gfx/geometry/insets.h" -#include "ui/gfx/geometry/point.h" -#include "ui/gfx/geometry/point_f.h" -#include "ui/gfx/geometry/rect.h" -#include "ui/gfx/geometry/rect_f.h" -#include "ui/gfx/geometry/size.h" -#include "ui/gfx/geometry/size_f.h" -#include "ui/gfx/range/range.h" -#include "ui/gfx/shadow_value.h" -#include "ui/gfx/text_constants.h" +#include "ui/base/metadata/base_type_conversion.h" #include "ui/views/views_export.h" #include "url/gurl.h" -#include "url/third_party/mozilla/url_parse.h" - -namespace views { -namespace metadata { - -using ValidStrings = std::vector<std::u16string>; - -// Various metadata methods pass types either by value or const ref depending on -// whether the types are "small" (defined as "fundamental, enum, or pointer"). -// ArgType<T> gives the appropriate type to use as an argument in such cases. -template <typename T> -using ArgType = - typename std::conditional<std::is_fundamental<T>::value || - std::is_enum<T>::value || - std::is_pointer<T>::value || - (std::is_move_assignable<T>::value && - std::is_move_constructible<T>::value && - !std::is_copy_assignable<T>::value && - !std::is_copy_constructible<T>::value), - T, - const T&>::type; - -VIEWS_EXPORT extern const char kNoPrefix[]; -VIEWS_EXPORT extern const char kSkColorPrefix[]; - -// General Type Conversion Template Functions --------------------------------- -template <bool serializable, - bool read_only = false, - const char* name_prefix = kNoPrefix> -struct BaseTypeConverter { - static constexpr bool is_serializable = serializable; - static constexpr bool is_read_only = read_only; - static bool IsSerializable() { return is_serializable; } - static bool IsReadOnly() { return is_read_only; } - static const char* PropertyNamePrefix() { return name_prefix; } -}; - -template <typename T> -struct TypeConverter : BaseTypeConverter<std::is_enum<T>::value> { - static std::u16string ToString(ArgType<T> source_value); - static base::Optional<T> FromString(const std::u16string& source_value); - static ValidStrings GetValidStrings(); -}; - -// The following definitions and macros are needed only in cases where a type -// is a mere alias to a POD type AND a specialized type converter is also needed -// to handle different the string conversions different from the existing POD -// type converter. See SkColor below as an example of their use. -// NOTE: This should be a rare occurrence and if possible use a unique type and -// a TypeConverter specialization based on that unique type. - -template <typename T, typename K> -struct Uniquifier { - using type = T; - using tag = K; -}; - -#define MAKE_TYPE_UNIQUE(type_name) \ - struct type_name##Tag {}; \ - using type_name##Unique = \ - ::views::metadata::Uniquifier<type_name, type_name##Tag> - -#define _UNIQUE_TYPE_NAME1(type_name) type_name##Unique - -#define _UNIQUE_TYPE_NAME2(qualifier, type_name) qualifier::type_name##Unique - -#define _GET_TYPE_MACRO(_1, _2, NAME, ...) NAME - -#define UNIQUE_TYPE_NAME(name, ...) \ - _GET_TYPE_MACRO(name, ##__VA_ARGS__, _UNIQUE_TYPE_NAME2, _UNIQUE_TYPE_NAME1) \ - (name, ##__VA_ARGS__) - -// Types and macros for generating enum converters ---------------------------- -template <typename T> -struct EnumStringsMap; - -// Generate the code to define a enum type to and from std::u16string -// conversions. The first argument is the type T, and the rest of the argument -// should have the enum value and string pairs defined in a format like -// "{enum_value0, string16_value0}, {enum_value1, string16_value1} ...". -// Both enum_values and string16_values need to be compile time constants. -#define DEFINE_ENUM_CONVERTERS(T, ...) \ - template <> \ - struct views::metadata::EnumStringsMap<T> { \ - static_assert(std::is_enum<T>::value, "Error: " #T " is not an enum."); \ - \ - static const auto& Get() { \ - static constexpr auto kMap = \ - base::MakeFixedFlatMap<T, base::StringPiece16>({__VA_ARGS__}); \ - return kMap; \ - } \ - }; \ - \ - template <> \ - std::u16string views::metadata::TypeConverter<T>::ToString( \ - ArgType<T> source_value) { \ - const auto& map = EnumStringsMap<T>::Get(); \ - auto* it = map.find(source_value); \ - return it != map.end() ? std::u16string(it->second) : std::u16string(); \ - } \ - \ - template <> \ - base::Optional<T> views::metadata::TypeConverter<T>::FromString( \ - const std::u16string& str) { \ - const auto& map = EnumStringsMap<T>::Get(); \ - using Pair = base::ranges::range_value_t<decltype(map)>; \ - auto* it = base::ranges::find(map, str, &Pair::second); \ - return it != map.end() ? base::make_optional(it->first) : base::nullopt; \ - } \ - \ - template <> \ - views::metadata::ValidStrings \ - views::metadata::TypeConverter<T>::GetValidStrings() { \ - ValidStrings string_values; \ - base::ranges::transform( \ - EnumStringsMap<T>::Get(), std::back_inserter(string_values), \ - [](const auto& pair) { return std::u16string(pair.second); }); \ - return string_values; \ - } - -// String Conversions --------------------------------------------------------- - -VIEWS_EXPORT std::u16string PointerToString(const void* pointer_val); - -#define DECLARE_CONVERSIONS(T) \ - template <> \ - struct VIEWS_EXPORT TypeConverter<T> : BaseTypeConverter<true> { \ - static std::u16string ToString(ArgType<T> source_value); \ - static base::Optional<T> FromString(const std::u16string& source_value); \ - static ValidStrings GetValidStrings() { return {}; } \ - }; - -DECLARE_CONVERSIONS(int8_t) -DECLARE_CONVERSIONS(int16_t) -DECLARE_CONVERSIONS(int32_t) -DECLARE_CONVERSIONS(int64_t) -DECLARE_CONVERSIONS(uint8_t) -DECLARE_CONVERSIONS(uint16_t) -DECLARE_CONVERSIONS(uint32_t) -DECLARE_CONVERSIONS(uint64_t) -DECLARE_CONVERSIONS(float) -DECLARE_CONVERSIONS(double) -DECLARE_CONVERSIONS(const char*) -DECLARE_CONVERSIONS(base::FilePath) -DECLARE_CONVERSIONS(std::u16string) -DECLARE_CONVERSIONS(base::TimeDelta) -DECLARE_CONVERSIONS(gfx::Insets) -DECLARE_CONVERSIONS(gfx::Point) -DECLARE_CONVERSIONS(gfx::PointF) -DECLARE_CONVERSIONS(gfx::Range) -DECLARE_CONVERSIONS(gfx::Rect) -DECLARE_CONVERSIONS(gfx::RectF) -DECLARE_CONVERSIONS(gfx::ShadowValues) -DECLARE_CONVERSIONS(gfx::Size) -DECLARE_CONVERSIONS(gfx::SizeF) -DECLARE_CONVERSIONS(GURL) -DECLARE_CONVERSIONS(url::Component) - -#undef DECLARE_CONVERSIONS template <> -struct VIEWS_EXPORT TypeConverter<bool> : BaseTypeConverter<true> { - static std::u16string ToString(bool source_value); - static base::Optional<bool> FromString(const std::u16string& source_value); - static ValidStrings GetValidStrings(); +struct VIEWS_EXPORT ui::metadata::TypeConverter<GURL> + : BaseTypeConverter<true> { + static std::u16string ToString(const GURL& source_value); + static base::Optional<GURL> FromString(const std::u16string& source_value); + static ui::metadata::ValidStrings GetValidStrings(); }; -// Special conversions for wrapper types -------------------------------------- - -VIEWS_EXPORT const std::u16string& GetNullOptStr(); - -template <typename T> -struct TypeConverter<base::Optional<T>> - : BaseTypeConverter<TypeConverter<T>::is_serializable> { - static std::u16string ToString(ArgType<base::Optional<T>> source_value) { - if (!source_value) - return GetNullOptStr(); - return TypeConverter<T>::ToString(source_value.value()); - } - static base::Optional<base::Optional<T>> FromString( - const std::u16string& source_value) { - if (source_value == GetNullOptStr()) - return base::make_optional<base::Optional<T>>(base::nullopt); - - auto ret = TypeConverter<T>::FromString(source_value); - return ret ? base::make_optional(ret) : base::nullopt; - } - static ValidStrings GetValidStrings() { return {}; } -}; - -// Special Conversions for std:unique_ptr<T> and T* types ---------------------- - -template <typename T> -struct TypeConverter<std::unique_ptr<T>> : BaseTypeConverter<false, true> { - static std::u16string ToString(const std::unique_ptr<T>& source_value) { - return PointerToString(source_value.get()); - } - static std::u16string ToString(const T* source_value) { - return PointerToString(source_value); - } - static base::Optional<std::unique_ptr<T>> FromString( - const std::u16string& source_value) { - DCHECK(false) << "Type converter cannot convert from string."; - return base::nullopt; - } - static ValidStrings GetValidStrings() { return {}; } -}; - -template <typename T> -struct TypeConverter<T*> : BaseTypeConverter<false, true> { - static std::u16string ToString(ArgType<T*> source_value) { - return PointerToString(source_value); - } - static base::Optional<T*> FromString(const std::u16string& source_value) { - DCHECK(false) << "Type converter cannot convert from string."; - return base::nullopt; - } - static ValidStrings GetValidStrings() { return {}; } -}; - -template <typename T> -struct TypeConverter<std::vector<T>> - : BaseTypeConverter<TypeConverter<T>::is_serializable> { - static std::u16string ToString(ArgType<std::vector<T>> source_value) { - std::vector<std::u16string> serialized; - base::ranges::transform(source_value, std::back_inserter(serialized), - &TypeConverter<T>::ToString); - return u"{" + base::JoinString(serialized, u",") + u"}"; - } - static base::Optional<std::vector<T>> FromString( - const std::u16string& source_value) { - if (source_value.empty() || source_value.front() != u'{' || - source_value.back() != u'}') - return base::nullopt; - const auto values = - base::SplitString(source_value.substr(1, source_value.length() - 2), - u",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - std::vector<T> output; - for (const auto& value : values) { - auto ret = TypeConverter<T>::FromString(value); - if (!ret) - return base::nullopt; - output.push_back(*ret); - } - return base::make_optional(output); - } - static ValidStrings GetValidStrings() { return {}; } -}; - -MAKE_TYPE_UNIQUE(SkColor); - -template <> -struct VIEWS_EXPORT TypeConverter<UNIQUE_TYPE_NAME(SkColor)> - : BaseTypeConverter<true, false, kSkColorPrefix> { - static std::u16string ToString(SkColor source_value); - static base::Optional<SkColor> FromString(const std::u16string& source_value); - static ValidStrings GetValidStrings(); - - // Parses a string within |start| and |end| for a color string in the forms - // rgb(r, g, b), rgba(r, g, b, a), hsl(h, s%, l%), hsla(h, s%, l%, a), - // 0xXXXXXX, 0xXXXXXXXX, <decimal number> - // Returns the full string in |color| and the position immediately following - // the last token in |next_token|. - // Returns false if the input string cannot be properly parsed. |color| and - // |next_token| will be undefined. - static bool GetNextColor(std::u16string::const_iterator start, - std::u16string::const_iterator end, - std::u16string& color, - std::u16string::const_iterator& next_token); - static bool GetNextColor(std::u16string::const_iterator start, - std::u16string::const_iterator end, - std::u16string& color); - - // Same as above, except returns the color string converted into an |SkColor|. - // Returns base::nullopt if the color string cannot be properly parsed or the - // string cannot be converted into a valid SkColor and |next_token| may be - // undefined. - static base::Optional<SkColor> GetNextColor( - std::u16string::const_iterator start, - std::u16string::const_iterator end, - std::u16string::const_iterator& next_token); - static base::Optional<SkColor> GetNextColor( - std::u16string::const_iterator start, - std::u16string::const_iterator end); - - // Converts the four elements of |pieces| beginning at |start_piece| to an - // SkColor by assuming the pieces are split from a string like - // "rgba(r,g,b,a)". Returns nullopt if conversion was unsuccessful. - static base::Optional<SkColor> RgbaPiecesToSkColor( - const std::vector<base::StringPiece16>& pieces, - size_t start_piece); - - private: - static base::Optional<SkColor> ParseHexString( - const std::u16string& hex_string); - static base::Optional<SkColor> ParseHslString( - const std::u16string& hsl_string); - static base::Optional<SkColor> ParseRgbString( - const std::u16string& rgb_string); -}; - -using SkColorConverter = TypeConverter<UNIQUE_TYPE_NAME(SkColor)>; - -} // namespace metadata -} // namespace views - #endif // UI_VIEWS_METADATA_TYPE_CONVERSION_H_
diff --git a/ui/views/metadata/type_conversion_unittest.cc b/ui/views/metadata/type_conversion_unittest.cc index 136f26e..17d50c4 100644 --- a/ui/views/metadata/type_conversion_unittest.cc +++ b/ui/views/metadata/type_conversion_unittest.cc
@@ -1,261 +1,24 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. +// 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. #include "ui/views/metadata/type_conversion.h" -#include "base/ranges/ranges.h" -#include "base/strings/string_tokenizer.h" -#include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" -#include "ui/gfx/geometry/insets.h" -#include "ui/gfx/geometry/rect.h" #include "ui/views/controls/button/button.h" +#include "ui/views/controls/focus_ring.h" -using TypeConversionTest = PlatformTest; +using ViewsTypeConversionTest = PlatformTest; -namespace views { - -// Used in CheckIsSerializable test case. -enum TestResult { - TEST_TRUE, - TEST_FALSE, -}; -DEFINE_ENUM_CONVERTERS(TestResult, {TEST_TRUE, u"TRUE"}, {TEST_FALSE, u"FALSE"}) - -TEST_F(TypeConversionTest, TestConversion_IntToString) { - int from_int = 5; - std::u16string to_string = metadata::TypeConverter<int>::ToString(from_int); - - EXPECT_EQ(to_string, u"5"); -} - -TEST_F(TypeConversionTest, TestConversion_StringToInt) { - std::u16string from_string = u"10"; - EXPECT_EQ(metadata::TypeConverter<int>::FromString(from_string), 10); -} - -// This tests whether the converter handles a bogus input string, in which case -// the return value should be nullopt. -TEST_F(TypeConversionTest, TestConversion_BogusStringToInt) { - std::u16string from_string = u"Foo"; - EXPECT_EQ(metadata::TypeConverter<int>::FromString(from_string), - base::nullopt); -} - -TEST_F(TypeConversionTest, TestConversion_BogusStringToFloat) { - std::u16string from_string = u"1.2"; - EXPECT_EQ(metadata::TypeConverter<float>::FromString(from_string), 1.2f); -} - -TEST_F(TypeConversionTest, TestConversion_OptionalIntToString) { - base::Optional<int> src; - std::u16string to_string = - metadata::TypeConverter<base::Optional<int>>::ToString(src); - EXPECT_EQ(to_string, metadata::GetNullOptStr()); - - src = 5; - to_string = metadata::TypeConverter<base::Optional<int>>::ToString(src); - EXPECT_EQ(to_string, u"5"); -} - -TEST_F(TypeConversionTest, TestConversion_StringToOptionalInt) { - base::Optional<int> ret; - EXPECT_EQ(metadata::TypeConverter<base::Optional<int>>::FromString( - metadata::GetNullOptStr()), - base::make_optional(ret)); - - EXPECT_EQ(metadata::TypeConverter<base::Optional<int>>::FromString(u"10"), - 10); - - EXPECT_EQ(metadata::TypeConverter<base::Optional<int>>::FromString(u"ab0"), - base::nullopt); -} - -TEST_F(TypeConversionTest, TestConversion_ShadowValuesToString) { - gfx::ShadowValues shadow_values; - shadow_values.emplace_back(gfx::Vector2d(1, 2), .3, - SkColorSetARGB(128, 255, 0, 0)); - - EXPECT_EQ(metadata::TypeConverter<gfx::ShadowValues>::ToString(shadow_values), - u"[ (1,2),0.30,rgba(255,0,0,128) ]"); - - shadow_values.emplace_back(gfx::Vector2d(9, 8), .76, - SkColorSetARGB(20, 0, 64, 255)); - - EXPECT_EQ(metadata::TypeConverter<gfx::ShadowValues>::ToString(shadow_values), - u"[ (1,2),0.30,rgba(255,0,0,128); (9,8),0.76,rgba(0,64,255,20) ]"); -} - -TEST_F(TypeConversionTest, TestConversion_StringToShadowValues) { - base::Optional<gfx::ShadowValues> opt_result = - metadata::TypeConverter<gfx::ShadowValues>::FromString( - u"[ (6,4),0.53,rgba(23,44,0,1); (93,83),4.33,rgba(10,20,0,0.059) ]"); - - EXPECT_EQ(opt_result.has_value(), true); - gfx::ShadowValues result = opt_result.value(); - EXPECT_EQ(result.size(), 2U); - - EXPECT_EQ(result[0].color(), SkColorSetARGB(255, 23, 44, 0)); - EXPECT_EQ(result[1].color(), SkColorSetARGB(15, 10, 20, 0)); - - EXPECT_EQ(result[0].x(), 6); - EXPECT_EQ(result[1].x(), 93); - - EXPECT_EQ(result[0].y(), 4); - EXPECT_EQ(result[1].y(), 83); - - EXPECT_EQ(result[0].blur(), 0.53); - EXPECT_EQ(result[1].blur(), 4.33); -} - -TEST_F(TypeConversionTest, TestConversion_SkColorConversions) { - // Check conversion from rgb hex string - base::Optional<SkColor> result = - metadata::SkColorConverter::FromString(u"0x112233"); - EXPECT_TRUE(result); - EXPECT_EQ(result.value(), SkColorSetRGB(0x11, 0x22, 0x33)); - - // Check conversion from argb hex string - result = metadata::SkColorConverter::FromString(u"0x7F112233"); - EXPECT_TRUE(result); - EXPECT_EQ(result.value(), SkColorSetARGB(0x7F, 0x11, 0x22, 0x33)); - - // Check conversion from rgb(r,g,b) string - result = metadata::SkColorConverter::FromString(u"rgb(0, 128, 192)"); - EXPECT_TRUE(result); - EXPECT_EQ(result.value(), SkColorSetRGB(0, 128, 192)); - - // Check conversion from rgba(r,g,b,a) string - result = metadata::SkColorConverter::FromString(u"rgba(0, 128, 192, 0.5)"); - EXPECT_TRUE(result); - EXPECT_EQ(result.value(), SkColorSetARGB(128, 0, 128, 192)); - - // Check conversion from hsl(h,s,l) string - result = metadata::SkColorConverter::FromString(u"hsl(195, 100%, 50%)"); - EXPECT_TRUE(result); - const SkScalar hsv[3] = {195.0, 1.0, 0.5}; - EXPECT_EQ(result.value(), SkHSVToColor(hsv)); - - // Check conversion from hsla(h,s,l,a) string - result = metadata::SkColorConverter::FromString(u"hsl(195, 100%, 50%, 0.5)"); - EXPECT_TRUE(result); - EXPECT_EQ(result.value(), SkHSVToColor(128, hsv)); - - // Check conversion from a decimal integer value - result = metadata::SkColorConverter::FromString(u"4278239231"); - EXPECT_TRUE(result); - EXPECT_EQ(result.value(), SkColorSetARGB(255, 0, 191, 255)); - - // Check without commas. - result = metadata::SkColorConverter::FromString(u"rgba(92 92 92 1)"); - EXPECT_TRUE(result); - EXPECT_EQ(result.value(), SkColorSetARGB(255, 92, 92, 92)); - - // Don't support the CSS hash color style - result = metadata::SkColorConverter::FromString(u"#03254"); - EXPECT_FALSE(result); - - // Don't support some common invalid values - result = metadata::SkColorConverter::FromString(u"rgba(1,2,3,4)"); - EXPECT_FALSE(result); - - result = metadata::SkColorConverter::FromString(u"rgba(1,2,3,4"); - EXPECT_FALSE(result); - - result = metadata::SkColorConverter::FromString(u"hsla(1,2,3,4)"); - EXPECT_FALSE(result); -} - -TEST_F(TypeConversionTest, TestConversion_ColorParserTest) { - using converter = metadata::SkColorConverter; - std::u16string color; - const std::u16string source = - u"rgb(0, 128, 192), hsl(90, 100%, 30%), rgba(128, 128, 128, 0.5), " - u"hsla(240, 100%, 50%, 0.5)"; - auto start_pos = source.cbegin(); - EXPECT_TRUE( - converter::GetNextColor(start_pos, source.cend(), color, start_pos)); - EXPECT_EQ(color, u"rgb(0, 128, 192)"); - EXPECT_TRUE( - converter::GetNextColor(start_pos, source.cend(), color, start_pos)); - EXPECT_EQ(color, u"hsl(90, 100%, 30%)"); - EXPECT_TRUE( - converter::GetNextColor(start_pos, source.cend(), color, start_pos)); - EXPECT_EQ(color, u"rgba(128, 128, 128, 0.5)"); - EXPECT_TRUE(converter::GetNextColor(start_pos, source.cend(), color)); - EXPECT_EQ(color, u"hsla(240, 100%, 50%, 0.5)"); -} - -TEST_F(TypeConversionTest, TestConversion_InsetsToString) { - constexpr gfx::Insets kInsets(3, 5, 7, 9); - - std::u16string to_string = - metadata::TypeConverter<gfx::Insets>::ToString(kInsets); - - EXPECT_EQ(to_string, base::ASCIIToUTF16(kInsets.ToString())); -} - -TEST_F(TypeConversionTest, TestConversion_StringToInsets) { - std::u16string from_string = u"2,3,4,5"; - EXPECT_EQ(metadata::TypeConverter<gfx::Insets>::FromString(from_string), - gfx::Insets(2, 3, 4, 5)); -} - -TEST_F(TypeConversionTest, TestConversion_VectorToString) { - const std::vector<int> kVector{3, 5, 7, 9}; - - std::u16string to_string = - metadata::TypeConverter<std::vector<int>>::ToString(kVector); - - EXPECT_EQ(to_string, u"{3,5,7,9}"); -} - -TEST_F(TypeConversionTest, TestConversion_StringToVector) { - std::u16string from_string = u"{2,3,4,5}"; - EXPECT_EQ(metadata::TypeConverter<std::vector<int>>::FromString(from_string), - std::vector<int>({2, 3, 4, 5})); -} - -TEST_F(TypeConversionTest, CheckIsSerializable) { - // Test types with explicitly added converters. - EXPECT_TRUE(metadata::TypeConverter<int8_t>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<int16_t>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<int32_t>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<int64_t>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<uint8_t>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<uint16_t>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<uint32_t>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<uint64_t>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<float>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<double>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<bool>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<const char*>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<std::u16string>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<gfx::ShadowValues>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<gfx::Size>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<gfx::Range>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<gfx::Insets>::IsSerializable()); - - // Test enum type. - EXPECT_TRUE(metadata::TypeConverter<TestResult>::IsSerializable()); - - // Test aliased types. - EXPECT_TRUE(metadata::TypeConverter<int>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<SkColor>::IsSerializable()); - +TEST_F(ViewsTypeConversionTest, CheckIsSerializable) { // Test types with no explicit or aliased converters. - EXPECT_FALSE(metadata::TypeConverter< + EXPECT_FALSE(ui::metadata::TypeConverter< views::Button::PressedCallback>::IsSerializable()); - EXPECT_FALSE(metadata::TypeConverter<views::FocusRing*>::IsSerializable()); + EXPECT_FALSE( + ui::metadata::TypeConverter<views::FocusRing*>::IsSerializable()); // Test base::Optional type. - EXPECT_TRUE( - metadata::TypeConverter<base::Optional<const char*>>::IsSerializable()); - EXPECT_TRUE(metadata::TypeConverter<base::Optional<int>>::IsSerializable()); - EXPECT_FALSE(metadata::TypeConverter< + EXPECT_FALSE(ui::metadata::TypeConverter< base::Optional<views::FocusRing*>>::IsSerializable()); } - -} // namespace views
diff --git a/ui/views/metadata/view_factory.h b/ui/views/metadata/view_factory.h index 972ebcf..5a770ce 100644 --- a/ui/views/metadata/view_factory.h +++ b/ui/views/metadata/view_factory.h
@@ -12,7 +12,7 @@ #include <utility> #include "ui/base/class_property.h" -#include "ui/views/metadata/type_conversion.h" +#include "ui/base/metadata/base_type_conversion.h" #include "ui/views/metadata/view_factory_internal.h" #include "ui/views/views_export.h" @@ -63,7 +63,7 @@ template <typename T> Builder& SetProperty(const ui::ClassProperty<T>* property, - metadata::ArgType<T> value) { + ui::metadata::ArgType<T> value) { auto setter = std::make_unique<internal::ClassPropertyValueSetter<ViewClass_, T>>( property, value); @@ -73,7 +73,7 @@ template <typename T> Builder& SetProperty(const ui::ClassProperty<T*>* property, - metadata::ArgType<T> value) { + ui::metadata::ArgType<T> value) { auto setter = std::make_unique<internal::ClassPropertyMoveSetter<ViewClass_, T>>( property, value); @@ -172,14 +172,13 @@ view_class##BuilderT& operator=(view_class##BuilderT&&) = default; \ ~view_class##BuilderT() override = default; -#define VIEW_BUILDER_PROPERTY(property_type, property_name) \ - BuilderT& Set##property_name( \ - ::views::metadata::ArgType<property_type> value) { \ - auto setter = std::make_unique<::views::internal::PropertySetter< \ - ViewClass_, property_type, decltype(&ViewClass_::Set##property_name), \ - &ViewClass_::Set##property_name>>(std::move(value)); \ - ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); \ - return *static_cast<BuilderT*>(this); \ +#define VIEW_BUILDER_PROPERTY(property_type, property_name) \ + BuilderT& Set##property_name(::ui::metadata::ArgType<property_type> value) { \ + auto setter = std::make_unique<::views::internal::PropertySetter< \ + ViewClass_, property_type, decltype(&ViewClass_::Set##property_name), \ + &ViewClass_::Set##property_name>>(std::move(value)); \ + ::views::internal::ViewBuilderCore::AddPropertySetter(std::move(setter)); \ + return *static_cast<BuilderT*>(this); \ } #define VIEW_BUILDER_METHOD(method_name) \ @@ -213,8 +212,8 @@ } #define VIEW_BUILDER_PROPERTY_DEFAULT(property_type, property_name, default) \ - BuilderT& Set##property_name( \ - ::views::metadata::ArgType<property_type> value = default) { \ + BuilderT& Set##property_name(::ui::metadata::ArgType<property_type> value = \ + default) { \ auto setter = std::make_unique<::views::internal::PropertySetter< \ ViewClass_, property_type, decltype(&ViewClass_::Set##property_name), \ &ViewClass_::Set##property_name>>(std::move(value)); \
diff --git a/ui/views/metadata/view_factory_internal.h b/ui/views/metadata/view_factory_internal.h index 29f4209..68ab84c 100644 --- a/ui/views/metadata/view_factory_internal.h +++ b/ui/views/metadata/view_factory_internal.h
@@ -13,8 +13,7 @@ #include <vector> #include "ui/base/class_property.h" -#include "ui/views/metadata/type_conversion.h" -#include "ui/views/metadata/view_factory_internal.h" +#include "ui/base/metadata/base_type_conversion.h" #include "ui/views/views_export.h" namespace views { @@ -48,7 +47,7 @@ template <typename TClass, typename TValue, typename TSig, TSig Set> class PropertySetter : public PropertySetterBase { public: - explicit PropertySetter(metadata::ArgType<TValue> value) + explicit PropertySetter(ui::metadata::ArgType<TValue> value) : value_(std::move(value)) {} PropertySetter(const PropertySetter&) = delete; PropertySetter& operator=(const PropertySetter&) = delete;
diff --git a/ui/views/test/view_metadata_test_utils.cc b/ui/views/test/view_metadata_test_utils.cc index 585dfae..bf67f8a 100644 --- a/ui/views/test/view_metadata_test_utils.cc +++ b/ui/views/test/view_metadata_test_utils.cc
@@ -7,19 +7,19 @@ #include <string> #include "testing/gtest/include/gtest/gtest.h" -#include "ui/views/metadata/metadata_types.h" +#include "ui/base/metadata/metadata_types.h" namespace views { namespace test { void TestViewMetadata(View* view) { - metadata::ClassMetaData* meta_data = view->GetClassMetaData(); + ui::metadata::ClassMetaData* meta_data = view->GetClassMetaData(); EXPECT_NE(meta_data, nullptr); for (auto* property : *meta_data) { std::u16string value = property->GetValueAsString(view); - metadata::PropertyFlags flags = property->GetPropertyFlags(); - if (!(flags & metadata::PropertyFlags::kReadOnly) && - !!(flags & metadata::PropertyFlags::kSerializable)) { + ui::metadata::PropertyFlags flags = property->GetPropertyFlags(); + if (!(flags & ui::metadata::PropertyFlags::kReadOnly) && + !!(flags & ui::metadata::PropertyFlags::kSerializable)) { property->SetValueAsString(view, value); } }
diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc index 22476b95..75c90d5 100644 --- a/ui/views/touchui/touch_selection_controller_impl.cc +++ b/ui/views/touchui/touch_selection_controller_impl.cc
@@ -15,14 +15,14 @@ #include "ui/aura/env.h" #include "ui/aura/window.h" #include "ui/aura/window_targeter.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/image/image.h" #include "ui/resources/grit/ui_resources.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -373,12 +373,6 @@ Widget* widget_ = nullptr; }; -DEFINE_ENUM_CONVERTERS(gfx::SelectionBound::Type, - {gfx::SelectionBound::Type::LEFT, u"LEFT"}, - {gfx::SelectionBound::Type::RIGHT, u"RIGHT"}, - {gfx::SelectionBound::Type::CENTER, u"CENTER"}, - {gfx::SelectionBound::Type::EMPTY, u"EMPTY"}) - BEGIN_METADATA(TouchSelectionControllerImpl, EditingHandleView, View) ADD_READONLY_PROPERTY_METADATA(gfx::SelectionBound::Type, SelectionBoundType) ADD_PROPERTY_METADATA(bool, WidgetVisible) @@ -744,3 +738,9 @@ } } // namespace views + +DEFINE_ENUM_CONVERTERS(gfx::SelectionBound::Type, + {gfx::SelectionBound::Type::LEFT, u"LEFT"}, + {gfx::SelectionBound::Type::RIGHT, u"RIGHT"}, + {gfx::SelectionBound::Type::CENTER, u"CENTER"}, + {gfx::SelectionBound::Type::EMPTY, u"EMPTY"})
diff --git a/ui/views/touchui/touch_selection_menu_views.cc b/ui/views/touchui/touch_selection_menu_views.cc index 29583c4..7f5e5f81 100644 --- a/ui/views/touchui/touch_selection_menu_views.cc +++ b/ui/views/touchui/touch_selection_menu_views.cc
@@ -11,6 +11,7 @@ #include "base/strings/utf_string_conversions.h" #include "ui/aura/window.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/pointer/touch_editing_controller.h" #include "ui/display/display.h" #include "ui/display/screen.h" @@ -23,7 +24,6 @@ #include "ui/touch_selection/touch_selection_menu_runner.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" namespace views { namespace {
diff --git a/ui/views/view.cc b/ui/views/view.cc index aeb2902..aec3d693 100644 --- a/ui/views/view.cc +++ b/ui/views/view.cc
@@ -29,6 +29,7 @@ #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/mojom/drag_drop_types.mojom.h" #include "ui/base/ime/input_method.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/color/color_provider_manager.h" #include "ui/compositor/clip_recorder.h" #include "ui/compositor/compositor.h" @@ -57,7 +58,6 @@ #include "ui/views/controls/scroll_view.h" #include "ui/views/drag_controller.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/view_observer.h" #include "ui/views/view_tracker.h" @@ -2270,31 +2270,11 @@ SchedulePaint(); } -base::CallbackListSubscription View::AddPropertyChangedCallback( - PropertyKey property, - PropertyChangedCallback callback) { - auto entry = property_changed_vectors_.find(property); - if (entry == property_changed_vectors_.end()) { - entry = property_changed_vectors_ - .emplace(property, std::make_unique<PropertyChangedCallbacks>()) - .first; - } - PropertyChangedCallbacks* property_changed_callbacks = entry->second.get(); - - return property_changed_callbacks->Add(std::move(callback)); -} - -void View::OnPropertyChanged(PropertyKey property, +void View::OnPropertyChanged(ui::metadata::PropertyKey property, PropertyEffects property_effects) { if (property_effects != kPropertyEffectsNone) HandlePropertyChangeEffects(property_effects); - - auto entry = property_changed_vectors_.find(property); - if (entry == property_changed_vectors_.end()) - return; - - PropertyChangedCallbacks* property_changed_callbacks = entry->second.get(); - property_changed_callbacks->Notify(); + TriggerChangedCallback(property); } int View::GetX() const { @@ -3237,12 +3217,6 @@ return preferred_height; } -DEFINE_ENUM_CONVERTERS(View::FocusBehavior, - {View::FocusBehavior::ACCESSIBLE_ONLY, - u"ACCESSIBLE_ONLY"}, - {View::FocusBehavior::ALWAYS, u"ALWAYS"}, - {View::FocusBehavior::NEVER, u"NEVER"}) - // This block requires the existence of METADATA_HEADER(View) in the class // declaration for View. BEGIN_METADATA_BASE(View) @@ -3274,3 +3248,9 @@ END_METADATA } // namespace views + +DEFINE_ENUM_CONVERTERS(views::View::FocusBehavior, + {views::View::FocusBehavior::ACCESSIBLE_ONLY, + u"ACCESSIBLE_ONLY"}, + {views::View::FocusBehavior::ALWAYS, u"ALWAYS"}, + {views::View::FocusBehavior::NEVER, u"NEVER"})
diff --git a/ui/views/view.h b/ui/views/view.h index 0863add..b2ab04ab 100644 --- a/ui/views/view.h +++ b/ui/views/view.h
@@ -34,6 +34,8 @@ #include "ui/base/dragdrop/drop_target_event.h" #include "ui/base/dragdrop/mojom/drag_drop_types.mojom-forward.h" #include "ui/base/dragdrop/os_exchange_data.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_types.h" #include "ui/base/ui_base_types.h" #include "ui/compositor/layer_delegate.h" #include "ui/compositor/layer_observer.h" @@ -50,7 +52,6 @@ #include "ui/gfx/native_widget_types.h" #include "ui/views/layout/layout_manager.h" #include "ui/views/layout/layout_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/paint_info.h" #include "ui/views/view_targeter.h" @@ -128,11 +129,7 @@ View* move_view = nullptr; }; -// Used to identify the CallbackList<> within the PropertyChangedVectors map. -using PropertyKey = const void*; - -using PropertyChangedCallbacks = base::RepeatingClosureList; -using PropertyChangedCallback = PropertyChangedCallbacks::CallbackType; +using PropertyChangedCallback = ui::metadata::PropertyChangedCallback; // The elements in PropertyEffects represent bits which define what effect(s) a // changed Property has on the containing class. Additional elements should @@ -275,7 +272,7 @@ public ui::EventTarget, public ui::EventHandler, public ui::PropertyHandler, - public views::metadata::MetaDataProvider { + public ui::metadata::MetaDataProvider { public: using Views = std::vector<View*>; @@ -389,6 +386,8 @@ // Creation and lifetime ----------------------------------------------------- View(); + View(const View&) = delete; + View& operator=(const View&) = delete; ~View() override; // By default a View is owned by its parent unless specified otherwise here. @@ -1619,10 +1618,7 @@ // Property Support ---------------------------------------------------------- - base::CallbackListSubscription AddPropertyChangedCallback( - PropertyKey property, - PropertyChangedCallback callback) WARN_UNUSED_RESULT; - void OnPropertyChanged(PropertyKey property, + void OnPropertyChanged(ui::metadata::PropertyKey property, PropertyEffects property_effects); private: @@ -1661,9 +1657,6 @@ int GetPreferredHeightForWidth(const View* host, int width) const override; }; - using PropertyChangedVectors = - std::map<PropertyKey, std::unique_ptr<PropertyChangedCallbacks>>; - // Painting ----------------------------------------------------------------- // Responsible for propagating SchedulePaint() to the view's layer. If there @@ -2142,13 +2135,8 @@ base::ObserverList<ViewObserver>::Unchecked observers_; - // Property Changed Callbacks ------------------------------------------------ - PropertyChangedVectors property_changed_vectors_; - // http://crbug.com/1162949 : Instrumentation that indicates if this is alive. LifeCycleState life_cycle_state_ = LifeCycleState::kAlive; - - DISALLOW_COPY_AND_ASSIGN(View); }; BEGIN_VIEW_BUILDER(VIEWS_EXPORT, View, BaseView)
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc index 5e307a5..309240a7 100644 --- a/ui/views/view_unittest.cc +++ b/ui/views/view_unittest.cc
@@ -33,6 +33,7 @@ #include "ui/base/accelerators/accelerator.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_types.h" #include "ui/compositor/compositor.h" #include "ui/compositor/compositor_switches.h" #include "ui/compositor/layer.h" @@ -55,7 +56,6 @@ #include "ui/views/controls/scroll_view.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/box_layout.h" -#include "ui/views/metadata/metadata_types.h" #include "ui/views/paint_info.h" #include "ui/views/test/view_metadata_test_utils.h" #include "ui/views/test/views_test_base.h" @@ -5373,9 +5373,9 @@ auto subscription = test_view->AddEnabledChangedCallback(base::BindRepeating( [](bool* enabled_changed) { *enabled_changed = true; }, &enabled_changed)); - views::metadata::ClassMetaData* view_metadata = View::MetaData(); + ui::metadata::ClassMetaData* view_metadata = View::MetaData(); ASSERT_TRUE(view_metadata); - views::metadata::MemberMetaDataBase* enabled_property = + ui::metadata::MemberMetaDataBase* enabled_property = view_metadata->FindMemberData("Enabled"); ASSERT_TRUE(enabled_property); std::u16string false_value = u"false"; @@ -5387,9 +5387,9 @@ TEST_F(ViewTest, TestMarginsPropertyMetadata) { auto test_view = std::make_unique<View>(); - views::metadata::ClassMetaData* view_metadata = View::MetaData(); + ui::metadata::ClassMetaData* view_metadata = View::MetaData(); ASSERT_TRUE(view_metadata); - views::metadata::MemberMetaDataBase* insets_property = + ui::metadata::MemberMetaDataBase* insets_property = view_metadata->FindMemberData("kMarginsKey"); ASSERT_TRUE(insets_property); std::u16string insets_value = u"8,8,8,8";
diff --git a/ui/views/view_utils.cc b/ui/views/view_utils.cc index 5df39fc..9a5638f 100644 --- a/ui/views/view_utils.cc +++ b/ui/views/view_utils.cc
@@ -50,7 +50,7 @@ views::View* view = const_cast<views::View*>(view_); for (auto* member : *(view->GetClassMetaData())) { auto flags = member->GetPropertyFlags(); - if (!!(flags & views::metadata::PropertyFlags::kSerializable)) { + if (!!(flags & ui::metadata::PropertyFlags::kSerializable)) { callback.Run(member->member_name(), base::UTF16ToUTF8(member->GetValueAsString(view))); }
diff --git a/ui/views/view_utils.h b/ui/views/view_utils.h index 11893d7..a2dfdb5 100644 --- a/ui/views/view_utils.h +++ b/ui/views/view_utils.h
@@ -10,8 +10,8 @@ #include <type_traits> #include <vector> +#include "ui/base/metadata/metadata_types.h" #include "ui/views/debug/debugger_utils.h" -#include "ui/views/metadata/metadata_types.h" #include "ui/views/view.h" #include "ui/views/views_export.h" @@ -42,8 +42,8 @@ template <typename V> bool IsViewClass(View* view) { static_assert(std::is_base_of<View, V>::value, "Only View classes supported"); - metadata::ClassMetaData* parent = V::MetaData(); - metadata::ClassMetaData* child = view->GetClassMetaData(); + ui::metadata::ClassMetaData* parent = V::MetaData(); + ui::metadata::ClassMetaData* child = view->GetClassMetaData(); while (child && child != parent) child = child->parent_class_meta_data(); return !!child;
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc index 632a62d..8798da3 100644 --- a/ui/views/widget/root_view.cc +++ b/ui/views/widget/root_view.cc
@@ -16,6 +16,8 @@ #include "ui/accessibility/platform/ax_platform_node.h" #include "ui/base/cursor/cursor.h" #include "ui/base/dragdrop/mojom/drag_drop_types.mojom-shared.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/ui_base_switches_util.h" #include "ui/compositor/layer.h" #include "ui/events/event.h" @@ -24,8 +26,6 @@ #include "ui/gfx/canvas.h" #include "ui/views/accessibility/view_accessibility.h" #include "ui/views/drag_controller.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view_class_properties.h" #include "ui/views/view_targeter.h" #include "ui/views/widget/root_view_targeter.h"
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc index 21845e0..0386a6b 100644 --- a/ui/views/widget/widget.cc +++ b/ui/views/widget/widget.cc
@@ -20,6 +20,7 @@ #include "ui/base/hit_test.h" #include "ui/base/ime/input_method.h" #include "ui/base/l10n/l10n_font_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/color/color_provider_manager.h" #include "ui/compositor/compositor.h" @@ -33,7 +34,6 @@ #include "ui/views/focus/focus_manager.h" #include "ui/views/focus/focus_manager_factory.h" #include "ui/views/focus/widget_focus_manager.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/views_delegate.h" #include "ui/views/views_features.h" #include "ui/views/widget/any_widget_observer_singleton.h" @@ -47,6 +47,10 @@ #include "ui/views/window/custom_frame_view.h" #include "ui/views/window/dialog_delegate.h" +#if defined(OS_LINUX) +#include "ui/views/linux_ui/linux_ui.h" +#endif + namespace views { namespace { @@ -1647,6 +1651,13 @@ parent_) return parent_->GetNativeTheme(); +#if defined(OS_LINUX) + if (const views::LinuxUI* linux_ui = views::LinuxUI::instance()) { + if (auto* native_theme = linux_ui->GetNativeTheme(GetNativeWindow())) + return native_theme; + } +#endif + return ui::NativeTheme::GetInstanceForNativeUi(); } @@ -1767,13 +1778,6 @@ focus_manager->ViewRemoved(root_view_.get()); } -DEFINE_ENUM_CONVERTERS(ui::ZOrderLevel, - {ui::ZOrderLevel::kNormal, u"kNormal"}, - {ui::ZOrderLevel::kFloatingWindow, u"kFloatingWindow"}, - {ui::ZOrderLevel::kFloatingUIElement, - u"kFloatingUIElement"}, - {ui::ZOrderLevel::kSecuritySurface, u"kSecuritySurface"}) - BEGIN_METADATA_BASE(Widget) ADD_READONLY_PROPERTY_METADATA(const char*, ClassName) ADD_READONLY_PROPERTY_METADATA(gfx::Rect, ClientAreaBoundsInScreen) @@ -1799,3 +1803,10 @@ } // namespace internal } // namespace views + +DEFINE_ENUM_CONVERTERS(ui::ZOrderLevel, + {ui::ZOrderLevel::kNormal, u"kNormal"}, + {ui::ZOrderLevel::kFloatingWindow, u"kFloatingWindow"}, + {ui::ZOrderLevel::kFloatingUIElement, + u"kFloatingUIElement"}, + {ui::ZOrderLevel::kSecuritySurface, u"kSecuritySurface"})
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h index 2bbfb7d..c1ecf559 100644 --- a/ui/views/widget/widget.h +++ b/ui/views/widget/widget.h
@@ -17,6 +17,8 @@ #include "base/scoped_observation.h" #include "build/build_config.h" #include "ui/base/dragdrop/mojom/drag_drop_types.mojom-forward.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_types.h" #include "ui/base/ui_base_types.h" #include "ui/events/event_source.h" #include "ui/gfx/geometry/rect.h" @@ -24,8 +26,6 @@ #include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme_observer.h" #include "ui/views/focus/focus_manager.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_types.h" #include "ui/views/widget/native_widget_delegate.h" #include "ui/views/window/client_view.h" #include "ui/views/window/non_client_view.h" @@ -101,7 +101,7 @@ public ui::EventSource, public FocusTraversable, public ui::NativeThemeObserver, - public metadata::MetaDataProvider { + public ui::metadata::MetaDataProvider { public: METADATA_HEADER_BASE(Widget); using Widgets = std::set<Widget*>;
diff --git a/ui/views/widget/widget_delegate.cc b/ui/views/widget/widget_delegate.cc index 0c1be5b..b4fa10a85 100644 --- a/ui/views/widget/widget_delegate.cc +++ b/ui/views/widget/widget_delegate.cc
@@ -11,10 +11,10 @@ #include "base/strings/utf_string_conversions.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/gfx/image/image_skia.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/view.h" #include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/widget/widget_delegate.h b/ui/views/widget/widget_delegate.h index eba8040..2771390 100644 --- a/ui/views/widget/widget_delegate.h +++ b/ui/views/widget/widget_delegate.h
@@ -11,8 +11,8 @@ #include "base/macros.h" #include "ui/accessibility/ax_enums.mojom.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/window/client_view.cc b/ui/views/window/client_view.cc index 227efb2..7829ac2 100644 --- a/ui/views/window/client_view.cc +++ b/ui/views/window/client_view.cc
@@ -10,8 +10,8 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h"
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc index 9b74c37..026f909 100644 --- a/ui/views/window/dialog_client_view.cc +++ b/ui/views/window/dialog_client_view.cc
@@ -10,6 +10,8 @@ #include <vector> #include "build/build_config.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/views/background.h" #include "ui/views/border.h" @@ -20,8 +22,6 @@ #include "ui/views/controls/button/md_text_button.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/view_observer.h" #include "ui/views/view_tracker.h"
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc index 87d538d6..7d8d1149 100644 --- a/ui/views/window/dialog_delegate.cc +++ b/ui/views/window/dialog_delegate.cc
@@ -14,6 +14,7 @@ #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_role_properties.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/color_palette.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/bubble/bubble_border.h" @@ -21,7 +22,6 @@ #include "ui/views/buildflags.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/layout/layout_provider.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/style/platform_style.h" #include "ui/views/views_features.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/window/dialog_delegate.h b/ui/views/window/dialog_delegate.h index c385d4e..53eb475 100644 --- a/ui/views/window/dialog_delegate.h +++ b/ui/views/window/dialog_delegate.h
@@ -13,8 +13,8 @@ #include "base/macros.h" #include "base/time/time.h" #include "ui/accessibility/ax_enums.mojom-forward.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/ui_base_types.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h" #include "ui/views/views_export.h"
diff --git a/ui/views/window/frame_caption_button.cc b/ui/views/window/frame_caption_button.cc index 15798487..b36dcfa 100644 --- a/ui/views/window/frame_caption_button.cc +++ b/ui/views/window/frame_caption_button.cc
@@ -8,6 +8,7 @@ #include <utility> #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/animation/slide_animation.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" @@ -19,7 +20,6 @@ #include "ui/views/animation/ink_drop_impl.h" #include "ui/views/animation/ink_drop_ripple.h" #include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/window/hit_test_utils.h" namespace views { @@ -78,6 +78,8 @@ SetInkDropMode(InkDropMode::ON); SetInkDropVisibleOpacity(kInkDropVisibleOpacity); UpdateInkDropBaseColor(); + views::InkDrop::UseInkDropWithoutAutoHighlight(this, + /*highlight_on_hover=*/false); views::HighlightPathGenerator::Install( this, std::make_unique<HighlightPathGenerator>(this)); @@ -185,11 +187,6 @@ return views::PaintInfo::ScaleType::kUniformScaling; } -std::unique_ptr<views::InkDrop> FrameCaptionButton::CreateInkDrop() { - return views::InkDrop::CreateInkDropWithoutAutoHighlight( - this, /*highlight_on_hover=*/false); -} - std::unique_ptr<views::InkDropRipple> FrameCaptionButton::CreateInkDropRipple() const { return std::make_unique<views::FloodFillInkDropRipple>( @@ -331,6 +328,15 @@ GetColorWithMaxContrast(GetColorWithMaxContrast(button_color))); } +BEGIN_METADATA(FrameCaptionButton, Button) +ADD_PROPERTY_METADATA(SkColor, BackgroundColor, ui::metadata::SkColorConverter) +ADD_PROPERTY_METADATA(int, InkDropCornerRadius) +ADD_READONLY_PROPERTY_METADATA(CaptionButtonIcon, Icon) +ADD_PROPERTY_METADATA(bool, PaintAsActive) +END_METADATA + +} // namespace views + DEFINE_ENUM_CONVERTERS( views::CaptionButtonIcon, {views::CaptionButtonIcon::CAPTION_BUTTON_ICON_MINIMIZE, @@ -354,11 +360,3 @@ {views::CaptionButtonIcon::CAPTION_BUTTON_ICON_COUNT, u"CAPTION_BUTTON_ICON_COUNT"}) -BEGIN_METADATA(FrameCaptionButton, Button) -ADD_PROPERTY_METADATA(SkColor, BackgroundColor, metadata::SkColorConverter) -ADD_PROPERTY_METADATA(int, InkDropCornerRadius) -ADD_READONLY_PROPERTY_METADATA(CaptionButtonIcon, Icon) -ADD_PROPERTY_METADATA(bool, PaintAsActive) -END_METADATA - -} // namespace views
diff --git a/ui/views/window/frame_caption_button.h b/ui/views/window/frame_caption_button.h index 5f93b6b..1a3f18f 100644 --- a/ui/views/window/frame_caption_button.h +++ b/ui/views/window/frame_caption_button.h
@@ -7,10 +7,10 @@ #include <memory> +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image_skia.h" #include "ui/views/controls/button/button.h" -#include "ui/views/metadata/metadata_header_macros.h" #include "ui/views/views_export.h" #include "ui/views/window/caption_button_layout_constants.h" #include "ui/views/window/caption_button_types.h" @@ -22,7 +22,6 @@ namespace views { -class InkDrop; class InkDropRipple; // Base class for the window caption buttons (minimize, maximize, restore, @@ -63,7 +62,6 @@ // views::Button: void OnGestureEvent(ui::GestureEvent* event) override; views::PaintInfo::ScaleType GetPaintScaleType() const override; - std::unique_ptr<InkDrop> CreateInkDrop() override; std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; void SetBackgroundColor(SkColor background_color);
diff --git a/ui/views/window/native_frame_view.cc b/ui/views/window/native_frame_view.cc index 12edd20..89b88c55 100644 --- a/ui/views/window/native_frame_view.cc +++ b/ui/views/window/native_frame_view.cc
@@ -5,7 +5,7 @@ #include "ui/views/window/native_frame_view.h" #include "build/build_config.h" -#include "ui/views/metadata/metadata_impl_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/widget/native_widget.h" #include "ui/views/widget/widget.h"
diff --git a/ui/views/window/native_frame_view.h b/ui/views/window/native_frame_view.h index 0b185af..ce1c5ed 100644 --- a/ui/views/window/native_frame_view.h +++ b/ui/views/window/native_frame_view.h
@@ -6,7 +6,7 @@ #define UI_VIEWS_WINDOW_NATIVE_FRAME_VIEW_H_ #include "base/macros.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/window/non_client_view.h"
diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc index 923e7ac..7c45c43 100644 --- a/ui/views/window/non_client_view.cc +++ b/ui/views/window/non_client_view.cc
@@ -10,9 +10,9 @@ #include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/hit_test.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/rect_conversions.h" #include "ui/views/layout/fill_layout.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/rect_based_targeting_utils.h" #include "ui/views/view_targeter.h" #include "ui/views/widget/root_view.h"
diff --git a/ui/views/window/non_client_view.h b/ui/views/window/non_client_view.h index c47c5b63..e56193a 100644 --- a/ui/views/window/non_client_view.h +++ b/ui/views/window/non_client_view.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "build/build_config.h" -#include "ui/views/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/metadata/view_factory.h" #include "ui/views/view.h" #include "ui/views/view_targeter_delegate.h"
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/activation_code_page.html b/ui/webui/resources/cr_components/chromeos/cellular_setup/activation_code_page.html index 4f17e71..60bde27 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/activation_code_page.html +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/activation_code_page.html
@@ -45,9 +45,8 @@ paper-spinner-lite { height: 20px; - position: absolute; - right: 16px; - top: 24px; + margin-inline-end: 6px; + margin-top: 6px; width: 20px; } @@ -113,6 +112,10 @@ --iron-icon-fill-color: #1A73E8; } + .hidden { + visibility: hidden; + } + #scanSucessHeader { --iron-icon-fill-color: #1E8E3E; margin-bottom: 8px; @@ -220,7 +223,7 @@ [[i18n('scanQrCodeInvalid')]] </span> </div> - <cr-button id="useCameraAgainButton" class="blue-icon" + <cr-button id="useCameraAgainButton" class$="[[getUseCameraAgainClass_(showBusy)]]" on-click="startScanning_" disabled="[[isUiElementDisabled_(UiElement.SCAN_SUCCESS, state_, showBusy)]]"> <iron-icon class="button-image" icon="cellular-setup:camera"></iron-icon> @@ -249,16 +252,19 @@ <div id="activationCodeContainer" class$="[[computeActivationCodeClass_( cameraCount_, qrCodeDetector_.*)]]"> <cr-input id="activationCode" - label="[[i18n('activationCode')]]" - value="{{activationCode}}" - disabled="[[showBusy]]" - on-keydown="onKeyDown_" - invalid="[[shouldActivationCodeInputBeInvalid_(state_)]]" - error-message="[[i18n('scanQrCodeInvalid')]]"> + label="[[i18n('activationCode')]]" + value="{{activationCode}}" + disabled="[[showBusy]]" + on-keydown="onKeyDown_" + invalid="[[shouldActivationCodeInputBeInvalid_(state_)]]" + error-message="[[i18n('scanQrCodeInvalid')]]"> + <template is="dom-if" if="[[showBusy]]"> + <div slot="suffix"> + <paper-spinner-lite active> + </paper-spinner-lite> + </div> + </template> </cr-input> - <paper-spinner-lite active - hidden$="[[!showBusy]]"> - </paper-spinner-lite> <div id="loadingMessage" hidden$="[[!showBusy]]"> [[i18n('scanQrCodeLoading')]] </div>
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/activation_code_page.js b/ui/webui/resources/cr_components/chromeos/cellular_setup/activation_code_page.js index 7497af5..4d45999 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/activation_code_page.js +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/activation_code_page.js
@@ -538,4 +538,12 @@ shouldActivationCodeInputBeInvalid_(state) { return state === PageState.MANUAL_ENTRY_INSTALL_FAILURE; }, + + /** + * @return {string} + * @private + */ + getUseCameraAgainClass_() { + return this.showBusy ? 'hidden' : 'blue-icon'; + } });
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/base_page.html b/ui/webui/resources/cr_components/chromeos/cellular_setup/base_page.html index 2f8fc2a..1023347 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/base_page.html +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/base_page.html
@@ -31,7 +31,7 @@ <template is="dom-if" if="[[isTitleShown_(title)]]" restamp> <h3 id="title">[[getTitle_(title)]]</h3> </template> - <div id="message"> + <div id="message" aria-live="polite" aria-atomic="true"> <iron-icon icon$="cellular-setup:[[messageIcon]]" hidden$="[[!isMessageIconShown_(messageIcon)]]">
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/psim_flow_ui.js b/ui/webui/resources/cr_components/chromeos/cellular_setup/psim_flow_ui.js index 295ad42..ff00949 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/psim_flow_ui.js +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/psim_flow_ui.js
@@ -304,6 +304,7 @@ this.state_ = PSimUIState.STARTING_ACTIVATION; this.startActivationAttempts_ = 0; this.updateButtonBarState_(); + this.fire('focus-default-button'); }, navigateForward() {
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/setup_loading_page.html b/ui/webui/resources/cr_components/chromeos/cellular_setup/setup_loading_page.html index 3b03de44..43968642 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/setup_loading_page.html +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/setup_loading_page.html
@@ -36,7 +36,7 @@ <div slot="page-body" class="layout vertical center-center"> <paper-spinner-lite active hidden$="[[shouldShowSimDetectError_(state)]]"> </paper-spinner-lite> - <div id="networkConnectionMessage" hidden$="[[shouldShowSimDetectError_(state)]]"> + <div id="networkConnectionMessage" hidden$="[[shouldShowSimDetectError_(state)]]" aria-live="polite"> [[loadingMessage]] </div> <div id="simDetectError" hidden$="[[!shouldShowSimDetectError_(state)]]"></div>
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_list_item.js b/ui/webui/resources/cr_components/chromeos/network/network_list_item.js index 81026e49..f5691850 100644 --- a/ui/webui/resources/cr_components/chromeos/network/network_list_item.js +++ b/ui/webui/resources/cr_components/chromeos/network/network_list_item.js
@@ -67,7 +67,8 @@ rowLabel: { type: String, notify: true, - computed: 'getRowLabel_(item, networkState, subtitle_)', + computed: + 'getRowLabel_(item, networkState, subtitle_, isPSimPendingActivationNetwork_)', }, buttonLabel: { @@ -397,6 +398,12 @@ this.getItemName_(), this.item.typeState.cellular.signalStrength); } if (status) { + if (this.isPSimPendingActivationNetwork_) { + return this.i18n( + 'networkListItemLabelCellularUnactivatedWithConnectionStatus', + index, total, this.getItemName_(), status, + this.item.typeState.cellular.signalStrength); + } if (this.subtitle_) { return this.i18n( 'networkListItemLabelCellularWithConnectionStatusAndProviderName', @@ -409,6 +416,12 @@ this.item.typeState.cellular.signalStrength); } + if (this.isPSimPendingActivationNetwork_) { + return this.i18n( + 'networkListItemLabelCellularUnactivated', index, total, + this.getItemName_(), this.item.typeState.cellular.signalStrength); + } + if (this.subtitle_) { return this.i18n( 'networkListItemLabelCellularWithProviderName', index, total,
diff --git a/url/url_canon_fileurl.cc b/url/url_canon_fileurl.cc index 6d6ade9..2aa5824 100644 --- a/url/url_canon_fileurl.cc +++ b/url/url_canon_fileurl.cc
@@ -25,47 +25,29 @@ int FileDoDriveSpec(const CHAR* spec, int begin, int end, CanonOutput* output) { // The path could be one of several things: /foo/bar, c:/foo/bar, /c:/foo, - // /./c:/foo, (with backslashes instead of slashes as well). The code - // first guesses the beginning of the drive letter, then verifies that the - // path up to that point can be canonicalised as "/". If it can, then the - // found drive letter is indeed a drive letter, otherwise the path has no - // drive letter in it. - if (begin > end) // Nothing to search in. - return begin; // Found no letter, so didn't consum any characters. + // (with backslashes instead of slashes as well). + int num_slashes = CountConsecutiveSlashes(spec, begin, end); + int after_slashes = begin + num_slashes; - // If there is something that looks like a drive letter in the spec between - // being and end, store its position in drive_letter_pos. - int drive_letter_pos = - DoesContainWindowsDriveSpecUntil(spec, begin, end, end); - if (drive_letter_pos < begin) - return begin; // Found no letter, so didn't consum any characters. + if (!DoesBeginWindowsDriveSpec(spec, after_slashes, end)) + return begin; // Haven't consumed any characters - // Check if the path up to the drive letter candidate can be canonicalized as - // "/". - Component sub_path = MakeRange(begin, drive_letter_pos); - Component output_path; - const int initial_length = output->length(); - bool success = CanonicalizePath(spec, sub_path, output, &output_path); - if (!success || output_path.len != 1 || - output->at(output_path.begin) != '/') { - // Undo writing the canonicalized path. - output->set_length(initial_length); - return begin; // Found no letter, so didn't consum any characters. - } + // A drive spec is the start of a path, so we need to add a slash for the + // authority terminator (typically the third slash). + output->push_back('/'); - // By now, "/" has been written to the output and a valid drive letter is - // confirmed at position drive_letter_pos, followed by a valid drive letter - // separator (a colon or a pipe). + // DoesBeginWindowsDriveSpec will ensure that the drive letter is valid + // and that it is followed by a colon/pipe. - // Normalize Windows drive letters to uppercase. - if (base::IsAsciiLower(spec[drive_letter_pos])) - output->push_back(static_cast<char>(spec[drive_letter_pos] - 'a' + 'A')); + // Normalize Windows drive letters to uppercase + if (base::IsAsciiLower(spec[after_slashes])) + output->push_back(static_cast<char>(spec[after_slashes] - 'a' + 'A')); else - output->push_back(static_cast<char>(spec[drive_letter_pos])); + output->push_back(static_cast<char>(spec[after_slashes])); // Normalize the character following it to a colon rather than pipe. output->push_back(':'); - return drive_letter_pos + 2; + return after_slashes + 2; } #endif // WIN32
diff --git a/url/url_canon_unittest.cc b/url/url_canon_unittest.cc index 8a121c58..fb27fe7 100644 --- a/url/url_canon_unittest.cc +++ b/url/url_canon_unittest.cc
@@ -1851,28 +1851,20 @@ // Busted refs shouldn't make the whole thing fail. {"file:///C:/asdf#\xc2", "file:///C:/asdf#%EF%BF%BD", true, Component(), Component(7, 8)}, - {"file:///./s:", "file:///S:", true, Component(), Component(7, 3)}, #else // Unix-style paths - {"file:///home/me", "file:///home/me", true, Component(), - Component(7, 8)}, + {"file:///home/me", "file:///home/me", true, Component(), Component(7, 8)}, // Windowsy ones should get still treated as Unix-style. - {"file:c:\\foo\\bar.html", "file:///c:/foo/bar.html", true, Component(), - Component(7, 16)}, - {"file:c|//foo\\bar.html", "file:///c%7C//foo/bar.html", true, - Component(), Component(7, 19)}, - {"file:///./s:", "file:///s:", true, Component(), Component(7, 3)}, + {"file:c:\\foo\\bar.html", "file:///c:/foo/bar.html", true, Component(), Component(7, 16)}, + {"file:c|//foo\\bar.html", "file:///c%7C//foo/bar.html", true, Component(), Component(7, 19)}, // file: tests from WebKit (LayoutTests/fast/loader/url-parse-1.html) - {"//", "file:///", true, Component(), Component(7, 1)}, - {"///", "file:///", true, Component(), Component(7, 1)}, - {"///test", "file:///test", true, Component(), Component(7, 5)}, - {"file://test", "file://test/", true, Component(7, 4), Component(11, 1)}, - {"file://localhost", "file://localhost/", true, Component(7, 9), - Component(16, 1)}, - {"file://localhost/", "file://localhost/", true, Component(7, 9), - Component(16, 1)}, - {"file://localhost/test", "file://localhost/test", true, Component(7, 9), - Component(16, 5)}, + {"//", "file:///", true, Component(), Component(7, 1)}, + {"///", "file:///", true, Component(), Component(7, 1)}, + {"///test", "file:///test", true, Component(), Component(7, 5)}, + {"file://test", "file://test/", true, Component(7, 4), Component(11, 1)}, + {"file://localhost", "file://localhost/", true, Component(7, 9), Component(16, 1)}, + {"file://localhost/", "file://localhost/", true, Component(7, 9), Component(16, 1)}, + {"file://localhost/test", "file://localhost/test", true, Component(7, 9), Component(16, 5)}, #endif // _WIN32 };
diff --git a/url/url_file.h b/url/url_file.h index 91b2ddc..45b8d9a 100644 --- a/url/url_file.h +++ b/url/url_file.h
@@ -34,44 +34,23 @@ #ifdef WIN32 -// DoesContainWindowsDriveSpecUntil returns the least number between -// start_offset and max_offset such that the spec has a valid drive -// specification starting at that offset. Otherwise it returns -1. This function -// gracefully handles, by returning -1, start_offset values that are equal to or -// larger than the spec_len, and caps max_offset appropriately to simplify -// callers. max_offset must be at least start_offset. -template <typename CHAR> -inline int DoesContainWindowsDriveSpecUntil(const CHAR* spec, - int start_offset, - int max_offset, - int spec_len) { - CHECK_LE(start_offset, max_offset); - if (start_offset > spec_len - 2) - return -1; // Not enough room. - if (max_offset > spec_len - 2) - max_offset = spec_len - 2; - for (int offset = start_offset; offset <= max_offset; ++offset) { - if (!base::IsAsciiAlpha(spec[offset])) - continue; // Doesn't contain a valid drive letter. - if (!IsWindowsDriveSeparator(spec[offset + 1])) - continue; // Isn't followed with a drive separator. - return offset; - } - return -1; -} - // Returns true if the start_offset in the given spec looks like it begins a // drive spec, for example "c:". This function explicitly handles start_offset // values that are equal to or larger than the spec_len to simplify callers. // // If this returns true, the spec is guaranteed to have a valid drive letter -// plus a drive letter separator (a colon or a pipe) starting at |start_offset|. -template <typename CHAR> -inline bool DoesBeginWindowsDriveSpec(const CHAR* spec, - int start_offset, +// plus a colon starting at |start_offset|. +template<typename CHAR> +inline bool DoesBeginWindowsDriveSpec(const CHAR* spec, int start_offset, int spec_len) { - return DoesContainWindowsDriveSpecUntil(spec, start_offset, start_offset, - spec_len) == start_offset; + int remaining_len = spec_len - start_offset; + if (remaining_len < 2) + return false; // Not enough room. + if (!base::IsAsciiAlpha(spec[start_offset])) + return false; // Doesn't start with a valid drive letter. + if (!IsWindowsDriveSeparator(spec[start_offset + 1])) + return false; // Isn't followed with a drive separator. + return true; } // Returns true if the start_offset in the given text looks like it begins a
diff --git a/weblayer/browser/cookie_manager_browsertest.cc b/weblayer/browser/cookie_manager_browsertest.cc index a7da2970..26a447a 100644 --- a/weblayer/browser/cookie_manager_browsertest.cc +++ b/weblayer/browser/cookie_manager_browsertest.cc
@@ -2,8 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/files/file_util.h" #include "base/test/bind.h" +#include "build/build_config.h" +#include "content/public/browser/browser_context.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "weblayer/browser/cookie_manager_impl.h" #include "weblayer/browser/profile_impl.h" #include "weblayer/public/cookie_manager.h" #include "weblayer/test/weblayer_browser_test.h" @@ -45,6 +49,16 @@ return final_result; } + base::Time GetCookieDbModifiedTime() { + base::FilePath cookie_path = + GetBrowserContext()->GetPath().Append(FILE_PATH_LITERAL("Cookies")); + + base::ScopedAllowBlockingForTesting scoped_allow_blocking; + base::File::Info info; + EXPECT_TRUE(base::GetFileInfo(cookie_path, &info)); + return info.last_modified; + } + private: size_t num_to_wait_for_ = 0; std::vector<net::CookieChangeInfo> change_infos_; @@ -112,4 +126,61 @@ } } +#if defined(OS_WIN) +// TODO(crbug.com/1204901): Disabled due to flakiness on Windows. +#define MAYBE_FlushCookiesAfterSet DISABLED_FlushCookiesAfterSet +#else +#define MAYBE_FlushCookiesAfterSet FlushCookiesAfterSet +#endif +IN_PROC_BROWSER_TEST_F(CookieManagerBrowserTest, MAYBE_FlushCookiesAfterSet) { + EXPECT_TRUE(embedded_test_server()->Start()); + NavigateAndWaitForCompletion( + embedded_test_server()->GetURL("/simple_page.html"), shell()); + + base::Time original_modified_time = GetCookieDbModifiedTime(); + + ASSERT_TRUE(SetCookie("a=b; expires=Fri, 01 Jan 2038 00:00:00 GMT")); + EXPECT_EQ(GetCookieDbModifiedTime(), original_modified_time); + + EXPECT_TRUE(static_cast<CookieManagerImpl*>(GetProfile()->GetCookieManager()) + ->FireFlushTimerForTesting()); + EXPECT_GT(GetCookieDbModifiedTime(), original_modified_time); +} + +#if defined(OS_WIN) +// TODO(crbug.com/1204901): Disabled due to flakiness on Windows. +#define MAYBE_FlushCookiesAfterSetMultiple DISABLED_FlushCookiesAfterSetMultiple +#else +#define MAYBE_FlushCookiesAfterSetMultiple FlushCookiesAfterSetMultiple +#endif +IN_PROC_BROWSER_TEST_F(CookieManagerBrowserTest, + MAYBE_FlushCookiesAfterSetMultiple) { + EXPECT_TRUE(embedded_test_server()->Start()); + NavigateAndWaitForCompletion( + embedded_test_server()->GetURL("/simple_page.html"), shell()); + + base::Time original_modified_time = GetCookieDbModifiedTime(); + + ASSERT_TRUE(SetCookie("a=b; expires=Fri, 01 Jan 2038 00:00:00 GMT")); + EXPECT_EQ(GetCookieDbModifiedTime(), original_modified_time); + ASSERT_TRUE(SetCookie("c=d; expires=Fri, 01 Jan 2038 00:00:00 GMT")); + EXPECT_EQ(GetCookieDbModifiedTime(), original_modified_time); + + CookieManagerImpl* cookie_manager = + static_cast<CookieManagerImpl*>(GetProfile()->GetCookieManager()); + EXPECT_TRUE(cookie_manager->FireFlushTimerForTesting()); + EXPECT_GT(GetCookieDbModifiedTime(), original_modified_time); + + // Flush timer should be gone now. + EXPECT_FALSE(cookie_manager->FireFlushTimerForTesting()); + + // Try again to make sure it works a second time. + original_modified_time = GetCookieDbModifiedTime(); + ASSERT_TRUE(SetCookie("d=f; expires=Fri, 01 Jan 2038 00:00:00 GMT")); + EXPECT_EQ(GetCookieDbModifiedTime(), original_modified_time); + + EXPECT_TRUE(cookie_manager->FireFlushTimerForTesting()); + EXPECT_GT(GetCookieDbModifiedTime(), original_modified_time); +} + } // namespace weblayer
diff --git a/weblayer/browser/cookie_manager_impl.cc b/weblayer/browser/cookie_manager_impl.cc index 4c0e6937..bdbaa4e0 100644 --- a/weblayer/browser/cookie_manager_impl.cc +++ b/weblayer/browser/cookie_manager_impl.cc
@@ -17,6 +17,7 @@ namespace weblayer { namespace { +constexpr base::TimeDelta kCookieFlushDelay = base::TimeDelta::FromSeconds(1); void GetCookieComplete(CookieManager::GetCookieCallback callback, const net::CookieAccessResultList& cookies, @@ -136,6 +137,17 @@ } #endif +bool CookieManagerImpl::FireFlushTimerForTesting() { + if (!flush_timer_) + return false; + + flush_run_loop_for_testing_ = std::make_unique<base::RunLoop>(); + flush_timer_->FireNow(); + flush_run_loop_for_testing_->Run(); + flush_run_loop_for_testing_ = nullptr; + return true; +} + bool CookieManagerImpl::SetCookieInternal(const GURL& url, const std::string& value, SetCookieCallback callback) { @@ -149,7 +161,9 @@ ->GetCookieManagerForBrowserProcess() ->SetCanonicalCookie( *cc, url, net::CookieOptions::MakeAllInclusive(), - net::cookie_util::AdaptCookieAccessResultToBool(std::move(callback))); + net::cookie_util::AdaptCookieAccessResultToBool( + base::BindOnce(&CookieManagerImpl::OnCookieSet, + weak_factory_.GetWeakPtr(), std::move(callback)))); return true; } @@ -176,4 +190,23 @@ cookie_change_receivers_.Remove(id); } +void CookieManagerImpl::OnCookieSet(SetCookieCallback callback, bool success) { + std::move(callback).Run(success); + if (!flush_timer_) { + flush_timer_ = std::make_unique<base::OneShotTimer>(); + flush_timer_->Start(FROM_HERE, kCookieFlushDelay, + base::BindOnce(&CookieManagerImpl::OnFlushTimerFired, + weak_factory_.GetWeakPtr())); + } +} + +void CookieManagerImpl::OnFlushTimerFired() { + browser_context_->GetDefaultStoragePartition() + ->GetCookieManagerForBrowserProcess() + ->FlushCookieStore(flush_run_loop_for_testing_ + ? flush_run_loop_for_testing_->QuitClosure() + : base::DoNothing()); + flush_timer_ = nullptr; +} + } // namespace weblayer
diff --git a/weblayer/browser/cookie_manager_impl.h b/weblayer/browser/cookie_manager_impl.h index 7c513cd..4729b48 100644 --- a/weblayer/browser/cookie_manager_impl.h +++ b/weblayer/browser/cookie_manager_impl.h
@@ -56,6 +56,10 @@ void RemoveCookieChangedCallback(JNIEnv* env, int id); #endif + // Fires the cookie flush timer immediately and waits for the flush to + // complete. Returns true if the flush timer was running. + bool FireFlushTimerForTesting(); + private: bool SetCookieInternal(const GURL& url, const std::string& value, @@ -64,11 +68,17 @@ const std::string* name, CookieChangedCallback callback); void RemoveCookieChangedCallbackInternal(int id); + void OnCookieSet(SetCookieCallback callback, bool success); + void OnFlushTimerFired(); content::BrowserContext* browser_context_; mojo::ReceiverSet<network::mojom::CookieChangeListener, std::unique_ptr<network::mojom::CookieChangeListener>> cookie_change_receivers_; + + std::unique_ptr<base::OneShotTimer> flush_timer_; + std::unique_ptr<base::RunLoop> flush_run_loop_for_testing_; + base::WeakPtrFactory<CookieManagerImpl> weak_factory_{this}; };
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/UrlBarControllerImpl.java b/weblayer/browser/java/org/chromium/weblayer_private/UrlBarControllerImpl.java index 332dd7a..aa2e0d09 100644 --- a/weblayer/browser/java/org/chromium/weblayer_private/UrlBarControllerImpl.java +++ b/weblayer/browser/java/org/chromium/weblayer_private/UrlBarControllerImpl.java
@@ -248,7 +248,7 @@ PageInfoController.show(mBrowserImpl.getWindowAndroid().getActivity().get(), webContents, publisherUrl, PageInfoController.OpenedFromSource.TOOLBAR, - PageInfoControllerDelegateImpl.create(webContents), null, + PageInfoControllerDelegateImpl.create(webContents), PageInfoController.NO_HIGHLIGHTED_PERMISSION); }
diff --git a/weblayer/browser/tab_impl.cc b/weblayer/browser/tab_impl.cc index dd405ae..a3dd04e 100644 --- a/weblayer/browser/tab_impl.cc +++ b/weblayer/browser/tab_impl.cc
@@ -7,6 +7,7 @@ #include <cmath> #include "base/auto_reset.h" +#include "base/bind.h" #include "base/feature_list.h" #include "base/guid.h" #include "base/logging.h" @@ -15,6 +16,7 @@ #include "base/time/default_tick_clock.h" #include "cc/layers/layer.h" #include "components/autofill/content/browser/content_autofill_driver_factory.h" +#include "components/autofill/core/browser/android_autofill_manager.h" #include "components/autofill/core/browser/autofill_provider.h" #include "components/autofill/core/common/autofill_features.h" #include "components/blocked_content/popup_blocker.h" @@ -1415,7 +1417,8 @@ autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( web_contents, AutofillClientImpl::FromWebContents(web_contents), i18n::GetApplicationLocale(), enable_autofill_download_manager, - autofill_provider_.get()); + base::BindRepeating(&autofill::AndroidAutofillManager::Create, + autofill_provider_.get())); } find_in_page::FindTabHelper* TabImpl::GetFindTabHelper() {
diff --git a/weblayer/shell/browser/shell_views.cc b/weblayer/shell/browser/shell_views.cc index aedc40d6..e8d08e36d 100644 --- a/weblayer/shell/browser/shell_views.cc +++ b/weblayer/shell/browser/shell_views.cc
@@ -18,6 +18,8 @@ #include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_tree_host.h" #include "ui/base/clipboard/clipboard.h" +#include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/resource/resource_bundle.h" #include "ui/events/event.h" #include "ui/native_theme/native_theme_color_id.h" @@ -28,8 +30,6 @@ #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/metadata/metadata_header_macros.h" -#include "ui/views/metadata/metadata_impl_macros.h" #include "ui/views/test/desktop_test_views_delegate.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h"
diff --git a/weblayer/weblayer_resource_exclusions.gni b/weblayer/weblayer_resource_exclusions.gni index 0badbde..35c92e1 100644 --- a/weblayer/weblayer_resource_exclusions.gni +++ b/weblayer/weblayer_resource_exclusions.gni
@@ -23,7 +23,6 @@ "${_material_package}:[Bb]uttonToggleGroup", "${_material_package}:[Cc]alendar", "${_material_package}:[Cc]ardView", - "${_material_package}:\b[Cc]hip", "${_material_package}:design_snackbar", "${_material_package}:[Ff]loatingActionButton", "${_material_package}:[Mm]aterialAlertDialog", @@ -49,7 +48,8 @@ # Instead of manually filtering, unused resource removal would be better: # https://crbug.com/636448 weblayer_resource_exclusion_regex += "|${_material_package}/layout" -weblayer_resource_exclusion_regex += "|${_material_package}/color.*(choice|chip_|card_|calendar_|bottom_nav_|slider_)" +weblayer_resource_exclusion_regex += + "|${_material_package}/color.*(card_|calendar_|bottom_nav_|slider_)" weblayer_resource_exclusion_regex += "|${_material_package}/drawable.*design_snackbar" weblayer_resource_exclusion_regex += "|${_material_package}/xml.*badge_"