diff --git a/DEPS b/DEPS index df6686095..6a99dec 100644 --- a/DEPS +++ b/DEPS
@@ -314,11 +314,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': '5b2dae1a9b549aaa1d9d43103ff4e7db87a4b6d2', + 'skia_revision': '8d9e2cd32ec723b42c62bbcc2d88545424b3e223', # 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': 'e3538e4e0e62b275515a23b9c5c49a3957d612e3', + 'v8_revision': '848018e98242a6244389bf82bb73a07239c3aa22', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. @@ -389,7 +389,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling chromium_variations # and whatever else without interference from each other. - 'chromium_variations_revision': 'a621459ab6c5e090cb2acacc9cd1b6a20456719c', + 'chromium_variations_revision': 'c2314644ddd1e2a534324bc0f9105531d5d0471a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling CrossBench # and whatever else without interference from each other. @@ -405,7 +405,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': 'cba3d1f0b8f005be884136dd1015c455789ec590', + 'devtools_frontend_revision': '43a373f3335ce57b5b154ee6065c38001d6361b6', # 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. @@ -445,7 +445,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': '5e4add6919b4bdc626b3f6a37395097b8fd360fc', + 'dawn_revision': '28d5970cfe844d8627f5eba90b9838f7c493ecab', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -845,7 +845,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - 'bf36310ed848cc85ee85bfc723a3700bed22f392', + '8b7017c9d33cc541ad3023f49a2e78e816e86434', 'condition': 'checkout_android and checkout_src_internal', }, @@ -1281,7 +1281,7 @@ # For Linux and Chromium OS. 'src/third_party/cros_system_api': { - 'url': Var('chromium_git') + '/chromiumos/platform2/system_api.git' + '@' + 'c825bdec3d1f3f7fb19e83ba3c0126a45f31a889', + 'url': Var('chromium_git') + '/chromiumos/platform2/system_api.git' + '@' + 'af6c292682cc02a8112f14d7112e96fc5a95a746', 'condition': 'checkout_linux', }, @@ -1295,13 +1295,13 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '67e56f63826baa6cb218751e4da7d9727c398885', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'af369d8962d91db619be7cad3cd44a054fac782f', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '88a822273e94788edfe19d912122565cc7e8b2d1', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '07ad94e29d169d6849d3164143470848a9f2ef31', 'condition': 'checkout_src_internal', }, @@ -1790,7 +1790,7 @@ Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'ff0bba2e85ce2e2825d28083f1e83ecec6513df2', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '6bbbba9c6aeb4a4448a496d48fcfde141596285a', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3',
diff --git a/android_webview/browser/metrics/README.md b/android_webview/browser/metrics/README.md new file mode 100644 index 0000000..1835dc4 --- /dev/null +++ b/android_webview/browser/metrics/README.md
@@ -0,0 +1,8 @@ +# WebView Metrics + +This folder contains some of the code for Android WebView's metrics support. See +[//components/metrics/](/components/metrics/README) for more information about +metrics in general. + +Googlers can read http://go/clank-webview-uma to learn more about WebView's +metrics support.
diff --git a/android_webview/browser/safe_browsing/aw_url_checker_delegate_impl.cc b/android_webview/browser/safe_browsing/aw_url_checker_delegate_impl.cc index c0aeee7..6dc58e3 100644 --- a/android_webview/browser/safe_browsing/aw_url_checker_delegate_impl.cc +++ b/android_webview/browser/safe_browsing/aw_url_checker_delegate_impl.cc
@@ -18,7 +18,6 @@ #include "android_webview/browser/safe_browsing/aw_safe_browsing_ui_manager.h" #include "android_webview/browser_jni_headers/AwSafeBrowsingConfigHelper_jni.h" #include "android_webview/browser_jni_headers/AwSafeBrowsingSafeModeAction_jni.h" -#include "android_webview/common/aw_features.h" #include "base/android/jni_android.h" #include "base/feature_list.h" #include "base/functional/bind.h" @@ -117,11 +116,8 @@ int render_frame_id, bool originated_from_service_worker) { JNIEnv* env = base::android::AttachCurrentThread(); - if (base::FeatureList::IsEnabled( - android_webview::features::kWebViewSafeBrowsingSafeMode)) { - if (Java_AwSafeBrowsingSafeModeAction_isSafeBrowsingDisabled(env)) { - return true; - } + if (Java_AwSafeBrowsingSafeModeAction_isSafeBrowsingDisabled(env)) { + return true; } const content::GlobalRenderFrameHostId rfh_id(render_process_id,
diff --git a/android_webview/browser/variations/README.md b/android_webview/browser/variations/README.md new file mode 100644 index 0000000..09d01020 --- /dev/null +++ b/android_webview/browser/variations/README.md
@@ -0,0 +1,9 @@ +# WebView Variations + +This folder contains some of the code for Android WebView's variations support. +Variations is the chromium infrastructure for A/B experiments and gradual +rollouts. See [//components/variations/](/components/variations/) for more +information about variations in general. + +Googlers can read http://go/clank-webview-finch to learn more about WebView's +variations support.
diff --git a/android_webview/common/aw_features.cc b/android_webview/common/aw_features.cc index bdca8f5..3934b5d 100644 --- a/android_webview/common/aw_features.cc +++ b/android_webview/common/aw_features.cc
@@ -119,12 +119,6 @@ "WebViewRestrictSensitiveContent", base::FEATURE_DISABLED_BY_DEFAULT); -// Enable doing a JNI call to check safe browsing safe mode status before doing -// a safe browsing check. -BASE_FEATURE(kWebViewSafeBrowsingSafeMode, - "WebViewSafeBrowsingSafeMode", - base::FEATURE_ENABLED_BY_DEFAULT); - // Enable detection of loading mature sites (according to Google SafeSearch) // on WebViews running on supervised user accounts. BASE_FEATURE(kWebViewSupervisedUserSiteDetection,
diff --git a/android_webview/common/aw_features.h b/android_webview/common/aw_features.h index c827f853..a481e90 100644 --- a/android_webview/common/aw_features.h +++ b/android_webview/common/aw_features.h
@@ -36,7 +36,6 @@ BASE_DECLARE_FEATURE(kWebViewRecordAppDataDirectorySize); BASE_DECLARE_FEATURE(kWebViewReportFrameMetrics); BASE_DECLARE_FEATURE(kWebViewRestrictSensitiveContent); -BASE_DECLARE_FEATURE(kWebViewSafeBrowsingSafeMode); BASE_DECLARE_FEATURE(kWebViewSupervisedUserSiteDetection); BASE_DECLARE_FEATURE(kWebViewSupervisedUserSiteBlock); BASE_DECLARE_FEATURE(kWebViewSuppressDifferentOriginSubframeJSDialogs);
diff --git a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java index 46b4fd79c..2f7d06d 100644 --- a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java +++ b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java
@@ -487,9 +487,6 @@ Flag.baseFeature(TracingServiceFeatures.ENABLE_PERFETTO_SYSTEM_TRACING, "When enabled, WebView exports trace events to the Android Perfetto service." + " This works only for Android Q+."), - Flag.baseFeature(AwFeatures.WEBVIEW_SAFE_BROWSING_SAFE_MODE, - "Enable doing a JNI call to check safe browsing safe mode status " - + "before doing a safe browsing check."), Flag.baseFeature(UiAndroidFeatures.CONVERT_TRACKPAD_EVENTS_TO_MOUSE, "Enables converting trackpad click gestures to mouse events" + " in order for them to be interpreted similar to a desktop"
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwSupervisedUserTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwSupervisedUserTest.java index 9e7cdc6..8fc8fec3 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwSupervisedUserTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwSupervisedUserTest.java
@@ -4,6 +4,8 @@ package org.chromium.android_webview.test; +import android.net.Uri; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.test.InstrumentationRegistry; @@ -17,6 +19,8 @@ import org.junit.runner.RunWith; import org.chromium.android_webview.AwContents; +import org.chromium.android_webview.JsReplyProxy; +import org.chromium.android_webview.WebMessageListener; import org.chromium.android_webview.common.AwFeatures; import org.chromium.android_webview.common.AwSupervisedUserUrlClassifierDelegate; import org.chromium.android_webview.common.PlatformServiceBridge; @@ -25,6 +29,9 @@ import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; +import org.chromium.content_public.browser.MessagePayload; +import org.chromium.content_public.browser.MessagePort; +import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.net.test.util.TestWebServer; import org.chromium.url.GURL; @@ -53,15 +60,146 @@ private static final String BLOCKED_SITE_TITLE = "This website is blocked by your parent."; private static String makeTestPage(String title, @Nullable String iFrameUrl) { - return "<html>" - + " <head>" - + " <title>" + title + "</title>" - + " </head>" - + " <body>" - + " Hello world!" - + ((iFrameUrl != null) ? ("<iframe src=\"" + iFrameUrl + "\"/iframe>") : "") - + " </body>" - + "</html>"; + StringBuilder sb = new StringBuilder(); + sb.append("<html><head><title>").append(title).append("</title></head><body>Hello world!"); + if (iFrameUrl != null) { + sb.append("<iframe id='testIframe' src='").append(iFrameUrl).append("'></iframe>"); + sb.append("<script>"); + sb.append("document.getElementById('testIframe').addEventListener('load', function(){"); + sb.append("var title;"); + sb.append("try {"); + sb.append("title = this.contentWindow.document.title"); + sb.append("} catch (error){ if (error.name == 'SecurityError') {title = '") + .append(BLOCKED_SITE_TITLE) + .append("';}}"); + sb.append("myObject.postMessage(title)});"); + sb.append("</script>"); + } + sb.append("</body></html>"); + return sb.toString(); + } + + @Rule + public AwActivityTestRule mActivityTestRule = new AwActivityTestRule(); + + private OnProgressChangedClient mContentsClient = new OnProgressChangedClient(); + private AwContents mAwContents; + private TestWebServer mWebServer; + private IFrameLoadedListener mIFrameLoadedListener = new IFrameLoadedListener(); + + @Before + public void setUp() throws Exception { + mWebServer = TestWebServer.start(); + PlatformServiceBridge.injectInstance(new TestPlatformServiceBridge()); + AwTestContainerView testContainerView = + mActivityTestRule.createAwTestContainerViewOnMainSync(mContentsClient); + mAwContents = testContainerView.getAwContents(); + AwActivityTestRule.enableJavaScriptOnUiThread(mAwContents); + TestThreadUtils.runOnUiThreadBlocking(() -> { + mAwContents.addWebMessageListener( + "myObject", new String[] {"*"}, mIFrameLoadedListener); + }); + } + + @After + public void tearDown() throws Exception { + mActivityTestRule.destroyAwContentsOnMainSync(mAwContents); + mWebServer.shutdown(); + } + + @Test + @SmallTest + @Feature({"AndroidWebView"}) + @CommandLineFlags.Add("enable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK) + public void testAllowedSiteIsLoaded() throws Throwable { + String embeddedUrl = setUpWebPage(SAFE_SITE_IFRAME_PATH, SAFE_SITE_IFRAME_TITLE, null); + String requestUrl = setUpWebPage(SAFE_SITE_PATH, SAFE_SITE_TITLE, embeddedUrl); + + loadUrl(requestUrl); + + assertPageTitle(SAFE_SITE_TITLE); + assertIframeTitle(SAFE_SITE_IFRAME_TITLE); + } + + @Test + @SmallTest + @Feature({"AndroidWebView"}) + @CommandLineFlags.Add("enable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK) + public void testDisallowedSiteIsBlocked() throws Throwable { + String requestUrl = setUpWebPage(MATURE_SITE_PATH, MATURE_SITE_TITLE, null); + + loadUrl(requestUrl); + + assertPageTitle(BLOCKED_SITE_TITLE); + } + + @Test + @SmallTest + @Feature({"AndroidWebView"}) + @CommandLineFlags.Add("enable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK) + public void testDisallowedEmbeddedSiteIsBlocked() throws Throwable { + String embeddedUrl = setUpWebPage(MATURE_SITE_IFRAME_PATH, MATURE_SITE_IFRAME_TITLE, null); + String requestUrl = setUpWebPage(SAFE_SITE_PATH, SAFE_SITE_TITLE, embeddedUrl); + + loadUrl(requestUrl); + + assertPageTitle(SAFE_SITE_TITLE); + assertIframeTitle(BLOCKED_SITE_TITLE); + } + + @Test + @SmallTest + @Feature({"AndroidWebView"}) + @CommandLineFlags.Add("enable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK) + public void testDisallowedSiteRedirectIsBlocked() throws Throwable { + String requestUrl = mWebServer.setRedirect(MATURE_SITE_PATH, SAFE_SITE_PATH); + + loadUrl(requestUrl); + + assertPageTitle(BLOCKED_SITE_TITLE); + } + + @Test + @SmallTest + @Feature({"AndroidWebView"}) + @CommandLineFlags.Add("enable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_BLOCK) + public void testDisallowedRedirectIsBlocked() throws Throwable { + String requestUrl = mWebServer.setRedirect(SAFE_SITE_PATH, MATURE_SITE_PATH); + + loadUrl(requestUrl); + + assertPageTitle(BLOCKED_SITE_TITLE); + } + + @Test + @SmallTest + public void testDisallowedSiteIsLoadedFeatureOff() throws Throwable { + String embeddedUrl = setUpWebPage(MATURE_SITE_IFRAME_PATH, MATURE_SITE_IFRAME_TITLE, null); + String requestUrl = setUpWebPage(MATURE_SITE_PATH, MATURE_SITE_TITLE, embeddedUrl); + + loadUrl(requestUrl); + + assertPageTitle(MATURE_SITE_TITLE); + assertIframeTitle(MATURE_SITE_IFRAME_TITLE); + } + + private String setUpWebPage(String path, String title, @Nullable String iFrameUrl) { + return mWebServer.setResponse(path, makeTestPage(title, iFrameUrl), null); + } + + private void loadUrl(String requestUrl) throws TimeoutException { + InstrumentationRegistry.getInstrumentation().runOnMainSync( + () -> mAwContents.loadUrl(requestUrl, null)); + mContentsClient.waitForFullLoad(); + } + + private void assertPageTitle(String expectedTitle) { + Assert.assertEquals(expectedTitle, mAwContents.getTitle()); + } + + private void assertIframeTitle(String expectedTitle) throws Exception { + String iFrameTitle = mIFrameLoadedListener.waitForResult(); + Assert.assertEquals(expectedTitle, iFrameTitle); } private static class OnProgressChangedClient extends TestAwContentsClient { @@ -82,137 +220,21 @@ } } - @Rule - public AwActivityTestRule mActivityTestRule = new AwActivityTestRule(); + private static class IFrameLoadedListener implements WebMessageListener { + private final CallbackHelper mCallbackHelper = new CallbackHelper(); + private volatile String mResult; - private OnProgressChangedClient mContentsClient = new OnProgressChangedClient(); - private AwContents mAwContents; - private TestWebServer mWebServer; + @Override + public void onPostMessage(MessagePayload payload, Uri sourceOrigin, boolean isMainFrame, + JsReplyProxy replyProxy, MessagePort[] ports) { + mResult = payload.getAsString(); + mCallbackHelper.notifyCalled(); + } - @Before - public void setUp() throws Exception { - mWebServer = TestWebServer.start(); - PlatformServiceBridge.injectInstance(new TestPlatformServiceBridge()); - AwTestContainerView testContainerView = - mActivityTestRule.createAwTestContainerViewOnMainSync(mContentsClient); - mAwContents = testContainerView.getAwContents(); - } - - @After - public void tearDown() throws Exception { - mActivityTestRule.destroyAwContentsOnMainSync(mAwContents); - mWebServer.shutdown(); - } - - @Test - @SmallTest - @Feature({"AndroidWebView"}) - @CommandLineFlags.Add("enable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_DETECTION) - public void testAllowedSiteIsLoaded() throws Throwable { - String embeddedUrl = setUpWebPage(SAFE_SITE_IFRAME_PATH, SAFE_SITE_IFRAME_TITLE, null); - String requestUrl = setUpWebPage(SAFE_SITE_PATH, SAFE_SITE_TITLE, embeddedUrl); - - loadUrl(requestUrl); - - assertPageTitle(SAFE_SITE_TITLE); - // todo(jdeabreu): fix flaky iframe test check - // assertIframeTitle(SAFE_SITE_IFRAME_TITLE); - } - - @Test - @SmallTest - @Feature({"AndroidWebView"}) - @CommandLineFlags.Add("enable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_DETECTION) - public void testDisallowedSiteIsBlocked() throws Throwable { - String requestUrl = setUpWebPage(MATURE_SITE_PATH, MATURE_SITE_TITLE, null); - - loadUrl(requestUrl); - - assertPageTitle(BLOCKED_SITE_TITLE); - } - - @Test - @SmallTest - @Feature({"AndroidWebView"}) - @CommandLineFlags.Add("enable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_DETECTION) - public void testDisallowedEmbeddedSiteIsBlocked() throws Throwable { - String embeddedUrl = setUpWebPage(MATURE_SITE_IFRAME_PATH, MATURE_SITE_IFRAME_TITLE, null); - String requestUrl = setUpWebPage(SAFE_SITE_PATH, SAFE_SITE_TITLE, embeddedUrl); - - loadUrl(requestUrl); - - assertPageTitle(SAFE_SITE_TITLE); - // todo(jdeabreu): fix flaky iframe test check - // assertIframeTitle("null"); - } - - @Test - @SmallTest - @Feature({"AndroidWebView"}) - @CommandLineFlags.Add("enable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_DETECTION) - public void testDisallowedSiteRedirectIsBlocked() throws Throwable { - String requestUrl = mWebServer.setRedirect(MATURE_SITE_PATH, SAFE_SITE_PATH); - - loadUrl(requestUrl); - - assertPageTitle(BLOCKED_SITE_TITLE); - } - - @Test - @SmallTest - @Feature({"AndroidWebView"}) - @CommandLineFlags.Add("enable-features=" + AwFeatures.WEBVIEW_SUPERVISED_USER_SITE_DETECTION) - public void testDisallowedRedirectIsBlocked() throws Throwable { - String requestUrl = mWebServer.setRedirect(SAFE_SITE_PATH, MATURE_SITE_PATH); - - loadUrl(requestUrl); - - assertPageTitle(BLOCKED_SITE_TITLE); - } - - @Test - @SmallTest - public void testDisallowedSiteIsLoadedFeatureOff() throws Throwable { - String embeddedUrl = setUpWebPage(MATURE_SITE_IFRAME_PATH, MATURE_SITE_IFRAME_TITLE, null); - String requestUrl = setUpWebPage(MATURE_SITE_PATH, MATURE_SITE_TITLE, embeddedUrl); - - loadUrl(requestUrl); - - assertPageTitle(MATURE_SITE_TITLE); - // todo(jdeabreu): fix flaky iframe test check - // assertIframeTitle(MATURE_SITE_IFRAME_TITLE); - } - - private String setUpWebPage(String path, String title, @Nullable String iFrameUrl) { - return mWebServer.setResponse(path, makeTestPage(title, iFrameUrl), null); - } - - private void loadUrl(String requestUrl) throws TimeoutException { - InstrumentationRegistry.getInstrumentation().runOnMainSync( - () -> mAwContents.loadUrl(requestUrl, null)); - mContentsClient.waitForFullLoad(); - } - - private void assertPageTitle(String expectedTitle) { - Assert.assertEquals(expectedTitle, mAwContents.getTitle()); - } - - private void assertIframeTitle(String expectedTitle) throws Exception { - AwActivityTestRule.enableJavaScriptOnUiThread(mAwContents); - String iFrameTitle = getJavaScriptResultIframeTitle(mAwContents, mContentsClient); - Assert.assertEquals(expectedTitle, iFrameTitle); - } - - /** - * Like {@link AwActivityTestRule#getJavaScriptResultBodyTextContent}, but it gets the title - * of the iframe instead. This assumes the main frame has only a single iframe. - */ - private String getJavaScriptResultIframeTitle( - final AwContents awContents, final TestAwContentsClient viewClient) throws Exception { - String script = "document.getElementsByTagName('iframe')[0].contentDocument.title"; - String raw = - mActivityTestRule.executeJavaScriptAndWaitForResult(awContents, viewClient, script); - return mActivityTestRule.maybeStripDoubleQuotes(raw); + public String waitForResult() throws TimeoutException { + mCallbackHelper.waitForNext(); + return mResult; + } } private static class TestPlatformServiceBridge extends PlatformServiceBridge {
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingSafeModeTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingSafeModeTest.java index 653312e..bbba2480 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingSafeModeTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingSafeModeTest.java
@@ -29,7 +29,6 @@ import org.chromium.android_webview.safe_browsing.AwSafeBrowsingSafeModeAction; import org.chromium.base.Callback; import org.chromium.base.test.util.CallbackHelper; -import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; import java.util.Set; @@ -63,7 +62,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add({"enable-features=WebViewSafeBrowsingSafeMode"}) public void testSafeBrowsingDisabledForHardcodedMalwareUrl() throws Throwable { SafeModeController safeModeController = SafeModeController.getInstance(); safeModeController.registerActions( @@ -82,7 +80,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add({"enable-features=WebViewSafeBrowsingSafeMode"}) public void testSafeBrowsingDisabledOverridesPerWebViewToggle() throws Throwable { SafeModeController safeModeController = SafeModeController.getInstance(); safeModeController.registerActions(
diff --git a/android_webview/tools/README.md b/android_webview/tools/README.md new file mode 100644 index 0000000..c07d40b --- /dev/null +++ b/android_webview/tools/README.md
@@ -0,0 +1,12 @@ +# WebView Tools + +This folder includes various tools for testing or developing WebView. This code +**should not** be included in the WebView product itself. + +To learn more about python scripts: run the script with the `--help` command. +This should provide basic documentation for what the script does and how to use +it. You may also be able to find additional usage documentation for some scripts +on the subpages of [WebView Docs](/android_webview/docs/README.md). + +To learn more about the System WebView Shell Android app: please read [the usage +documentation](/android_webview/docs/webview-shell.md).
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 4b0ba07..3d0ebb46 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -8,6 +8,7 @@ import("//build/config/ui.gni") import("//chromeos/ash/components/assistant/ambient.gni") import("//chromeos/ash/components/scalable_iph/scalable_iph.gni") +import("//chromeos/components/sensors/buildflags.gni") import("//mojo/public/tools/bindings/mojom.gni") import("//testing/test.gni") import("//tools/grit/repack.gni") @@ -2872,6 +2873,7 @@ "//chromeos/ash/services/recording", "//chromeos/ash/services/recording/public/mojom", "//chromeos/components/quick_answers/public/cpp:prefs", + "//chromeos/components/sensors:buildflags", "//chromeos/components/sensors:sensors", "//chromeos/components/sensors/mojom", "//chromeos/components/webauthn",
diff --git a/ash/accelerometer/accelerometer_reader.cc b/ash/accelerometer/accelerometer_reader.cc index 44290a69..ba8ef86a 100644 --- a/ash/accelerometer/accelerometer_reader.cc +++ b/ash/accelerometer/accelerometer_reader.cc
@@ -9,6 +9,7 @@ #include "base/no_destructor.h" #include "base/task/current_thread.h" #include "base/task/sequenced_task_runner.h" +#include "chromeos/components/sensors/buildflags.h" #include "ash/accelerometer/accelerometer_provider_mojo.h" namespace ash {
diff --git a/ash/components/arc/session/BUILD.gn b/ash/components/arc/session/BUILD.gn index 8ec258d0..320520b 100644 --- a/ash/components/arc/session/BUILD.gn +++ b/ash/components/arc/session/BUILD.gn
@@ -62,6 +62,7 @@ "//chromeos/ash/components/dbus/upstart", "//chromeos/ash/components/memory:memory", "//chromeos/ash/components/system", + "//chromeos/components/sensors:buildflags", "//chromeos/system", "//components/prefs:prefs", "//components/user_manager",
diff --git a/ash/components/arc/session/arc_vm_client_adapter.cc b/ash/components/arc/session/arc_vm_client_adapter.cc index b920777f..388c4b84 100644 --- a/ash/components/arc/session/arc_vm_client_adapter.cc +++ b/ash/components/arc/session/arc_vm_client_adapter.cc
@@ -61,6 +61,7 @@ #include "chromeos/ash/components/dbus/concierge/concierge_client.h" #include "chromeos/ash/components/dbus/debug_daemon/debug_daemon_client.h" #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" +#include "chromeos/components/sensors/buildflags.h" #include "chromeos/dbus/common/dbus_method_call_status.h" #include "chromeos/system/core_scheduling.h" #include "components/user_manager/user_manager.h"
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 1b38a51..4b17cc07 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -2234,7 +2234,7 @@ // Controls whether to show promise icons during web app installations. BASE_FEATURE(kPromiseIconsForWebApps, - "kPromiseIconsForWebApps", + "PromiseIconsForWebApps", base::FEATURE_DISABLED_BY_DEFAULT); // Controls whether the quick dim prototype is enabled. @@ -2753,14 +2753,6 @@ "WallpaperRefreshRevamp", base::FEATURE_ENABLED_BY_DEFAULT); -// Enables special handling of Chrome tab drags from a WebUI tab strip. -// These will be treated similarly to a window drag, showing split view -// indicators in tablet mode, etc. The functionality is behind a flag right now -// since it is under development. -BASE_FEATURE(kWebUITabStripTabDragIntegration, - "WebUITabStripTabDragIntegration", - base::FEATURE_ENABLED_BY_DEFAULT); - // Enables the Welcome Tour that walks new users through ChromeOS System UI. BASE_FEATURE(kWelcomeTour, "WelcomeTour", base::FEATURE_DISABLED_BY_DEFAULT); @@ -3764,7 +3756,7 @@ base::FeatureList::IsEnabled(kOobeDisplaySize); } -bool isOsFeedbackDialogEnabled() { +bool IsOsFeedbackDialogEnabled() { return base::FeatureList::IsEnabled(kOsFeedbackDialog); } @@ -4162,10 +4154,6 @@ return base::FeatureList::IsEnabled(kWallpaperRefreshRevamp); } -bool IsWebUITabStripTabDragIntegrationEnabled() { - return base::FeatureList::IsEnabled(kWebUITabStripTabDragIntegration); -} - bool IsWelcomeTourEnabled() { return base::FeatureList::IsEnabled(kWelcomeTour); }
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index e318153..9aa6d784 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -568,7 +568,7 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kOobeQuickStart); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kOobeTouchpadScroll); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kOobeDisplaySize); -bool isOsFeedbackDialogEnabled(); +COMPONENT_EXPORT(ASH_CONSTANTS) bool IsOsFeedbackDialogEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kOsFeedbackDialog); COMPONENT_EXPORT(ASH_CONSTANTS) @@ -812,8 +812,6 @@ COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kWallpaperRefreshRevamp); COMPONENT_EXPORT(ASH_CONSTANTS) -BASE_DECLARE_FEATURE(kWebUITabStripTabDragIntegration); -COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kWelcomeTour); COMPONENT_EXPORT(ASH_CONSTANTS) BASE_DECLARE_FEATURE(kWelcomeTourForceUserEligibility); @@ -1171,7 +1169,6 @@ bool IsWallpaperGooglePhotosSharedAlbumsEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWallpaperPerDeskEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWallpaperRefreshRevampEnabled(); -COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWebUITabStripTabDragIntegrationEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWelcomeTourEnabled(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWelcomeTourEnabledCounterfactually(); COMPONENT_EXPORT(ASH_CONSTANTS) bool IsWelcomeTourForceUserEligibilityEnabled();
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc index f2026700..3c03dc6 100644 --- a/ash/drag_drop/drag_drop_controller_unittest.cc +++ b/ash/drag_drop/drag_drop_controller_unittest.cc
@@ -27,7 +27,6 @@ #include "base/task/single_thread_task_runner.h" #include "base/test/bind.h" #include "base/test/gmock_callback_support.h" -#include "base/test/scoped_feature_list.h" #include "testing/gmock/include/gmock/gmock.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/aura/client/capture_client.h" @@ -1346,9 +1345,6 @@ // Verifies that a tab drag changes the drag operation to a move. TEST_F(DragDropControllerTest, DragTabChangesDragOperationToMove) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kWebUITabStripTabDragIntegration); - EXPECT_CALL(*mock_shell_delegate(), IsTabDrag(_)) .Times(1) .WillOnce(Return(true)); @@ -1383,9 +1379,6 @@ // Verifies that a tab drag does not crash (UAF) on source window destruction. TEST_F(DragDropControllerTest, DragTabDoesNotCrashOnSourceWindowDestruction) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kWebUITabStripTabDragIntegration); - EXPECT_CALL(*mock_shell_delegate(), IsTabDrag(_)) .Times(1) .WillOnce(Return(true)); @@ -1630,9 +1623,6 @@ } TEST_F(DragDropControllerTest, DragWithChromeTabDelegateTakesCapture) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kWebUITabStripTabDragIntegration); - EXPECT_CALL(*mock_shell_delegate(), IsTabDrag(_)) .Times(1) .WillOnce(Return(true)); @@ -1658,9 +1648,6 @@ // overview (or any other window) on the other, touch and hold a desk mini view // (or that other window) and drag a browser tab simultaneously. TEST_F(DragDropControllerTest, TabletSplitViewDragTwoBrowserTabs) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kWebUITabStripTabDragIntegration); - // Enter tablet mode. Avoid TabletModeController::OnGetSwitchStates() from // disabling tablet mode. base::RunLoop().RunUntilIdle();
diff --git a/ash/drag_drop/tab_drag_drop_delegate.cc b/ash/drag_drop/tab_drag_drop_delegate.cc index 844fd33..05d4afc 100644 --- a/ash/drag_drop/tab_drag_drop_delegate.cc +++ b/ash/drag_drop/tab_drag_drop_delegate.cc
@@ -82,9 +82,6 @@ // static bool TabDragDropDelegate::IsChromeTabDrag(const ui::OSExchangeData& drag_data) { - if (!features::IsWebUITabStripTabDragIntegrationEnabled()) - return false; - return Shell::Get()->shell_delegate()->IsTabDrag(drag_data); }
diff --git a/ash/drag_drop/tab_drag_drop_delegate_unittest.cc b/ash/drag_drop/tab_drag_drop_delegate_unittest.cc index 10ecbaa..8720ce79 100644 --- a/ash/drag_drop/tab_drag_drop_delegate_unittest.cc +++ b/ash/drag_drop/tab_drag_drop_delegate_unittest.cc
@@ -79,8 +79,7 @@ public: TabDragDropDelegateTest() { scoped_feature_list_.InitWithFeatures( - {features::kWebUITabStripTabDragIntegration, - chromeos::wm::features::kWindowLayoutMenu}, + {chromeos::wm::features::kWindowLayoutMenu}, /*disabled_features=*/{}); }
diff --git a/ash/webui/camera_app_ui/resources/.eslintrc.js b/ash/webui/camera_app_ui/resources/.eslintrc.js index e92f3c4..29822b2a 100644 --- a/ash/webui/camera_app_ui/resources/.eslintrc.js +++ b/ash/webui/camera_app_ui/resources/.eslintrc.js
@@ -798,6 +798,29 @@ // find a way to keep running it on presubmit check. allowAny: true, }], + + // Prevent floating promises, since promises that are not awaited usually + // indicates improper sequencing that might cause race, and if the + // promise is rejected, the error is only logged by unhandled promise + // rejection, and not propagated to caller. + // + // There are several potential ways to fix the lint error if you + // encounter this: + // * If the caller should wait for the promise, make the caller async and + // await the promise. + // * If the caller doesn't want to wait for the promise, and the promise + // is some kind of "job" that should be run independently but multiple + // jobs shouldn't be run at the same time, consider using AsyncJobQueue + // in async_job_queue.ts. + // * As a last resort, add "void" before the promise to suppress the + // lint, ideally with a comment explaining why that is needed, check + // that there won't be issue if multiple of those promises got created + // at the same time, and check that error handling with unhandled + // promise rejection is sufficient. + '@typescript-eslint/no-floating-promises': 'error', + '@typescript-eslint/require-await': 'error', + '@typescript-eslint/await-thenable': 'error', + '@typescript-eslint/no-meaningless-void-operator': 'error', }, }], };
diff --git a/ash/webui/camera_app_ui/resources/.eslintrc_floating_promise.js b/ash/webui/camera_app_ui/resources/.eslintrc_floating_promise.js deleted file mode 100644 index 70154a2..0000000 --- a/ash/webui/camera_app_ui/resources/.eslintrc_floating_promise.js +++ /dev/null
@@ -1,16 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -const config = require('./.eslintrc.js'); - -const tsOverride = config['overrides'][0]; -tsOverride.rules = { - ...tsOverride.rules, - '@typescript-eslint/no-floating-promises': 'error', - '@typescript-eslint/require-await': 'error', - '@typescript-eslint/await-thenable': 'error', - '@typescript-eslint/no-meaningless-void-operator': 'error', -}; - -module.exports = config;
diff --git a/ash/webui/camera_app_ui/resources/js/animation.ts b/ash/webui/camera_app_ui/resources/js/animation.ts index fc30b06f..3da96f8 100644 --- a/ash/webui/camera_app_ui/resources/js/animation.ts +++ b/ash/webui/camera_app_ui/resources/js/animation.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import {assertExists, assertInstanceof} from './assert.js'; -import {AsyncJobQueue} from './async_job_queue.js'; +import {AsyncJobInfo, AsyncJobQueue} from './async_job_queue.js'; const jobQueueMap = new Map<HTMLElement, AsyncJobQueue>(); @@ -44,13 +44,12 @@ * * @param el Target element to apply "animate" class. * @param changeElement Function to change the target element before animation. - * @return Promise resolved when the animation is settled. */ -export async function play( - el: HTMLElement, changeElement?: () => void): Promise<void> { +export function play( + el: HTMLElement, changeElement?: () => void): AsyncJobInfo { cancel(el); const queue = getQueueFor(el); - async function job() { + return queue.push(async () => { void el.offsetWidth; // Force repaint before applying the animation. if (changeElement !== undefined) { changeElement(); @@ -58,6 +57,5 @@ el.classList.add('animate'); await Promise.allSettled(getAnimations(el).map((a) => a.finished)); el.classList.remove('animate'); - } - await queue.push(job).result; + }); }
diff --git a/ash/webui/camera_app_ui/resources/js/async_job_queue.ts b/ash/webui/camera_app_ui/resources/js/async_job_queue.ts index 21c02c9..1e08c56 100644 --- a/ash/webui/camera_app_ui/resources/js/async_job_queue.ts +++ b/ash/webui/camera_app_ui/resources/js/async_job_queue.ts
@@ -30,12 +30,17 @@ /** * Returned by `AsyncJobQueue.push` containing `result` of the queued job. */ -interface AsyncJobInfo { +export interface AsyncJobInfo { /** * The result of the job. Resolved when the job is finished, cleared or * dropped, and rejected if the job is run but throws an error. * TODO(pihsun): returns different state for cleared or dropped case if * there's use for it. + * TODO(pihsun): really returns the return value of the job from this if + * there's use case for it. For now all places that use AsyncJobQueue and + * need result use AsyncJobWithResultQueue, which doesn't support clearing and + * mode other than 'enqueue', but has a simpler typing because the return + * value always exist. */ result: Promise<void>; }
diff --git a/ash/webui/camera_app_ui/resources/js/barcode_chip.ts b/ash/webui/camera_app_ui/resources/js/barcode_chip.ts index 57e3139..6dc37a95 100644 --- a/ash/webui/camera_app_ui/resources/js/barcode_chip.ts +++ b/ash/webui/camera_app_ui/resources/js/barcode_chip.ts
@@ -97,7 +97,7 @@ dom.getFrom(container, '.barcode-copy-button', HTMLButtonElement); copyButton.onclick = async () => { await navigator.clipboard.writeText(content); - await snackbar.show(snackbarLabel); + snackbar.show(snackbarLabel); }; return copyButton; }
diff --git a/ash/webui/camera_app_ui/resources/js/custom_effect.ts b/ash/webui/camera_app_ui/resources/js/custom_effect.ts index f7fa5f4c..34b3dc8 100644 --- a/ash/webui/camera_app_ui/resources/js/custom_effect.ts +++ b/ash/webui/camera_app_ui/resources/js/custom_effect.ts
@@ -65,7 +65,7 @@ this.parent.appendChild(template); // We don't care about waiting for the single ripple animation to end // before returning. - void animation.play(ripple).then(() => { + void animation.play(ripple).result.then(() => { ripple.remove(); }); }
diff --git a/ash/webui/camera_app_ui/resources/js/snackbar.ts b/ash/webui/camera_app_ui/resources/js/snackbar.ts index 77de496..dc306f6 100644 --- a/ash/webui/camera_app_ui/resources/js/snackbar.ts +++ b/ash/webui/camera_app_ui/resources/js/snackbar.ts
@@ -13,8 +13,7 @@ * @param label The label of the message to show. * @param substitutions The substitutions for the label. */ -export async function show( - label: I18nString, ...substitutions: string[]): Promise<void> { +export function show(label: I18nString, ...substitutions: string[]): void { // TTS speaks changes of on-screen aria-live elements. Force content changes // and clear content once inactive to avoid stale content being read out. const message = loadTimeData.getI18nMessage(label, ...substitutions); @@ -23,5 +22,5 @@ element.textContent = ''; // Force reiterate the same message for a11y. element.textContent = message; } - await animate.play(element, changeElement); + animate.play(element, changeElement); }
diff --git a/ash/webui/camera_app_ui/resources/js/toast.ts b/ash/webui/camera_app_ui/resources/js/toast.ts index 078a530..3f104ff1 100644 --- a/ash/webui/camera_app_ui/resources/js/toast.ts +++ b/ash/webui/camera_app_ui/resources/js/toast.ts
@@ -20,10 +20,7 @@ element.textContent = ''; // Force reiterate the same message for a11y. element.textContent = message; } - // TODO(pihsun): Should this be awaited? Maybe should change animate.play to - // two parts, one wait until animation is played and another wait until it's - // settled. - void animate.play(element, changeElement); + animate.play(element, changeElement); } /**
diff --git a/ash/webui/camera_app_ui/resources/js/util.ts b/ash/webui/camera_app_ui/resources/js/util.ts index 68229cf..c790072e 100644 --- a/ash/webui/camera_app_ui/resources/js/util.ts +++ b/ash/webui/camera_app_ui/resources/js/util.ts
@@ -248,7 +248,7 @@ const ripple = assertInstanceof(tpl.querySelector('.inkdrop-ripple'), HTMLElement); el.appendChild(tpl); - el.addEventListener('click', async (e) => { + el.addEventListener('click', (e) => { const tRect = assertInstanceof(e.target, HTMLElement).getBoundingClientRect(); const elRect = el.getBoundingClientRect(); @@ -260,7 +260,7 @@ el.style.setProperty('--drop-x', `${dropX}px`); el.style.setProperty('--drop-y', `${dropY}px`); el.style.setProperty('--drop-radius', `${radius}px`); - await animate.play(ripple); + animate.play(ripple); }); }
diff --git a/ash/webui/camera_app_ui/resources/js/views/camera.ts b/ash/webui/camera_app_ui/resources/js/views/camera.ts index 796332c..0d35b56 100644 --- a/ash/webui/camera_app_ui/resources/js/views/camera.ts +++ b/ash/webui/camera_app_ui/resources/js/views/camera.ts
@@ -727,7 +727,7 @@ playShutterEffect(): void { void sound.play(dom.get('#sound-shutter', HTMLAudioElement)); - void animate.play(this.cameraManager.getPreviewVideo().video); + animate.play(this.cameraManager.getPreviewVideo().video); } private getLowStorageDialogKeys(dialogType: LowStorageDialogType) {
diff --git a/ash/webui/camera_app_ui/resources/js/views/camera/options.ts b/ash/webui/camera_app_ui/resources/js/views/camera/options.ts index 7e888f35..c1a2dcb 100644 --- a/ash/webui/camera_app_ui/resources/js/views/camera/options.ts +++ b/ash/webui/camera_app_ui/resources/js/views/camera/options.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import * as animate from '../../animation.js'; -import {assert} from '../../assert.js'; +import {assert, assertExists} from '../../assert.js'; import { CameraConfig, CameraInfo, @@ -56,13 +56,13 @@ constructor(private readonly cameraManager: CameraManager) { this.cameraManager.registerCameraUI(this); - this.switchDeviceButton.addEventListener('click', async () => { + this.switchDeviceButton.addEventListener('click', () => { if (state.get(state.State.TAKING)) { return; } const switching = this.cameraManager.switchCamera(); if (switching !== null) { - await animate.play(dom.get('#switch-device', HTMLElement)); + animate.play(dom.get('#switch-device', HTMLElement)); } }); dom.get('#open-settings', HTMLButtonElement) @@ -80,15 +80,16 @@ } private setAriaLabelForOptionButton( - element: HTMLElement, titleLabel: I18nString, - stateOptions: StateOption[]) { + element: HTMLElement, titleLabel: I18nString, stateOptions: StateOption[], + ariaDescribedByElement: HTMLElement) { element.setAttribute('i18n-label', titleLabel); for (const {ariaLabel, state: targetState, isDisableOption = false} of stateOptions) { const stateEnabled = state.get(targetState); if ((stateEnabled && !isDisableOption) || (!stateEnabled && isDisableOption)) { - element.setAttribute('i18n-aria', ariaLabel); + ariaDescribedByElement.setAttribute('i18n-text', ariaLabel); + util.setupI18nElements(ariaDescribedByElement); break; } } @@ -110,8 +111,10 @@ }, ]; const titleLabel = I18nString.OPEN_MIRROR_PANEL_BUTTON; + const ariaDescribedByElement = + this.createAriaDescribedByElement(this.openMirrorPanel); this.setAriaLabelForOptionButton( - this.openMirrorPanel, titleLabel, stateOptions); + this.openMirrorPanel, titleLabel, stateOptions, ariaDescribedByElement); this.openMirrorPanel.addEventListener('click', () => { nav.open(ViewName.OPTION_PANEL, new OptionPanelOptions({ triggerButton: this.openMirrorPanel, @@ -122,6 +125,7 @@ state.set(state.State.MIRROR, enabled); this.saveMirroring(enabled); }, + ariaDescribedByElement, })); }); } @@ -151,8 +155,10 @@ }, ]; const titleLabel = I18nString.OPEN_GRID_PANEL_BUTTON; + const ariaDescribedByElement = + this.createAriaDescribedByElement(this.openGridPanel); this.setAriaLabelForOptionButton( - this.openGridPanel, titleLabel, stateOptions); + this.openGridPanel, titleLabel, stateOptions, ariaDescribedByElement); this.openGridPanel.addEventListener('click', () => { nav.open(ViewName.OPTION_PANEL, new OptionPanelOptions({ triggerButton: this.openGridPanel, @@ -166,6 +172,7 @@ state.set(s, newState === s); } }, + ariaDescribedByElement, })); }); } @@ -190,8 +197,10 @@ }, ]; const titleLabel = I18nString.OPEN_TIMER_PANEL_BUTTON; + const ariaDescribedByElement = + this.createAriaDescribedByElement(this.openTimerPanel); this.setAriaLabelForOptionButton( - this.openTimerPanel, titleLabel, stateOptions); + this.openTimerPanel, titleLabel, stateOptions, ariaDescribedByElement); this.openTimerPanel.addEventListener('click', () => { nav.open( ViewName.OPTION_PANEL, new OptionPanelOptions({ @@ -205,6 +214,7 @@ state.set(s, newState === s); } }, + ariaDescribedByElement, })); }); } @@ -310,4 +320,19 @@ this.audioTrack.enabled = state.get(state.State.MIC); } } + + /** + * Creates an element as `triggerButton`'s aria-describedby reference. The id + * of the created element is the ID of `triggerButton` with the suffix + * "-desc". + */ + private createAriaDescribedByElement(triggerButton: HTMLElement) { + const element = document.createElement('div'); + const parent = assertExists(triggerButton.parentElement); + element.id = `${triggerButton.id}-desc`; + element.hidden = true; + parent.insertBefore(element, triggerButton); + triggerButton.setAttribute('aria-describedby', element.id); + return element; + } }
diff --git a/ash/webui/camera_app_ui/resources/js/views/camera/timertick.ts b/ash/webui/camera_app_ui/resources/js/views/camera/timertick.ts index 52a832bc..0c050d5 100644 --- a/ash/webui/camera_app_ui/resources/js/views/camera/timertick.ts +++ b/ash/webui/camera_app_ui/resources/js/views/camera/timertick.ts
@@ -57,8 +57,7 @@ void play(dom.get(sound, HTMLAudioElement)); } tickMsg.textContent = tickCounter + ''; - // Not waiting for animation to finish playing. - void animate.play(tickMsg); + animate.play(tickMsg); tickTimeout = setTimeout(onTimerTick, 1000); tickCounter--; }
diff --git a/ash/webui/camera_app_ui/resources/js/views/option_panel.ts b/ash/webui/camera_app_ui/resources/js/views/option_panel.ts index a3bf07b..eb34a9d 100644 --- a/ash/webui/camera_app_ui/resources/js/views/option_panel.ts +++ b/ash/webui/camera_app_ui/resources/js/views/option_panel.ts
@@ -33,8 +33,13 @@ } override entering(options: EnterOptions): void { - const {triggerButton, titleLabel, stateOptions, onStateChanged} = - assertInstanceof(options, OptionPanelOptions); + const { + triggerButton, + titleLabel, + stateOptions, + onStateChanged, + ariaDescribedByElement, + } = assertInstanceof(options, OptionPanelOptions); const {bottom, right} = triggerButton.getBoundingClientRect(); this.panel.style.bottom = `${window.innerHeight - bottom}px`; this.panel.style.left = `${right + 6}px`; @@ -61,8 +66,8 @@ input.checked = checked; input.addEventListener('change', () => { if (input.checked) { - triggerButton.setAttribute('i18n-aria', ariaLabel); - util.setupI18nElements(triggerButton); + ariaDescribedByElement.setAttribute('i18n-text', ariaLabel); + util.setupI18nElements(ariaDescribedByElement); speak(ariaLabel); onStateChanged(isDisableOption ? null : targetState);
diff --git a/ash/webui/camera_app_ui/resources/js/views/view.ts b/ash/webui/camera_app_ui/resources/js/views/view.ts index 0fafed849..1fb727b 100644 --- a/ash/webui/camera_app_ui/resources/js/views/view.ts +++ b/ash/webui/camera_app_ui/resources/js/views/view.ts
@@ -82,16 +82,26 @@ readonly onStateChanged: (newState: state.State|null) => void; - constructor({triggerButton, titleLabel, stateOptions, onStateChanged}: { + readonly ariaDescribedByElement: HTMLElement; + + constructor({ + triggerButton, + titleLabel, + stateOptions, + onStateChanged, + ariaDescribedByElement, + }: { triggerButton: HTMLElement, titleLabel: I18nString, stateOptions: StateOption[], onStateChanged: (newState: state.State|null) => void, + ariaDescribedByElement: HTMLElement, }) { this.triggerButton = triggerButton; this.titleLabel = titleLabel; this.stateOptions = stateOptions; this.onStateChanged = onStateChanged; + this.ariaDescribedByElement = ariaDescribedByElement; } }
diff --git a/ash/webui/os_feedback_ui/BUILD.gn b/ash/webui/os_feedback_ui/BUILD.gn index bc26e84..fc7fd63e 100644 --- a/ash/webui/os_feedback_ui/BUILD.gn +++ b/ash/webui/os_feedback_ui/BUILD.gn
@@ -28,6 +28,7 @@ "//chromeos/strings/", "//content/public/browser", "//ui/resources", + "//ui/web_dialogs", "//ui/webui", ] }
diff --git a/ash/webui/os_feedback_ui/DEPS b/ash/webui/os_feedback_ui/DEPS index 93138d4..f01f19e 100644 --- a/ash/webui/os_feedback_ui/DEPS +++ b/ash/webui/os_feedback_ui/DEPS
@@ -1,4 +1,5 @@ include_rules = [ "+ui/resources", "+ui/webui", + "+ui/web_dialogs", ]
diff --git a/ash/webui/os_feedback_ui/os_feedback_ui.cc b/ash/webui/os_feedback_ui/os_feedback_ui.cc index 24d4b3e..82824a9 100644 --- a/ash/webui/os_feedback_ui/os_feedback_ui.cc +++ b/ash/webui/os_feedback_ui/os_feedback_ui.cc
@@ -23,6 +23,7 @@ #include "content/public/common/url_constants.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "ui/resources/grit/webui_resources.h" +#include "ui/web_dialogs/web_dialog_ui.h" #include "ui/webui/color_change_listener/color_change_handler.h" #include "ui/webui/mojo_web_ui_controller.h" #include "ui/webui/webui_allowlist.h" @@ -138,7 +139,7 @@ OSFeedbackUI::OSFeedbackUI( content::WebUI* web_ui, std::unique_ptr<OsFeedbackDelegate> feedback_delegate) - : MojoWebUIController(web_ui) { + : ui::MojoWebDialogUI(web_ui) { auto* browser_context = web_ui->GetWebContents()->GetBrowserContext(); content::WebUIDataSource* source = content::WebUIDataSource::CreateAndAdd( browser_context, kChromeUIOSFeedbackHost);
diff --git a/ash/webui/os_feedback_ui/os_feedback_ui.h b/ash/webui/os_feedback_ui/os_feedback_ui.h index da62f30..f4154686 100644 --- a/ash/webui/os_feedback_ui/os_feedback_ui.h +++ b/ash/webui/os_feedback_ui/os_feedback_ui.h
@@ -13,6 +13,7 @@ #include "ash/webui/os_feedback_ui/mojom/os_feedback_ui.mojom.h" #include "ash/webui/os_feedback_ui/url_constants.h" #include "content/public/common/url_constants.h" +#include "ui/web_dialogs/web_dialog_ui.h" #include "ui/webui/mojo_web_ui_controller.h" #include "ui/webui/resources/cr_components/color_change_listener/color_change_listener.mojom.h" @@ -38,7 +39,7 @@ create_controller_func) {} }; -class OSFeedbackUI : public ui::MojoWebUIController { +class OSFeedbackUI : public ui::MojoWebDialogUI { public: OSFeedbackUI(content::WebUI* web_ui, std::unique_ptr<OsFeedbackDelegate> feedback_delegate);
diff --git a/ash/webui/os_feedback_ui/resources/feedback_flow.js b/ash/webui/os_feedback_ui/resources/feedback_flow.js index 3f3b0d4..09bff23 100644 --- a/ash/webui/os_feedback_ui/resources/feedback_flow.js +++ b/ash/webui/os_feedback_ui/resources/feedback_flow.js
@@ -8,6 +8,7 @@ import './share_data_page.js'; import './strings.m.js'; +import {assert} from 'chrome://resources/ash/common/assert.js'; import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js'; import {ColorChangeUpdater} from 'chrome://resources/cr_components/color_change_listener/colors_css_updater.js'; import {stringToMojoString16} from 'chrome://resources/js/mojo_type_util.js'; @@ -175,7 +176,9 @@ feedbackContext_: {type: FeedbackContext, readonly: false, notify: true}, }; } - + /** + * @suppress {missingProperties} + */ constructor() { super(); @@ -280,6 +283,15 @@ * @private */ this.noHelpContentDisplayed_; + + /** + * When the feedback tool is opened as a dialog, feedback context is passed + * to front end via dialog args. + * + * @type {string} + * @private + */ + this.dialogArgs_ = chrome.getVariableValue('dialogArguments'); } connectedCallback() { @@ -304,16 +316,11 @@ ready() { super.ready(); - - this.feedbackServiceProvider_.getFeedbackContext().then((response) => { - this.feedbackContext_ = response.feedbackContext; - this.setAdditionalContextFromQueryParams_(); - this.shouldShowAssistantCheckbox_ = !!this.feedbackContext_ && - this.feedbackContext_.isInternalAccount && - this.feedbackContext_.fromAssistant; - this.shouldShowAutofillCheckbox_ = - !!this.feedbackContext_ && this.feedbackContext_.fromAutofill; - }); + if (this.dialogArgs_ && this.dialogArgs_.length > 0) { + this.initializeForDialogMode_(); + } else { + this.initializeForNonDialogMode_(); + } window.addEventListener('message', event => { if (event.data.id !== HELP_CONTENT_CLICKED) { @@ -381,6 +388,63 @@ } /** + * @suppress {checkTypes} suppress feedbackInfo type check in closure + * compiler. + * TODO(http://b/issues/233080620): Add a type definition for feedbackInfo. + * + * @private + */ + initializeForDialogMode_() { + // This is on Dialog mode. The `dialogArgs_` contains feedback context + // info. + const feedbackInfo = JSON.parse(this.dialogArgs_); + assert(!!feedbackInfo); + this.feedbackContext_ = { + assistantDebugInfoAllowed: false, + fromSettingsSearch: feedbackInfo.fromSettingsSearch, + isInternalAccount: feedbackInfo.isInternalAccount, + traceId: feedbackInfo.traceId, + pageUrl: {url: feedbackInfo.pageUrl}, + fromAssistant: feedbackInfo.fromAssistant, + fromAutofill: feedbackInfo.fromAutofill, + autofillMetadata: feedbackInfo.autofillMetadata ? + JSON.stringify(feedbackInfo.autofillMetadata) : + '', + hasLinkedCrossDevicePhone: feedbackInfo.hasLinkedCrossDevicePhone, + categoryTag: feedbackInfo.categoryTag, + }; + this.descriptionTemplate_ = feedbackInfo.description; + this.descriptionPlaceholderText_ = feedbackInfo.descriptionPlaceholder; + if (feedbackInfo.systemInformation?.length == 1) { + // Currently, one extra diagnostics string may be passed to feedback + // app. + // + // Sample input: + //" systemInformation": [ + // { + // "key": "EXTRA_DIAGNOSTICS", + // "value": "extra log data" + // } + // ]. + assert('EXTRA_DIAGNOSTICS' === feedbackInfo.systemInformation[0].key); + this.feedbackContext_.extraDiagnostics = + feedbackInfo.systemInformation[0].value; + } + this.onFeedbackContextReceived_(); + } + + /** + * @private + */ + initializeForNonDialogMode_() { + this.feedbackServiceProvider_.getFeedbackContext().then((response) => { + this.feedbackContext_ = response.feedbackContext; + this.setAdditionalContextFromQueryParams_(); + this.onFeedbackContextReceived_(); + }); + } + + /** * @private */ fetchScreenshot_() { @@ -399,6 +463,16 @@ } /** + * @private + */ + onFeedbackContextReceived_() { + assert(this.feedbackContext_); + this.shouldShowAssistantCheckbox_ = + this.feedbackContext_.isInternalAccount && + this.feedbackContext_.fromAssistant; + this.shouldShowAutofillCheckbox_ = this.feedbackContext_.fromAutofill; + } + /** * Sets additional context passed from RequestFeedbackFlow as part of the URL. * See `AdditionalContextQueryParam` for valid query parameters. * @private @@ -610,6 +684,20 @@ } /** + * @returns {?string} + */ + getDescriptionTemplateForTesting() { + return this.descriptionTemplate_; + } + + /** + * @returns {?string} + */ + getDescriptionPlaceholderTextForTesting() { + return this.descriptionPlaceholderText_; + } + + /** * Checks if any keywords related to bluetooth have been typed. If they are, * we show the bluetooth logs option, otherwise hide it. * @return {boolean}
diff --git a/base/memory/raw_ptr_liveness.dot b/base/memory/raw_ptr_liveness.dot index 0876f0f..c8162cb8 100644 --- a/base/memory/raw_ptr_liveness.dot +++ b/base/memory/raw_ptr_liveness.dot
@@ -1,5 +1,5 @@ digraph { - graph[bgcolor=transparent] + graph[bgcolor=white] node[shape=box] component[label="Is it a\ncomponent\nbuild?"]
diff --git a/base/memory/raw_ptr_liveness.png b/base/memory/raw_ptr_liveness.png index 6778b67c..8f69f6b 100644 --- a/base/memory/raw_ptr_liveness.png +++ b/base/memory/raw_ptr_liveness.png Binary files differ
diff --git a/base/trace_event/common/trace_event_common.h b/base/trace_event/common/trace_event_common.h index f2ee4d36..c1bb2e2 100644 --- a/base/trace_event/common/trace_event_common.h +++ b/base/trace_event/common/trace_event_common.h
@@ -195,7 +195,7 @@ // use_perfetto_client_library GN arg. If that flag is disabled, we fall back to // the legacy implementation in the latter half of this file (and // trace_event.h). -// TODO(skyostil): Remove the legacy macro implementation. +// TODO(skyostil, crbug.com/1006541): Remove the legacy macro implementation. // Normally we'd use BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) for this, but // because v8 includes trace_event_common.h directly (in non-Perfetto mode), we
diff --git a/base/tracing/README.md b/base/tracing/README.md index fac9f22f..1231441 100644 --- a/base/tracing/README.md +++ b/base/tracing/README.md
@@ -22,5 +22,5 @@ [Typed trace events in //base](https://docs.google.com/document/d/1UQ4Ez7B-TeowijOUuMXuoWj1amZcQ7E2abt3s4jaAEY/edit#). -Note: The integration with Perfetto's SDK is work-in-progress behind the gn flag -"use_perfetto_client_library". \ No newline at end of file +Note: The integration with Perfetto's SDK is work-in-progress (https://crbug.com/1006541) behind +the gn flag "use_perfetto_client_library".
diff --git a/build/android/pylib/local/device/local_device_environment.py b/build/android/pylib/local/device/local_device_environment.py index 582e690..39b90d0 100644 --- a/build/android/pylib/local/device/local_device_environment.py +++ b/build/android/pylib/local/device/local_device_environment.py
@@ -86,6 +86,26 @@ return decorator +# TODO(b/293175593): Use PlaceNomediaFile after +# https://crrev.com/c/4877296 lands +def place_nomedia_on_device(dev, device_root, as_root=False): + """Places .nomedia file in test data root. + + This helps to prevent system from scanning media files inside test data. + + Args: + dev: Device to place .nomedia file. + device_root: Base path on device to place .nomedia file. + """ + + dev.RunShellCommand(['mkdir', '-p', device_root], + check_return=True, + as_root=as_root) + dev.WriteFile('%s/.nomedia' % device_root, + 'https://crbug.com/796640', + as_root=as_root) + + # TODO(1262303): After Telemetry is supported by python3 we can re-add # super without arguments in this script. # pylint: disable=super-with-arguments
diff --git a/build/android/pylib/local/device/local_device_gtest_run.py b/build/android/pylib/local/device/local_device_gtest_run.py index 0b49651..86fe489 100644 --- a/build/android/pylib/local/device/local_device_gtest_run.py +++ b/build/android/pylib/local/device/local_device_gtest_run.py
@@ -430,7 +430,8 @@ host_device_tuples_substituted = [ (h, local_device_test_run.SubstituteDeviceRoot(d, device_root)) for h, d in host_device_tuples] - dev.PlaceNomediaFile(device_root) + local_device_environment.place_nomedia_on_device( + dev, device_root, as_root=self._env.force_main_user) dev.PushChangedFiles( host_device_tuples_substituted, delete_device_stale=True,
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 bb65d80b..d2f225b 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
@@ -454,7 +454,7 @@ logging.info('Pushing data dependencies.') for h, d in host_device_tuples_substituted: logging.debug(' %r -> %r', h, d) - dev.PlaceNomediaFile(device_root) + local_device_environment.place_nomedia_on_device(dev, device_root) dev.PushChangedFiles(host_device_tuples_substituted, delete_device_stale=True, as_root=self._env.force_main_user)
diff --git a/build/config/siso/PRESUBMIT.py b/build/config/siso/PRESUBMIT.py index e0c67e9..5e4f6aa 100644 --- a/build/config/siso/PRESUBMIT.py +++ b/build/config/siso/PRESUBMIT.py
@@ -18,6 +18,7 @@ "Cq-Include-Trybots: luci.chromium.try:android-arm64-siso-rel\n" "Cq-Include-Trybots: luci.chromium.try:android-nougat-x86-siso-rel\n" "Cq-Include-Trybots: luci.chromium.try:fuchsia-x64-cast-receiver-siso-rel\n" + "Cq-Include-Trybots: luci.chromium.try:mac-siso-rel\n" "Cq-Include-Trybots: luci.chromium.try:linux-chromeos-siso-rel\n" "Cq-Include-Trybots: luci.chromium.try:linux-lacros-siso-rel\n" "Cq-Include-Trybots: luci.chromium.try:linux-siso-rel\n"
diff --git a/buildtools/.gitignore b/buildtools/.gitignore index ca155dd8..a85d420c 100644 --- a/buildtools/.gitignore +++ b/buildtools/.gitignore
@@ -1,17 +1,17 @@ *.pyc -android/doclava.tar.gz -android/doclava/ -clang_format/script/ -linux64/.versions -linux64/clang-format -linux64/gn -mac/.versions -mac/clang-format -mac/gn -reclient -third_party/libc++/trunk -third_party/libc++abi/trunk -third_party/libunwind/trunk -win/.versions -win/clang-format.exe -win/gn.exe +/android/doclava.tar.gz +/android/doclava/ +/clang_format/script/ +/linux64/.versions/ +/linux64/clang-format +/linux64/gn +/mac/.versions/ +/mac/clang-format +/mac/gn +/reclient/ +/third_party/libc++/trunk +/third_party/libc++abi/trunk +/third_party/libunwind/trunk +/win/.versions +/win/clang-format.exe +/win/gn.exe
diff --git a/cc/raster/one_copy_raster_buffer_provider.cc b/cc/raster/one_copy_raster_buffer_provider.cc index 1d1ad9e..66c2fbc 100644 --- a/cc/raster/one_copy_raster_buffer_provider.cc +++ b/cc/raster/one_copy_raster_buffer_provider.cc
@@ -52,6 +52,10 @@ "OneCopyRasterBufferPlaybackNormalThreadPriority", base::FEATURE_ENABLED_BY_DEFAULT); +BASE_FEATURE(kAlwaysUseMappableSIForOneCopyRaster, + "AlwaysUseMappableSIForOneCopyRaster", + base::FEATURE_ENABLED_BY_DEFAULT); + } // namespace // Subclass for InUsePoolResource that holds ownership of a one-copy backing @@ -337,6 +341,12 @@ const RasterSource::PlaybackSettings& playback_settings, uint64_t previous_content_id, uint64_t new_content_id) { + is_shared_memory_ = false; + std::unique_ptr<gpu::SharedImageInterface::ScopedMapping> mapping; + gfx::GpuMemoryBuffer* buffer = nullptr; + void* memory = nullptr; + size_t stride = 0; + gfx::Rect playback_rect = raster_full_rect; if (use_partial_raster_ && previous_content_id) { // Reduce playback rect to dirty region if the content id of the staging @@ -348,46 +358,77 @@ float full_rect_size = raster_full_rect.size().GetArea(); - // Allocate GpuMemoryBuffer if necessary. - if (!staging_buffer->gpu_memory_buffer) { - staging_buffer->gpu_memory_buffer = - gpu_memory_buffer_manager_->CreateGpuMemoryBuffer( - staging_buffer->size, - viz::SinglePlaneSharedImageFormatToBufferFormat(format), - gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, gpu::kNullSurfaceHandle, - shutdown_event_); + if (base::FeatureList::IsEnabled(kAlwaysUseMappableSIForOneCopyRaster)) { + CHECK(!staging_buffer->gpu_memory_buffer); + + auto* sii = worker_context_provider_->SharedImageInterface(); + + // Allocate MappableSharedImage if necessary. + if (staging_buffer->mailbox.IsZero()) { + staging_buffer->mailbox = sii->CreateSharedImage( + format, staging_buffer->size, dst_color_space, + kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, + gpu::SHARED_IMAGE_USAGE_CPU_WRITE, "OneCopyRasterStaging", + gpu::kNullSurfaceHandle, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE); + } + + mapping = sii->MapSharedImage(staging_buffer->mailbox); + if (!mapping) { + LOG(ERROR) << "MapSharedImage Failed."; + return false; + } + memory = mapping->Memory(0); + stride = mapping->Stride(0); + is_shared_memory_ = mapping->IsSharedMemory(); + } else { + // Allocate GpuMemoryBuffer if necessary. + if (!staging_buffer->gpu_memory_buffer) { + staging_buffer->gpu_memory_buffer = + gpu_memory_buffer_manager_->CreateGpuMemoryBuffer( + staging_buffer->size, + viz::SinglePlaneSharedImageFormatToBufferFormat(format), + gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, + gpu::kNullSurfaceHandle, shutdown_event_); + } + + buffer = staging_buffer->gpu_memory_buffer.get(); + if (!buffer) { + return false; + } + + CHECK_EQ(1u, gfx::NumberOfPlanesForLinearBufferFormat(buffer->GetFormat())); + bool rv = buffer->Map(); + CHECK(rv); + CHECK(buffer->memory(0)); + // RasterBufferProvider::PlaybackToMemory only supports unsigned strides. + CHECK_GE(buffer->stride(0), 0); + + // TODO(https://crbug.com/870663): Temporary diagnostics. + base::debug::Alias(&playback_rect); + base::debug::Alias(&full_rect_size); + base::debug::Alias(&rv); + void* buffer_memory = buffer->memory(0); + base::debug::Alias(&buffer_memory); + gfx::Size staging_buffer_size = staging_buffer->size; + base::debug::Alias(&staging_buffer_size); + gfx::Size buffer_size = buffer->GetSize(); + base::debug::Alias(&buffer_size); + + memory = buffer->memory(0); + stride = buffer->stride(0); + is_shared_memory_ = + buffer->GetType() == gfx::GpuMemoryBufferType::SHARED_MEMORY_BUFFER; } - if (!staging_buffer->gpu_memory_buffer) { - return false; - } - - gfx::GpuMemoryBuffer* buffer = staging_buffer->gpu_memory_buffer.get(); - CHECK_EQ(1u, gfx::NumberOfPlanesForLinearBufferFormat(buffer->GetFormat())); - bool rv = buffer->Map(); - CHECK(rv); - CHECK(buffer->memory(0)); - // RasterBufferProvider::PlaybackToMemory only supports unsigned strides. - CHECK_GE(buffer->stride(0), 0); - - // TODO(https://crbug.com/870663): Temporary diagnostics. - base::debug::Alias(&playback_rect); - base::debug::Alias(&full_rect_size); - base::debug::Alias(&rv); - void* buffer_memory = buffer->memory(0); - base::debug::Alias(&buffer_memory); - gfx::Size staging_buffer_size = staging_buffer->size; - base::debug::Alias(&staging_buffer_size); - gfx::Size buffer_size = buffer->GetSize(); - base::debug::Alias(&buffer_size); - DCHECK(!playback_rect.IsEmpty()) << "Why are we rastering a tile that's not dirty?"; RasterBufferProvider::PlaybackToMemory( - buffer->memory(0), format, staging_buffer->size, buffer->stride(0), - raster_source, raster_full_rect, playback_rect, transform, - dst_color_space, /*gpu_compositing=*/true, playback_settings); - buffer->Unmap(); + memory, format, staging_buffer->size, stride, raster_source, + raster_full_rect, playback_rect, transform, dst_color_space, + /*gpu_compositing=*/true, playback_settings); + base::FeatureList::IsEnabled(kAlwaysUseMappableSIForOneCopyRaster) + ? mapping.reset() + : buffer->Unmap(); staging_buffer->content_id = new_content_id; return true; @@ -407,7 +448,11 @@ auto* sii = worker_context_provider_->SharedImageInterface(); DCHECK(sii); - CHECK(staging_buffer->gpu_memory_buffer.get()); + if (base::FeatureList::IsEnabled(kAlwaysUseMappableSIForOneCopyRaster)) { + CHECK(!staging_buffer->mailbox.IsZero()); + } else { + CHECK(staging_buffer->gpu_memory_buffer.get()); + } bool needs_clear = false; @@ -460,10 +505,8 @@ query_target = GL_COMMANDS_ISSUED_CHROMIUM; #endif - // COMMANDS_ISSUED is sufficient for shared memory GpuMemoryBuffers. - const auto* buffer = staging_buffer->gpu_memory_buffer.get(); - if (buffer && - buffer->GetType() == gfx::GpuMemoryBufferType::SHARED_MEMORY_BUFFER) { + // COMMANDS_ISSUED is sufficient for shared memory resources. + if (is_shared_memory_) { query_target = GL_COMMANDS_ISSUED_CHROMIUM; }
diff --git a/cc/raster/one_copy_raster_buffer_provider.h b/cc/raster/one_copy_raster_buffer_provider.h index 978ef70..a187a37 100644 --- a/cc/raster/one_copy_raster_buffer_provider.h +++ b/cc/raster/one_copy_raster_buffer_provider.h
@@ -172,6 +172,10 @@ const bool tile_overlay_candidate_; const uint32_t tile_texture_target_; + // Whether the current data in the staging buffer came from a shared memory + // resource. + bool is_shared_memory_ = false; + StagingBufferPool staging_pool_; };
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java index 50b397c1..f8b9e8e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
@@ -20,7 +20,6 @@ import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ChromeTabbedActivity2; import org.chromium.chrome.browser.IntentHandler; -import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabObserver; @@ -205,8 +204,7 @@ @Override public boolean shouldLaunchWebApksOnInitialIntent() { - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.S - && ChromeFeatureList.sWebApkTrampolineOnInitialIntent.isEnabled(); + return Build.VERSION.SDK_INT >= Build.VERSION_CODES.S; } @Override
diff --git a/chrome/app/app_management_strings.grdp b/chrome/app/app_management_strings.grdp index 8e1962a..81c1b2d 100644 --- a/chrome/app/app_management_strings.grdp +++ b/chrome/app/app_management_strings.grdp
@@ -148,9 +148,6 @@ <message name="IDS_APP_MANAGEMENT_APP_DETAILS_DATA_SIZE" desc="Text for data size label for the amount of storage the app's associated files is using"> Data stored in app: <ph name="APP_SIZE">$1<ex>100 MB</ex></ph> </message> - <message name="IDS_APP_MANAGEMENT_APP_DETAILS_TOTAL_SIZE" desc="Text for total app size label for the amount of storage the app itself is using"> - Size: <ph name="CHROME_APP_SIZE">$1<ex>100 MB</ex></ph> - </message> <message name="IDS_APP_MANAGEMENT_ARC_MANAGE_PERMISSIONS" desc="Label for a link to manage permissions for an app."> Manage permissions </message>
diff --git a/chrome/app/app_management_strings_grdp/IDS_APP_MANAGEMENT_APP_DETAILS_TOTAL_SIZE.png.sha1 b/chrome/app/app_management_strings_grdp/IDS_APP_MANAGEMENT_APP_DETAILS_TOTAL_SIZE.png.sha1 deleted file mode 100644 index dd93271..0000000 --- a/chrome/app/app_management_strings_grdp/IDS_APP_MANAGEMENT_APP_DETAILS_TOTAL_SIZE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -daf1042ba806a725ca5cee256032d7dc295bad50 \ No newline at end of file
diff --git a/chrome/app/password_manager_ui_strings.grdp b/chrome/app/password_manager_ui_strings.grdp index 2612df35..b6b4846 100644 --- a/chrome/app/password_manager_ui_strings.grdp +++ b/chrome/app/password_manager_ui_strings.grdp
@@ -66,9 +66,12 @@ <message name="IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_CANCELED_TITLE" desc="The title of the dialog in the password sharing flow when the user canceled sharing."> Password was not shared </message> - <message name="IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NO_MEMBERS_DESCRIPTION" desc="The title of the dialog that is shown to users with no members in their Google Family group when they started the password sharing flow. The link navigates the user to the page where they can create or manage their Google Family group."> + <message name="IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NOT_FAMILY_MEMBER" desc="The title of the dialog that is shown to users who are not a member of Google Family group when they started the password sharing flow. The link navigates the user to the page where they can create their Google Family group."> For now, you can only share passwords with family members. <ph name="BEGIN_LINK"><a href="$1" target="_blank"></ph>Create a family group<ph name="END_LINK"></a></ph> with up to 6 members, and get more from your products and subscriptions across Google. </message> + <message name="IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NO_OTHER_FAMILY_MEMBERS" desc="The title of the dialog that is shown to users with no members in their Google Family group when they started the password sharing flow. The link navigates the user to the page where they can view their Google Family group and invite new members."> + For now, you can only share passwords with family members. <ph name="BEGIN_LINK"><a href="$1" target="_blank"></ph>Invite family members<ph name="END_LINK"></a></ph> to join your group, and get more from your products and subscriptions across Google. + </message> <message name="IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_FAMILY_PICKER_DESCRIPTION" desc="The descrtiption of the dialog that is shown to users when they started the password sharing flow and now they need to select the recipients."> When you share a copy of your <ph name="BEGIN_BOLD_USERNAME"><b></ph>username<ph name="END_BOLD_USERNAME"></b></ph> and <ph name="BEGIN_BOLD_PASSWORD"><b></ph>password<ph name="END_BOLD_PASSWORD"></b></ph>, your family member can fill them using Google Password Manager </message>
diff --git a/chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NO_MEMBERS_DESCRIPTION.png.sha1 b/chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NOT_FAMILY_MEMBER.png.sha1 similarity index 100% rename from chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NO_MEMBERS_DESCRIPTION.png.sha1 rename to chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NOT_FAMILY_MEMBER.png.sha1
diff --git a/chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NO_OTHER_FAMILY_MEMBERS.png.sha1 b/chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NO_OTHER_FAMILY_MEMBERS.png.sha1 new file mode 100644 index 0000000..a205886 --- /dev/null +++ b/chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NO_OTHER_FAMILY_MEMBERS.png.sha1
@@ -0,0 +1 @@ +bd0c04ff2961125cf451cc90c454a65f85731729 \ No newline at end of file
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 3b80f93d3..6fcd8de 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -4124,15 +4124,6 @@ kOsDesktop, FEATURE_VALUE_TYPE(features::kWebUITabStripContextMenuAfterTap)}, #endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) -#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH) - { - "webui-tab-strip-tab-drag-integration", - flag_descriptions::kWebUITabStripTabDragIntegrationName, - flag_descriptions::kWebUITabStripTabDragIntegrationDescription, - kOsCrOS, - FEATURE_VALUE_TYPE(ash::features::kWebUITabStripTabDragIntegration), - }, -#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH) {"allow-eap-default-cas-without-subject-verification", flag_descriptions::kAllowEapDefaultCasWithoutSubjectVerificationName,
diff --git a/chrome/browser/ash/BUILD.gn b/chrome/browser/ash/BUILD.gn index 5d4dacf..2f286e5 100644 --- a/chrome/browser/ash/BUILD.gn +++ b/chrome/browser/ash/BUILD.gn
@@ -3678,6 +3678,7 @@ "//chromeos/components/onc", "//chromeos/components/print_management/mojom", "//chromeos/components/remote_apps/mojom", + "//chromeos/components/sensors:buildflags", "//chromeos/components/sensors/mojom", "//chromeos/components/sharesheet:constants", "//chromeos/crosapi/mojom",
diff --git a/chrome/browser/ash/arc/vmm/arc_vmm_manager.cc b/chrome/browser/ash/arc/vmm/arc_vmm_manager.cc index db237f99..46ac813 100644 --- a/chrome/browser/ash/arc/vmm/arc_vmm_manager.cc +++ b/chrome/browser/ash/arc/vmm/arc_vmm_manager.cc
@@ -387,14 +387,11 @@ private: // ui::AcceleratorTarget: bool AcceleratorPressed(const ui::Accelerator& accelerator) override { - // TODO(b/287411215): The log just for test / dogfood usage, since this - // class hide by flag and will never be enabled in production env. Remove - // it after experiment / dogfood finish. if (accelerator == vmm_swap_enabled_) { - LOG(WARNING) << "Set force enable vmm swap state."; + DVLOG(1) << "Set force enable vmm swap state by keyboard shortcut."; manager_->SetSwapState(SwapState::FORCE_ENABLE); } else if (accelerator == vmm_swap_disabled_) { - LOG(WARNING) << "Set diable vmm swap state."; + DVLOG(1) << "Set diable vmm swap state by keyboard shortcut."; manager_->SetSwapState(SwapState::DISABLE); } else { NOTREACHED();
diff --git a/chrome/browser/ash/bruschetta/bruschetta_installer_impl.cc b/chrome/browser/ash/bruschetta/bruschetta_installer_impl.cc index 2d59a7f3..5d78b50 100644 --- a/chrome/browser/ash/bruschetta/bruschetta_installer_impl.cc +++ b/chrome/browser/ash/bruschetta/bruschetta_installer_impl.cc
@@ -346,9 +346,9 @@ install_running_ = false; Error(BruschettaInstallResult::kCreateDiskError); if (result) { - LOG(ERROR) << "Create VM failed: " << result->failure_reason(); + LOG(ERROR) << "Create VM disk failed: " << result->failure_reason(); } else { - LOG(ERROR) << "Create VM failed, no response"; + LOG(ERROR) << "Create VM disk failed, no response"; } return; }
diff --git a/chrome/browser/ash/bruschetta/bruschetta_launcher_unittest.cc b/chrome/browser/ash/bruschetta/bruschetta_launcher_unittest.cc index 99031790..4281900 100644 --- a/chrome/browser/ash/bruschetta/bruschetta_launcher_unittest.cc +++ b/chrome/browser/ash/bruschetta/bruschetta_launcher_unittest.cc
@@ -84,6 +84,7 @@ base::Value::Dict config; config.Set(prefs::kPolicyEnabledKey, static_cast<int>(prefs::PolicyEnabledState::RUN_ALLOWED)); + config.Set(prefs::kPolicyNameKey, "Display Name"); base::Value::Dict vtpm; vtpm.Set(prefs::kPolicyVTPMEnabledKey, true);
diff --git a/chrome/browser/ash/bruschetta/bruschetta_service.cc b/chrome/browser/ash/bruschetta/bruschetta_service.cc index 0a310ff..79f63974 100644 --- a/chrome/browser/ash/bruschetta/bruschetta_service.cc +++ b/chrome/browser/ash/bruschetta/bruschetta_service.cc
@@ -49,7 +49,10 @@ return; } - vm_observer_.Observe(ash::ConciergeClient::Get()); + ash::ConciergeClient* concierge = ash::ConciergeClient::Get(); + if (concierge != nullptr) { + vm_observer_.Observe(concierge); + } pref_observer_.Init(profile_->GetPrefs()); pref_observer_.Add(
diff --git a/chrome/browser/ash/bruschetta/bruschetta_util.cc b/chrome/browser/ash/bruschetta/bruschetta_util.cc index 0afc0dd0..c0f2824 100644 --- a/chrome/browser/ash/bruschetta/bruschetta_util.cc +++ b/chrome/browser/ash/bruschetta/bruschetta_util.cc
@@ -214,14 +214,17 @@ std::string GetDisplayName(Profile* profile, guest_os::GuestId guest) { auto config = GetConfigForGuest(profile, guest, prefs::PolicyEnabledState::BLOCKED); - if (!config.has_value() || !config.value()) { - // If the config doesn't exist, the terminal will default to - // <vm_name>:<container_name>, but container_name isn't meaningful for us - // so just use the vm_name instead. - return guest.vm_name; + const std::string* name = nullptr; + if (config.has_value()) { + name = config.value()->FindString(prefs::kPolicyNameKey); } - - return *config.value()->FindString(prefs::kPolicyNameKey); + if (name) { + return *name; + } + // If the config doesn't exist, the terminal will default to + // <vm_name>:<container_name>, but container_name isn't meaningful for us + // so just use the vm_name instead. + return guest.vm_name; } } // namespace bruschetta
diff --git a/chrome/browser/ash/crosapi/browser_manager.cc b/chrome/browser/ash/crosapi/browser_manager.cc index e5aaa335..20bbf02f 100644 --- a/chrome/browser/ash/crosapi/browser_manager.cc +++ b/chrome/browser/ash/crosapi/browser_manager.cc
@@ -1732,8 +1732,8 @@ base::OnceClosure cb, bool launching_at_login_screen) { device_ownership_waiter_called_ = true; - device_ownership_waiter_->WaitForOwnerhipFetched(std::move(cb), - launching_at_login_screen); + device_ownership_waiter_->WaitForOwnershipFetched(std::move(cb), + launching_at_login_screen); } void BrowserManager::OnLaunchParamsFetched(bool launching_at_login_screen,
diff --git a/chrome/browser/ash/crosapi/device_ownership_waiter.h b/chrome/browser/ash/crosapi/device_ownership_waiter.h index bfdeb000..7d5ff2a2 100644 --- a/chrome/browser/ash/crosapi/device_ownership_waiter.h +++ b/chrome/browser/ash/crosapi/device_ownership_waiter.h
@@ -27,8 +27,8 @@ // - we are running ChromeOS on Linux: The `DeviceSettingsService` is not // behaving as in the real world for these builds, hence we can skip the // check. - virtual void WaitForOwnerhipFetched(base::OnceClosure callback, - bool launching_at_login_screen) = 0; + virtual void WaitForOwnershipFetched(base::OnceClosure callback, + bool launching_at_login_screen) = 0; }; } // namespace crosapi
diff --git a/chrome/browser/ash/crosapi/device_ownership_waiter_impl.cc b/chrome/browser/ash/crosapi/device_ownership_waiter_impl.cc index b281fa09..a954536 100644 --- a/chrome/browser/ash/crosapi/device_ownership_waiter_impl.cc +++ b/chrome/browser/ash/crosapi/device_ownership_waiter_impl.cc
@@ -15,7 +15,7 @@ namespace crosapi { -void DeviceOwnershipWaiterImpl::WaitForOwnerhipFetched( +void DeviceOwnershipWaiterImpl::WaitForOwnershipFetched( base::OnceClosure callback, bool launching_at_login_screen) { if (launching_at_login_screen ||
diff --git a/chrome/browser/ash/crosapi/device_ownership_waiter_impl.h b/chrome/browser/ash/crosapi/device_ownership_waiter_impl.h index b13cb50..6d8d69f 100644 --- a/chrome/browser/ash/crosapi/device_ownership_waiter_impl.h +++ b/chrome/browser/ash/crosapi/device_ownership_waiter_impl.h
@@ -18,8 +18,8 @@ delete; ~DeviceOwnershipWaiterImpl() override = default; - void WaitForOwnerhipFetched(base::OnceClosure callback, - bool launching_at_login_screen) override; + void WaitForOwnershipFetched(base::OnceClosure callback, + bool launching_at_login_screen) override; }; } // namespace crosapi
diff --git a/chrome/browser/ash/crosapi/device_ownership_waiter_unittest.cc b/chrome/browser/ash/crosapi/device_ownership_waiter_unittest.cc index fb2bc644..c3a4b11 100644 --- a/chrome/browser/ash/crosapi/device_ownership_waiter_unittest.cc +++ b/chrome/browser/ash/crosapi/device_ownership_waiter_unittest.cc
@@ -52,8 +52,8 @@ DeviceOwnershipWaiterImpl waiter; base::test::TestFuture<void> future; - waiter.WaitForOwnerhipFetched(future.GetCallback(), - /*launching_at_login_screen=*/true); + waiter.WaitForOwnershipFetched(future.GetCallback(), + /*launching_at_login_screen=*/true); GetFakeUserManager().SetOwnerId(user_manager::StubAccountId()); @@ -65,8 +65,8 @@ DeviceOwnershipWaiterImpl waiter; base::test::TestFuture<void> future; - waiter.WaitForOwnerhipFetched(future.GetCallback(), - /*launching_at_login_screen=*/false); + waiter.WaitForOwnershipFetched(future.GetCallback(), + /*launching_at_login_screen=*/false); GetFakeUserManager().SetOwnerId(user_manager::StubAccountId()); @@ -84,8 +84,8 @@ DeviceOwnershipWaiterImpl waiter; base::test::TestFuture<void> future; - waiter.WaitForOwnerhipFetched(future.GetCallback(), - /*launching_at_login_screen=*/false); + waiter.WaitForOwnershipFetched(future.GetCallback(), + /*launching_at_login_screen=*/false); EXPECT_TRUE(future.Wait()); }
diff --git a/chrome/browser/ash/crosapi/drive_integration_service_ash.cc b/chrome/browser/ash/crosapi/drive_integration_service_ash.cc index fe599b2..d990d872 100644 --- a/chrome/browser/ash/crosapi/drive_integration_service_ash.cc +++ b/chrome/browser/ash/crosapi/drive_integration_service_ash.cc
@@ -49,9 +49,8 @@ void DriveIntegrationServiceAsh::AddDriveIntegrationServiceObserver( mojo::PendingRemote<mojom::DriveIntegrationServiceObserver> observer) { - DCHECK(GetDriveService()); - drive_service_observation_.Reset(); - drive_service_observation_.Observe(GetDriveService()); + drive_observer_.Reset(); + drive_observer_.Observe(GetDriveService()); mojo::Remote<mojom::DriveIntegrationServiceObserver> remote( std::move(observer)); observers_.Add(std::move(remote)); @@ -98,7 +97,7 @@ observer->OnMountPointPathChanged(base::FilePath()); } void DriveIntegrationServiceAsh::OnDriveIntegrationServiceDestroyed() { - drive_service_observation_.Reset(); + drive_observer_.Reset(); } } // namespace crosapi
diff --git a/chrome/browser/ash/crosapi/drive_integration_service_ash.h b/chrome/browser/ash/crosapi/drive_integration_service_ash.h index 74213b0..697c197a 100644 --- a/chrome/browser/ash/crosapi/drive_integration_service_ash.h +++ b/chrome/browser/ash/crosapi/drive_integration_service_ash.h
@@ -16,9 +16,8 @@ // Implements the crosapi interface for DriveIntegrationService. Lives in // Ash-Chrome on the UI thread. -class DriveIntegrationServiceAsh - : public mojom::DriveIntegrationService, - public drive::DriveIntegrationServiceObserver { +class DriveIntegrationServiceAsh : public mojom::DriveIntegrationService, + drive::DriveIntegrationService::Observer { public: DriveIntegrationServiceAsh(); DriveIntegrationServiceAsh(const DriveIntegrationServiceAsh&) = delete; @@ -44,7 +43,7 @@ mojo::PendingRemote<crosapi::mojom::DriveFsNativeMessageHostBridge> bridge) override; - // drivefs::DriveIntegrationServiceObserver: + // DriveIntegrationService::Observer implementation. void OnFileSystemMounted() override; void OnFileSystemBeingUnmounted() override; void OnFileSystemMountFailed() override; @@ -52,8 +51,9 @@ private: base::ScopedObservation<drive::DriveIntegrationService, - drive::DriveIntegrationServiceObserver> - drive_service_observation_{this}; + drive::DriveIntegrationService::Observer> + drive_observer_{this}; + // This class supports any number of connections. This allows the client to // have multiple, potentially thread-affine, remotes. mojo::ReceiverSet<mojom::DriveIntegrationService> receivers_;
diff --git a/chrome/browser/ash/crosapi/fake_device_ownership_waiter.cc b/chrome/browser/ash/crosapi/fake_device_ownership_waiter.cc index e2b01e5..c951122 100644 --- a/chrome/browser/ash/crosapi/fake_device_ownership_waiter.cc +++ b/chrome/browser/ash/crosapi/fake_device_ownership_waiter.cc
@@ -14,7 +14,7 @@ namespace crosapi { -void FakeDeviceOwnershipWaiter::WaitForOwnerhipFetched( +void FakeDeviceOwnershipWaiter::WaitForOwnershipFetched( base::OnceClosure callback, bool launching_at_login_screen) { if (launching_at_login_screen ||
diff --git a/chrome/browser/ash/crosapi/fake_device_ownership_waiter.h b/chrome/browser/ash/crosapi/fake_device_ownership_waiter.h index 80bd326..822430c 100644 --- a/chrome/browser/ash/crosapi/fake_device_ownership_waiter.h +++ b/chrome/browser/ash/crosapi/fake_device_ownership_waiter.h
@@ -23,8 +23,8 @@ ~FakeDeviceOwnershipWaiter() override = default; // `DeviceOwnershipWaiter`: - void WaitForOwnerhipFetched(base::OnceClosure callback, - bool launching_at_login_screen) override; + void WaitForOwnershipFetched(base::OnceClosure callback, + bool launching_at_login_screen) override; }; } // namespace crosapi
diff --git a/chrome/browser/ash/drive/drive_integration_service.cc b/chrome/browser/ash/drive/drive_integration_service.cc index 2516f660..1779025 100644 --- a/chrome/browser/ash/drive/drive_integration_service.cc +++ b/chrome/browser/ash/drive/drive_integration_service.cc
@@ -1705,6 +1705,10 @@ // devices. registry->RegisterBooleanPref(prefs::kDriveFsBulkPinningVisible, true); registry->RegisterBooleanPref(prefs::kDriveFsBulkPinningEnabled, false); + // Do not sync `kDriveFsDSSAvailabilityLastEmitted` as it directly relates to + // device specific caching of Docs/Sheets/Slides. + registry->RegisterTimePref(prefs::kDriveFsDSSAvailabilityLastEmitted, + base::Time::Now()); } void DriveIntegrationService::OnDrivePrefChanged() {
diff --git a/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_impl.h b/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_impl.h index 1c2d9d4..6a9d50cf 100644 --- a/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_impl.h +++ b/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_impl.h
@@ -151,8 +151,7 @@ // Maps block reasons to their associated enterprise connector blocked file // paths. - std::map<policy::FilesPolicyDialog::EnterpriseConnectorsBlockReason, - std::vector<base::FilePath>> + std::map<policy::FilesPolicyDialog::BlockReason, std::vector<base::FilePath>> connectors_blocked_files_; // The name of the first blocked file, if any. Used for notifications.
diff --git a/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_unittest.cc b/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_unittest.cc index b8dc745..53f27bf8 100644 --- a/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_unittest.cc +++ b/chrome/browser/ash/file_manager/copy_or_move_io_task_policy_unittest.cc
@@ -557,9 +557,8 @@ .WillOnce(RunClosure(quit_closure)); } - void ExpectFPNMBlockedFiles( - std::vector<FileInfo> files, - policy::FilesPolicyDialog::EnterpriseConnectorsBlockReason reason) { + void ExpectFPNMBlockedFiles(std::vector<FileInfo> files, + policy::FilesPolicyDialog::BlockReason reason) { std::vector<base::FilePath> blocked_files; for (auto&& file : files) { blocked_files.push_back(file.source_url.path()); @@ -760,9 +759,8 @@ : absl::nullopt}); if (UseNewPolicyUI() && UseNewConnectorsUI()) { - ExpectFPNMBlockedFiles({file}, - policy::FilesPolicyDialog:: - EnterpriseConnectorsBlockReason::kSensitiveData); + ExpectFPNMBlockedFiles({file}, policy::FilesPolicyDialog::BlockReason:: + kEnterpriseConnectorsSensitiveData); } // Start the copy/move. @@ -807,7 +805,7 @@ if (UseNewPolicyUI() && UseNewConnectorsUI()) { ExpectFPNMBlockedFiles( {file}, - policy::FilesPolicyDialog::EnterpriseConnectorsBlockReason::kUnknown); + policy::FilesPolicyDialog::BlockReason::kEnterpriseConnectorsUnknown); } // Start the copy/move. @@ -1002,8 +1000,8 @@ if (UseNewPolicyUI() && UseNewConnectorsUI()) { ExpectFPNMBlockedFiles({enabled_file}, - policy::FilesPolicyDialog:: - EnterpriseConnectorsBlockReason::kSensitiveData); + policy::FilesPolicyDialog::BlockReason:: + kEnterpriseConnectorsSensitiveData); } // Start the copy/move. @@ -1081,12 +1079,11 @@ maybe_policy_errors); if (UseNewPolicyUI() && UseNewConnectorsUI()) { - ExpectFPNMBlockedFiles({file0}, - policy::FilesPolicyDialog:: - EnterpriseConnectorsBlockReason::kSensitiveData); + ExpectFPNMBlockedFiles({file0}, policy::FilesPolicyDialog::BlockReason:: + kEnterpriseConnectorsSensitiveData); ExpectFPNMBlockedFiles( {file1}, - policy::FilesPolicyDialog::EnterpriseConnectorsBlockReason::kMalware); + policy::FilesPolicyDialog::BlockReason::kEnterpriseConnectorsMalware); } // Start the copy/move. @@ -1155,9 +1152,8 @@ : absl::nullopt}); if (UseNewPolicyUI() && UseNewConnectorsUI()) { - ExpectFPNMBlockedFiles({file0}, - policy::FilesPolicyDialog:: - EnterpriseConnectorsBlockReason::kSensitiveData); + ExpectFPNMBlockedFiles({file0}, policy::FilesPolicyDialog::BlockReason:: + kEnterpriseConnectorsSensitiveData); } // Start the copy/move. @@ -1299,21 +1295,21 @@ ExpectFPNMFilesWarningDialogAndProceed(task); if (UseNewPolicyUI()) { - // We expect two different calls to - // FilesPolicyNotificationManager::AddConnectorsBlockedFiles, one for each - // scan result tag. + // We expect a call to + // FilesPolicyNotificationManager::AddConnectorsBlockedFiles for scan result + // tag. ExpectFPNMBlockedFiles({blocked_file_0}, - policy::FilesPolicyDialog:: - EnterpriseConnectorsBlockReason::kSensitiveData); + policy::FilesPolicyDialog::BlockReason:: + kEnterpriseConnectorsSensitiveData); ExpectFPNMBlockedFiles( {blocked_file_1}, - policy::FilesPolicyDialog::EnterpriseConnectorsBlockReason::kMalware); + policy::FilesPolicyDialog::BlockReason::kEnterpriseConnectorsMalware); ExpectFPNMBlockedFiles({blocked_file_2}, - policy::FilesPolicyDialog:: - EnterpriseConnectorsBlockReason::kEncryptedFile); + policy::FilesPolicyDialog::BlockReason:: + kEnterpriseConnectorsEncryptedFile); ExpectFPNMBlockedFiles( {blocked_file_3}, - policy::FilesPolicyDialog::EnterpriseConnectorsBlockReason::kLargeFile); + policy::FilesPolicyDialog::BlockReason::kEnterpriseConnectorsLargeFile); } task.Execute(progress_callback.Get(), complete_callback.Get());
diff --git a/chrome/browser/ash/file_manager/file_manager_browsertest.cc b/chrome/browser/ash/file_manager/file_manager_browsertest.cc index 39c7e33..9edc6759 100644 --- a/chrome/browser/ash/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/ash/file_manager/file_manager_browsertest.cc
@@ -1416,52 +1416,39 @@ FilesAppBrowserTest, ::testing::Values( TestCase("searchDownloadsWithResults"), - TestCase("searchDownloadsWithResults").EnableSearchV2(), TestCase("searchDownloadsWithNoResults"), - TestCase("searchDownloadsWithNoResults").EnableSearchV2(), TestCase("searchDownloadsClearSearchKeyDown"), - TestCase("searchDownloadsClearSearchKeyDown").EnableSearchV2(), TestCase("searchDownloadsClearSearch"), - TestCase("searchDownloadsClearSearch").EnableSearchV2(), TestCase("searchHidingViaTab"), - TestCase("searchHidingViaTab").EnableSearchV2(), TestCase("searchHidingTextEntryField"), - TestCase("searchHidingTextEntryField").EnableSearchV2(), TestCase("searchButtonToggles"), - TestCase("searchButtonToggles").EnableSearchV2(), - TestCase("searchWithLocationOptions").EnableSearchV2(), - TestCase("searchLocalWithTypeOptions").EnableSearchV2(), - TestCase("searchDriveWithTypeOptions").EnableSearchV2(), - TestCase("searchWithRecencyOptions").EnableSearchV2(), - TestCase("searchDriveWithRecencyOptions").EnableSearchV2(), - TestCase("searchRemovableDevice").EnableSearchV2(), - TestCase("searchPartitionedRemovableDevice").EnableSearchV2(), - TestCase("resetSearchOptionsOnFolderChange").EnableSearchV2(), - TestCase("showSearchResultMessageWhenSearching").EnableSearchV2(), - TestCase("searchFromMyFiles").EnableSearchV2(), - TestCase("selectionPath").EnableSearchV2(), - TestCase("searchHierarchy").EnableSearchV2(), - TestCase("hideSearchInTrash").EnableSearchV2(), + TestCase("searchWithLocationOptions"), + TestCase("searchLocalWithTypeOptions"), + TestCase("searchDriveWithTypeOptions"), + TestCase("searchWithRecencyOptions"), + TestCase("searchDriveWithRecencyOptions"), + TestCase("searchRemovableDevice"), + TestCase("searchPartitionedRemovableDevice"), + TestCase("resetSearchOptionsOnFolderChange"), + TestCase("showSearchResultMessageWhenSearching"), + TestCase("searchFromMyFiles"), + TestCase("selectionPath"), + TestCase("searchHierarchy"), + TestCase("hideSearchInTrash"), // TODO(b/287169303): test is flaky on ChromiumOS MSan #if !defined(MEMORY_SANITIZER) - TestCase("searchTrashedFiles").EnableSearchV2(), + TestCase("searchTrashedFiles"), #endif - TestCase("matchDriveFilesByName").EnableSearchV2(), - TestCase("searchSharedWithMe").EnableSearchV2(), - TestCase("searchDocumentsProvider") - .EnableGenericDocumentsProvider() - .EnableSearchV2(), + TestCase("matchDriveFilesByName"), + TestCase("searchSharedWithMe"), + TestCase("searchDocumentsProvider").EnableGenericDocumentsProvider(), TestCase("searchDocumentsProviderWithTypeOptions") - .EnableGenericDocumentsProvider() - .EnableSearchV2(), + .EnableGenericDocumentsProvider(), TestCase("searchDocumentsProviderWithRecencyOptions") - .EnableGenericDocumentsProvider() - .EnableSearchV2(), - TestCase("searchFileSystemProvider").EnableSearchV2(), - TestCase("searchImageByContent") - .EnableImageContentSearch() - .EnableSearchV2(), - TestCase("changingDirectoryClosesSearch").EnableSearchV2() + .EnableGenericDocumentsProvider(), + TestCase("searchFileSystemProvider"), + TestCase("searchImageByContent").EnableImageContentSearch(), + TestCase("changingDirectoryClosesSearch") // TODO(b/189173190): Enable // TestCase("searchQueryLaunchParam") ));
diff --git a/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc b/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc index f6a1bfe9..ef134b7 100644 --- a/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc +++ b/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc
@@ -2328,12 +2328,6 @@ disabled_features.push_back(features::kFileTransferEnterpriseConnectorUI); } - if (options.enable_search_v2) { - enabled_features.push_back(ash::features::kFilesSearchV2); - } else { - disabled_features.push_back(ash::features::kFilesSearchV2); - } - if (options.enable_image_content_search) { enabled_features.push_back(search_features::kLauncherImageSearch); enabled_features.push_back(search_features::kLauncherImageSearchIca);
diff --git a/chrome/browser/ash/file_manager/file_manager_browsertest_base.h b/chrome/browser/ash/file_manager/file_manager_browsertest_base.h index c43078f4..b681c5f 100644 --- a/chrome/browser/ash/file_manager/file_manager_browsertest_base.h +++ b/chrome/browser/ash/file_manager/file_manager_browsertest_base.h
@@ -179,9 +179,6 @@ // Whether test should use report-only mode for the file transfer connector. bool file_transfer_connector_report_only = false; - // Whether tests should enable V2 of search. - bool enable_search_v2 = false; - // Whether tests should enable image content search. bool enable_image_content_search = false;
diff --git a/chrome/browser/ash/file_manager/file_manager_browsertest_utils.cc b/chrome/browser/ash/file_manager/file_manager_browsertest_utils.cc index 5bfb12f..e2fe1c8 100644 --- a/chrome/browser/ash/file_manager/file_manager_browsertest_utils.cc +++ b/chrome/browser/ash/file_manager/file_manager_browsertest_utils.cc
@@ -160,11 +160,6 @@ return *this; } -TestCase& TestCase::EnableSearchV2() { - options.enable_search_v2 = true; - return *this; -} - TestCase& TestCase::EnableFSPsInRecents() { options.enable_fsps_in_recents = true; return *this; @@ -270,10 +265,6 @@ full_name += "_ReportOnly"; } - if (options.enable_search_v2) { - full_name += "_SearchV2"; - } - if (options.enable_fsps_in_recents) { full_name += "_FSPsInRecents"; }
diff --git a/chrome/browser/ash/file_manager/file_manager_browsertest_utils.h b/chrome/browser/ash/file_manager/file_manager_browsertest_utils.h index 03e83919..e5fa470 100644 --- a/chrome/browser/ash/file_manager/file_manager_browsertest_utils.h +++ b/chrome/browser/ash/file_manager/file_manager_browsertest_utils.h
@@ -88,8 +88,6 @@ TestCase& FileTransferConnectorReportOnlyMode(); - TestCase& EnableSearchV2(); - TestCase& EnableFSPsInRecents(); TestCase& EnableOsFeedback();
diff --git a/chrome/browser/ash/file_manager/volume_manager.cc b/chrome/browser/ash/file_manager/volume_manager.cc index 47d7d94..36f4bf5 100644 --- a/chrome/browser/ash/file_manager/volume_manager.cc +++ b/chrome/browser/ash/file_manager/volume_manager.cc
@@ -246,7 +246,7 @@ base::BindOnce(&RecordDownloadsDiskUsageStats, std::move(localVolume))); // Subscribe to DriveIntegrationService. - drive_integration_service_->AddObserver(this); + drive_observer_.Observe(drive_integration_service_); if (drive_integration_service_->IsMounted()) { DoMountEvent(Volume::CreateForDrive(GetDriveMountPointPath())); } @@ -333,9 +333,7 @@ p->RemoveObserver(this); } - if (drive_integration_service_) { - drive_integration_service_->RemoveObserver(this); - } + drive_observer_.Reset(); if (file_system_provider_service_) { file_system_provider_service_->RemoveObserver(this); @@ -559,6 +557,11 @@ file_system_type)); } +void VolumeManager::OnDriveIntegrationServiceDestroyed() { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + drive_observer_.Reset(); +} + void VolumeManager::OnFileSystemMounted() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
diff --git a/chrome/browser/ash/file_manager/volume_manager.h b/chrome/browser/ash/file_manager/volume_manager.h index e3ce7d2..03574dc 100644 --- a/chrome/browser/ash/file_manager/volume_manager.h +++ b/chrome/browser/ash/file_manager/volume_manager.h
@@ -12,9 +12,11 @@ #include "base/files/file.h" #include "base/files/file_path.h" #include "base/functional/callback.h" +#include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" +#include "base/scoped_observation.h" #include "chrome/browser/ash/arc/session/arc_session_manager_observer.h" #include "chrome/browser/ash/drive/drive_integration_service.h" #include "chrome/browser/ash/file_manager/documents_provider_root_manager.h" @@ -55,13 +57,13 @@ // - Android/Arc++ file system. // - File System Providers. class VolumeManager : public KeyedService, - public arc::ArcSessionManagerObserver, - public drive::DriveIntegrationServiceObserver, - public ash::disks::DiskMountManager::Observer, - public ash::file_system_provider::Observer, - public storage_monitor::RemovableStorageObserver, - public ui::ClipboardObserver, - public DocumentsProviderRootManager::Observer { + arc::ArcSessionManagerObserver, + drive::DriveIntegrationService::Observer, + ash::disks::DiskMountManager::Observer, + ash::file_system_provider::Observer, + storage_monitor::RemovableStorageObserver, + ui::ClipboardObserver, + DocumentsProviderRootManager::Observer { public: // An alternate to device::mojom::MtpManager::GetStorageInfo. // Used for injecting fake MTP manager for testing in VolumeManagerTest. @@ -188,7 +190,8 @@ const std::string& drive_label = "", const std::string& file_system_type = ""); - // drive::DriveIntegrationServiceObserver overrides. + // DriveIntegrationService::Observer implementation. + void OnDriveIntegrationServiceDestroyed() override; void OnFileSystemMounted() override; void OnFileSystemBeingUnmounted() override; @@ -359,9 +362,15 @@ bool arc_volumes_mounted_ = false; bool ignore_clipboard_changed_ = false; + base::ScopedObservation<drive::DriveIntegrationService, + drive::DriveIntegrationService::Observer> + drive_observer_{this}; + // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory<VolumeManager> weak_ptr_factory_{this}; + + FRIEND_TEST_ALL_PREFIXES(VolumeManagerTest, OnBootDeviceDiskEvent); }; } // namespace file_manager
diff --git a/chrome/browser/ash/input_method/editor_consent_enums.h b/chrome/browser/ash/input_method/editor_consent_enums.h index a0ed07a1..c2e4fb8 100644 --- a/chrome/browser/ash/input_method/editor_consent_enums.h +++ b/chrome/browser/ash/input_method/editor_consent_enums.h
@@ -40,6 +40,12 @@ kUnset, }; +enum class EditorMode { + kBlocked, + kConsentNeeded, + kEditor, +}; + ConsentStatus GetConsentStatusFromInteger(int status_value); } // namespace ash::input_method
diff --git a/chrome/browser/ash/input_method/editor_mediator.cc b/chrome/browser/ash/input_method/editor_mediator.cc index b0ea4dc..009eba5 100644 --- a/chrome/browser/ash/input_method/editor_mediator.cc +++ b/chrome/browser/ash/input_method/editor_mediator.cc
@@ -88,6 +88,11 @@ std::move(editor_client_connector_receiver), std::move(editor_event_sink_receiver), std::move(text_actuator_remote), std::move(text_query_provider_remote)); + + // TODO: b:300838514 - We should only bind the native UI with the shared lib when the + // Rewrite UI is shown. Consider add a listener to the write/rewrite UI and + // move the binding there. + panel_manager_.BindEditorClient(); } } @@ -141,6 +146,7 @@ void EditorMediator::ProcessConsentAction(ConsentAction consent_action) { consent_store_->ProcessConsentAction(consent_action); + HandleTrigger(); } void EditorMediator::OnPromoCardDeclined() { @@ -148,10 +154,16 @@ } void EditorMediator::HandleTrigger() { - if (!editor_switch_->CanBeTriggered()) { - return; + switch (editor_switch_->GetEditorMode()) { + case EditorMode::kEditor: + mako_page_handler_.ShowRewriteUI(profile_); + break; + case EditorMode::kConsentNeeded: + mako_page_handler_.ShowConsentUI(profile_); + break; + case EditorMode::kBlocked: + mako_page_handler_.CloseUI(); } - mako_page_handler_.ShowRewriteUI(profile_); } void EditorMediator::OnTextInserted() { @@ -170,10 +182,6 @@ return editor_switch_->IsAllowedForUse(); } -bool EditorMediator::CanBeTriggered() { - return editor_switch_->CanBeTriggered(); -} - ConsentStatus EditorMediator::GetConsentStatus() { return consent_store_->GetConsentStatus(); }
diff --git a/chrome/browser/ash/input_method/editor_mediator.h b/chrome/browser/ash/input_method/editor_mediator.h index a191fad..f95e0913 100644 --- a/chrome/browser/ash/input_method/editor_mediator.h +++ b/chrome/browser/ash/input_method/editor_mediator.h
@@ -57,8 +57,8 @@ static bool HasInstance(); // Binds a new editor instance request from a client. - void BindEditorClient( - mojo::PendingReceiver<orca::mojom::EditorClient> pending_receiver); + void BindEditorClient(mojo::PendingReceiver<orca::mojom::EditorClient> + pending_receiver) override; // Binds a new panel manager request from a client. void BindEditorPanelManager(
diff --git a/chrome/browser/ash/input_method/editor_panel_manager.cc b/chrome/browser/ash/input_method/editor_panel_manager.cc index 5908b68..b4538e36 100644 --- a/chrome/browser/ash/input_method/editor_panel_manager.cc +++ b/chrome/browser/ash/input_method/editor_panel_manager.cc
@@ -16,15 +16,31 @@ namespace { +crosapi::mojom::EditorPanelPresetQueryCategory ToEditorPanelQueryCategory( + const orca::mojom::PresetTextQueryType query_type) { + switch (query_type) { + case orca::mojom::PresetTextQueryType::kUnknown: + return crosapi::mojom::EditorPanelPresetQueryCategory::kUnknown; + case orca::mojom::PresetTextQueryType::kShorten: + return crosapi::mojom::EditorPanelPresetQueryCategory::kShorten; + case orca::mojom::PresetTextQueryType::kElaborate: + return crosapi::mojom::EditorPanelPresetQueryCategory::kElaborate; + case orca::mojom::PresetTextQueryType::kRephrase: + return crosapi::mojom::EditorPanelPresetQueryCategory::kRephrase; + case orca::mojom::PresetTextQueryType::kFormalize: + return crosapi::mojom::EditorPanelPresetQueryCategory::kFormalize; + case orca::mojom::PresetTextQueryType::kEmojify: + return crosapi::mojom::EditorPanelPresetQueryCategory::kEmojify; + } +} + crosapi::mojom::EditorPanelPresetTextQueryPtr ToEditorPanelQuery( const orca::mojom::PresetTextQueryPtr& orca_query) { auto editor_panel_query = crosapi::mojom::EditorPanelPresetTextQuery::New(); editor_panel_query->text_query_id = orca_query->id; editor_panel_query->name = orca_query->label; editor_panel_query->description = orca_query->description; - // TODO(b/295059934): Add the actual preset query categories. - editor_panel_query->category = - crosapi::mojom::EditorPanelPresetQueryCategory::kUnknown; + editor_panel_query->category = ToEditorPanelQueryCategory(orca_query->type); return editor_panel_query; } @@ -41,6 +57,15 @@ receivers_.Add(this, std::move(pending_receiver)); } +void EditorPanelManager::BindEditorClient() { + if (!editor_client_remote_.is_bound()) { + delegate_->BindEditorClient( + editor_client_remote_.BindNewPipeAndPassReceiver()); + + editor_client_remote_.reset_on_disconnect(); + } +} + void EditorPanelManager::GetEditorPanelContext( GetEditorPanelContextCallback callback) { // TODO(b/295059934): Get the panel mode from the editor mediator.
diff --git a/chrome/browser/ash/input_method/editor_panel_manager.h b/chrome/browser/ash/input_method/editor_panel_manager.h index 42135e65..ff409cc 100644 --- a/chrome/browser/ash/input_method/editor_panel_manager.h +++ b/chrome/browser/ash/input_method/editor_panel_manager.h
@@ -27,6 +27,10 @@ class Delegate { public: virtual ~Delegate() = default; + + virtual void BindEditorClient( + mojo::PendingReceiver<orca::mojom::EditorClient> pending_receiver) = 0; + virtual void OnPromoCardDeclined() = 0; virtual void HandleTrigger() = 0; }; @@ -60,6 +64,8 @@ void BindReceiver(mojo::PendingReceiver<crosapi::mojom::EditorPanelManager> pending_receiver); + void BindEditorClient(); + private: void OnGetPresetTextQueriesResult( GetEditorPanelContextCallback callback,
diff --git a/chrome/browser/ash/input_method/editor_switch.cc b/chrome/browser/ash/input_method/editor_switch.cc index 5c3eb40..0d2d3bb 100644 --- a/chrome/browser/ash/input_method/editor_switch.cc +++ b/chrome/browser/ash/input_method/editor_switch.cc
@@ -70,7 +70,7 @@ EditorSwitch::~EditorSwitch() = default; -bool EditorSwitch::IsAllowedForUse() { +bool EditorSwitch::IsAllowedForUse() const { bool is_managed = profile_->GetProfilePolicyConnector()->IsManaged(); return // Conditions required for dogfooding. @@ -82,7 +82,7 @@ !is_managed && IsCountryAllowed(country_code_)); } -bool EditorSwitch::CanBeTriggered() { +bool EditorSwitch::CanBeTriggered() const { ConsentStatus current_consent_status = GetConsentStatusFromInteger( profile_->GetPrefs()->GetInteger(prefs::kOrcaConsentStatus)); @@ -95,6 +95,22 @@ ; } +EditorMode EditorSwitch::GetEditorMode() const { + if (!CanBeTriggered()) { + return EditorMode::kBlocked; + } + + ConsentStatus current_consent_status = GetConsentStatusFromInteger( + profile_->GetPrefs()->GetInteger(prefs::kOrcaConsentStatus)); + + if (current_consent_status == ConsentStatus::kPending || + current_consent_status == ConsentStatus::kUnset) { + return EditorMode::kConsentNeeded; + } else { + return EditorMode::kEditor; + } +} + void EditorSwitch::OnInputContextUpdated( const TextInputMethod::InputContext& input_context, const TextFieldContextualInfo& text_field_contextual_info) {
diff --git a/chrome/browser/ash/input_method/editor_switch.h b/chrome/browser/ash/input_method/editor_switch.h index 9843e3e..36f246d 100644 --- a/chrome/browser/ash/input_method/editor_switch.h +++ b/chrome/browser/ash/input_method/editor_switch.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_ASH_INPUT_METHOD_EDITOR_SWITCH_H_ #include "ash/constants/app_types.h" +#include "chrome/browser/ash/input_method/editor_consent_enums.h" #include "chrome/browser/ash/input_method/text_field_contextual_info_fetcher.h" #include "chrome/browser/profiles/profile.h" #include "ui/base/ime/ash/text_input_method.h" @@ -25,11 +26,7 @@ ~EditorSwitch(); // Determines if the feature trace is ever allowed to be visible. - bool IsAllowedForUse(); - - // Determines if the feature can be triggered from an input context. If it is - // not allowed for use, then returns false. - bool CanBeTriggered(); + bool IsAllowedForUse() const; // Handles the change in input context. void OnInputContextUpdated( @@ -42,9 +39,15 @@ void SetProfile(Profile* profile); + EditorMode GetEditorMode() const; + private: raw_ptr<Profile> profile_; + // Determines if the feature can be triggered from an input context. If it is + // not allowed for use, then returns false. + bool CanBeTriggered() const; + std::string country_code_; std::string active_engine_id_; ui::TextInputType input_type_ = ui::TEXT_INPUT_TYPE_NONE;
diff --git a/chrome/browser/ash/input_method/editor_switch_unittest.cc b/chrome/browser/ash/input_method/editor_switch_unittest.cc index ab3ff1b6..69ca443 100644 --- a/chrome/browser/ash/input_method/editor_switch_unittest.cc +++ b/chrome/browser/ash/input_method/editor_switch_unittest.cc
@@ -115,7 +115,7 @@ CreateFakeTextFieldContextualInfo(AppType::BROWSER)); EXPECT_TRUE(editor_switch.IsAllowedForUse()); - EXPECT_FALSE(editor_switch.CanBeTriggered()); + EXPECT_EQ(editor_switch.GetEditorMode(), EditorMode::kBlocked); } TEST_F(EditorSwitchTest, FeatureCannotBeTriggeredOnAPasswordField) { @@ -141,7 +141,7 @@ CreateFakeTextFieldContextualInfo(AppType::BROWSER)); EXPECT_TRUE(editor_switch.IsAllowedForUse()); - EXPECT_FALSE(editor_switch.CanBeTriggered()); + EXPECT_EQ(editor_switch.GetEditorMode(), EditorMode::kBlocked); } TEST_F(EditorSwitchTest, FeatureCannotBeTriggeredWithNonEnglishInputMethod) { @@ -165,7 +165,7 @@ CreateFakeTextFieldContextualInfo(AppType::BROWSER)); EXPECT_TRUE(editor_switch.IsAllowedForUse()); - EXPECT_FALSE(editor_switch.CanBeTriggered()); + EXPECT_EQ(editor_switch.GetEditorMode(), EditorMode::kBlocked); } TEST_F(EditorSwitchTest, FeatureCanNotBeTriggeredOnArcApps) { @@ -189,7 +189,7 @@ CreateFakeTextFieldContextualInfo(AppType::ARC_APP)); EXPECT_TRUE(editor_switch.IsAllowedForUse()); - EXPECT_FALSE(editor_switch.CanBeTriggered()); + EXPECT_EQ(editor_switch.GetEditorMode(), EditorMode::kBlocked); } TEST_F(EditorSwitchTest, @@ -214,7 +214,7 @@ CreateFakeTextFieldContextualInfo(AppType::ARC_APP)); EXPECT_TRUE(editor_switch.IsAllowedForUse()); - EXPECT_FALSE(editor_switch.CanBeTriggered()); + EXPECT_EQ(editor_switch.GetEditorMode(), EditorMode::kBlocked); } TEST_F(EditorSwitchTest, FeatureCanNotBeTriggeredOnTabletMode) { @@ -238,7 +238,7 @@ CreateFakeTextFieldContextualInfo(AppType::BROWSER)); EXPECT_TRUE(editor_switch.IsAllowedForUse()); - EXPECT_FALSE(editor_switch.CanBeTriggered()); + EXPECT_EQ(editor_switch.GetEditorMode(), EditorMode::kBlocked); } TEST_F( @@ -264,7 +264,7 @@ CreateFakeTextFieldContextualInfo(AppType::BROWSER)); EXPECT_TRUE(editor_switch.IsAllowedForUse()); - EXPECT_TRUE(editor_switch.CanBeTriggered()); + EXPECT_EQ(editor_switch.GetEditorMode(), EditorMode::kConsentNeeded); } TEST_F( @@ -290,7 +290,7 @@ CreateFakeTextFieldContextualInfo(AppType::BROWSER)); EXPECT_TRUE(editor_switch.IsAllowedForUse()); - EXPECT_TRUE(editor_switch.CanBeTriggered()); + EXPECT_EQ(editor_switch.GetEditorMode(), EditorMode::kEditor); } } // namespace
diff --git a/chrome/browser/ash/input_method/editor_text_query_provider.cc b/chrome/browser/ash/input_method/editor_text_query_provider.cc index 7517439..732b101 100644 --- a/chrome/browser/ash/input_method/editor_text_query_provider.cc +++ b/chrome/browser/ash/input_method/editor_text_query_provider.cc
@@ -4,10 +4,12 @@ #include "chrome/browser/ash/input_method/editor_text_query_provider.h" +#include "base/notreached.h" #include "base/values.h" #include "chrome/browser/manta/manta_service.h" #include "chrome/browser/manta/manta_service_factory.h" #include "chrome/browser/manta/manta_status.h" +#include "chromeos/ash/services/orca/public/mojom/orca_service.mojom.h" namespace ash::input_method { @@ -33,22 +35,45 @@ for (auto it = params.begin(); it != params.end(); ++it) { provider_request[it->first] = it->second; } + + provider_request["tone"] = request->text_query_id; return provider_request; } -orca::mojom::TextQueryResponsePtr ParseResponse( - base::Value::Dict& raw_response) { - if (raw_response.FindBool("error").value_or(false)) { - // TODO: b:300557202 - use the right error code - auto* error_message = raw_response.FindString("error_message"); - return orca::mojom::TextQueryResponse::NewError( - orca::mojom::TextQueryError::New( - orca::mojom::TextQueryErrorCode::kInvalidArgument, - error_message != nullptr ? *error_message : std::string())); +orca::mojom::TextQueryErrorCode ConvertErrorCode( + manta::MantaStatusCode status_code) { + switch (status_code) { + case manta::MantaStatusCode::kGenericError: + case manta::MantaStatusCode::kMalformedResponse: + return orca::mojom::TextQueryErrorCode::kUnknown; + case manta::MantaStatusCode::kInvalidInput: + return orca::mojom::TextQueryErrorCode::kInvalidArgument; + case manta::MantaStatusCode::kResourceExhausted: + return orca::mojom::TextQueryErrorCode::kResourceExhausted; + case manta::MantaStatusCode::kBackendFailure: + return orca::mojom::TextQueryErrorCode::kBackendFailure; + case manta::MantaStatusCode::kNoInternetConnection: + return orca::mojom::TextQueryErrorCode::kNoInternetConnection; + case manta::MantaStatusCode::kUnsupportedLanguage: + return orca::mojom::TextQueryErrorCode::kUnsupportedLanguage; + case manta::MantaStatusCode::kBlockedOutputs: + return orca::mojom::TextQueryErrorCode::kBlockedOutputs; + case manta::MantaStatusCode::kRestrictedCountry: + return orca::mojom::TextQueryErrorCode::kRestrictedRegion; + case manta::MantaStatusCode::kOk: + NOTREACHED_NORETURN(); } +} +orca::mojom::TextQueryErrorPtr ConvertErrorResponse(manta::MantaStatus status) { + return orca::mojom::TextQueryError::New(ConvertErrorCode(status.status_code), + status.message); +} + +std::vector<orca::mojom::TextQueryResultPtr> ParseSuccessResponse( + base::Value::Dict& response) { std::vector<orca::mojom::TextQueryResultPtr> results; - if (auto* output_data_list = raw_response.FindList("outputData")) { + if (auto* output_data_list = response.FindList("outputData")) { int result_id = 0; for (const auto& data : *output_data_list) { if (const auto* text = data.GetDict().FindString("text")) { @@ -58,7 +83,7 @@ } } } - return orca::mojom::TextQueryResponse::NewResults(std::move(results)); + return results; } } // namespace @@ -90,11 +115,13 @@ CreateProviderRequest(std::move(request)), base::BindOnce( [](ProcessCallback process_callback, base::Value::Dict dict, - manta::MantaStatus manta_status) { - // TODO(b:298285960): Deal with manta_status to obtain the errors - // properly. - auto response = ParseResponse(dict); - std::move(process_callback).Run(std::move(response)); + manta::MantaStatus status) { + std::move(process_callback) + .Run(status.status_code == manta::MantaStatusCode::kOk + ? orca::mojom::TextQueryResponse::NewResults( + ParseSuccessResponse(dict)) + : orca::mojom::TextQueryResponse::NewError( + ConvertErrorResponse(status))); }, std::move(callback))); }
diff --git a/chrome/browser/ash/login/ui/login_feedback.cc b/chrome/browser/ash/login/ui/login_feedback.cc index 738fb4c..645bc20 100644 --- a/chrome/browser/ash/login/ui/login_feedback.cc +++ b/chrome/browser/ash/login/ui/login_feedback.cc
@@ -4,7 +4,9 @@ #include "chrome/browser/ash/login/ui/login_feedback.h" +#include "ash/constants/ash_features.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/webui/ash/os_feedback_dialog.h" #include "chrome/browser/ui/webui/feedback/feedback_dialog.h" #include "extensions/browser/api/feedback_private/feedback_private_api.h" @@ -34,7 +36,11 @@ /*from_autofill=*/false, /*autofill_metadata=*/base::Value::Dict()); - FeedbackDialog::CreateOrShow(profile_, *info); + if (ash::features::IsOsFeedbackDialogEnabled()) { + OsFeedbackDialog::ShowDialog(profile_, *info); + } else { + FeedbackDialog::CreateOrShow(profile_, *info); + } } } // namespace ash
diff --git a/chrome/browser/ash/login/ui/login_feedback_browsertest.cc b/chrome/browser/ash/login/ui/login_feedback_browsertest.cc index 2e8e1d4..0a683125 100644 --- a/chrome/browser/ash/login/ui/login_feedback_browsertest.cc +++ b/chrome/browser/ash/login/ui/login_feedback_browsertest.cc
@@ -4,18 +4,42 @@ #include "chrome/browser/ash/login/ui/login_feedback.h" +#include "ash/constants/ash_features.h" +#include "ash/webui/os_feedback_ui/url_constants.h" #include "base/run_loop.h" #include "base/task/single_thread_task_runner.h" +#include "base/test/scoped_feature_list.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/test/oobe_base_test.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/webui/ash/os_feedback_dialog.h" +#include "chrome/browser/ui/webui/ash/system_web_dialog_delegate.h" #include "chrome/browser/ui/webui/feedback/feedback_dialog.h" #include "content/public/test/browser_test.h" namespace ash { +namespace { + +bool HasInstanceOfOsFeedbackDialog() { + return ash::SystemWebDialogDelegate::HasInstance( + GURL(ash::kChromeUIOSFeedbackUrl)); +} + +void TestOpenOsFeedbackDialog() { + Profile* const profile = ash::ProfileHelper::GetSigninProfile(); + std::unique_ptr<ash::LoginFeedback> login_feedback( + new ash::LoginFeedback(profile)); + // There should be none instance. + EXPECT_FALSE(HasInstanceOfOsFeedbackDialog()); + // Open the feedback dialog. + login_feedback->Request("Test feedback"); + // Verify an instance exists now. + EXPECT_TRUE(HasInstanceOfOsFeedbackDialog()); +} + class LoginFeedbackTest : public LoginManagerTest { public: LoginFeedbackTest() : LoginManagerTest() { @@ -31,6 +55,26 @@ LoginManagerMixin login_mixin_{&mixin_host_}; }; +class LoginOsFeedbackDialogTest : public LoginFeedbackTest { + public: + LoginOsFeedbackDialogTest() : LoginFeedbackTest() { + feature_list_.InitAndEnableFeature(features::kOsFeedbackDialog); + } + + private: + base::test::ScopedFeatureList feature_list_; +}; + +class OobeOsFeedbackDialogTest : public OobeBaseTest { + public: + OobeOsFeedbackDialogTest() : OobeBaseTest() { + feature_list_.InitAndEnableFeature(features::kOsFeedbackDialog); + } + + private: + base::test::ScopedFeatureList feature_list_; +}; + void EnsureFeedbackAppUIShown(FeedbackDialog* feedback_dialog, base::OnceClosure callback) { auto* widget = feedback_dialog->GetWidget(); @@ -74,6 +118,8 @@ feedback_dialog->GetWidget()->Close(); } +} // namespace + // Test feedback UI shows up and is active on the Login Screen IN_PROC_BROWSER_TEST_F(LoginFeedbackTest, Basic) { TestFeedback(); @@ -84,4 +130,16 @@ TestFeedback(); } +// Test feedback UI shows up and is active on the Login Screen when the feature +// flag OsFeedbackDialog is enabled. +IN_PROC_BROWSER_TEST_F(LoginOsFeedbackDialogTest, Basic) { + TestOpenOsFeedbackDialog(); +} + +// Test feedback UI shows up and is active in OOBE when the feature flag +// OsFeedbackDialog is enabled. +IN_PROC_BROWSER_TEST_F(OobeOsFeedbackDialogTest, Basic) { + TestOpenOsFeedbackDialog(); +} + } // namespace ash
diff --git a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog.cc b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog.cc index b985bb4..d2fbe12 100644 --- a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog.cc +++ b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog.cc
@@ -64,7 +64,7 @@ } views::Widget* FilesPolicyDialog::CreateErrorDialog( - const std::map<DlpConfidentialFile, Policy>& files, + const std::map<DlpConfidentialFile, BlockReason>& files, dlp::FileAction action, gfx::NativeWindow modal_parent) { if (factory_) {
diff --git a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog.h b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog.h index 4977511..414ddf9 100644 --- a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog.h +++ b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog.h
@@ -20,6 +20,8 @@ namespace policy { +class FilesPolicyDialogFactory; + // Dialog type (warning or error). enum class FilesDialogType { kUnknown, // Not a valid type - no dialog will be created. @@ -33,44 +35,27 @@ kEnterpriseConnectors, // Enterprise Connectors policy. }; -// Interface for creating warn and error FilesPolicyDialogs. -// Used in tests. -class FilesPolicyDialogFactory { - public: - virtual ~FilesPolicyDialogFactory() = default; - - virtual views::Widget* CreateWarnDialog( - OnDlpRestrictionCheckedWithJustificationCallback callback, - const std::vector<DlpConfidentialFile>& files, - dlp::FileAction action, - gfx::NativeWindow modal_parent, - absl::optional<DlpFileDestination> destination, - FilesPolicyWarnSettings settings) = 0; - - virtual views::Widget* CreateErrorDialog( - const std::map<DlpConfidentialFile, Policy>& files, - dlp::FileAction action, - gfx::NativeWindow modal_parent) = 0; -}; - // FilesPolicyDialog is a window modal dialog used to show detailed overview of // warnings and files blocked by data protection policies. class FilesPolicyDialog : public PolicyDialogBase { public: METADATA_HEADER(FilesPolicyDialog); - // Reasons for which a file can be blocked by an Enterprise Connectors policy. - enum class EnterpriseConnectorsBlockReason { + // Reasons for which a file can be blocked either because of an Enterprise + // Connectors or DLP policy. + enum class BlockReason { + // File was blocked because of Data Leak Prevention policies. + kDlp, // File was blocked but the reason is not known. - kUnknown, + kEnterpriseConnectorsUnknown, // File was blocked because it contains sensitive data (e.g., SSNs). - kSensitiveData, + kEnterpriseConnectorsSensitiveData, // File was blocked because it's a malware. - kMalware, + kEnterpriseConnectorsMalware, // File was blocked because it could not be scanned due to encryption. - kEncryptedFile, + kEnterpriseConnectorsEncryptedFile, // File was blocked because it could not be uploaded due to its size. - kLargeFile, + kEnterpriseConnectorsLargeFile, }; FilesPolicyDialog() = delete; @@ -94,7 +79,7 @@ // Creates and shows an instance of FilesPolicyErrorDialog. Returns owning // Widget. static views::Widget* CreateErrorDialog( - const std::map<DlpConfidentialFile, Policy>& files, + const std::map<DlpConfidentialFile, BlockReason>& files, dlp::FileAction action, gfx::NativeWindow modal_parent); @@ -116,6 +101,27 @@ views::Label* AddMessage(const std::u16string& message) override; }; +// Interface for creating warn and error FilesPolicyDialogs. +// Used in tests. +class FilesPolicyDialogFactory { + public: + virtual ~FilesPolicyDialogFactory() = default; + + virtual views::Widget* CreateWarnDialog( + OnDlpRestrictionCheckedWithJustificationCallback callback, + const std::vector<DlpConfidentialFile>& files, + dlp::FileAction action, + gfx::NativeWindow modal_parent, + absl::optional<DlpFileDestination> destination, + FilesPolicyWarnSettings settings) = 0; + + virtual views::Widget* CreateErrorDialog( + const std::map<DlpConfidentialFile, FilesPolicyDialog::BlockReason>& + files, + dlp::FileAction action, + gfx::NativeWindow modal_parent) = 0; +}; + } // namespace policy #endif // CHROME_BROWSER_ASH_POLICY_DLP_DIALOGS_FILES_POLICY_DIALOG_H_
diff --git a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_browsertest.cc b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_browsertest.cc index 3bc296c..7debcf315 100644 --- a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_browsertest.cc +++ b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_browsertest.cc
@@ -171,13 +171,13 @@ FilesPolicyDialogBrowserTest::SetUpOnMainThread(); blocked_files_.emplace(DlpConfidentialFile(base::FilePath("file1.txt")), - Policy::kDlp); + FilesPolicyDialog::BlockReason::kDlp); blocked_files_.emplace(DlpConfidentialFile(base::FilePath("file2.txt")), - Policy::kDlp); + FilesPolicyDialog::BlockReason::kDlp); } protected: - std::map<DlpConfidentialFile, Policy> blocked_files_; + std::map<DlpConfidentialFile, FilesPolicyDialog::BlockReason> blocked_files_; }; // Tests that the error dialog is created as a system modal if no parent is @@ -185,8 +185,9 @@ IN_PROC_BROWSER_TEST_P(ErrorDialogBrowserTest, NoParent) { dlp::FileAction action = GetParam(); // Add another blocked file to test the mixed error case. - blocked_files_.emplace(DlpConfidentialFile(base::FilePath("file3.txt")), - Policy::kEnterpriseConnectors); + blocked_files_.emplace( + DlpConfidentialFile(base::FilePath("file3.txt")), + FilesPolicyDialog::BlockReason::kEnterpriseConnectorsSensitiveData); auto* widget = FilesPolicyDialog::CreateErrorDialog(blocked_files_, action, /*modal_parent=*/nullptr);
diff --git a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.cc b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.cc index 1f2125e..828a7581 100644 --- a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.cc +++ b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.cc
@@ -10,14 +10,13 @@ namespace policy { -FilesPolicyDialog::EnterpriseConnectorsBlockReason -GetEnterpriseConnectorsBlockReason( +FilesPolicyDialog::BlockReason GetEnterpriseConnectorsBlockReason( const enterprise_connectors::FileTransferAnalysisDelegate:: FileTransferAnalysisResult& result) { CHECK(result.IsUnknown() || result.IsBlocked()); if (result.IsUnknown()) { - return FilesPolicyDialog::EnterpriseConnectorsBlockReason::kUnknown; + return FilesPolicyDialog::BlockReason::kEnterpriseConnectorsUnknown; } // Blocked files without a tag may happen for several reasons including @@ -31,36 +30,36 @@ if (result.final_result().value() == enterprise_connectors::FinalContentAnalysisResult::ENCRYPTED_FILES) { - return FilesPolicyDialog::EnterpriseConnectorsBlockReason::kEncryptedFile; + return FilesPolicyDialog::BlockReason::kEnterpriseConnectorsEncryptedFile; } if (result.final_result().value() == enterprise_connectors::FinalContentAnalysisResult::LARGE_FILES) { - return policy::FilesPolicyDialog::EnterpriseConnectorsBlockReason:: - kLargeFile; + return policy::FilesPolicyDialog::BlockReason:: + kEnterpriseConnectorsLargeFile; } NOTREACHED() << "Enterprise connector result representing a blocked transfer " "without a tag but with an unexpected final result value."; - return FilesPolicyDialog::EnterpriseConnectorsBlockReason::kUnknown; + return FilesPolicyDialog::BlockReason::kEnterpriseConnectorsUnknown; } DCHECK(result.tag() == enterprise_connectors::kDlpTag || result.tag() == enterprise_connectors::kMalwareTag); if (result.tag() == enterprise_connectors::kDlpTag) { - return policy::FilesPolicyDialog::EnterpriseConnectorsBlockReason:: - kSensitiveData; + return policy::FilesPolicyDialog::BlockReason:: + kEnterpriseConnectorsSensitiveData; } if (result.tag() == enterprise_connectors::kMalwareTag) { - return FilesPolicyDialog::EnterpriseConnectorsBlockReason::kMalware; + return FilesPolicyDialog::BlockReason::kEnterpriseConnectorsMalware; } NOTREACHED() << "Enterprise connector result representing a blocked transfer " "with an unexpected tag."; - return FilesPolicyDialog::EnterpriseConnectorsBlockReason::kUnknown; + return FilesPolicyDialog::BlockReason::kEnterpriseConnectorsUnknown; } } // namespace policy
diff --git a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.h b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.h index 6ae6b27..6d56efe 100644 --- a/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.h +++ b/chrome/browser/ash/policy/dlp/dialogs/files_policy_dialog_utils.h
@@ -12,8 +12,7 @@ // Converts a file transfer analysis result representing a block or unknown // verdict into a block reason. -FilesPolicyDialog::EnterpriseConnectorsBlockReason -GetEnterpriseConnectorsBlockReason( +FilesPolicyDialog::BlockReason GetEnterpriseConnectorsBlockReason( const enterprise_connectors::FileTransferAnalysisDelegate:: FileTransferAnalysisResult& result);
diff --git a/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.cc b/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.cc index f9b6699..3a23a55 100644 --- a/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.cc +++ b/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.cc
@@ -21,15 +21,16 @@ namespace policy { namespace { -// Returns the block reason description for `policy`. -std::u16string GetPolicyString(Policy policy, size_t file_count) { - return policy::files_string_util::GetBlockReasonMessage(policy, file_count, +// Returns the block reason description. +std::u16string GetPolicyString(FilesPolicyDialog::BlockReason reason, + size_t file_count) { + return policy::files_string_util::GetBlockReasonMessage(reason, file_count, u""); } } // namespace FilesPolicyErrorDialog::FilesPolicyErrorDialog( - const std::map<DlpConfidentialFile, Policy>& files, + const std::map<DlpConfidentialFile, FilesPolicyDialog::BlockReason>& files, dlp::FileAction action, gfx::NativeWindow modal_parent) : FilesPolicyDialog(files.size(), action, modal_parent) { @@ -40,14 +41,13 @@ SetButtonLabel(ui::DIALOG_BUTTON_OK, GetOkButton()); SetButtonLabel(ui::DialogButton::DIALOG_BUTTON_CANCEL, GetCancelButton()); - for (const auto& file : files) { - if (!base::Contains(files_, file.second)) { - files_.emplace(file.second, std::vector<DlpConfidentialFile>{file.first}); + for (const auto& [file, reason] : files) { + if (!base::Contains(files_, reason)) { + files_.emplace(reason, std::vector<DlpConfidentialFile>{file}); } else { - files_.at(file.second).push_back(file.first); + files_.at(reason).push_back(file); } } - CHECK(files_.size() == 1 || files_.size() == 2); file_count_ = files.size(); AddGeneralInformation(); @@ -98,7 +98,8 @@ return u""; } -void FilesPolicyErrorDialog::AddPolicyRow(Policy policy) { +void FilesPolicyErrorDialog::AddPolicyRow( + FilesPolicyDialog::BlockReason reason) { DCHECK(scroll_view_container_); views::View* row = scroll_view_container_->AddChildView(std::make_unique<views::View>()); @@ -107,7 +108,7 @@ gfx::Insets::TLBR(10, 16, 10, 16), 0)); views::Label* title_label = - AddRowTitle(GetPolicyString(policy, files_.at(policy).size()), row); + AddRowTitle(GetPolicyString(reason, files_.at(reason).size()), row); title_label->SetFontList( ash::TypographyProvider::Get()->ResolveTypographyToken( ash::TypographyToken::kCrosBody1));
diff --git a/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.h b/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.h index 9097f1b..e8a7ee39 100644 --- a/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.h +++ b/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.h
@@ -23,7 +23,8 @@ METADATA_HEADER(FilesPolicyErrorDialog); FilesPolicyErrorDialog() = delete; - FilesPolicyErrorDialog(const std::map<DlpConfidentialFile, Policy>& files, + FilesPolicyErrorDialog(const std::map<DlpConfidentialFile, + FilesPolicyDialog::BlockReason>& files, dlp::FileAction action, gfx::NativeWindow modal_parent); FilesPolicyErrorDialog(const FilesPolicyErrorDialog&) = delete; @@ -42,7 +43,7 @@ // Adds a row with blocked reason message based on `policy`. Should only be // called after `SetupUpperPanel()`. - void AddPolicyRow(Policy policy); + void AddPolicyRow(FilesPolicyDialog::BlockReason policy); // Called from the dialog's "Cancel" button. // Opens the help page for policy/-ies that blocked the file action. @@ -53,7 +54,8 @@ void Dismiss(); // Maps each policy reason to the list of files blocked because of it. - std::map<Policy, std::vector<DlpConfidentialFile>> files_; + std::map<FilesPolicyDialog::BlockReason, std::vector<DlpConfidentialFile>> + files_; // Total number of blocked files for all policies. size_t file_count_;
diff --git a/chrome/browser/ash/policy/dlp/files_policy_notification_manager.cc b/chrome/browser/ash/policy/dlp/files_policy_notification_manager.cc index 675ca83..8a458bb1 100644 --- a/chrome/browser/ash/policy/dlp/files_policy_notification_manager.cc +++ b/chrome/browser/ash/policy/dlp/files_policy_notification_manager.cc
@@ -73,20 +73,21 @@ // Returns the message for notification of `type` and with `file_count` // blocked/warned files. `first_file` is the name of the first restricted file -// and is only used for single file notifications. `policy` is the block reason +// and is only used for single file notifications. `reason` is the block reason // of the first restricted file and is only used for single file block // notifications. -std::u16string GetNotificationMessage(NotificationType type, - size_t file_count, - const std::u16string& first_file, - absl::optional<Policy> policy) { +std::u16string GetNotificationMessage( + NotificationType type, + size_t file_count, + const std::u16string& first_file, + absl::optional<FilesPolicyDialog::BlockReason> reason) { switch (type) { case NotificationType::kError: - CHECK(policy.has_value()); + CHECK(reason.has_value()); return file_count > 1 ? l10n_util::GetStringUTF16(IDS_POLICY_DLP_FILES_BLOCK_MESSAGE) : policy::files_string_util::GetBlockReasonMessage( - policy.value(), file_count, first_file); + reason.value(), file_count, first_file); case NotificationType::kWarning: const std::u16string placeholder_value = file_count == 1 ? first_file : base::NumberToString16(file_count); @@ -286,7 +287,8 @@ } for (const auto& file : blocked_files) { io_tasks_.at(task_id.value()) - .AddBlockedFile(DlpConfidentialFile(file), Policy::kDlp); + .AddBlockedFile(DlpConfidentialFile(file), + FilesPolicyDialog::BlockReason::kDlp); } } else { ShowDlpBlockNotification(std::move(blocked_files), action); @@ -297,7 +299,7 @@ file_manager::io_task::IOTaskId task_id, std::vector<base::FilePath> blocked_files, dlp::FileAction action, - FilesPolicyDialog::EnterpriseConnectorsBlockReason reason) { + FilesPolicyDialog::BlockReason reason) { // Sometimes EC checks are done before FilesPolicyNotificationManager is // lazily created, so the task is not tracked and the blocked files won't // be added. On the other hand, the IOTask may be aborted/canceled already so @@ -305,10 +307,8 @@ if (!HasIOTask(task_id)) { AddIOTask(task_id, action); } - // TODO(b/300643270): store EnterpriseConnectorsBlockReason in the IOTask. for (const auto& file : blocked_files) { - io_tasks_.at(task_id).AddBlockedFile(DlpConfidentialFile(file), - Policy::kEnterpriseConnectors); + io_tasks_.at(task_id).AddBlockedFile(DlpConfidentialFile(file), reason); } } @@ -451,7 +451,7 @@ io_tasks_.erase(task_id); } -std::map<DlpConfidentialFile, Policy> +std::map<DlpConfidentialFile, FilesPolicyDialog::BlockReason> FilesPolicyNotificationManager::GetIOTaskBlockedFilesForTesting( file_manager::io_task::IOTaskId task_id) const { if (!HasIOTask(task_id)) { @@ -542,7 +542,7 @@ FileTaskInfo info(action); for (const auto& file : files) { info.AddBlockedFile(DlpConfidentialFile(file.file_path), - Policy::kDlp); + FilesPolicyDialog::BlockReason::kDlp); } non_io_tasks_.emplace(notification_id, std::move(info)); // Always open the Files app. This should notify us through @@ -656,8 +656,8 @@ void FilesPolicyNotificationManager::FileTaskInfo::AddBlockedFile( DlpConfidentialFile file, - Policy policy) { - blocked_files_.emplace(file, policy); + FilesPolicyDialog::BlockReason reason) { + blocked_files_.emplace(file, reason); } void FilesPolicyNotificationManager::FileTaskInfo::OnWidgetDestroying( @@ -711,7 +711,7 @@ : NotificationType::kError; size_t file_count; std::u16string file_name; - absl::optional<Policy> policy; + absl::optional<FilesPolicyDialog::BlockReason> reason; if (HasWarning(task_id)) { CHECK(!io_tasks_.at(task_id).GetWarningInfo()->files.empty()); file_count = io_tasks_.at(task_id).GetWarningInfo()->files.size(); @@ -720,11 +720,11 @@ CHECK(HasBlockedFiles(task_id)); file_count = io_tasks_.at(task_id).blocked_files().size(); file_name = io_tasks_.at(task_id).blocked_files().begin()->first.title; - policy = io_tasks_.at(task_id).blocked_files().begin()->second; + reason = io_tasks_.at(task_id).blocked_files().begin()->second; } auto notification = file_manager::CreateSystemNotification( notification_id, GetNotificationTitle(type, action, file_count), - GetNotificationMessage(type, file_count, file_name, policy), + GetNotificationMessage(type, file_count, file_name, reason), base::MakeRefCounted<message_center::HandleNotificationClickDelegate>( std::move(callback)), optional_fields); @@ -1089,7 +1089,8 @@ blocked_files.size()), GetNotificationMessage( NotificationType::kError, blocked_files.size(), - blocked_files.begin()->BaseName().LossyDisplayName(), Policy::kDlp), + blocked_files.begin()->BaseName().LossyDisplayName(), + FilesPolicyDialog::BlockReason::kDlp), base::MakeRefCounted<PolicyNotificationClickHandler>(base::BindOnce( &FilesPolicyNotificationManager::HandleDlpErrorNotificationClick, weak_factory_.GetWeakPtr(), notification_id,
diff --git a/chrome/browser/ash/policy/dlp/files_policy_notification_manager.h b/chrome/browser/ash/policy/dlp/files_policy_notification_manager.h index ce74d47..add158b 100644 --- a/chrome/browser/ash/policy/dlp/files_policy_notification_manager.h +++ b/chrome/browser/ash/policy/dlp/files_policy_notification_manager.h
@@ -78,7 +78,7 @@ file_manager::io_task::IOTaskId task_id, std::vector<base::FilePath> blocked_files, dlp::FileAction action, - FilesPolicyDialog::EnterpriseConnectorsBlockReason reason); + FilesPolicyDialog::BlockReason reason); // Shows DLP Warning UI. If `task_id` is set, the corresponding IOTask // will be paused. Otherwise a desktop notification will be shown. Virtual @@ -131,7 +131,8 @@ // Clears any info stored about the task with `task_id`. virtual void OnErrorItemDismissed(file_manager::io_task::IOTaskId task_id); - std::map<DlpConfidentialFile, Policy> GetIOTaskBlockedFilesForTesting( + std::map<DlpConfidentialFile, FilesPolicyDialog::BlockReason> + GetIOTaskBlockedFilesForTesting( file_manager::io_task::IOTaskId task_id) const; // Returns whether IO task has a warning timeout timer. bool HasWarningTimerForTesting(file_manager::io_task::IOTaskId task_id) const; @@ -205,11 +206,13 @@ // Returns true if `warning_info_` has value. bool HasWarningInfo() const; - const std::map<DlpConfidentialFile, Policy>& blocked_files() const { + const std::map<DlpConfidentialFile, FilesPolicyDialog::BlockReason>& + blocked_files() const { return blocked_files_; } // Add `file` to the blocked files map. - void AddBlockedFile(DlpConfidentialFile file, Policy policy); + void AddBlockedFile(DlpConfidentialFile file, + FilesPolicyDialog::BlockReason reason); dlp::FileAction action() const { return action_; } @@ -221,7 +224,8 @@ absl::optional<WarningInfo> warning_info_; // A map of all files blocked to be transferred and the block reason for // each. - std::map<DlpConfidentialFile, Policy> blocked_files_; + std::map<DlpConfidentialFile, FilesPolicyDialog::BlockReason> + blocked_files_; // The action that's restricted. dlp::FileAction action_; // Warning/Error dialog widget. Each FileTask is expected to have only one
diff --git a/chrome/browser/ash/policy/dlp/files_policy_notification_manager_browsertest.cc b/chrome/browser/ash/policy/dlp/files_policy_notification_manager_browsertest.cc index 984c3da..b9d44d9 100644 --- a/chrome/browser/ash/policy/dlp/files_policy_notification_manager_browsertest.cc +++ b/chrome/browser/ash/policy/dlp/files_policy_notification_manager_browsertest.cc
@@ -81,7 +81,8 @@ } // namespace -using BlockedFilesMap = std::map<DlpConfidentialFile, Policy>; +using BlockedFilesMap = + std::map<DlpConfidentialFile, FilesPolicyDialog::BlockReason>; class MockFilesPolicyDialogFactory : public FilesPolicyDialogFactory { public: @@ -550,8 +551,10 @@ IN_PROC_BROWSER_TEST_P(NonIOErrorBrowserTest, MultiFileOKShowsDialog) { auto action = GetParam(); BlockedFilesMap blocked_map; - blocked_map.emplace(base::FilePath("file1.txt"), Policy::kDlp); - blocked_map.emplace(base::FilePath("file2.txt"), Policy::kDlp); + blocked_map.emplace(base::FilePath("file1.txt"), + FilesPolicyDialog::BlockReason::kDlp); + blocked_map.emplace(base::FilePath("file2.txt"), + FilesPolicyDialog::BlockReason::kDlp); EXPECT_CALL(*factory_, CreateErrorDialog(blocked_map, action, testing::NotNull())) .Times(1); @@ -647,8 +650,10 @@ IN_PROC_BROWSER_TEST_P(NonIOErrorBrowserTest, MultiFileOKShowsDialog_Timeout) { auto action = GetParam(); BlockedFilesMap blocked_map; - blocked_map.emplace(base::FilePath("file1.txt"), Policy::kDlp); - blocked_map.emplace(base::FilePath("file2.txt"), Policy::kDlp); + blocked_map.emplace(base::FilePath("file1.txt"), + FilesPolicyDialog::BlockReason::kDlp); + blocked_map.emplace(base::FilePath("file2.txt"), + FilesPolicyDialog::BlockReason::kDlp); // Set factory to create a real dialog. // Null modal parent means the dialog is a system modal. EXPECT_CALL(*factory_, @@ -1267,8 +1272,10 @@ auto [type, action] = GetParam(); BlockedFilesMap blocked_map; - blocked_map.emplace(base::FilePath("file1.txt"), Policy::kDlp); - blocked_map.emplace(base::FilePath("file2.txt"), Policy::kDlp); + blocked_map.emplace(base::FilePath("file1.txt"), + FilesPolicyDialog::BlockReason::kDlp); + blocked_map.emplace(base::FilePath("file2.txt"), + FilesPolicyDialog::BlockReason::kDlp); EXPECT_CALL(*factory_, CreateErrorDialog(blocked_map, action, testing::NotNull())) .Times(2);
diff --git a/chrome/browser/ash/policy/dlp/files_policy_notification_manager_unittest.cc b/chrome/browser/ash/policy/dlp/files_policy_notification_manager_unittest.cc index a3418d5..88c4f23 100644 --- a/chrome/browser/ash/policy/dlp/files_policy_notification_manager_unittest.cc +++ b/chrome/browser/ash/policy/dlp/files_policy_notification_manager_unittest.cc
@@ -105,13 +105,18 @@ } } -// Converts file_manager::io_task::PolicyErrorType to FilesPolicyDialog::Policy. -Policy ConvertPolicy(file_manager::io_task::PolicyErrorType policy_error_type) { +// Converts file_manager::io_task::PolicyErrorType to +// FilesPolicyDialog::BlockReason. +FilesPolicyDialog::BlockReason ConvertPolicy( + file_manager::io_task::PolicyErrorType policy_error_type) { switch (policy_error_type) { case file_manager::io_task::PolicyErrorType::kDlp: - return Policy::kDlp; + return FilesPolicyDialog::BlockReason::kDlp; case file_manager::io_task::PolicyErrorType::kEnterpriseConnectors: - return Policy::kEnterpriseConnectors; + // We don't have elements to identify a specific enterprise connectors + // block reason from a PolicyErrorType. For testing purposes, we simply + // return one among the existing reasons. + return FilesPolicyDialog::BlockReason::kEnterpriseConnectorsUnknown; case file_manager::io_task::PolicyErrorType::kDlpWarningTimeout: NOTREACHED_NORETURN(); } @@ -283,22 +288,20 @@ class FPNMIOTaskTest : public FilesPolicyNotificationManagerTest { protected: - // Depending on the policy, calls FPNM::ShowDlpBlockedFiles() or + // Depending on the block reason, calls FPNM::ShowDlpBlockedFiles() or // FPNM::AddConnectorsBlockedFiles(), both of which store all the info about // the task to later show notifications/dialogs. - void AddBlockedFiles(Policy policy, - file_manager::io_task::IOTaskId task_id, - std::vector<base::FilePath> blocked_files, - dlp::FileAction action) { - switch (policy) { - case Policy::kDlp: - fpnm_->ShowDlpBlockedFiles(task_id, std::move(blocked_files), action); - return; - case Policy::kEnterpriseConnectors: - fpnm_->AddConnectorsBlockedFiles( - task_id, std::move(blocked_files), action, - FilesPolicyDialog::EnterpriseConnectorsBlockReason::kSensitiveData); - return; + void AddBlockedFiles( + FilesPolicyDialog::FilesPolicyDialog::BlockReason block_reason, + file_manager::io_task::IOTaskId task_id, + std::vector<base::FilePath> blocked_files, + dlp::FileAction action) { + if (block_reason == + FilesPolicyDialog::FilesPolicyDialog::BlockReason::kDlp) { + fpnm_->ShowDlpBlockedFiles(task_id, std::move(blocked_files), action); + } else { + fpnm_->AddConnectorsBlockedFiles(task_id, std::move(blocked_files), + action, block_reason); } } @@ -338,7 +341,7 @@ file_manager::io_task::IOTaskId task_id = 1; ASSERT_FALSE(AddCopyOrMoveIOTask(task_id, /*is_copy=*/true).empty()); EXPECT_TRUE(fpnm_->HasIOTask(task_id)); - AddBlockedFiles(Policy::kDlp, task_id, + AddBlockedFiles(FilesPolicyDialog::BlockReason::kDlp, task_id, {base::FilePath(kFile1), base::FilePath(kFile2)}, dlp::FileAction::kCopy); @@ -385,7 +388,7 @@ file_manager::io_task::IOTaskId task_id = 1; ASSERT_FALSE(AddCopyOrMoveIOTask(task_id, /*is_copy=*/true).empty()); EXPECT_TRUE(fpnm_->HasIOTask(task_id)); - AddBlockedFiles(Policy::kDlp, task_id, + AddBlockedFiles(FilesPolicyDialog::BlockReason::kDlp, task_id, {base::FilePath(kFile1), base::FilePath(kFile2)}, dlp::FileAction::kCopy); fpnm_->OnErrorItemDismissed(task_id); @@ -409,25 +412,27 @@ EXPECT_FALSE(fpnm_->HasIOTask(task_id)); } -class FilesPolicyNotificationManagerDlpAndConnectorsTest +class FilesPolicyNotificationManagerDlpAndConnectorsWarningTest : public FPNMIOTaskTest, public testing::WithParamInterface<Policy> { public: Policy GetPolicy() { return GetParam(); } }; -INSTANTIATE_TEST_SUITE_P(DLP, - FilesPolicyNotificationManagerDlpAndConnectorsTest, - ::testing::Values(Policy::kDlp)); +INSTANTIATE_TEST_SUITE_P( + DLP, + FilesPolicyNotificationManagerDlpAndConnectorsWarningTest, + ::testing::Values(Policy::kDlp)); -INSTANTIATE_TEST_SUITE_P(EnterpriseConnectors, - FilesPolicyNotificationManagerDlpAndConnectorsTest, - ::testing::Values(Policy::kEnterpriseConnectors)); +INSTANTIATE_TEST_SUITE_P( + EnterpriseConnectors, + FilesPolicyNotificationManagerDlpAndConnectorsWarningTest, + ::testing::Values(Policy::kEnterpriseConnectors)); // Tests that passing task id to ShowDlpWarning will pause the corresponding // IOTask. Completing the task with error should abort it and run the warning // callback with false. -TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsTest, +TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsWarningTest, WarningPausesIOTask) { IOTaskStatusObserver observer; io_task_controller_->AddObserver(&observer); @@ -501,70 +506,9 @@ } } -// ShowDlpBlockedFiles/AddConnectorsBlockedFiles updates IO task info. -TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsTest, - ShowDlpIOBlockedFiles) { - IOTaskStatusObserver observer; - io_task_controller_->AddObserver(&observer); - - file_manager::io_task::IOTaskId task_id = 1; - - // Task is queued. - EXPECT_CALL( - observer, - OnIOTaskStatus( - AllOf(Field(&file_manager::io_task::ProgressStatus::task_id, task_id), - Field(&file_manager::io_task::ProgressStatus::state, - file_manager::io_task::State::kQueued)))); - - auto src_file_path = AddCopyOrMoveIOTask(task_id, /*is_copy=*/true); - ASSERT_FALSE(src_file_path.empty()); - EXPECT_TRUE(fpnm_->HasIOTask(task_id)); - - AddBlockedFiles(GetPolicy(), task_id, - std::vector<base::FilePath>{src_file_path}, - dlp::FileAction::kCopy); - - // Task in progress. - EXPECT_CALL( - observer, - OnIOTaskStatus( - AllOf(Field(&file_manager::io_task::ProgressStatus::task_id, task_id), - Field(&file_manager::io_task::ProgressStatus::state, - file_manager::io_task::State::kInProgress)))); - - // Task completes successfully. - EXPECT_CALL( - observer, - OnIOTaskStatus( - AllOf(Field(&file_manager::io_task::ProgressStatus::task_id, task_id), - Field(&file_manager::io_task::ProgressStatus::state, - file_manager::io_task::State::kSuccess)))); - - base::RunLoop().RunUntilIdle(); - io_task_controller_->RemoveObserver(&observer); - - // Task is not removed after completion. - EXPECT_TRUE(fpnm_->HasIOTask(task_id)); - - std::map<DlpConfidentialFile, Policy> expected_blocked_files{ - {DlpConfidentialFile(src_file_path), GetPolicy()}}; - EXPECT_EQ(fpnm_->GetIOTaskBlockedFilesForTesting(task_id), - expected_blocked_files); - - if (GetPolicy() == Policy::kDlp) { - EXPECT_THAT( - histogram_tester_.GetAllSamples( - GetDlpHistogramPrefix() + std::string(dlp::kFileActionBlockedUMA)), - base::BucketsAre(base::Bucket(dlp::FileAction::kCopy, 1))); - EXPECT_THAT(histogram_tester_.GetAllSamples(GetDlpHistogramPrefix() + - dlp::kFilesBlockedCountUMA), - testing::ElementsAre(base::Bucket(1, 1))); - } -} - // Tests that cancelling a paused IO task will run the warning callback. -TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsTest, WarningCancelled) { +TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsWarningTest, + WarningCancelled) { IOTaskStatusObserver observer; io_task_controller_->AddObserver(&observer); @@ -634,7 +578,8 @@ } // Tests that resuming a paused IO task will run the warning callback. -TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsTest, WarningResumed) { +TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsWarningTest, + WarningResumed) { IOTaskStatusObserver observer; io_task_controller_->AddObserver(&observer); @@ -695,44 +640,8 @@ } } -// Tests that blocking files from non-tracked IO task will add it to FPNM. -TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsTest, - TaskBlockedNotTracked) { - fpnm_->Shutdown(); - fpnm_.reset(); - - int task_id = 1; - auto dst_url = - CreateFileSystemURL(kTestStorageKey, temp_dir_.GetPath().value()); - - auto src_file_path = AddCopyOrMoveIOTask(task_id, /*is_copy=*/true); - ASSERT_FALSE(src_file_path.empty()); - - fpnm_ = std::make_unique<FilesPolicyNotificationManager>(profile_); - ASSERT_FALSE(fpnm_->HasIOTask(task_id)); - - AddBlockedFiles(GetPolicy(), task_id, {base::FilePath(src_file_path)}, - dlp::FileAction::kCopy); - - EXPECT_TRUE(fpnm_->HasIOTask(task_id)); - std::map<DlpConfidentialFile, Policy> expected_blocked_files{ - {DlpConfidentialFile(src_file_path), GetPolicy()}}; - EXPECT_EQ(fpnm_->GetIOTaskBlockedFilesForTesting(task_id), - expected_blocked_files); - - if (GetPolicy() == Policy::kDlp) { - EXPECT_THAT( - histogram_tester_.GetAllSamples( - GetDlpHistogramPrefix() + std::string(dlp::kFileActionBlockedUMA)), - base::BucketsAre(base::Bucket(dlp::FileAction::kCopy, 1))); - EXPECT_THAT(histogram_tester_.GetAllSamples(GetDlpHistogramPrefix() + - dlp::kFilesBlockedCountUMA), - testing::ElementsAre(base::Bucket(1, 1))); - } -} - // Tests that warning files from non-tracked IO task will add it to FPNM. -TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsTest, +TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsWarningTest, TaskWarnedNotTracked) { fpnm_->Shutdown(); fpnm_.reset(); @@ -792,6 +701,124 @@ } } +class FilesPolicyNotificationManagerDlpAndConnectorsBlockTest + : public FPNMIOTaskTest, + public testing::WithParamInterface<FilesPolicyDialog::BlockReason> { + public: + FilesPolicyDialog::BlockReason GetBlockReason() { return GetParam(); } +}; + +INSTANTIATE_TEST_SUITE_P( + DLP, + FilesPolicyNotificationManagerDlpAndConnectorsBlockTest, + ::testing::Values( + FilesPolicyDialog::BlockReason::kDlp, + FilesPolicyDialog::BlockReason::kEnterpriseConnectorsSensitiveData, + FilesPolicyDialog::BlockReason::kEnterpriseConnectorsMalware, + FilesPolicyDialog::BlockReason::kEnterpriseConnectorsEncryptedFile, + FilesPolicyDialog::BlockReason::kEnterpriseConnectorsLargeFile, + FilesPolicyDialog::BlockReason::kEnterpriseConnectorsUnknown)); + +// ShowDlpBlockedFiles/AddConnectorsBlockedFiles updates IO task info. +TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsBlockTest, + ShowDlpIOBlockedFiles) { + IOTaskStatusObserver observer; + io_task_controller_->AddObserver(&observer); + + file_manager::io_task::IOTaskId task_id = 1; + + // Task is queued. + EXPECT_CALL( + observer, + OnIOTaskStatus( + AllOf(Field(&file_manager::io_task::ProgressStatus::task_id, task_id), + Field(&file_manager::io_task::ProgressStatus::state, + file_manager::io_task::State::kQueued)))); + + auto src_file_path = AddCopyOrMoveIOTask(task_id, /*is_copy=*/true); + ASSERT_FALSE(src_file_path.empty()); + EXPECT_TRUE(fpnm_->HasIOTask(task_id)); + + AddBlockedFiles(GetBlockReason(), task_id, + std::vector<base::FilePath>{src_file_path}, + dlp::FileAction::kCopy); + + // Task in progress. + EXPECT_CALL( + observer, + OnIOTaskStatus( + AllOf(Field(&file_manager::io_task::ProgressStatus::task_id, task_id), + Field(&file_manager::io_task::ProgressStatus::state, + file_manager::io_task::State::kInProgress)))); + + // Task completes successfully. + EXPECT_CALL( + observer, + OnIOTaskStatus( + AllOf(Field(&file_manager::io_task::ProgressStatus::task_id, task_id), + Field(&file_manager::io_task::ProgressStatus::state, + file_manager::io_task::State::kSuccess)))); + + base::RunLoop().RunUntilIdle(); + io_task_controller_->RemoveObserver(&observer); + + // Task is not removed after completion. + EXPECT_TRUE(fpnm_->HasIOTask(task_id)); + + std::map<DlpConfidentialFile, FilesPolicyDialog::BlockReason> + expected_blocked_files{ + {DlpConfidentialFile(src_file_path), GetBlockReason()}}; + EXPECT_EQ(fpnm_->GetIOTaskBlockedFilesForTesting(task_id), + expected_blocked_files); + + if (GetBlockReason() == FilesPolicyDialog::BlockReason::kDlp) { + EXPECT_THAT( + histogram_tester_.GetAllSamples( + GetDlpHistogramPrefix() + std::string(dlp::kFileActionBlockedUMA)), + base::BucketsAre(base::Bucket(dlp::FileAction::kCopy, 1))); + EXPECT_THAT(histogram_tester_.GetAllSamples(GetDlpHistogramPrefix() + + dlp::kFilesBlockedCountUMA), + testing::ElementsAre(base::Bucket(1, 1))); + } +} + +// Tests that blocking files from non-tracked IO task will add it to FPNM. +TEST_P(FilesPolicyNotificationManagerDlpAndConnectorsBlockTest, + TaskBlockedNotTracked) { + fpnm_->Shutdown(); + fpnm_.reset(); + + int task_id = 1; + auto dst_url = + CreateFileSystemURL(kTestStorageKey, temp_dir_.GetPath().value()); + + auto src_file_path = AddCopyOrMoveIOTask(task_id, /*is_copy=*/true); + ASSERT_FALSE(src_file_path.empty()); + + fpnm_ = std::make_unique<FilesPolicyNotificationManager>(profile_); + ASSERT_FALSE(fpnm_->HasIOTask(task_id)); + + AddBlockedFiles(GetBlockReason(), task_id, {base::FilePath(src_file_path)}, + dlp::FileAction::kCopy); + + EXPECT_TRUE(fpnm_->HasIOTask(task_id)); + std::map<DlpConfidentialFile, FilesPolicyDialog::BlockReason> + expected_blocked_files{ + {DlpConfidentialFile(src_file_path), GetBlockReason()}}; + EXPECT_EQ(fpnm_->GetIOTaskBlockedFilesForTesting(task_id), + expected_blocked_files); + + if (GetBlockReason() == FilesPolicyDialog::BlockReason::kDlp) { + EXPECT_THAT( + histogram_tester_.GetAllSamples( + GetDlpHistogramPrefix() + std::string(dlp::kFileActionBlockedUMA)), + base::BucketsAre(base::Bucket(dlp::FileAction::kCopy, 1))); + EXPECT_THAT(histogram_tester_.GetAllSamples(GetDlpHistogramPrefix() + + dlp::kFilesBlockedCountUMA), + testing::ElementsAre(base::Bucket(1, 1))); + } +} + class FPNMPausedStatusNotification : public FPNMIOTaskTest, public ::testing::WithParamInterface<
diff --git a/chrome/browser/ash/policy/dlp/files_policy_string_util.cc b/chrome/browser/ash/policy/dlp/files_policy_string_util.cc index 21b5cb2fc..3362d96 100644 --- a/chrome/browser/ash/policy/dlp/files_policy_string_util.cc +++ b/chrome/browser/ash/policy/dlp/files_policy_string_util.cc
@@ -95,17 +95,22 @@ } } -std::u16string GetBlockReasonMessage(Policy policy, +std::u16string GetBlockReasonMessage(FilesPolicyDialog::BlockReason reason, size_t file_count, const std::u16string& first_file) { int message_id; const std::u16string placeholder_value = file_count == 1 ? first_file : base::NumberToString16(file_count); - switch (policy) { - case Policy::kDlp: + switch (reason) { + case FilesPolicyDialog::BlockReason::kDlp: message_id = IDS_POLICY_DLP_FILES_POLICY_BLOCK_MESSAGE; break; - case Policy::kEnterpriseConnectors: + case FilesPolicyDialog::BlockReason::kEnterpriseConnectorsSensitiveData: + case FilesPolicyDialog::BlockReason::kEnterpriseConnectorsMalware: + case FilesPolicyDialog::BlockReason::kEnterpriseConnectorsEncryptedFile: + case FilesPolicyDialog::BlockReason::kEnterpriseConnectorsLargeFile: + case FilesPolicyDialog::BlockReason::kEnterpriseConnectorsUnknown: + // TODO(b/300705572): provide a proper message for every switch case. message_id = IDS_POLICY_DLP_FILES_CONTENT_BLOCK_MESSAGE; break; }
diff --git a/chrome/browser/ash/policy/dlp/files_policy_string_util.h b/chrome/browser/ash/policy/dlp/files_policy_string_util.h index 5c3d6ba..d58e4f3 100644 --- a/chrome/browser/ash/policy/dlp/files_policy_string_util.h +++ b/chrome/browser/ash/policy/dlp/files_policy_string_util.h
@@ -24,10 +24,10 @@ std::u16string GetContinueAnywayButton(dlp::FileAction action); // Returns the message for notification or dialog informing the user that the -// file action on `file_count` files is blocked due to `policy`. `first_file` is +// file action on `file_count` files is blocked due to `reason`. `first_file` is // the name of the first restricted file and is only used for single file // notifications. -std::u16string GetBlockReasonMessage(Policy policy, +std::u16string GetBlockReasonMessage(FilesPolicyDialog::BlockReason reason, size_t file_count, const std::u16string& first_file = u"");
diff --git a/chrome/browser/ash/policy/dlp/test/mock_files_policy_notification_manager.h b/chrome/browser/ash/policy/dlp/test/mock_files_policy_notification_manager.h index 82184cb..36f0c9b 100644 --- a/chrome/browser/ash/policy/dlp/test/mock_files_policy_notification_manager.h +++ b/chrome/browser/ash/policy/dlp/test/mock_files_policy_notification_manager.h
@@ -44,7 +44,7 @@ (file_manager::io_task::IOTaskId task_id, std::vector<base::FilePath> blocked_files, dlp::FileAction action, - FilesPolicyDialog::EnterpriseConnectorsBlockReason reason), + FilesPolicyDialog::BlockReason reason), (override)); MOCK_METHOD(void,
diff --git a/chrome/browser/ash/system_web_apps/apps/chrome_file_manager_ui_delegate.cc b/chrome/browser/ash/system_web_apps/apps/chrome_file_manager_ui_delegate.cc index e6f518f..0492149 100644 --- a/chrome/browser/ash/system_web_apps/apps/chrome_file_manager_ui_delegate.cc +++ b/chrome/browser/ash/system_web_apps/apps/chrome_file_manager_ui_delegate.cc
@@ -6,6 +6,7 @@ #include "base/metrics/histogram_functions.h" #include "base/task/sequenced_task_runner.h" +#include "base/time/time.h" #include "base/values.h" #include "chrome/browser/ash/drive/file_system_util.h" #include "chrome/browser/ash/file_manager/file_manager_string_util.h" @@ -15,7 +16,9 @@ #include "chrome/browser/ash/policy/dlp/files_policy_notification_manager_factory.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" +#include "components/drive/drive_pref_names.h" #include "components/drive/file_errors.h" +#include "components/prefs/pref_service.h" #include "content/public/browser/web_ui.h" ChromeFileManagerUIDelegate::ChromeFileManagerUIDelegate(content::WebUI* web_ui) @@ -110,16 +113,43 @@ drive::FileError error, drivefs::mojom::DocsOfflineStatsPtr stats) { if (error != drive::FileError::FILE_ERROR_OK || !stats || - stats->total == -1 || stats->available_offline == -1 || - (total_available_offline_hosted_files_ == stats->available_offline && - total_hosted_files_ == stats->total)) { + stats->total == -1 || stats->available_offline == -1) { VLOG(1) << "Not recording the Docs offline UMA stat"; return; } - base::UmaHistogramPercentage( - "FileBrowser.GoogleDrive.DSSAvailabilityPercentage", - stats->total == 0 ? 0 : (stats->available_offline * 100 / stats->total)); + const int32_t availability_percent = + stats->total == 0 ? 0 : (stats->available_offline * 100 / stats->total); + + // Only emitted if a change in percentage is detected. + if (total_available_offline_hosted_files_ != stats->available_offline || + total_hosted_files_ != stats->total) { + base::UmaHistogramPercentage( + "FileBrowser.GoogleDrive.DSSAvailabilityPercentage", + availability_percent); + } + + // Emitted after 1 day has elapsed since it was last emitted. + if (Profile* const profile = Profile::FromWebUI(web_ui_)) { + PrefService* const prefs = profile->GetPrefs(); + DCHECK(prefs); + + const base::TimeDelta time_since_last_update = + base::Time::Now() - + prefs->GetTime(drive::prefs::kDriveFsDSSAvailabilityLastEmitted); + if (time_since_last_update > base::Days(1)) { + base::UmaHistogramPercentage( + "FileBrowser.GoogleDrive.DailyDSSAvailabilityPercentage", + availability_percent); + } + + if (time_since_last_update > base::Days(1) || + time_since_last_update.is_negative()) { + prefs->SetTime(drive::prefs::kDriveFsDSSAvailabilityLastEmitted, + base::Time::Now()); + } + } + total_available_offline_hosted_files_ = stats->available_offline; total_hosted_files_ = stats->total; }
diff --git a/chrome/browser/chrome_browser_interface_binders.cc b/chrome/browser/chrome_browser_interface_binders.cc index 50e0249..8134d8bd 100644 --- a/chrome/browser/chrome_browser_interface_binders.cc +++ b/chrome/browser/chrome_browser_interface_binders.cc
@@ -180,6 +180,7 @@ #endif #include "chrome/browser/ui/side_panel/customize_chrome/customize_chrome_utils.h" #include "chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.h" +#include "chrome/browser/ui/webui/hats/hats_ui.h" #include "chrome/browser/ui/webui/history/history_ui.h" #include "chrome/browser/ui/webui/internals/user_education/user_education_internals.mojom.h" #include "chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom.h" @@ -1724,6 +1725,9 @@ registry.ForWebUI<ReadAnythingUntrustedUI>() .Add<color_change_listener::mojom::PageHandler>(); } + if (base::FeatureList::IsEnabled(features::kHaTSWebUI)) { + registry.ForWebUI<HatsUI>().Add<hats::mojom::PageHandlerFactory>(); + } #endif // !BUILDFLAG(IS_ANDROID) }
diff --git a/chrome/browser/devtools/device/devtools_device_discovery.cc b/chrome/browser/devtools/device/devtools_device_discovery.cc index e1c7fc28..28fac6a6 100644 --- a/chrome/browser/devtools/device/devtools_device_discovery.cc +++ b/chrome/browser/devtools/device/devtools_device_discovery.cc
@@ -405,6 +405,9 @@ scoped_refptr<RemoteBrowser>, int result, const std::string& response); + void ParseBrowserInfo(scoped_refptr<RemoteBrowser> browser, + const std::string& version_response, + bool& is_node); base::OnceCallback<void(const CompleteDevices&)> callback_; DevToolsDeviceDiscovery::CompleteDevices complete_devices_; @@ -456,27 +459,13 @@ } } -void DevToolsDeviceDiscovery::DiscoveryRequest::ReceivedVersion( - scoped_refptr<AndroidDeviceManager::Device> device, +void DevToolsDeviceDiscovery::DiscoveryRequest::ParseBrowserInfo( scoped_refptr<RemoteBrowser> browser, - int result, - const std::string& response) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - - std::string url = kPageListRequest; - if (base::FeatureList::IsEnabled(::features::kDevToolsTabTarget)) { - url += "?for_tab"; - } - device->SendJsonRequest( - browser->socket(), url, - base::BindOnce(&DiscoveryRequest::ReceivedPages, this, device, browser)); - - if (result < 0) { - return; - } + const std::string& version_response, + bool& is_node) { // Parse version, append to package name if available, absl::optional<base::Value::Dict> value_dict = - base::JSONReader::ReadDict(response); + base::JSONReader::ReadDict(version_response); if (!value_dict) { return; } @@ -486,6 +475,7 @@ *browser_name, "/", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); if (parts.size() == 2) { browser->version_ = parts[1]; + is_node = parts[0] == "node.js"; } else { browser->version_ = *browser_name; } @@ -501,6 +491,27 @@ } } +void DevToolsDeviceDiscovery::DiscoveryRequest::ReceivedVersion( + scoped_refptr<AndroidDeviceManager::Device> device, + scoped_refptr<RemoteBrowser> browser, + int result, + const std::string& response) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + std::string url = kPageListRequest; + bool is_node = false; + if (result >= 0) { + ParseBrowserInfo(browser, response, is_node); + } + if (base::FeatureList::IsEnabled(::features::kDevToolsTabTarget) && + !is_node) { + url += "?for_tab"; + } + device->SendJsonRequest( + browser->socket(), url, + base::BindOnce(&DiscoveryRequest::ReceivedPages, this, device, browser)); +} + void DevToolsDeviceDiscovery::DiscoveryRequest::ReceivedPages( scoped_refptr<AndroidDeviceManager::Device> device, scoped_refptr<RemoteBrowser> browser,
diff --git a/chrome/browser/devtools/protocol/devtools_autofill_browsertest.cc b/chrome/browser/devtools/protocol/devtools_autofill_browsertest.cc index b47bbde8..ad8f0878 100644 --- a/chrome/browser/devtools/protocol/devtools_autofill_browsertest.cc +++ b/chrome/browser/devtools/protocol/devtools_autofill_browsertest.cc
@@ -332,9 +332,7 @@ EXPECT_EQ(GetFilledOutForm(unique_context_id), GetTestCreditCard()); } -// Disabled due to nullptr deref; see https://crbug.com/1477600. -IN_PROC_BROWSER_TEST_F(DevToolsAutofillTest, - DISABLED_TriggerCreditCardInOOPIFIframe) { +IN_PROC_BROWSER_TEST_F(DevToolsAutofillTest, TriggerCreditCardInOOPIFIframe) { embedded_test_server()->ServeFilesFromSourceDirectory( "chrome/test/data/autofill"); ASSERT_TRUE(embedded_test_server()->Start()); @@ -347,36 +345,43 @@ EXPECT_TRUE(main_autofill_manager().WaitForFormsSeen(1)); - const base::Value::Dict* result = SendCommandSync("Target.getTargets"); + { + base::Value::Dict params; + params.Set("discover", true); + SendCommandSync("Target.setDiscoverTargets", std::move(params)); + ASSERT_TRUE(result()); + } - base::Value::Dict iframe_target; - for (const auto& target : *result->FindList("targetInfos")) { - if (*target.GetDict().FindString("type") == "iframe") { - iframe_target = target.Clone().TakeDict(); + std::string frame_target_id; + while (true) { + base::Value::Dict result; + result = WaitForNotification("Target.targetCreated", true); + if (*result.FindStringByDottedPath("targetInfo.type") == "iframe") { + frame_target_id = + std::string(*result.FindStringByDottedPath("targetInfo.targetId")); break; } } - std::string target_id = CHECK_DEREF(iframe_target.FindString("targetId")); { base::Value::Dict params; - params.Set("targetId", target_id); + params.Set("targetId", frame_target_id); params.Set("flatten", true); - result = SendCommandSync("Target.attachToTarget", std::move(params)); + SendCommandSync("Target.attachToTarget", std::move(params)); + ASSERT_TRUE(result()); } - std::string session_id = CHECK_DEREF(result->FindString("sessionId")); + std::string session_id = CHECK_DEREF(result()->FindString("sessionId")); int backend_node_id = GetBackendNodeIdByIdAttribute("CREDIT_CARD_NUMBER", "", session_id); base::Value::Dict params; params.Set("fieldId", backend_node_id); - params.Set("frameId", target_id); + params.Set("frameId", frame_target_id); params.Set("card", GetTestCreditCard()); - result = SendSessionCommand("Autofill.trigger", std::move(params), session_id, - /*wait=*/true); - - EXPECT_EQ(*result, base::Value::Dict()); + SendSessionCommand("Autofill.trigger", std::move(params), session_id, + /*wait=*/true); + EXPECT_EQ(*result(), base::Value::Dict()); EXPECT_EQ(GetFilledOutForm("", session_id), GetTestCreditCard()); }
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index 8963f3d..8eec6f4 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn
@@ -888,7 +888,6 @@ "//components/page_load_metrics/browser:browser", "//components/password_manager/content/browser", "//components/password_manager/core/browser", - "//components/password_manager/core/browser:import_results", "//components/password_manager/core/browser/affiliation", "//components/password_manager/core/browser/export", "//components/password_manager/core/browser/features:password_features",
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate.h b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate.h index 5eced39..f174a05f 100644 --- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate.h +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate.h
@@ -16,8 +16,8 @@ #include "base/strings/string_piece_forward.h" #include "chrome/common/extensions/api/passwords_private.h" #include "components/password_manager/core/browser/bulk_leak_check_service.h" -#include "components/password_manager/core/browser/ui/export_progress_status.h" -#include "components/password_manager/core/browser/ui/import_results.h" +#include "components/password_manager/core/browser/export/export_progress_status.h" +#include "components/password_manager/core/browser/import/import_results.h" #include "components/password_manager/core/browser/ui/insecure_credentials_manager.h" #include "extensions/browser/extension_function.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc index 4709a8c..513a396 100644 --- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
@@ -105,19 +105,19 @@ extensions::api::passwords_private::ExportProgressStatus ConvertStatus( password_manager::ExportProgressStatus status) { switch (status) { - case password_manager::ExportProgressStatus::NOT_STARTED: + case password_manager::ExportProgressStatus::kNotStarted: return extensions::api::passwords_private::ExportProgressStatus:: EXPORT_PROGRESS_STATUS_NOT_STARTED; - case password_manager::ExportProgressStatus::IN_PROGRESS: + case password_manager::ExportProgressStatus::kInProgress: return extensions::api::passwords_private::ExportProgressStatus:: EXPORT_PROGRESS_STATUS_IN_PROGRESS; - case password_manager::ExportProgressStatus::SUCCEEDED: + case password_manager::ExportProgressStatus::kSucceeded: return extensions::api::passwords_private::ExportProgressStatus:: EXPORT_PROGRESS_STATUS_SUCCEEDED; - case password_manager::ExportProgressStatus::FAILED_CANCELLED: + case password_manager::ExportProgressStatus::kFailedCancelled: return extensions::api::passwords_private::ExportProgressStatus:: EXPORT_PROGRESS_STATUS_FAILED_CANCELLED; - case password_manager::ExportProgressStatus::FAILED_WRITE_FAILED: + case password_manager::ExportProgressStatus::kFailedWrite: return extensions::api::passwords_private::ExportProgressStatus:: EXPORT_PROGRESS_STATUS_FAILED_WRITE_FAILED; }
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.h b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.h index b794ffc..53007074 100644 --- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.h +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.h
@@ -24,13 +24,13 @@ #include "chrome/common/extensions/api/passwords_private.h" #include "components/device_reauth/device_authenticator.h" #include "components/keyed_service/core/keyed_service.h" +#include "components/password_manager/core/browser/export/export_progress_status.h" #include "components/password_manager/core/browser/export/password_manager_exporter.h" #include "components/password_manager/core/browser/password_access_authenticator.h" #include "components/password_manager/core/browser/password_account_storage_settings_watcher.h" #include "components/password_manager/core/browser/reauth_purpose.h" #include "components/password_manager/core/browser/sharing/recipients_fetcher.h" #include "components/password_manager/core/browser/ui/credential_ui_entry.h" -#include "components/password_manager/core/browser/ui/export_progress_status.h" #include "components/password_manager/core/browser/ui/saved_passwords_presenter.h" #include "extensions/browser/extension_function.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl_unittest.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl_unittest.cc index b047738..cd579627 100644 --- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl_unittest.cc +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl_unittest.cc
@@ -54,6 +54,7 @@ #include "components/password_manager/content/browser/password_manager_log_router_factory.h" #include "components/password_manager/core/browser/affiliation/fake_affiliation_service.h" #include "components/password_manager/core/browser/features/password_features.h" +#include "components/password_manager/core/browser/import/import_results.h" #include "components/password_manager/core/browser/insecure_credentials_table.h" #include "components/password_manager/core/browser/mock_password_feature_manager.h" #include "components/password_manager/core/browser/password_form.h" @@ -65,7 +66,6 @@ #include "components/password_manager/core/browser/sharing/password_sharing_recipients_downloader.h" #include "components/password_manager/core/browser/sharing/recipients_fetcher_impl.h" #include "components/password_manager/core/browser/test_password_store.h" -#include "components/password_manager/core/browser/ui/import_results.h" #include "components/password_manager/core/common/password_manager_features.h" #include "components/signin/public/base/signin_metrics.h" #include "components/signin/public/identity_manager/identity_test_environment.h" @@ -165,7 +165,7 @@ void CancelExport() override {} password_manager::ExportProgressStatus GetExportProgressStatus() override { - return password_manager::ExportProgressStatus::SUCCEEDED; + return password_manager::ExportProgressStatus::kSucceeded; } void Import(content::WebContents* web_contents,
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 2da5227..4a56fbe6 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -8531,14 +8531,6 @@ "expiry_milestone": 116 }, { - "name": "webui-tab-strip-tab-drag-integration", - "owners": [ - "yuhengh", - "tluk" - ], - "expiry_milestone": 116 - }, - { "name": "webxr-incubations", "owners": [ "//third_party/blink/renderer/modules/xr/OWNERS", "xr-dev@chromium.org" ], "expiry_milestone": 130
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 4aedd43..42b9253d 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -7527,14 +7527,6 @@ "following a press gesture."; #endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) -#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH) -const char kWebUITabStripTabDragIntegrationName[] = - "ChromeOS drag-drop extensions for WebUI tab strip"; -const char kWebUITabStripTabDragIntegrationDescription[] = - "Enables special handling in ash for WebUI tab strip tab drags. Allows " - "dragging tabs out to new windows."; -#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH) - #if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_ANDROID) const char kAutofillCreditCardUploadName[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index cf202a86..0d838e3 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -4356,11 +4356,6 @@ extern const char kWebUITabStripContextMenuAfterTapDescription[]; #endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) -#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH) -extern const char kWebUITabStripTabDragIntegrationName[]; -extern const char kWebUITabStripTabDragIntegrationDescription[]; -#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) && BUILDFLAG(IS_CHROMEOS_ASH) - #if defined(TOOLKIT_VIEWS) || BUILDFLAG(IS_ANDROID) extern const char kAutofillCreditCardUploadName[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index 129845c..f7e9682 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -344,7 +344,6 @@ &kWebApkAllowIconUpdate, &kWebApkBackupAndRestoreBackend, &kWebApkInstallService, - &kWebApkTrampolineOnInitialIntent, &features::kDnsOverHttps, ¬ifications::features::kUseChimeAndroidSdk, &paint_preview::kPaintPreviewDemo, @@ -393,6 +392,7 @@ &send_tab_to_self::kSendTabToSelfSigninPromo, &send_tab_to_self::kSendTabToSelfV2, &share::kScreenshotsForAndroidV2, + &supervised_user::kEnableProtoApiForClassifyUrl, &switches::kForceStartupSigninPromo, &switches::kIdentityStatusConsistency, &switches::kForceDisableExtendedSyncPromos, @@ -1177,9 +1177,5 @@ "WebApkInstallService", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kWebApkTrampolineOnInitialIntent, - "WebApkTrampolineOnInitialIntent", - base::FEATURE_ENABLED_BY_DEFAULT); - } // namespace android } // namespace chrome
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h index 4ca38c7..a9e7e25 100644 --- a/chrome/browser/flags/android/chrome_feature_list.h +++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -212,7 +212,6 @@ BASE_DECLARE_FEATURE(kWebApkAllowIconUpdate); BASE_DECLARE_FEATURE(kWebApkBackupAndRestoreBackend); BASE_DECLARE_FEATURE(kWebApkInstallService); -BASE_DECLARE_FEATURE(kWebApkTrampolineOnInitialIntent); } // namespace android } // namespace chrome
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java index 484e864..b976e35 100644 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -254,6 +254,7 @@ "UseDownloadOfflineContentProvider"; public static final String DRAG_DROP_INTO_OMNIBOX = "DragDropIntoOmnibox"; public static final String DRAW_EDGE_TO_EDGE = "DrawEdgeToEdge"; + public static final String ENABLE_PROTO_API_FOR_CLASSIFY_URL = "EnableProtoApiForClassifyUrl"; public static final String EXPERIMENTS_FOR_AGSA = "ExperimentsForAgsa"; public static final String EMPTY_STATES = "EmptyStates"; public static final String FEATURE_NOTIFICATION_GUIDE = "FeatureNotificationGuide"; @@ -475,8 +476,6 @@ public static final String WEBNOTES_STYLIZE = "WebNotesStylize"; public static final String WEB_APK_ALLOW_ICON_UPDATA = "WebApkAllowIconUpdate"; public static final String WEB_APK_INSTALL_SERVICE = "WebApkInstallService"; - public static final String WEB_APK_TRAMPOLINE_ON_INITIAL_INTENT = - "WebApkTrampolineOnInitialIntent"; public static final String WEB_APP_AMBIENT_BADGE_SUPRESS_FIRST_VISIT = "AmbientBadgeSuppressFirstVisit"; public static final String WEB_APK_INSTALL_FAILURE_NOTIFICATION = @@ -617,8 +616,6 @@ new CachedFlag(USE_CHIME_ANDROID_SDK, false); public static final CachedFlag sUseLibunwindstackNativeUnwinderAndroid = new CachedFlag(USE_LIBUNWINDSTACK_NATIVE_UNWINDER_ANDROID, false); - public static final CachedFlag sWebApkTrampolineOnInitialIntent = - new CachedFlag(WEB_APK_TRAMPOLINE_ON_INITIAL_INTENT, true); public static final List<CachedFlag> sFlagsCachedFullBrowser = List.of( // clang-format off @@ -690,8 +687,7 @@ sTabToGTSAnimation, sToolbarUseHardwareBitmapDraw, sUseChimeAndroidSdk, - sUseLibunwindstackNativeUnwinderAndroid, - sWebApkTrampolineOnInitialIntent + sUseLibunwindstackNativeUnwinderAndroid // clang-format on );
diff --git a/chrome/browser/lacros/cros_apps/api/diagnostics/cros_apps_diagnostics_api_browsertest.cc b/chrome/browser/lacros/cros_apps/api/diagnostics/cros_apps_diagnostics_api_browsertest.cc index 9467399..359fa43 100644 --- a/chrome/browser/lacros/cros_apps/api/diagnostics/cros_apps_diagnostics_api_browsertest.cc +++ b/chrome/browser/lacros/cros_apps/api/diagnostics/cros_apps_diagnostics_api_browsertest.cc
@@ -61,7 +61,7 @@ uint32_t max_clock_speed_khz; uint32_t scaling_current_frequency_khz; uint32_t scaling_max_frequency_khz; - } kLogicalCpuTestVals[] = { + } kTestLogicalCpus[] = { { .core_id = 42, .idle_time_ms = 9007199254740991, @@ -85,6 +85,11 @@ }, }; + const crosapi::mojom::ProbeCpuArchitectureEnum kTestCpuArchitecture = + crosapi::mojom::ProbeCpuArchitectureEnum::kX86_64; + const std::string kTestCpuArchitectureName = "x86_64"; + const std::string kTestCpuModelName = "AMD Ryzen 7 7840U"; + // Some telemetry info is not available in browser tests, so we need to // set up a fake probe service for testing. { @@ -92,58 +97,59 @@ { auto logical_cpu1 = crosapi::mojom::ProbeLogicalCpuInfo::New(); logical_cpu1->core_id = - crosapi::mojom::UInt32Value::New(kLogicalCpuTestVals[0].core_id); + crosapi::mojom::UInt32Value::New(kTestLogicalCpus[0].core_id); logical_cpu1->idle_time_ms = - crosapi::mojom::UInt64Value::New(kLogicalCpuTestVals[0].idle_time_ms); + crosapi::mojom::UInt64Value::New(kTestLogicalCpus[0].idle_time_ms); logical_cpu1->max_clock_speed_khz = crosapi::mojom::UInt32Value::New( - kLogicalCpuTestVals[0].max_clock_speed_khz); + kTestLogicalCpus[0].max_clock_speed_khz); logical_cpu1->scaling_current_frequency_khz = crosapi::mojom::UInt32Value::New( - kLogicalCpuTestVals[0].scaling_current_frequency_khz); + kTestLogicalCpus[0].scaling_current_frequency_khz); logical_cpu1->scaling_max_frequency_khz = crosapi::mojom::UInt32Value::New( - kLogicalCpuTestVals[0].scaling_max_frequency_khz); + kTestLogicalCpus[0].scaling_max_frequency_khz); auto logical_cpu2 = crosapi::mojom::ProbeLogicalCpuInfo::New(); logical_cpu2->core_id = - crosapi::mojom::UInt32Value::New(kLogicalCpuTestVals[1].core_id); + crosapi::mojom::UInt32Value::New(kTestLogicalCpus[1].core_id); logical_cpu2->idle_time_ms = - crosapi::mojom::UInt64Value::New(kLogicalCpuTestVals[1].idle_time_ms); + crosapi::mojom::UInt64Value::New(kTestLogicalCpus[1].idle_time_ms); logical_cpu2->max_clock_speed_khz = crosapi::mojom::UInt32Value::New( - kLogicalCpuTestVals[1].max_clock_speed_khz); + kTestLogicalCpus[1].max_clock_speed_khz); logical_cpu2->scaling_current_frequency_khz = crosapi::mojom::UInt32Value::New( - kLogicalCpuTestVals[1].scaling_current_frequency_khz); + kTestLogicalCpus[1].scaling_current_frequency_khz); logical_cpu2->scaling_max_frequency_khz = crosapi::mojom::UInt32Value::New( - kLogicalCpuTestVals[1].scaling_max_frequency_khz); + kTestLogicalCpus[1].scaling_max_frequency_khz); auto physical_cpu1 = crosapi::mojom::ProbePhysicalCpuInfo::New(); + physical_cpu1->model_name = kTestCpuModelName; physical_cpu1->logical_cpus.push_back(std::move(logical_cpu1)); physical_cpu1->logical_cpus.push_back(std::move(logical_cpu2)); auto logical_cpu3 = crosapi::mojom::ProbeLogicalCpuInfo::New(); logical_cpu3->core_id = - crosapi::mojom::UInt32Value::New(kLogicalCpuTestVals[2].core_id); + crosapi::mojom::UInt32Value::New(kTestLogicalCpus[2].core_id); logical_cpu3->idle_time_ms = - crosapi::mojom::UInt64Value::New(kLogicalCpuTestVals[2].idle_time_ms); + crosapi::mojom::UInt64Value::New(kTestLogicalCpus[2].idle_time_ms); logical_cpu3->max_clock_speed_khz = crosapi::mojom::UInt32Value::New( - kLogicalCpuTestVals[2].max_clock_speed_khz); + kTestLogicalCpus[2].max_clock_speed_khz); logical_cpu3->scaling_current_frequency_khz = crosapi::mojom::UInt32Value::New( - kLogicalCpuTestVals[2].scaling_current_frequency_khz); + kTestLogicalCpus[2].scaling_current_frequency_khz); logical_cpu3->scaling_max_frequency_khz = crosapi::mojom::UInt32Value::New( - kLogicalCpuTestVals[2].scaling_max_frequency_khz); + kTestLogicalCpus[2].scaling_max_frequency_khz); auto physical_cpu2 = crosapi::mojom::ProbePhysicalCpuInfo::New(); + physical_cpu2->model_name = kTestCpuModelName; physical_cpu2->logical_cpus.push_back(std::move(logical_cpu3)); auto cpu_info = crosapi::mojom::ProbeCpuInfo::New(); cpu_info->num_total_threads = crosapi::mojom::UInt32Value::New(2147483647); - cpu_info->architecture = - crosapi::mojom::ProbeCpuArchitectureEnum::kX86_64; + cpu_info->architecture = kTestCpuArchitecture; cpu_info->physical_cpus.push_back(std::move(physical_cpu1)); cpu_info->physical_cpus.push_back(std::move(physical_cpu2)); @@ -160,7 +166,7 @@ { base::Value::List logical_cpus_expected_list; - for (const auto& logical_cpu : kLogicalCpuTestVals) { + for (const auto& logical_cpu : kTestLogicalCpus) { // `base::Value::Dict().Set()` expects int type; to avoid type casting // issues, we compare properties using strings instead. logical_cpus_expected_list.Append( @@ -183,21 +189,12 @@ "(async () => { window.cpuInfoResult = await " "window.chromeos.diagnostics.getCpuInfo(); })();")); - { - // Some base::SysInfo calls are blocking. - base::ScopedAllowBlockingForTesting allow_blocking; - - EXPECT_EQ(base::SysInfo::ProcessCPUArchitecture(), - content::EvalJs(web_contents, - "window.cpuInfoResult.architectureName;")); - EXPECT_EQ( - base::SysInfo::CPUModelName(), - content::EvalJs(web_contents, "window.cpuInfoResult.modelName;")); - EXPECT_EQ( - base::SysInfo::NumberOfEfficientProcessors(), - content::EvalJs(web_contents, - "window.cpuInfoResult.numOfEfficientProcessors;")); - } + EXPECT_EQ(kTestCpuArchitectureName, + content::EvalJs(web_contents, + "window.cpuInfoResult.architectureName;")); + EXPECT_EQ(kTestCpuModelName, + content::EvalJs(web_contents, "window.cpuInfoResult.modelName;")); + ; // JavaScript function that converts all properties of an object to // string recursively.
diff --git a/chrome/browser/lacros/cros_apps/api/diagnostics/cros_diagnostics_impl.cc b/chrome/browser/lacros/cros_apps/api/diagnostics/cros_diagnostics_impl.cc index 38c5b3e..0e6b1fea 100644 --- a/chrome/browser/lacros/cros_apps/api/diagnostics/cros_diagnostics_impl.cc +++ b/chrome/browser/lacros/cros_apps/api/diagnostics/cros_diagnostics_impl.cc
@@ -7,33 +7,12 @@ #include "chrome/browser/lacros/cros_apps/api/diagnostics/cros_diagnostics_impl.h" #include "base/functional/bind.h" -#include "base/system/sys_info.h" #include "base/task/thread_pool.h" #include "chromeos/lacros/lacros_service.h" #include "content/public/browser/network_service_instance.h" #include "content/public/browser/render_frame_host.h" #include "services/network/public/mojom/network_service.mojom.h" -namespace { - -blink::mojom::CrosCpuInfoPtr GetCpuInfoPostTask() { - auto cpu_info_mojom = blink::mojom::CrosCpuInfo::New(); - - // TODO(b/298332995): Some information here, e.g. CPU model and architecture - // name, can be retrieved via Crosapi instead. We should follow up and change - // the implementation to use Crosapi. - cpu_info_mojom->architecture_name = base::SysInfo::ProcessCPUArchitecture(); - - // Calls that may be thread-blocking. - cpu_info_mojom->model_name = base::SysInfo::CPUModelName(); - cpu_info_mojom->num_of_efficient_processors = - base::SysInfo::NumberOfEfficientProcessors(); - - return cpu_info_mojom; -} - -} // namespace - CrosDiagnosticsImpl::~CrosDiagnosticsImpl() = default; // static @@ -52,15 +31,8 @@ cros_diagnostics_receiver_(this, std::move(receiver)) {} void CrosDiagnosticsImpl::GetCpuInfo(GetCpuInfoCallback callback) { - base::ThreadPool::PostTaskAndReplyWithResult( - FROM_HERE, {base::MayBlock()}, base::BindOnce(&GetCpuInfoPostTask), - base::BindOnce(&CrosDiagnosticsImpl::GetCpuInfoPostTaskCallback, - weak_ptr_factory_.GetWeakPtr(), std::move(callback))); -} + auto cpu_info_mojom = blink::mojom::CrosCpuInfo::New(); -void CrosDiagnosticsImpl::GetCpuInfoPostTaskCallback( - GetCpuInfoCallback callback, - blink::mojom::CrosCpuInfoPtr cpu_info_mojom) { chromeos::LacrosService* lacros_service = chromeos::LacrosService::Get(); if (!lacros_service->IsAvailable<crosapi::mojom::TelemetryProbeService>()) { auto error = @@ -93,11 +65,32 @@ return; } + switch (telemetry_info->cpu_result->get_cpu_info()->architecture) { + case crosapi::mojom::ProbeCpuArchitectureEnum::kUnknown: + cpu_info_mojom->architecture = + blink::mojom::CrosCpuArchitecture::kUnknown; + break; + case crosapi::mojom::ProbeCpuArchitectureEnum::kX86_64: + cpu_info_mojom->architecture = blink::mojom::CrosCpuArchitecture::kX86_64; + break; + case crosapi::mojom::ProbeCpuArchitectureEnum::kArmv7l: + cpu_info_mojom->architecture = blink::mojom::CrosCpuArchitecture::kArm; + break; + case crosapi::mojom::ProbeCpuArchitectureEnum::kAArch64: + cpu_info_mojom->architecture = blink::mojom::CrosCpuArchitecture::kArm64; + break; + } + std::vector<blink::mojom::CrosLogicalCpuInfoPtr> logical_cpu_infos_mojom; // Concatenate logical processor infos from each physical CPU. for (const auto& physical_cpu : telemetry_info->cpu_result->get_cpu_info()->physical_cpus) { + if (physical_cpu->model_name) { + // Assume that either only one `physical_cpu` exists, or each different + // `physical_cpu` shares the same `model_name`. + cpu_info_mojom->model_name = physical_cpu->model_name.value(); + } for (const auto& logical_cpu : physical_cpu->logical_cpus) { auto logical_cpu_info_mojom = blink::mojom::CrosLogicalCpuInfo::New();
diff --git a/chrome/browser/lacros/cros_apps/api/diagnostics/cros_diagnostics_impl.h b/chrome/browser/lacros/cros_apps/api/diagnostics/cros_diagnostics_impl.h index b7e1b579..176903a 100644 --- a/chrome/browser/lacros/cros_apps/api/diagnostics/cros_diagnostics_impl.h +++ b/chrome/browser/lacros/cros_apps/api/diagnostics/cros_diagnostics_impl.h
@@ -38,9 +38,6 @@ content::RenderFrameHost* render_frame_host, mojo::PendingReceiver<blink::mojom::CrosDiagnostics> receiver); - void GetCpuInfoPostTaskCallback(GetCpuInfoCallback callback, - blink::mojom::CrosCpuInfoPtr cpu_info_mojom); - void GetCpuInfoProbeTelemetryInfoCallback( GetCpuInfoCallback callback, blink::mojom::CrosCpuInfoPtr cpu_info_mojom,
diff --git a/chrome/browser/lacros/input_method_lacros_browsertest.cc b/chrome/browser/lacros/input_method_lacros_browsertest.cc index 38f52f7e..163cb5b 100644 --- a/chrome/browser/lacros/input_method_lacros_browsertest.cc +++ b/chrome/browser/lacros/input_method_lacros_browsertest.cc
@@ -953,17 +953,17 @@ EXPECT_THAT(event_listener.WaitForMessage(), IsCompositionStartEvent()); EXPECT_THAT(event_listener.WaitForMessage(), + IsCompositionUpdateEvent("hello")); + EXPECT_THAT(event_listener.WaitForMessage(), IsBeforeInputEvent("insertCompositionText", "hello", CompositionState::kComposing)); EXPECT_THAT(event_listener.WaitForMessage(), - IsCompositionUpdateEvent("hello")); - EXPECT_THAT(event_listener.WaitForMessage(), IsInputEvent("insertCompositionText", "hello", CompositionState::kComposing)); + EXPECT_THAT(event_listener.WaitForMessage(), IsCompositionUpdateEvent("")); EXPECT_THAT(event_listener.WaitForMessage(), IsBeforeInputEvent("insertCompositionText", "", CompositionState::kComposing)); - EXPECT_THAT(event_listener.WaitForMessage(), IsCompositionUpdateEvent("")); EXPECT_THAT(event_listener.WaitForMessage(), IsInputEvent("insertCompositionText", absl::nullopt, CompositionState::kComposing)); @@ -1259,10 +1259,10 @@ EXPECT_THAT(event_listener.WaitForMessage(), IsKeyDownEvent("Process", "KeyG", 229)); EXPECT_THAT(event_listener.WaitForMessage(), IsCompositionStartEvent()); + EXPECT_THAT(event_listener.WaitForMessage(), IsCompositionUpdateEvent("ㅎ")); EXPECT_THAT(event_listener.WaitForMessage(), IsBeforeInputEvent("insertCompositionText", "ㅎ", CompositionState::kComposing)); - EXPECT_THAT(event_listener.WaitForMessage(), IsCompositionUpdateEvent("ㅎ")); EXPECT_THAT(event_listener.WaitForMessage(), IsInputEvent("insertCompositionText", "ㅎ", CompositionState::kComposing));
diff --git a/chrome/browser/page_load_metrics/observers/lcp_critical_path_predictor_page_load_metrics_observer.h b/chrome/browser/page_load_metrics/observers/lcp_critical_path_predictor_page_load_metrics_observer.h index 84355f2..0fc891b 100644 --- a/chrome/browser/page_load_metrics/observers/lcp_critical_path_predictor_page_load_metrics_observer.h +++ b/chrome/browser/page_load_metrics/observers/lcp_critical_path_predictor_page_load_metrics_observer.h
@@ -17,7 +17,8 @@ } // namespace internal // PageLoadMetricsObserver responsible for: -// - Staging LCP element locator information until LCP is finalized, and +// - Staging LCP element locator, LCP influencer scripts, used fonts and other +// information until LCP is finalized, and // - Reporting "PageLoad.Clients.LCPP." UMAs class LcpCriticalPathPredictorPageLoadMetricsObserver : public page_load_metrics::PageLoadMetricsObserver { @@ -62,6 +63,11 @@ lcp_influencer_scripts_ = lcp_influencer_scripts; } + // Append fetched font URLs to the list to be passed to LCPP. + void AppendFetchedFontUrl(const GURL& font_url) { + font_urls_.push_back(font_url); + } + private: // PageLoadMetricsObserver implementation: ObservePolicy OnStart(content::NavigationHandle* navigation_handle, @@ -94,6 +100,8 @@ std::string lcp_element_locator_; // async script urls of the latest LCP candidate element. std::vector<GURL> lcp_influencer_scripts_; + // Fetched font URLs. + std::vector<GURL> font_urls_; base::WeakPtrFactory<LcpCriticalPathPredictorPageLoadMetricsObserver> weak_factory_{this};
diff --git a/chrome/browser/password_manager/android/password_manager_settings_service_android_impl.cc b/chrome/browser/password_manager/android/password_manager_settings_service_android_impl.cc index f91cc5f..a3b7e39 100644 --- a/chrome/browser/password_manager/android/password_manager_settings_service_android_impl.cc +++ b/chrome/browser/password_manager/android/password_manager_settings_service_android_impl.cc
@@ -97,8 +97,7 @@ PasswordManagerSettingsServiceAndroidImpl(PrefService* pref_service, syncer::SyncService* sync_service) : pref_service_(pref_service), sync_service_(sync_service) { - DCHECK(pref_service_); - DCHECK(password_manager::features::UsesUnifiedPasswordManagerUi()); + CHECK(pref_service_); if (!PasswordSettingsUpdaterAndroidBridgeHelper::CanCreateAccessor()) return; bridge_helper_ = PasswordSettingsUpdaterAndroidBridgeHelper::Create(); @@ -119,7 +118,7 @@ sync_service_(sync_service), bridge_helper_(std::move(bridge_helper)), lifecycle_helper_(std::move(lifecycle_helper)) { - DCHECK(pref_service_); + CHECK(pref_service_); if (!bridge_helper_) return; Init(); @@ -160,7 +159,7 @@ const PrefService::Preference* android_pref = GetGMSPrefFromSetting(pref_service_, setting); - DCHECK(android_pref); + CHECK(android_pref); return android_pref->GetValue()->GetBool(); } @@ -192,7 +191,7 @@ } void PasswordManagerSettingsServiceAndroidImpl::Init() { - DCHECK(bridge_helper_); + CHECK(bridge_helper_); MigratePrefsIfNeeded(); bridge_helper_->SetConsumer(weak_ptr_factory_.GetWeakPtr()); @@ -247,7 +246,7 @@ void PasswordManagerSettingsServiceAndroidImpl::OnSettingValueAbsent( password_manager::PasswordManagerSetting setting) { - DCHECK(bridge_helper_); + CHECK(bridge_helper_); UpdateSettingFetchState(setting); if (IsUnenrolledFromUPM(pref_service_)) return; @@ -323,7 +322,7 @@ } void PasswordManagerSettingsServiceAndroidImpl::FetchSettings() { - DCHECK(bridge_helper_); + CHECK(bridge_helper_); for (PasswordManagerSetting setting : kAllPasswordSettings) { bridge_helper_->GetPasswordSettingValue( SyncingAccount(
diff --git a/chrome/browser/password_manager/android/password_manager_settings_service_android_impl_unittest.cc b/chrome/browser/password_manager/android/password_manager_settings_service_android_impl_unittest.cc index 3d329fa7..2b6addd 100644 --- a/chrome/browser/password_manager/android/password_manager_settings_service_android_impl_unittest.cc +++ b/chrome/browser/password_manager/android/password_manager_settings_service_android_impl_unittest.cc
@@ -8,11 +8,9 @@ #include "base/memory/weak_ptr.h" #include "base/test/metrics/histogram_tester.h" -#include "base/test/scoped_feature_list.h" #include "chrome/browser/password_manager/android/fake_password_manager_lifecycle_helper.h" #include "chrome/browser/password_manager/android/password_settings_updater_android_bridge_helper.h" #include "components/password_manager/core/browser/password_manager_setting.h" -#include "components/password_manager/core/common/password_manager_features.h" #include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h" @@ -1049,11 +1047,6 @@ TEST_F(PasswordManagerSettingsServiceAndroidImplTest, OverrideOfferToSaveForError) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitWithFeatures( - /*enabled_features=*/ - {password_manager::features::kUnifiedPasswordManagerAndroid}, - /*disabled_features=*/{}); InitializeSettingsService(/*password_sync_enabled=*/true, /*setting_sync_enabled=*/true); pref_service()->SetUserPref( @@ -1070,11 +1063,6 @@ TEST_F(PasswordManagerSettingsServiceAndroidImplTest, OverrideOfferToSaveForErrorWhenNotSyncing) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitWithFeatures( - /*enabled_features=*/ - {password_manager::features::kUnifiedPasswordManagerAndroid}, - /*disabled_features=*/{}); InitializeSettingsService(/*password_sync_enabled=*/false, /*setting_sync_enabled=*/true); pref_service()->SetUserPref( @@ -1090,11 +1078,6 @@ TEST_F(PasswordManagerSettingsServiceAndroidImplTest, OverrideOfferToSaveForErrorWhenManaged) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitWithFeatures( - /*enabled_features=*/ - {password_manager::features::kUnifiedPasswordManagerAndroid}, - /*disabled_features=*/{}); InitializeSettingsService(/*password_sync_enabled=*/false, /*setting_sync_enabled=*/true); pref_service()->SetUserPref( @@ -1113,11 +1096,6 @@ TEST_F(PasswordManagerSettingsServiceAndroidImplTest, IgnoreOverrideOfferToSaveForErrorWhenUnenrolled) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitWithFeatures( - /*enabled_features=*/ - {password_manager::features::kUnifiedPasswordManagerAndroid}, - /*disabled_features=*/{}); InitializeSettingsService(/*password_sync_enabled=*/false, /*setting_sync_enabled=*/true); pref_service()->SetUserPref(
diff --git a/chrome/browser/password_manager/password_manager_settings_service_factory.cc b/chrome/browser/password_manager/password_manager_settings_service_factory.cc index 85b2e2ee..14e3bb11 100644 --- a/chrome/browser/password_manager/password_manager_settings_service_factory.cc +++ b/chrome/browser/password_manager/password_manager_settings_service_factory.cc
@@ -61,15 +61,8 @@ TRACE_EVENT0("passwords", "PasswordManagerSettingsServiceCreation"); Profile* profile = Profile::FromBrowserContext(context); #if BUILDFLAG(IS_ANDROID) - if (password_manager::features::UsesUnifiedPasswordManagerUi()) { return std::make_unique<PasswordManagerSettingsServiceAndroidImpl>( profile->GetPrefs(), SyncServiceFactory::GetForProfile(profile)); - } - // Reset the migration pref in case the client is no longer in the enabled - // group. - profile->GetPrefs()->SetBoolean( - password_manager::prefs::kSettingsMigratedToUPM, false); - return std::make_unique<PasswordManagerSettingsServiceImpl>(profile->GetPrefs()); #else return std::make_unique<PasswordManagerSettingsServiceImpl>(profile->GetPrefs()); #endif
diff --git a/chrome/browser/preloading/prerender/prerender_omnibox_ui_browsertest.cc b/chrome/browser/preloading/prerender/prerender_omnibox_ui_browsertest.cc index 3be72ea8..21927ba 100644 --- a/chrome/browser/preloading/prerender/prerender_omnibox_ui_browsertest.cc +++ b/chrome/browser/preloading/prerender/prerender_omnibox_ui_browsertest.cc
@@ -649,7 +649,7 @@ scoped_feature_list_.InitWithFeaturesAndParameters( {{features::kSupportSearchSuggestionForPrerender2, { - {"implementation_type", "ignore_prefetch"}, + {"implementation_type", "use_prefetch"}, }}}, {prerender_utils::kHidePrefetchParameter, kSearchPrefetchOnlyAllowDefaultMatchPreloading}); @@ -778,59 +778,21 @@ resp->set_code(net::HTTP_OK); resp->set_content_type("text/html"); std::string content = R"( - <html><body> HI PRERENDER! - <script> - let resolveFunc; - const historyUpdated = new Promise((resolve, reject) => { - resolveFunc = resolve; - }); - function removeParam() { - const url = new URL(document.URL); - // Search parameters will contain pf=cs if the document is - // activated from a prerendered document. - if (url.searchParams.get('pf') === 'cs') { - url.searchParams.delete('pf'); - // After being activated, the page is no longer a prerendering - // page. If it defines any parameters for identifying the - // page type, it is also responsible for updating its history - // state by removing the parameters. - history.replaceState(null, "", url.toString()); - resolveFunc(true); - } else { - resolveFunc(false); - } - } - if (document.prerendering) { - document.addEventListener("prerenderingchange", () => { - removeParam(); - }); - } else { - // If this script is executed after the page was activated. - removeParam(); - } - </script> - </body></html> + <html><body> HI PRERENDER! </body></html> )"; resp->set_content(content); return resp; } - GURL GetSearchUrl(const std::string& query, - std::string search_terms, - bool is_prerender) { + GURL GetSearchUrl(const std::string& query, std::string search_terms) { // $1: the search terms that will be retrieved. - // $2: flag for prefetch/prerender request. Should be &pf=cs if the url is - // expected to be used for a prerendering navigation. Otherwise it should be - // an empty string. - // $3: origin query. This might differ than search terms. For example, an + // $2: origin query. This might differ than search terms. For example, an // origin query of "prerend" can have the search term of "prerender", // since the suggestion service suggests to retrieve the term. - std::string url_template = "/search_page.html?q=$1$2&oq=$3&"; + std::string url_template = "/search_page.html?q=$1&oq=$2&"; return search_engine_server_.GetURL( - kSearchDomain, - base::ReplaceStringPlaceholders( - url_template, {search_terms, is_prerender ? "&pf=cs" : "", query}, - nullptr)); + kSearchDomain, base::ReplaceStringPlaceholders( + url_template, {search_terms, query}, nullptr)); } AutocompleteController* GetAutocompleteController() { @@ -935,8 +897,7 @@ Observe(GetActiveWebContents()); std::string search_query = "prerender2"; - GURL expected_prerender_url = - GetSearchUrl(search_query, "prerender222", /*is_prerender=*/true); + GURL expected_prerender_url = GetSearchUrl(search_query, "prerender222"); GURL canonical_search_url; HasCanoncialPreloadingOmniboxSearchURL( @@ -957,21 +918,18 @@ absl::optional<SearchPrefetchStatus> prefetch_status = search_prefetch_service->GetSearchPrefetchStatusForTesting( canonical_search_url); - EXPECT_FALSE(prefetch_status.has_value()); - histogram_tester.ExpectTotalCount( + ASSERT_TRUE(prefetch_status.has_value()); + EXPECT_EQ(prefetch_status.value(), SearchPrefetchStatus::kComplete); + histogram_tester.ExpectUniqueSample( "Omnibox.SearchPrefetch.PrefetchEligibilityReason2.SuggestionPrefetch", - 0); + SearchPrefetchEligibilityReason::kPrefetchStarted, 1); + // The prerendering url shouldn't contain the parameter of pf=cs. content::RenderFrameHost* prerender_rfh = prerender_helper().GetPrerenderedMainFrameHost(host_id); - EXPECT_TRUE( + EXPECT_FALSE( base::Contains(prerender_rfh->GetLastCommittedURL().spec(), "pf=cs")); - histogram_tester.ExpectUniqueSample( - "Prerender.Experimental.DefaultSearchEngine." - "SearchTermExtractorCorrectness", - true, 1); - // Ensure there is a search hint. AutocompleteController* autocomplete_controller = GetAutocompleteController(); auto prerender_match = base::ranges::find_if( @@ -986,20 +944,17 @@ host_id); EXPECT_TRUE(IsPrerenderingNavigation()); - // Wait until the history is updated. - ASSERT_EQ(true, content::EvalJs(GetActiveWebContents()->GetPrimaryMainFrame(), - "historyUpdated;")); - - EXPECT_EQ(1, prerender_helper().GetRequestCount(expected_prerender_url)); + // Prerendering shouldn't send a request as it reuses the prefetched response. + EXPECT_EQ(0, prerender_helper().GetRequestCount(expected_prerender_url)); + EXPECT_EQ(expected_prerender_url, + GetActiveWebContents()->GetLastCommittedURL()); // The displayed url shouldn't contain the parameter of pf=cs. EXPECT_FALSE(base::Contains( GetActiveWebContents()->GetLastCommittedURL().spec(), "pf=cs")); - EXPECT_EQ(0, prerender_helper().GetRequestCount( - GetActiveWebContents()->GetLastCommittedURL())); { - // Check that we store one entry corresponding to the prerender prediction - // and attempt. + // Check that we store 1 entry for the prediction and 2 entries for the + // prefetch/prerender attempts. ukm::SourceId ukm_source_id = activation_observer.next_page_ukm_source_id(); auto attempt_ukm_entries = test_ukm_recorder()->GetEntries( Preloading_Attempt::kEntryName, @@ -1008,7 +963,7 @@ Preloading_Prediction::kEntryName, content::test::kPreloadingPredictionUkmMetrics); EXPECT_EQ(prediction_ukm_entries.size(), 1u); - EXPECT_EQ(attempt_ukm_entries.size(), 1u); + EXPECT_EQ(attempt_ukm_entries.size(), 2u); // Check that we log the correct metrics for successful prerender // activation. @@ -1019,6 +974,14 @@ }; std::vector<UkmEntry> expected_attempt_entries = { attempt_entry_builder().BuildEntry( + ukm_source_id, content::PreloadingType::kPrefetch, + content::PreloadingEligibility::kEligible, + content::PreloadingHoldbackStatus::kAllowed, + content::PreloadingTriggeringOutcome::kReady, + content::PreloadingFailureReason::kUnspecified, + /*accurate=*/true, + /*ready_time=*/kMockElapsedTime), + attempt_entry_builder().BuildEntry( ukm_source_id, content::PreloadingType::kPrerender, content::PreloadingEligibility::kEligible, content::PreloadingHoldbackStatus::kAllowed, @@ -1060,8 +1023,7 @@ Observe(GetActiveWebContents()); std::string search_query_1 = "prerender2"; - GURL expected_prerender_url = - GetSearchUrl(search_query_1, "prerender222", /*is_prerender=*/true); + GURL expected_prerender_url = GetSearchUrl(search_query_1, "prerender222"); // Trigger an omnibox suggest that has a prerender hint. int host_id = @@ -1081,10 +1043,18 @@ auto ukm_entries = test_ukm_recorder()->GetEntries( Preloading_Attempt::kEntryName, content::test::kPreloadingAttemptUkmMetrics); - EXPECT_EQ(ukm_entries.size(), 1u); + EXPECT_EQ(ukm_entries.size(), 2u); std::vector<UkmEntry> expected_entries = { attempt_entry_builder().BuildEntry( + ukm_source_id, content::PreloadingType::kPrefetch, + content::PreloadingEligibility::kEligible, + content::PreloadingHoldbackStatus::kAllowed, + content::PreloadingTriggeringOutcome::kReady, + content::PreloadingFailureReason::kUnspecified, + /*accurate=*/false, + /*ready_time=*/kMockElapsedTime), + attempt_entry_builder().BuildEntry( ukm_source_id, content::PreloadingType::kPrerender, content::PreloadingEligibility::kEligible, content::PreloadingHoldbackStatus::kAllowed, @@ -1116,8 +1086,7 @@ Observe(GetActiveWebContents()); std::string search_query_1 = "prerender2"; - GURL expected_prerender_url = - GetSearchUrl(search_query_1, "prerender222", /*is_prerender=*/true); + GURL expected_prerender_url = GetSearchUrl(search_query_1, "prerender222"); // Trigger an omnibox suggest that has a prerender hint. int host_id = @@ -1145,18 +1114,25 @@ base::RunLoop().RunUntilIdle(); { - // Check that we store two entries corresponding to both the prererendering - // attempts. + // Check that we store 4 entries for prefetch/prererender attempts. ukm::SourceId ukm_source_id = activation_observer.next_page_ukm_source_id(); auto ukm_entries = test_ukm_recorder()->GetEntries( Preloading_Attempt::kEntryName, content::test::kPreloadingAttemptUkmMetrics); - EXPECT_EQ(ukm_entries.size(), 2u); + EXPECT_EQ(ukm_entries.size(), 4u); // Check that we log the correct metrics for successful prerender // activation and for duplicate attempt to the same prerender URL. std::vector<UkmEntry> expected_entries = { attempt_entry_builder().BuildEntry( + ukm_source_id, content::PreloadingType::kPrefetch, + content::PreloadingEligibility::kEligible, + content::PreloadingHoldbackStatus::kAllowed, + content::PreloadingTriggeringOutcome::kReady, + content::PreloadingFailureReason::kUnspecified, + /*accurate=*/true, + /*ready_time=*/kMockElapsedTime), + attempt_entry_builder().BuildEntry( ukm_source_id, content::PreloadingType::kPrerender, content::PreloadingEligibility::kEligible, content::PreloadingHoldbackStatus::kAllowed, @@ -1165,6 +1141,13 @@ /*accurate=*/true, /*ready_time=*/kMockElapsedTime), attempt_entry_builder().BuildEntry( + ukm_source_id, content::PreloadingType::kPrefetch, + content::PreloadingEligibility::kEligible, + content::PreloadingHoldbackStatus::kAllowed, + content::PreloadingTriggeringOutcome::kDuplicate, + content::PreloadingFailureReason::kUnspecified, + /*accurate=*/true), + attempt_entry_builder().BuildEntry( ukm_source_id, content::PreloadingType::kPrerender, content::PreloadingEligibility::kEligible, content::PreloadingHoldbackStatus::kAllowed, @@ -1178,10 +1161,6 @@ expected_entries); } - // Wait until the history is updated. - EXPECT_EQ(true, content::EvalJs(GetActiveWebContents()->GetPrimaryMainFrame(), - "historyUpdated;")); - // The displayed url shouldn't contain the parameter of pf=cs. EXPECT_FALSE(base::Contains( GetActiveWebContents()->GetLastCommittedURL().spec(), "pf=cs")); @@ -1205,8 +1184,7 @@ AddNewSuggestionRule("prerender22", {"prerender222", "prerender223"}); std::string search_query_1 = "prerender22"; - GURL prerender_url = - GetSearchUrl(search_query_1, "prerender222", /*is_prerender=*/true); + GURL prerender_url = GetSearchUrl(search_query_1, "prerender222"); int host_id = InputSearchQueryAndWaitForTrigger(search_query_1, prerender_url); ASSERT_NE(host_id, content::RenderFrameHost::kNoFrameTreeNodeId); @@ -1214,8 +1192,7 @@ // Start the second prerendering with the different suggestion. AddNewSuggestionRule("prerender33", {"prerender333", "prerender334"}); std::string search_query_2 = "prerender33"; - GURL prerender_url2 = - GetSearchUrl(search_query_2, "prerender333", /*is_prerender=*/true); + GURL prerender_url2 = GetSearchUrl(search_query_2, "prerender333"); int host_id2 = InputSearchQueryAndWaitForTrigger(search_query_2, prerender_url2); ASSERT_NE(host_id, host_id2); @@ -1237,18 +1214,25 @@ EXPECT_TRUE(IsPrerenderingNavigation()); { - // Check that we store two entries corresponding to both the prererendering - // attempts. + // Check that we store 4 entries for prefetch/prerender attempts. ukm::SourceId ukm_source_id = activation_observer.next_page_ukm_source_id(); auto ukm_entries = test_ukm_recorder()->GetEntries( Preloading_Attempt::kEntryName, content::test::kPreloadingAttemptUkmMetrics); - EXPECT_EQ(ukm_entries.size(), 2u); + EXPECT_EQ(ukm_entries.size(), 4u); // Check that we log the correct metrics for successful prerender // activation with suggestions to the different prerender URLs. std::vector<UkmEntry> expected_entries = { attempt_entry_builder().BuildEntry( + ukm_source_id, content::PreloadingType::kPrefetch, + content::PreloadingEligibility::kEligible, + content::PreloadingHoldbackStatus::kAllowed, + content::PreloadingTriggeringOutcome::kReady, + content::PreloadingFailureReason::kUnspecified, + /*accurate=*/false, + /*ready_time=*/kMockElapsedTime), + attempt_entry_builder().BuildEntry( ukm_source_id, content::PreloadingType::kPrerender, content::PreloadingEligibility::kEligible, content::PreloadingHoldbackStatus::kAllowed, @@ -1256,6 +1240,14 @@ ToPreloadingFailureReason(PrerenderPredictionStatus::kCancelled), /*accurate=*/false), attempt_entry_builder().BuildEntry( + ukm_source_id, content::PreloadingType::kPrefetch, + content::PreloadingEligibility::kEligible, + content::PreloadingHoldbackStatus::kAllowed, + content::PreloadingTriggeringOutcome::kReady, + content::PreloadingFailureReason::kUnspecified, + /*accurate=*/true, + /*ready_time=*/kMockElapsedTime), + attempt_entry_builder().BuildEntry( ukm_source_id, content::PreloadingType::kPrerender, content::PreloadingEligibility::kEligible, content::PreloadingHoldbackStatus::kAllowed, @@ -1270,10 +1262,6 @@ expected_entries); } - // Wait until the history is updated. - EXPECT_EQ(true, content::EvalJs(GetActiveWebContents()->GetPrimaryMainFrame(), - "historyUpdated;")); - // The displayed url shouldn't contain the parameter of pf=cs. EXPECT_FALSE(base::Contains( GetActiveWebContents()->GetLastCommittedURL().spec(), "pf=cs")); @@ -1286,24 +1274,6 @@ PrerenderPredictionStatus::kHitFinished, 1); } -// Tests whether prerendering a search suggestion will have pf=cs parameter -// attached correctly. -IN_PROC_BROWSER_TEST_F(PrerenderOmniboxSearchSuggestionUIBrowserTest, - SearchPrerenderParameterVerification) { - const GURL kInitialUrl = embedded_test_server()->GetURL("/empty.html"); - ASSERT_TRUE(GetActiveWebContents()); - ASSERT_TRUE(content::NavigateToURL(GetActiveWebContents(), kInitialUrl)); - Observe(GetActiveWebContents()); - std::string search_query = "prerender2"; - - GURL expected_prerender_url = - GetSearchUrl(search_query, "prerender222", /*is_prerender=*/true); - ASSERT_TRUE(base::Contains(expected_prerender_url.spec(), "pf=cs")); - int host_id = - InputSearchQueryAndWaitForTrigger(search_query, expected_prerender_url); - EXPECT_NE(host_id, content::RenderFrameHost::kNoFrameTreeNodeId); -} - class PrerenderOmniboxReferrerChainUIBrowserTest : public PrerenderOmniboxUIBrowserTest { public:
diff --git a/chrome/browser/resources/ash/settings/os_apps_page/app_management_page/app_details_item.html b/chrome/browser/resources/ash/settings/os_apps_page/app_management_page/app_details_item.html index f885e287..3cee15f 100644 --- a/chrome/browser/resources/ash/settings/os_apps_page/app_management_page/app_details_item.html +++ b/chrome/browser/resources/ash/settings/os_apps_page/app_management_page/app_details_item.html
@@ -60,7 +60,7 @@ </div> </template> </div> -<template is="dom-if" if="[[shouldShowFullSizeDetails_(app)]]" restamp> +<template is="dom-if" if="[[shouldShowStorage_(app)]]" restamp> <div class="indented-app-details" id="storageTitle"> $i18n{appManagementAppDetailsStorageTitle} <template is="dom-if" if="[[shouldShowAppSize_(app)]]" restamp> @@ -75,11 +75,6 @@ </template> </div> </template> -<template is="dom-if" if="[[shouldShowShortSizeDetails_(app)]]" restamp> - <div class="indented-app-details" id="shortSize"> - [[i18n('appManagementAppDetailsTotalSize', app.appSize)]] - </div> -</template> <template is="dom-if" if="[[shouldShowVersion_(app)]]" restamp> <div class="indented-app-details" id="version"> [[i18n('appManagementAppDetailsVersion', app.version)]]
diff --git a/chrome/browser/resources/ash/settings/os_apps_page/app_management_page/app_details_item.ts b/chrome/browser/resources/ash/settings/os_apps_page/app_management_page/app_details_item.ts index 6e58e94..f19490e4 100644 --- a/chrome/browser/resources/ash/settings/os_apps_page/app_management_page/app_details_item.ts +++ b/chrome/browser/resources/ash/settings/os_apps_page/app_management_page/app_details_item.ts
@@ -90,20 +90,12 @@ } private shouldShowAppSize_(app: App): boolean { - return this.shouldShowStorage_(app) && Boolean(app.appSize); + return Boolean(app.appSize); } private shouldShowDataSize_(app: App): boolean { return Boolean(app.dataSize); } - - private shouldShowFullSizeDetails_(app: App): boolean { - return this.shouldShowAppSize_(app) && this.shouldShowDataSize_(app); - } - - private shouldShowShortSizeDetails_(app: App): boolean { - return this.shouldShowAppSize_(app) && !this.shouldShowDataSize_(app); - } /** * The info icon is only shown for System apps and apps installed from the * Chrome browser.
diff --git a/chrome/browser/resources/hats/BUILD.gn b/chrome/browser/resources/hats/BUILD.gn index 5bd97fc..7309121 100644 --- a/chrome/browser/resources/hats/BUILD.gn +++ b/chrome/browser/resources/hats/BUILD.gn
@@ -11,7 +11,18 @@ static_files = [ "hats.html" ] - non_web_component_files = [ "hats.ts" ] + non_web_component_files = [ + "hats.ts", + "browser_proxy.ts", + ] - ts_deps = [ "//ui/webui/resources/js:build_ts" ] + mojo_files_deps = + [ "//chrome/browser/ui/webui/hats:mojo_bindings_ts__generator" ] + mojo_files = + [ "$root_gen_dir/chrome/browser/ui/webui/hats/hats.mojom-webui.ts" ] + + ts_deps = [ + "//ui/webui/resources/js:build_ts", + "//ui/webui/resources/mojo:build_ts", + ] }
diff --git a/chrome/browser/resources/hats/browser_proxy.ts b/chrome/browser/resources/hats/browser_proxy.ts new file mode 100644 index 0000000..2a61a22 --- /dev/null +++ b/chrome/browser/resources/hats/browser_proxy.ts
@@ -0,0 +1,33 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {PageCallbackRouter, PageHandlerFactory, PageHandlerInterface, PageHandlerRemote} from './hats.mojom-webui.js'; + +class BrowserProxy { + callbackRouter: PageCallbackRouter; + handler: PageHandlerInterface; + + constructor() { + this.callbackRouter = new PageCallbackRouter(); + + this.handler = new PageHandlerRemote(); + + const factory = PageHandlerFactory.getRemote(); + factory.createPageHandler( + this.callbackRouter.$.bindNewPipeAndPassRemote(), + (this.handler as PageHandlerRemote).$.bindNewPipeAndPassReceiver()); + } + + static getInstance(): BrowserProxy { + return instance || (instance = new BrowserProxy()); + } + + static setInstance(obj: BrowserProxy) { + instance = obj; + } +} + +let instance: BrowserProxy|null = null; + +export {BrowserProxy};
diff --git a/chrome/browser/resources/hats/hats.ts b/chrome/browser/resources/hats/hats.ts index 3434b0b..915c5b8 100644 --- a/chrome/browser/resources/hats/hats.ts +++ b/chrome/browser/resources/hats/hats.ts
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import {BrowserProxy} from './browser_proxy.js'; + // Global `window` context. declare global { interface Window { @@ -15,19 +17,22 @@ script.type = 'text/javascript'; script.src = 'https://www.gstatic.com/feedback/js/help/prod/service/lazy.min.js'; - script.onload = requestSurvey; + script.onload = async function() { + const {apiKey} = await BrowserProxy.getInstance().handler.getApiKey(); + requestSurvey(apiKey); + }; document.head.appendChild(script); } -function requestSurvey() { +function requestSurvey(apiKey: string) { // Provide a dummy window size, such that the survey renders at its desired // size. The actual dialog will be resized to the survey provided size // transparently. window.innerWidth = 800; window.innerHeight = 600; - const helpApi = window.help.service.Lazy.create( - 0, {apiKey: 'HATS_API_KEY', locale: 'en-US'}); + const helpApi = + window.help.service.Lazy.create(0, {apiKey: apiKey, locale: 'en-US'}); let loadedSent = false;
diff --git a/chrome/browser/resources/password_manager/BUILD.gn b/chrome/browser/resources/password_manager/BUILD.gn index 41463f94..d33ebd4 100644 --- a/chrome/browser/resources/password_manager/BUILD.gn +++ b/chrome/browser/resources/password_manager/BUILD.gn
@@ -71,7 +71,8 @@ "sharing/share_password_family_picker_dialog.ts", "sharing/share_password_loading_dialog.ts", "sharing/share_password_error_dialog.ts", - "sharing/share_password_no_members_dialog.ts", + "sharing/share_password_no_other_family_members_dialog.ts", + "sharing/share_password_not_family_member_dialog.ts", "sharing/share_password_confirmation_dialog.ts", "side_bar.ts", "site_favicon.ts",
diff --git a/chrome/browser/resources/password_manager/sharing/share_password_flow.html b/chrome/browser/resources/password_manager/sharing/share_password_flow.html index 6930ccc..92f2fca 100644 --- a/chrome/browser/resources/password_manager/sharing/share_password_flow.html +++ b/chrome/browser/resources/password_manager/sharing/share_password_flow.html
@@ -13,10 +13,17 @@ </template> <template is="dom-if" - if="[[isState_(flowStateEnum_.NO_MEMBERS, flowState)]]" restamp> - <share-password-no-members-dialog on-close="onDialogClose_" + if="[[isState_(flowStateEnum_.NO_OTHER_MEMBERS, flowState)]]" restamp> + <share-password-no-other-family-members-dialog on-close="onDialogClose_" dialog-title="[[getShareDialogTitle_(passwordName)]]"> - </share-password-no-members-dialog> + </share-password-no-other-family-members-dialog> +</template> + +<template is="dom-if" + if="[[isState_(flowStateEnum_.NOT_FAMILY_MEMBER, flowState)]]" restamp> + <share-password-not-family-member-dialog on-close="onDialogClose_" + dialog-title="[[getShareDialogTitle_(passwordName)]]"> + </share-password-not-family-member-dialog> </template> <template is="dom-if"
diff --git a/chrome/browser/resources/password_manager/sharing/share_password_flow.ts b/chrome/browser/resources/password_manager/sharing/share_password_flow.ts index 9192b4c6..5455fee0 100644 --- a/chrome/browser/resources/password_manager/sharing/share_password_flow.ts +++ b/chrome/browser/resources/password_manager/sharing/share_password_flow.ts
@@ -9,7 +9,8 @@ import './share_password_family_picker_dialog.js'; import './share_password_loading_dialog.js'; import './share_password_error_dialog.js'; -import './share_password_no_members_dialog.js'; +import './share_password_no_other_family_members_dialog.js'; +import './share_password_not_family_member_dialog.js'; import './share_password_confirmation_dialog.js'; import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js'; @@ -24,7 +25,8 @@ NO_DIALOG, FETCHING, ERROR, - NO_MEMBERS, + NO_OTHER_MEMBERS, + NOT_FAMILY_MEMBER, FAMILY_PICKER, CONFIRMATION, } @@ -88,9 +90,15 @@ this.flowState = ShareFlowState.ERROR; break; case chrome.passwordsPrivate.FamilyFetchStatus.NO_MEMBERS: - this.flowState = ShareFlowState.NO_MEMBERS; + // TODO(crbug/1445526): Rename FamilyFetchStatus.NO_MEMBERS to + // NOT_FAMILY_MEMBER. + this.flowState = ShareFlowState.NOT_FAMILY_MEMBER; break; case chrome.passwordsPrivate.FamilyFetchStatus.SUCCESS: + if (this.fetchResults_.familyMembers.length === 0) { + this.flowState = ShareFlowState.NO_OTHER_MEMBERS; + return; + } this.flowState = ShareFlowState.FAMILY_PICKER; break; default:
diff --git a/chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.html b/chrome/browser/resources/password_manager/sharing/share_password_no_other_family_members_dialog.html similarity index 90% rename from chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.html rename to chrome/browser/resources/password_manager/sharing/share_password_no_other_family_members_dialog.html index 76dfc32..43bdc8b 100644 --- a/chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.html +++ b/chrome/browser/resources/password_manager/sharing/share_password_no_other_family_members_dialog.html
@@ -22,7 +22,7 @@ role="presentation"> </picture> <div id="description" - inner-h-t-m-l="[[i18nAdvanced('sharePasswordNoMembersDescription')]]"> + inner-h-t-m-l="[[i18nAdvanced('sharePasswordNoOtherFamilyMembers')]]"> </div> </div> <div slot="button-container">
diff --git a/chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.ts b/chrome/browser/resources/password_manager/sharing/share_password_no_other_family_members_dialog.ts similarity index 63% copy from chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.ts copy to chrome/browser/resources/password_manager/sharing/share_password_no_other_family_members_dialog.ts index b617f558..d479c42 100644 --- a/chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.ts +++ b/chrome/browser/resources/password_manager/sharing/share_password_no_other_family_members_dialog.ts
@@ -9,9 +9,9 @@ import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {getTemplate} from './share_password_no_members_dialog.html.js'; +import {getTemplate} from './share_password_no_other_family_members_dialog.html.js'; -export interface SharePasswordNoMembersDialogElement { +export interface SharePasswordNoOtherFamilyMembersDialogElement { $: { description: HTMLElement, action: HTMLElement, @@ -19,10 +19,10 @@ }; } -export class SharePasswordNoMembersDialogElement extends I18nMixin +export class SharePasswordNoOtherFamilyMembersDialogElement extends I18nMixin (PolymerElement) { static get is() { - return 'share-password-no-members-dialog'; + return 'share-password-no-other-family-members-dialog'; } static get template() { @@ -30,7 +30,9 @@ } static get properties() { - return {dialogTitle: {type: String}}; + return { + dialogTitle: String, + }; } dialogTitle: string; @@ -43,10 +45,11 @@ declare global { interface HTMLElementTagNameMap { - 'share-password-no-members-dialog': SharePasswordNoMembersDialogElement; + 'share-password-no-other-family-members-dialog': + SharePasswordNoOtherFamilyMembersDialogElement; } } customElements.define( - SharePasswordNoMembersDialogElement.is, - SharePasswordNoMembersDialogElement); + SharePasswordNoOtherFamilyMembersDialogElement.is, + SharePasswordNoOtherFamilyMembersDialogElement);
diff --git a/chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.html b/chrome/browser/resources/password_manager/sharing/share_password_not_family_member_dialog.html similarity index 90% copy from chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.html copy to chrome/browser/resources/password_manager/sharing/share_password_not_family_member_dialog.html index 76dfc32..dfed902 100644 --- a/chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.html +++ b/chrome/browser/resources/password_manager/sharing/share_password_not_family_member_dialog.html
@@ -22,7 +22,7 @@ role="presentation"> </picture> <div id="description" - inner-h-t-m-l="[[i18nAdvanced('sharePasswordNoMembersDescription')]]"> + inner-h-t-m-l="[[i18nAdvanced('sharePasswordNotFamilyMember')]]"> </div> </div> <div slot="button-container">
diff --git a/chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.ts b/chrome/browser/resources/password_manager/sharing/share_password_not_family_member_dialog.ts similarity index 65% rename from chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.ts rename to chrome/browser/resources/password_manager/sharing/share_password_not_family_member_dialog.ts index b617f558..1409b02 100644 --- a/chrome/browser/resources/password_manager/sharing/share_password_no_members_dialog.ts +++ b/chrome/browser/resources/password_manager/sharing/share_password_not_family_member_dialog.ts
@@ -9,9 +9,9 @@ import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {getTemplate} from './share_password_no_members_dialog.html.js'; +import {getTemplate} from './share_password_not_family_member_dialog.html.js'; -export interface SharePasswordNoMembersDialogElement { +export interface SharePasswordNotFamilyMemberDialogElement { $: { description: HTMLElement, action: HTMLElement, @@ -19,10 +19,10 @@ }; } -export class SharePasswordNoMembersDialogElement extends I18nMixin +export class SharePasswordNotFamilyMemberDialogElement extends I18nMixin (PolymerElement) { static get is() { - return 'share-password-no-members-dialog'; + return 'share-password-not-family-member-dialog'; } static get template() { @@ -30,7 +30,9 @@ } static get properties() { - return {dialogTitle: {type: String}}; + return { + dialogTitle: String, + }; } dialogTitle: string; @@ -43,10 +45,11 @@ declare global { interface HTMLElementTagNameMap { - 'share-password-no-members-dialog': SharePasswordNoMembersDialogElement; + 'share-password-not-family-member-dialog': + SharePasswordNotFamilyMemberDialogElement; } } customElements.define( - SharePasswordNoMembersDialogElement.is, - SharePasswordNoMembersDialogElement); + SharePasswordNotFamilyMemberDialogElement.is, + SharePasswordNotFamilyMemberDialogElement);
diff --git a/chrome/browser/supervised_user/BUILD.gn b/chrome/browser/supervised_user/BUILD.gn index 8d36e27..b732e7f 100644 --- a/chrome/browser/supervised_user/BUILD.gn +++ b/chrome/browser/supervised_user/BUILD.gn
@@ -21,7 +21,11 @@ ] if (is_android) { sources += [ "android/supervised_user_settings_service_bridge.cc" ] - deps += [ ":test_support_jni_headers" ] + deps += [ + ":test_support_jni_headers", + "//components/signin/public/identity_manager:test_support", + "//services/network:test_support", + ] } }
diff --git a/chrome/browser/supervised_user/android/java/src/org/chromium/chrome/browser/supervised_user/SupervisedUserSettingsBridge.java b/chrome/browser/supervised_user/android/java/src/org/chromium/chrome/browser/supervised_user/SupervisedUserSettingsBridge.java index 2bfc5f7..a5a695d 100644 --- a/chrome/browser/supervised_user/android/java/src/org/chromium/chrome/browser/supervised_user/SupervisedUserSettingsBridge.java +++ b/chrome/browser/supervised_user/android/java/src/org/chromium/chrome/browser/supervised_user/SupervisedUserSettingsBridge.java
@@ -24,9 +24,31 @@ SupervisedUserSettingsBridgeJni.get().setManualFilterForHost(profile, host, allowlist); } + /** Sets response to the kids management API */ + static void setSafeSearchResponseForTesting(Profile profile, boolean isAllowed) { + SupervisedUserSettingsBridgeJni.get().setSafeSearchResponseForTesting(profile, isAllowed); + } + + /** + * Sets up the TestUrlLoaderFactoryHelper, to be used in tests + */ + static void setUpTestUrlLoaderFactoryHelper() { + SupervisedUserSettingsBridgeJni.get().setUpTestUrlLoaderFactoryHelper(); + } + + /** + * Tears down up the TestUrlLoaderFactoryHelper, to be used in tests + */ + static void tearDownTestUrlLoaderFactoryHelper() { + SupervisedUserSettingsBridgeJni.get().tearDownTestUrlLoaderFactoryHelper(); + } + @NativeMethods interface Natives { void setFilteringBehavior(Profile profile, int setting); void setManualFilterForHost(Profile profile, String host, boolean allowlist); + void setSafeSearchResponseForTesting(Profile profile, boolean siteIsAllowed); // IN-TEST + void setUpTestUrlLoaderFactoryHelper(); + void tearDownTestUrlLoaderFactoryHelper(); } }
diff --git a/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/SupervisedUserCriticalJourneysIntegrationTest.java b/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/SupervisedUserCriticalJourneysIntegrationTest.java index be449ae..fda6ab0f 100644 --- a/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/SupervisedUserCriticalJourneysIntegrationTest.java +++ b/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/SupervisedUserCriticalJourneysIntegrationTest.java
@@ -25,12 +25,14 @@ import org.chromium.base.test.util.CommandLineFlags; import org.chromium.chrome.R; +import org.chromium.chrome.browser.flags.ChromeFeatureList; 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.browser.ui.appmenu.AppMenuTestSupport; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.signin.SigninTestRule; import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -43,6 +45,7 @@ @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) public class SupervisedUserCriticalJourneysIntegrationTest { private static final String BLOCKED_SITE_URL = "www.example.com"; + private static final String MATURE_SITE_URL = "www.bestgore.com"; @Rule public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); @@ -97,4 +100,27 @@ onView(withText(R.string.menu_new_incognito_tab)).check(matches(not(isEnabled()))); onView(withText(R.string.menu_new_incognito_tab)).check(matches(not(isClickable()))); } + + @Test + @LargeTest + @Features.EnableFeatures({ChromeFeatureList.ENABLE_PROTO_API_FOR_CLASSIFY_URL}) + public void matureSitesAreBlockedBySafeSites() throws Exception { + SupervisedUserSettingsTestUtils.setUpTestUrlLoaderFactoryHelper(); + TestThreadUtils.runOnUiThreadBlocking(() -> { + SupervisedUserSettingsTestUtils.setSafeSearchResponseForTesting( + Profile.getLastUsedRegularProfile(), /*isAllowed=*/false); + }); + + EmbeddedTestServer testServer = mActivityTestRule.getEmbeddedTestServerRule().getServer(); + String blockedHost = testServer.getURLWithHostName(MATURE_SITE_URL, "/"); + mActivityTestRule.loadUrl(blockedHost); + + Tab tab = mActivityTestRule.getActivity().getActivityTab(); + Assert.assertTrue(tab.isShowingErrorPage()); + String title = mActivityTestRule.getActivity().getCurrentWebContents().getTitle(); + Assert.assertFalse(title.isEmpty()); + WebsiteParentApprovalTestUtils.checkLocalApprovalsButtonIsVisible(mWebContents); + WebsiteParentApprovalTestUtils.checkRemoteApprovalsButtonIsVisible(mWebContents); + SupervisedUserSettingsTestUtils.tearDownTestUrlLoaderFactoryHelper(); + } }
diff --git a/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/SupervisedUserSettingsTestUtils.java b/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/SupervisedUserSettingsTestUtils.java index 6ca4f5a..df5c44c 100644 --- a/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/SupervisedUserSettingsTestUtils.java +++ b/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/SupervisedUserSettingsTestUtils.java
@@ -12,4 +12,22 @@ static void addUrlToBlocklist(Profile profile, String url) { SupervisedUserSettingsBridge.setManualFilterForHost(profile, url, false); } + /** Sets the kids management API response so that it blocks/allows the site */ + public static void setSafeSearchResponseForTesting(Profile profile, boolean isAllowed) { + SupervisedUserSettingsBridge.setSafeSearchResponseForTesting(profile, isAllowed); + } + + /** + * This method sets up the TestUrlLoaderFactoryHelper which is used to keep the instance of + * TestUrlLoaderFactory within scope throughout the test + */ + public static void setUpTestUrlLoaderFactoryHelper() { + SupervisedUserSettingsBridge.setUpTestUrlLoaderFactoryHelper(); + } + /** + * This method is used to tear down the TestUrlLoaderFactoryHelper + */ + public static void tearDownTestUrlLoaderFactoryHelper() { + SupervisedUserSettingsBridge.tearDownTestUrlLoaderFactoryHelper(); + } }
diff --git a/chrome/browser/supervised_user/android/supervised_user_settings_service_bridge.cc b/chrome/browser/supervised_user/android/supervised_user_settings_service_bridge.cc index 248a8d9fe..acfe2b8 100644 --- a/chrome/browser/supervised_user/android/supervised_user_settings_service_bridge.cc +++ b/chrome/browser/supervised_user/android/supervised_user_settings_service_bridge.cc
@@ -9,11 +9,22 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_android.h" #include "chrome/browser/profiles/profile_key.h" +#include "chrome/browser/signin/identity_manager_factory.h" +#include "chrome/browser/supervised_user/supervised_user_service_factory.h" #include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h" #include "chrome/browser/supervised_user/supervised_user_test_util.h" #include "chrome/browser/supervised_user/test_support_jni_headers/SupervisedUserSettingsBridge_jni.h" +#include "components/signin/public/identity_manager/identity_manager.h" +#include "components/signin/public/identity_manager/identity_test_environment.h" +#include "components/signin/public/identity_manager/identity_test_utils.h" +#include "components/supervised_user/core/browser/kids_chrome_management_client.h" +#include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" +#include "components/supervised_user/core/browser/supervised_user_service.h" #include "components/supervised_user/core/browser/supervised_user_settings_service.h" +#include "components/supervised_user/core/browser/supervised_user_url_filter.h" #include "components/supervised_user/core/common/supervised_user_constants.h" +#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" +#include "services/network/test/test_url_loader_factory.h" using base::android::JavaParamRef; @@ -41,3 +52,75 @@ supervised_user_test_util::SetManualFilterForHost(profile, host_string, allowlist); } +class TestUrlLoaderFactoryHelper { + public: + static TestUrlLoaderFactoryHelper* SharedInstance() { + return base::Singleton<TestUrlLoaderFactoryHelper>::get(); + } + + void SetUp() { + test_url_loader_factory_ = + std::make_unique<network::TestURLLoaderFactory>(); + shared_url_loader_factory_ = + base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>( + test_url_loader_factory_.get()); + } + + void TearDown() { test_url_loader_factory_.reset(); } + + scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory() { + return std::ref(shared_url_loader_factory_); + } + network::TestURLLoaderFactory* test_url_loader_factory() { + return test_url_loader_factory_.get(); + } + + private: + std::unique_ptr<network::TestURLLoaderFactory> test_url_loader_factory_; + scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory_; +}; + +void JNI_SupervisedUserSettingsBridge_SetSafeSearchResponseForTesting( // IN-TEST + JNIEnv* env, + const JavaParamRef<jobject>& j_profile, + jboolean is_allowed) { + kids_chrome_management::ClassifyUrlResponse response; + auto url_classification = + is_allowed ? kids_chrome_management::ClassifyUrlResponse::ALLOWED + : kids_chrome_management::ClassifyUrlResponse::RESTRICTED; + + response.set_display_classification(url_classification); + std::string classify_url_service_url = + "https://kidsmanagement-pa.googleapis.com/kidsmanagement/v1/people/" + "me:classifyUrl?alt=proto"; + network::TestURLLoaderFactory* test_url_loader_factory_ = + TestUrlLoaderFactoryHelper::SharedInstance()->test_url_loader_factory(); + scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory = + TestUrlLoaderFactoryHelper::SharedInstance()->shared_url_loader_factory(); + + test_url_loader_factory_->AddResponse(classify_url_service_url, + response.SerializeAsString()); + + Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); + auto* identity_manager = IdentityManagerFactory::GetForProfile(profile); + + std::unique_ptr<KidsChromeManagementClient> + test_kids_chrome_management_client_ = + std::make_unique<KidsChromeManagementClient>( + shared_url_loader_factory, identity_manager); + + supervised_user::SupervisedUserService* supervised_user_service = + SupervisedUserServiceFactory::GetForProfile(profile); + supervised_user_service->GetURLFilter()->InitAsyncURLChecker( + test_kids_chrome_management_client_.get()); +} + +void JNI_SupervisedUserSettingsBridge_SetUpTestUrlLoaderFactoryHelper( + JNIEnv* env) { + TestUrlLoaderFactoryHelper::SharedInstance()->SetUp(); +} + +void JNI_SupervisedUserSettingsBridge_TearDownTestUrlLoaderFactoryHelper( + JNIEnv* env) { + TestUrlLoaderFactoryHelper::SharedInstance()->TearDown(); +}
diff --git a/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc b/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc index b2a8819f..eb7dba4b 100644 --- a/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc +++ b/chrome/browser/sync/test/integration/performance/sessions_sync_perf_test.cc
@@ -54,9 +54,6 @@ // Update all tabs in |profile| by visiting a new URL. void UpdateTabs(int profile); - // Close all tabs in |profile|. - void RemoveTabs(int profile); - // Returns the number of open tabs in all sessions (local + foreign) for // |profile|. Returns -1 on failure. int GetTabCount(int profile); @@ -96,10 +93,6 @@ WaitForTabsToLoad(profile, urls); } -void SessionsSyncPerfTest::RemoveTabs(int profile) { - GetBrowser(profile)->tab_strip_model()->CloseAllTabs(); -} - int SessionsSyncPerfTest::GetTabCount(int profile) { const sync_sessions::SyncedSession* local_session; if (!GetLocalSession(profile, &local_session)) { @@ -133,8 +126,7 @@ return GURL(base::StringPrintf("http://localhost/%d", n)); } -// TODO(lipalani): Re-enable after crbug.com/96921 is fixed. -IN_PROC_BROWSER_TEST_F(SessionsSyncPerfTest, DISABLED_P0) { +IN_PROC_BROWSER_TEST_F(SessionsSyncPerfTest, P0) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; perf_test::PerfResultReporter reporter = @@ -150,11 +142,4 @@ ASSERT_EQ(kNumTabs, GetTabCount(0)); ASSERT_EQ(kNumTabs, GetTabCount(1)); reporter.AddResult(kMetricUpdateTabSyncTime, dt); - - RemoveTabs(0); - dt = TimeMutualSyncCycle(GetClient(0), GetClient(1)); - // New tab page remains open on profile 0 after closing all tabs. - ASSERT_EQ(1, GetTabCount(0)); - ASSERT_EQ(0, GetTabCount(1)); - reporter.AddResult(kMetricDeleteTabSyncTime, dt); }
diff --git a/chrome/browser/sync/test/integration/single_client_reading_list_sync_test.cc b/chrome/browser/sync/test/integration/single_client_reading_list_sync_test.cc index a337c60..cf6ceecf 100644 --- a/chrome/browser/sync/test/integration/single_client_reading_list_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_reading_list_sync_test.cc
@@ -199,12 +199,6 @@ base::test::ScopedFeatureList scoped_feature_list_; }; -// TODO(crbug.com/1455032): The following ifdef should be removed. -// Currently Android explicitly enables Sync-the-feature upon -// `SignInPrimaryAccount()` while the following tests are expecting the sync -// feature to be disabled. -#if !BUILDFLAG(IS_ANDROID) - IN_PROC_BROWSER_TEST_F(SingleClientReadingListSyncTest, ShouldDownloadAccountDataUponSignin) { const GURL kUrl("http://url.com/"); @@ -566,6 +560,4 @@ #endif // !BUILDFLAG(IS_CHROMEOS_ASH) -#endif // !BUILDFLAG(IS_ANDROID) - } // namespace
diff --git a/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc b/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc index 550fab0..50596c9 100644 --- a/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc
@@ -26,12 +26,8 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/constants/ash_features.h" -#include "components/browser_sync/browser_sync_switches.h" #endif -// TODO(crbug.com/1455032): Enable all of these tests on Android once -// SignInPrimaryAccount() doesn't enable Sync anymore. - namespace { syncer::ModelTypeSet AllowedTypesInStandaloneTransportMode() { @@ -141,6 +137,9 @@ } #endif // BUILDFLAG(IS_CHROMEOS_ASH) +// TODO(crbug.com/1117345): On Android it's currently not possible to "upgrade" +// a kSignin account to kSync. +#if !BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F(SingleClientStandaloneTransportSyncTest, SwitchesBetweenTransportAndFeature) { ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; @@ -175,6 +174,7 @@ syncer::UserSelectableType::kBookmarks)); EXPECT_TRUE(GetSyncService(0)->GetActiveDataTypes().Has(syncer::BOOKMARKS)); } +#endif // BUILDFLAG(IS_ANDROID) // Tests the behavior of receiving a "Reset Sync" operation from the dashboard // while Sync-the-feature is active: On non-ChromeOS, this signs the user out, @@ -222,6 +222,8 @@ #endif // BUILDFLAG(IS_CHROMEOS_ASH) } +// TODO(crbug.com/1117345): Android currently doesn't support PRE_ tests. +#if !BUILDFLAG(IS_ANDROID) // Regression test for crbug.com/955989 that verifies the cache GUID is not // reset upon restart of the browser, in standalone transport mode. IN_PROC_BROWSER_TEST_F(SingleClientStandaloneTransportSyncTest, @@ -286,6 +288,7 @@ EXPECT_EQ(old_cache_guid, transport_data_prefs.GetCacheGuid()); } +#endif // BUILDFLAG(IS_ANDROID) class SingleClientStandaloneTransportWithReplaceSyncWithSigninSyncTest : public SingleClientStandaloneTransportSyncTest { @@ -356,6 +359,8 @@ GetSyncService(0)->GetActiveDataTypes().Has(syncer::CONTACT_INFO)); } +// TODO(crbug.com/1117345): Android currently doesn't support PRE_ tests. +#if !BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F( SingleClientStandaloneTransportWithReplaceSyncWithSigninSyncTest, PRE_DataTypesEnabledInTransportModeWithCustomPassphrase) { @@ -454,6 +459,7 @@ EXPECT_TRUE(GetSyncService(0)->GetActiveDataTypes().Has( syncer::AUTOFILL_WALLET_DATA)); } +#endif // BUILDFLAG(IS_ANDROID) class SingleClientStandaloneTransportWithoutReplaceSyncWithSigninSyncTest : public SingleClientStandaloneTransportSyncTest { @@ -549,6 +555,8 @@ base::test::ScopedFeatureList sync_to_signin_feature_; }; +// TODO(crbug.com/1117345): Android currently doesn't support PRE_ tests. +#if !BUILDFLAG(IS_ANDROID) IN_PROC_BROWSER_TEST_F( SingleClientStandaloneTransportReplaceSyncWithSigninMigrationSyncTest, PRE_MigratesSignedInUser) { @@ -663,5 +671,6 @@ EXPECT_FALSE(GetSyncService(0)->GetUserSettings()->GetSelectedTypes().Has( syncer::UserSelectableType::kAutofill)); } +#endif // BUILDFLAG(IS_ANDROID) } // namespace
diff --git a/chrome/browser/sync/test/integration/sync_integration_tests_sources.gni b/chrome/browser/sync/test/integration/sync_integration_tests_sources.gni index a809a48a..0c2af9c 100644 --- a/chrome/browser/sync/test/integration/sync_integration_tests_sources.gni +++ b/chrome/browser/sync/test/integration/sync_integration_tests_sources.gni
@@ -16,6 +16,7 @@ "../browser/sync/test/integration/single_client_offer_sync_test.cc", "../browser/sync/test/integration/single_client_outgoing_password_sharing_invitation_test.cc", "../browser/sync/test/integration/single_client_reading_list_sync_test.cc", + "../browser/sync/test/integration/single_client_standalone_transport_sync_test.cc", "../browser/sync/test/integration/single_client_sync_invalidations_test.cc", "../browser/sync/test/integration/sync_exponential_backoff_test.cc", ] @@ -43,7 +44,6 @@ "../browser/sync/test/integration/single_client_send_tab_to_self_sync_test.cc", "../browser/sync/test/integration/single_client_sessions_sync_test.cc", "../browser/sync/test/integration/single_client_sharing_message_sync_test.cc", - "../browser/sync/test/integration/single_client_standalone_transport_sync_test.cc", "../browser/sync/test/integration/single_client_themes_sync_test.cc", "../browser/sync/test/integration/single_client_user_consents_sync_test.cc", "../browser/sync/test/integration/single_client_user_events_sync_test.cc",
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 64aa721..1cce2cb 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -548,7 +548,6 @@ "//components/password_manager/content/browser", "//components/password_manager/content/common", "//components/password_manager/core/browser", - "//components/password_manager/core/browser:import_results", "//components/password_manager/core/browser/affiliation", "//components/password_manager/core/browser/export", "//components/password_manager/core/browser/features:password_features", @@ -1628,6 +1627,8 @@ "webui/feedback/feedback_handler.h", "webui/feedback/feedback_ui.cc", "webui/feedback/feedback_ui.h", + "webui/hats/hats_page_handler.cc", + "webui/hats/hats_page_handler.h", "webui/hats/hats_ui.cc", "webui/hats/hats_ui.h", "webui/help/version_updater.h", @@ -1930,6 +1931,7 @@ "//chrome/browser/ui/webui/app_service_internals:mojo_bindings", "//chrome/browser/ui/webui/downloads:mojo_bindings", "//chrome/browser/ui/webui/feed:mojo_bindings", + "//chrome/browser/ui/webui/hats:mojo_bindings", "//chrome/browser/ui/webui/internals/user_education:mojo_bindings", "//chrome/browser/ui/webui/new_tab_page:mojo_bindings", "//chrome/browser/ui/webui/new_tab_page_third_party:mojo_bindings", @@ -3057,8 +3059,8 @@ "webui/ash/login/network_state_informer.h", "webui/ash/login/offline_login_screen_handler.cc", "webui/ash/login/offline_login_screen_handler.h", - "webui/ash/login/online_login_helper.cc", - "webui/ash/login/online_login_helper.h", + "webui/ash/login/online_login_utils.cc", + "webui/ash/login/online_login_utils.h", "webui/ash/login/oobe_display_chooser.cc", "webui/ash/login/oobe_display_chooser.h", "webui/ash/login/oobe_ui.cc", @@ -3075,6 +3077,8 @@ "webui/ash/login/password_selection_screen_handler.h", "webui/ash/login/pin_setup_screen_handler.cc", "webui/ash/login/pin_setup_screen_handler.h", + "webui/ash/os_feedback_dialog.cc", + "webui/ash/os_feedback_dialog.h", # Template used by the `tools/oobe/generate_screen_template.py` script. "webui/ash/login/placeholder_screen_handler.cc",
diff --git a/chrome/browser/ui/ash/chrome_new_window_client.cc b/chrome/browser/ui/ash/chrome_new_window_client.cc index 637276799..11d487b8 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client.cc +++ b/chrome/browser/ui/ash/chrome_new_window_client.cc
@@ -262,8 +262,6 @@ aura::Window* source_window, const ui::OSExchangeData& drop_data, NewWindowForDetachingTabCallback closure) { - DCHECK(ash::features::IsWebUITabStripTabDragIntegrationEnabled()); - BrowserView* source_view = BrowserView::GetBrowserViewForNativeWindow( source_window->GetToplevelWindow()); if (!source_view) {
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc index 58c94cb..6c4072a 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -250,12 +250,10 @@ } bool ChromeShellDelegate::IsTabDrag(const ui::OSExchangeData& drop_data) { - DCHECK(ash::features::IsWebUITabStripTabDragIntegrationEnabled()); return tab_strip_ui::IsDraggedTab(drop_data); } int ChromeShellDelegate::GetBrowserWebUITabStripHeight() { - DCHECK(ash::features::IsWebUITabStripTabDragIntegrationEnabled()); return TabStripUILayout::GetContainerHeight(); }
diff --git a/chrome/browser/ui/passwords/settings/password_manager_porter.cc b/chrome/browser/ui/passwords/settings/password_manager_porter.cc index 0a72750..00ee49b 100644 --- a/chrome/browser/ui/passwords/settings/password_manager_porter.cc +++ b/chrome/browser/ui/passwords/settings/password_manager_porter.cc
@@ -80,7 +80,7 @@ bool PasswordManagerPorter::Export(content::WebContents* web_contents) { if (exporter_ && exporter_->GetProgressStatus() == - password_manager::ExportProgressStatus::IN_PROGRESS) { + password_manager::ExportProgressStatus::kInProgress) { return false; } @@ -108,7 +108,7 @@ password_manager::ExportProgressStatus PasswordManagerPorter::GetExportProgressStatus() { return exporter_ ? exporter_->GetProgressStatus() - : password_manager::ExportProgressStatus::NOT_STARTED; + : password_manager::ExportProgressStatus::kNotStarted; } void PasswordManagerPorter::SetExporterForTesting(
diff --git a/chrome/browser/ui/passwords/settings/password_manager_porter_interface.h b/chrome/browser/ui/passwords/settings/password_manager_porter_interface.h index 4a3a248c..2940c20 100644 --- a/chrome/browser/ui/passwords/settings/password_manager_porter_interface.h +++ b/chrome/browser/ui/passwords/settings/password_manager_porter_interface.h
@@ -5,9 +5,9 @@ #ifndef CHROME_BROWSER_UI_PASSWORDS_SETTINGS_PASSWORD_MANAGER_PORTER_INTERFACE_H_ #define CHROME_BROWSER_UI_PASSWORDS_SETTINGS_PASSWORD_MANAGER_PORTER_INTERFACE_H_ +#include "components/password_manager/core/browser/export/export_progress_status.h" +#include "components/password_manager/core/browser/import/import_results.h" #include "components/password_manager/core/browser/password_form.h" -#include "components/password_manager/core/browser/ui/export_progress_status.h" -#include "components/password_manager/core/browser/ui/import_results.h" namespace content { class WebContents;
diff --git a/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc b/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc index 4686164..8b57c36 100644 --- a/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc +++ b/chrome/browser/ui/passwords/settings/password_manager_porter_unittest.cc
@@ -25,10 +25,10 @@ #include "components/password_manager/core/browser/affiliation/fake_affiliation_service.h" #include "components/password_manager/core/browser/export/password_manager_exporter.h" #include "components/password_manager/core/browser/import/csv_password_sequence.h" +#include "components/password_manager/core/browser/import/import_results.h" #include "components/password_manager/core/browser/password_manager_test_utils.h" #include "components/password_manager/core/browser/test_password_store.h" #include "components/password_manager/core/browser/ui/credential_provider_interface.h" -#include "components/password_manager/core/browser/ui/import_results.h" #include "components/password_manager/core/common/password_manager_features.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/ui/quick_answers/quick_answers_state_ash.cc b/chrome/browser/ui/quick_answers/quick_answers_state_ash.cc index 9e0c1621..1f835e54 100644 --- a/chrome/browser/ui/quick_answers/quick_answers_state_ash.cc +++ b/chrome/browser/ui/quick_answers/quick_answers_state_ash.cc
@@ -59,6 +59,10 @@ session_observation_.Reset(); } +void QuickAnswersStateAsh::OnShellDestroying() { + session_observation_.Reset(); +} + void QuickAnswersStateAsh::RegisterPrefChanges(PrefService* pref_service) { pref_change_registrar_.reset();
diff --git a/chrome/browser/ui/quick_answers/quick_answers_state_ash.h b/chrome/browser/ui/quick_answers/quick_answers_state_ash.h index fd83d424..4b72a0b 100644 --- a/chrome/browser/ui/quick_answers/quick_answers_state_ash.h +++ b/chrome/browser/ui/quick_answers/quick_answers_state_ash.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_QUICK_ANSWERS_QUICK_ANSWERS_STATE_ASH_H_ #include "ash/public/cpp/session/session_observer.h" +#include "ash/shell_observer.h" #include "base/scoped_observation.h" #include "chromeos/components/quick_answers/public/cpp/quick_answers_state.h" @@ -18,6 +19,7 @@ // A class that holds Quick Answers related prefs and states. class QuickAnswersStateAsh : public ash::SessionObserver, + public ash::ShellObserver, public QuickAnswersState { public: QuickAnswersStateAsh(); @@ -28,10 +30,13 @@ ~QuickAnswersStateAsh() override; private: - // SessionObserver: + // ash::SessionObserver: void OnFirstSessionStarted() override; void OnChromeTerminating() override; + // ash::ShellObserver: + void OnShellDestroying() override; + void RegisterPrefChanges(PrefService* pref_service); // QuickAnswersState:
diff --git a/chrome/browser/ui/views/editor_menu/editor_menu_controller_impl.cc b/chrome/browser/ui/views/editor_menu/editor_menu_controller_impl.cc index d4782ce..7055b18 100644 --- a/chrome/browser/ui/views/editor_menu/editor_menu_controller_impl.cc +++ b/chrome/browser/ui/views/editor_menu/editor_menu_controller_impl.cc
@@ -43,14 +43,30 @@ #endif // BUILDFLAG(IS_CHROMEOS_LACROS) } +PresetQueryCategory GetPresetQueryCategory( + const crosapi::mojom::EditorPanelPresetQueryCategory category) { + switch (category) { + case crosapi::mojom::EditorPanelPresetQueryCategory::kUnknown: + return PresetQueryCategory::kUnknown; + case crosapi::mojom::EditorPanelPresetQueryCategory::kShorten: + return PresetQueryCategory::kShorten; + case crosapi::mojom::EditorPanelPresetQueryCategory::kElaborate: + return PresetQueryCategory::kElaborate; + case crosapi::mojom::EditorPanelPresetQueryCategory::kRephrase: + return PresetQueryCategory::kRephrase; + case crosapi::mojom::EditorPanelPresetQueryCategory::kFormalize: + return PresetQueryCategory::kFormalize; + case crosapi::mojom::EditorPanelPresetQueryCategory::kEmojify: + return PresetQueryCategory::kEmojify; + } +} + PresetTextQueries GetPresetTextQueries( const std::vector<EditorPanelPresetTextQueryPtr>& preset_text_queries) { - // TODO(b/295059934): Use EditorPanelPresetTextQueryPtrs to get the actual - // query categories. PresetTextQueries queries; for (const auto& query : preset_text_queries) { queries.emplace_back(query->text_query_id, base::UTF8ToUTF16(query->name), - PresetQueryCategory::kUnknown); + GetPresetQueryCategory(query->category)); } return queries; }
diff --git a/chrome/browser/ui/webui/ash/lock_screen_reauth/lock_screen_reauth_handler.cc b/chrome/browser/ui/webui/ash/lock_screen_reauth/lock_screen_reauth_handler.cc index 8332696..6655de0 100644 --- a/chrome/browser/ui/webui/ash/lock_screen_reauth/lock_screen_reauth_handler.cc +++ b/chrome/browser/ui/webui/ash/lock_screen_reauth/lock_screen_reauth_handler.cc
@@ -8,6 +8,7 @@ #include "ash/constants/ash_features.h" #include "base/check_op.h" +#include "base/functional/bind.h" #include "base/notreached.h" #include "chrome/browser/ash/login/login_pref_names.h" #include "chrome/browser/ash/login/saml/in_session_password_sync_manager.h" @@ -20,6 +21,7 @@ #include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/ui/webui/ash/lock_screen_reauth/lock_screen_reauth_dialogs.h" #include "chrome/browser/ui/webui/ash/login/check_passwords_against_cryptohome_helper.h" +#include "chrome/browser/ui/webui/ash/login/online_login_utils.h" #include "chrome/common/chrome_features.h" #include "chrome/grit/generated_resources.h" #include "chrome/installer/util/google_update_settings.h" @@ -273,27 +275,7 @@ DCHECK(!email.empty()); DCHECK(!gaia_id.empty()); - OnlineLoginHelper::CompleteLoginCallback complete_login_callback = - base::BindOnce(&LockScreenReauthHandler::CheckCredentials, - weak_factory_.GetWeakPtr()); - - if (password.empty()) { - CHECK_NE(scraped_saml_passwords.size(), 1u); - complete_login_callback = base::BindOnce( - &LockScreenReauthHandler::SamlConfirmPassword, - weak_factory_.GetWeakPtr(), std::move(scraped_saml_passwords)); - } - - login::SigninPartitionManager* signin_partition_manager = - login::SigninPartitionManager::Factory::GetForBrowserContext( - Profile::FromWebUI(web_ui())); - - online_login_helper_ = std::make_unique<OnlineLoginHelper>( - signin_partition_name_, signin_partition_manager, - base::BindOnce(&LockScreenReauthHandler::OnCookieWaitTimeout, - weak_factory_.GetWeakPtr()), - std::move(complete_login_callback)); - + // Build UserContext user_context_ = std::make_unique<UserContext>(); if (!login::BuildUserContextForGaiaSignIn( login::GetUsertypeFromServicesString(services), @@ -309,8 +291,40 @@ return; } - online_login_helper_->SetUserContext(std::move(user_context_)); - online_login_helper_->RequestCookiesAndCompleteAuthentication(); + // Create GaiaCookiesRetriever + login::SigninPartitionManager* signin_partition_manager = + login::SigninPartitionManager::Factory::GetForBrowserContext( + Profile::FromWebUI(web_ui())); + gaia_cookie_retriever_ = std::make_unique<GaiaCookieRetriever>( + signin_partition_name_, signin_partition_manager, + base::BindOnce(&LockScreenReauthHandler::OnCookieWaitTimeout, + weak_factory_.GetWeakPtr())); + + // Create the callback that will be invoked once cookies are received. + const bool needs_saml_confirm_password = password.empty(); + GaiaCookieRetriever::OnCookieRetrievedCallback finish_auth_callback = + base::BindOnce(&LockScreenReauthHandler::FinishAuthentication, + weak_factory_.GetWeakPtr(), needs_saml_confirm_password, + std::move(scraped_saml_passwords), + std::move(user_context_)); + + // Request cookies and proceed with authentication. + gaia_cookie_retriever_->RetrieveCookies(std::move(finish_auth_callback)); +} + +void LockScreenReauthHandler::FinishAuthentication( + bool needs_saml_confirm_password, + ::login::StringList scraped_saml_passwords, + std::unique_ptr<UserContext> user_context, + login::GaiaCookiesData gaia_cookies) { + gaia_cookies.TransferCookiesToUserContext(*user_context); + + if (needs_saml_confirm_password) { + CHECK_NE(scraped_saml_passwords.size(), 1u); + SamlConfirmPassword(scraped_saml_passwords, std::move(user_context)); + } else { + CheckCredentials(std::move(user_context)); + } } void LockScreenReauthHandler::OnCookieWaitTimeout() {
diff --git a/chrome/browser/ui/webui/ash/lock_screen_reauth/lock_screen_reauth_handler.h b/chrome/browser/ui/webui/ash/lock_screen_reauth/lock_screen_reauth_handler.h index 01b6447..1d7642a 100644 --- a/chrome/browser/ui/webui/ash/lock_screen_reauth/lock_screen_reauth_handler.h +++ b/chrome/browser/ui/webui/ash/lock_screen_reauth/lock_screen_reauth_handler.h
@@ -11,7 +11,9 @@ #include "base/memory/weak_ptr.h" #include "base/values.h" #include "chrome/browser/ui/webui/ash/login/check_passwords_against_cryptohome_helper.h" -#include "chrome/browser/ui/webui/ash/login/online_login_helper.h" +#include "chrome/browser/ui/webui/ash/login/online_login_utils.h" +#include "chromeos/ash/components/login/auth/public/user_context.h" +#include "components/login/base_screen_handler_utils.h" #include "content/public/browser/web_ui_message_handler.h" #include "net/cookies/cookie_access_result.h" @@ -79,6 +81,12 @@ // is the user password among the list of scraped passwords. void OnPasswordConfirmed(const std::string& password); + // Finish the authentication + void FinishAuthentication(bool needs_saml_confirm_password, + ::login::StringList scraped_saml_password, + std::unique_ptr<UserContext> user_context, + login::GaiaCookiesData gaia_cookies); + void LoadAuthenticatorParam(); void LoadGaia(const login::GaiaContext& context); @@ -126,7 +134,7 @@ std::unique_ptr<LoginClientCertUsageObserver> extension_provided_client_cert_usage_observer_; - std::unique_ptr<OnlineLoginHelper> online_login_helper_; + std::unique_ptr<GaiaCookieRetriever> gaia_cookie_retriever_; // A test may be waiting for the authenticator to load. base::OnceClosure waiting_caller_;
diff --git a/chrome/browser/ui/webui/ash/login/gaia_screen_handler.cc b/chrome/browser/ui/webui/ash/login/gaia_screen_handler.cc index 22bfebb..2654ef22 100644 --- a/chrome/browser/ui/webui/ash/login/gaia_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/gaia_screen_handler.cc
@@ -72,7 +72,7 @@ #include "chrome/browser/ui/webui/ash/login/enrollment_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/network_state_informer.h" -#include "chrome/browser/ui/webui/ash/login/online_login_helper.h" +#include "chrome/browser/ui/webui/ash/login/online_login_utils.h" #include "chrome/browser/ui/webui/ash/login/reset_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/saml_confirm_password_handler.h" #include "chrome/browser/ui/webui/ash/login/signin_fatal_error_screen_handler.h" @@ -782,27 +782,6 @@ const std::string sanitized_email = gaia::SanitizeEmail(email); LoginDisplayHost::default_host()->SetDisplayEmail(sanitized_email); - OnlineLoginHelper::CompleteLoginCallback complete_login_callback = - base::BindOnce([](std::unique_ptr<UserContext> user_context) { - LoginDisplayHost::default_host()->CompleteLogin(*user_context); - }); - - if (password.empty() && !IsSamlUserPasswordless()) { - CHECK_NE(scraped_saml_passwords.size(), 1u); - complete_login_callback = base::BindOnce( - &GaiaScreenHandler::SAMLConfirmPassword, weak_factory_.GetWeakPtr(), - std::move(scraped_saml_passwords)); - } - - login::SigninPartitionManager* signin_partition_manager = - login::SigninPartitionManager::Factory::GetForBrowserContext( - Profile::FromWebUI(web_ui())); - online_login_helper_ = std::make_unique<OnlineLoginHelper>( - signin_partition_name_, signin_partition_manager, - base::BindOnce(&GaiaScreenHandler::OnCookieWaitTimeout, - weak_factory_.GetWeakPtr()), - std::move(complete_login_callback)); - auto user_context = std::make_unique<UserContext>(); SigninError error; if (!login::BuildUserContextForGaiaSignIn( @@ -817,8 +796,26 @@ return; } - online_login_helper_->SetUserContext(std::move(user_context)); - online_login_helper_->RequestCookiesAndCompleteAuthentication(); + // Create GaiaCookiesRetriever + login::SigninPartitionManager* signin_partition_manager = + login::SigninPartitionManager::Factory::GetForBrowserContext( + Profile::FromWebUI(web_ui())); + gaia_cookie_retriever_ = std::make_unique<GaiaCookieRetriever>( + signin_partition_name_, signin_partition_manager, + base::BindOnce(&GaiaScreenHandler::OnCookieWaitTimeout, + weak_factory_.GetWeakPtr())); + + // Create the callback that will be invoked once cookies are received. + const bool needs_saml_confirm_password = + password.empty() && !IsSamlUserPasswordless(); + GaiaCookieRetriever::OnCookieRetrievedCallback finish_auth_callback = + base::BindOnce(&GaiaScreenHandler::CompleteAuthenticationWithCookies, + weak_factory_.GetWeakPtr(), needs_saml_confirm_password, + std::move(scraped_saml_passwords), + std::move(user_context)); + + // Request cookies and proceed with authentication. + gaia_cookie_retriever_->RetrieveCookies(std::move(finish_auth_callback)); populated_account_id_.clear(); @@ -832,6 +829,24 @@ } } +void GaiaScreenHandler::CompleteAuthenticationWithCookies( + bool needs_saml_confirm_password, + ::login::StringList scraped_saml_passwords, + std::unique_ptr<UserContext> user_context, + login::GaiaCookiesData gaia_cookies) { + // Transfer the received cookies into the UserContext + gaia_cookies.TransferCookiesToUserContext(*user_context); + + // Finish the authentication + if (needs_saml_confirm_password) { + CHECK_NE(scraped_saml_passwords.size(), 1u); + SAMLConfirmPassword(std::move(scraped_saml_passwords), + std::move(user_context)); + } else { + LoginDisplayHost::default_host()->CompleteLogin(*user_context); + } +} + void GaiaScreenHandler::OnCookieWaitTimeout() { LoadAuthExtension(true /* force */); LoginDisplayHost::default_host()->GetSigninUI()->ShowSigninError(
diff --git a/chrome/browser/ui/webui/ash/login/gaia_screen_handler.h b/chrome/browser/ui/webui/ash/login/gaia_screen_handler.h index 6f1947f9..33a3910 100644 --- a/chrome/browser/ui/webui/ash/login/gaia_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/gaia_screen_handler.h
@@ -19,7 +19,7 @@ #include "chrome/browser/certificate_provider/security_token_pin_dialog_host.h" #include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/network_state_informer.h" -#include "chrome/browser/ui/webui/ash/login/online_login_helper.h" +#include "chrome/browser/ui/webui/ash/login/online_login_utils.h" #include "chrome/browser/ui/webui/ash/login/saml_challenge_key_handler.h" #include "chromeos/components/security_token_pin/constants.h" #include "components/user_manager/user_type.h" @@ -253,6 +253,13 @@ bool services_provided, const base::Value::Dict& password_attributes, const base::Value::Dict& sync_trusted_vault_keys); + + void CompleteAuthenticationWithCookies( + bool needs_saml_confirm_password, + ::login::StringList scraped_saml_passwords, + std::unique_ptr<UserContext> user_context, + login::GaiaCookiesData gaia_cookies); + void HandleCompleteLogin(const std::string& gaia_id, const std::string& typed_email, const std::string& password, @@ -453,7 +460,7 @@ std::unique_ptr<SamlChallengeKeyHandler> saml_challenge_key_handler_; std::unique_ptr<SamlChallengeKeyHandler> saml_challenge_key_handler_for_test_; - std::unique_ptr<OnlineLoginHelper> online_login_helper_; + std::unique_ptr<GaiaCookieRetriever> gaia_cookie_retriever_; // Network state informer used to keep signin screen up. scoped_refptr<NetworkStateInformer> network_state_informer_;
diff --git a/chrome/browser/ui/webui/ash/login/online_login_helper.cc b/chrome/browser/ui/webui/ash/login/online_login_utils.cc similarity index 83% rename from chrome/browser/ui/webui/ash/login/online_login_helper.cc rename to chrome/browser/ui/webui/ash/login/online_login_utils.cc index 4657f656d..97b416f 100644 --- a/chrome/browser/ui/webui/ash/login/online_login_helper.cc +++ b/chrome/browser/ui/webui/ash/login/online_login_utils.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/webui/ash/login/online_login_helper.h" +#include "chrome/browser/ui/webui/ash/login/online_login_utils.h" #include "chrome/browser/ash/login/signin_partition_manager.h" #include "chrome/browser/ash/login/ui/login_display_host_webui.h" @@ -34,6 +34,22 @@ GaiaContext::GaiaContext() {} GaiaContext::GaiaContext(GaiaContext const&) = default; +GaiaCookiesData::GaiaCookiesData() = default; +GaiaCookiesData::~GaiaCookiesData() = default; +GaiaCookiesData::GaiaCookiesData(GaiaCookiesData const&) = default; + +void GaiaCookiesData::TransferCookiesToUserContext(UserContext& user_context) { + CHECK(!this->auth_code.empty()); + user_context.SetAuthCode(this->auth_code); + + if (this->gaps_cookie.has_value() && !this->gaps_cookie->empty()) { + user_context.SetGAPSCookie(this->gaps_cookie.value()); + } + if (this->rapt.has_value() && !this->rapt->empty()) { + user_context.SetReauthProofToken(this->rapt.value()); + } +} + bool ExtractSamlPasswordAttributesEnabled() { return base::FeatureList::IsEnabled(::features::kInSessionPasswordChange); } @@ -182,24 +198,20 @@ } // namespace login -OnlineLoginHelper::OnlineLoginHelper( +GaiaCookieRetriever::GaiaCookieRetriever( std::string signin_partition_name, login::SigninPartitionManager* signin_partition_manager, - OnCookieTimeoutCallback on_cookie_timeout_callback, - CompleteLoginCallback complete_login_callback) + OnCookieTimeoutCallback on_cookie_timeout_callback) : signin_partition_name_(signin_partition_name), signin_partition_manager_(signin_partition_manager), - on_cookie_timeout_callback_(std::move(on_cookie_timeout_callback)), - complete_login_callback_(std::move(complete_login_callback)) {} + on_cookie_timeout_callback_(std::move(on_cookie_timeout_callback)) {} -OnlineLoginHelper::~OnlineLoginHelper() = default; +GaiaCookieRetriever::~GaiaCookieRetriever() = default; -void OnlineLoginHelper::SetUserContext( - std::unique_ptr<UserContext> pending_user_context) { - pending_user_context_ = std::move(pending_user_context); -} +void GaiaCookieRetriever::RetrieveCookies( + OnCookieRetrievedCallback on_cookie_retrieved_callback) { + on_cookie_retrieved_callback_ = std::move(on_cookie_retrieved_callback); -void OnlineLoginHelper::RequestCookiesAndCompleteAuthentication() { content::StoragePartition* partition = signin_partition_manager_->GetCurrentStoragePartition(); if (!partition) @@ -219,7 +231,7 @@ cookie_waiting_timer_ = std::make_unique<base::OneShotTimer>(); cookie_waiting_timer_->Start( FROM_HERE, login::kCookieDelay, - base::BindOnce(&OnlineLoginHelper::OnCookieWaitTimeout, + base::BindOnce(&GaiaCookieRetriever::OnCookieWaitTimeout, weak_factory_.GetWeakPtr())); } @@ -228,54 +240,45 @@ cookie_manager->GetCookieList( GaiaUrls::GetInstance()->gaia_url(), cookie_options, net::CookiePartitionKeyCollection::Todo(), - base::BindOnce(&OnlineLoginHelper::OnGetCookiesForCompleteAuthentication, + base::BindOnce(&GaiaCookieRetriever::OnGetCookieListResponse, weak_factory_.GetWeakPtr())); } -void OnlineLoginHelper::OnCookieChange(const net::CookieChangeInfo& change) { - RequestCookiesAndCompleteAuthentication(); +void GaiaCookieRetriever::OnCookieChange(const net::CookieChangeInfo& change) { + if (on_cookie_retrieved_callback_.has_value() && + on_cookie_retrieved_callback_.value()) { + RetrieveCookies(std::move(on_cookie_retrieved_callback_.value())); + } } -void OnlineLoginHelper::OnCookieWaitTimeout() { - DCHECK(pending_user_context_); - pending_user_context_.reset(); +void GaiaCookieRetriever::OnCookieWaitTimeout() { oauth_code_listener_.reset(); cookie_waiting_timer_.reset(); std::move(on_cookie_timeout_callback_).Run(); } -void OnlineLoginHelper::OnGetCookiesForCompleteAuthentication( +void GaiaCookieRetriever::OnGetCookieListResponse( const net::CookieAccessResultList& cookies, const net::CookieAccessResultList& excluded_cookies) { - std::string auth_code, gaps_cookie, rapt; + login::GaiaCookiesData cookie_data; for (const auto& cookie_with_access_result : cookies) { const auto& cookie = cookie_with_access_result.cookie; if (cookie.Name() == login::kOAUTHCodeCookie) - auth_code = cookie.Value(); + cookie_data.auth_code = cookie.Value(); else if (cookie.Name() == login::kGAPSCookie) - gaps_cookie = cookie.Value(); + cookie_data.gaps_cookie = cookie.Value(); else if (cookie.Name() == login::kRAPTCookie) - rapt = cookie.Value(); + cookie_data.rapt = cookie.Value(); } - if (auth_code.empty()) { + if (cookie_data.auth_code.empty()) { // Will try again from onCookieChange. return; } - DCHECK(pending_user_context_); - auto user_context = std::move(pending_user_context_); - pending_user_context_.reset(); oauth_code_listener_.reset(); cookie_waiting_timer_.reset(); - - user_context->SetAuthCode(auth_code); - if (!gaps_cookie.empty()) - user_context->SetGAPSCookie(gaps_cookie); - if (!rapt.empty()) - user_context->SetReauthProofToken(rapt); - - std::move(complete_login_callback_).Run(std::move(user_context)); + std::move(on_cookie_retrieved_callback_.value()).Run(cookie_data); } } // namespace ash
diff --git a/chrome/browser/ui/webui/ash/login/online_login_helper.h b/chrome/browser/ui/webui/ash/login/online_login_utils.h similarity index 70% rename from chrome/browser/ui/webui/ash/login/online_login_helper.h rename to chrome/browser/ui/webui/ash/login/online_login_utils.h index 28605b3..7777444 100644 --- a/chrome/browser/ui/webui/ash/login/online_login_helper.h +++ b/chrome/browser/ui/webui/ash/login/online_login_utils.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_WEBUI_ASH_LOGIN_ONLINE_LOGIN_HELPER_H_ -#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ONLINE_LOGIN_HELPER_H_ +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ONLINE_LOGIN_UTILS_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ONLINE_LOGIN_UTILS_H_ #include <memory> #include <string> @@ -47,6 +47,24 @@ std::string gaps_cookie; }; +// Structure for holding the data from Gaia cookies that ChromeOS wants to +// store in the user context after a successful authentication. +struct GaiaCookiesData { + GaiaCookiesData(); + GaiaCookiesData(GaiaCookiesData const&); + ~GaiaCookiesData(); + + void TransferCookiesToUserContext(UserContext& user_context); + + // login::kOAUTHCodeCookie - Not optional. + std::string auth_code; + + // login::kGAPSCookie + absl::optional<std::string> gaps_cookie = absl::nullopt; + // Re-Auth Proof Token -- login::kRAPTCookie + absl::optional<std::string> rapt = absl::nullopt; +}; + using LoadGaiaWithPartition = base::OnceCallback<void(const std::string&)>; using OnSetCookieForLoadGaiaWithPartition = @@ -92,28 +110,27 @@ } // namespace login -// This class will be used in authenticating Gaia and SAML users in loginscreen -// and SAML users in lockscreen. -class OnlineLoginHelper : public network::mojom::CookieChangeListener { +// GaiaCookieRetriever is used for retrieving the cookies that are set by Gaia +// by directly interacting with a |SigninPartitionManager| and delivering the +// results via the |OnCookieRetrievedCallback|. If a timeout occurs, the given +// |OnCookieTimeoutCallback| is invoked. +class GaiaCookieRetriever : public network::mojom::CookieChangeListener { public: using OnCookieTimeoutCallback = base::OnceCallback<void(void)>; - using CompleteLoginCallback = - base::OnceCallback<void(std::unique_ptr<UserContext>)>; + using OnCookieRetrievedCallback = + base::OnceCallback<void(login::GaiaCookiesData)>; - explicit OnlineLoginHelper( + explicit GaiaCookieRetriever( std::string signin_partition_name, login::SigninPartitionManager* signin_partition_manager, - OnCookieTimeoutCallback on_cookie_timeout_callback, - CompleteLoginCallback complete_login_callback); + OnCookieTimeoutCallback on_cookie_timeout_callback); - OnlineLoginHelper(const OnlineLoginHelper&) = delete; - OnlineLoginHelper& operator=(const OnlineLoginHelper&) = delete; + GaiaCookieRetriever(const GaiaCookieRetriever&) = delete; + GaiaCookieRetriever& operator=(const GaiaCookieRetriever&) = delete; - ~OnlineLoginHelper() override; + ~GaiaCookieRetriever() override; - void SetUserContext(std::unique_ptr<UserContext> pending_user_context); - - void RequestCookiesAndCompleteAuthentication(); + void RetrieveCookies(OnCookieRetrievedCallback on_cookie_retrieved_callback); private: // network::mojom::CookieChangeListener: @@ -121,7 +138,7 @@ void OnCookieWaitTimeout(); - void OnGetCookiesForCompleteAuthentication( + void OnGetCookieListResponse( const net::CookieAccessResultList& cookies, const net::CookieAccessResultList& excluded_cookies); @@ -140,11 +157,11 @@ OnCookieTimeoutCallback on_cookie_timeout_callback_; - CompleteLoginCallback complete_login_callback_; + absl::optional<OnCookieRetrievedCallback> on_cookie_retrieved_callback_; - base::WeakPtrFactory<OnlineLoginHelper> weak_factory_{this}; + base::WeakPtrFactory<GaiaCookieRetriever> weak_factory_{this}; }; } // namespace ash -#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ONLINE_LOGIN_HELPER_H_ +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ONLINE_LOGIN_UTILS_H_
diff --git a/chrome/browser/ui/webui/ash/mako/mako_ui.cc b/chrome/browser/ui/webui/ash/mako/mako_ui.cc index 3c2cd7d..b68c2eb 100644 --- a/chrome/browser/ui/webui/ash/mako/mako_ui.cc +++ b/chrome/browser/ui/webui/ash/mako/mako_ui.cc
@@ -21,6 +21,7 @@ #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_data_source.h" #include "content/public/common/url_constants.h" +#include "net/base/url_util.h" #include "ui/base/ime/ash/ime_bridge.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" @@ -199,22 +200,55 @@ ->Show(); } +void MakoPageHandler::ShowWriteUI(Profile* profile) { + ShowEditorUI( + net::AppendOrReplaceQueryParameter(GURL(kChromeUIMakoOrcaURL), + kOrcaModeParamKey, kOrcaWriteMode), + profile); +} + void MakoPageHandler::ShowRewriteUI(Profile* profile) { + ShowEditorUI( + net::AppendOrReplaceQueryParameter(GURL(kChromeUIMakoOrcaURL), + kOrcaModeParamKey, kOrcaRewriteMode), + profile); +} + +void MakoPageHandler::ShowRewriteUIFromPreset(Profile* profile, + std::string_view text_query_id) { + GURL url = net::AppendOrReplaceQueryParameter( + GURL(kChromeUIMakoOrcaURL), kOrcaModeParamKey, kOrcaRewriteMode); + ShowEditorUI(net::AppendOrReplaceQueryParameter(url, kOrcaPresetParamKey, + text_query_id), + profile); +} + +void MakoPageHandler::ShowRewriteUIFromFreeform(Profile* profile, + std::string_view text) { + GURL url = net::AppendOrReplaceQueryParameter( + GURL(kChromeUIMakoOrcaURL), kOrcaModeParamKey, kOrcaRewriteMode); + ShowEditorUI( + net::AppendOrReplaceQueryParameter(url, kOrcaPresetParamKey, text), + profile); +} + +void MakoPageHandler::ShowEditorUI(const GURL& url, + content::BrowserContext* browser_context) { if (contents_wrapper_ != nullptr) { - // If switching to the rewrite UI (e.g. from consent UI to rewrite UI), - // close the current contents and use the cached caret bounds. + // If switching contents (e.g. from consent UI to rewrite UI), close the + // current contents and use the cached caret bounds. contents_wrapper_->CloseUI(); CHECK(caret_bounds_.has_value()); } else if (const auto* text_input_client = GetTextInputClient()) { // Otherwise, try to get the caret bounds from the text input client. caret_bounds_ = text_input_client->GetCaretBounds(); } else { - // Otherwise, don't show the rewrite UI. + // Otherwise, don't show mako UI. return; } contents_wrapper_ = std::make_unique<BubbleContentsWrapperT<MakoUntrustedUI>>( - GURL(kChromeUIMakoOrcaURL), profile, kMakoTaskManagerStringID); + url, browser_context, kMakoTaskManagerStringID); contents_wrapper_->ReloadWebContents(); views::BubbleDialogDelegateView::CreateBubble( std::make_unique<MakoRewriteView>(contents_wrapper_.get(),
diff --git a/chrome/browser/ui/webui/ash/mako/mako_ui.h b/chrome/browser/ui/webui/ash/mako/mako_ui.h index 9a284422..8b94d57 100644 --- a/chrome/browser/ui/webui/ash/mako/mako_ui.h +++ b/chrome/browser/ui/webui/ash/mako/mako_ui.h
@@ -32,7 +32,6 @@ // The WebUI for chrome://mako class MakoUntrustedUI : public ui::UntrustedBubbleWebUIController { public: - static void Show(Profile* profile); explicit MakoUntrustedUI(content::WebUI* web_ui); ~MakoUntrustedUI() override; @@ -50,13 +49,17 @@ MakoPageHandler& operator=(const MakoPageHandler&) = delete; ~MakoPageHandler(); - // TODO(b/300554470): Add parameters to specify when the WebUI is being opened - // via a preset text query. void ShowConsentUI(Profile* profile); + void ShowWriteUI(Profile* profile); void ShowRewriteUI(Profile* profile); + void ShowRewriteUIFromPreset(Profile* profile, + std::string_view text_query_id); + void ShowRewriteUIFromFreeform(Profile* profile, std::string_view text); void CloseUI(); private: + void ShowEditorUI(const GURL& url, content::BrowserContext* browser_context); + // Cached caret bounds to use as the mako UI anchor when there is no text // input client (e.g. if focus is not regained after switching from the // consent UI to the rewrite UI).
diff --git a/chrome/browser/ui/webui/ash/mako/url_constants.cc b/chrome/browser/ui/webui/ash/mako/url_constants.cc index 7aefa13..55ff869f 100644 --- a/chrome/browser/ui/webui/ash/mako/url_constants.cc +++ b/chrome/browser/ui/webui/ash/mako/url_constants.cc
@@ -11,4 +11,11 @@ const char kChromeUIMakoOrcaURL[] = "chrome-untrusted://mako/orca.html"; const char kChromeUIMakoPrivacyURL[] = "chrome-untrusted://mako/privacy.html"; +const char kOrcaModeParamKey[] = "mode"; +const char kOrcaWriteMode[] = "write"; +const char kOrcaRewriteMode[] = "rewrite"; + +const char kOrcaPresetParamKey[] = "preset"; +const char kOrcaFreeformParamKey[] = "freeform"; + } // namespace ash
diff --git a/chrome/browser/ui/webui/ash/mako/url_constants.h b/chrome/browser/ui/webui/ash/mako/url_constants.h index a2d0fd2..6a5354d 100644 --- a/chrome/browser/ui/webui/ash/mako/url_constants.h +++ b/chrome/browser/ui/webui/ash/mako/url_constants.h
@@ -12,5 +12,13 @@ extern const char kChromeUIMakoOrcaURL[]; extern const char kChromeUIMakoPrivacyURL[]; +extern const char kOrcaModeParamKey[]; +extern const char kOrcaWriteMode[]; +extern const char kOrcaRewriteMode[]; + +extern const char kOrcaPresetParamKey[]; +extern const char kOrcaFreeformParamKey[]; + } // namespace ash + #endif // CHROME_BROWSER_UI_WEBUI_ASH_MAKO_URL_CONSTANTS_H_
diff --git a/chrome/browser/ui/webui/ash/os_feedback_dialog.cc b/chrome/browser/ui/webui/ash/os_feedback_dialog.cc new file mode 100644 index 0000000..be91a42 --- /dev/null +++ b/chrome/browser/ui/webui/ash/os_feedback_dialog.cc
@@ -0,0 +1,63 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/ash/os_feedback_dialog.h" + +#include "ash/webui/os_feedback_ui/url_constants.h" +#include "base/json/json_writer.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/webui/ash/system_web_dialog_delegate.h" + +namespace { + +// All Feedback Tool window will be a fixed 600px*640dp portal per +// specification. +constexpr int kDialogWidth = 600; +constexpr int kDialogHeight = 640; + +GURL GetUrl() { + return GURL{ash::kChromeUIOSFeedbackUrl}; +} + +} // namespace + +namespace ash { + +void OsFeedbackDialog::ShowDialog( + content::BrowserContext* context, + const extensions::api::feedback_private::FeedbackInfo& info, + gfx::NativeWindow parent) { + // If a dialog is opened, focus on it. + auto* existing_instance = + SystemWebDialogDelegate::FindInstance(GetUrl().spec()); + if (existing_instance) { + existing_instance->Focus(); + return; + } + + auto* dialog = new OsFeedbackDialog(info); + dialog->ShowSystemDialogForBrowserContext(context, parent); +} + +// Protected. +OsFeedbackDialog::OsFeedbackDialog( + const extensions::api::feedback_private::FeedbackInfo& info) + : SystemWebDialogDelegate(GetUrl(), + /* title=*/std::u16string()), + feedback_info_(info.ToValue()) {} + +OsFeedbackDialog::~OsFeedbackDialog() = default; + +// Private. +void OsFeedbackDialog::GetDialogSize(gfx::Size* size) const { + size->SetSize(::kDialogWidth, ::kDialogHeight); +} + +std::string OsFeedbackDialog::GetDialogArgs() const { + std::string data; + base::JSONWriter::Write(feedback_info_, &data); + return data; +} + +} // namespace ash
diff --git a/chrome/browser/ui/webui/ash/os_feedback_dialog.h b/chrome/browser/ui/webui/ash/os_feedback_dialog.h new file mode 100644 index 0000000..d75c8aa --- /dev/null +++ b/chrome/browser/ui/webui/ash/os_feedback_dialog.h
@@ -0,0 +1,43 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_OS_FEEDBACK_DIALOG_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_OS_FEEDBACK_DIALOG_H_ + +#include "chrome/browser/ui/webui/ash/system_web_dialog_delegate.h" +#include "extensions/common/api/feedback_private.h" + +namespace ash { + +class OsFeedbackDialog : public SystemWebDialogDelegate { + public: + // Shows a Feedback dialog using the specified BrowserContext (or Profile). + // If |parent| is not null, the dialog will be parented to |parent|. + // Otherwise it will be attached to either the AlwaysOnTop container or the + // LockSystemModal container, depending on the session state at creation. + static void ShowDialog( + content::BrowserContext* context, + const extensions::api::feedback_private::FeedbackInfo& info, + gfx::NativeWindow parent = nullptr); + + protected: + explicit OsFeedbackDialog( + const extensions::api::feedback_private::FeedbackInfo& info); + OsFeedbackDialog(const OsFeedbackDialog&) = delete; + OsFeedbackDialog& operator=(const OsFeedbackDialog&) = delete; + ~OsFeedbackDialog() override; + + private: + // SystemWebDialogDelegate: + void GetDialogSize(gfx::Size* size) const override; + std::string GetDialogArgs() const override; + + // Used to populate feedback context when launched from Dialog (eg. from login + // screen). + const base::Value::Dict feedback_info_; +}; + +} // namespace ash + +#endif // CHROME_BROWSER_UI_WEBUI_ASH_OS_FEEDBACK_DIALOG_H_
diff --git a/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc b/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc index 1b33e9183..8ba13257 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc
@@ -228,8 +228,6 @@ IDS_APP_MANAGEMENT_APP_DETAILS_APP_SIZE}, {"appManagementAppDetailsDataSize", IDS_APP_MANAGEMENT_APP_DETAILS_DATA_SIZE}, - {"appManagementAppDetailsTotalSize", - IDS_APP_MANAGEMENT_APP_DETAILS_TOTAL_SIZE}, {"appManagementAppInstalledByPolicyLabel", IDS_APP_MANAGEMENT_POLICY_APP_POLICY_STRING}, {"appManagementArcManagePermissionsLabel",
diff --git a/chrome/browser/ui/webui/ash/settings/pages/crostini/crostini_section.cc b/chrome/browser/ui/webui/ash/settings/pages/crostini/crostini_section.cc index b793675d..8e4f2e31 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/crostini/crostini_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/crostini/crostini_section.cc
@@ -257,11 +257,6 @@ !bruschetta::GetInstallableConfigs(profile).empty(); const bool bru_installed = !guest_os::GetContainers(profile, guest_os::VmType::BRUSCHETTA).empty(); - if (bru_enabled && !bru_installable) { - LOG(WARNING) - << "Bruschetta is enabled but has no installable configs. Installed = " - << bru_installed; - } return bru_enabled && (bru_installable || bru_installed); }
diff --git a/chrome/browser/ui/webui/hats/BUILD.gn b/chrome/browser/ui/webui/hats/BUILD.gn new file mode 100644 index 0000000..f84e4c83 --- /dev/null +++ b/chrome/browser/ui/webui/hats/BUILD.gn
@@ -0,0 +1,12 @@ +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD - style license that can be +# found in the LICENSE file. + +import("//mojo/public/tools/bindings/mojom.gni") + +mojom("mojo_bindings") { + sources = [ "hats.mojom" ] + public_deps = [ "//mojo/public/mojom/base" ] + webui_module_path = "/" + use_typescript_sources = true +}
diff --git a/chrome/browser/ui/webui/hats/OWNERS b/chrome/browser/ui/webui/hats/OWNERS index bbdb9fd..bc4fb2d 100644 --- a/chrome/browser/ui/webui/hats/OWNERS +++ b/chrome/browser/ui/webui/hats/OWNERS
@@ -1 +1,4 @@ file://chrome/browser/ui/hats/OWNERS + +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/chrome/browser/ui/webui/hats/hats.mojom b/chrome/browser/ui/webui/hats/hats.mojom new file mode 100644 index 0000000..4e51272 --- /dev/null +++ b/chrome/browser/ui/webui/hats/hats.mojom
@@ -0,0 +1,24 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module hats.mojom; + +// Interface for setting up connection to allow calls between the hats web +// page and native code. +interface PageHandlerFactory { + // Called from hats page JS to set up native handler. + CreatePageHandler(pending_remote<Page> page, + pending_receiver<PageHandler> handler); +}; + +// Called from TS side of chrome-untrusted://hats (Renderer -> Browser) +interface PageHandler { + // Gets the API Key for Chrome HaTS. + GetApiKey() => (string api_key); + // TODO(https://crbug.com/1121586): Add OnSurveyLoaded and OnSurveyClosed. +}; + +// Called from C++ side of chrome-untrusted://hats. (Browser -> Renderer) +interface Page { +};
diff --git a/chrome/browser/ui/webui/hats/hats_page_handler.cc b/chrome/browser/ui/webui/hats/hats_page_handler.cc new file mode 100644 index 0000000..e7989f3 --- /dev/null +++ b/chrome/browser/ui/webui/hats/hats_page_handler.cc
@@ -0,0 +1,21 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/hats/hats_page_handler.h" + +#include <string> + +#include "google_apis/google_api_keys.h" + +HatsPageHandler::HatsPageHandler( + mojo::PendingReceiver<hats::mojom::PageHandler> receiver, + mojo::PendingRemote<hats::mojom::Page> page) + : receiver_(this, std::move(receiver)), page_(std::move(page)) {} + +HatsPageHandler::~HatsPageHandler() = default; + +// Triggered by getApiKey() call in TS; sends a response back to the renderer. +void HatsPageHandler::GetApiKey(GetApiKeyCallback callback) { + std::move(callback).Run(google_apis::GetHatsAPIKey()); +}
diff --git a/chrome/browser/ui/webui/hats/hats_page_handler.h b/chrome/browser/ui/webui/hats/hats_page_handler.h new file mode 100644 index 0000000..df69607 --- /dev/null +++ b/chrome/browser/ui/webui/hats/hats_page_handler.h
@@ -0,0 +1,30 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_HATS_HATS_PAGE_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_HATS_HATS_PAGE_HANDLER_H_ + +#include "chrome/browser/ui/webui/hats/hats.mojom.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "mojo/public/cpp/bindings/remote.h" + +class HatsPageHandler : public hats::mojom::PageHandler { + public: + HatsPageHandler(mojo::PendingReceiver<hats::mojom::PageHandler> receiver, + mojo::PendingRemote<hats::mojom::Page> page); + + HatsPageHandler(const HatsPageHandler&) = delete; + HatsPageHandler& operator=(const HatsPageHandler&) = delete; + + ~HatsPageHandler() override; + + // hats::mojom::PageHandler: + void GetApiKey(GetApiKeyCallback callback) override; + + private: + mojo::Receiver<hats::mojom::PageHandler> receiver_; + mojo::Remote<hats::mojom::Page> page_; +}; + +#endif // CHROME_BROWSER_UI_WEBUI_HATS_HATS_PAGE_HANDLER_H_
diff --git a/chrome/browser/ui/webui/hats/hats_ui.cc b/chrome/browser/ui/webui/hats/hats_ui.cc index 4dfb8b5..c350893 100644 --- a/chrome/browser/ui/webui/hats/hats_ui.cc +++ b/chrome/browser/ui/webui/hats/hats_ui.cc
@@ -12,7 +12,6 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_data_source.h" -#include "google_apis/google_api_keys.h" HatsUIConfig::HatsUIConfig() : WebUIConfig(content::kChromeUIUntrustedScheme, @@ -38,7 +37,6 @@ source, base::make_span(kHatsResources, kHatsResourcesSize), IDR_HATS_HATS_HTML); - source->AddString("hatsApiKey", google_apis::GetHatsAPIKey()); source->OverrideContentSecurityPolicy( network::mojom::CSPDirectiveName::ScriptSrc, "script-src " @@ -80,4 +78,19 @@ source->DisableTrustedTypesCSP(); } +HatsUI::~HatsUI() = default; + +void HatsUI::BindInterface( + mojo::PendingReceiver<hats::mojom::PageHandlerFactory> receiver) { + page_factory_receiver_.reset(); + page_factory_receiver_.Bind(std::move(receiver)); +} + +void HatsUI::CreatePageHandler( + mojo::PendingRemote<hats::mojom::Page> page, + mojo::PendingReceiver<hats::mojom::PageHandler> receiver) { + page_handler_ = + std::make_unique<HatsPageHandler>(std::move(receiver), std::move(page)); +} + WEB_UI_CONTROLLER_TYPE_IMPL(HatsUI)
diff --git a/chrome/browser/ui/webui/hats/hats_ui.h b/chrome/browser/ui/webui/hats/hats_ui.h index 95bca34..ad620e4 100644 --- a/chrome/browser/ui/webui/hats/hats_ui.h +++ b/chrome/browser/ui/webui/hats/hats_ui.h
@@ -5,7 +5,12 @@ #ifndef CHROME_BROWSER_UI_WEBUI_HATS_HATS_UI_H_ #define CHROME_BROWSER_UI_WEBUI_HATS_HATS_UI_H_ +#include "chrome/browser/ui/webui/hats/hats.mojom.h" +#include "chrome/browser/ui/webui/hats/hats_page_handler.h" #include "content/public/browser/webui_config.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" #include "ui/webui/untrusted_web_ui_controller.h" // The configuration for the chrome-untrusted://hats page. @@ -21,16 +26,30 @@ const GURL& url) override; }; -class HatsUI : public ui::UntrustedWebUIController { +class HatsPageHandler; + +class HatsUI : public ui::UntrustedWebUIController, + public hats::mojom::PageHandlerFactory { public: explicit HatsUI(content::WebUI* web_ui); HatsUI(const HatsUI&) = delete; HatsUI& operator=(const HatsUI&) = delete; + ~HatsUI() override; - ~HatsUI() override = default; + void BindInterface( + mojo::PendingReceiver<hats::mojom::PageHandlerFactory> receiver); private: + // hats::mojom::PageHandlerFactory: + void CreatePageHandler( + mojo::PendingRemote<hats::mojom::Page> page, + mojo::PendingReceiver<hats::mojom::PageHandler> receiver) override; + + std::unique_ptr<HatsPageHandler> page_handler_; + + mojo::Receiver<hats::mojom::PageHandlerFactory> page_factory_receiver_{this}; + WEB_UI_CONTROLLER_TYPE_DECL(); };
diff --git a/chrome/browser/ui/webui/password_manager/password_manager_ui.cc b/chrome/browser/ui/webui/password_manager/password_manager_ui.cc index 20dcd96..69c93c9 100644 --- a/chrome/browser/ui/webui/password_manager/password_manager_ui.cc +++ b/chrome/browser/ui/webui/password_manager/password_manager_ui.cc
@@ -394,11 +394,17 @@ base::ASCIIToUTF16(chrome::kPasswordManagerLearnMoreURL))); source->AddString( - "sharePasswordNoMembersDescription", + "sharePasswordNotFamilyMember", l10n_util::GetStringFUTF16( - IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NO_MEMBERS_DESCRIPTION, + IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NOT_FAMILY_MEMBER, base::ASCIIToUTF16(chrome::kFamilyGroupCreateURL))); + source->AddString( + "sharePasswordNoOtherFamilyMembers", + l10n_util::GetStringFUTF16( + IDS_PASSWORD_MANAGER_UI_SHARE_PASSWORD_NO_OTHER_FAMILY_MEMBERS, + base::ASCIIToUTF16(chrome::kFamilyGroupViewURL))); + source->AddString("familyGroupViewURL", chrome::kFamilyGroupViewURL); source->AddString(
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index 1e12854c9..1a7a846 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1695340775-2dfbe8317bd966d1a196657ea9feaa47de2c3393.profdata +chrome-android32-main-1695362254-43d85d483bd3b3d7129418dab15ecdade515883c.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index 21bceed..dd460e8 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1695340775-a286389b96ea44d9a59a07e7678456e2ea7e754e.profdata +chrome-android64-main-1695362254-484d5e94ee7ad2c0cddbfa77ca6c0208684bc445.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index d42722d5..5b4fd42 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1695340775-042c565722b57376544839262f8c8ab07fd5d48e.profdata +chrome-linux-main-1695362254-0fdb279be1883b226df81f2b23e06b494349f1c6.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index c60d2d8a..99c5003 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1695340775-5bab9f15bcc5d00073aeacab62843abfddeba0e6.profdata +chrome-mac-arm-main-1695369587-7985a3de3565d3c74ecb36397725ee84f2a7d54d.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 0fe0fd4..62c52c39 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1695340775-d1c7622d633a56dfa57bf5ca3ecfcfdcf55302a0.profdata +chrome-mac-main-1695362254-d76010064debd5607accfc85fe8fa91525a051cc.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index fd395af..3812816 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1695329968-169c58ddc574f346430455bf98d727b5ad342d1c.profdata +chrome-win32-main-1695351285-666dd7019fafc47bab5904a388dbe617bd09ae81.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 271c07f..4811e47c 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1695329968-8f1b3b30ea236dc96e2ebf8737c58fb5aeab7a23.profdata +chrome-win64-main-1695351285-2ecf106ec8b687d9eda167430e331092a92a2737.profdata
diff --git a/chrome/credential_provider/gaiacp/device_policies_manager_unittests.cc b/chrome/credential_provider/gaiacp/device_policies_manager_unittests.cc index b0bd17ec..8cc505e 100644 --- a/chrome/credential_provider/gaiacp/device_policies_manager_unittests.cc +++ b/chrome/credential_provider/gaiacp/device_policies_manager_unittests.cc
@@ -4,10 +4,10 @@ #include <windows.h> -#include "base/strings/string_number_conversions.h" +#include "base/strings/strcat_win.h" +#include "base/strings/string_number_conversions_win.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "chrome/credential_provider/gaiacp/device_policies_manager.h" #include "chrome/credential_provider/gaiacp/gcpw_strings.h" @@ -49,9 +49,10 @@ const size_t num_users_needed = 3; for (size_t i = 0; i < num_users_needed; ++i) { CComBSTR sid_str; - std::wstring username = L"new-user-" + base::NumberToWString(i); - std::wstring gaia_id = L"gaia-id-" + base::NumberToWString(i); - std::wstring email = base::StringPrintf(L"user_%d@company.com", i); + const std::wstring i_str = base::NumberToWString(i); + std::wstring username = L"new-user-" + i_str; + std::wstring gaia_id = L"gaia-id-" + i_str; + std::wstring email = base::StrCat({L"user_", i_str, L"@company.com"}); ASSERT_EQ(S_OK, fake_os_user_manager()->CreateTestOSUser( username, L"password", L"Full Name", L"comment", gaia_id, email, &sid_str)); @@ -60,8 +61,8 @@ // Create an existing user association in registry but with an invalid sid. base::win::RegKey key; - std::wstring key_name = base::StringPrintf(L"%ls\\%ls", kGcpUsersRootKeyName, - L"non-existent-user-sid"); + std::wstring key_name = + std::wstring(kGcpUsersRootKeyName) + L"\\non-existent-user-sid"; ASSERT_EQ(ERROR_SUCCESS, key.Create(HKEY_LOCAL_MACHINE, key_name.c_str(), KEY_WRITE)); ASSERT_EQ(ERROR_SUCCESS,
diff --git a/chrome/credential_provider/gaiacp/gcp_utils.cc b/chrome/credential_provider/gaiacp/gcp_utils.cc index 6d4d26172..9c24792 100644 --- a/chrome/credential_provider/gaiacp/gcp_utils.cc +++ b/chrome/credential_provider/gaiacp/gcp_utils.cc
@@ -35,6 +35,7 @@ #include "base/json/json_writer.h" #include "base/no_destructor.h" #include "base/path_service.h" +#include "base/strings/strcat_win.h" #include "base/strings/string_number_conversions_win.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" @@ -731,8 +732,7 @@ return hr; } - *entrypoint_arg = - std::wstring(base::StringPrintf(L"\"%ls\",%ls", short_path, entrypoint)); + *entrypoint_arg = base::StrCat({L"\"", short_path, L"\",", entrypoint}); // In tests, the current module is the unittest exe, not the real dll. // The unittest exe does not expose entrypoints, so return S_FALSE as a hint
diff --git a/chrome/credential_provider/gaiacp/gcp_utils_unittests.cc b/chrome/credential_provider/gaiacp/gcp_utils_unittests.cc index 8cc9f2c..5f1ac52 100644 --- a/chrome/credential_provider/gaiacp/gcp_utils_unittests.cc +++ b/chrome/credential_provider/gaiacp/gcp_utils_unittests.cc
@@ -5,7 +5,7 @@ #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/process/launch.h" -#include "base/strings/stringprintf.h" +#include "base/strings/strcat_win.h" #include "base/strings/utf_string_conversions.h" #include "base/test/test_reg_util_win.h" #include "base/values.h" @@ -441,7 +441,7 @@ ASSERT_LT(0u, GetShortPathName(path, short_path, std::size(short_path))); std::wstring expected_arg = - base::StringPrintf(L"\"%ls\",%ls", short_path, L"entrypoint"); + base::StrCat({L"\"", short_path, L"\",entrypoint"}); ASSERT_EQ(1u, command_line.GetArgs().size()); ASSERT_EQ(expected_arg, command_line.GetArgs()[0]); @@ -497,56 +497,39 @@ const char* username = std::get<4>(GetParam()); const char* domain = std::get<5>(GetParam()); const char* serial_number = std::get<6>(GetParam()); - std::wstring serial_number16 = - base::UTF8ToWide(base::StringPrintf("%s", serial_number)); const char* machine_guid = std::get<7>(GetParam()); - std::wstring machine_guid16 = - base::UTF8ToWide(base::StringPrintf("%s", machine_guid)); const char* is_user_ad_joined = std::get<8>(GetParam()); const char* device_resource_id = std::get<9>(GetParam()); FakeOSUserManager fake_os_user_manager; - bool should_succeed = (email && email[0]) && (id_token && id_token[0]) && - (access_token && access_token[0]) && (sid && sid[0]) && - (username && username[0]) && (domain && domain[0]) && - (machine_guid && machine_guid[0]) && - (serial_number && serial_number[0]) && - (is_user_ad_joined && is_user_ad_joined[0]); + const auto has = [](const char* param) { return param && param[0]; }; + bool should_succeed = has(email) && has(id_token) && has(access_token) && + has(sid) && has(username) && has(domain) && + has(serial_number) && has(machine_guid) && + has(is_user_ad_joined); base::Value::Dict properties; - if (email) - properties.Set(kKeyEmail, email); - if (id_token) - properties.Set(kKeyMdmIdToken, id_token); - if (access_token) - properties.Set(kKeyAccessToken, access_token); - if (sid) - properties.Set(kKeySID, sid); - if (username) - properties.Set(kKeyUsername, username); - if (domain) - properties.Set(kKeyDomain, domain); - if (sid) - properties.Set(kKeySID, sid); - if (is_user_ad_joined) - properties.Set(kKeyIsAdJoinedUser, is_user_ad_joined); - - SetMachineGuidForTesting(machine_guid16); - GoogleRegistrationDataForTesting g_registration_data(serial_number16); - - if (device_resource_id) { - std::wstring sid16 = base::UTF8ToWide(base::StringPrintf("%s", sid)); - HRESULT hr = SetUserProperty(sid16, kRegUserDeviceResourceId, - base::UTF8ToWide(device_resource_id)); - EXPECT_TRUE(SUCCEEDED(hr)); - } + const auto set_property = [&](base::StringPiece key, const char* value) { + if (value) { + properties.Set(key, value); + } + }; + set_property(kKeyEmail, email); + set_property(kKeyMdmIdToken, id_token); + set_property(kKeyAccessToken, access_token); + set_property(kKeySID, sid); + set_property(kKeyUsername, username); + set_property(kKeyDomain, domain); + GoogleRegistrationDataForTesting g_registration_data( + base::UTF8ToWide(serial_number)); + SetMachineGuidForTesting(base::UTF8ToWide(machine_guid)); + set_property(kKeyIsAdJoinedUser, is_user_ad_joined); + EXPECT_TRUE( + SUCCEEDED(SetUserProperty(base::UTF8ToWide(sid), kRegUserDeviceResourceId, + base::UTF8ToWide(device_resource_id)))); // EnrollToGoogleMdmIfNeeded() should fail if any field is missing. - if (should_succeed) { - ASSERT_EQ(S_OK, EnrollToGoogleMdmIfNeeded(properties)); - } else { - ASSERT_NE(S_OK, EnrollToGoogleMdmIfNeeded(properties)); - } + EXPECT_EQ(should_succeed, EnrollToGoogleMdmIfNeeded(properties) == S_OK); } INSTANTIATE_TEST_SUITE_P( @@ -555,7 +538,7 @@ ::testing::Combine(::testing::Values("foo@gmail.com", "", nullptr), ::testing::Values("id_token", "", nullptr), ::testing::Values("access_token", "", nullptr), - ::testing::Values("sid", "", nullptr), + ::testing::Values("sid", ""), ::testing::Values("username", "", nullptr), ::testing::Values("domain", "", nullptr), ::testing::Values("serial_number"),
diff --git a/chrome/credential_provider/gaiacp/os_process_manager.cc b/chrome/credential_provider/gaiacp/os_process_manager.cc index 26b3b5c4..dead8184 100644 --- a/chrome/credential_provider/gaiacp/os_process_manager.cc +++ b/chrome/credential_provider/gaiacp/os_process_manager.cc
@@ -28,7 +28,7 @@ #include "base/files/file_path.h" #include "base/process/launch.h" #include "base/scoped_native_library.h" -#include "base/strings/stringprintf.h" +#include "base/strings/strcat_win.h" #include "base/strings/utf_string_conversions.h" #include "base/win/registry.h" #include "base/win/scoped_process_information.h" @@ -475,9 +475,8 @@ // code. However this function is called to execute rundll32 which parses // command lines in a special way and fails when the first arg is double // quoted. Therefore the command line is built manually here. - std::wstring unquoted_cmdline; - base::StringAppendF(&unquoted_cmdline, L"\"%ls\"", - command_line.GetProgram().value().c_str()); + std::wstring unquoted_cmdline = + base::StrCat({L"\"", command_line.GetProgram().value(), L"\""}); for (const auto& arg : command_line.GetArgs()) { unquoted_cmdline.append(FILE_PATH_LITERAL(" ")); unquoted_cmdline.append(arg);
diff --git a/chrome/credential_provider/gaiacp/os_user_manager.cc b/chrome/credential_provider/gaiacp/os_user_manager.cc index 0fd6642..033cabc59 100644 --- a/chrome/credential_provider/gaiacp/os_user_manager.cc +++ b/chrome/credential_provider/gaiacp/os_user_manager.cc
@@ -22,7 +22,6 @@ #include "base/files/file_util.h" #include "base/scoped_native_library.h" #include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/win/registry.h" #include "base/win/win_util.h" @@ -379,14 +378,11 @@ flags_changed = true; } - std::wstring password_domain = base::StringPrintf(L"%ls", domain); - - NET_API_STATUS changepassword_nsts = ::NetUserChangePassword( - password_domain.c_str(), username, old_password, new_password); + NET_API_STATUS changepassword_nsts = + ::NetUserChangePassword(domain, username, old_password, new_password); if (changepassword_nsts != NERR_Success) { LOGFN(ERROR) << "Unable to change password for '" << username - << "' domain '" << password_domain - << "' nsts=" << changepassword_nsts; + << "' domain '" << domain << "' nsts=" << changepassword_nsts; } if (flags_changed) {
diff --git a/chrome/credential_provider/gaiacp/reg_utils.cc b/chrome/credential_provider/gaiacp/reg_utils.cc index 1f26b6c..4fdb8a8a 100644 --- a/chrome/credential_provider/gaiacp/reg_utils.cc +++ b/chrome/credential_provider/gaiacp/reg_utils.cc
@@ -5,7 +5,8 @@ #include "chrome/credential_provider/gaiacp/reg_utils.h" #include "base/base64.h" -#include "base/strings/stringprintf.h" +#include "base/strings/strcat_win.h" +#include "base/strings/string_number_conversions_win.h" #include "base/strings/utf_string_conversions.h" #include "base/win/atl.h" #include "base/win/registry.h" @@ -110,12 +111,11 @@ } std::wstring GetImageRegKeyForSpecificSize(int image_size) { - return base::StringPrintf(L"%ls%i", kImageRegKey, image_size); + return kImageRegKey + base::NumberToWString(image_size); } std::wstring GetAccountPictureRegPathForUSer(const std::wstring& user_sid) { - return base::StringPrintf(L"%ls\\%ls", kAccountPicturesRootRegKey, - user_sid.c_str()); + return base::StrCat({kAccountPicturesRootRegKey, L"\\", user_sid}); } } // namespace
diff --git a/chrome/credential_provider/gaiacp/scoped_user_profile.cc b/chrome/credential_provider/gaiacp/scoped_user_profile.cc index a279a11..94c0320 100644 --- a/chrome/credential_provider/gaiacp/scoped_user_profile.cc +++ b/chrome/credential_provider/gaiacp/scoped_user_profile.cc
@@ -21,6 +21,7 @@ #include "base/files/file_util.h" #include "base/functional/bind.h" #include "base/functional/callback.h" +#include "base/strings/strcat_win.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" @@ -106,8 +107,9 @@ const base::FilePath& account_picture_path, int size, const std::wstring& picture_extension) { - return account_picture_path.Append(base::StringPrintf( - L"GoogleAccountPicture_%i%ls", size, picture_extension.c_str())); + return account_picture_path.Append( + base::StrCat({L"GoogleAccountPicture_", base::NumberToWString(size), + picture_extension})); } using ImageProcessor =
diff --git a/chrome/credential_provider/gaiacp/win_http_url_fetcher.cc b/chrome/credential_provider/gaiacp/win_http_url_fetcher.cc index f4d471b2..6f4b6819 100644 --- a/chrome/credential_provider/gaiacp/win_http_url_fetcher.cc +++ b/chrome/credential_provider/gaiacp/win_http_url_fetcher.cc
@@ -18,8 +18,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/memory/ptr_util.h" -#include "base/strings/strcat.h" -#include "base/strings/stringprintf.h" +#include "base/strings/strcat_win.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/lock.h" #include "base/time/time.h" @@ -348,7 +347,7 @@ for (const auto& kv : request_headers_) { const wchar_t* key = A2CW(kv.first.c_str()); const wchar_t* value = A2CW(kv.second.c_str()); - std::wstring header = base::StringPrintf(L"%ls: %ls", key, value); + std::wstring header = base::StrCat({key, L": ", value}); if (!::WinHttpAddRequestHeaders( request_.Get(), header.c_str(), header.length(), WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE)) {
diff --git a/chrome/credential_provider/test/gcp_setup_unittests.cc b/chrome/credential_provider/test/gcp_setup_unittests.cc index 84d6340..70bb94c 100644 --- a/chrome/credential_provider/test/gcp_setup_unittests.cc +++ b/chrome/credential_provider/test/gcp_setup_unittests.cc
@@ -22,9 +22,9 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/process/launch.h" +#include "base/strings/strcat_win.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/syslog_logging.h" #include "base/test/scoped_path_override.h" @@ -280,7 +280,7 @@ // Make sure COM object is registered. std::wstring register_key_path = - base::StringPrintf(L"CLSID\\%ls\\InprocServer32", guid_string.c_str()); + base::StrCat({L"CLSID\\", guid_string, L"\\InprocServer32"}); base::win::RegKey clsid_key(HKEY_CLASSES_ROOT, register_key_path.c_str(), KEY_READ); EXPECT_EQ(registered, clsid_key.Valid()); @@ -293,10 +293,10 @@ EXPECT_EQ(path.value(), value); } - std::wstring cp_key_path = base::StringPrintf( - L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\" - L"Authentication\\Credential Providers\\%ls", - guid_string.c_str()); + std::wstring cp_key_path = + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Authentication\\" + L"Credential Providers\\" + + guid_string; // Make sure credential provider is registered. base::win::RegKey cp_key(HKEY_LOCAL_MACHINE, cp_key_path.c_str(), KEY_READ);
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 3d5456b..b8bd8b8 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -6587,11 +6587,11 @@ "//components/page_load_metrics/common:test_support", "//components/paint_preview/common/mojom", "//components/password_manager/content/browser", - "//components/password_manager/core/browser:import_results", "//components/password_manager/core/browser:test_support", "//components/password_manager/core/browser/export", "//components/password_manager/core/browser/features:password_features", "//components/password_manager/core/browser/import:csv", + "//components/password_manager/core/browser/import:importer", "//components/payments/content", "//components/payments/content:test_support", "//components/payments/content:utils",
diff --git a/chrome/test/chromedriver/js/call_function.js b/chrome/test/chromedriver/js/call_function.js index 2fc17dc6..24a3a728 100644 --- a/chrome/test/chromedriver/js/call_function.js +++ b/chrome/test/chromedriver/js/call_function.js
@@ -124,7 +124,7 @@ const Symbol = window.cdc_adoQpoasnfa76pfcZLmcfl_Symbol || window.Symbol; return (typeof value[Symbol.iterator] === 'function') && ('length' in value) && - (typeof value['length'] === 'number'); + (typeof value.length === 'number'); } /**
diff --git a/chrome/test/data/webui/chromeos/os_feedback_ui/feedback_flow_test.js b/chrome/test/data/webui/chromeos/os_feedback_ui/feedback_flow_test.js index 0e4d78f..237ea31 100644 --- a/chrome/test/data/webui/chromeos/os_feedback_ui/feedback_flow_test.js +++ b/chrome/test/data/webui/chromeos/os_feedback_ui/feedback_flow_test.js
@@ -1198,4 +1198,97 @@ window.removeEventListener('message', testMessageListener); }); + + // Test that when dialog args is present, it will be used to populate the + // feedback context. + test('Create_feedback_context_from_dialogArguments_if_present', async () => { + // Save the original chrome.getVariableValue function. + const chromeGetVariableValue = chrome.getVariableValue; + // Mock the chrome.getVariableValue to return dialogArguments. + const mockChromeGetVariableValue = (message) => { + if (message === 'dialogArguments') { + return '{' + + '"autofillMetadata":{"fake key1": "fake value1"},' + + '"categoryTag":"Login",' + + '"description":"fake description",' + + '"descriptionPlaceholder":"fake description placeholder",' + + '"fromAssistant": true, ' + + '"fromAutofill": true, ' + + '"pageUrl":"chrome://flags/",' + + '"systemInformation":[' + + ' {' + + ' "key": "EXTRA_DIAGNOSTICS",' + + ' "value": "fake extra log data"' + + ' }' + + ']' + + '}'; + } + return '{}'; + }; + chrome.getVariableValue = mockChromeGetVariableValue; + + await initializePage(); + + const feedbackContext = getFeedbackContext_(); + assertEquals('Login', feedbackContext.categoryTag); + assertEquals('fake extra log data', feedbackContext.extraDiagnostics); + assertEquals('chrome://flags/', feedbackContext.pageUrl.url); + assertEquals( + '{"fake key1":"fake value1"}', feedbackContext.autofillMetadata); + assertTrue(feedbackContext.fromAssistant); + assertTrue(feedbackContext.fromAutofill); + + assertEquals('fake description', page.getDescriptionTemplateForTesting()); + assertEquals( + 'fake description placeholder', + page.getDescriptionPlaceholderTextForTesting()); + + // Restore chrome.getVariableValue. + chrome.getVariableValue = chromeGetVariableValue; + // Verify that the getFeedbackContext is not called. + assertEquals(0, feedbackServiceProvider.getFeedbackContextCallCount()); + }); + + // Test that when dialog args is present, it will be used to populate the + // feedback context. Most info are empty or with default values. + test( + 'Create_feedback_context_from_dialogArguments_if_present_empty', + async () => { + // Save the original chrome.getVariableValue function. + const chromeGetVariableValue = chrome.getVariableValue; + // Mock the chrome.getVariableValue to return dialogArguments. + const mockChromeGetVariableValue = (message) => { + if (message === 'dialogArguments') { + return '{' + + '"autofillMetadata":{},' + + '"categoryTag":"",' + + '"fromAssistant": false, ' + + '"fromAutofill": false, ' + + '"pageUrl":"",' + + '"systemInformation":[]' + + '}'; + } + return '{}'; + }; + chrome.getVariableValue = mockChromeGetVariableValue; + + await initializePage(); + + const feedbackContext = getFeedbackContext_(); + assertTrue(!feedbackContext.categoryTag); + assertTrue(!feedbackContext.extraDiagnostics); + assertTrue(!feedbackContext.pageUrl.url); + assertEquals('{}', feedbackContext.autofillMetadata); + assertFalse(feedbackContext.fromAssistant); + assertFalse(feedbackContext.fromAutofill); + + assertTrue(!page.getDescriptionTemplateForTesting()); + assertTrue(!page.getDescriptionPlaceholderTextForTesting()); + + // Restore chrome.getVariableValue. + chrome.getVariableValue = chromeGetVariableValue; + + // Verify that the getFeedbackContext is not called. + assertEquals(0, feedbackServiceProvider.getFeedbackContextCallCount()); + }); }
diff --git a/chrome/test/data/webui/chromeos/os_feedback_ui/share_data_page_test.js b/chrome/test/data/webui/chromeos/os_feedback_ui/share_data_page_test.js index 38605428..ebafd3a0 100644 --- a/chrome/test/data/webui/chromeos/os_feedback_ui/share_data_page_test.js +++ b/chrome/test/data/webui/chromeos/os_feedback_ui/share_data_page_test.js
@@ -11,8 +11,8 @@ import {FeedbackAppPreSubmitAction, FeedbackContext} from 'chrome://os-feedback/feedback_types.js'; import {setFeedbackServiceProviderForTesting} from 'chrome://os-feedback/mojo_interface_provider.js'; import {ShareDataPageElement} from 'chrome://os-feedback/share_data_page.js'; -import {mojoString16ToString, stringToMojoString16} from 'chrome://resources/ash/common/mojo_utils.js'; import {getDeepActiveElement} from 'chrome://resources/ash/common/util.js'; +import {mojoString16ToString, stringToMojoString16} from 'chrome://resources/js/mojo_type_util.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertArrayEquals, assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js'; import {flushTasks} from 'chrome://webui-test/polymer_test_util.js';
diff --git a/chrome/test/data/webui/password_manager/share_password_flow_test.ts b/chrome/test/data/webui/password_manager/share_password_flow_test.ts index 79a812c..93d38246 100644 --- a/chrome/test/data/webui/password_manager/share_password_flow_test.ts +++ b/chrome/test/data/webui/password_manager/share_password_flow_test.ts
@@ -11,7 +11,7 @@ import {eventToPromise, isVisible} from 'chrome://webui-test/test_util.js'; import {TestPasswordManagerProxy} from './test_password_manager_proxy.js'; -import {makeFamilyFetchResults} from './test_util.js'; +import {makeFamilyFetchResults, makeRecipientInfo} from './test_util.js'; const SITE = 'test.com'; @@ -103,7 +103,27 @@ await shareFlowDone; }); - test('Has correct no members state', async function() { + test('Has correct no other members state', async function() { + passwordManager.data.familyFetchResults = makeFamilyFetchResults( + chrome.passwordsPrivate.FamilyFetchStatus.SUCCESS, /*members=*/[]); + const shareElement = startPasswordShare(); + await passwordManager.whenCalled('fetchFamilyMembers'); + await flushTasks(); + + const dialog = shareElement.shadowRoot!.querySelector( + 'share-password-no-other-family-members-dialog'); + assertTrue(!!dialog); + + assertVisibleTextContent( + dialog.$.header, shareElement.i18n('shareDialogTitle', SITE)); + assertVisibleTextContent( + dialog.$.description, + shareElement.i18n('sharePasswordNoOtherFamilyMembers')); + assertVisibleTextContent( + dialog.$.action, shareElement.i18n('sharePasswordGotIt')); + }); + + test('Has correct not a family member state', async function() { passwordManager.data.familyFetchResults = makeFamilyFetchResults( chrome.passwordsPrivate.FamilyFetchStatus.NO_MEMBERS); const shareElement = startPasswordShare(); @@ -111,19 +131,19 @@ await flushTasks(); const dialog = shareElement.shadowRoot!.querySelector( - 'share-password-no-members-dialog'); + 'share-password-not-family-member-dialog'); assertTrue(!!dialog); assertVisibleTextContent( dialog.$.header, shareElement.i18n('shareDialogTitle', SITE)); assertVisibleTextContent( dialog.$.description, - shareElement.i18n('sharePasswordNoMembersDescription')); + shareElement.i18n('sharePasswordNotFamilyMember')); assertVisibleTextContent( dialog.$.action, shareElement.i18n('sharePasswordGotIt')); }); - test('Action button should hide the no members dialog', async function() { + test('Action button should hide not family member dialog', async function() { passwordManager.data.familyFetchResults = makeFamilyFetchResults( chrome.passwordsPrivate.FamilyFetchStatus.NO_MEMBERS); const shareElement = startPasswordShare(); @@ -133,7 +153,25 @@ const shareFlowDone = eventToPromise('share-flow-done', shareElement); const dialog = shareElement.shadowRoot!.querySelector( - 'share-password-no-members-dialog'); + 'share-password-not-family-member-dialog'); + assertTrue(!!dialog); + dialog.$.action.click(); + await flushTasks(); + + await shareFlowDone; + }); + + test('Action button should hide no other members dialog', async function() { + passwordManager.data.familyFetchResults = makeFamilyFetchResults( + chrome.passwordsPrivate.FamilyFetchStatus.SUCCESS, /*members=*/[]); + const shareElement = startPasswordShare(); + await passwordManager.whenCalled('fetchFamilyMembers'); + await flushTasks(); + + const shareFlowDone = eventToPromise('share-flow-done', shareElement); + + const dialog = shareElement.shadowRoot!.querySelector( + 'share-password-no-other-family-members-dialog'); assertTrue(!!dialog); dialog.$.action.click(); await flushTasks(); @@ -143,7 +181,8 @@ test('Cancel button should hide family picker dialog', async function() { passwordManager.data.familyFetchResults = makeFamilyFetchResults( - chrome.passwordsPrivate.FamilyFetchStatus.SUCCESS); + chrome.passwordsPrivate.FamilyFetchStatus.SUCCESS, + /*members=*/[makeRecipientInfo()]); const shareElement = startPasswordShare(); await passwordManager.whenCalled('fetchFamilyMembers'); await flushTasks();
diff --git a/chrome/test/data/webui/settings/chromeos/os_apps_page/app_management_page/app_details_item_test.ts b/chrome/test/data/webui/settings/chromeos/os_apps_page/app_management_page/app_details_item_test.ts index a3f0c10..4c54d52 100644 --- a/chrome/test/data/webui/settings/chromeos/os_apps_page/app_management_page/app_details_item_test.ts +++ b/chrome/test/data/webui/settings/chromeos/os_apps_page/app_management_page/app_details_item_test.ts
@@ -131,14 +131,13 @@ appSize: '17 MB', }); - const shortSize = appDetailsItem.shadowRoot!.querySelector('#shortSize'); + const appSize = appDetailsItem.shadowRoot!.querySelector('#appSize'); - assertNull(appDetailsItem.shadowRoot!.querySelector('#storageTitle')); - assertNull(appDetailsItem.shadowRoot!.querySelector('#appSize')); + assertTrue(!!appDetailsItem.shadowRoot!.querySelector('#storageTitle')); + assertTrue(!!appSize); assertNull(appDetailsItem.shadowRoot!.querySelector('#dataSize')); - assertTrue(!!shortSize); - assertEquals('Size: 17 MB', shortSize.textContent!.trim()); + assertEquals('App size: 17 MB', appSize.textContent!.trim()); }); test('Android App from play store', async () => {
diff --git a/chromeos/ash/components/language_packs/handwriting.cc b/chromeos/ash/components/language_packs/handwriting.cc index c48375f..1465e7b 100644 --- a/chromeos/ash/components/language_packs/handwriting.cc +++ b/chromeos/ash/components/language_packs/handwriting.cc
@@ -84,17 +84,18 @@ return DlcToHandwritingLocale(dlc_id).has_value(); } -base::flat_set<std::string> FilterHandwritingDlcsWithContent( +base::flat_set<std::string> ConvertDlcsWithContentToHandwritingLocales( const dlcservice::DlcsWithContent& dlcs_with_content) { - std::vector<std::string> dlc_ids; + std::vector<std::string> dlc_locales; for (const auto& dlc_info : dlcs_with_content.dlc_infos()) { - if (IsHandwritingDlc(dlc_info.id())) { - dlc_ids.push_back(dlc_info.id()); + const auto& locale = DlcToHandwritingLocale(dlc_info.id()); + if (locale.has_value()) { + dlc_locales.push_back(*locale); } } - return dlc_ids; + return dlc_locales; } base::flat_set<std::string> GetHandwritingLocalesFromEnabledInputMethods(
diff --git a/chromeos/ash/components/language_packs/handwriting.h b/chromeos/ash/components/language_packs/handwriting.h index 4f65eeef..54f966a 100644 --- a/chromeos/ash/components/language_packs/handwriting.h +++ b/chromeos/ash/components/language_packs/handwriting.h
@@ -55,10 +55,10 @@ bool IsHandwritingDlc(std::string_view dlc_id); // Given a DlcsWithContent proto message, filters out all DLCs that are not -// Handwriting and returns a list with the dlc IDs. +// Handwriting and returns a list with the corresponding locales. // DlcsWithContent is returned by DLC Service in the callback to get all the // existing DLCs on device. -base::flat_set<std::string> FilterHandwritingDlcsWithContent( +base::flat_set<std::string> ConvertDlcsWithContentToHandwritingLocales( const dlcservice::DlcsWithContent& dlcs_with_content); // Returns the list of handwriting locales that correspond to the input methods
diff --git a/chromeos/ash/components/language_packs/handwriting_unittest.cc b/chromeos/ash/components/language_packs/handwriting_unittest.cc index 062969d0..7c70ddf 100644 --- a/chromeos/ash/components/language_packs/handwriting_unittest.cc +++ b/chromeos/ash/components/language_packs/handwriting_unittest.cc
@@ -390,16 +390,18 @@ }); TEST_F(HandwritingTest, FilterHandwritingDlcsDefault) { - EXPECT_THAT(FilterHandwritingDlcsWithContent(dlcservice::DlcsWithContent()), - IsEmpty()); + EXPECT_THAT( + ConvertDlcsWithContentToHandwritingLocales(dlcservice::DlcsWithContent()), + IsEmpty()); } TEST_F(HandwritingTest, FilterHandwritingDlcsNotHandwriting) { const dlcservice::DlcsWithContent dlcs_without_handwriting = CreateDlcsWithContent({"tts-en-us", "grammar-it"}); - EXPECT_THAT(FilterHandwritingDlcsWithContent(dlcs_without_handwriting), - IsEmpty()); + EXPECT_THAT( + ConvertDlcsWithContentToHandwritingLocales(dlcs_without_handwriting), + IsEmpty()); } TEST_F(HandwritingTest, FilterHandwritingDlcsVariousEntries) { @@ -409,8 +411,9 @@ CreateDlcsWithContent({"handwriting-fr", "tts-en-us", "handwriting-it", "grammar-it", "handwriting-cy"}); - EXPECT_THAT(FilterHandwritingDlcsWithContent(dlcs_with_some_handwriting), - UnorderedElementsAre("handwriting-fr", "handwriting-it")); + EXPECT_THAT( + ConvertDlcsWithContentToHandwritingLocales(dlcs_with_some_handwriting), + UnorderedElementsAre("fr", "it")); } TEST_F(HandwritingTest, GetTargetLocalesEmpty) {
diff --git a/chromeos/ash/services/orca/public/mojom/orca_service.mojom b/chromeos/ash/services/orca/public/mojom/orca_service.mojom index 60bd6bc..9d92ec0 100644 --- a/chromeos/ash/services/orca/public/mojom/orca_service.mojom +++ b/chromeos/ash/services/orca/public/mojom/orca_service.mojom
@@ -6,7 +6,7 @@ // the Chromium repo. This file should be updated first, before syncing in the // other repos. -// Next MinVersion: 3 +// Next MinVersion: 4 module ash.orca.mojom; @@ -70,6 +70,12 @@ enum TextQueryErrorCode { [Default] kUnknown = 0, kInvalidArgument = 1, + [MinVersion=3] kResourceExhausted = 2, + [MinVersion=3] kBackendFailure = 3, + [MinVersion=3] kNoInternetConnection = 4, + [MinVersion=3] kUnsupportedLanguage = 5, + [MinVersion=3] kBlockedOutputs = 6, + [MinVersion=3] kRestrictedRegion = 7, }; // An error that occurred when processing a `TextQueryRequest`.
diff --git a/chromeos/components/sensors/BUILD.gn b/chromeos/components/sensors/BUILD.gn index 791a65b..efa1eef 100644 --- a/chromeos/components/sensors/BUILD.gn +++ b/chromeos/components/sensors/BUILD.gn
@@ -2,7 +2,17 @@ # 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("//build/config/chromeos/ui_mode.gni") +import("//chromeos/components/sensors/buildflags.gni") + +assert(is_chromeos, "Non-ChromeOS builds cannot depend on //chromeos") + +buildflag_header("buildflags") { + header = "buildflags.h" + + flags = [ "USE_IIOSERVICE=$use_iioservice" ] +} component("sensors") { output_name = "chromeos_sensors"
diff --git a/chromeos/components/sensors/buildflags.gni b/chromeos/components/sensors/buildflags.gni new file mode 100644 index 0000000..87cc77a --- /dev/null +++ b/chromeos/components/sensors/buildflags.gni
@@ -0,0 +1,8 @@ +# Copyright 2021 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + # Indicates if iioservice daemon is installed. + use_iioservice = false +}
diff --git a/chromeos/crosapi/mojom/editor_panel.mojom b/chromeos/crosapi/mojom/editor_panel.mojom index a67b7883..634286a 100644 --- a/chromeos/crosapi/mojom/editor_panel.mojom +++ b/chromeos/crosapi/mojom/editor_panel.mojom
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Next MinVersion: 2 + module crosapi.mojom; [Stable, Extensible] @@ -21,6 +23,11 @@ [Stable, Extensible] enum EditorPanelPresetQueryCategory { [Default] kUnknown = 0, + [MinVersion=1] kShorten = 1, + [MinVersion=1] kElaborate = 2, + [MinVersion=1] kRephrase = 3, + [MinVersion=1] kFormalize = 4, + [MinVersion=1] kEmojify = 5, }; [Stable]
diff --git a/chromeos/profiles/arm.afdo.newest.txt b/chromeos/profiles/arm.afdo.newest.txt index 1a0e3de..5452048 100644 --- a/chromeos/profiles/arm.afdo.newest.txt +++ b/chromeos/profiles/arm.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-none-118-5978.0-1695037821-benchmark-119.0.6020.0-r2-redacted.afdo.xz +chromeos-chrome-arm-none-118-5978.0-1695037821-benchmark-119.0.6021.0-r1-redacted.afdo.xz
diff --git a/clank b/clank index bf36310..8b7017c 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit bf36310ed848cc85ee85bfc723a3700bed22f392 +Subproject commit 8b7017c9d33cc541ad3023f49a2e78e816e86434
diff --git a/components/autofill/core/browser/BUILD.gn b/components/autofill/core/browser/BUILD.gn index 3a18ccb..98d48fb6 100644 --- a/components/autofill/core/browser/BUILD.gn +++ b/components/autofill/core/browser/BUILD.gn
@@ -288,6 +288,8 @@ "metrics/converge_to_extreme_length_address_metrics.h", "metrics/fallback_autocomplete_unrecognized_metrics.cc", "metrics/fallback_autocomplete_unrecognized_metrics.h", + "metrics/field_filling_stats_and_score_metrics.cc", + "metrics/field_filling_stats_and_score_metrics.h", "metrics/form_events/address_form_event_logger.cc", "metrics/form_events/address_form_event_logger.h", "metrics/form_events/credit_card_form_event_logger.cc", @@ -1032,6 +1034,7 @@ "metrics/autofill_metrics_unittest.cc", "metrics/converge_to_extreme_length_address_metrics_unittest.cc", "metrics/fallback_autocomplete_unrecognized_metrics_unittest.cc", + "metrics/field_filling_stats_and_score_metrics_unittest.cc", "metrics/form_events/address_form_event_logger_unittest.cc", "metrics/form_events/form_event_logger_base_unittest.cc", "metrics/payments/card_metadata_metrics_unittest.cc",
diff --git a/components/autofill/core/browser/metrics/autofill_metrics.cc b/components/autofill/core/browser/metrics/autofill_metrics.cc index 852d0cf..83fd409 100644 --- a/components/autofill/core/browser/metrics/autofill_metrics.cc +++ b/components/autofill/core/browser/metrics/autofill_metrics.cc
@@ -1707,119 +1707,6 @@ } } -// static -void AutofillMetrics::LogFieldFillingStats( - FormType form_type, - const FormGroupFillingStats& filling_stats) { - std::string histogram_prefix = base::StrCat( - {"Autofill.FieldFillingStats.", FormTypeToStringPiece(form_type), "."}); - - // Do not acquire metrics if autofill was not used in this form group. - if (filling_stats.TotalFilled() == 0) - return; - - // Counts into those histograms are mutually exclusive. - base::UmaHistogramCounts100(base::StrCat({histogram_prefix, "Accepted"}), - filling_stats.num_accepted); - - base::UmaHistogramCounts100( - base::StrCat({histogram_prefix, "CorrectedToSameType"}), - filling_stats.num_corrected_to_same_type); - - base::UmaHistogramCounts100( - base::StrCat({histogram_prefix, "CorrectedToDifferentType"}), - filling_stats.num_corrected_to_different_type); - - base::UmaHistogramCounts100( - base::StrCat({histogram_prefix, "CorrectedToUnknownType"}), - filling_stats.num_corrected_to_unknown_type); - - base::UmaHistogramCounts100( - base::StrCat({histogram_prefix, "CorrectedToEmpty"}), - filling_stats.num_corrected_to_empty); - - base::UmaHistogramCounts100( - base::StrCat({histogram_prefix, "ManuallyFilledToSameType"}), - filling_stats.num_manually_filled_to_same_type); - - base::UmaHistogramCounts100( - base::StrCat({histogram_prefix, "ManuallyFilledToDifferentType"}), - filling_stats.num_manually_filled_to_differt_type); - - base::UmaHistogramCounts100( - base::StrCat({histogram_prefix, "ManuallyFilledToUnknownType"}), - filling_stats.num_manually_filled_to_unknown_type); - - base::UmaHistogramCounts100(base::StrCat({histogram_prefix, "LeftEmpty"}), - filling_stats.num_left_empty); - - // Counts into those histograms are not mutually exclusive and a single field - // can contribute to multiple of those. - base::UmaHistogramCounts100( - base::StrCat({histogram_prefix, "TotalCorrected"}), - filling_stats.TotalCorrected()); - - base::UmaHistogramCounts100(base::StrCat({histogram_prefix, "TotalFilled"}), - filling_stats.TotalFilled()); - - base::UmaHistogramCounts100(base::StrCat({histogram_prefix, "TotalUnfilled"}), - filling_stats.TotalUnfilled()); - - base::UmaHistogramCounts100( - base::StrCat({histogram_prefix, "TotalManuallyFilled"}), - filling_stats.TotalManuallyFilled()); - - base::UmaHistogramCounts100(base::StrCat({histogram_prefix, "Total"}), - filling_stats.Total()); -} - -// static -void AutofillMetrics::LogFormFillingScore( - FormType form_type, - const FormGroupFillingStats& filling_stats) { - // Do not acquire metrics if Autofill was not used in this form group. - if (filling_stats.TotalFilled() == 0) { - return; - } - - const int score = - 2 * filling_stats.num_accepted - 3 * filling_stats.TotalCorrected() + 100; - - // Make sure that the score is between 0 and 200 since we are only emitting to - // a histogram with equally distributed 201 buckets. - base::UmaHistogramCustomCounts( - base::StrCat( - {"Autofill.FormFillingScore.", FormTypeToStringPiece(form_type)}), - std::clamp(score, 1, 200), 1, 200, 200); -} - -// static -void AutofillMetrics::LogFormFillingComplexScore( - FormType form_type, - const FormGroupFillingStats& filling_stats) { - // Do not acquire metrics if Autofill was not used in this form group. - if (filling_stats.TotalFilled() == 0) { - return; - } - - // Limit the number of accepted fields to 19 and the number of corrected - // fields to 9. - const size_t value_min = 0; - - const size_t clamped_accepted = std::clamp( - filling_stats.num_accepted, value_min, static_cast<size_t>(19)); - const size_t clamped_corrected = std::clamp( - filling_stats.TotalCorrected(), value_min, static_cast<size_t>(9)); - - const int complex_score = clamped_accepted * 10 + clamped_corrected; - - // The metric is tracked to an histogram with 199 equally distributed buckets. - base::UmaHistogramCustomCounts( - base::StrCat({"Autofill.FormFillingComplexScore.", - FormTypeToStringPiece(form_type)}), - complex_score, 1, 199, 199); -} - void AutofillMetrics::LogSectioningMetrics( const base::flat_map<Section, size_t>& fields_per_section) { constexpr base::StringPiece kBaseHistogramName = "Autofill.Sectioning.";
diff --git a/components/autofill/core/browser/metrics/autofill_metrics.h b/components/autofill/core/browser/metrics/autofill_metrics.h index d13b99d..1e3ce1b 100644 --- a/components/autofill/core/browser/metrics/autofill_metrics.h +++ b/components/autofill/core/browser/metrics/autofill_metrics.h
@@ -49,7 +49,6 @@ namespace autofill_metrics { class FormEventLoggerBase; -struct FormGroupFillingStats; } // namespace autofill_metrics // A given maximum is enforced to minimize the number of buckets generated. @@ -1144,39 +1143,6 @@ size_t num_edited_autofilled_fields, bool observed_submission); - // Logs the `filling_stats` of the fields within a `form_type`. The filling - // status consistent of the number of accepted, corrected or and unfilled - // fields. - static void LogFieldFillingStats( - FormType form_type, - const autofill_metrics::FormGroupFillingStats& filling_stats); - - // Logs a form-wide score for the fields of `form_type` based on the - // field-wise `filling_stats`. The score is calculated as follows: - // S = 2*number(filled and accepted) - 3*number(filled and corrected) + 100 - // Note that the score is offset by 100 since UMA cannot log negative numbers - // It is also limited to 200. - // Each filled and accepted field contributes to a positive score of 2, while - // each filled and correct field contributes with a negative score of 3. - // The metric is only recorded if at least one field was accepted or - // corrected. - static void LogFormFillingScore( - FormType form_type, - const autofill_metrics::FormGroupFillingStats& filling_stats); - - // Similar to LogFormFillingScore but with a different score function: - // S = number(filled and accepted) * 10 + number(corrected) - // This score serves as a 2D histogram to record the number of corrected and - // accepted fields into a single histogram. - // Note that the number of accepted fields is limited to 19 and the number of - // corrected fields is limited to 9. - // A score of 45 would mean that 4 fields have been accepted and 5 corrected. - // The metric is only recorded if at least one field was accepted or - // corrected. - static void LogFormFillingComplexScore( - FormType form_type, - const autofill_metrics::FormGroupFillingStats& filling_stats); - // Logs the number of sections and the number of fields/section. static void LogSectioningMetrics( const base::flat_map<Section, size_t>& fields_per_section);
diff --git a/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc b/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc index 4c27441..eed3006 100644 --- a/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc +++ b/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc
@@ -201,133 +201,6 @@ AutofillMetricsIFrameTest, testing::Bool()); -// Test the logging of the field-wise filling stats and the form-wise filling -// score for the different form types. -TEST_F(AutofillMetricsTest, FillingStatsAndScores) { - FormData form = GetAndAddSeenForm( - {.description_for_logging = "FieldFillingStats", - .fields = - { - {.role = NAME_FULL, - .value = u"First Middle Last", - .is_autofilled = true}, - // Those two fields are going to be changed to a value of the - // same type. - {.role = NAME_FIRST, .value = u"First", .is_autofilled = true}, - {.role = NAME_LAST, .value = u"Last", .is_autofilled = true}, - // This field is going to be changed to a value of a different - // type. - {.role = NAME_FIRST, .value = u"First", .is_autofilled = true}, - // This field is going to be changed to another value of unknown - // type. - {.role = NAME_FIRST, .value = u"First", .is_autofilled = true}, - // This field is going to be changed to the empty value. - {.role = NAME_MIDDLE, .value = u"Middle", .is_autofilled = true}, - // This field remains. - {.role = NAME_LAST, .value = u"Last", .is_autofilled = true}, - // This following two fields are manually filled to a value of - // type NAME_FIRST. - {.role = NAME_FIRST, .value = u"Elvis", .is_autofilled = false}, - {.role = NAME_FIRST, .value = u"Elvis", .is_autofilled = false}, - // This one is manually filled to a value of type NAME_LAST. - {.role = NAME_FIRST, - .value = u"Presley", - .is_autofilled = false}, - // This next three are manually filled to a value of - // UNKNOWN_TYPE. - {.role = NAME_FIRST, - .value = u"Random Value", - .is_autofilled = false}, - {.role = NAME_MIDDLE, - .value = u"Random Value", - .is_autofilled = false}, - {.role = NAME_LAST, - .value = u"Random Value", - .is_autofilled = false}, - // The last field is not autofilled and empty. - {.role = ADDRESS_HOME_CITY, - .value = u"", - .is_autofilled = false}, - // We add two credit cards field to make sure those are counted - // in separate statistics. - {.role = CREDIT_CARD_NAME_FULL, - .value = u"Test Name", - .is_autofilled = true}, - {.role = CREDIT_CARD_NUMBER, - .value = u"", - .is_autofilled = false}, - }, - .unique_renderer_id = test::MakeFormRendererId(), - .main_frame_origin = - url::Origin::Create(autofill_client_->form_origin())}); - - // Elvis is of type NAME_FIRST in the test profile. - SimulateUserChangedTextFieldTo(form, form.fields[1], u"Elvis"); - // Presley is of type NAME_LAST in the test profile - SimulateUserChangedTextFieldTo(form, form.fields[2], u"Presley"); - // Presley is of type NAME_LAST in the test profile - SimulateUserChangedTextFieldTo(form, form.fields[3], u"Presley"); - // This is a random string of UNKNOWN_TYPE. - SimulateUserChangedTextFieldTo(form, form.fields[4], u"something random"); - SimulateUserChangedTextFieldTo(form, form.fields[5], u""); - - base::HistogramTester histogram_tester; - SubmitForm(form); - - const std::string histogram_prefix = "Autofill.FieldFillingStats.Address."; - - // Testing of the FormFillingStats expectations. - - histogram_tester.ExpectUniqueSample(histogram_prefix + "Accepted", 2, 1); - histogram_tester.ExpectUniqueSample(histogram_prefix + "CorrectedToSameType", - 2, 1); - histogram_tester.ExpectUniqueSample( - histogram_prefix + "CorrectedToDifferentType", 1, 1); - histogram_tester.ExpectUniqueSample( - histogram_prefix + "CorrectedToUnknownType", 1, 1); - histogram_tester.ExpectUniqueSample(histogram_prefix + "CorrectedToEmpty", 1, - 1); - histogram_tester.ExpectUniqueSample(histogram_prefix + "LeftEmpty", 1, 1); - histogram_tester.ExpectUniqueSample( - histogram_prefix + "ManuallyFilledToSameType", 2, 1); - histogram_tester.ExpectUniqueSample( - histogram_prefix + "ManuallyFilledToDifferentType", 1, 1); - histogram_tester.ExpectUniqueSample( - histogram_prefix + "ManuallyFilledToUnknownType", 3, 1); - histogram_tester.ExpectUniqueSample(histogram_prefix + "TotalManuallyFilled", - 6, 1); - histogram_tester.ExpectUniqueSample(histogram_prefix + "TotalFilled", 7, 1); - histogram_tester.ExpectUniqueSample(histogram_prefix + "TotalCorrected", 5, - 1); - histogram_tester.ExpectUniqueSample(histogram_prefix + "TotalUnfilled", 7, 1); - histogram_tester.ExpectUniqueSample(histogram_prefix + "Total", 14, 1); - - // Testing of the FormFillingScore expectations. - - // The form contains a total of 7 autofilled address fields. Two fields are - // accepted while 5 are corrected. - const int accepted_address_fields = 2; - const int corrected_address_fields = 5; - - const int expected_address_score = - 2 * accepted_address_fields - 3 * corrected_address_fields + 100; - const int expected_address_complex_score = - accepted_address_fields * 10 + corrected_address_fields; - - histogram_tester.ExpectUniqueSample("Autofill.FormFillingScore.Address", - expected_address_score, 1); - histogram_tester.ExpectUniqueSample( - "Autofill.FormFillingComplexScore.Address", - expected_address_complex_score, 1); - - // Also test for credit cards where there is exactly one accepted field and - // no corrected fields. - histogram_tester.ExpectUniqueSample("Autofill.FormFillingScore.CreditCard", - 102, 1); - histogram_tester.ExpectUniqueSample( - "Autofill.FormFillingComplexScore.CreditCard", 10, 1); -} - // Test that we log the right number of autofilled fields at submission time. TEST_F(AutofillMetricsTest, NumberOfAutofilledFieldsAtSubmission) { // Set up our form data with two autofilled fields.
diff --git a/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.cc b/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.cc new file mode 100644 index 0000000..085971ef --- /dev/null +++ b/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.cc
@@ -0,0 +1,158 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h" +#include "base/metrics/histogram_functions.h" +#include "base/strings/strcat.h" +#include "components/autofill/core/browser/form_types.h" + +namespace autofill::autofill_metrics { + +namespace { + +// Logs the `filling_stats` of the fields within a `form_type`. The filling +// status consistent of the number of accepted, corrected or and unfilled +// fields. +void LogFieldFillingStats(FormType form_type, + const FormGroupFillingStats& filling_stats) { + std::string histogram_prefix = base::StrCat( + {"Autofill.FieldFillingStats.", FormTypeToStringPiece(form_type), "."}); + + // Do not acquire metrics if autofill was not used in this form group. + if (filling_stats.TotalFilled() == 0) { + return; + } + + // Counts into those histograms are mutually exclusive. + base::UmaHistogramCounts100(base::StrCat({histogram_prefix, "Accepted"}), + filling_stats.num_accepted); + + base::UmaHistogramCounts100( + base::StrCat({histogram_prefix, "CorrectedToSameType"}), + filling_stats.num_corrected_to_same_type); + + base::UmaHistogramCounts100( + base::StrCat({histogram_prefix, "CorrectedToDifferentType"}), + filling_stats.num_corrected_to_different_type); + + base::UmaHistogramCounts100( + base::StrCat({histogram_prefix, "CorrectedToUnknownType"}), + filling_stats.num_corrected_to_unknown_type); + + base::UmaHistogramCounts100( + base::StrCat({histogram_prefix, "CorrectedToEmpty"}), + filling_stats.num_corrected_to_empty); + + base::UmaHistogramCounts100( + base::StrCat({histogram_prefix, "ManuallyFilledToSameType"}), + filling_stats.num_manually_filled_to_same_type); + + base::UmaHistogramCounts100( + base::StrCat({histogram_prefix, "ManuallyFilledToDifferentType"}), + filling_stats.num_manually_filled_to_differt_type); + + base::UmaHistogramCounts100( + base::StrCat({histogram_prefix, "ManuallyFilledToUnknownType"}), + filling_stats.num_manually_filled_to_unknown_type); + + base::UmaHistogramCounts100(base::StrCat({histogram_prefix, "LeftEmpty"}), + filling_stats.num_left_empty); + + // Counts into those histograms are not mutually exclusive and a single field + // can contribute to multiple of those. + base::UmaHistogramCounts100( + base::StrCat({histogram_prefix, "TotalCorrected"}), + filling_stats.TotalCorrected()); + + base::UmaHistogramCounts100(base::StrCat({histogram_prefix, "TotalFilled"}), + filling_stats.TotalFilled()); + + base::UmaHistogramCounts100(base::StrCat({histogram_prefix, "TotalUnfilled"}), + filling_stats.TotalUnfilled()); + + base::UmaHistogramCounts100( + base::StrCat({histogram_prefix, "TotalManuallyFilled"}), + filling_stats.TotalManuallyFilled()); + + base::UmaHistogramCounts100(base::StrCat({histogram_prefix, "Total"}), + filling_stats.Total()); +} + +// Logs a form-wide score for the fields of `form_type` based on the +// field-wise `filling_stats`. The score is calculated as follows: +// S = 2*number(filled and accepted) - 3*number(filled and corrected) + 100 +// Note that the score is offset by 100 since UMA cannot log negative numbers +// It is also limited to 200. +// Each filled and accepted field contributes to a positive score of 2, while +// each filled and correct field contributes with a negative score of 3. +// The metric is only recorded if at least one field was accepted or +// corrected. +void LogFormFillingScore(FormType form_type, + const FormGroupFillingStats& filling_stats) { + // Do not acquire metrics if Autofill was not used in this form group. + if (filling_stats.TotalFilled() == 0) { + return; + } + + const int score = + 2 * filling_stats.num_accepted - 3 * filling_stats.TotalCorrected() + 100; + + // Make sure that the score is between 0 and 200 since we are only emitting to + // a histogram with equally distributed 201 buckets. + base::UmaHistogramCustomCounts( + base::StrCat( + {"Autofill.FormFillingScore.", FormTypeToStringPiece(form_type)}), + std::clamp(score, 1, 200), 1, 200, 200); +} + +// Similar to LogFormFillingScore but with a different score function: +// S = number(filled and accepted) * 10 + number(corrected) +// This score serves as a 2D histogram to record the number of corrected and +// accepted fields into a single histogram. +// Note that the number of accepted fields is limited to 19 and the number of +// corrected fields is limited to 9. +// A score of 45 would mean that 4 fields have been accepted and 5 corrected. +// The metric is only recorded if at least one field was accepted or +// corrected. +void LogFormFillingComplexScore(FormType form_type, + const FormGroupFillingStats& filling_stats) { + // Do not acquire metrics if Autofill was not used in this form group. + if (filling_stats.TotalFilled() == 0) { + return; + } + + // Limit the number of accepted fields to 19 and the number of corrected + // fields to 9. + const size_t value_min = 0; + + const size_t clamped_accepted = std::clamp( + filling_stats.num_accepted, value_min, static_cast<size_t>(19)); + const size_t clamped_corrected = std::clamp( + filling_stats.TotalCorrected(), value_min, static_cast<size_t>(9)); + + const int complex_score = clamped_accepted * 10 + clamped_corrected; + + // The metric is tracked to an histogram with 199 equally distributed buckets. + base::UmaHistogramCustomCounts( + base::StrCat({"Autofill.FormFillingComplexScore.", + FormTypeToStringPiece(form_type)}), + complex_score, 1, 199, 199); +} + +} // namespace + +void LogFieldFillingStatsAndScore( + const FormGroupFillingStats& address_filling_stats, + const FormGroupFillingStats& cc_filling_stats) { + LogFieldFillingStats(FormType::kAddressForm, address_filling_stats); + LogFieldFillingStats(FormType::kCreditCardForm, cc_filling_stats); + + LogFormFillingScore(FormType::kAddressForm, address_filling_stats); + LogFormFillingScore(FormType::kCreditCardForm, cc_filling_stats); + + LogFormFillingComplexScore(FormType::kAddressForm, address_filling_stats); + LogFormFillingComplexScore(FormType::kCreditCardForm, cc_filling_stats); +} + +} // namespace autofill::autofill_metrics
diff --git a/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h b/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h new file mode 100644 index 0000000..2dc6b86f --- /dev/null +++ b/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h
@@ -0,0 +1,21 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_METRICS_FIELD_FILLING_STATS_AND_SCORE_METRICS_H_ +#define COMPONENTS_AUTOFILL_CORE_BROWSER_METRICS_FIELD_FILLING_STATS_AND_SCORE_METRICS_H_ + +#include "components/autofill/core/browser/metrics/autofill_metrics_utils.h" + +namespace autofill::autofill_metrics { + +// Logs the `filling_stats` of the fields within a `form_type`. The filling +// status consistent of the number of accepted, corrected or and unfilled +// fields. See the .cc file for details. +void LogFieldFillingStatsAndScore( + const FormGroupFillingStats& address_filling_stats, + const FormGroupFillingStats& cc_filling_stats); + +} // namespace autofill::autofill_metrics + +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_METRICS_FIELD_FILLING_STATS_AND_SCORE_METRICS_H_
diff --git a/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics_unittest.cc b/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics_unittest.cc new file mode 100644 index 0000000..e8d8c8f --- /dev/null +++ b/components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics_unittest.cc
@@ -0,0 +1,149 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h" + +#include "base/test/metrics/histogram_tester.h" +#include "components/autofill/core/browser/autofill_test_utils.h" +#include "components/autofill/core/browser/metrics/autofill_metrics_test_base.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace autofill::autofill_metrics { + +class AutofillFieldFillingStatsAndScoreMetricsTest + : public AutofillMetricsBaseTest, + public testing::Test { + public: + void SetUp() override { SetUpHelper(); } + void TearDown() override { TearDownHelper(); } +}; + +// Test the logging of the field-wise filling stats and the form-wise filling +// score for the different form types. +TEST_F(AutofillFieldFillingStatsAndScoreMetricsTest, FillingStatsAndScores) { + FormData form = GetAndAddSeenForm( + {.description_for_logging = "FieldFillingStats", + .fields = + { + {.role = NAME_FULL, + .value = u"First Middle Last", + .is_autofilled = true}, + // Those two fields are going to be changed to a value of the + // same type. + {.role = NAME_FIRST, .value = u"First", .is_autofilled = true}, + {.role = NAME_LAST, .value = u"Last", .is_autofilled = true}, + // This field is going to be changed to a value of a different + // type. + {.role = NAME_FIRST, .value = u"First", .is_autofilled = true}, + // This field is going to be changed to another value of unknown + // type. + {.role = NAME_FIRST, .value = u"First", .is_autofilled = true}, + // This field is going to be changed to the empty value. + {.role = NAME_MIDDLE, .value = u"Middle", .is_autofilled = true}, + // This field remains. + {.role = NAME_LAST, .value = u"Last", .is_autofilled = true}, + // This following two fields are manually filled to a value of + // type NAME_FIRST. + {.role = NAME_FIRST, .value = u"Elvis", .is_autofilled = false}, + {.role = NAME_FIRST, .value = u"Elvis", .is_autofilled = false}, + // This one is manually filled to a value of type NAME_LAST. + {.role = NAME_FIRST, + .value = u"Presley", + .is_autofilled = false}, + // This next three are manually filled to a value of + // UNKNOWN_TYPE. + {.role = NAME_FIRST, + .value = u"Random Value", + .is_autofilled = false}, + {.role = NAME_MIDDLE, + .value = u"Random Value", + .is_autofilled = false}, + {.role = NAME_LAST, + .value = u"Random Value", + .is_autofilled = false}, + // The last field is not autofilled and empty. + {.role = ADDRESS_HOME_CITY, + .value = u"", + .is_autofilled = false}, + // We add two credit cards field to make sure those are counted + // in separate statistics. + {.role = CREDIT_CARD_NAME_FULL, + .value = u"Test Name", + .is_autofilled = true}, + {.role = CREDIT_CARD_NUMBER, + .value = u"", + .is_autofilled = false}, + }, + .unique_renderer_id = test::MakeFormRendererId(), + .main_frame_origin = + url::Origin::Create(autofill_client_->form_origin())}); + + // Elvis is of type NAME_FIRST in the test profile. + SimulateUserChangedTextFieldTo(form, form.fields[1], u"Elvis"); + // Presley is of type NAME_LAST in the test profile + SimulateUserChangedTextFieldTo(form, form.fields[2], u"Presley"); + // Presley is of type NAME_LAST in the test profile + SimulateUserChangedTextFieldTo(form, form.fields[3], u"Presley"); + // This is a random string of UNKNOWN_TYPE. + SimulateUserChangedTextFieldTo(form, form.fields[4], u"something random"); + SimulateUserChangedTextFieldTo(form, form.fields[5], u""); + + base::HistogramTester histogram_tester; + SubmitForm(form); + + const std::string histogram_prefix = "Autofill.FieldFillingStats.Address."; + + // Testing of the FormFillingStats expectations. + + histogram_tester.ExpectUniqueSample(histogram_prefix + "Accepted", 2, 1); + histogram_tester.ExpectUniqueSample(histogram_prefix + "CorrectedToSameType", + 2, 1); + histogram_tester.ExpectUniqueSample( + histogram_prefix + "CorrectedToDifferentType", 1, 1); + histogram_tester.ExpectUniqueSample( + histogram_prefix + "CorrectedToUnknownType", 1, 1); + histogram_tester.ExpectUniqueSample(histogram_prefix + "CorrectedToEmpty", 1, + 1); + histogram_tester.ExpectUniqueSample(histogram_prefix + "LeftEmpty", 1, 1); + histogram_tester.ExpectUniqueSample( + histogram_prefix + "ManuallyFilledToSameType", 2, 1); + histogram_tester.ExpectUniqueSample( + histogram_prefix + "ManuallyFilledToDifferentType", 1, 1); + histogram_tester.ExpectUniqueSample( + histogram_prefix + "ManuallyFilledToUnknownType", 3, 1); + histogram_tester.ExpectUniqueSample(histogram_prefix + "TotalManuallyFilled", + 6, 1); + histogram_tester.ExpectUniqueSample(histogram_prefix + "TotalFilled", 7, 1); + histogram_tester.ExpectUniqueSample(histogram_prefix + "TotalCorrected", 5, + 1); + histogram_tester.ExpectUniqueSample(histogram_prefix + "TotalUnfilled", 7, 1); + histogram_tester.ExpectUniqueSample(histogram_prefix + "Total", 14, 1); + + // Testing of the FormFillingScore expectations. + + // The form contains a total of 7 autofilled address fields. Two fields are + // accepted while 5 are corrected. + const int accepted_address_fields = 2; + const int corrected_address_fields = 5; + + const int expected_address_score = + 2 * accepted_address_fields - 3 * corrected_address_fields + 100; + const int expected_address_complex_score = + accepted_address_fields * 10 + corrected_address_fields; + + histogram_tester.ExpectUniqueSample("Autofill.FormFillingScore.Address", + expected_address_score, 1); + histogram_tester.ExpectUniqueSample( + "Autofill.FormFillingComplexScore.Address", + expected_address_complex_score, 1); + + // Also test for credit cards where there is exactly one accepted field and + // no corrected fields. + histogram_tester.ExpectUniqueSample("Autofill.FormFillingScore.CreditCard", + 102, 1); + histogram_tester.ExpectUniqueSample( + "Autofill.FormFillingComplexScore.CreditCard", 10, 1); +} + +} // namespace autofill::autofill_metrics
diff --git a/components/autofill/core/browser/metrics/quality_metrics.cc b/components/autofill/core/browser/metrics/quality_metrics.cc index 7ee4068..fb22441c 100644 --- a/components/autofill/core/browser/metrics/quality_metrics.cc +++ b/components/autofill/core/browser/metrics/quality_metrics.cc
@@ -9,6 +9,7 @@ #include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/field_type_utils.h" #include "components/autofill/core/browser/metrics/autofill_metrics_utils.h" +#include "components/autofill/core/browser/metrics/field_filling_stats_and_score_metrics.h" #include "components/autofill/core/browser/metrics/precedence_over_autocomplete_metrics.h" #include "components/autofill/core/browser/metrics/shadow_prediction_metrics.h" #include "components/autofill/core/browser/validation.h" @@ -386,20 +387,8 @@ // Log the field filling statistics if autofill was used. // The metrics are only emitted if there was at least one field in the // corresponding form group that is or was filled by autofill. - AutofillMetrics::LogFieldFillingStats(FormType::kAddressForm, - address_field_stats); - AutofillMetrics::LogFieldFillingStats(FormType::kCreditCardForm, - cc_field_stats); - - AutofillMetrics::LogFormFillingScore(FormType::kAddressForm, - address_field_stats); - AutofillMetrics::LogFormFillingScore(FormType::kCreditCardForm, - cc_field_stats); - - AutofillMetrics::LogFormFillingComplexScore(FormType::kAddressForm, - address_field_stats); - AutofillMetrics::LogFormFillingComplexScore(FormType::kCreditCardForm, - cc_field_stats); + autofill_metrics::LogFieldFillingStatsAndScore(address_field_stats, + cc_field_stats); if (card_form) { AutofillMetrics::LogCreditCardSeamlessnessAtSubmissionTime(
diff --git a/components/drive/drive_pref_names.cc b/components/drive/drive_pref_names.cc index 5eb2bb4..b563780 100644 --- a/components/drive/drive_pref_names.cc +++ b/components/drive/drive_pref_names.cc
@@ -45,4 +45,8 @@ // or disabled by the user. const char kDriveFsBulkPinningEnabled[] = "drivefs.bulk_pinning_enabled"; +// A time pref indicating the last time the DSS availability metric was emitted. +const char kDriveFsDSSAvailabilityLastEmitted[] = + "drivefs.dss_availability_last_emitted_time"; + } // namespace drive::prefs
diff --git a/components/drive/drive_pref_names.h b/components/drive/drive_pref_names.h index e6673cc7e..a587a71d 100644 --- a/components/drive/drive_pref_names.h +++ b/components/drive/drive_pref_names.h
@@ -19,6 +19,7 @@ extern const char kDriveFsMirrorSyncMachineRootId[]; extern const char kDriveFsBulkPinningVisible[]; extern const char kDriveFsBulkPinningEnabled[]; +extern const char kDriveFsDSSAvailabilityLastEmitted[]; } // namespace drive::prefs
diff --git a/components/exo/drag_drop_operation_unittest.cc b/components/exo/drag_drop_operation_unittest.cc index d08110cb..755d809 100644 --- a/components/exo/drag_drop_operation_unittest.cc +++ b/components/exo/drag_drop_operation_unittest.cc
@@ -162,10 +162,7 @@ class DragDropOperationTestWithWebUITabStripTest : public DragDropOperationTest { public: - DragDropOperationTestWithWebUITabStripTest() { - scoped_feature_list_.InitAndEnableFeature( - ash::features::kWebUITabStripTabDragIntegration); - } + DragDropOperationTestWithWebUITabStripTest() {} // DragDropOperationTest: void SetUp() override {
diff --git a/components/exo/shell_surface_base.cc b/components/exo/shell_surface_base.cc index 55665f80..21c17b3 100644 --- a/components/exo/shell_surface_base.cc +++ b/components/exo/shell_surface_base.cc
@@ -1824,13 +1824,36 @@ gfx::Point origin = GetClientViewBounds().origin(); origin += GetSurfaceOrigin().OffsetFromOrigin(); + // As `origin` is in DP here, it eventually needs to be converted to pixels. + // We need to make subpixel adjustment so the `origin` in pixel coordinates + // will align exactly to a pixel boundary. Here, we calculate the closest + // pixel boundary by converting to pixels and rounding the original DP value. + // Note that this shouldn't take `scaled_root_origin` into account as its + // original value is in pixels and it needs a different type of subpixel + // adjustment (i.e. preserving the original pixel distance between two + // points). + const gfx::Vector2dF surface_origin_subpixel_offset = + ScaleVector2d(ToRoundedVector2d(ScaleVector2d(origin.OffsetFromOrigin(), + GetScaleFactor())), + 1.f / GetScaleFactor()) - + origin.OffsetFromOrigin(); + const gfx::Vector2dF root_surface_origin_dp = ScaleVector2d( root_surface_origin_pixel().OffsetFromOrigin(), 1.f / GetScaleFactor()); origin -= ToFlooredVector2d(root_surface_origin_dp); - // Set subpixel offset to the diff between the dp scaled origin in float and - // its floored value to adjust root surface origin to be at the same position. + // Subpixel offset used to adjust the offset of `root_origin` so it will + // exactly match the original value in pixels. + const gfx::Vector2dF root_surface_origin_subpixel_offset = + ToFlooredVector2d(root_surface_origin_dp) - root_surface_origin_dp; + + // Two offsets can be simply added together because + // `surface_origin_subpixel_offset` is used for shifting the origin on a pixel + // boundary while `root_surface_origin_subpixel_offset` just ensures that the + // root surface origin stays the same value in pixel while scrolling when a + // sub surface moves (e.g. by scrolling) but the actual value it's preserving + // doesn't matter. host_window()->layer()->SetSubpixelPositionOffset( - ToFlooredVector2d(root_surface_origin_dp) - root_surface_origin_dp); + surface_origin_subpixel_offset + root_surface_origin_subpixel_offset); if (origin != host_window()->bounds().origin()) { AllocateLocalSurfaceId();
diff --git a/components/exo/shell_surface_base.h b/components/exo/shell_surface_base.h index c39ffe8..8ab1a6a 100644 --- a/components/exo/shell_surface_base.h +++ b/components/exo/shell_surface_base.h
@@ -507,6 +507,7 @@ FRIEND_TEST_ALL_PREFIXES( ShellSurfaceTest, LocalSurfaceIdUpdatedOnHostWindowOriginChangedWithScaleFactor); + FRIEND_TEST_ALL_PREFIXES(ShellSurfaceTest, SubpixelPositionOffset); // Called on widget creation to initialize its window state. // TODO(reveman): Remove virtual functions below to avoid FBC problem.
diff --git a/components/exo/shell_surface_unittest.cc b/components/exo/shell_surface_unittest.cc index a05ef8b..1f48efe2 100644 --- a/components/exo/shell_surface_unittest.cc +++ b/components/exo/shell_surface_unittest.cc
@@ -3965,4 +3965,29 @@ shell_surface->GetWidget()->GetWindowBoundsInScreen().size()); } +TEST_F(ShellSurfaceTest, SubpixelPositionOffset) { + UpdateDisplay("1200x800*1.6"); + std::unique_ptr<ShellSurface> shell_surface = + test::ShellSurfaceBuilder({256, 256}) + .SetOrigin({20, 20}) + .BuildShellSurface(); + auto* surface = shell_surface->root_surface(); + // Enabling a normal frame makes `GetClientViewBounds().origin()` return + // (0, 32), which makes the host window not align with any pixel boundary. + surface->SetFrame(SurfaceFrameType::NORMAL); + shell_surface->root_surface()->SetSurfaceHierarchyContentBoundsForTest( + gfx::Rect(-20, -20, 256, 256)); + EXPECT_TRUE(shell_surface->OnPreWidgetCommit()); + shell_surface->CommitWidget(); + EXPECT_EQ(gfx::Point(20, 20), shell_surface->root_surface_origin_pixel()); + EXPECT_EQ(gfx::Rect(-12, 20, 256, 256), + shell_surface->host_window()->bounds()); + // Verify that 'root_surface_origin()' is exactly preservered in pixels with + // subpixel offset. + // (0, -0.125) is caused by the frame like above, and (-0.5, -0.5) is for + // 'root_surface_origin()'. + EXPECT_EQ(gfx::Vector2dF(-0.5, -0.625), + shell_surface->host_window()->layer()->GetSubpixelOffset()); +} + } // namespace exo
diff --git a/components/password_manager/core/browser/BUILD.gn b/components/password_manager/core/browser/BUILD.gn index 9c4df95..aa4b9fe9 100644 --- a/components/password_manager/core/browser/BUILD.gn +++ b/components/password_manager/core/browser/BUILD.gn
@@ -224,7 +224,6 @@ "ui/credential_ui_entry.cc", "ui/credential_ui_entry.h", "ui/credential_utils.h", - "ui/export_progress_status.h", "ui/insecure_credentials_manager.cc", "ui/insecure_credentials_manager.h", "ui/password_check_referrer.cc", @@ -388,13 +387,6 @@ } } -source_set("import_results") { - sources = [ - "ui/import_results.cc", - "ui/import_results.h", - ] -} - # PasswordForm is an extremely common struct used by many sub-components and # sub-directories. Having its own target makes it possible to break up several # cyclic dependencies.
diff --git a/components/password_manager/core/browser/export/BUILD.gn b/components/password_manager/core/browser/export/BUILD.gn index a7f9bc2..508aa0a 100644 --- a/components/password_manager/core/browser/export/BUILD.gn +++ b/components/password_manager/core/browser/export/BUILD.gn
@@ -9,6 +9,7 @@ sources = [ "csv_writer.cc", "csv_writer.h", + "export_progress_status.h", "password_csv_writer.cc", "password_csv_writer.h", "password_manager_exporter.cc", @@ -16,6 +17,7 @@ ] deps = [ "//base", + # TODO(crbug.com/1479425): Remove dependency on core/browser. Instead depend on subdirectories of browser. "//components/password_manager/core/browser", ]
diff --git a/components/password_manager/core/browser/export/export_progress_status.h b/components/password_manager/core/browser/export/export_progress_status.h new file mode 100644 index 0000000..572bb51 --- /dev/null +++ b/components/password_manager/core/browser/export/export_progress_status.h
@@ -0,0 +1,20 @@ +// Copyright 2017 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_EXPORT_EXPORT_PROGRESS_STATUS_H_ +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_EXPORT_EXPORT_PROGRESS_STATUS_H_ + +namespace password_manager { + +enum class ExportProgressStatus { + kNotStarted, + kInProgress, + kSucceeded, + kFailedCancelled, + kFailedWrite +}; + +} // namespace password_manager + +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_EXPORT_EXPORT_PROGRESS_STATUS_H_
diff --git a/components/password_manager/core/browser/export/password_manager_exporter.cc b/components/password_manager/core/browser/export/password_manager_exporter.cc index 1f0915c..6d0a2a8 100644 --- a/components/password_manager/core/browser/export/password_manager_exporter.cc +++ b/components/password_manager/core/browser/export/password_manager_exporter.cc
@@ -71,7 +71,7 @@ base::OnceClosure completion_callback) : presenter_(presenter), on_progress_(std::move(on_progress)), - last_progress_status_(ExportProgressStatus::NOT_STARTED), + last_progress_status_(ExportProgressStatus::kNotStarted), write_function_(base::BindRepeating(&DefaultWriteFunction)), delete_function_(base::BindRepeating(&DefaultDeleteFunction)), completion_callback_(std::move(completion_callback)), @@ -88,7 +88,7 @@ PasswordManagerExporter::~PasswordManagerExporter() = default; void PasswordManagerExporter::PreparePasswordsForExport() { - DCHECK_EQ(GetProgressStatus(), ExportProgressStatus::NOT_STARTED); + DCHECK_EQ(GetProgressStatus(), ExportProgressStatus::kNotStarted); std::vector<CredentialUIEntry> credentials = presenter_->GetSavedCredentials(); @@ -106,14 +106,14 @@ void PasswordManagerExporter::SetDestination( const base::FilePath& destination) { - DCHECK_EQ(GetProgressStatus(), ExportProgressStatus::NOT_STARTED); + DCHECK_EQ(GetProgressStatus(), ExportProgressStatus::kNotStarted); destination_ = destination; if (IsReadyForExport()) Export(); - OnProgress({.status = ExportProgressStatus::IN_PROGRESS}); + OnProgress({.status = ExportProgressStatus::kInProgress}); } void PasswordManagerExporter::SetSerialisedPasswordList( @@ -131,7 +131,7 @@ // If we are currently still serialising, Export() will see the cancellation // status and won't schedule writing. - OnProgress({.status = ExportProgressStatus::FAILED_CANCELLED}); + OnProgress({.status = ExportProgressStatus::kFailedCancelled}); // If we are currently writing to the disk, we will have to cleanup the file // once writing stops. @@ -166,7 +166,7 @@ void PasswordManagerExporter::Export() { // If cancelling was requested while we were serialising the passwords, don't // write anything to the disk. - if (GetProgressStatus() == ExportProgressStatus::FAILED_CANCELLED) { + if (GetProgressStatus() == ExportProgressStatus::kFailedCancelled) { serialised_password_list_.clear(); return; } @@ -188,11 +188,11 @@ std::string file_path = base::WideToUTF8(destination_.value()); #endif OnProgress( - {.status = ExportProgressStatus::SUCCEEDED, .file_path = file_path}); + {.status = ExportProgressStatus::kSucceeded, .file_path = file_path}); } else { OnProgress( - {.status = ExportProgressStatus::FAILED_WRITE_FAILED, + {.status = ExportProgressStatus::kFailedWrite, .folder_name = destination_.DirName().BaseName().AsUTF8Unsafe()}); // Don't leave partial password files, if we tell the user we couldn't write Cleanup();
diff --git a/components/password_manager/core/browser/export/password_manager_exporter.h b/components/password_manager/core/browser/export/password_manager_exporter.h index dd6e12d..a43c09e 100644 --- a/components/password_manager/core/browser/export/password_manager_exporter.h +++ b/components/password_manager/core/browser/export/password_manager_exporter.h
@@ -13,7 +13,7 @@ #include "base/memory/weak_ptr.h" #include "base/strings/string_piece.h" #include "base/task/sequenced_task_runner.h" -#include "components/password_manager/core/browser/ui/export_progress_status.h" +#include "components/password_manager/core/browser/export/export_progress_status.h" namespace password_manager {
diff --git a/components/password_manager/core/browser/export/password_manager_exporter_unittest.cc b/components/password_manager/core/browser/export/password_manager_exporter_unittest.cc index eab45df..62d431e 100644 --- a/components/password_manager/core/browser/export/password_manager_exporter_unittest.cc +++ b/components/password_manager/core/browser/export/password_manager_exporter_unittest.cc
@@ -15,11 +15,11 @@ #include "base/test/task_environment.h" #include "build/build_config.h" #include "components/password_manager/core/browser/affiliation/fake_affiliation_service.h" +#include "components/password_manager/core/browser/export/export_progress_status.h" #include "components/password_manager/core/browser/export/password_csv_writer.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" #include "components/password_manager/core/browser/test_password_store.h" #include "components/password_manager/core/browser/ui/credential_ui_entry.h" -#include "components/password_manager/core/browser/ui/export_progress_status.h" #include "components/password_manager/core/browser/ui/saved_passwords_presenter.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -63,12 +63,12 @@ } PasswordExportInfo CreateExportInProgressInfo() { - return {.status = ExportProgressStatus::IN_PROGRESS}; + return {.status = ExportProgressStatus::kInProgress}; } PasswordExportInfo CreateSuccessfulExportInfo(const base::FilePath& path) { return { - .status = ExportProgressStatus::SUCCEEDED, + .status = ExportProgressStatus::kSucceeded, #if !BUILDFLAG(IS_WIN) .file_path = path.value(), #else @@ -78,12 +78,12 @@ } PasswordExportInfo CreateFailedExportInfo(const base::FilePath& path) { - return {.status = ExportProgressStatus::FAILED_WRITE_FAILED, + return {.status = ExportProgressStatus::kFailedWrite, .folder_name = path.DirName().BaseName().AsUTF8Unsafe()}; } PasswordExportInfo CreateCancelledExportInfo() { - return {.status = ExportProgressStatus::FAILED_CANCELLED}; + return {.status = ExportProgressStatus::kFailedCancelled}; } class PasswordManagerExporterTest : public testing::Test { @@ -182,7 +182,7 @@ SetPasswordList({form}); // The last status seen in the callback. - PasswordExportInfo export_info({.status = ExportProgressStatus::NOT_STARTED}); + PasswordExportInfo export_info({.status = ExportProgressStatus::kNotStarted}); EXPECT_CALL(mock_write_file_, Run).WillOnce(Return(true)); EXPECT_CALL(mock_on_progress_, Run).WillRepeatedly(SaveArg<0>(&export_info));
diff --git a/components/password_manager/core/browser/import/BUILD.gn b/components/password_manager/core/browser/import/BUILD.gn index 52c0c18..a51e919 100644 --- a/components/password_manager/core/browser/import/BUILD.gn +++ b/components/password_manager/core/browser/import/BUILD.gn
@@ -12,6 +12,8 @@ if (use_blink) { source_set("importer") { sources = [ + "import_results.cc", + "import_results.h", "password_importer.cc", "password_importer.h", ] @@ -23,7 +25,6 @@ deps = [ "//components/password_manager/core/browser", - "//components/password_manager/core/browser:import_results", "//components/password_manager/core/common:features", "//components/password_manager/services/csv_password:service", "//components/sync/base:base", @@ -36,7 +37,6 @@ deps = [ ":importer", "//base/test:test_support", - "//components/password_manager/core/browser:import_results", "//components/password_manager/core/browser:test_support", "//components/password_manager/core/browser/affiliation:test_support", "//mojo/public/cpp/bindings:bindings",
diff --git a/components/password_manager/core/browser/ui/import_results.cc b/components/password_manager/core/browser/import/import_results.cc similarity index 92% rename from components/password_manager/core/browser/ui/import_results.cc rename to components/password_manager/core/browser/import/import_results.cc index 70d830c6..ae7eee2 100644 --- a/components/password_manager/core/browser/ui/import_results.cc +++ b/components/password_manager/core/browser/import/import_results.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 "components/password_manager/core/browser/ui/import_results.h" +#include "components/password_manager/core/browser/import/import_results.h" namespace password_manager {
diff --git a/components/password_manager/core/browser/ui/import_results.h b/components/password_manager/core/browser/import/import_results.h similarity index 93% rename from components/password_manager/core/browser/ui/import_results.h rename to components/password_manager/core/browser/import/import_results.h index 9ea63417..67a7d30ed 100644 --- a/components/password_manager/core/browser/ui/import_results.h +++ b/components/password_manager/core/browser/import/import_results.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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_IMPORT_RESULTS_H_ -#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_IMPORT_RESULTS_H_ +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_IMPORT_IMPORT_RESULTS_H_ +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_IMPORT_IMPORT_RESULTS_H_ #include <string> #include <vector> @@ -120,4 +120,4 @@ } // namespace password_manager -#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_IMPORT_RESULTS_H_ +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_IMPORT_IMPORT_RESULTS_H_
diff --git a/components/password_manager/core/browser/import/password_importer.cc b/components/password_manager/core/browser/import/password_importer.cc index 6f73a9d..6195056e 100644 --- a/components/password_manager/core/browser/import/password_importer.cc +++ b/components/password_manager/core/browser/import/password_importer.cc
@@ -18,11 +18,11 @@ #include "base/types/expected_macros.h" #include "components/password_manager/core/browser/import/csv_password.h" #include "components/password_manager/core/browser/import/csv_password_sequence.h" +#include "components/password_manager/core/browser/import/import_results.h" #include "components/password_manager/core/browser/password_form.h" #include "components/password_manager/core/browser/password_manager_util.h" #include "components/password_manager/core/browser/password_ui_utils.h" #include "components/password_manager/core/browser/ui/credential_ui_entry.h" -#include "components/password_manager/core/browser/ui/import_results.h" #include "components/password_manager/core/browser/ui/saved_passwords_presenter.h" #include "components/password_manager/core/common/password_manager_features.h" #include "components/password_manager/services/csv_password/csv_password_parser_service.h"
diff --git a/components/password_manager/core/browser/import/password_importer.h b/components/password_manager/core/browser/import/password_importer.h index f1e11e51..124e20a 100644 --- a/components/password_manager/core/browser/import/password_importer.h +++ b/components/password_manager/core/browser/import/password_importer.h
@@ -10,9 +10,9 @@ #include "base/files/file_path.h" #include "base/functional/callback.h" #include "base/types/expected.h" +#include "components/password_manager/core/browser/import/import_results.h" #include "components/password_manager/core/browser/password_form.h" #include "components/password_manager/core/browser/ui/credential_ui_entry.h" -#include "components/password_manager/core/browser/ui/import_results.h" #include "components/password_manager/services/csv_password/csv_password_parser_service.h" #include "components/password_manager/services/csv_password/public/mojom/csv_password_parser.mojom.h"
diff --git a/components/password_manager/core/browser/import/password_importer_unittest.cc b/components/password_manager/core/browser/import/password_importer_unittest.cc index 1ad6996..48d50c37 100644 --- a/components/password_manager/core/browser/import/password_importer_unittest.cc +++ b/components/password_manager/core/browser/import/password_importer_unittest.cc
@@ -16,9 +16,9 @@ #include "base/test/task_environment.h" #include "components/password_manager/core/browser/affiliation/fake_affiliation_service.h" #include "components/password_manager/core/browser/import/csv_password_sequence.h" +#include "components/password_manager/core/browser/import/import_results.h" #include "components/password_manager/core/browser/test_password_store.h" #include "components/password_manager/core/browser/ui/credential_ui_entry.h" -#include "components/password_manager/core/browser/ui/import_results.h" #include "components/password_manager/core/browser/ui/saved_passwords_presenter.h" #include "components/password_manager/core/common/password_manager_features.h" #include "components/sync/base/features.h"
diff --git a/components/password_manager/core/browser/ui/export_progress_status.h b/components/password_manager/core/browser/ui/export_progress_status.h deleted file mode 100644 index bb2578b..0000000 --- a/components/password_manager/core/browser/ui/export_progress_status.h +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2017 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_EXPORT_PROGRESS_STATUS_H_ -#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_EXPORT_PROGRESS_STATUS_H_ - -namespace password_manager { - -enum class ExportProgressStatus { - NOT_STARTED, - IN_PROGRESS, - SUCCEEDED, - FAILED_CANCELLED, - FAILED_WRITE_FAILED -}; - -} // namespace password_manager - -#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_EXPORT_PROGRESS_STATUS_H_
diff --git a/components/services/storage/service_worker/service_worker_database.cc b/components/services/storage/service_worker/service_worker_database.cc index 75066f6..71e5cb0 100644 --- a/components/services/storage/service_worker/service_worker_database.cc +++ b/components/services/storage/service_worker/service_worker_database.cc
@@ -402,6 +402,529 @@ } } +absl::optional<blink::ServiceWorkerRouterCondition> ConvertToBlinkCondition( + const storage::ServiceWorkerRegistrationData_RouterRules_RuleV1_Condition& + condition) { + blink::ServiceWorkerRouterCondition ret; + switch (condition.condition_case()) { + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + CONDITION_NOT_SET: + return absl::nullopt; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + kUrlPattern: { + ret.type = + blink::ServiceWorkerRouterCondition::ConditionType::kUrlPattern; + blink::SafeUrlPattern url_pattern; + if (condition.url_pattern().legacy_pathname_size() == 0) { + if (condition.url_pattern().protocol_size() > 0) { + auto protocol = + ConvertToBlinkParts(condition.url_pattern().protocol()); + if (!protocol) { + return absl::nullopt; + } + url_pattern.protocol = *protocol; + } + if (condition.url_pattern().username_size() > 0) { + auto username = + ConvertToBlinkParts(condition.url_pattern().username()); + if (!username) { + return absl::nullopt; + } + url_pattern.username = *username; + } + if (condition.url_pattern().password_size() > 0) { + auto password = + ConvertToBlinkParts(condition.url_pattern().password()); + if (!password) { + return absl::nullopt; + } + url_pattern.password = *password; + } + if (condition.url_pattern().hostname_size() > 0) { + auto hostname = + ConvertToBlinkParts(condition.url_pattern().hostname()); + if (!hostname) { + return absl::nullopt; + } + url_pattern.hostname = *hostname; + } + if (condition.url_pattern().port_size() > 0) { + auto port = ConvertToBlinkParts(condition.url_pattern().port()); + if (!port) { + return absl::nullopt; + } + url_pattern.port = *port; + } + if (condition.url_pattern().pathname_size() > 0) { + auto pathname = + ConvertToBlinkParts(condition.url_pattern().pathname()); + if (!pathname) { + return absl::nullopt; + } + url_pattern.pathname = *pathname; + } + if (condition.url_pattern().search_size() > 0) { + auto search = ConvertToBlinkParts(condition.url_pattern().search()); + if (!search) { + return absl::nullopt; + } + url_pattern.search = *search; + } + if (condition.url_pattern().hash_size() > 0) { + auto hash = ConvertToBlinkParts(condition.url_pattern().hash()); + if (!hash) { + return absl::nullopt; + } + url_pattern.hash = *hash; + } + if (condition.url_pattern().has_options()) { + url_pattern.options.ignore_case = + condition.url_pattern().options().ignore_case(); + } + } else { + // Workaround for the legacy URLPattern pathanme implementation. + // It assumes the non-existence of the fields as matching + // anything. i.e. "*". + CHECK_GT(condition.url_pattern().legacy_pathname_size(), 0); + auto pathname = + ConvertToBlinkParts(condition.url_pattern().legacy_pathname()); + if (!pathname) { + return absl::nullopt; + } + url_pattern.pathname = *pathname; + + // Set default "*" to all other fields. + { + liburlpattern::Part part; + part.modifier = liburlpattern::Modifier::kNone; + part.type = liburlpattern::PartType::kFullWildcard; + part.name = "0"; + + url_pattern.protocol.push_back(part); + url_pattern.username.push_back(part); + url_pattern.password.push_back(part); + url_pattern.hostname.push_back(part); + url_pattern.port.push_back(part); + url_pattern.search.push_back(part); + url_pattern.hash.push_back(part); + } + } + ret.url_pattern = std::move(url_pattern); + break; + } + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + kRequest: { + ret.type = blink::ServiceWorkerRouterCondition::ConditionType::kRequest; + blink::ServiceWorkerRouterRequestCondition request; + if (condition.request().has_method()) { + request.method = condition.request().method(); + } + if (condition.request().has_mode()) { + switch (condition.request().mode()) { + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kSameOriginMode: + request.mode = network::mojom::RequestMode::kSameOrigin; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kNoCorsMode: + request.mode = network::mojom::RequestMode::kNoCors; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kCorsMode: + request.mode = network::mojom::RequestMode::kCors; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kCorsWithForcedPreflightMode: + request.mode = + network::mojom::RequestMode::kCorsWithForcedPreflight; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kNavigateMode: + request.mode = network::mojom::RequestMode::kNavigate; + break; + } + } + if (condition.request().has_destination()) { + switch (condition.request().destination()) { + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kEmptyDestination: + request.destination = network::mojom::RequestDestination::kEmpty; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kAudioDestination: + request.destination = network::mojom::RequestDestination::kAudio; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kAudioWorkletDestination: + request.destination = + network::mojom::RequestDestination::kAudioWorklet; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kDocumentDestination: + request.destination = network::mojom::RequestDestination::kDocument; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kEmbedDestination: + request.destination = network::mojom::RequestDestination::kEmbed; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kFontDestination: + request.destination = network::mojom::RequestDestination::kFont; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kFrameDestination: + request.destination = network::mojom::RequestDestination::kFrame; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kIframeDestination: + request.destination = network::mojom::RequestDestination::kIframe; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kImageDestination: + request.destination = network::mojom::RequestDestination::kImage; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kManifestDestination: + request.destination = network::mojom::RequestDestination::kManifest; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kObjectDestination: + request.destination = network::mojom::RequestDestination::kObject; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kPaintWorkletDestination: + request.destination = + network::mojom::RequestDestination::kPaintWorklet; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kReportDestination: + request.destination = network::mojom::RequestDestination::kReport; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kScriptDestination: + request.destination = network::mojom::RequestDestination::kScript; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kServiceWorkerDestination: + request.destination = + network::mojom::RequestDestination::kServiceWorker; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kSharedWorkerDestination: + request.destination = + network::mojom::RequestDestination::kSharedWorker; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kStyleDestination: + request.destination = network::mojom::RequestDestination::kStyle; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kTrackDestination: + request.destination = network::mojom::RequestDestination::kTrack; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kVideoDestination: + request.destination = network::mojom::RequestDestination::kVideo; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kWebBundleDestination: + request.destination = + network::mojom::RequestDestination::kWebBundle; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kWorkerDestination: + request.destination = network::mojom::RequestDestination::kWorker; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kXsltDestination: + request.destination = network::mojom::RequestDestination::kXslt; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kFencedframeDestination: + request.destination = + network::mojom::RequestDestination::kFencedframe; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kWebIdentityDestination: + request.destination = + network::mojom::RequestDestination::kWebIdentity; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kDictionaryDestination: + request.destination = + network::mojom::RequestDestination::kDictionary; + break; + } + } + ret.request = request; + break; + } + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + kRunningStatus: { + ret.type = + blink::ServiceWorkerRouterCondition::ConditionType::kRunningStatus; + blink::ServiceWorkerRouterRunningStatusCondition running_status; + if (!condition.has_running_status() || + !condition.running_status().has_status()) { + return absl::nullopt; + } + switch (condition.running_status().status()) { + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + RunningStatus::kRunning: + running_status.status = + blink::ServiceWorkerRouterRunningStatusCondition:: + RunningStatusEnum::kRunning; + break; + case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + RunningStatus::kNotRunning: + running_status.status = + blink::ServiceWorkerRouterRunningStatusCondition:: + RunningStatusEnum::kNotRunning; + break; + } + ret.running_status = running_status; + break; + } + } + + return ret; +} + +void WriteConditionToProto( + const blink::ServiceWorkerRouterCondition& condition, + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition* out) { + switch (condition.type) { + case blink::ServiceWorkerRouterCondition::ConditionType::kUrlPattern: { + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition::URLPattern* + mutable_url_pattern = out->mutable_url_pattern(); + CHECK(!condition.url_pattern->protocol.empty() || + !condition.url_pattern->username.empty() || + !condition.url_pattern->password.empty() || + !condition.url_pattern->hostname.empty() || + !condition.url_pattern->port.empty() || + !condition.url_pattern->pathname.empty() || + !condition.url_pattern->search.empty() || + !condition.url_pattern->hash.empty()); + if (!condition.url_pattern->protocol.empty()) { + ConvertToProtoParts(condition.url_pattern->protocol, + mutable_url_pattern->mutable_protocol()); + } + if (!condition.url_pattern->username.empty()) { + ConvertToProtoParts(condition.url_pattern->username, + mutable_url_pattern->mutable_username()); + } + if (!condition.url_pattern->password.empty()) { + ConvertToProtoParts(condition.url_pattern->password, + mutable_url_pattern->mutable_password()); + } + if (!condition.url_pattern->hostname.empty()) { + ConvertToProtoParts(condition.url_pattern->hostname, + mutable_url_pattern->mutable_hostname()); + } + if (!condition.url_pattern->port.empty()) { + ConvertToProtoParts(condition.url_pattern->port, + mutable_url_pattern->mutable_port()); + } + if (!condition.url_pattern->pathname.empty()) { + ConvertToProtoParts(condition.url_pattern->pathname, + mutable_url_pattern->mutable_pathname()); + } + if (!condition.url_pattern->search.empty()) { + ConvertToProtoParts(condition.url_pattern->search, + mutable_url_pattern->mutable_search()); + } + if (!condition.url_pattern->hash.empty()) { + ConvertToProtoParts(condition.url_pattern->hash, + mutable_url_pattern->mutable_hash()); + } + mutable_url_pattern->mutable_options()->set_ignore_case( + condition.url_pattern->options.ignore_case); + break; + } + case blink::ServiceWorkerRouterCondition::ConditionType::kRequest: { + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition::Request* + request = out->mutable_request(); + if (condition.request->method) { + request->set_method(*condition.request->method); + } + if (condition.request->mode) { + switch (*condition.request->mode) { + case network::mojom::RequestMode::kSameOrigin: + request->set_mode(ServiceWorkerRegistrationData::RouterRules:: + RuleV1::Condition::Request::kSameOriginMode); + break; + case network::mojom::RequestMode::kNoCors: + request->set_mode(ServiceWorkerRegistrationData::RouterRules:: + RuleV1::Condition::Request::kNoCorsMode); + break; + case network::mojom::RequestMode::kCors: + request->set_mode(ServiceWorkerRegistrationData::RouterRules:: + RuleV1::Condition::Request::kCorsMode); + break; + case network::mojom::RequestMode::kCorsWithForcedPreflight: + request->set_mode( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kCorsWithForcedPreflightMode); + break; + case network::mojom::RequestMode::kNavigate: + request->set_mode(ServiceWorkerRegistrationData::RouterRules:: + RuleV1::Condition::Request::kNavigateMode); + break; + } + } + if (condition.request->destination) { + switch (*condition.request->destination) { + case network::mojom::RequestDestination::kEmpty: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kEmptyDestination); + break; + case network::mojom::RequestDestination::kAudio: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kAudioDestination); + break; + case network::mojom::RequestDestination::kAudioWorklet: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kAudioWorkletDestination); + break; + case network::mojom::RequestDestination::kDocument: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kDocumentDestination); + break; + case network::mojom::RequestDestination::kEmbed: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kEmbedDestination); + break; + case network::mojom::RequestDestination::kFont: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kFontDestination); + break; + case network::mojom::RequestDestination::kFrame: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kFrameDestination); + break; + case network::mojom::RequestDestination::kIframe: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kIframeDestination); + break; + case network::mojom::RequestDestination::kImage: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kImageDestination); + break; + case network::mojom::RequestDestination::kManifest: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kManifestDestination); + break; + case network::mojom::RequestDestination::kObject: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kObjectDestination); + break; + case network::mojom::RequestDestination::kPaintWorklet: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kPaintWorkletDestination); + break; + case network::mojom::RequestDestination::kReport: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kReportDestination); + break; + case network::mojom::RequestDestination::kScript: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kScriptDestination); + break; + case network::mojom::RequestDestination::kServiceWorker: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kServiceWorkerDestination); + break; + case network::mojom::RequestDestination::kSharedWorker: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kSharedWorkerDestination); + break; + case network::mojom::RequestDestination::kStyle: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kStyleDestination); + break; + case network::mojom::RequestDestination::kTrack: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kTrackDestination); + break; + case network::mojom::RequestDestination::kVideo: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kVideoDestination); + break; + case network::mojom::RequestDestination::kWebBundle: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kWebBundleDestination); + break; + case network::mojom::RequestDestination::kWorker: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kWorkerDestination); + break; + case network::mojom::RequestDestination::kXslt: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kXsltDestination); + break; + case network::mojom::RequestDestination::kFencedframe: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kFencedframeDestination); + break; + case network::mojom::RequestDestination::kWebIdentity: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kWebIdentityDestination); + break; + case network::mojom::RequestDestination::kDictionary: + request->set_destination( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + Request::kDictionaryDestination); + break; + } + } + break; + } + case blink::ServiceWorkerRouterCondition::ConditionType::kRunningStatus: { + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + RunningStatus* running_status = out->mutable_running_status(); + switch (condition.running_status->status) { + case blink::ServiceWorkerRouterRunningStatusCondition:: + RunningStatusEnum::kRunning: + running_status->set_status( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + RunningStatus::kRunning); + break; + case blink::ServiceWorkerRouterRunningStatusCondition:: + RunningStatusEnum::kNotRunning: + running_status->set_status( + ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: + RunningStatus::kNotRunning); + break; + } + break; + } + } +} + } // namespace const char* ServiceWorkerDatabase::StatusToString( @@ -2089,299 +2612,13 @@ for (const auto& r : data.router_rules().v1()) { blink::ServiceWorkerRouterRule router_rule; for (const auto& c : r.condition()) { - blink::ServiceWorkerRouterCondition condition; - switch (c.condition_case()) { - case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: - CONDITION_NOT_SET: - return Status::kErrorCorrupted; - case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: - kUrlPattern: { - condition.type = - blink::ServiceWorkerRouterCondition::ConditionType::kUrlPattern; - blink::SafeUrlPattern url_pattern; - if (c.url_pattern().legacy_pathname_size() == 0) { - if (c.url_pattern().protocol_size() > 0) { - auto protocol = ConvertToBlinkParts(c.url_pattern().protocol()); - if (!protocol) { - return Status::kErrorCorrupted; - } - url_pattern.protocol = *protocol; - } - if (c.url_pattern().username_size() > 0) { - auto username = ConvertToBlinkParts(c.url_pattern().username()); - if (!username) { - return Status::kErrorCorrupted; - } - url_pattern.username = *username; - } - if (c.url_pattern().password_size() > 0) { - auto password = ConvertToBlinkParts(c.url_pattern().password()); - if (!password) { - return Status::kErrorCorrupted; - } - url_pattern.password = *password; - } - if (c.url_pattern().hostname_size() > 0) { - auto hostname = ConvertToBlinkParts(c.url_pattern().hostname()); - if (!hostname) { - return Status::kErrorCorrupted; - } - url_pattern.hostname = *hostname; - } - if (c.url_pattern().port_size() > 0) { - auto port = ConvertToBlinkParts(c.url_pattern().port()); - if (!port) { - return Status::kErrorCorrupted; - } - url_pattern.port = *port; - } - if (c.url_pattern().pathname_size() > 0) { - auto pathname = ConvertToBlinkParts(c.url_pattern().pathname()); - if (!pathname) { - return Status::kErrorCorrupted; - } - url_pattern.pathname = *pathname; - } - if (c.url_pattern().search_size() > 0) { - auto search = ConvertToBlinkParts(c.url_pattern().search()); - if (!search) { - return Status::kErrorCorrupted; - } - url_pattern.search = *search; - } - if (c.url_pattern().hash_size() > 0) { - auto hash = ConvertToBlinkParts(c.url_pattern().hash()); - if (!hash) { - return Status::kErrorCorrupted; - } - url_pattern.hash = *hash; - } - if (c.url_pattern().has_options()) { - url_pattern.options.ignore_case = - c.url_pattern().options().ignore_case(); - } - } else { - // Workaround for the legacy URLPattern pathanme implementation. - // It assumes the non-existence of the fields as matching - // anything. i.e. "*". - CHECK_GT(c.url_pattern().legacy_pathname_size(), 0); - auto pathname = - ConvertToBlinkParts(c.url_pattern().legacy_pathname()); - if (!pathname) { - return Status::kErrorCorrupted; - } - url_pattern.pathname = *pathname; - - // Set default "*" to all other fields. - { - liburlpattern::Part part; - part.modifier = liburlpattern::Modifier::kNone; - part.type = liburlpattern::PartType::kFullWildcard; - part.name = "0"; - - url_pattern.protocol.push_back(part); - url_pattern.username.push_back(part); - url_pattern.password.push_back(part); - url_pattern.hostname.push_back(part); - url_pattern.port.push_back(part); - url_pattern.search.push_back(part); - url_pattern.hash.push_back(part); - } - } - condition.url_pattern = std::move(url_pattern); - break; - } - case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: - kRequest: { - condition.type = - blink::ServiceWorkerRouterCondition::ConditionType::kRequest; - blink::ServiceWorkerRouterRequestCondition request; - if (c.request().has_method()) { - request.method = c.request().method(); - } - if (c.request().has_mode()) { - switch (c.request().mode()) { - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kSameOriginMode: - request.mode = network::mojom::RequestMode::kSameOrigin; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kNoCorsMode: - request.mode = network::mojom::RequestMode::kNoCors; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kCorsMode: - request.mode = network::mojom::RequestMode::kCors; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kCorsWithForcedPreflightMode: - request.mode = - network::mojom::RequestMode::kCorsWithForcedPreflight; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kNavigateMode: - request.mode = network::mojom::RequestMode::kNavigate; - break; - } - } - if (c.request().has_destination()) { - switch (c.request().destination()) { - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kEmptyDestination: - request.destination = - network::mojom::RequestDestination::kEmpty; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kAudioDestination: - request.destination = - network::mojom::RequestDestination::kAudio; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kAudioWorkletDestination: - request.destination = - network::mojom::RequestDestination::kAudioWorklet; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kDocumentDestination: - request.destination = - network::mojom::RequestDestination::kDocument; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kEmbedDestination: - request.destination = - network::mojom::RequestDestination::kEmbed; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kFontDestination: - request.destination = - network::mojom::RequestDestination::kFont; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kFrameDestination: - request.destination = - network::mojom::RequestDestination::kFrame; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kIframeDestination: - request.destination = - network::mojom::RequestDestination::kIframe; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kImageDestination: - request.destination = - network::mojom::RequestDestination::kImage; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kManifestDestination: - request.destination = - network::mojom::RequestDestination::kManifest; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kObjectDestination: - request.destination = - network::mojom::RequestDestination::kObject; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kPaintWorkletDestination: - request.destination = - network::mojom::RequestDestination::kPaintWorklet; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kReportDestination: - request.destination = - network::mojom::RequestDestination::kReport; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kScriptDestination: - request.destination = - network::mojom::RequestDestination::kScript; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kServiceWorkerDestination: - request.destination = - network::mojom::RequestDestination::kServiceWorker; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kSharedWorkerDestination: - request.destination = - network::mojom::RequestDestination::kSharedWorker; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kStyleDestination: - request.destination = - network::mojom::RequestDestination::kStyle; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kTrackDestination: - request.destination = - network::mojom::RequestDestination::kTrack; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kVideoDestination: - request.destination = - network::mojom::RequestDestination::kVideo; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kWebBundleDestination: - request.destination = - network::mojom::RequestDestination::kWebBundle; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kWorkerDestination: - request.destination = - network::mojom::RequestDestination::kWorker; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kXsltDestination: - request.destination = - network::mojom::RequestDestination::kXslt; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kFencedframeDestination: - request.destination = - network::mojom::RequestDestination::kFencedframe; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kWebIdentityDestination: - request.destination = - network::mojom::RequestDestination::kWebIdentity; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kDictionaryDestination: - request.destination = - network::mojom::RequestDestination::kDictionary; - break; - } - } - condition.request = request; - break; - } - case ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: - kRunningStatus: { - condition.type = blink::ServiceWorkerRouterCondition:: - ConditionType::kRunningStatus; - blink::ServiceWorkerRouterRunningStatusCondition running_status; - if (!c.has_running_status() || !c.running_status().has_status()) { - return Status::kErrorCorrupted; - } - switch (c.running_status().status()) { - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::RunningStatus::kRunning: - running_status.status = - blink::ServiceWorkerRouterRunningStatusCondition:: - RunningStatusEnum::kRunning; - break; - case ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::RunningStatus::kNotRunning: - running_status.status = - blink::ServiceWorkerRouterRunningStatusCondition:: - RunningStatusEnum::kNotRunning; - break; - } - condition.running_status = running_status; - } + absl::optional<blink::ServiceWorkerRouterCondition> condition = + ConvertToBlinkCondition(c); + if (condition) { + router_rule.conditions.emplace_back(std::move(*condition)); + } else { + return Status::kErrorCorrupted; } - router_rule.conditions.emplace_back(condition); } for (const auto& s : r.source()) { blink::ServiceWorkerRouterSource source; @@ -2615,242 +2852,7 @@ for (const auto& c : r.conditions) { ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition* condition = v1->add_condition(); - switch (c.type) { - case blink::ServiceWorkerRouterCondition::ConditionType:: - kUrlPattern: { - ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: - URLPattern* mutable_url_pattern = - condition->mutable_url_pattern(); - CHECK(!c.url_pattern->protocol.empty() || - !c.url_pattern->username.empty() || - !c.url_pattern->password.empty() || - !c.url_pattern->hostname.empty() || - !c.url_pattern->port.empty() || - !c.url_pattern->pathname.empty() || - !c.url_pattern->search.empty() || - !c.url_pattern->hash.empty()); - if (!c.url_pattern->protocol.empty()) { - ConvertToProtoParts(c.url_pattern->protocol, - mutable_url_pattern->mutable_protocol()); - } - if (!c.url_pattern->username.empty()) { - ConvertToProtoParts(c.url_pattern->username, - mutable_url_pattern->mutable_username()); - } - if (!c.url_pattern->password.empty()) { - ConvertToProtoParts(c.url_pattern->password, - mutable_url_pattern->mutable_password()); - } - if (!c.url_pattern->hostname.empty()) { - ConvertToProtoParts(c.url_pattern->hostname, - mutable_url_pattern->mutable_hostname()); - } - if (!c.url_pattern->port.empty()) { - ConvertToProtoParts(c.url_pattern->port, - mutable_url_pattern->mutable_port()); - } - if (!c.url_pattern->pathname.empty()) { - ConvertToProtoParts(c.url_pattern->pathname, - mutable_url_pattern->mutable_pathname()); - } - if (!c.url_pattern->search.empty()) { - ConvertToProtoParts(c.url_pattern->search, - mutable_url_pattern->mutable_search()); - } - if (!c.url_pattern->hash.empty()) { - ConvertToProtoParts(c.url_pattern->hash, - mutable_url_pattern->mutable_hash()); - } - mutable_url_pattern->mutable_options()->set_ignore_case( - c.url_pattern->options.ignore_case); - break; - } - case blink::ServiceWorkerRouterCondition::ConditionType::kRequest: { - ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: - Request* request = condition->mutable_request(); - if (c.request->method) { - request->set_method(*c.request->method); - } - if (c.request->mode) { - switch (*c.request->mode) { - case network::mojom::RequestMode::kSameOrigin: - request->set_mode( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kSameOriginMode); - break; - case network::mojom::RequestMode::kNoCors: - request->set_mode( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kNoCorsMode); - break; - case network::mojom::RequestMode::kCors: - request->set_mode(ServiceWorkerRegistrationData::RouterRules:: - RuleV1::Condition::Request::kCorsMode); - break; - case network::mojom::RequestMode::kCorsWithForcedPreflight: - request->set_mode( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kCorsWithForcedPreflightMode); - break; - case network::mojom::RequestMode::kNavigate: - request->set_mode( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kNavigateMode); - break; - } - } - if (c.request->destination) { - switch (*c.request->destination) { - case network::mojom::RequestDestination::kEmpty: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kEmptyDestination); - break; - case network::mojom::RequestDestination::kAudio: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kAudioDestination); - break; - case network::mojom::RequestDestination::kAudioWorklet: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kAudioWorkletDestination); - break; - case network::mojom::RequestDestination::kDocument: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kDocumentDestination); - break; - case network::mojom::RequestDestination::kEmbed: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kEmbedDestination); - break; - case network::mojom::RequestDestination::kFont: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kFontDestination); - break; - case network::mojom::RequestDestination::kFrame: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kFrameDestination); - break; - case network::mojom::RequestDestination::kIframe: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kIframeDestination); - break; - case network::mojom::RequestDestination::kImage: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kImageDestination); - break; - case network::mojom::RequestDestination::kManifest: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kManifestDestination); - break; - case network::mojom::RequestDestination::kObject: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kObjectDestination); - break; - case network::mojom::RequestDestination::kPaintWorklet: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kPaintWorkletDestination); - break; - case network::mojom::RequestDestination::kReport: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kReportDestination); - break; - case network::mojom::RequestDestination::kScript: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kScriptDestination); - break; - case network::mojom::RequestDestination::kServiceWorker: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kServiceWorkerDestination); - break; - case network::mojom::RequestDestination::kSharedWorker: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kSharedWorkerDestination); - break; - case network::mojom::RequestDestination::kStyle: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kStyleDestination); - break; - case network::mojom::RequestDestination::kTrack: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kTrackDestination); - break; - case network::mojom::RequestDestination::kVideo: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kVideoDestination); - break; - case network::mojom::RequestDestination::kWebBundle: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kWebBundleDestination); - break; - case network::mojom::RequestDestination::kWorker: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kWorkerDestination); - break; - case network::mojom::RequestDestination::kXslt: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kXsltDestination); - break; - case network::mojom::RequestDestination::kFencedframe: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kFencedframeDestination); - break; - case network::mojom::RequestDestination::kWebIdentity: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kWebIdentityDestination); - break; - case network::mojom::RequestDestination::kDictionary: - request->set_destination( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::Request::kDictionaryDestination); - break; - } - } - break; - } - case blink::ServiceWorkerRouterCondition::ConditionType:: - kRunningStatus: { - ServiceWorkerRegistrationData::RouterRules::RuleV1::Condition:: - RunningStatus* running_status = - condition->mutable_running_status(); - switch (c.running_status->status) { - case blink::ServiceWorkerRouterRunningStatusCondition:: - RunningStatusEnum::kRunning: - running_status->set_status( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::RunningStatus::kRunning); - break; - case blink::ServiceWorkerRouterRunningStatusCondition:: - RunningStatusEnum::kNotRunning: - running_status->set_status( - ServiceWorkerRegistrationData::RouterRules::RuleV1:: - Condition::RunningStatus::kNotRunning); - break; - } - } - } + WriteConditionToProto(c, condition); } for (const auto& s : r.sources) { ServiceWorkerRegistrationData::RouterRules::RuleV1::Source* source =
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index f3a9f077..87a39bc4 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -2713,8 +2713,15 @@ } else if (is_ios) { sources += [ "child_process_launcher_helper_ios.cc", + "date_time_chooser/ios/date_time_chooser_coordinator.h", + "date_time_chooser/ios/date_time_chooser_coordinator.mm", + "date_time_chooser/ios/date_time_chooser_delegate.h", "date_time_chooser/ios/date_time_chooser_ios.h", "date_time_chooser/ios/date_time_chooser_ios.mm", + "date_time_chooser/ios/date_time_chooser_mediator.h", + "date_time_chooser/ios/date_time_chooser_mediator.mm", + "date_time_chooser/ios/date_time_chooser_view_controller.h", + "date_time_chooser/ios/date_time_chooser_view_controller.mm", "devtools/protocol/native_input_event_builder_ios.mm", "renderer_host/browser_compositor_ios.h", "renderer_host/browser_compositor_ios.mm",
diff --git a/content/browser/date_time_chooser/ios/date_time_chooser_coordinator.h b/content/browser/date_time_chooser/ios/date_time_chooser_coordinator.h new file mode 100644 index 0000000..e4a67787 --- /dev/null +++ b/content/browser/date_time_chooser/ios/date_time_chooser_coordinator.h
@@ -0,0 +1,34 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_COORDINATOR_H_ +#define CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_COORDINATOR_H_ + +#import <Foundation/Foundation.h> + +#import "third_party/blink/public/mojom/choosers/date_time_chooser.mojom.h" +#import "ui/gfx/native_widget_types.h" + +using DateTimeDialogValuePtr = blink::mojom::DateTimeDialogValuePtr; + +@class DateTimeChooserViewController; +@class DateTimeChooserMediator; +@class UIViewController; + +namespace content { +class DateTimeChooserIOS; +} + +// Holds a controller and a mediator so that communicates UI and Mojo +// implementations. +@interface DateTimeChooserCoordinator : NSObject + +// Initializer. +- (instancetype)initWithDateTimeChooser:(content::DateTimeChooserIOS*)chooser + configs:(DateTimeDialogValuePtr)configs + baseViewController:(UIViewController*)baseViewController; + +@end + +#endif // CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_COORDINATOR_H_
diff --git a/content/browser/date_time_chooser/ios/date_time_chooser_coordinator.mm b/content/browser/date_time_chooser/ios/date_time_chooser_coordinator.mm new file mode 100644 index 0000000..602672f --- /dev/null +++ b/content/browser/date_time_chooser/ios/date_time_chooser_coordinator.mm
@@ -0,0 +1,51 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "content/browser/date_time_chooser/ios/date_time_chooser_coordinator.h" + +#import "content/browser/date_time_chooser/ios/date_time_chooser_mediator.h" +#import "content/browser/date_time_chooser/ios/date_time_chooser_view_controller.h" +#import "ui/gfx/native_widget_types.h" + +@interface DateTimeChooserCoordinator () +// The controller that has UI components. +@property(nonatomic, strong) + DateTimeChooserViewController* dateTimeChooserController; + +// The mediator that has DateTimeChooser. +@property(nonatomic, strong) DateTimeChooserMediator* dateTimeChooserMediator; +@end + +@implementation DateTimeChooserCoordinator + +- (instancetype)initWithDateTimeChooser:(content::DateTimeChooserIOS*)chooser + configs:(DateTimeDialogValuePtr)configs + baseViewController:(UIViewController*)baseViewController { + if (!(self = [super init])) { + return nil; + } + _dateTimeChooserMediator = + [[DateTimeChooserMediator alloc] initWithDateTimeChooser:chooser]; + + _dateTimeChooserController = [[DateTimeChooserViewController alloc] + initWithConfigs:std::move(configs)]; + _dateTimeChooserController.delegate = _dateTimeChooserMediator; + _dateTimeChooserController.view.backgroundColor = [UIColor whiteColor]; + _dateTimeChooserController.modalInPresentation = true; + _dateTimeChooserController.modalPresentationStyle = + UIModalPresentationPopover; + _dateTimeChooserController.popoverPresentationController.delegate = + _dateTimeChooserController; + _dateTimeChooserController.popoverPresentationController.sourceView = + baseViewController.view; + _dateTimeChooserController.popoverPresentationController.sourceRect = + baseViewController.view.bounds; + + [baseViewController presentViewController:_dateTimeChooserController + animated:true + completion:nil]; + return self; +} + +@end
diff --git a/content/browser/date_time_chooser/ios/date_time_chooser_delegate.h b/content/browser/date_time_chooser/ios/date_time_chooser_delegate.h new file mode 100644 index 0000000..80c3832 --- /dev/null +++ b/content/browser/date_time_chooser/ios/date_time_chooser_delegate.h
@@ -0,0 +1,22 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_DELEGATE_H_ +#define CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_DELEGATE_H_ + +#import <Foundation/Foundation.h> + +@class DateTimeChooserViewController; + +// Delegate to handle actions. +@protocol DateTimeChooserDelegate <NSObject> + +// Method invoked when the user closed a dialog. +- (void)dateTimeChooser:(DateTimeChooserViewController*)chooser + didCloseSuccessfully:(BOOL)success + withDate:(NSDate*)date; + +@end + +#endif // CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_DELEGATE_H_
diff --git a/content/browser/date_time_chooser/ios/date_time_chooser_ios.h b/content/browser/date_time_chooser/ios/date_time_chooser_ios.h index 181a7ce..cb38e92 100644 --- a/content/browser/date_time_chooser/ios/date_time_chooser_ios.h +++ b/content/browser/date_time_chooser/ios/date_time_chooser_ios.h
@@ -9,6 +9,8 @@ #include "content/common/content_export.h" #include "third_party/blink/public/mojom/choosers/date_time_chooser.mojom-forward.h" +@class DateTimeChooserCoordinator; + namespace content { // IOS implementation for DateTimeChooser dialogs. @@ -20,11 +22,17 @@ DateTimeChooserIOS(const DateTimeChooserIOS&) = delete; DateTimeChooserIOS& operator=(const DateTimeChooserIOS&) = delete; + // Called when a dialog is closed by a user action. + void OnDialogClosed(bool success, double value); + protected: // DateTimeChooser: void OpenPlatformDialog(blink::mojom::DateTimeDialogValuePtr value, OpenDateTimeDialogCallback callback) override; void ClosePlatformDialog() override; + + private: + DateTimeChooserCoordinator* __strong coordinator_; }; } // namespace content
diff --git a/content/browser/date_time_chooser/ios/date_time_chooser_ios.mm b/content/browser/date_time_chooser/ios/date_time_chooser_ios.mm index c372a40..8fc2057 100644 --- a/content/browser/date_time_chooser/ios/date_time_chooser_ios.mm +++ b/content/browser/date_time_chooser/ios/date_time_chooser_ios.mm
@@ -4,6 +4,11 @@ #import "content/browser/date_time_chooser/ios/date_time_chooser_ios.h" +#import <UIKit/UIKit.h> + +#import "content/browser/date_time_chooser/ios/date_time_chooser_coordinator.h" +#import "ui/gfx/native_widget_types.h" + namespace content { // DateTimeChooserIOS implementation @@ -12,15 +17,26 @@ DateTimeChooserIOS::~DateTimeChooserIOS() = default; +void DateTimeChooserIOS::OnDialogClosed(bool success, double value) { + if (open_date_time_response_callback_) { + std::move(open_date_time_response_callback_).Run(success, value); + } + ClosePlatformDialog(); +} + void DateTimeChooserIOS::OpenPlatformDialog( blink::mojom::DateTimeDialogValuePtr value, OpenDateTimeDialogCallback callback) { - // TODO(crbug.com/1461947): Create a coordninator to handle UI components. - std::move(callback).Run(false, 0); + open_date_time_response_callback_ = std::move(callback); + gfx::NativeWindow gfx_window = GetWebContents().GetTopLevelNativeWindow(); + coordinator_ = [[DateTimeChooserCoordinator alloc] + initWithDateTimeChooser:this + configs:std::move(value) + baseViewController:gfx_window.Get().rootViewController]; } void DateTimeChooserIOS::ClosePlatformDialog() { - // TODO(crbug.com/1461947): Close a dialog and clean it up. + coordinator_ = nil; } // static
diff --git a/content/browser/date_time_chooser/ios/date_time_chooser_mediator.h b/content/browser/date_time_chooser/ios/date_time_chooser_mediator.h new file mode 100644 index 0000000..3b5b054 --- /dev/null +++ b/content/browser/date_time_chooser/ios/date_time_chooser_mediator.h
@@ -0,0 +1,24 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_MEDIATOR_H_ +#define CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_MEDIATOR_H_ + +#import <Foundation/Foundation.h> + +#import "content/browser/date_time_chooser/ios/date_time_chooser_delegate.h" + +namespace content { +class DateTimeChooserIOS; +} // namespace content + +// Communicates with content::DateTimeChooserIOS. +@interface DateTimeChooserMediator : NSObject <DateTimeChooserDelegate> + +// Initializer. +- (instancetype)initWithDateTimeChooser: + (content::DateTimeChooserIOS*)dateTimeChooser; +@end + +#endif // CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_MEDIATOR_H_
diff --git a/content/browser/date_time_chooser/ios/date_time_chooser_mediator.mm b/content/browser/date_time_chooser/ios/date_time_chooser_mediator.mm new file mode 100644 index 0000000..90c5af07 --- /dev/null +++ b/content/browser/date_time_chooser/ios/date_time_chooser_mediator.mm
@@ -0,0 +1,33 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "content/browser/date_time_chooser/ios/date_time_chooser_mediator.h" + +#import "content/browser/date_time_chooser/ios/date_time_chooser_ios.h" + +@interface DateTimeChooserMediator () +@property(nonatomic, assign) content::DateTimeChooserIOS* dateTimeChooser; +@end + +@implementation DateTimeChooserMediator +- (instancetype)initWithDateTimeChooser: + (content::DateTimeChooserIOS*)dateTimeChooser { + if (!(self = [super init])) { + return nil; + } + + _dateTimeChooser = dateTimeChooser; + return self; +} + +#pragma mark - DateTimeChooserDelegate + +- (void)dateTimeChooser:(DateTimeChooserViewController*)chooser + didCloseSuccessfully:(BOOL)success + withDate:(NSDate*)date { + self.dateTimeChooser->OnDialogClosed(success, + [date timeIntervalSince1970] * 1000); +} + +@end
diff --git a/content/browser/date_time_chooser/ios/date_time_chooser_view_controller.h b/content/browser/date_time_chooser/ios/date_time_chooser_view_controller.h new file mode 100644 index 0000000..68db22f --- /dev/null +++ b/content/browser/date_time_chooser/ios/date_time_chooser_view_controller.h
@@ -0,0 +1,26 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_VIEW_CONTROLLER_H_ +#define CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_VIEW_CONTROLLER_H_ + +#import <Foundation/Foundation.h> +#import <UIKit/UIKit.h> + +#import "content/browser/date_time_chooser/ios/date_time_chooser_coordinator.h" +#import "content/browser/date_time_chooser/ios/date_time_chooser_delegate.h" + +// The ViewController that has UIDatePicker. +@interface DateTimeChooserViewController + : UIViewController <UIPopoverPresentationControllerDelegate> + +// Delegate used to tell DateTimeChooser the controller status. +@property(nonatomic, weak) id<DateTimeChooserDelegate> delegate; + +// Initializer. +- (instancetype)initWithConfigs:(DateTimeDialogValuePtr)configs; + +@end + +#endif // CONTENT_BROWSER_DATE_TIME_CHOOSER_IOS_DATE_TIME_CHOOSER_VIEW_CONTROLLER_H_
diff --git a/content/browser/date_time_chooser/ios/date_time_chooser_view_controller.mm b/content/browser/date_time_chooser/ios/date_time_chooser_view_controller.mm new file mode 100644 index 0000000..2dd0155 --- /dev/null +++ b/content/browser/date_time_chooser/ios/date_time_chooser_view_controller.mm
@@ -0,0 +1,137 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "content/browser/date_time_chooser/ios/date_time_chooser_view_controller.h" + +#import "base/notreached.h" +#import "third_party/blink/public/mojom/choosers/date_time_chooser.mojom.h" +#import "ui/base/ime/text_input_type.h" + +const CGFloat kToolBarHeight = 44; + +@interface DateTimeChooserViewController () +// The type to set the date picker mode +@property(nonatomic, assign) ui::TextInputType type; +// Initalized time for the date picker +@property(nonatomic, assign) NSInteger initTimeInMS; +// Updated with the selected date in the date picker +@property(nonatomic, assign) NSDate* selectedDate; +@end + +@implementation DateTimeChooserViewController + +- (instancetype)initWithConfigs:(DateTimeDialogValuePtr)configs { + if (!(self = [super init])) { + return nil; + } + _delegate = nil; + _type = configs->dialog_type; + _initTimeInMS = configs->dialog_value; + return self; +} + +- (UIDatePicker*)createUIDatePicker { + UIDatePicker* datePicker = [[UIDatePicker alloc] init]; + switch (self.type) { + case ui::TextInputType::TEXT_INPUT_TYPE_DATE: + datePicker.datePickerMode = UIDatePickerModeDate; + break; + case ui::TextInputType::TEXT_INPUT_TYPE_DATE_TIME: + case ui::TextInputType::TEXT_INPUT_TYPE_DATE_TIME_LOCAL: + case ui::TextInputType::TEXT_INPUT_TYPE_MONTH: + case ui::TextInputType::TEXT_INPUT_TYPE_TIME: + case ui::TextInputType::TEXT_INPUT_TYPE_WEEK: + // TODO(crbug.com/1461947): Set the mode based on each type and handle the + // selected value with the format matched to the mode. + datePicker.datePickerMode = UIDatePickerModeDate; + break; + default: + NOTREACHED() << "Invalid type for a DateTimeChooser."; + break; + } + datePicker.preferredDatePickerStyle = UIDatePickerStyleInline; + + // Convert milliseconds to seconds. + NSTimeInterval dialogValue = self.initTimeInMS / 1000; + NSDate* initValue = [NSDate dateWithTimeIntervalSince1970:dialogValue]; + [datePicker setDate:initValue animated:FALSE]; + [datePicker addTarget:self + action:@selector(datePickerValueChanged:) + forControlEvents:UIControlEventValueChanged]; + return datePicker; +} + +- (void)cancelButtonTapped { + [[self presentingViewController] dismissViewControllerAnimated:YES + completion:nil]; + [self.delegate dateTimeChooser:self + didCloseSuccessfully:FALSE + withDate:self.selectedDate]; +} + +- (void)doneButtonTapped { + [[self presentingViewController] dismissViewControllerAnimated:YES + completion:nil]; + // Convert seconds to miliseconds. + [self.delegate dateTimeChooser:self + didCloseSuccessfully:TRUE + withDate:self.selectedDate]; +} + +- (void)datePickerValueChanged:(UIDatePicker*)datePicker { + self.selectedDate = datePicker.date; +} + +// Adds subviews for a UI component with UIDatePicker and buttons. +// +// ------------------------------------- +// +// +// UIDatePicker +// +// +// -------------------------------------- +// | Cancel | flexibleSpace | Done | +// -------------------------------------- +// +- (void)viewWillAppear:(BOOL)animated { + UIDatePicker* datePicker = [self createUIDatePicker]; + // Create a ToolBar for buttons. + UIToolbar* toolbar = [[UIToolbar alloc] + initWithFrame:CGRectMake(0, 0, datePicker.frame.size.width, + kToolBarHeight)]; + UIBarButtonItem* cancelButton = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemCancel + target:self + action:@selector(cancelButtonTapped)]; + UIBarButtonItem* flexibleSpace = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace + target:nil + action:nil]; + UIBarButtonItem* doneButton = [[UIBarButtonItem alloc] + initWithBarButtonSystemItem:UIBarButtonSystemItemDone + target:self + action:@selector(doneButtonTapped)]; + + // Add the UIBarButtonItem to the UIToolbar + [toolbar setItems:@[ cancelButton, flexibleSpace, doneButton ]]; + + // Vertical stack view that holds UIDatePicker and buttons. + UIStackView* verticalStack = + [[UIStackView alloc] initWithArrangedSubviews:@[ datePicker, toolbar ]]; + verticalStack.axis = UILayoutConstraintAxisVertical; + verticalStack.spacing = 0; + verticalStack.distribution = UIStackViewDistributionFill; + verticalStack.layoutMarginsRelativeArrangement = YES; + verticalStack.layoutMargins = UIEdgeInsetsMake(0, 0, 0, 0); + verticalStack.translatesAutoresizingMaskIntoConstraints = NO; + [self.view addSubview:verticalStack]; + [self.view setBounds:CGRectMake(CGRectGetMinX(datePicker.bounds), + CGRectGetMinY(datePicker.bounds), + CGRectGetWidth(datePicker.bounds), + CGRectGetHeight(datePicker.bounds) + + CGRectGetHeight(toolbar.bounds))]; +} + +@end
diff --git a/content/browser/loader/keep_alive_url_loader.cc b/content/browser/loader/keep_alive_url_loader.cc index c8485a92..0a544cb86 100644 --- a/content/browser/loader/keep_alive_url_loader.cc +++ b/content/browser/loader/keep_alive_url_loader.cc
@@ -10,6 +10,7 @@ #include "base/feature_list.h" #include "base/functional/bind.h" #include "base/functional/callback_forward.h" +#include "base/metrics/histogram_functions.h" #include "base/trace_event/trace_event.h" #include "base/trace_event/typed_macros.h" #include "content/browser/renderer_host/policy_container_host.h" @@ -47,6 +48,23 @@ kDefaultDisconnectedKeepAliveURLLoaderTimeout.InSeconds()))); } +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +// +// Must remain in sync with FetchLaterBrowserMetricType in +// tools/metrics/histograms/enums.xml. +enum class FetchLaterBrowserMetricType { + kAbortedByInitiator = 0, + kStartedAfterInitiatorDisconnected = 1, + kStartedByInitiator = 2, + kCancelledAfterTimeLimit = 3, + kMaxValue = kCancelledAfterTimeLimit, +}; + +void LogFetchLaterMetric(const FetchLaterBrowserMetricType& type) { + base::UmaHistogramEnumeration("FetchLater.Browser.Metrics", type); +} + // A convenient holder to aggregate modified header fields for redirect. struct ModifiedHeaders { ModifiedHeaders() = default; @@ -321,6 +339,7 @@ request_id_, "url", last_url_); TRACE_EVENT_NESTABLE_ASYNC_BEGIN1("loading", "KeepAliveURLLoader", request_id_, "url", last_url_); + base::UmaHistogramBoolean("FetchLater.Browser.Total", true); // TODO(crbug.com/1356128): Replace custom throttle logic here with blink's. for (auto& content_throttle : throttles) { @@ -335,6 +354,10 @@ request_id_); is_started_ = true; + if (IsFetchLater()) { + base::UmaHistogramBoolean("FetchLater.Browser.Total.Started", true); + } + // Asks the network service to create a URL loader with passed in params. network_loader_factory_->CreateLoaderAndStart( loader_.BindNewPipeAndPassReceiver(), request_id_, options_, @@ -858,6 +881,8 @@ if (!IsStarted()) { // May be the last chance to start a deferred loader. + LogFetchLaterMetric( + FetchLaterBrowserMetricType::kStartedAfterInitiatorDisconnected); Start(); } // For other types of keepalive requests, this loader does not care about @@ -872,10 +897,15 @@ } void KeepAliveURLLoader::OnDisconnectedLoaderTimerFired() { - // TODO(crbug.com/1465781): Add UMA histogram logging. + LogFetchLaterMetric(FetchLaterBrowserMetricType::kCancelledAfterTimeLimit); DeleteSelf(); } +bool KeepAliveURLLoader::IsFetchLater() const { + return base::FeatureList::IsEnabled(blink::features::kFetchLaterAPI) && + resource_request_.is_fetch_later_api; +} + void KeepAliveURLLoader::DeleteSelf() { CHECK(on_delete_callback_); std::move(on_delete_callback_).Run();
diff --git a/content/browser/loader/keep_alive_url_loader.h b/content/browser/loader/keep_alive_url_loader.h index b3f6c94e..4a9fa01 100644 --- a/content/browser/loader/keep_alive_url_loader.h +++ b/content/browser/loader/keep_alive_url_loader.h
@@ -217,6 +217,9 @@ // URLLoaderClient in renderer. bool IsRendererConnected() const; + // Tells if this loader is constructed for a FetchLater request. + bool IsFetchLater() const; + // Returns net::OK to allow following the redirect. Otherwise, returns // corresponding error code. net::Error WillFollowRedirect(const net::RedirectInfo& redirect_info) const;
diff --git a/content/browser/loader/prefetch_url_loader_service_context.cc b/content/browser/loader/prefetch_url_loader_service_context.cc index 39388e7..c80ac91 100644 --- a/content/browser/loader/prefetch_url_loader_service_context.cc +++ b/content/browser/loader/prefetch_url_loader_service_context.cc
@@ -11,8 +11,6 @@ #include "content/public/browser/url_loader_throttles.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_client.h" -#include "net/base/network_anonymization_key.h" -#include "services/network/public/cpp/features.h" #include "third_party/blink/public/common/loader/url_loader_throttle.h" #include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
diff --git a/content/browser/webui/webui_config_map_unittest.cc b/content/browser/webui/webui_config_map_unittest.cc index 1355353c..2f892b1 100644 --- a/content/browser/webui/webui_config_map_unittest.cc +++ b/content/browser/webui/webui_config_map_unittest.cc
@@ -4,14 +4,13 @@ #include "content/public/browser/webui_config_map.h" +#include "content/public/browser/web_ui_controller.h" #include "content/public/browser/webui_config.h" #include "content/public/test/scoped_web_ui_controller_factory_registration.h" #include "testing/gtest/include/gtest/gtest.h" namespace content { -class WebUIController; - namespace { constexpr const char kChromeFoo[] = "chrome://foo";
diff --git a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt index 66dff0a..6ccbb3db 100644 --- a/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/trace_test_expectations.txt
@@ -243,7 +243,6 @@ # Win AMD failure since test added crbug.com/1446057 [ win10 amd-0x7340 angle-d3d11 ] VideoPathTraceTest_DirectComposition_Video_SW_Decode [ Failure ] -crbug.com/1475318 [ monterey amd-0x679e ] TraceTest_ReflectedDiv [ Failure ] ####################################################################### # Automated Entries After This Point - Do Not Manually Add Below Here #
diff --git a/docs/telemetry_extension/api_overview.md b/docs/telemetry_extension/api_overview.md index 76c24ae7..9218f83 100644 --- a/docs/telemetry_extension/api_overview.md +++ b/docs/telemetry_extension/api_overview.md
@@ -360,6 +360,8 @@ | touchpad_button | | touchpad_touch | | touchpad_connected | +| touchscreen_touch | +| touchscreen_connected | | external_display | | stylus_touch | | stylus_connected |
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc index 2fe3134c..bcea4c0 100644 --- a/gpu/config/gpu_info_collector.cc +++ b/gpu/config/gpu_info_collector.cc
@@ -346,7 +346,12 @@ void ReportWebGPUSupportMetrics(dawn::native::Instance* instance) { static BASE_FEATURE(kCollectWebGPUSupportMetrics, "CollectWebGPUSupportMetrics", +#if BUILDFLAG(IS_ANDROID) + base::FEATURE_DISABLED_BY_DEFAULT); +#else base::FEATURE_ENABLED_BY_DEFAULT); +#endif + if (!base::FeatureList::IsEnabled(kCollectWebGPUSupportMetrics)) { return; }
diff --git a/infra/config/generated/testing/variants.pyl b/infra/config/generated/testing/variants.pyl index 4ebd6c1..211932ed 100644 --- a/infra/config/generated/testing/variants.pyl +++ b/infra/config/generated/testing/variants.pyl
@@ -70,16 +70,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 119.0.6022.0', + 'description': 'Run with ash-chrome version 119.0.6023.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v119.0.6022.0', - 'revision': 'version:119.0.6022.0', + 'location': 'lacros_version_skew_tests_v119.0.6023.0', + 'revision': 'version:119.0.6023.0', }, ], },
diff --git a/infra/config/targets/lacros-version-skew-variants.json b/infra/config/targets/lacros-version-skew-variants.json index 86e2329..40fab46e 100644 --- a/infra/config/targets/lacros-version-skew-variants.json +++ b/infra/config/targets/lacros-version-skew-variants.json
@@ -1,16 +1,16 @@ { "LACROS_VERSION_SKEW_CANARY": { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "identifier": "Lacros version skew testing ash canary", "swarming": { "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ] }
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm index 8083e9ee..8b826ce 100644 --- a/ios/chrome/app/main_controller.mm +++ b/ios/chrome/app/main_controller.mm
@@ -109,7 +109,7 @@ #import "ios/chrome/browser/signin/authentication_service_factory.h" #import "ios/chrome/browser/signin/identity_manager_factory.h" #import "ios/chrome/browser/snapshots/snapshot_browser_agent.h" -#import "ios/chrome/browser/snapshots/snapshot_cache.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" #import "ios/chrome/browser/sync/sync_service_factory.h" #import "ios/chrome/browser/ui/appearance/appearance_customization.h" #import "ios/chrome/browser/ui/first_run/first_run_util.h"
diff --git a/ios/chrome/browser/main/browser_util.mm b/ios/chrome/browser/main/browser_util.mm index d294af9..4f43e30 100644 --- a/ios/chrome/browser/main/browser_util.mm +++ b/ios/chrome/browser/main/browser_util.mm
@@ -14,24 +14,25 @@ #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_opener.h" #import "ios/chrome/browser/snapshots/snapshot_browser_agent.h" -#import "ios/chrome/browser/snapshots/snapshot_cache.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" #import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" #import "ios/web/public/web_state.h" namespace { // Moves snapshot associated with `snapshot_id` from `source_browser` to -// `destination_browser`'s snapshot cache. +// `destination_browser`'s snapshot storage. void MoveSnapshot(SnapshotID snapshot_id, Browser* source_browser, Browser* destination_browser) { DCHECK(snapshot_id.valid()); - SnapshotCache* source_cache = - SnapshotBrowserAgent::FromBrowser(source_browser)->snapshot_cache(); - SnapshotCache* destination_cache = - SnapshotBrowserAgent::FromBrowser(destination_browser)->snapshot_cache(); - [source_cache migrateImageWithSnapshotID:snapshot_id - toSnapshotCache:destination_cache]; + SnapshotStorage* source_storage = + SnapshotBrowserAgent::FromBrowser(source_browser)->snapshot_storage(); + SnapshotStorage* destination_storage = + SnapshotBrowserAgent::FromBrowser(destination_browser) + ->snapshot_storage(); + [source_storage migrateImageWithSnapshotID:snapshot_id + toSnapshotStorage:destination_storage]; } } // namespace
diff --git a/ios/chrome/browser/main/browser_util_unittest.mm b/ios/chrome/browser/main/browser_util_unittest.mm index 70dfbd2..d96a52a 100644 --- a/ios/chrome/browser/main/browser_util_unittest.mm +++ b/ios/chrome/browser/main/browser_util_unittest.mm
@@ -15,8 +15,8 @@ #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_opener.h" #import "ios/chrome/browser/snapshots/snapshot_browser_agent.h" -#import "ios/chrome/browser/snapshots/snapshot_cache.h" #import "ios/chrome/browser/snapshots/snapshot_id.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" #import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" #import "ios/web/public/test/fakes/fake_web_state.h" #import "ios/web/public/test/web_task_environment.h" @@ -93,17 +93,18 @@ // Returns the cached snapshot for the given snapshot ID in the given snapshot // cache. - UIImage* GetSnapshot(SnapshotCache* snapshot_cache, SnapshotID snapshot_id) { - CHECK(snapshot_cache); + UIImage* GetSnapshot(SnapshotStorage* snapshot_storage, + SnapshotID snapshot_id) { + CHECK(snapshot_storage); base::RunLoop run_loop; base::RunLoop* run_loop_ptr = &run_loop; __block UIImage* snapshot = nil; - [snapshot_cache retrieveImageForSnapshotID:snapshot_id - callback:^(UIImage* cached_snapshot) { - snapshot = cached_snapshot; - run_loop_ptr->Quit(); - }]; + [snapshot_storage retrieveImageForSnapshotID:snapshot_id + callback:^(UIImage* cached_snapshot) { + snapshot = cached_snapshot; + run_loop_ptr->Quit(); + }]; run_loop.Run(); return snapshot; } @@ -199,28 +200,28 @@ SnapshotBrowserAgent* agent = SnapshotBrowserAgent::FromBrowser(browser_.get()); agent->SetSessionID([[NSUUID UUID] UUIDString]); - SnapshotCache* snapshot_cache = agent->snapshot_cache(); - ASSERT_NE(nil, snapshot_cache); + SnapshotStorage* snapshot_storage = agent->snapshot_storage(); + ASSERT_NE(nil, snapshot_storage); UIImage* snapshot = UIImageWithSizeAndSolidColor({10, 20}, UIColor.redColor); SnapshotTabHelper* snapshot_tab_helper = SnapshotTabHelper::FromWebState(web_state); SnapshotID snapshot_id = snapshot_tab_helper->GetSnapshotID(); - [snapshot_cache setImage:snapshot withSnapshotID:snapshot_id]; + [snapshot_storage setImage:snapshot withSnapshotID:snapshot_id]; ASSERT_TRUE( - UIImagesAreEqual(snapshot, GetSnapshot(snapshot_cache, snapshot_id))); + UIImagesAreEqual(snapshot, GetSnapshot(snapshot_storage, snapshot_id))); // Check that the other browser doesn’t have a snapshot for that identifier. SnapshotBrowserAgent::CreateForBrowser(other_browser_.get()); SnapshotBrowserAgent* other_agent = SnapshotBrowserAgent::FromBrowser(other_browser_.get()); other_agent->SetSessionID([[NSUUID UUID] UUIDString]); - SnapshotCache* other_snapshot_cache = other_agent->snapshot_cache(); - ASSERT_NE(nil, other_snapshot_cache); - ASSERT_EQ(nil, GetSnapshot(other_snapshot_cache, snapshot_id)); + SnapshotStorage* other_snapshot_storage = other_agent->snapshot_storage(); + ASSERT_NE(nil, other_snapshot_storage); + ASSERT_EQ(nil, GetSnapshot(other_snapshot_storage, snapshot_id)); // Migrate the tab between browsers. MoveTabFromBrowserToBrowser(browser_.get(), 0, other_browser_.get(), 0); - EXPECT_EQ(nil, GetSnapshot(snapshot_cache, snapshot_id)); - EXPECT_TRUE(UIImagesAreEqual(snapshot, - GetSnapshot(other_snapshot_cache, snapshot_id))); + EXPECT_EQ(nil, GetSnapshot(snapshot_storage, snapshot_id)); + EXPECT_TRUE(UIImagesAreEqual( + snapshot, GetSnapshot(other_snapshot_storage, snapshot_id))); }
diff --git a/ios/chrome/browser/snapshots/BUILD.gn b/ios/chrome/browser/snapshots/BUILD.gn index d252498..62d3981 100644 --- a/ios/chrome/browser/snapshots/BUILD.gn +++ b/ios/chrome/browser/snapshots/BUILD.gn
@@ -5,20 +5,20 @@ source_set("snapshots") { public = [ "snapshot_browser_agent.h", - "snapshot_cache.h", - "snapshot_cache_internal.h", - "snapshot_cache_observer.h", "snapshot_generator_delegate.h", "snapshot_id.h", "snapshot_lru_cache.h", + "snapshot_storage.h", + "snapshot_storage_internal.h", + "snapshot_storage_observer.h", "snapshot_tab_helper.h", ] sources = [ "snapshot_browser_agent.mm", - "snapshot_cache.mm", "snapshot_generator.h", "snapshot_generator.mm", "snapshot_lru_cache.mm", + "snapshot_storage.mm", "snapshot_tab_helper.mm", ] deps = [ @@ -54,8 +54,8 @@ testonly = true sources = [ "snapshot_browser_agent_unittest.mm", - "snapshot_cache_unittest.mm", "snapshot_lru_cache_unittest.mm", + "snapshot_storage_unittest.mm", "snapshot_tab_helper_unittest.mm", ] deps = [
diff --git a/ios/chrome/browser/snapshots/DEPS b/ios/chrome/browser/snapshots/DEPS index 552599a..57fd750 100644 --- a/ios/chrome/browser/snapshots/DEPS +++ b/ios/chrome/browser/snapshots/DEPS
@@ -4,7 +4,7 @@ specific_include_rules = { # TODO(crbug.com/1294160): Remove these dependencies. - "^snapshot_cache.mm": [ + "^snapshot_storage.mm": [ "+ios/chrome/browser/shared/ui/util/uikit_ui_util.h", "+ios/chrome/browser/tabs/features.h", ],
diff --git a/ios/chrome/browser/snapshots/snapshot_browser_agent.h b/ios/chrome/browser/snapshots/snapshot_browser_agent.h index 474b6c8..7acbbac 100644 --- a/ios/chrome/browser/snapshots/snapshot_browser_agent.h +++ b/ios/chrome/browser/snapshots/snapshot_browser_agent.h
@@ -14,9 +14,9 @@ #import "ios/chrome/browser/shared/model/web_state_list/web_state_list_observer.h" #import "ios/chrome/browser/snapshots/snapshot_id.h" -@class SnapshotCache; +@class SnapshotStorage; -// Associates a SnapshotCache to a Browser. +// Associates a SnapshotStorage to a Browser. class SnapshotBrowserAgent : public BrowserObserver, public WebStateListObserver, public BrowserUserData<SnapshotBrowserAgent> { @@ -38,7 +38,7 @@ // Permanently removes all snapshots. void RemoveAllSnapshots(); - SnapshotCache* snapshot_cache() { return snapshot_cache_; } + SnapshotStorage* snapshot_storage() { return snapshot_storage_; } private: friend class BrowserUserData<SnapshotBrowserAgent>; @@ -56,7 +56,7 @@ void WillBeginBatchOperation(WebStateList* web_state_list) override; void BatchOperationEnded(WebStateList* web_state_list) override; - // Helper methods to set a snapshot cache for `web_state`. + // Helper methods to set a snapshot storage for `web_state`. void InsertWebState(web::WebState* web_state); void DetachWebState(web::WebState* web_state); @@ -70,7 +70,7 @@ // Returns the snapshot IDs of all the WebStates in the Browser. std::vector<SnapshotID> GetSnapshotIDs(); - __strong SnapshotCache* snapshot_cache_; + __strong SnapshotStorage* snapshot_storage_; Browser* browser_ = nullptr; };
diff --git a/ios/chrome/browser/snapshots/snapshot_browser_agent.mm b/ios/chrome/browser/snapshots/snapshot_browser_agent.mm index 8e23359..03e6134 100644 --- a/ios/chrome/browser/snapshots/snapshot_browser_agent.mm +++ b/ios/chrome/browser/snapshots/snapshot_browser_agent.mm
@@ -11,7 +11,7 @@ #import "base/strings/sys_string_conversions.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" -#import "ios/chrome/browser/snapshots/snapshot_cache.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" #import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" namespace { @@ -38,7 +38,7 @@ browser->GetWebStateList()->RemoveObserver(this); browser->RemoveObserver(this); browser_ = nullptr; - [snapshot_cache_ shutdown]; + [snapshot_storage_ shutdown]; } #pragma mark - WebStateListObserver @@ -91,7 +91,7 @@ void SnapshotBrowserAgent::SetSessionID(NSString* session_identifier) { // It is incorrect to call this method twice. - DCHECK(!snapshot_cache_); + DCHECK(!snapshot_storage_); DCHECK(session_identifier.length != 0); const std::string identifier = base::SysNSStringToUTF8(session_identifier); @@ -110,8 +110,8 @@ const base::FilePath storage_path = browser_state_path.Append(kSnapshots).Append(identifier); - snapshot_cache_ = [[SnapshotCache alloc] initWithStoragePath:storage_path - legacyPath:legacy_path]; + snapshot_storage_ = [[SnapshotStorage alloc] initWithStoragePath:storage_path + legacyPath:legacy_path]; } void SnapshotBrowserAgent::PerformStorageMaintenance() { @@ -120,19 +120,20 @@ } void SnapshotBrowserAgent::RemoveAllSnapshots() { - [snapshot_cache_ removeAllImages]; + [snapshot_storage_ removeAllImages]; } void SnapshotBrowserAgent::InsertWebState(web::WebState* web_state) { - SnapshotTabHelper::FromWebState(web_state)->SetSnapshotCache(snapshot_cache_); + SnapshotTabHelper::FromWebState(web_state)->SetSnapshotStorage( + snapshot_storage_); } void SnapshotBrowserAgent::DetachWebState(web::WebState* web_state) { - SnapshotTabHelper::FromWebState(web_state)->SetSnapshotCache(nil); + SnapshotTabHelper::FromWebState(web_state)->SetSnapshotStorage(nil); } void SnapshotBrowserAgent::MigrateStorageIfNecessary() { - DCHECK(snapshot_cache_); + DCHECK(snapshot_storage_); WebStateList* web_state_list = browser_->GetWebStateList(); const int web_state_list_count = web_state_list->count(); @@ -155,17 +156,17 @@ SnapshotTabHelper::FromWebState(web_state)->GetSnapshotID()); } - [snapshot_cache_ renameSnapshotsWithIDs:stable_identifiers - toIDs:snapshot_identifiers]; + [snapshot_storage_ renameSnapshotsWithIDs:stable_identifiers + toIDs:snapshot_identifiers]; } void SnapshotBrowserAgent::PurgeUnusedSnapshots() { - DCHECK(snapshot_cache_); + DCHECK(snapshot_storage_); std::vector<SnapshotID> snapshot_ids = GetSnapshotIDs(); // Keep snapshots that are less than one minute old, to prevent a concurrency // issue if they are created while the purge is running. const base::Time one_minute_ago = base::Time::Now() - base::Minutes(1); - [snapshot_cache_ purgeCacheOlderThan:one_minute_ago keeping:snapshot_ids]; + [snapshot_storage_ purgeCacheOlderThan:one_minute_ago keeping:snapshot_ids]; } std::vector<SnapshotID> SnapshotBrowserAgent::GetSnapshotIDs() {
diff --git a/ios/chrome/browser/snapshots/snapshot_browser_agent_unittest.mm b/ios/chrome/browser/snapshots/snapshot_browser_agent_unittest.mm index b9b0debe..623f86f 100644 --- a/ios/chrome/browser/snapshots/snapshot_browser_agent_unittest.mm +++ b/ios/chrome/browser/snapshots/snapshot_browser_agent_unittest.mm
@@ -26,14 +26,14 @@ std::unique_ptr<Browser> browser_; }; -TEST_F(SnapshotBrowserAgentTest, SnapshotCacheCreatedAfterSettingSessionID) { +TEST_F(SnapshotBrowserAgentTest, SnapshotStorageCreatedAfterSettingSessionID) { SnapshotBrowserAgent::CreateForBrowser(browser_.get()); SnapshotBrowserAgent* agent = SnapshotBrowserAgent::FromBrowser(browser_.get()); EXPECT_NE(nullptr, agent); - EXPECT_EQ(nil, agent->snapshot_cache()); + EXPECT_EQ(nil, agent->snapshot_storage()); agent->SetSessionID([[NSUUID UUID] UUIDString]); - EXPECT_NE(nil, agent->snapshot_cache()); + EXPECT_NE(nil, agent->snapshot_storage()); } } // anonymous namespace
diff --git a/ios/chrome/browser/snapshots/snapshot_cache_observer.h b/ios/chrome/browser/snapshots/snapshot_cache_observer.h deleted file mode 100644 index e9069b1e..0000000 --- a/ios/chrome/browser/snapshots/snapshot_cache_observer.h +++ /dev/null
@@ -1,21 +0,0 @@ -// Copyright 2017 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_OBSERVER_H_ -#define IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_OBSERVER_H_ - -#import <Foundation/Foundation.h> - -@class SnapshotCache; - -// Interface for listening to events occurring to the SnapshotCache. -@protocol SnapshotCacheObserver -@optional -// Tells the observing object that the `snapshotCache` was updated with a new -// snapshot corresponding to `snapshotID`. -- (void)snapshotCache:(SnapshotCache*)snapshotCache - didUpdateSnapshotForID:(SnapshotID)snapshotID; -@end - -#endif // IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_OBSERVER_H_
diff --git a/ios/chrome/browser/snapshots/snapshot_generator.h b/ios/chrome/browser/snapshots/snapshot_generator.h index b92a24e4..6978142 100644 --- a/ios/chrome/browser/snapshots/snapshot_generator.h +++ b/ios/chrome/browser/snapshots/snapshot_generator.h
@@ -8,7 +8,7 @@ #import <UIKit/UIKit.h> class SnapshotID; -@class SnapshotCache; +@class SnapshotStorage; @protocol SnapshotGeneratorDelegate; namespace web { @@ -19,9 +19,9 @@ // tab's web page. @interface SnapshotGenerator : NSObject -// Weak reference to the snapshot cache which is used to store and retrieve +// Weak reference to the snapshot storage which is used to store and retrieve // snapshots for the WebState associated with this SnapshotGenerator. -@property(nonatomic, weak) SnapshotCache* snapshotCache; +@property(nonatomic, weak) SnapshotStorage* snapshotStorage; // Designated initializer. - (instancetype)initWithWebState:(web::WebState*)webState @@ -38,18 +38,18 @@ // `callback` will be called with nil. - (void)retrieveGreySnapshot:(void (^)(UIImage*))callback; -// Generates a new snapshot, updates the snapshot cache, and returns the new +// Generates a new snapshot, updates the snapshot storage, and returns the new // snapshot image. - (UIImage*)updateSnapshot; -// Asynchronously generates a new snapshot, updates the snapshot cache, and runs -// `callback` with the new snapshot image. It is an error to call this method if -// the web state is showing anything other (e.g., native content) than a web -// view. +// Asynchronously generates a new snapshot, updates the snapshot storage, and +// runs `callback` with the new snapshot image. It is an error to call this +// method if the web state is showing anything other (e.g., native content) than +// a web view. - (void)updateWebViewSnapshotWithCompletion:(void (^)(UIImage*))completion; // Generates a new snapshot and returns the new snapshot image. This does not -// update the snapshot cache. If `shouldAddOverlay` is YES, overlays (e.g., +// update the snapshot storage. If `shouldAddOverlay` is YES, overlays (e.g., // infobars, the download manager, and sad tab view) are also captured in the // snapshot image. - (UIImage*)generateSnapshotWithOverlays:(BOOL)shouldAddOverlay;
diff --git a/ios/chrome/browser/snapshots/snapshot_generator.mm b/ios/chrome/browser/snapshots/snapshot_generator.mm index 66be264f..24df5f03 100644 --- a/ios/chrome/browser/snapshots/snapshot_generator.mm +++ b/ios/chrome/browser/snapshots/snapshot_generator.mm
@@ -15,9 +15,9 @@ #import "base/functional/bind.h" #import "build/blink_buildflags.h" #import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h" -#import "ios/chrome/browser/snapshots/snapshot_cache.h" #import "ios/chrome/browser/snapshots/snapshot_generator_delegate.h" #import "ios/chrome/browser/snapshots/snapshot_id.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" #import "ios/web/public/thread/web_task_traits.h" #import "ios/web/public/thread/web_thread.h" #import "ios/web/public/web_client.h" @@ -95,8 +95,8 @@ - (void)retrieveSnapshot:(void (^)(UIImage*))callback { DCHECK(callback); - if (_snapshotCache) { - [_snapshotCache retrieveImageForSnapshotID:_snapshotID callback:callback]; + if (_snapshotStorage) { + [_snapshotStorage retrieveImageForSnapshotID:_snapshotID callback:callback]; } else { callback(nil); } @@ -115,10 +115,10 @@ callback(image); }; - SnapshotCache* snapshotCache = _snapshotCache; - if (snapshotCache) { - [snapshotCache retrieveGreyImageForSnapshotID:_snapshotID - callback:wrappedCallback]; + SnapshotStorage* snapshotStorage = _snapshotStorage; + if (snapshotStorage) { + [snapshotStorage retrieveGreyImageForSnapshotID:_snapshotID + callback:wrappedCallback]; } else { wrappedCallback(nil); } @@ -126,7 +126,7 @@ - (UIImage*)updateSnapshot { UIImage* snapshot = [self generateSnapshotWithOverlays:YES]; - [self updateSnapshotCacheWithImage:snapshot]; + [self updateSnapshotStorageWithImage:snapshot]; return snapshot; } @@ -158,7 +158,7 @@ baseImage:image.ToUIImage() frameInWindow:snapshotInfo.snapshotFrameInWindow]; } - [weakSelf updateSnapshotCacheWithImage:snapshot]; + [weakSelf updateSnapshotStorageWithImage:snapshot]; if (completion) completion(snapshot); })); @@ -179,15 +179,15 @@ } - (void)willBeSavedGreyWhenBackgrounding { - [_snapshotCache willBeSavedGreyWhenBackgrounding:_snapshotID]; + [_snapshotStorage willBeSavedGreyWhenBackgrounding:_snapshotID]; } - (void)saveGreyInBackground { - [_snapshotCache saveGreyInBackgroundForSnapshotID:_snapshotID]; + [_snapshotStorage saveGreyInBackgroundForSnapshotID:_snapshotID]; } - (void)removeSnapshot { - [_snapshotCache removeImageWithSnapshotID:_snapshotID]; + [_snapshotStorage removeImageWithSnapshotID:_snapshotID]; } #pragma mark - Private methods @@ -222,7 +222,7 @@ // Note: When not using device scale, the output image size may slightly // differ from the input size due to rounding. const CGFloat kScale = - std::max<CGFloat>(1.0, [_snapshotCache snapshotScaleForDevice]); + std::max<CGFloat>(1.0, [_snapshotStorage snapshotScaleForDevice]); UIGraphicsImageRendererFormat* format = [UIGraphicsImageRendererFormat preferredFormat]; format.scale = kScale; @@ -312,7 +312,7 @@ if (overlays.count == 0) return baseImage; const CGFloat kScale = - std::max<CGFloat>(1.0, [_snapshotCache snapshotScaleForDevice]); + std::max<CGFloat>(1.0, [_snapshotStorage snapshotScaleForDevice]); UIGraphicsImageRendererFormat* format = [UIGraphicsImageRendererFormat preferredFormat]; @@ -349,13 +349,13 @@ return image; } -// Updates the snapshot cache with `snapshot`. -- (void)updateSnapshotCacheWithImage:(UIImage*)snapshot { +// Updates the snapshot storage with `snapshot`. +- (void)updateSnapshotStorageWithImage:(UIImage*)snapshot { if (snapshot) { - [_snapshotCache setImage:snapshot withSnapshotID:_snapshotID]; + [_snapshotStorage setImage:snapshot withSnapshotID:_snapshotID]; } else { // Remove any stale snapshot since the snapshot failed. - [_snapshotCache removeImageWithSnapshotID:_snapshotID]; + [_snapshotStorage removeImageWithSnapshotID:_snapshotID]; } }
diff --git a/ios/chrome/browser/snapshots/snapshot_cache.h b/ios/chrome/browser/snapshots/snapshot_storage.h similarity index 78% rename from ios/chrome/browser/snapshots/snapshot_cache.h rename to ios/chrome/browser/snapshots/snapshot_storage.h index c29b2894..c130426 100644 --- a/ios/chrome/browser/snapshots/snapshot_cache.h +++ b/ios/chrome/browser/snapshots/snapshot_storage.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 IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_H_ -#define IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_H_ +#ifndef IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_STORAGE_H_ +#define IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_STORAGE_H_ #include <vector> @@ -13,21 +13,21 @@ namespace base { class FilePath; class Time; -} +} // namespace base -@protocol SnapshotCacheObserver; +@protocol SnapshotStorageObserver; -// A class providing an in-memory and on-disk cache of tab snapshots. +// A class providing an in-memory and on-disk storage of tab snapshots. // A snapshot is a full-screen image of the contents of the page at the current // scroll offset and zoom level, used to stand in for the WKWebView if it has // been purged from memory or when quickly switching tabs. // Persists to disk on a background thread each time a snapshot changes. -@interface SnapshotCache : NSObject +@interface SnapshotStorage : NSObject // Designated initializer. `storagePath` is the file path where all images -// managed by this SnapshotCache are stored. `storagePath` is not guaranteed to -// exist. The contents of `storagePath` are entirely managed by this -// SnapshotCache. +// managed by this SnapshotStorage are stored. `storagePath` is not guaranteed +// to exist. The contents of `storagePath` are entirely managed by this +// SnapshotStorage. // // To support renaming the directory where the snapshots are stored, it is // possible to pass a non-empty path via `legacyPath`. If present, then it @@ -67,7 +67,7 @@ // Removes all images from both the LRU and disk. - (void)removeAllImages; -// Purges the cache of snapshots that are older than `date`. The snapshots for +// Purges the storage of snapshots that are older than `date`. The snapshots for // `liveSnapshotIDs` will be kept. This will be done asynchronously on a // background thread. - (void)purgeCacheOlderThan:(base::Time)date @@ -78,18 +78,18 @@ - (void)renameSnapshotsWithIDs:(NSArray<NSString*>*)oldIDs toIDs:(const std::vector<SnapshotID>&)newIDs; -// Moves the on-disk tab snapshot from the receiver cache to the destination -// on-disk cache. If the snapshot was also in-memory, it is moved as well. The +// Moves the on-disk tab snapshot from the receiver storage to the destination +// on-disk storage. If the snapshot was also in-memory, it is moved as well. The // grey image is handled as well if present. - (void)migrateImageWithSnapshotID:(SnapshotID)snapshotID - toSnapshotCache:(SnapshotCache*)destinationCache; + toSnapshotStorage:(SnapshotStorage*)destinationCache; // Hints that the snapshot for `snapshotID` will likely be saved to disk when // the application is backgrounded. The snapshot is then saved in memory, so it // does not need to be read off disk. - (void)willBeSavedGreyWhenBackgrounding:(SnapshotID)snapshotID; -// Creates temporary cache of grey images for tablet side-swipe. +// Creates temporary storage of grey images for tablet side-swipe. - (void)createGreyCache:(const std::vector<SnapshotID>&)snapshotIDs; // Releases alls images in grey cache. @@ -99,11 +99,11 @@ // if a color version of the snapshot already exists in memory or on disk. - (void)saveGreyInBackgroundForSnapshotID:(SnapshotID)snapshotID; -// Adds an observer to this snapshot cache. -- (void)addObserver:(id<SnapshotCacheObserver>)observer; +// Adds an observer to this snapshot storage. +- (void)addObserver:(id<SnapshotStorageObserver>)observer; -// Removes an observer from this snapshot cache. -- (void)removeObserver:(id<SnapshotCacheObserver>)observer; +// Removes an observer from this snapshot storage. +- (void)removeObserver:(id<SnapshotStorageObserver>)observer; // Must be invoked before the instance is deallocated. It is needed to release // all references to C++ objects. The receiver will likely soon be deallocated. @@ -112,7 +112,7 @@ @end // Additionnal methods that should only be used for tests. -@interface SnapshotCache (TestingAdditions) +@interface SnapshotStorage (TestingAdditions) // Requests the grey snapshot for `snapshotID`. If the image is already loaded // in memory, this will immediately call back with `callback`. Otherwise, only // uses `callback` for the most recent caller. The callback is not guaranteed to @@ -124,4 +124,4 @@ - (NSUInteger)lruCacheMaxSize; @end -#endif // IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_H_ +#endif // IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_STORAGE_H_
diff --git a/ios/chrome/browser/snapshots/snapshot_cache.mm b/ios/chrome/browser/snapshots/snapshot_storage.mm similarity index 92% rename from ios/chrome/browser/snapshots/snapshot_cache.mm rename to ios/chrome/browser/snapshots/snapshot_storage.mm index 5f04b55..980d9b8 100644 --- a/ios/chrome/browser/snapshots/snapshot_cache.mm +++ b/ios/chrome/browser/snapshots/snapshot_storage.mm
@@ -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 "ios/chrome/browser/snapshots/snapshot_cache.h" -#import "ios/chrome/browser/snapshots/snapshot_cache_internal.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" +#import "ios/chrome/browser/snapshots/snapshot_storage_internal.h" #import <UIKit/UIKit.h> @@ -30,27 +30,28 @@ #import "base/threading/scoped_blocking_call.h" #import "base/time/time.h" #import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h" -#import "ios/chrome/browser/snapshots/snapshot_cache_observer.h" #import "ios/chrome/browser/snapshots/snapshot_id.h" #import "ios/chrome/browser/snapshots/snapshot_lru_cache.h" +#import "ios/chrome/browser/snapshots/snapshot_storage_observer.h" #import "ios/chrome/browser/tabs/features.h" #import "ui/base/device_form_factor.h" // Protocol observers subclass that explicitly implements -// <SnapshotCacheObserver>. -@interface SnapshotCacheObservers : CRBProtocolObservers<SnapshotCacheObserver> +// <SnapshotStorageObserver>. +@interface SnapshotStorageObservers + : CRBProtocolObservers <SnapshotStorageObserver> + (instancetype)observers; @end -@implementation SnapshotCacheObservers +@implementation SnapshotStorageObservers + (instancetype)observers { - return [self observersWithProtocol:@protocol(SnapshotCacheObserver)]; + return [self observersWithProtocol:@protocol(SnapshotStorageObserver)]; } @end -@interface SnapshotCache () +@interface SnapshotStorage () // List of observers to be notified of changes to the snapshot cache. -@property(nonatomic, strong) SnapshotCacheObservers* observers; +@property(nonatomic, strong) SnapshotStorageObservers* observers; @end namespace { @@ -66,7 +67,8 @@ }; const ImageType kImageTypes[] = { - IMAGE_TYPE_COLOR, IMAGE_TYPE_GREYSCALE, + IMAGE_TYPE_COLOR, + IMAGE_TYPE_GREYSCALE, }; const CGFloat kJPEGImageQuality = 1.0; // Highest quality. No compression. @@ -138,8 +140,9 @@ // the snapshot images should match the scale of the device. // On tablet, the color snapshot is only used to generate the grey snapshot, // which does not have to be high quality, so use scale of 1.0 on all tablets. - if (ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET) + if (ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET) { return IMAGE_SCALE_1X; + } // Cap snapshot resolution to 2x to reduce the amount of memory used. return [UIScreen mainScreen].scale == 1.0 ? IMAGE_SCALE_1X : IMAGE_SCALE_2X; @@ -176,8 +179,9 @@ } void WriteImageToDisk(UIImage* image, const base::FilePath& file_path) { - if (!image) + if (!image) { return; + } // CGImage should exist, otherwise UIImageJPEG(PNG)Representation returns nil. CHECK(image.CGImage); @@ -227,8 +231,9 @@ if (!color_image) { color_image = ReadImageForSnapshotIDFromDisk(snapshot_id, IMAGE_TYPE_COLOR, image_scale, cache_directory); - if (!color_image) + if (!color_image) { return; + } } UIImage* grey_image = GreyImage(color_image); base::FilePath image_path = ImagePath(snapshot_id, IMAGE_TYPE_GREYSCALE, @@ -253,8 +258,9 @@ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, base::BlockingType::WILL_BLOCK); - if (cache_directory.empty() || !base::DirectoryExists(cache_directory)) + if (cache_directory.empty() || !base::DirectoryExists(cache_directory)) { return; + } if (!base::DeletePathRecursively(cache_directory)) { DLOG(ERROR) << "Error deleting snapshots storage. " @@ -273,8 +279,9 @@ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, base::BlockingType::WILL_BLOCK); - if (!base::DirectoryExists(cache_directory)) + if (!base::DirectoryExists(cache_directory)) { return; + } std::set<base::FilePath> files_to_keep; for (SnapshotID snapshot_id : keep_alive_snapshot_ids) { @@ -288,13 +295,16 @@ for (base::FilePath current_file = enumerator.Next(); !current_file.empty(); current_file = enumerator.Next()) { - if (current_file.Extension() != ".jpg") + if (current_file.Extension() != ".jpg") { continue; - if (base::Contains(files_to_keep, current_file)) + } + if (base::Contains(files_to_keep, current_file)) { continue; + } base::FileEnumerator::FileInfo file_info = enumerator.GetInfo(); - if (file_info.GetLastModifiedTime() > threshold_date) + if (file_info.GetLastModifiedTime() > threshold_date) { continue; + } base::DeleteFile(current_file); } @@ -388,15 +398,16 @@ snapshot_scale, cache_directory); } - if (!image) + if (!image) { return nil; + } return GreyImage(image); } } // anonymous namespace -@implementation SnapshotCache { +@implementation SnapshotStorage { // Cache to hold color snapshots in memory. n.b. Color snapshots are not // kept in memory on tablets. SnapshotLRUCache<UIImage*>* _lruCache; @@ -450,7 +461,7 @@ FROM_HERE, base::BindOnce(CreateCacheDirectory, _cacheDirectory, legacyPath)); - _observers = [SnapshotCacheObservers observers]; + _observers = [SnapshotStorageObservers observers]; [[NSNotificationCenter defaultCenter] addObserver:self @@ -513,8 +524,9 @@ base::BindOnce(&ReadImageForSnapshotIDFromDisk, snapshotID, IMAGE_TYPE_COLOR, _snapshotsScale, _cacheDirectory), base::BindOnce(^(UIImage* image) { - if (image) + if (image) { [weakLRUCache setObject:image forKey:snapshotID]; + } callback(image); })); } @@ -532,7 +544,7 @@ CGImageGetHeight(image.CGImage) * [_lruCache count]; base::UmaHistogramMemoryKB("IOS.Snapshots.CacheSize", imageSizes / 1024); - [self.observers snapshotCache:self didUpdateSnapshotForID:snapshotID]; + [self.observers snapshotStorage:self didUpdateSnapshotForID:snapshotID]; // Save the image to disk. _taskRunner->PostTask( @@ -546,10 +558,11 @@ [_lruCache removeObjectForKey:snapshotID]; - [self.observers snapshotCache:self didUpdateSnapshotForID:snapshotID]; + [self.observers snapshotStorage:self didUpdateSnapshotForID:snapshotID]; - if (!_taskRunner) + if (!_taskRunner) { return; + } _taskRunner->PostTask( FROM_HERE, base::BindOnce(&DeleteImageWithSnapshotID, _cacheDirectory, @@ -561,8 +574,9 @@ [_lruCache removeAllObjects]; - if (!_taskRunner) + if (!_taskRunner) { return; + } _taskRunner->PostTask(FROM_HERE, base::BindOnce(&RemoveAllImages, _cacheDirectory)); @@ -587,8 +601,9 @@ keeping:(const std::vector<SnapshotID>&)liveSnapshotIDs { DCHECK_CALLED_ON_VALID_SEQUENCE(_sequenceChecker); - if (!_taskRunner) + if (!_taskRunner) { return; + } _taskRunner->PostTask( FROM_HERE, base::BindOnce(&PurgeCacheOlderThan, _cacheDirectory, date, @@ -609,17 +624,17 @@ } - (void)migrateImageWithSnapshotID:(SnapshotID)snapshotID - toSnapshotCache:(SnapshotCache*)destinationCache { + toSnapshotStorage:(SnapshotStorage*)destinationStorage { DCHECK_CALLED_ON_VALID_SEQUENCE(_sequenceChecker); - // Copy to the destination cache. + // Copy to the destination storage. if (UIImage* image = [_lruCache objectForKey:snapshotID]) { // Copy both on-disk and in-memory versions. - [destinationCache setImage:image withSnapshotID:snapshotID]; + [destinationStorage setImage:image withSnapshotID:snapshotID]; // Copy the grey scale version, if available. auto iterator = _greyImageDictionary.find(snapshotID); if (iterator != _greyImageDictionary.end()) { - destinationCache->_greyImageDictionary.insert( + destinationStorage->_greyImageDictionary.insert( std::make_pair(snapshotID, iterator->second)); } } else { @@ -627,14 +642,14 @@ if (_taskRunner) { _taskRunner->PostTask( FROM_HERE, - base::BindOnce(&CopyImageFile, - [self imagePathForSnapshotID:snapshotID], - [destinationCache imagePathForSnapshotID:snapshotID])); + base::BindOnce( + &CopyImageFile, [self imagePathForSnapshotID:snapshotID], + [destinationStorage imagePathForSnapshotID:snapshotID])); _taskRunner->PostTask( FROM_HERE, base::BindOnce( &CopyImageFile, [self greyImagePathForSnapshotID:snapshotID], - [destinationCache greyImagePathForSnapshotID:snapshotID])); + [destinationStorage greyImagePathForSnapshotID:snapshotID])); } } @@ -684,10 +699,11 @@ // already in the cache, use it. UIImage* image = [_lruCache objectForKey:snapshotID]; - if (!_taskRunner) + if (!_taskRunner) { return; + } - __weak SnapshotCache* weakSelf = self; + __weak SnapshotStorage* weakSelf = self; _taskRunner->PostTaskAndReplyWithResult( FROM_HERE, base::BindOnce(&GreyImageFromCachedImage, _cacheDirectory, snapshotID, @@ -735,7 +751,7 @@ return; } - __weak SnapshotCache* weakSelf = self; + __weak SnapshotStorage* weakSelf = self; _taskRunner->PostTaskAndReplyWithResult( FROM_HERE, base::BindOnce(&ReadImageForSnapshotIDFromDisk, snapshotID, @@ -770,8 +786,9 @@ } } - if (!_taskRunner) + if (!_taskRunner) { return; + } _taskRunner->PostTask( FROM_HERE, @@ -779,11 +796,11 @@ _backgroundingColorImage, _cacheDirectory)); } -- (void)addObserver:(id<SnapshotCacheObserver>)observer { +- (void)addObserver:(id<SnapshotStorageObserver>)observer { [self.observers addObserver:observer]; } -- (void)removeObserver:(id<SnapshotCacheObserver>)observer { +- (void)removeObserver:(id<SnapshotStorageObserver>)observer { [self.observers removeObserver:observer]; } @@ -793,7 +810,7 @@ @end -@implementation SnapshotCache (TestingAdditions) +@implementation SnapshotStorage (TestingAdditions) - (void)greyImageForSnapshotID:(SnapshotID)snapshotID callback:(void (^)(UIImage*))callback {
diff --git a/ios/chrome/browser/snapshots/snapshot_cache_internal.h b/ios/chrome/browser/snapshots/snapshot_storage_internal.h similarity index 66% rename from ios/chrome/browser/snapshots/snapshot_cache_internal.h rename to ios/chrome/browser/snapshots/snapshot_storage_internal.h index bc65696d..2d3ee9c 100644 --- a/ios/chrome/browser/snapshots/snapshot_cache_internal.h +++ b/ios/chrome/browser/snapshots/snapshot_storage_internal.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 IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_INTERNAL_H_ -#define IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_INTERNAL_H_ +#ifndef IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_STORAGE_INTERNAL_H_ +#define IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_STORAGE_INTERNAL_H_ -#import "ios/chrome/browser/snapshots/snapshot_cache_internal.h" +#import "ios/chrome/browser/snapshots/snapshot_storage_internal.h" namespace base { class FilePath; @@ -13,7 +13,7 @@ @class NSString; -@interface SnapshotCache (Internal) +@interface SnapshotStorage (Internal) // Returns filepath to the color snapshot of `snapshotID`. - (base::FilePath)imagePathForSnapshotID:(SnapshotID)snapshotID; // Returns filepath to the greyscale snapshot of `snapshotID`. @@ -22,4 +22,4 @@ - (base::FilePath)legacyImagePathForSnapshotID:(NSString*)snapshotID; @end -#endif // IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_CACHE_INTERNAL_H_ +#endif // IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_STORAGE_INTERNAL_H_
diff --git a/ios/chrome/browser/snapshots/snapshot_storage_observer.h b/ios/chrome/browser/snapshots/snapshot_storage_observer.h new file mode 100644 index 0000000..b3c88cc2 --- /dev/null +++ b/ios/chrome/browser/snapshots/snapshot_storage_observer.h
@@ -0,0 +1,21 @@ +// Copyright 2017 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_STORAGE_OBSERVER_H_ +#define IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_STORAGE_OBSERVER_H_ + +#import <Foundation/Foundation.h> + +@class SnapshotStorage; + +// Interface for listening to events occurring to the SnapshotStorage. +@protocol SnapshotStorageObserver +@optional +// Tells the observing object that the `snapshotStorage` was updated with a new +// snapshot corresponding to `snapshotID`. +- (void)snapshotStorage:(SnapshotStorage*)snapshotStorage + didUpdateSnapshotForID:(SnapshotID)snapshotID; +@end + +#endif // IOS_CHROME_BROWSER_SNAPSHOTS_SNAPSHOT_STORAGE_OBSERVER_H_
diff --git a/ios/chrome/browser/snapshots/snapshot_cache_unittest.mm b/ios/chrome/browser/snapshots/snapshot_storage_unittest.mm similarity index 61% rename from ios/chrome/browser/snapshots/snapshot_cache_unittest.mm rename to ios/chrome/browser/snapshots/snapshot_storage_unittest.mm index 21a26db..037bb55 100644 --- a/ios/chrome/browser/snapshots/snapshot_cache_unittest.mm +++ b/ios/chrome/browser/snapshots/snapshot_storage_unittest.mm
@@ -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 "ios/chrome/browser/snapshots/snapshot_cache.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" #import <UIKit/UIKit.h> @@ -16,9 +16,9 @@ #import "base/strings/sys_string_conversions.h" #import "base/time/time.h" #import "components/sessions/core/session_id.h" -#import "ios/chrome/browser/snapshots/snapshot_cache_internal.h" -#import "ios/chrome/browser/snapshots/snapshot_cache_observer.h" #import "ios/chrome/browser/snapshots/snapshot_id.h" +#import "ios/chrome/browser/snapshots/snapshot_storage_internal.h" +#import "ios/chrome/browser/snapshots/snapshot_storage_observer.h" #import "ios/web/public/test/web_task_environment.h" #import "ios/web/public/thread/web_thread.h" #import "testing/gtest/include/gtest/gtest.h" @@ -38,12 +38,12 @@ } // namespace -@interface FakeSnapshotCacheObserver : NSObject<SnapshotCacheObserver> +@interface FakeSnapshotStorageObserver : NSObject <SnapshotStorageObserver> @property(nonatomic, assign) SnapshotID lastUpdatedID; @end -@implementation FakeSnapshotCacheObserver -- (void)snapshotCache:(SnapshotCache*)snapshotCache +@implementation FakeSnapshotStorageObserver +- (void)snapshotStorage:(SnapshotStorage*)snapshotStorage didUpdateSnapshotForID:(SnapshotID)snapshotID { self.lastUpdatedID = snapshotID; } @@ -51,27 +51,27 @@ namespace { -class SnapshotCacheTest : public PlatformTest { +class SnapshotStorageTest : public PlatformTest { protected: void TearDown() override { ClearDumpedImages(); - [snapshot_cache_ shutdown]; - snapshot_cache_ = nil; + [snapshot_storage_ shutdown]; + snapshot_storage_ = nil; PlatformTest::TearDown(); } // Build an array of snapshot IDs and an array of UIImages filled with // random colors. - [[nodiscard]] bool CreateSnapshotCache() { - DCHECK(!snapshot_cache_); + [[nodiscard]] bool CreateSnapshotStorage() { + DCHECK(!snapshot_storage_); if (!scoped_temp_directory_.CreateUniqueTempDir()) { return false; } - snapshot_cache_ = [[SnapshotCache alloc] + snapshot_storage_ = [[SnapshotStorage alloc] initWithStoragePath:scoped_temp_directory_.GetPath()]; - CGFloat scale = [snapshot_cache_ snapshotScaleForDevice]; + CGFloat scale = [snapshot_storage_ snapshotScaleForDevice]; srand(1); @@ -83,24 +83,24 @@ return true; } - SnapshotCache* GetSnapshotCache() { - DCHECK(snapshot_cache_); - return snapshot_cache_; + SnapshotStorage* GetSnapshotStorage() { + DCHECK(snapshot_storage_); + return snapshot_storage_; } // Adds a fake snapshot file into `directory` using `snapshot_id` in the // filename. base::FilePath AddSnapshotFileToDirectory(const base::FilePath directory, SnapshotID snapshot_id) { - // Use the same filename as designated by SnapshotCache. - base::FilePath cache_image_path = - [GetSnapshotCache() imagePathForSnapshotID:snapshot_id]; - base::FilePath image_filename = cache_image_path.BaseName(); + // Use the same filename as designated by SnapshotStorage. + base::FilePath storage_image_path = + [GetSnapshotStorage() imagePathForSnapshotID:snapshot_id]; + base::FilePath image_filename = storage_image_path.BaseName(); base::FilePath image_path = directory.Append(image_filename); EXPECT_TRUE(WriteFile(image_path, "")); EXPECT_TRUE(base::PathExists(image_path)); - EXPECT_FALSE(base::PathExists(cache_image_path)); + EXPECT_FALSE(base::PathExists(storage_image_path)); return image_path; } @@ -128,95 +128,96 @@ }]; } - // Flushes all the runloops internally used by the snapshot cache. This is + // Flushes all the runloops internally used by the snapshot storage. This is // done by asking to retrieve a non-existent image from disk and blocking // until the callback is invoked. - void FlushRunLoops(SnapshotCache* cache) { + void FlushRunLoops(SnapshotStorage* storage) { base::RunLoop run_loop; - [cache retrieveImageForSnapshotID:SnapshotID(SessionID::NewUnique().id()) - callback:base::CallbackToBlock( - base::IgnoreArgs<UIImage*>( - run_loop.QuitClosure()))]; + [storage retrieveImageForSnapshotID:SnapshotID(SessionID::NewUnique().id()) + callback:base::CallbackToBlock( + base::IgnoreArgs<UIImage*>( + run_loop.QuitClosure()))]; run_loop.Run(); } // This function removes the snapshots both from dictionary and from disk. void ClearDumpedImages() { - if (!snapshot_cache_) { + if (!snapshot_storage_) { return; } for (auto [snapshot_id, _] : test_images_) { - [snapshot_cache_ removeImageWithSnapshotID:snapshot_id]; + [snapshot_storage_ removeImageWithSnapshotID:snapshot_id]; } - FlushRunLoops(snapshot_cache_); + FlushRunLoops(snapshot_storage_); // The above calls to -removeImageWithSnapshotID remove both the color // and grey snapshots for each snapshotID, if they are on disk. However, // ensure we also get rid of the grey snapshots in memory. - [snapshot_cache_ removeGreyCache]; + [snapshot_storage_ removeGreyCache]; __block BOOL foundImage = NO; __block NSUInteger numCallbacks = 0; for (auto [snapshot_id, _] : test_images_) { const base::FilePath path = - [snapshot_cache_ imagePathForSnapshotID:snapshot_id]; + [snapshot_storage_ imagePathForSnapshotID:snapshot_id]; // Checks that the snapshot is not on disk. EXPECT_FALSE(base::PathExists(path)); // Check that the snapshot is not in the dictionary. - [snapshot_cache_ retrieveImageForSnapshotID:snapshot_id - callback:^(UIImage* image) { - ++numCallbacks; - if (image) { - foundImage = YES; - } - }]; + [snapshot_storage_ retrieveImageForSnapshotID:snapshot_id + callback:^(UIImage* image) { + ++numCallbacks; + if (image) { + foundImage = YES; + } + }]; } // Expect that all the callbacks ran and that none retrieved an image. - FlushRunLoops(snapshot_cache_); + FlushRunLoops(snapshot_storage_); EXPECT_EQ(test_images_.size(), numCallbacks); EXPECT_FALSE(foundImage); } - // Loads kSnapshotCount color images into the cache. If `waitForFilesOnDisk` - // is YES, will not return until the images have been written to disk. + // Loads kSnapshotCount color images into the storage. If + // `waitForFilesOnDisk` is YES, will not return until the images have been + // written to disk. void LoadAllColorImagesIntoCache(bool waitForFilesOnDisk) { LoadColorImagesIntoCache(kSnapshotCount, waitForFilesOnDisk); } - // Loads `count` color images into the cache. If `waitForFilesOnDisk` + // Loads `count` color images into the storage. If `waitForFilesOnDisk` // is YES, will not return until the images have been written to disk. void LoadColorImagesIntoCache(NSUInteger count, bool waitForFilesOnDisk) { - // Put color images in the cache. + // Put color images in the storage. for (auto [snapshot_id, image] : test_images_) { @autoreleasepool { - [snapshot_cache_ setImage:image withSnapshotID:snapshot_id]; + [snapshot_storage_ setImage:image withSnapshotID:snapshot_id]; } } if (waitForFilesOnDisk) { - FlushRunLoops(snapshot_cache_); + FlushRunLoops(snapshot_storage_); for (auto [snapshot_id, _] : test_images_) { // Check that images are on the disk. const base::FilePath path = - [snapshot_cache_ imagePathForSnapshotID:snapshot_id]; + [snapshot_storage_ imagePathForSnapshotID:snapshot_id]; EXPECT_TRUE(base::PathExists(path)); } } } // Waits for the first `count` grey images of `test_images_` to be placed in - // the cache. + // the storage. void WaitForGreyImagesInCache(NSUInteger count) { - FlushRunLoops(snapshot_cache_); + FlushRunLoops(snapshot_storage_); { NSUInteger index = 0; for (auto [snapshot_id, _] : test_images_) { - EXPECT_TRUE([snapshot_cache_ hasGreyImageInMemory:snapshot_id]); + EXPECT_TRUE([snapshot_storage_ hasGreyImageInMemory:snapshot_id]); if (++index >= count) { break; } @@ -267,24 +268,24 @@ web::WebTaskEnvironment task_environment_; base::ScopedTempDir scoped_temp_directory_; - SnapshotCache* snapshot_cache_; + SnapshotStorage* snapshot_storage_; std::map<SnapshotID, UIImage*> test_images_; }; -// This test simply put all the snapshots in the cache and then gets them back +// This test simply put all the snapshots in the storage and then gets them back // As the snapshots are kept in memory, the same pointer can be retrieved. // This test also checks that images are correctly removed from the disk. -TEST_F(SnapshotCacheTest, Cache) { - ASSERT_TRUE(CreateSnapshotCache()); - SnapshotCache* cache = GetSnapshotCache(); +TEST_F(SnapshotStorageTest, Cache) { + ASSERT_TRUE(CreateSnapshotStorage()); + SnapshotStorage* storage = GetSnapshotStorage(); - NSUInteger expectedCacheSize = MIN(kSnapshotCount, [cache lruCacheMaxSize]); + NSUInteger expectedCacheSize = MIN(kSnapshotCount, [storage lruCacheMaxSize]); - // Put all images in the cache. + // Put all images in the storage. { NSUInteger inserted_images = 0; for (auto [snapshot_id, image] : test_images_) { - [cache setImage:image withSnapshotID:snapshot_id]; + [storage setImage:image withSnapshotID:snapshot_id]; if (++inserted_images == expectedCacheSize) { break; } @@ -297,13 +298,13 @@ NSUInteger inserted_images = 0; for (auto [snapshot_id, image] : test_images_) { UIImage* expected_image = image; - [cache retrieveImageForSnapshotID:snapshot_id - callback:^(UIImage* retrieved_image) { - // Images have not been removed from the - // dictionnary. We expect the same pointer. - EXPECT_EQ(retrieved_image, expected_image); - ++numberOfCallbacks; - }]; + [storage retrieveImageForSnapshotID:snapshot_id + callback:^(UIImage* retrieved_image) { + // Images have not been removed from the + // dictionnary. We expect the same pointer. + EXPECT_EQ(retrieved_image, expected_image); + ++numberOfCallbacks; + }]; if (++inserted_images == expectedCacheSize) { break; } @@ -313,21 +314,21 @@ EXPECT_EQ(expectedCacheSize, numberOfCallbacks); } -// This test puts all the snapshots in the cache and flushes them to disk. +// This test puts all the snapshots in the storage and flushes them to disk. // The snapshots are then reloaded from the disk, and the colors are compared. -TEST_F(SnapshotCacheTest, SaveToDisk) { - ASSERT_TRUE(CreateSnapshotCache()); - SnapshotCache* cache = GetSnapshotCache(); +TEST_F(SnapshotStorageTest, SaveToDisk) { + ASSERT_TRUE(CreateSnapshotStorage()); + SnapshotStorage* storage = GetSnapshotStorage(); - // Put all images in the cache. + // Put all images in the storage. for (auto [snapshot_id, image] : test_images_) { - [cache setImage:image withSnapshotID:snapshot_id]; + [storage setImage:image withSnapshotID:snapshot_id]; } - FlushRunLoops(cache); + FlushRunLoops(storage); for (auto [snapshot_id, reference_image] : test_images_) { // Check that images are on the disk. - const base::FilePath path = [cache imagePathForSnapshotID:snapshot_id]; + const base::FilePath path = [storage imagePathForSnapshotID:snapshot_id]; EXPECT_TRUE(base::PathExists(path)); // Check image colors by comparing the first pixel against the reference @@ -369,38 +370,38 @@ } } -TEST_F(SnapshotCacheTest, Purge) { - ASSERT_TRUE(CreateSnapshotCache()); - SnapshotCache* cache = GetSnapshotCache(); +TEST_F(SnapshotStorageTest, Purge) { + ASSERT_TRUE(CreateSnapshotStorage()); + SnapshotStorage* storage = GetSnapshotStorage(); - // Put all images in the cache. + // Put all images in the storage. for (auto [snapshot_id, image] : test_images_) { - [cache setImage:image withSnapshotID:snapshot_id]; + [storage setImage:image withSnapshotID:snapshot_id]; } ASSERT_FALSE(test_images_.empty()); std::vector<SnapshotID> liveSnapshotIDs = {test_images_.begin()->first}; - // Purge the cache. - [cache purgeCacheOlderThan:(base::Time::Now() - base::Hours(1)) - keeping:liveSnapshotIDs]; - FlushRunLoops(cache); + // Purge the storage. + [storage purgeCacheOlderThan:(base::Time::Now() - base::Hours(1)) + keeping:liveSnapshotIDs]; + FlushRunLoops(storage); // Check that nothing has been deleted. for (auto [snapshot_id, _] : test_images_) { // Check that images are on the disk. - const base::FilePath path = [cache imagePathForSnapshotID:snapshot_id]; + const base::FilePath path = [storage imagePathForSnapshotID:snapshot_id]; EXPECT_TRUE(base::PathExists(path)); } - // Purge the cache. - [cache purgeCacheOlderThan:base::Time::Now() keeping:liveSnapshotIDs]; - FlushRunLoops(cache); + // Purge the storage. + [storage purgeCacheOlderThan:base::Time::Now() keeping:liveSnapshotIDs]; + FlushRunLoops(storage); // Check that the file have been deleted. for (auto [snapshot_id, _] : test_images_) { // Check that images are on the disk. - const base::FilePath path = [cache imagePathForSnapshotID:snapshot_id]; + const base::FilePath path = [storage imagePathForSnapshotID:snapshot_id]; if (snapshot_id == *liveSnapshotIDs.begin()) { EXPECT_TRUE(base::PathExists(path)); } else { @@ -411,62 +412,62 @@ // Tests that migration code correctly rename the specified files and leave // the other files untouched. -TEST_F(SnapshotCacheTest, RenameSnapshots) { - ASSERT_TRUE(CreateSnapshotCache()); - SnapshotCache* cache = GetSnapshotCache(); +TEST_F(SnapshotStorageTest, RenameSnapshots) { + ASSERT_TRUE(CreateSnapshotStorage()); + SnapshotStorage* storage = GetSnapshotStorage(); // This snapshot will be renamed. NSString* image1_id = [[NSUUID UUID] UUIDString]; - base::FilePath image1_path = [cache legacyImagePathForSnapshotID:image1_id]; + base::FilePath image1_path = [storage legacyImagePathForSnapshotID:image1_id]; ASSERT_TRUE(base::WriteFile(image1_path, "image1")); // This snapshot will not be renamed. NSString* image2_id = [[NSUUID UUID] UUIDString]; - base::FilePath image2_path = [cache legacyImagePathForSnapshotID:image2_id]; + base::FilePath image2_path = [storage legacyImagePathForSnapshotID:image2_id]; ASSERT_TRUE(base::WriteFile(image2_path, "image2")); SnapshotID new_id = SnapshotID(SessionID::NewUnique().id()); - [cache renameSnapshotsWithIDs:@[ image1_id ] toIDs:{new_id}]; - FlushRunLoops(cache); + [storage renameSnapshotsWithIDs:@[ image1_id ] toIDs:{new_id}]; + FlushRunLoops(storage); // image1 should have been moved. EXPECT_FALSE(base::PathExists(image1_path)); - EXPECT_TRUE(base::PathExists([cache imagePathForSnapshotID:new_id])); + EXPECT_TRUE(base::PathExists([storage imagePathForSnapshotID:new_id])); // image2 should not have moved. EXPECT_TRUE(base::PathExists(image2_path)); } // Tests that createGreyCache creates the grey snapshots in the background, -// from color images in the in-memory cache. When the grey images are all +// from color images in the in-memory storage. When the grey images are all // loaded into memory, tests that the request to retrieve the grey snapshot // calls the callback immediately. // Disabled on simulators because it sometimes crashes. crbug/421425 #if !TARGET_IPHONE_SIMULATOR -TEST_F(SnapshotCacheTest, CreateGreyCache) { - ASSERT_TRUE(CreateSnapshotCache()); +TEST_F(SnapshotStorageTest, CreateGreyCache) { + ASSERT_TRUE(CreateSnapshotStorage()); LoadAllColorImagesIntoCache(true); - // Request the creation of a grey image cache for all images. - SnapshotCache* cache = GetSnapshotCache(); + // Request the creation of a grey image storage for all images. + SnapshotStorage* storage = GetSnapshotStorage(); { std::vector<SnapshotID> snapshot_ids; for (auto [snapshot_id, _] : test_images_) { snapshot_ids.push_back(snapshot_id); } - [cache createGreyCache:snapshot_ids]; + [storage createGreyCache:snapshot_ids]; } - // Wait for them to be put into the grey image cache. + // Wait for them to be put into the grey image storage. WaitForGreyImagesInCache(kSnapshotCount); __block NSUInteger numberOfCallbacks = 0; for (auto [snapshot_id, _] : test_images_) { - [cache retrieveGreyImageForSnapshotID:snapshot_id - callback:^(UIImage* image) { - EXPECT_TRUE(image); - ++numberOfCallbacks; - }]; + [storage retrieveGreyImageForSnapshotID:snapshot_id + callback:^(UIImage* image) { + EXPECT_TRUE(image); + ++numberOfCallbacks; + }]; } EXPECT_EQ(numberOfCallbacks, kSnapshotCount); @@ -475,34 +476,34 @@ // Same as previous test, except that all the color images are on disk, // rather than in memory. // Disabled due to the greyImage crash. b/8048597 -TEST_F(SnapshotCacheTest, CreateGreyCacheFromDisk) { - ASSERT_TRUE(CreateSnapshotCache()); +TEST_F(SnapshotStorageTest, CreateGreyCacheFromDisk) { + ASSERT_TRUE(CreateSnapshotStorage()); LoadAllColorImagesIntoCache(true); - // Remove color images from in-memory cache. - SnapshotCache* cache = GetSnapshotCache(); + // Remove color images from in-memory storage. + SnapshotStorage* storage = GetSnapshotStorage(); TriggerMemoryWarning(); - // Request the creation of a grey image cache for all images. + // Request the creation of a grey image storage for all images. { std::vector<SnapshotID> snapshot_ids; for (auto [snapshot_id, _] : test_images_) { snapshot_ids.push_back(snapshot_id); } - [cache createGreyCache:snapshot_ids]; + [storage createGreyCache:snapshot_ids]; } - // Wait for them to be put into the grey image cache. + // Wait for them to be put into the grey image storage. WaitForGreyImagesInCache(kSnapshotCount); __block NSUInteger numberOfCallbacks = 0; for (auto [snapshot_id, _] : test_images_) { - [cache retrieveGreyImageForSnapshotID:snapshot_id - callback:^(UIImage* image) { - EXPECT_TRUE(image); - ++numberOfCallbacks; - }]; + [storage retrieveGreyImageForSnapshotID:snapshot_id + callback:^(UIImage* image) { + EXPECT_TRUE(image); + ++numberOfCallbacks; + }]; } EXPECT_EQ(numberOfCallbacks, kSnapshotCount); @@ -511,11 +512,11 @@ // Tests mostRecentGreyBlock, which is a block to be called when the most // recently requested grey image is finally loaded. -// The test requests three images be cached as grey images. Only the final +// The test requests three images be storaged as grey images. Only the final // callback of the three requests should be called. // Disabled due to the greyImage crash. b/8048597 -TEST_F(SnapshotCacheTest, MostRecentGreyBlock) { - ASSERT_TRUE(CreateSnapshotCache()); +TEST_F(SnapshotStorageTest, MostRecentGreyBlock) { + ASSERT_TRUE(CreateSnapshotStorage()); const NSUInteger kNumImages = 3; std::vector<SnapshotID> snapshotIDs; for (auto [snapshot_id, _] : test_images_) { @@ -525,35 +526,35 @@ } } - SnapshotCache* cache = GetSnapshotCache(); + SnapshotStorage* storage = GetSnapshotStorage(); - // Put 3 images in the cache. + // Put 3 images in the storage. LoadColorImagesIntoCache(kNumImages, true); // Make sure the color images are only on disk, to ensure the background // thread is slow enough to queue up the requests. TriggerMemoryWarning(); - // Enable the grey image cache. - [cache createGreyCache:snapshotIDs]; + // Enable the grey image storage. + [storage createGreyCache:snapshotIDs]; // Request the grey versions __block BOOL firstCallbackCalled = NO; __block BOOL secondCallbackCalled = NO; __block BOOL thirdCallbackCalled = NO; ASSERT_GE(snapshotIDs.size(), kNumImages); - [cache greyImageForSnapshotID:snapshotIDs[0] - callback:^(UIImage*) { - firstCallbackCalled = YES; - }]; - [cache greyImageForSnapshotID:snapshotIDs[1] - callback:^(UIImage*) { - secondCallbackCalled = YES; - }]; - [cache greyImageForSnapshotID:snapshotIDs[2] - callback:^(UIImage*) { - thirdCallbackCalled = YES; - }]; + [storage greyImageForSnapshotID:snapshotIDs[0] + callback:^(UIImage*) { + firstCallbackCalled = YES; + }]; + [storage greyImageForSnapshotID:snapshotIDs[1] + callback:^(UIImage*) { + secondCallbackCalled = YES; + }]; + [storage greyImageForSnapshotID:snapshotIDs[2] + callback:^(UIImage*) { + thirdCallbackCalled = YES; + }]; // Wait for them to be loaded. WaitForGreyImagesInCache(kNumImages); @@ -565,23 +566,24 @@ // Test the function used to save a grey copy of a color snapshot fully on a // background thread when the application is backgrounded. -TEST_F(SnapshotCacheTest, GreyImageAllInBackground) { - ASSERT_TRUE(CreateSnapshotCache()); +TEST_F(SnapshotStorageTest, GreyImageAllInBackground) { + ASSERT_TRUE(CreateSnapshotStorage()); LoadAllColorImagesIntoCache(true); - SnapshotCache* cache = GetSnapshotCache(); + SnapshotStorage* storage = GetSnapshotStorage(); // Now convert every image into a grey image, on disk, in the background. for (auto [snapshot_id, _] : test_images_) { - [cache saveGreyInBackgroundForSnapshotID:snapshot_id]; + [storage saveGreyInBackgroundForSnapshotID:snapshot_id]; } // Waits for the grey images for `test_images_` to be written to disk, which // happens in a background thread. - FlushRunLoops(cache); + FlushRunLoops(storage); for (auto [snapshot_id, _] : test_images_) { - const base::FilePath path = [cache greyImagePathForSnapshotID:snapshot_id]; + const base::FilePath path = + [storage greyImagePathForSnapshotID:snapshot_id]; EXPECT_TRUE(base::PathExists(path)); base::DeleteFile(path); } @@ -589,24 +591,24 @@ // Verifies that image size and scale are preserved when writing and reading // from disk. -TEST_F(SnapshotCacheTest, SizeAndScalePreservation) { - ASSERT_TRUE(CreateSnapshotCache()); - SnapshotCache* cache = GetSnapshotCache(); +TEST_F(SnapshotStorageTest, SizeAndScalePreservation) { + ASSERT_TRUE(CreateSnapshotStorage()); + SnapshotStorage* storage = GetSnapshotStorage(); // Create an image with the expected snapshot scale. - CGFloat scale = [cache snapshotScaleForDevice]; + CGFloat scale = [storage snapshotScaleForDevice]; UIImage* image = GenerateRandomImage(scale); - // Add the image to the cache then call handle low memory to ensure the image - // is read from disk instead of the in-memory cache. + // Add the image to the storage then call handle low memory to ensure the + // image is read from disk instead of the in-memory storage. const SnapshotID kSnapshotID(SessionID::NewUnique().id()); - [cache setImage:image withSnapshotID:kSnapshotID]; - FlushRunLoops(cache); // ensure the file is written to disk. + [storage setImage:image withSnapshotID:kSnapshotID]; + FlushRunLoops(storage); // ensure the file is written to disk. TriggerMemoryWarning(); // Retrive the image and have the callback verify the size and scale. __block BOOL callbackComplete = NO; - [cache + [storage retrieveImageForSnapshotID:kSnapshotID callback:^(UIImage* imageFromDisk) { EXPECT_EQ(image.size.width, imageFromDisk.size.width); @@ -615,92 +617,92 @@ EXPECT_EQ(image.scale, imageFromDisk.scale); callbackComplete = YES; }]; - FlushRunLoops(cache); + FlushRunLoops(storage); EXPECT_TRUE(callbackComplete); } // Verifies that retina-scale images are deleted properly. -TEST_F(SnapshotCacheTest, DeleteRetinaImages) { - ASSERT_TRUE(CreateSnapshotCache()); - SnapshotCache* cache = GetSnapshotCache(); - if ([cache snapshotScaleForDevice] != 2.0) { +TEST_F(SnapshotStorageTest, DeleteRetinaImages) { + ASSERT_TRUE(CreateSnapshotStorage()); + SnapshotStorage* storage = GetSnapshotStorage(); + if ([storage snapshotScaleForDevice] != 2.0) { return; } // Create an image with retina scale. UIImage* image = GenerateRandomImage(2.0); - // Add the image to the cache then call handle low memory to ensure the image - // is read from disk instead of the in-memory cache. + // Add the image to the storage then call handle low memory to ensure the + // image is read from disk instead of the in-memory storage. const SnapshotID kSnapshotID(SessionID::NewUnique().id()); - [cache setImage:image withSnapshotID:kSnapshotID]; - FlushRunLoops(cache); // ensure the file is written to disk. + [storage setImage:image withSnapshotID:kSnapshotID]; + FlushRunLoops(storage); // ensure the file is written to disk. TriggerMemoryWarning(); // Verify the file was writted with @2x in the file name. - base::FilePath retinaFile = [cache imagePathForSnapshotID:kSnapshotID]; + base::FilePath retinaFile = [storage imagePathForSnapshotID:kSnapshotID]; EXPECT_TRUE(base::PathExists(retinaFile)); // Delete the image. - [cache removeImageWithSnapshotID:kSnapshotID]; - FlushRunLoops(cache); // ensure the file is removed. + [storage removeImageWithSnapshotID:kSnapshotID]; + FlushRunLoops(storage); // ensure the file is removed. EXPECT_FALSE(base::PathExists(retinaFile)); } // Tests that image immediately deletes when calling // `-removeImageWithSnapshotID:`. -TEST_F(SnapshotCacheTest, ImageDeleted) { - ASSERT_TRUE(CreateSnapshotCache()); - SnapshotCache* cache = GetSnapshotCache(); +TEST_F(SnapshotStorageTest, ImageDeleted) { + ASSERT_TRUE(CreateSnapshotStorage()); + SnapshotStorage* storage = GetSnapshotStorage(); UIImage* image = GenerateRandomImage(0); const SnapshotID kSnapshotID(SessionID::NewUnique().id()); - [cache setImage:image withSnapshotID:kSnapshotID]; - base::FilePath image_path = [cache imagePathForSnapshotID:kSnapshotID]; - [cache removeImageWithSnapshotID:kSnapshotID]; + [storage setImage:image withSnapshotID:kSnapshotID]; + base::FilePath image_path = [storage imagePathForSnapshotID:kSnapshotID]; + [storage removeImageWithSnapshotID:kSnapshotID]; // Give enough time for deletion. - FlushRunLoops(cache); + FlushRunLoops(storage); EXPECT_FALSE(base::PathExists(image_path)); } // Tests that all images are deleted when calling `-removeAllImages`. -TEST_F(SnapshotCacheTest, AllImagesDeleted) { - ASSERT_TRUE(CreateSnapshotCache()); - SnapshotCache* cache = GetSnapshotCache(); +TEST_F(SnapshotStorageTest, AllImagesDeleted) { + ASSERT_TRUE(CreateSnapshotStorage()); + SnapshotStorage* storage = GetSnapshotStorage(); UIImage* image = GenerateRandomImage(0); const SnapshotID kSnapshotID1(SessionID::NewUnique().id()); const SnapshotID kSnapshotID2(SessionID::NewUnique().id()); - [cache setImage:image withSnapshotID:kSnapshotID1]; - [cache setImage:image withSnapshotID:kSnapshotID1]; - base::FilePath image_1_path = [cache imagePathForSnapshotID:kSnapshotID1]; - base::FilePath image_2_path = [cache imagePathForSnapshotID:kSnapshotID1]; - [cache removeAllImages]; + [storage setImage:image withSnapshotID:kSnapshotID1]; + [storage setImage:image withSnapshotID:kSnapshotID1]; + base::FilePath image_1_path = [storage imagePathForSnapshotID:kSnapshotID1]; + base::FilePath image_2_path = [storage imagePathForSnapshotID:kSnapshotID1]; + [storage removeAllImages]; // Give enough time for deletion. - FlushRunLoops(cache); + FlushRunLoops(storage); EXPECT_FALSE(base::PathExists(image_1_path)); EXPECT_FALSE(base::PathExists(image_2_path)); } -// Tests that observers are notified when a snapshot is cached and removed. -TEST_F(SnapshotCacheTest, ObserversNotifiedOnSetAndRemoveImage) { - ASSERT_TRUE(CreateSnapshotCache()); - SnapshotCache* cache = GetSnapshotCache(); - FakeSnapshotCacheObserver* observer = - [[FakeSnapshotCacheObserver alloc] init]; - [cache addObserver:observer]; +// Tests that observers are notified when a snapshot is storaged and removed. +TEST_F(SnapshotStorageTest, ObserversNotifiedOnSetAndRemoveImage) { + ASSERT_TRUE(CreateSnapshotStorage()); + SnapshotStorage* storage = GetSnapshotStorage(); + FakeSnapshotStorageObserver* observer = + [[FakeSnapshotStorageObserver alloc] init]; + [storage addObserver:observer]; EXPECT_FALSE(observer.lastUpdatedID.valid()); ASSERT_TRUE(!test_images_.empty()); std::pair<SnapshotID, UIImage*> pair = *test_images_.begin(); - [cache setImage:pair.second withSnapshotID:pair.first]; + [storage setImage:pair.second withSnapshotID:pair.first]; EXPECT_EQ(pair.first, observer.lastUpdatedID); observer.lastUpdatedID = SnapshotID(); - [cache removeImageWithSnapshotID:pair.first]; + [storage removeImageWithSnapshotID:pair.first]; EXPECT_EQ(pair.first, observer.lastUpdatedID); - [cache removeObserver:observer]; + [storage removeObserver:observer]; } -// Tests that creating the SnapshotCache migrate an existing legacy cache. -TEST_F(SnapshotCacheTest, MigrateCache) { +// Tests that creating the SnapshotStorage migrate an existing legacy storage. +TEST_F(SnapshotStorageTest, MigrateCache) { ASSERT_TRUE(scoped_temp_directory_.CreateUniqueTempDir()); const base::FilePath root = scoped_temp_directory_.GetPath(); @@ -713,11 +715,11 @@ ASSERT_TRUE(base::CreateDirectory(legacy_path)); ASSERT_TRUE(base::WriteFile(legacy_path.Append(kFilename), "")); - SnapshotCache* cache = - [[SnapshotCache alloc] initWithStoragePath:storage_path - legacyPath:legacy_path]; + SnapshotStorage* storage = + [[SnapshotStorage alloc] initWithStoragePath:storage_path + legacyPath:legacy_path]; - FlushRunLoops(cache); + FlushRunLoops(storage); EXPECT_TRUE(base::DirectoryExists(storage_path)); EXPECT_FALSE(base::DirectoryExists(legacy_path)); @@ -725,32 +727,32 @@ // Check that the legacy directory content has been moved. EXPECT_TRUE(base::PathExists(storage_path.Append(kFilename))); - [cache shutdown]; + [storage shutdown]; } -// Tests that creating the SnapshotCache simply create the cache directory +// Tests that creating the SnapshotStorage simply create the storage directory // if the legacy path is not specified. -TEST_F(SnapshotCacheTest, MigrateCache_EmptyLegacyPath) { +TEST_F(SnapshotStorageTest, MigrateCache_EmptyLegacyPath) { ASSERT_TRUE(scoped_temp_directory_.CreateUniqueTempDir()); const base::FilePath root = scoped_temp_directory_.GetPath(); const base::FilePath storage_path = root.Append(kSnapshots).Append(kIdentifier); - SnapshotCache* cache = - [[SnapshotCache alloc] initWithStoragePath:storage_path - legacyPath:base::FilePath()]; + SnapshotStorage* storage = + [[SnapshotStorage alloc] initWithStoragePath:storage_path + legacyPath:base::FilePath()]; - FlushRunLoops(cache); + FlushRunLoops(storage); EXPECT_TRUE(base::DirectoryExists(storage_path)); - [cache shutdown]; + [storage shutdown]; } -// Tests that creating the SnapshotCache simply create the cache directory +// Tests that creating the SnapshotStorage simply create the storage directory // if the legacy path does not exists. -TEST_F(SnapshotCacheTest, MigrateCache_NoLegacyStorage) { +TEST_F(SnapshotStorageTest, MigrateCache_NoLegacyStorage) { ASSERT_TRUE(scoped_temp_directory_.CreateUniqueTempDir()); const base::FilePath root = scoped_temp_directory_.GetPath(); @@ -762,21 +764,21 @@ ASSERT_FALSE(base::DirectoryExists(legacy_path)); - SnapshotCache* cache = - [[SnapshotCache alloc] initWithStoragePath:storage_path - legacyPath:legacy_path]; + SnapshotStorage* storage = + [[SnapshotStorage alloc] initWithStoragePath:storage_path + legacyPath:legacy_path]; - FlushRunLoops(cache); + FlushRunLoops(storage); EXPECT_TRUE(base::DirectoryExists(storage_path)); EXPECT_FALSE(base::DirectoryExists(legacy_path)); - [cache shutdown]; + [storage shutdown]; } -// Tests that creating the SnapshotCache can fail to create the cache +// Tests that creating the SnapshotStorage can fail to create the storage // directory and that the legacy directory is left untouch in that case. -TEST_F(SnapshotCacheTest, MigrateCache_FailCreatingCache) { +TEST_F(SnapshotStorageTest, MigrateCache_FailCreatingCache) { ASSERT_TRUE(scoped_temp_directory_.CreateUniqueTempDir()); const base::FilePath root = scoped_temp_directory_.GetPath(); @@ -789,23 +791,23 @@ ASSERT_TRUE(base::CreateDirectory(legacy_path)); ASSERT_TRUE(base::WriteFile(legacy_path.Append(kFilename), "")); - // Create a file with the same name as the cache directory to + // Create a file with the same name as the storage directory to // simulate a failure (in real world the failure would be caused // by a disk that is full). ASSERT_TRUE(base::CreateDirectory(storage_path.DirName())); ASSERT_TRUE(base::WriteFile(storage_path, "")); - SnapshotCache* cache = - [[SnapshotCache alloc] initWithStoragePath:storage_path - legacyPath:base::FilePath()]; + SnapshotStorage* storage = + [[SnapshotStorage alloc] initWithStoragePath:storage_path + legacyPath:base::FilePath()]; - FlushRunLoops(cache); + FlushRunLoops(storage); EXPECT_FALSE(base::DirectoryExists(storage_path)); EXPECT_TRUE(base::DirectoryExists(legacy_path)); EXPECT_TRUE(base::PathExists(legacy_path.Append(kFilename))); - [cache shutdown]; + [storage shutdown]; } } // namespace
diff --git a/ios/chrome/browser/snapshots/snapshot_tab_helper.h b/ios/chrome/browser/snapshots/snapshot_tab_helper.h index 4437197..c45e0be7 100644 --- a/ios/chrome/browser/snapshots/snapshot_tab_helper.h +++ b/ios/chrome/browser/snapshots/snapshot_tab_helper.h
@@ -13,7 +13,7 @@ #include "ios/web/public/web_state_observer.h" #include "ios/web/public/web_state_user_data.h" -@class SnapshotCache; +@class SnapshotStorage; @class SnapshotGenerator; @protocol SnapshotGeneratorDelegate; @@ -34,9 +34,9 @@ // results in failures. The delegate is not owned by the tab helper. void SetDelegate(id<SnapshotGeneratorDelegate> delegate); - // Sets the snapshot cache to be used to store and retrieve snapshots. This is - // not owned by the tab helper. - void SetSnapshotCache(SnapshotCache* snapshot_cache); + // Sets the snapshot storage to be used to store and retrieve snapshots. This + // is not owned by the tab helper. + void SetSnapshotStorage(SnapshotStorage* snapshot_storage); // Retrieves a color snapshot for the current page, invoking `callback` with // the image. The callback may be called synchronously if there is a cached @@ -52,13 +52,13 @@ // `callback` with nil if a snapshot does not exist. void RetrieveGreySnapshot(void (^callback)(UIImage*)); - // Asynchronously generates a new snapshot, updates the snapshot cache, and + // Asynchronously generates a new snapshot, updates the snapshot storage, and // invokes `callback` with the new snapshot image. Invokes `callback` with nil // if snapshot generation fails. void UpdateSnapshotWithCallback(void (^callback)(UIImage*)); // Generates a new snapshot without any overlays, and returns the new snapshot - // image. This does not update the snapshot cache. Returns nil if snapshot + // image. This does not update the snapshot storage. Returns nil if snapshot // generation fails. UIImage* GenerateSnapshotWithoutOverlays();
diff --git a/ios/chrome/browser/snapshots/snapshot_tab_helper.mm b/ios/chrome/browser/snapshots/snapshot_tab_helper.mm index 0bd5a7f..e014d4fa 100644 --- a/ios/chrome/browser/snapshots/snapshot_tab_helper.mm +++ b/ios/chrome/browser/snapshots/snapshot_tab_helper.mm
@@ -8,8 +8,8 @@ #import "base/memory/ptr_util.h" #import "base/metrics/histogram_functions.h" #import "base/task/sequenced_task_runner.h" -#import "ios/chrome/browser/snapshots/snapshot_cache.h" #import "ios/chrome/browser/snapshots/snapshot_generator.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" #import "ios/web/public/thread/web_task_traits.h" #import "ios/web/public/web_client.h" #import "ios/web/public/web_state.h" @@ -50,8 +50,8 @@ snapshot_generator_.delegate = delegate; } -void SnapshotTabHelper::SetSnapshotCache(SnapshotCache* snapshot_cache) { - snapshot_generator_.snapshotCache = snapshot_cache; +void SnapshotTabHelper::SetSnapshotStorage(SnapshotStorage* snapshot_storage) { + snapshot_generator_.snapshotStorage = snapshot_storage; } void SnapshotTabHelper::RetrieveColorSnapshot(void (^callback)(UIImage*)) {
diff --git a/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm b/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm index a7e2f5f..baf1ef2 100644 --- a/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm +++ b/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm
@@ -9,7 +9,7 @@ #import "ios/chrome/browser/shared/ui/util/image/image_util.h" #import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/snapshots/fake_snapshot_generator_delegate.h" -#import "ios/chrome/browser/snapshots/snapshot_cache.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" #import "ios/web/public/test/fakes/fake_web_state.h" #import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" @@ -85,13 +85,13 @@ SnapshotTabHelper::CreateForWebState(&web_state_); SnapshotTabHelper::FromWebState(&web_state_)->SetDelegate(delegate_); - // Set custom snapshot cache. + // Set custom snapshot storage. EXPECT_TRUE(scoped_temp_directory_.CreateUniqueTempDir()); base::FilePath directory_name = scoped_temp_directory_.GetPath(); - snapshot_cache_ = - [[SnapshotCache alloc] initWithStoragePath:directory_name]; + snapshot_storage_ = + [[SnapshotStorage alloc] initWithStoragePath:directory_name]; SnapshotTabHelper::FromWebState(&web_state_) - ->SetSnapshotCache(snapshot_cache_); + ->SetSnapshotStorage(snapshot_storage_); // Add a fake view to the FakeWebState. This will be used to capture the // snapshot. By default the WebState is not ready for taking snapshot. @@ -104,12 +104,12 @@ SnapshotTabHelperTest(const SnapshotTabHelperTest&) = delete; SnapshotTabHelperTest& operator=(const SnapshotTabHelperTest&) = delete; - ~SnapshotTabHelperTest() override { [snapshot_cache_ shutdown]; } + ~SnapshotTabHelperTest() override { [snapshot_storage_ shutdown]; } void SetCachedSnapshot(UIImage* image) { SnapshotID snapshot_id = SnapshotTabHelper::FromWebState(&web_state_)->GetSnapshotID(); - [snapshot_cache_ setImage:image withSnapshotID:snapshot_id]; + [snapshot_storage_ setImage:image withSnapshotID:snapshot_id]; } UIImage* GetCachedSnapshot() { @@ -119,11 +119,11 @@ __block UIImage* snapshot = nil; SnapshotID snapshot_id = SnapshotTabHelper::FromWebState(&web_state_)->GetSnapshotID(); - [snapshot_cache_ retrieveImageForSnapshotID:snapshot_id - callback:^(UIImage* cached_snapshot) { - snapshot = cached_snapshot; - run_loop_ptr->Quit(); - }]; + [snapshot_storage_ retrieveImageForSnapshotID:snapshot_id + callback:^(UIImage* cached_snapshot) { + snapshot = cached_snapshot; + run_loop_ptr->Quit(); + }]; run_loop.Run(); return snapshot; @@ -133,13 +133,13 @@ web::WebTaskEnvironment task_environment_; base::ScopedTempDir scoped_temp_directory_; TabHelperSnapshotGeneratorDelegate* delegate_ = nil; - SnapshotCache* snapshot_cache_ = nil; + SnapshotStorage* snapshot_storage_ = nil; web::FakeWebState web_state_; }; // Tests that RetrieveColorSnapshot uses the image from the cache if // there is one present. -TEST_F(SnapshotTabHelperTest, RetrieveColorSnapshotCachedSnapshot) { +TEST_F(SnapshotTabHelperTest, RetrieveColorSnapshotStoragedSnapshot) { SetCachedSnapshot( UIImageWithSizeAndSolidColor(kCachedSnapshotSize, [UIColor greenColor])); @@ -204,7 +204,7 @@ // Tests that RetrieveGreySnapshot uses the image from the cache if // there is one present, and that it is greyscale. -TEST_F(SnapshotTabHelperTest, RetrieveGreySnapshotCachedSnapshot) { +TEST_F(SnapshotTabHelperTest, RetrieveGreySnapshotStoragedSnapshot) { SetCachedSnapshot( UIImageWithSizeAndSolidColor(kCachedSnapshotSize, [UIColor greenColor])); @@ -334,8 +334,8 @@ } // Tests that RemoveSnapshot deletes the cached snapshot from memory and -// disk (i.e. that SnapshotCache cannot retrieve a snapshot; depends on -// a correct implementation of SnapshotCache). +// disk (i.e. that SnapshotStorage cannot retrieve a snapshot; depends on +// a correct implementation of SnapshotStorage). TEST_F(SnapshotTabHelperTest, RemoveSnapshot) { SetCachedSnapshot( UIImageWithSizeAndSolidColor(kDefaultSnapshotSize, [UIColor greenColor])); @@ -346,7 +346,7 @@ } TEST_F(SnapshotTabHelperTest, ClosingWebStateDoesNotRemoveSnapshot) { - id partialMock = OCMPartialMock(snapshot_cache_); + id partialMock = OCMPartialMock(snapshot_storage_); auto web_state = std::make_unique<web::FakeWebState>(); SnapshotTabHelper::CreateForWebState(web_state.get());
diff --git a/ios/chrome/browser/ui/side_swipe/side_swipe_mediator.mm b/ios/chrome/browser/ui/side_swipe/side_swipe_mediator.mm index 2f6d646..3099ab9 100644 --- a/ios/chrome/browser/ui/side_swipe/side_swipe_mediator.mm +++ b/ios/chrome/browser/ui/side_swipe/side_swipe_mediator.mm
@@ -14,7 +14,7 @@ #import "ios/chrome/browser/shared/model/web_state_list/web_state_list_observer_bridge.h" #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/chrome/browser/snapshots/snapshot_browser_agent.h" -#import "ios/chrome/browser/snapshots/snapshot_cache.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" #import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" #import "ios/chrome/browser/ui/fullscreen/animated_scoped_fullscreen_disabler.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller.h" @@ -108,7 +108,7 @@ // Load grey snapshots for the next `kIpadGreySwipeTabCount` tabs in // `direction`. - (void)createGreyCache:(UISwipeGestureRecognizerDirection)direction; -// Tell snapshot cache to clear grey cache. +// Tell snapshot storage to clear grey cache. - (void)deleteGreyCache; // Handle tab side swipe for iPad. Change tabs according to swipe distance. - (void)handleiPadTabSwipe:(SideSwipeGestureRecognizer*)gesture; @@ -230,11 +230,11 @@ } index = index + dx; } - [_snapshotBrowserAgent->snapshot_cache() createGreyCache:snapshotIDs]; + [_snapshotBrowserAgent->snapshot_storage() createGreyCache:snapshotIDs]; } - (void)deleteGreyCache { - [_snapshotBrowserAgent->snapshot_cache() removeGreyCache]; + [_snapshotBrowserAgent->snapshot_storage() removeGreyCache]; } - (void)handlePan:(SideSwipeGestureRecognizer*)gesture {
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/base_grid_mediator.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/base_grid_mediator.mm index 588e70adb..863a707 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/base_grid_mediator.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/base_grid_mediator.mm
@@ -45,8 +45,8 @@ #import "ios/chrome/browser/shared/public/features/system_flags.h" #import "ios/chrome/browser/shared/ui/util/url_with_title.h" #import "ios/chrome/browser/snapshots/snapshot_browser_agent.h" -#import "ios/chrome/browser/snapshots/snapshot_cache.h" -#import "ios/chrome/browser/snapshots/snapshot_cache_observer.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" +#import "ios/chrome/browser/snapshots/snapshot_storage_observer.h" #import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" #import "ios/chrome/browser/tabs/features.h" #import "ios/chrome/browser/tabs_search/model/tabs_search_service.h" @@ -136,7 +136,7 @@ } // namespace @interface BaseGridMediator () <CRWWebStateObserver, - SnapshotCacheObserver, + SnapshotStorageObserver, WebStateListObserving> // The browser state from the browser. @property(nonatomic, readonly) ChromeBrowserState* browserState; @@ -181,7 +181,7 @@ #pragma mark - Public properties - (void)setBrowser:(Browser*)browser { - [self.snapshotCache removeObserver:self]; + [self.snapshotStorage removeObserver:self]; _scopedWebStateListObservation->RemoveAllObservations(); _scopedWebStateObservation->RemoveAllObservations(); @@ -190,7 +190,7 @@ _webStateList = browser ? browser->GetWebStateList() : nullptr; _browserState = browser ? browser->GetBrowserState() : nullptr; - [self.snapshotCache addObserver:self]; + [self.snapshotStorage addObserver:self]; if (_webStateList) { _scopedWebStateListObservation->AddObservation(_webStateList); @@ -393,9 +393,9 @@ [self.consumer replaceItemID:webState->GetUniqueIdentifier() withItem:item]; } -#pragma mark - SnapshotCacheObserver +#pragma mark - SnapshotStorageObserver -- (void)snapshotCache:(SnapshotCache*)snapshotCache +- (void)snapshotStorage:(SnapshotStorage*)snapshotStorage didUpdateSnapshotForID:(SnapshotID)snapshotID { web::WebState* webState = nullptr; for (int i = self.webStateList->pinned_tabs_count(); @@ -958,12 +958,12 @@ } } -// Returns a SnapshotCache for the current browser. -- (SnapshotCache*)snapshotCache { +// Returns a SnapshotStorage for the current browser. +- (SnapshotStorage*)snapshotStorage { if (!self.browser) { return nil; } - return SnapshotBrowserAgent::FromBrowser(self.browser)->snapshot_cache(); + return SnapshotBrowserAgent::FromBrowser(self.browser)->snapshot_storage(); } - (void)addItemsWithIDsToReadingList:(const std::set<web::WebStateID>&)itemIDs {
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.mm index 3e862217..183e62fb 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.mm
@@ -19,8 +19,8 @@ #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list_observer_bridge.h" #import "ios/chrome/browser/snapshots/snapshot_browser_agent.h" -#import "ios/chrome/browser/snapshots/snapshot_cache.h" -#import "ios/chrome/browser/snapshots/snapshot_cache_observer.h" +#import "ios/chrome/browser/snapshots/snapshot_storage.h" +#import "ios/chrome/browser/snapshots/snapshot_storage_observer.h" #import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" #import "ios/chrome/browser/tabs/inactive_tabs/features.h" #import "ios/chrome/browser/ui/tab_switcher/tab_collection_consumer.h" @@ -86,12 +86,12 @@ @interface InactiveTabsMediator () <CRWWebStateObserver, PrefObserverDelegate, - SnapshotCacheObserver, + SnapshotStorageObserver, WebStateListObserving> { // The list of inactive tabs. WebStateList* _webStateList; - // The snapshot cache of _webStateList. - __weak SnapshotCache* _snapshotCache; + // The snapshot storage of _webStateList. + __weak SnapshotStorage* _snapshotStorage; // The observers of _webStateList. std::unique_ptr<WebStateListObserverBridge> _webStateListObserverBridge; std::unique_ptr<ScopedWebStateListObservation> _scopedWebStateListObservation; @@ -135,7 +135,7 @@ CHECK(sessionRestorationAgent || web::features::UseSessionSerializationOptimizations()); CHECK(snapshotAgent); - CHECK(snapshotAgent->snapshot_cache()); + CHECK(snapshotAgent->snapshot_storage()); CHECK(tabRestoreService); self = [super init]; if (self) { @@ -165,8 +165,8 @@ _prefObserverBridge->ObserveChangesForPreference( prefs::kInactiveTabsTimeThreshold, &_prefChangeRegistrar); - _snapshotCache = snapshotAgent->snapshot_cache(); - [_snapshotCache addObserver:self]; + _snapshotStorage = snapshotAgent->snapshot_storage(); + [_snapshotStorage addObserver:self]; _sessionRestorationAgent = sessionRestorationAgent; _snapshotAgent = snapshotAgent; @@ -176,7 +176,7 @@ } - (void)dealloc { - [_snapshotCache removeObserver:self]; + [_snapshotStorage removeObserver:self]; } - (void)setConsumer: @@ -208,8 +208,8 @@ _prefChangeRegistrar.RemoveAll(); _prefObserverBridge.reset(); _prefService = nullptr; - [_snapshotCache removeObserver:self]; - _snapshotCache = nil; + [_snapshotStorage removeObserver:self]; + _snapshotStorage = nil; _sessionRestorationAgent = nullptr; [self discardSavedClosedItems]; _snapshotAgent = nullptr; @@ -245,9 +245,9 @@ } } -#pragma mark - SnapshotCacheObserver +#pragma mark - SnapshotStorageObserver -- (void)snapshotCache:(SnapshotCache*)snapshotCache +- (void)snapshotStorage:(SnapshotStorage*)snapshotStorage didUpdateSnapshotForID:(SnapshotID)snapshotID { web::WebState* webState = nullptr; for (int i = 0; i < _webStateList->count(); i++) {
diff --git a/ios/chrome/browser/web/session_state/web_session_state_cache.h b/ios/chrome/browser/web/session_state/web_session_state_cache.h index 54fc5ac4..eb0e18a 100644 --- a/ios/chrome/browser/web/session_state/web_session_state_cache.h +++ b/ios/chrome/browser/web/session_state/web_session_state_cache.h
@@ -16,7 +16,7 @@ } // A browser state keyed service, providing an on-disk cache of WKWebView -// sessionState data, modeled after the SnapshotCache. Data is persisted to +// sessionState data, modeled after the SnapshotStorage. Data is persisted to // disk in a background thread with the provided NSData to a file name based on // the webState TabId. Data can be written or deleted by tabId, delayed during // batch operations, or purged based on any nonexistent tabIds.
diff --git a/mojo/public/tools/bindings/checks/mojom_attributes_check.py b/mojo/public/tools/bindings/checks/mojom_attributes_check.py index 3a2d2a3..77638f2 100644 --- a/mojo/public/tools/bindings/checks/mojom_attributes_check.py +++ b/mojo/public/tools/bindings/checks/mojom_attributes_check.py
@@ -37,6 +37,7 @@ 'WebUIJsBridge', 'RenamedFrom', 'RequireContext', + 'RuntimeFeature', 'ServiceSandbox', 'Stable', 'Uuid', @@ -46,6 +47,7 @@ 'AllowedContext', 'MinVersion', 'NoInterrupt', + 'RuntimeFeature', 'Sync', 'UnlimitedSize', }
diff --git a/mojo/public/tools/bindings/checks/mojom_attributes_check_unittest.py b/mojo/public/tools/bindings/checks/mojom_attributes_check_unittest.py index 8c7f3c2c..f1a50a4 100644 --- a/mojo/public/tools/bindings/checks/mojom_attributes_check_unittest.py +++ b/mojo/public/tools/bindings/checks/mojom_attributes_check_unittest.py
@@ -89,6 +89,14 @@ [MinVersion=2,Sync,UnlimitedSize,NoInterrupt] Bar@1(int32 b, [MinVersion=2]Structure? s) => (bool c); }; + + [RuntimeFeature=test.mojom.FeatureName] + interface FooFeatureControlled {}; + + interface FooMethodFeatureControlled { + [RuntimeFeature=test.mojom.FeatureName] + MethodWithFeature() => (bool c); + }; """) def testWrongModuleStable(self):
diff --git a/mojo/public/tools/mojom/mojom/generate/module.py b/mojo/public/tools/mojom/mojom/generate/module.py index 3645e647..0a9f6f6 100644 --- a/mojo/public/tools/mojom/mojom/generate/module.py +++ b/mojo/public/tools/mojom/mojom/generate/module.py
@@ -423,6 +423,7 @@ ATTRIBUTE_SERVICE_SANDBOX = 'ServiceSandbox' ATTRIBUTE_REQUIRE_CONTEXT = 'RequireContext' ATTRIBUTE_ALLOWED_CONTEXT = 'AllowedContext' +ATTRIBUTE_RUNTIME_FEATURE = 'RuntimeFeature' class NamedValue: @@ -1254,6 +1255,18 @@ return self.attributes.get(ATTRIBUTE_ALLOWED_CONTEXT) \ if self.attributes else None + @property + def runtime_feature(self): + if not self.attributes: + return None + runtime_feature = self.attributes.get(ATTRIBUTE_RUNTIME_FEATURE, None) + if runtime_feature is None: + return None + if not isinstance(runtime_feature, Feature): + raise Exception("RuntimeFeature attribute on %s must be a feature." % + self.name) + return runtime_feature + def _tuple(self): return (self.mojom_name, self.ordinal, self.parameters, self.response_parameters, self.attributes) @@ -1400,6 +1413,18 @@ return service_sandbox @property + def runtime_feature(self): + if not self.attributes: + return None + runtime_feature = self.attributes.get(ATTRIBUTE_RUNTIME_FEATURE, None) + if runtime_feature is None: + return None + if not isinstance(runtime_feature, Feature): + raise Exception("RuntimeFeature attribute on %s must be a feature." % + self.name) + return runtime_feature + + @property def require_context(self): if not self.attributes: return None
diff --git a/net/base/features.cc b/net/base/features.cc index d974e256..561b2fbc5 100644 --- a/net/base/features.cc +++ b/net/base/features.cc
@@ -455,10 +455,6 @@ "ThirdPartyPartitionedStorageAllowedByDefault", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kCookieDeprecationFacilitatedTestingLabels, - "CookieDeprecationFacilitatedTestingLabels", - base::FEATURE_DISABLED_BY_DEFAULT); - BASE_FEATURE(kPriorityHeader, "PriorityHeader", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/net/base/features.h b/net/base/features.h index 024744a..7515c13c 100644 --- a/net/base/features.h +++ b/net/base/features.h
@@ -452,13 +452,6 @@ NET_EXPORT BASE_DECLARE_FEATURE(kThirdPartyPartitionedStorageAllowedByDefault); -// Gate access to cookie deprecation API which allows developers to opt in -// server side testing without cookies. This doesn't actually do anything in -// terms of deprecating cookies. -// (See -// https://developer.chrome.com/en/docs/privacy-sandbox/chrome-testing/#mode-a) -NET_EXPORT BASE_DECLARE_FEATURE(kCookieDeprecationFacilitatedTestingLabels); - // Enables the HTTP extensible priorities "priority" header. // RFC 9218 NET_EXPORT BASE_DECLARE_FEATURE(kPriorityHeader);
diff --git a/services/device/BUILD.gn b/services/device/BUILD.gn index 72cf214..a8ecf4e9 100644 --- a/services/device/BUILD.gn +++ b/services/device/BUILD.gn
@@ -7,6 +7,10 @@ import("//build/config/features.gni") import("//testing/test.gni") +if (is_chromeos) { + import("//chromeos/components/sensors/buildflags.gni") +} + if (is_android) { import("//build/config/android/rules.gni") import("//third_party/jni_zero/jni_zero.gni")
diff --git a/services/device/generic_sensor/BUILD.gn b/services/device/generic_sensor/BUILD.gn index efe1366..086b502 100644 --- a/services/device/generic_sensor/BUILD.gn +++ b/services/device/generic_sensor/BUILD.gn
@@ -5,6 +5,10 @@ import("//build/config/chromeos/ui_mode.gni") import("//build/config/features.gni") +if (is_chromeos) { + import("//chromeos/components/sensors/buildflags.gni") +} + if (is_android) { import("//build/config/android/rules.gni") import("//third_party/jni_zero/jni_zero.gni") @@ -85,6 +89,10 @@ } if (is_chromeos) { + deps += [ "//chromeos/components/sensors:buildflags" ] + } + + if (is_chromeos) { deps += [ "//chromeos/components/sensors", "//chromeos/components/sensors/mojom",
diff --git a/services/device/generic_sensor/platform_sensor_provider.cc b/services/device/generic_sensor/platform_sensor_provider.cc index 1abcaf0..fe199605 100644 --- a/services/device/generic_sensor/platform_sensor_provider.cc +++ b/services/device/generic_sensor/platform_sensor_provider.cc
@@ -12,6 +12,10 @@ #include "services/device/public/cpp/generic_sensor/sensor_reading_shared_buffer.h" #include "services/device/public/mojom/sensor_provider.mojom.h" +#if BUILDFLAG(IS_CHROMEOS) +#include "chromeos/components/sensors/buildflags.h" +#endif // BUILDFLAG(IS_CHROMEOS) + #if BUILDFLAG(IS_MAC) #include "services/device/generic_sensor/platform_sensor_provider_mac.h" #elif BUILDFLAG(IS_ANDROID)
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 154db6f1..cd2bb24d 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5075,9 +5075,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5087,8 +5087,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -5223,9 +5223,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5235,8 +5235,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -5355,9 +5355,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5367,8 +5367,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.coverage.json b/testing/buildbot/chromium.coverage.json index 3d2822c..f56e458 100644 --- a/testing/buildbot/chromium.coverage.json +++ b/testing/buildbot/chromium.coverage.json
@@ -25384,9 +25384,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25396,8 +25396,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -25532,9 +25532,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25544,8 +25544,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -25664,9 +25664,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25676,8 +25676,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 04e1593..54a146e 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -43320,9 +43320,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43331,8 +43331,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -43468,9 +43468,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43479,8 +43479,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -43600,9 +43600,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43611,8 +43611,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -44924,9 +44924,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -44935,8 +44935,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -45072,9 +45072,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45083,8 +45083,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -45204,9 +45204,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45215,8 +45215,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -45914,9 +45914,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45925,8 +45925,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index ed63f98..e40b91b 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -16439,12 +16439,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16454,8 +16454,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -16607,12 +16607,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16622,8 +16622,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": { @@ -16754,12 +16754,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 119.0.6022.0", + "description": "Run with ash-chrome version 119.0.6023.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16769,8 +16769,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v119.0.6022.0", - "revision": "version:119.0.6022.0" + "location": "lacros_version_skew_tests_v119.0.6023.0", + "revision": "version:119.0.6023.0" } ], "dimensions": {
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 4ebd6c1..211932ed 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -70,16 +70,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 119.0.6022.0', + 'description': 'Run with ash-chrome version 119.0.6023.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6022.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v119.0.6023.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v119.0.6022.0', - 'revision': 'version:119.0.6022.0', + 'location': 'lacros_version_skew_tests_v119.0.6023.0', + 'revision': 'version:119.0.6023.0', }, ], },
diff --git a/third_party/.gitignore b/third_party/.gitignore index e901cf4f..3f2f87ce 100644 --- a/third_party/.gitignore +++ b/third_party/.gitignore
@@ -28,24 +28,11 @@ /angle_dx11 /anonymous_tokens/src/ /aosp_dalvik/lib/* -/apache-linux/LICENSE -/apache-linux/bin/* -/apache-linux/lib/* -/apache-linux/libexec/* -/apache-mac-arm64/LICENSE -/apache-mac-arm64/bin/* -/apache-mac-arm64/lib/* -/apache-mac-arm64/libexec/* -/apache-mac/LICENSE -/apache-mac/bin/* -/apache-mac/lib/* -/apache-mac/libexec/* -/apache-win32/bin/*.dll -/apache-win32/bin/*.exe -/apache-win32/bin/iconv/*.so -/apache-win32/modules/*.dll -/apache-win32/modules/*.so -/apache-windows-arm64 +/apache-linux/ +/apache-mac-arm64/ +/apache-mac/ +/apache-win32/ +/apache-windows-arm64/ /arcore-android-sdk/src/ /arcore-android-sdk/test-apks/arcore/*.apk /asan @@ -94,19 +81,19 @@ /jacoco/test/ /javalang/src/ /javax_inject/lib/ -/jdk/current +/jdk/current/ /jdk/extras/java_8 /jdk11/current /js_code_coverage/*.tar.gz -/js_code_coverage/node_modules +/js_code_coverage/node_modules/ /jsr-305/src /kotlinc/current /leveldb /libassistant /libc++-static/libc++.a -/libei/bin -/libei/include -/libei/lib64 +/libei/bin/ +/libei/include/ +/libei/lib64/ /libgifcodec /libjingle/source /libupnp @@ -114,7 +101,7 @@ /llvm-allocated-type /llvm-bootstrap /llvm-bootstrap-install -/llvm-build +/llvm-build/ /llvm-build-tools /cronet_android_mainline_clang/linux-amd64 /mesa/src @@ -126,9 +113,9 @@ /nacl_sdk_binaries/ /ninja/ninja* /node/*.tar.gz -/node/linux -/node/mac -/node/node_modules +/node/linux/ +/node/mac/ +/node/node_modules/ /node/win /nss /objenesis/lib/ @@ -153,14 +140,14 @@ /robolectric/lib/ /robolectric/robolectric /rust-src -/rust-toolchain +/rust-toolchain/ /rust-toolchain-intermediate /scan-build/src /scons-2.0.1 /shaka-player/dist/ /siso/siso /siso/siso.exe -/siso/.versions +/siso/.versions/ /soda /soda-mac64 /soda-win32
diff --git a/third_party/blink/DEPS b/third_party/blink/DEPS index 7fb554fb..593f221 100644 --- a/third_party/blink/DEPS +++ b/third_party/blink/DEPS
@@ -1,6 +1,6 @@ include_rules = [ - "+base/barrier_closure.h", "+base/barrier_callback.h", + "+base/barrier_closure.h", "+base/functional/callback.h", "+base/functional/callback_forward.h", "+base/functional/callback_helpers.h",
diff --git a/third_party/blink/common/permissions_policy/COMMON_METADATA b/third_party/blink/common/permissions_policy/COMMON_METADATA index b282831..789dbbfb 100644 --- a/third_party/blink/common/permissions_policy/COMMON_METADATA +++ b/third_party/blink/common/permissions_policy/COMMON_METADATA
@@ -1,3 +1,5 @@ monorail { component: "Blink>PermissionsPolicy" } + +team_email: "permissions-dev@chromium.org"
diff --git a/third_party/blink/public/mojom/chromeos/diagnostics/cros_diagnostics.mojom b/third_party/blink/public/mojom/chromeos/diagnostics/cros_diagnostics.mojom index 1756c8d..849ce94 100644 --- a/third_party/blink/public/mojom/chromeos/diagnostics/cros_diagnostics.mojom +++ b/third_party/blink/public/mojom/chromeos/diagnostics/cros_diagnostics.mojom
@@ -46,22 +46,23 @@ kNetworkInterfaceLookupFailed, }; +// An enumeration of CPU architectures. +enum CrosCpuArchitecture { + kUnknown, + kX86_64, + kArm, + kArm64, +}; + // Diagnostics information of the CPU, e.g. model name, utilization and // temperature. struct CrosCpuInfo { - // The architecture of the CPU, e.g. "x86", "x86_64", "ARM", "ARM_64". - string architecture_name; + // The architecture of the CPU, represented by the CrosCpuArchitecture enumeration. + CrosCpuArchitecture architecture; // The model name of the CPU, e.g. "AMD Ryzen 7 7840U", "Intel Core i7-1370P". string model_name; - // The number of power-efficient logical processors available. This is - // typically the number of LITTLE cores on the Arm big.LITTLE architecture, or - // E-cores on the Intel hybrid architecture. - // - // Evaluates to 0 when the architecture is symmetric or cannot be determined. - int32 num_of_efficient_processors; - // Information on each logical processor available to the system. array<CrosLogicalCpuInfo> logical_cpus; };
diff --git a/third_party/blink/public/platform/DEPS b/third_party/blink/public/platform/DEPS index 929cb2b..e4ceca535 100644 --- a/third_party/blink/public/platform/DEPS +++ b/third_party/blink/public/platform/DEPS
@@ -23,7 +23,6 @@ "+base/threading/thread.h", "+base/threading/thread_checker.h", "+base/time", - "+base/trace_event", "+build/build_config.h", "+cc", "+components/viz/common",
diff --git a/third_party/blink/renderer/DEPS b/third_party/blink/renderer/DEPS index 3ccbf89b..fd91ee3 100644 --- a/third_party/blink/renderer/DEPS +++ b/third_party/blink/renderer/DEPS
@@ -19,7 +19,6 @@ "+base/feature_list.h", "+base/format_macros.h", "+base/functional/bind.h", - "+base/functional/function_ref.h", "+base/functional/overloaded.h", "+base/gtest_prod_util.h", "+base/hash/hash.h", @@ -28,7 +27,6 @@ "+base/location.h", "+base/logging.h", "+base/memory/ptr_util.h", - "+base/memory/raw_ptr.h", "+base/memory/ref_counted.h", "+base/memory/weak_ptr.h", "+base/metrics/field_trial_params.h", @@ -46,6 +44,7 @@ "+base/state_transitions.h", "+base/stl_util.h", "+base/strings/strcat.h", + "+base/strings/string_util.h", "+base/synchronization", "+base/sys_byteorder.h", "+base/system/sys_info.h", @@ -68,9 +67,7 @@ "+base/time/time_delta_from_string.h", "+base/timer/elapsed_timer.h", "+base/timer/timer.h", - "+base/containers/lru_cache.h", "+base/token.h", - "+base/trace_event", "+base/types/cxx23_to_underlying.h", "+base/types/expected.h", "+base/types/expected_macros.h",
diff --git a/third_party/blink/renderer/bindings/DEPS b/third_party/blink/renderer/bindings/DEPS index c944ffcc..36e20d3 100644 --- a/third_party/blink/renderer/bindings/DEPS +++ b/third_party/blink/renderer/bindings/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+base/logging.h", "+base/memory/scoped_refptr.h", "+base/process/process_metrics.h", "+gin/public", @@ -14,7 +13,5 @@ ".*_test(_.*)?\.(cc|h|mm)" : [ # For base::RunLoop() "+base/run_loop.h", - # For base::SingleThreadTaskRunner::GetCurrentDefault() - "+base/task/single_thread_task_runner.h" ] }
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_compile_hints_common.cc b/third_party/blink/renderer/bindings/core/v8/v8_compile_hints_common.cc index 0eae3f0..72b1e538 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_compile_hints_common.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_compile_hints_common.cc
@@ -3,6 +3,8 @@ // found in the LICENSE file. #include "third_party/blink/renderer/bindings/core/v8/v8_compile_hints_common.h" + +#include "base/containers/span.h" #include "base/hash/hash.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" @@ -22,25 +24,22 @@ std::string name_std_string(name_length + 1, '\0'); name_string->WriteUtf8(isolate, &name_std_string[0]); + name_std_string.resize(name_length); // We need the hash function to be stable across computers, thus using // PersistentHash. - return base::PersistentHash(name_std_string.c_str(), name_length); + return base::PersistentHash(name_std_string); } uint32_t ScriptNameHash(const KURL& url) { - const std::string& name_std_string = url.GetString().Utf8(); // We need the hash function to be stable across computers, thus using // PersistentHash. - return base::PersistentHash(name_std_string.c_str(), - name_std_string.length()); + return base::PersistentHash(url.GetString().Utf8()); } uint32_t CombineHash(uint32_t script_name_hash, int position) { - uint32_t function_position_data[2]; - function_position_data[0] = script_name_hash; - function_position_data[1] = position; - return base::PersistentHash(function_position_data, 2 * sizeof(int32_t)); + const uint32_t data[2] = {script_name_hash, static_cast<uint32_t>(position)}; + return base::PersistentHash(base::as_bytes(base::make_span(data))); } } // namespace blink::v8_compile_hints
diff --git a/third_party/blink/renderer/core/DEPS b/third_party/blink/renderer/core/DEPS index a9a13490..204f400 100644 --- a/third_party/blink/renderer/core/DEPS +++ b/third_party/blink/renderer/core/DEPS
@@ -2,7 +2,6 @@ "+base/apple/bridging.h", "+base/apple/scoped_cftyperef.h", "+base/atomic_sequence_num.h", - "+base/barrier_closure.h", "+base/cancelable_callback.h", "+base/memory/values_equivalent.h", "+base/files/file.h",
diff --git a/third_party/blink/renderer/core/content_capture/DEPS b/third_party/blink/renderer/core/content_capture/DEPS index c9bd340..0683836 100644 --- a/third_party/blink/renderer/core/content_capture/DEPS +++ b/third_party/blink/renderer/core/content_capture/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+base/logging.h", "+cc/paint/node_id.h", "+cc/trees/layer_tree_host.h", ]
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_context.cc b/third_party/blink/renderer/core/css/parser/css_parser_context.cc index ece01e3..d263002 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser_context.cc +++ b/third_party/blink/renderer/core/css/parser/css_parser_context.cc
@@ -19,6 +19,7 @@ #include "third_party/blink/renderer/core/loader/document_loader.h" #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/permissions_policy/layout_animations_policy.h" +#include "third_party/blink/renderer/platform/runtime_enabled_features.h" namespace blink { @@ -175,9 +176,12 @@ use_legacy_background_size_shorthand_behavior_( use_legacy_background_size_shorthand_behavior), secure_context_mode_(secure_context_mode), - charset_(charset), document_(use_counter_document), - resource_fetch_restriction_(resource_fetch_restriction) {} + resource_fetch_restriction_(resource_fetch_restriction) { + if (!RuntimeEnabledFeatures::CSSParserIgnoreCharsetForURLsEnabled()) { + charset_ = charset; + } +} bool CSSParserContext::operator==(const CSSParserContext& other) const { return base_url_ == other.base_url_ && origin_clean_ == other.origin_clean_ &&
diff --git a/third_party/blink/renderer/core/editing/ime/input_method_controller.cc b/third_party/blink/renderer/core/editing/ime/input_method_controller.cc index b6b9a14..3165168 100644 --- a/third_party/blink/renderer/core/editing/ime/input_method_controller.cc +++ b/third_party/blink/renderer/core/editing/ime/input_method_controller.cc
@@ -67,6 +67,7 @@ #include "third_party/blink/renderer/core/layout/layout_theme.h" #include "third_party/blink/renderer/core/page/focus_controller.h" #include "third_party/blink/renderer/core/page/page.h" +#include "third_party/blink/renderer/platform/runtime_enabled_features.h" namespace blink { @@ -449,6 +450,14 @@ if (!target) return; + if (RuntimeEnabledFeatures::CompositionUpdateBeforeBeforeInputEnabled()) { + DispatchCompositionUpdateEvent(frame, text); + // 'compositionupdate' event handler may destroy document. + if (!IsAvailable()) { + return; + } + } + DispatchBeforeInputFromComposition( target, InputEvent::InputType::kInsertCompositionText, text); @@ -456,10 +465,13 @@ if (!IsAvailable()) return; - DispatchCompositionUpdateEvent(frame, text); - // 'compositionupdate' event handler may destroy document. - if (!IsAvailable()) - return; + if (!RuntimeEnabledFeatures::CompositionUpdateBeforeBeforeInputEnabled()) { + DispatchCompositionUpdateEvent(frame, text); + // 'compositionupdate' event handler may destroy document. + if (!IsAvailable()) { + return; + } + } // TODO(editing-dev): The use of UpdateStyleAndLayout // needs to be audited. see http://crbug.com/590369 for more details.
diff --git a/third_party/blink/renderer/core/exported/DEPS b/third_party/blink/renderer/core/exported/DEPS index efec1e1..121d977 100644 --- a/third_party/blink/renderer/core/exported/DEPS +++ b/third_party/blink/renderer/core/exported/DEPS
@@ -16,7 +16,6 @@ ], "web_media_player_impl_unittest.cc": [ "+base/command_line.h", - "+base/memory/ref_counted.h", "+base/run_loop.h", "+base/strings/string_number_conversions.h", "+base/strings/string_split.h",
diff --git a/third_party/blink/renderer/core/fetch/DEPS b/third_party/blink/renderer/core/fetch/DEPS index 5a78494..c26ee8a 100644 --- a/third_party/blink/renderer/core/fetch/DEPS +++ b/third_party/blink/renderer/core/fetch/DEPS
@@ -12,9 +12,3 @@ "+storage/common/quota/padding_key.h", "+url/gurl.h", ] - -specific_include_rules = { - "bytes_uploader_test\.cc": [ - "+base/test/mock_callback.h", - ], -}
diff --git a/third_party/blink/renderer/core/fetch/fetch_manager.cc b/third_party/blink/renderer/core/fetch/fetch_manager.cc index e647b69..02037285 100644 --- a/third_party/blink/renderer/core/fetch/fetch_manager.cc +++ b/third_party/blink/renderer/core/fetch/fetch_manager.cc
@@ -99,6 +99,22 @@ // 64 kilobytes. constexpr uint64_t kMaxScheduledDeferredBytesPerOrigin = 64 * 1024; +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +// +// Must remain in sync with FetchLaterRendererMetricType in +// tools/metrics/histograms/enums.xml. +enum class FetchLaterRendererMetricType { + kAbortedByUser = 0, + kContextDestroyed = 1, + kActivatedByTimeout = 2, + kMaxValue = kActivatedByTimeout, +}; + +void LogFetchLaterMetric(const FetchLaterRendererMetricType& type) { + base::UmaHistogramEnumeration("FetchLater.Renderer.Metrics", type); +} + bool HasNonEmptyLocationHeader(const FetchHeaderList* headers) { String value; if (!headers->Get(http_names::kLocation, value)) @@ -1038,7 +1054,9 @@ fetch_request_data, script_state, signal), - fetch_later_result_(MakeGarbageCollected<FetchLaterResult>()) {} + fetch_later_result_(MakeGarbageCollected<FetchLaterResult>()) { + base::UmaHistogramBoolean("FetchLater.Renderer.Total", true); + } ~DeferredLoader() override = default; FetchLaterResult* fetch_later_result() { return fetch_later_result_; } @@ -1066,6 +1084,7 @@ // 12. Add the following abort steps to requestObject’s signal: // 1. Set deferredRecord’s invoke state to "aborted". SetInvokeState(InvokeState::ABORTED); + LogFetchLaterMetric(FetchLaterRendererMetricType::kAbortedByUser); // 2. Remove deferredRecord from request’s client’s fetch group’s // deferred fetch records. FetchManager::Loader::Abort(); @@ -1267,6 +1286,7 @@ // 2. For each deferred fetch record of fetchGroup's ... for (auto& deferred_loader : deferred_loaders_) { + LogFetchLaterMetric(FetchLaterRendererMetricType::kContextDestroyed); deferred_loader->Dispose(); } }
diff --git a/third_party/blink/renderer/core/frame/DEPS b/third_party/blink/renderer/core/frame/DEPS index 1e1b07e..0ec2d47 100644 --- a/third_party/blink/renderer/core/frame/DEPS +++ b/third_party/blink/renderer/core/frame/DEPS
@@ -67,9 +67,6 @@ "+printing/metafile_skia.h", "+ui/gfx/transform_util.h", ], - "root_frame_viewport\.cc": [ - "+base/barrier_callback.h", - ], "visual_viewport\.cc": [ "+cc/layers/solid_color_scrollbar_layer.h", ],
diff --git a/third_party/blink/renderer/core/html/html_frame_set_element.cc b/third_party/blink/renderer/core/html/html_frame_set_element.cc index 596f275..8dcfb9d 100644 --- a/third_party/blink/renderer/core/html/html_frame_set_element.cc +++ b/third_party/blink/renderer/core/html/html_frame_set_element.cc
@@ -49,7 +49,7 @@ constexpr int kDefaultBorderThicknessPx = 6; const Vector<LayoutUnit>& ColumnSizes(const LayoutBox& box) { - DCHECK(IsA<LayoutNGFrameSet>(box)); + DCHECK(IsA<LayoutFrameSet>(box)); // |object| should have only 1 physical fragment because <frameset> is // monolithic. const auto* data = box.GetPhysicalFragment(0)->GetFrameSetLayoutData(); @@ -58,7 +58,7 @@ } const Vector<LayoutUnit>& RowSizes(const LayoutBox& box) { - DCHECK(IsA<LayoutNGFrameSet>(box)); + DCHECK(IsA<LayoutFrameSet>(box)); // |object| should have only 1 physical fragment because <frameset> is // monolithic. const auto* data = box.GetPhysicalFragment(0)->GetFrameSetLayoutData(); @@ -410,7 +410,7 @@ LayoutObject* HTMLFrameSetElement::CreateLayoutObject( const ComputedStyle& style) { if (style.ContentBehavesAsNormal()) - return MakeGarbageCollected<LayoutNGFrameSet>(this); + return MakeGarbageCollected<LayoutFrameSet>(this); return LayoutObject::CreateObject(this, style); }
diff --git a/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc b/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc index 7bd9014..82f34db5 100644 --- a/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc +++ b/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc
@@ -960,12 +960,16 @@ return Fail(HtmlFastPathResult::kFailedParsingAttributes); } } - if (attr_name.size() >= 2 && attr_name[0] == 'o' && attr_name[1] == 'n') { + if (attr_name.size() > 2 && attr_name[0] == 'o' && attr_name[1] == 'n') { // These attributes likely contain script that may be executed at random // points, which could cause problems if parsing via the fast path // fails. For example, an image's onload event. return Fail(HtmlFastPathResult::kFailedOnAttribute); } + if (attr_name.size() == 2 && attr_name[0] == 'i' && attr_name[1] == 's') { + // This is for the "is" attribute case. + return Fail(HtmlFastPathResult::kFailedParsingAttributes); + } if (GetNext() != '=') { SkipWhitespace(); } @@ -976,11 +980,8 @@ SkipWhitespace(); } Attribute attribute = ProcessAttribute(attr_name, attr_value); - attribute_buffer_.push_back(attribute); - if (attribute.GetName() == html_names::kIsAttr) { - return Fail(HtmlFastPathResult::kFailedParsingAttributes); - } attribute_names_.push_back(attribute.LocalName().Impl()); + attribute_buffer_.push_back(std::move(attribute)); } std::sort(attribute_names_.begin(), attribute_names_.end()); if (std::adjacent_find(attribute_names_.begin(), attribute_names_.end()) !=
diff --git a/third_party/blink/renderer/core/inspector/DEPS b/third_party/blink/renderer/core/inspector/DEPS index 5f7034d..65ca67a 100644 --- a/third_party/blink/renderer/core/inspector/DEPS +++ b/third_party/blink/renderer/core/inspector/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+base/i18n/rtl.h", "+base/json", "+base/time/time_override.h", "+base/profiler/module_cache.h",
diff --git a/third_party/blink/renderer/core/layout/layout_frame_set.cc b/third_party/blink/renderer/core/layout/layout_frame_set.cc index b10970b..21b32cb 100644 --- a/third_party/blink/renderer/core/layout/layout_frame_set.cc +++ b/third_party/blink/renderer/core/layout/layout_frame_set.cc
@@ -10,33 +10,33 @@ namespace blink { -LayoutNGFrameSet::LayoutNGFrameSet(Element* element) : LayoutNGBlock(element) { +LayoutFrameSet::LayoutFrameSet(Element* element) : LayoutNGBlock(element) { DCHECK(IsA<HTMLFrameSetElement>(element)); } -const char* LayoutNGFrameSet::GetName() const { +const char* LayoutFrameSet::GetName() const { NOT_DESTROYED(); - return "LayoutNGFrameSet"; + return "LayoutFrameSet"; } -bool LayoutNGFrameSet::IsOfType(LayoutObjectType type) const { +bool LayoutFrameSet::IsOfType(LayoutObjectType type) const { NOT_DESTROYED(); - return type == kLayoutObjectNGFrameSet || LayoutNGBlock::IsOfType(type); + return type == kLayoutObjectFrameSet || LayoutNGBlock::IsOfType(type); } -bool LayoutNGFrameSet::IsChildAllowed(LayoutObject* child, - const ComputedStyle&) const { +bool LayoutFrameSet::IsChildAllowed(LayoutObject* child, + const ComputedStyle&) const { NOT_DESTROYED(); return child->IsFrame() || child->IsFrameSet(); } -void LayoutNGFrameSet::AddChild(LayoutObject* new_child, - LayoutObject* before_child) { +void LayoutFrameSet::AddChild(LayoutObject* new_child, + LayoutObject* before_child) { LayoutNGBlock::AddChild(new_child, before_child); To<HTMLFrameSetElement>(GetNode())->DirtyEdgeInfoAndFullPaintInvalidation(); } -void LayoutNGFrameSet::RemoveChild(LayoutObject* child) { +void LayoutFrameSet::RemoveChild(LayoutObject* child) { LayoutNGBlock::RemoveChild(child); if (DocumentBeingDestroyed()) { return; @@ -44,8 +44,8 @@ To<HTMLFrameSetElement>(GetNode())->DirtyEdgeInfoAndFullPaintInvalidation(); } -CursorDirective LayoutNGFrameSet::GetCursor(const PhysicalOffset& point, - ui::Cursor& cursor) const { +CursorDirective LayoutFrameSet::GetCursor(const PhysicalOffset& point, + ui::Cursor& cursor) const { NOT_DESTROYED(); const auto& frame_set = *To<HTMLFrameSetElement>(GetNode()); gfx::Point rounded_point = ToRoundedPoint(point);
diff --git a/third_party/blink/renderer/core/layout/layout_frame_set.h b/third_party/blink/renderer/core/layout/layout_frame_set.h index 063bd39..6bf4c1d 100644 --- a/third_party/blink/renderer/core/layout/layout_frame_set.h +++ b/third_party/blink/renderer/core/layout/layout_frame_set.h
@@ -9,9 +9,9 @@ namespace blink { -class LayoutNGFrameSet final : public LayoutNGBlock { +class LayoutFrameSet final : public LayoutNGBlock { public: - explicit LayoutNGFrameSet(Element*); + explicit LayoutFrameSet(Element*); private: const char* GetName() const override; @@ -24,7 +24,7 @@ }; template <> -struct DowncastTraits<LayoutNGFrameSet> { +struct DowncastTraits<LayoutFrameSet> { static bool AllowFrom(const LayoutObject& object) { return object.IsFrameSet(); }
diff --git a/third_party/blink/renderer/core/layout/layout_frame_set_test.cc b/third_party/blink/renderer/core/layout/layout_frame_set_test.cc index 77b72d4..a6c8be3 100644 --- a/third_party/blink/renderer/core/layout/layout_frame_set_test.cc +++ b/third_party/blink/renderer/core/layout/layout_frame_set_test.cc
@@ -7,9 +7,9 @@ namespace blink { -class LayoutNGFrameSetTest : public RenderingTest {}; +class LayoutFrameSetTest : public RenderingTest {}; -TEST_F(LayoutNGFrameSetTest, GetCursor) { +TEST_F(LayoutFrameSetTest, GetCursor) { SetHtmlInnerHTML(R"HTML( <frameset id='f' rows='50%,50%' cols='50%,50%' border='20'> <frame src=""></frame> @@ -29,7 +29,7 @@ EXPECT_EQ(ColumnResizeCursor(), cursor); } -TEST_F(LayoutNGFrameSetTest, HitTestingCrash) { +TEST_F(LayoutFrameSetTest, HitTestingCrash) { SetBodyInnerHTML(R"HTML(<hgroup id="container">a <style>frameset { transform-style: preserve-3d; }</style></hgroup>)HTML"); auto& doc = GetDocument();
diff --git a/third_party/blink/renderer/core/layout/layout_object.h b/third_party/blink/renderer/core/layout/layout_object.h index 8dbd4ee..35399b1 100644 --- a/third_party/blink/renderer/core/layout/layout_object.h +++ b/third_party/blink/renderer/core/layout/layout_object.h
@@ -897,7 +897,7 @@ } bool IsFrameSet() const { NOT_DESTROYED(); - return IsOfType(kLayoutObjectNGFrameSet); + return IsOfType(kLayoutObjectFrameSet); } bool IsLayoutNGBlockFlow() const { NOT_DESTROYED(); @@ -3518,6 +3518,7 @@ kLayoutObjectIFrame, kLayoutObjectImage, kLayoutObjectFieldset, + kLayoutObjectFrameSet, kLayoutObjectListMarkerImage, kLayoutObjectMathML, kLayoutObjectMathMLRoot, @@ -3527,7 +3528,6 @@ kLayoutObjectNGBlockFlow, kLayoutObjectNGCustom, kLayoutObjectNGFlexibleBox, - kLayoutObjectNGFrameSet, kLayoutObjectNGGrid, kLayoutObjectNGInlineListItem, kLayoutObjectNGInsideListMarker,
diff --git a/third_party/blink/renderer/core/paint/DEPS b/third_party/blink/renderer/core/paint/DEPS index 16a5c09a..540fa0c 100644 --- a/third_party/blink/renderer/core/paint/DEPS +++ b/third_party/blink/renderer/core/paint/DEPS
@@ -2,10 +2,6 @@ # This goes away after CompositeAfterPaint is enabled. For now it violates # strict onion soup guidelines. "+cc/layers/picture_layer.h", - # For DCHECK. - "+base/logging.h", - # Hash function access - "+base/hash/hash.h", ] specific_include_rules = {
diff --git a/third_party/blink/renderer/core/timing/DEPS b/third_party/blink/renderer/core/timing/DEPS index 13593048..b188217 100644 --- a/third_party/blink/renderer/core/timing/DEPS +++ b/third_party/blink/renderer/core/timing/DEPS
@@ -1,7 +1,6 @@ specific_include_rules = { "background_tracing_helper.cc": [ "+base/hash/md5.h", - "+base/sys_byteorder.h", "+url/url_constants.h", ], "background_tracing_helper.h": [
diff --git a/third_party/blink/renderer/core/typed_arrays/array_buffer/DEPS b/third_party/blink/renderer/core/typed_arrays/array_buffer/DEPS index 1927cf464..abfbba25 100644 --- a/third_party/blink/renderer/core/typed_arrays/array_buffer/DEPS +++ b/third_party/blink/renderer/core/typed_arrays/array_buffer/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+base/allocator/partition_allocator/oom.h", "+base/allocator/partition_allocator/page_allocator.h", "+base/memory/page_size.h", "+base/memory/platform_shared_memory_region.h",
diff --git a/third_party/blink/renderer/core/url_pattern/DEPS b/third_party/blink/renderer/core/url_pattern/DEPS index 7c671850..f0f5f9d 100644 --- a/third_party/blink/renderer/core/url_pattern/DEPS +++ b/third_party/blink/renderer/core/url_pattern/DEPS
@@ -3,7 +3,6 @@ # found in the LICENSE file. include_rules = [ - "+base/strings/string_util.h", "+third_party/liburlpattern", "+url/url_canon.h", "+url/url_util.h",
diff --git a/third_party/blink/renderer/extensions/chromeos/diagnostics/cros_cpu_info.idl b/third_party/blink/renderer/extensions/chromeos/diagnostics/cros_cpu_info.idl index 4ffe2c6..e0f8d90 100644 --- a/third_party/blink/renderer/extensions/chromeos/diagnostics/cros_cpu_info.idl +++ b/third_party/blink/renderer/extensions/chromeos/diagnostics/cros_cpu_info.idl
@@ -6,18 +6,12 @@ // temperature. dictionary CrosCpuInfo { // The architecture of the CPU, e.g. "x86", "x86_64", "ARM", "ARM_64". + // Returns "Unknown" if the architecture cannot be determined. DOMString architectureName; // The model name of the CPU, e.g. "AMD Ryzen 7 7840U", "Intel Core i7-1370P". DOMString modelName; - // The number of power-efficient logical processors available. This is - // typically the number of LITTLE cores on the Arm big.LITTLE architecture, or - // E-cores on the Intel hybrid architecture. - // - // Evaluates to 0 when the architecture is symmetric or cannot be determined. - long numOfEfficientProcessors; - // Information on each logical processor available to the system. sequence<CrosLogicalCpuInfo> logicalCpus; };
diff --git a/third_party/blink/renderer/extensions/chromeos/diagnostics/cros_diagnostics.cc b/third_party/blink/renderer/extensions/chromeos/diagnostics/cros_diagnostics.cc index 56f11e1..134eed8b 100644 --- a/third_party/blink/renderer/extensions/chromeos/diagnostics/cros_diagnostics.cc +++ b/third_party/blink/renderer/extensions/chromeos/diagnostics/cros_diagnostics.cc
@@ -87,11 +87,21 @@ auto* cpu_info_blink = MakeGarbageCollected<CrosCpuInfo>(); - cpu_info_blink->setArchitectureName( - result->get_cpu_info()->architecture_name); + switch (result->get_cpu_info()->architecture) { + case mojom::blink::CrosCpuArchitecture::kUnknown: + cpu_info_blink->setArchitectureName("Unknown"); + break; + case mojom::blink::CrosCpuArchitecture::kX86_64: + cpu_info_blink->setArchitectureName("x86_64"); + break; + case mojom::blink::CrosCpuArchitecture::kArm: + cpu_info_blink->setArchitectureName("ARM"); + break; + case mojom::blink::CrosCpuArchitecture::kArm64: + cpu_info_blink->setArchitectureName("Arm64"); + break; + } cpu_info_blink->setModelName(result->get_cpu_info()->model_name); - cpu_info_blink->setNumOfEfficientProcessors( - result->get_cpu_info()->num_of_efficient_processors); HeapVector<Member<CrosLogicalCpuInfo>> logical_cpu_infos_blink; for (const auto& logical_cpu : result->get_cpu_info()->logical_cpus) {
diff --git a/third_party/blink/renderer/modules/DEPS b/third_party/blink/renderer/modules/DEPS index 58c8c93..8843a08 100644 --- a/third_party/blink/renderer/modules/DEPS +++ b/third_party/blink/renderer/modules/DEPS
@@ -67,7 +67,6 @@ "+net/base/ip_endpoint.h", ], ".*socket.cc": [ - "+base/barrier_callback.h", "+base/functional/identity.h", ], }
diff --git a/third_party/blink/renderer/modules/accessibility/DEPS b/third_party/blink/renderer/modules/accessibility/DEPS index bb2920e0..e0683d0 100644 --- a/third_party/blink/renderer/modules/accessibility/DEPS +++ b/third_party/blink/renderer/modules/accessibility/DEPS
@@ -1,7 +1,6 @@ include_rules = [ "-third_party/blink/renderer/modules", "+base/containers/fixed_flat_set.h", - "+base/strings/string_util.h", "+third_party/blink/renderer/modules/accessibility", "+third_party/blink/renderer/modules/media_controls", "+third_party/blink/renderer/modules/modules_export.h",
diff --git a/third_party/blink/renderer/modules/breakout_box/DEPS b/third_party/blink/renderer/modules/breakout_box/DEPS index 4bce1f2..002c71b1 100644 --- a/third_party/blink/renderer/modules/breakout_box/DEPS +++ b/third_party/blink/renderer/modules/breakout_box/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+base/task/bind_post_task.h", # Required to initialize WebGraphicsContext3DVideoFramePool. "+gpu/command_buffer/client/gpu_memory_buffer_manager.h", "+media/base",
diff --git a/third_party/blink/renderer/modules/content_index/DEPS b/third_party/blink/renderer/modules/content_index/DEPS deleted file mode 100644 index cf9e7414..0000000 --- a/third_party/blink/renderer/modules/content_index/DEPS +++ /dev/null
@@ -1,3 +0,0 @@ -include_rules = [ - "+base/barrier_closure.h", -]
diff --git a/third_party/blink/renderer/modules/gamepad/DEPS b/third_party/blink/renderer/modules/gamepad/DEPS index 47408ec..1960878 100644 --- a/third_party/blink/renderer/modules/gamepad/DEPS +++ b/third_party/blink/renderer/modules/gamepad/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+device/base/synchronization/shared_memory_seqlock_buffer.h", # NOTE: These files are POD structs used to interpret shared memory across # the Device Gamepad implementation and the Blink client. "+device/gamepad/public/cpp/gamepad.h",
diff --git a/third_party/blink/renderer/modules/imagecapture/DEPS b/third_party/blink/renderer/modules/imagecapture/DEPS index 30188e3..4ac24b2 100644 --- a/third_party/blink/renderer/modules/imagecapture/DEPS +++ b/third_party/blink/renderer/modules/imagecapture/DEPS
@@ -2,9 +2,6 @@ "+media/capture/mojom/image_capture.mojom-blink.h", "+media/capture/mojom/image_capture.mojom-blink-forward.h", - # TODO(crbug.com/1198375): Remove this temporary exception after migration. - "+base/task/bind_post_task.h", - "+cc/paint/skia_paint_canvas.h", "+media", "+skia/ext/legacy_display_globals.h",
diff --git a/third_party/blink/renderer/modules/media/DEPS b/third_party/blink/renderer/modules/media/DEPS index e1e0630..ec36961 100644 --- a/third_party/blink/renderer/modules/media/DEPS +++ b/third_party/blink/renderer/modules/media/DEPS
@@ -1,6 +1,3 @@ include_rules = [ - # TODO(crbug.com/1198375): Remove this temporary exception after migration. - "+base/task/bind_post_task.h", - "+media/base/media_log.h", ]
diff --git a/third_party/blink/renderer/modules/mediarecorder/DEPS b/third_party/blink/renderer/modules/mediarecorder/DEPS index c936bf5d..bfef2b5 100644 --- a/third_party/blink/renderer/modules/mediarecorder/DEPS +++ b/third_party/blink/renderer/modules/mediarecorder/DEPS
@@ -6,7 +6,6 @@ "+base/memory/shared_memory_mapping.h", "+base/strings/string_piece.h", "+base/strings/string_number_conversions.h", - "+base/task/bind_post_task.h", "+base/task/task_runner_util.h", "+base/task/task_traits.h", "+base/threading/sequenced_task_runner_handle.h",
diff --git a/third_party/blink/renderer/modules/mediastream/DEPS b/third_party/blink/renderer/modules/mediastream/DEPS index 00882c0..a529be9 100644 --- a/third_party/blink/renderer/modules/mediastream/DEPS +++ b/third_party/blink/renderer/modules/mediastream/DEPS
@@ -25,13 +25,9 @@ "+services/viz/public/cpp/gpu/context_provider_command_buffer.h", "+skia/ext/platform_canvas.h", - "+base/task/bind_post_task.h", "+base/files/file.h", "+base/metrics/field_trial.h", - "+base/token.h", - "+base/sequence_checker.h", - "+base/trace_event/trace_event.h", "+base/unguessable_token.h", "+base/uuid.h", "+media/audio",
diff --git a/third_party/blink/renderer/modules/peerconnection/DEPS b/third_party/blink/renderer/modules/peerconnection/DEPS index d86e1c1..29c76081 100644 --- a/third_party/blink/renderer/modules/peerconnection/DEPS +++ b/third_party/blink/renderer/modules/peerconnection/DEPS
@@ -12,8 +12,6 @@ "+base/hash/md5.h", "+base/lazy_instance.h", "+base/power_monitor/power_observer.h", - # TODO(crbug.com/787254): Replace base::SequenceChecker by base::ThreadChecker. - "+base/sequence_checker.h", # TODO(crbug.com/787254): Replace StringPrintf uses here. "+base/strings/stringprintf.h", # TODO(crbug.com/787254): Remove the use of base::CurrentThread.
diff --git a/third_party/blink/renderer/modules/service_worker/DEPS b/third_party/blink/renderer/modules/service_worker/DEPS index bf09fee..38236643 100644 --- a/third_party/blink/renderer/modules/service_worker/DEPS +++ b/third_party/blink/renderer/modules/service_worker/DEPS
@@ -1,7 +1,4 @@ include_rules = [ - "+base/barrier_closure.h", - "+base/threading/thread_checker.h", - "+base/trace_event/trace_event.h", "+mojo/public/cpp/system/data_pipe.h", "+services/network/public", "+services/metrics/public/cpp/ukm_source_id.h",
diff --git a/third_party/blink/renderer/modules/webcodecs/DEPS b/third_party/blink/renderer/modules/webcodecs/DEPS index fc358b2c..7b7aeefd 100644 --- a/third_party/blink/renderer/modules/webcodecs/DEPS +++ b/third_party/blink/renderer/modules/webcodecs/DEPS
@@ -1,7 +1,5 @@ include_rules = [ "+base/containers/flat_map.h", - "+base/functional/bind.h", - "+base/strings/string_util.h", "+base/test", "+base/task/task_traits.h", "+base/threading/sequenced_task_runner_handle.h", @@ -50,14 +48,6 @@ "+base/win/scoped_com_initializer.h", "+media/gpu/windows/mf_audio_encoder.h", ], - "background_readback\.cc": [ - # TODO(crbug.com/1198375): Remove this temporary exception after migration. - "+base/task/bind_post_task.h", - ], - "video_frame\.cc": [ - # TODO(crbug.com/1198375): Remove this temporary exception after migration. - "+base/task/bind_post_task.h", - ], "video_frame_test\.cc": [ "+components/viz/test/test_context_provider.h", ],
diff --git a/third_party/blink/renderer/modules/webgl/DEPS b/third_party/blink/renderer/modules/webgl/DEPS index 2a57710..4683712 100644 --- a/third_party/blink/renderer/modules/webgl/DEPS +++ b/third_party/blink/renderer/modules/webgl/DEPS
@@ -1,6 +1,5 @@ include_rules = [ "+base/allocator/partition_allocator/partition_alloc_constants.h", - "+base/containers/lru_cache.h", "+device/vr/public/mojom/vr_service.mojom-blink.h", "+gpu/GLES2/gl2extchromium.h", "+gpu/command_buffer/client/gles2_interface.h",
diff --git a/third_party/blink/renderer/modules/webrtc/DEPS b/third_party/blink/renderer/modules/webrtc/DEPS index a6ffb36..9fed3169 100644 --- a/third_party/blink/renderer/modules/webrtc/DEPS +++ b/third_party/blink/renderer/modules/webrtc/DEPS
@@ -20,10 +20,3 @@ "+third_party/blink/renderer/modules/modules_export.h", "+third_party/blink/renderer/modules/webrtc", ] - -specific_include_rules = { - "webrtc_audio_renderer\.cc": [ - # TODO(crbug.com/1198375): Remove this temporary exception after migration. - "+base/task/bind_post_task.h", - ], -}
diff --git a/third_party/blink/renderer/platform/DEPS b/third_party/blink/renderer/platform/DEPS index c24e6fbf..ffd4d61 100644 --- a/third_party/blink/renderer/platform/DEPS +++ b/third_party/blink/renderer/platform/DEPS
@@ -7,49 +7,31 @@ "+base/android/sys_utils.h", "+base/atomic_ref_count.h", "+base/at_exit.h", - "+base/bit_cast.h", "+base/command_line.h", - "+base/compiler_specific.h", "+base/containers/flat_map.h", "+base/cpu.h", - "+base/feature_list.h", "+base/files", - "+base/functional/bind.h", "+base/functional/bind_internal.h", - "+base/functional/callback_helpers.h", "+base/i18n/icu_util.h", "+base/json", "+base/lazy_instance.h", - "+base/location.h", - "+base/logging.h", "+base/mac/mac_util.h", "+base/memory", "+base/memory/shared_memory.h", "+base/message_loop/message_loop.h", "+base/metrics/histogram_base.h", - "+base/metrics/histogram_functions.h", - "+base/metrics/histogram_macros.h", "+base/metrics/histogram_samples.h", - "+base/metrics/histogram.h", "+base/metrics/sparse_histogram.h", "+base/metrics/statistics_recorder.h", "+base/no_destructor.h", - "+base/numerics/checked_math.h", - "+base/numerics/safe_conversions.h", "+base/observer_list_threadsafe.h", - "+base/observer_list.h", "+base/process/memory.h", - "+base/rand_util.h", "+base/run_loop.h", "+base/strings/pattern.h", "+base/strings/string_number_conversions.h", "+base/strings/string_piece.h", "+base/strings/string_split.h", - "+base/strings/string_util.h", - "+base/strings/string_util.h", "+base/strings/stringprintf.h", - "+base/synchronization/waitable_event.h", - "+base/system/sys_info.h", "+base/task/common/lazy_now.h", "+base/task/delay_policy.h", "+base/task/delayed_task_handle.h", @@ -61,7 +43,6 @@ "+base/threading/thread_task_runner_handle.h", "+base/time", "+base/timer", - "+base/trace_event", "+base/tracing", "+base/unguessable_token.h", "+base/uuid.h",
diff --git a/third_party/blink/renderer/platform/exported/video_capture/DEPS b/third_party/blink/renderer/platform/exported/video_capture/DEPS index eff360ef..1a86b63 100644 --- a/third_party/blink/renderer/platform/exported/video_capture/DEPS +++ b/third_party/blink/renderer/platform/exported/video_capture/DEPS
@@ -2,16 +2,11 @@ "web_video_capture_impl_manager.cc": [ # TODO(crbug.com/1198375): Remove this temporary exception after # migration. - "+base/task/bind_post_task.h", - "+base/task/sequenced_task_runner.h", - "+base/token.h", "+media/capture/mojom/video_capture_types.mojom-blink.h", ], "web_video_capture_impl_manager_test.cc": [ # TODO(crbug.com/1198375): Remove this temporary exception after # migration. - "+base/task/bind_post_task.h", - "+base/token.h", "+media/capture/mojom/video_capture.mojom-blink.h", ], }
diff --git a/third_party/blink/renderer/platform/fonts/shaping/east_asian_spacing.cc b/third_party/blink/renderer/platform/fonts/shaping/east_asian_spacing.cc index 75376d58..d47e9fb 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/east_asian_spacing.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/east_asian_spacing.cc
@@ -140,25 +140,38 @@ last_type = GetCharType(text[start], font_data); } - // Compute for characters in the middle. - // TODO(crbug.com/1463891): This part can be skipped if the font has `chws`. - CharType type; - for (wtf_size_t i = start + 1; i < end; ++i, last_type = type) { - const UChar ch = text[i]; - type = GetCharType(ch, font_data); - if (ShouldKernLast(type, last_type)) { - DCHECK_GT(i, 0u); - indices.push_back(i - 1); - } else if (ShouldKern(type, last_type)) { - indices.push_back(i); + if (font_data.has_contextual_spacing) { + // The `chws` feature can handle charcters in a run. + // Compute the end edge if there are following runs. + if (end < text.length()) { + if (end - 1 > start) { + last_type = GetCharType(text[end - 1], font_data); + } + const CharType type = GetCharType(text[end], font_data); + if (ShouldKernLast(type, last_type)) { + indices.push_back(end - 1); + } } - } + } else { + // Compute for characters in the middle. + CharType type; + for (wtf_size_t i = start + 1; i < end; ++i, last_type = type) { + const UChar ch = text[i]; + type = GetCharType(ch, font_data); + if (ShouldKernLast(type, last_type)) { + DCHECK_GT(i, 0u); + indices.push_back(i - 1); + } else if (ShouldKern(type, last_type)) { + indices.push_back(i); + } + } - // Compute for the last character. - if (end < text.length()) { - type = GetCharType(text[end], font_data); - if (ShouldKernLast(type, last_type)) { - indices.push_back(end - 1); + // Compute for the last character. + if (end < text.length()) { + type = GetCharType(text[end], font_data); + if (ShouldKernLast(type, last_type)) { + indices.push_back(end - 1); + } } }
diff --git a/third_party/blink/renderer/platform/graphics/DEPS b/third_party/blink/renderer/platform/graphics/DEPS index 01151a9..af8804a9 100644 --- a/third_party/blink/renderer/platform/graphics/DEPS +++ b/third_party/blink/renderer/platform/graphics/DEPS
@@ -9,11 +9,9 @@ "+base/no_destructor.h", "+base/strings/string_number_conversions.h", "+base/strings/string_split.h", - "+base/strings/string_util.h", "+base/task/task_traits.h", "+base/threading/sequenced_task_runner_handle.h", "+base/threading/thread_restrictions.h", - "+base/barrier_closure.h", "+cc", "+components/paint_preview/common", "+components/viz/client",
diff --git a/third_party/blink/renderer/platform/heap/DEPS b/third_party/blink/renderer/platform/heap/DEPS index 8d536734..30806234 100644 --- a/third_party/blink/renderer/platform/heap/DEPS +++ b/third_party/blink/renderer/platform/heap/DEPS
@@ -6,14 +6,11 @@ "+third_party/blink/renderer/platform/heap", # Dependencies. - "+base/bits.h", "+base/functional/unretained_traits.h", "+base/sampling_heap_profiler/poisson_allocation_sampler.h", "+base/strings/string_number_conversions.h", - "+base/synchronization/lock.h", "+base/task/task_runner.h", "+base/task/post_job.h", - "+base/template_util.h", "+gin/public/cppgc.h", "+gin/public/v8_platform.h", "+testing/perf/perf_result_reporter.h",
diff --git a/third_party/blink/renderer/platform/instrumentation/DEPS b/third_party/blink/renderer/platform/instrumentation/DEPS index 1b9aae2..2b03585 100644 --- a/third_party/blink/renderer/platform/instrumentation/DEPS +++ b/third_party/blink/renderer/platform/instrumentation/DEPS
@@ -6,11 +6,9 @@ "+third_party/blink/renderer/platform/instrumentation", # Dependencies. - "+base/gtest_prod_util.h", "+base/json", "+base/memory", "+base/strings", - "+base/trace_event", "+base/values.h", "+components/performance_manager/public/mojom", "+skia/ext/skia_trace_memory_dump_impl.h",
diff --git a/third_party/blink/renderer/platform/loader/DEPS b/third_party/blink/renderer/platform/loader/DEPS index fffc579..3a4bbcb 100644 --- a/third_party/blink/renderer/platform/loader/DEPS +++ b/third_party/blink/renderer/platform/loader/DEPS
@@ -6,7 +6,6 @@ "+third_party/blink/renderer/platform/loader", # Dependencies. - "+base/metrics/field_trial_params.h", # for fetch/ResourceLoadScheduler.cpp "+base/strings/string_number_conversions.h", # for fetch/ResourceLoadScheduler.cpp "+components/link_header_util", # for LinkHeader.cpp "+net/base/load_flags.h",
diff --git a/third_party/blink/renderer/platform/media/DEPS b/third_party/blink/renderer/platform/media/DEPS index b8a7966..256ff99 100644 --- a/third_party/blink/renderer/platform/media/DEPS +++ b/third_party/blink/renderer/platform/media/DEPS
@@ -11,7 +11,6 @@ "+base/containers/circular_deque.h", "+base/strings/string_number_conversions.h", "+base/strings/utf_string_conversions.h", - "+base/task/bind_post_task.h", "+base/task/task_runner.h", "+base/threading/thread.h", "+cc/layers",
diff --git a/third_party/blink/renderer/platform/mojo/DEPS b/third_party/blink/renderer/platform/mojo/DEPS index 112c021..3b603d7 100644 --- a/third_party/blink/renderer/platform/mojo/DEPS +++ b/third_party/blink/renderer/platform/mojo/DEPS
@@ -6,8 +6,6 @@ "+third_party/blink/renderer/platform/mojo", # Dependencies. - "+base/containers/span.h", - "+base/observer_list.h", "+base/strings/latin1_string_conversions.h", "+base/task/current_thread.h", "+mojo/public/cpp/base/time_mojom_traits.h",
diff --git a/third_party/blink/renderer/platform/peerconnection/DEPS b/third_party/blink/renderer/platform/peerconnection/DEPS index 527244aa3..f5cb0a4 100644 --- a/third_party/blink/renderer/platform/peerconnection/DEPS +++ b/third_party/blink/renderer/platform/peerconnection/DEPS
@@ -12,15 +12,10 @@ # Dependencies. "+base/containers/circular_deque.h", - "+base/functional/bind.h", - "+base/functional/bind_post_task.h", - "+base/functional/callback.h", - "+base/functional/callback_forward.h", "+base/strings/string_number_conversions.h", "+base/strings/string_split.h", "+base/task/bind_post_task.h", "+base/task/task_traits.h", - "+base/task/sequenced_task_runner.h", "+base/threading/thread_restrictions.h", "+media/base", "+media/capture/capture_switches.h",
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 20f7d445..6f73c6b3 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -134,7 +134,7 @@ default: "", }, - // Specifiy the default value of the base::Feature instance. This field + // Specify the default value of the base::Feature instance. This field // works only if base_feature is not "none". // If the field is missing or "", the default value depends on the 'status' // field. See the comment above. @@ -687,6 +687,10 @@ } }, { + name: "CompositionUpdateBeforeBeforeInput", + status: "stable", + }, + { name: "CompressionDictionaryTransport", base_feature: "none", origin_trial_feature_name: "CompressionDictionaryTransport", @@ -1031,6 +1035,11 @@ base_feature: "CssPaintingForSpellingGrammarErrors", }, { + // Ignore the stylesheet encoding when parsing URLs, always using UTF-8. + // See crbug.com/1485525. + name: "CSSParserIgnoreCharsetForURLs", + }, + { // crbug.com/1443291: Phrase Line Breaking name: "CSSPhraseLineBreak", status: "stable",
diff --git a/third_party/blink/renderer/platform/scheduler/DEPS b/third_party/blink/renderer/platform/scheduler/DEPS index 1b8f3a26..b3c53bc5 100644 --- a/third_party/blink/renderer/platform/scheduler/DEPS +++ b/third_party/blink/renderer/platform/scheduler/DEPS
@@ -7,34 +7,18 @@ # Dependencies. "+base/atomic_sequence_num.h", - "+base/barrier_closure.h", "+base/cancelable_callback.h", "+base/command_line.h", - "+base/compiler_specific.h", "+base/containers/circular_deque.h", - "+base/feature_list.h", - "+base/format_macros.h", - "+base/functional/callback_helpers.h", - "+base/gtest_prod_util.h", - "+base/logging.h", "+base/message_loop/message_loop.h", "+base/message_loop/message_loop_current.h", "+base/message_loop/message_pump.h", "+base/metrics/field_trial.h", - "+base/metrics/field_trial_params.h", - "+base/metrics/histogram_functions.h", - "+base/metrics/histogram_macros.h", - "+base/observer_list.h", "+base/pending_task.h", "+base/profiler/sample_metadata.h", "+base/run_loop.h", - "+base/sequence_checker.h", - "+base/task/single_thread_task_runner.h", "+base/tracing_buildflags.h", "+base/strings/string_number_conversions.h", - "+base/synchronization/atomic_flag.h", - "+base/synchronization/cancellation_flag.h", - "+base/synchronization/lock.h", "+base/task/common/lazy_now.h", "+base/task/common/scoped_defer_task_posting.h", "+base/task/common/task_annotator.h", @@ -48,7 +32,6 @@ "+base/threading/platform_thread.h", "+base/threading/sequenced_task_runner_handle.h", "+base/threading/thread.h", - "+base/threading/thread_checker.h", "+base/traits_bag.h", "+services/metrics",
diff --git a/third_party/blink/renderer/platform/scheduler/common/DEPS b/third_party/blink/renderer/platform/scheduler/common/DEPS index 07204be..bb43c0a 100644 --- a/third_party/blink/renderer/platform/scheduler/common/DEPS +++ b/third_party/blink/renderer/platform/scheduler/common/DEPS
@@ -5,12 +5,6 @@ "back_forward_cache_disabling_feature_tracker_unittest.cc": [ "+third_party/blink/renderer/platform/bindings/source_location.h", ], - "blink_scheduler_single_thread_task_runner.cc": [ - "+base/functional/callback_helpers.h", - ], - "blink_scheduler_single_thread_task_runner.h": [ - "+base/functional/callback_forward.h", - ], "frame_or_worker_scheduler.cc": [ "+third_party/blink/renderer/platform/bindings/source_location.h", ],
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/DEPS b/third_party/blink/renderer/platform/scheduler/main_thread/DEPS index a0361c1..35798ecc 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/DEPS +++ b/third_party/blink/renderer/platform/scheduler/main_thread/DEPS
@@ -1,6 +1,5 @@ include_rules = [ "+base/cpu_reduction_experiment.h", - "+base/metrics/single_sample_metrics.h", "+cc", "+components/viz/common", ]
diff --git a/third_party/blink/renderer/platform/text/DEPS b/third_party/blink/renderer/platform/text/DEPS index 602cedc..e3fefbe7 100644 --- a/third_party/blink/renderer/platform/text/DEPS +++ b/third_party/blink/renderer/platform/text/DEPS
@@ -7,7 +7,6 @@ # Dependencies. "+base/apple", - "+base/i18n/rtl.h", "+base/mac", "+third_party/blink/renderer/platform/text/date_components.h", "+third_party/blink/renderer/platform/heap",
diff --git a/third_party/blink/renderer/platform/video_capture/DEPS b/third_party/blink/renderer/platform/video_capture/DEPS index f2e8cf8..4778291 100644 --- a/third_party/blink/renderer/platform/video_capture/DEPS +++ b/third_party/blink/renderer/platform/video_capture/DEPS
@@ -6,8 +6,6 @@ "+third_party/blink/renderer/platform/video_capture", # Dependencies. - "+base/task/bind_post_task.h", - "+base/token.h", "+media/base", "+media/capture", "+third_party/blink/renderer/platform/allow_discouraged_type.h",
diff --git a/third_party/blink/renderer/platform/webrtc/DEPS b/third_party/blink/renderer/platform/webrtc/DEPS index 680dbd3..1bb5173 100644 --- a/third_party/blink/renderer/platform/webrtc/DEPS +++ b/third_party/blink/renderer/platform/webrtc/DEPS
@@ -5,7 +5,6 @@ specific_include_rules = { "webrtc_video_frame_adapter\.cc": [ - "+base/dcheck_is_on.h", "+gpu/command_buffer/client/gpu_memory_buffer_manager.h", "+gpu/command_buffer/client/raster_interface.h", "+gpu/command_buffer/client/shared_image_interface.h",
diff --git a/third_party/blink/renderer/platform/wtf/DEPS b/third_party/blink/renderer/platform/wtf/DEPS index 0d49912..aa767b8 100644 --- a/third_party/blink/renderer/platform/wtf/DEPS +++ b/third_party/blink/renderer/platform/wtf/DEPS
@@ -4,28 +4,13 @@ "+base/apple/bridging.h", "+base/apple/scoped_cftyperef.h", "+base/atomic_ref_count.h", - "+base/auto_reset.h", - "+base/bits.h", - "+base/compiler_specific.h", - "+base/functional/bind.h", - "+base/logging.h", "+base/apple/foundation_util.h", - "+base/memory/ptr_util.h", - "+base/memory/ref_counted.h", - "+base/memory/weak_ptr.h", - "+base/metrics/histogram_macros.h", "+base/no_destructor.h", "+base/numerics", "+base/process/process_metrics.h", - "+base/rand_util.h", - "+base/stl_util.h", "+base/strings", "+base/third_party/double_conversion", - "+base/template_util.h", - "+base/test/metrics/histogram_tester.h", - "+base/thread_annotations.h", "+base/threading", - "+base/time/time.h", "+base/tuple.h", "+base/win/windows_types.h", # To avoid recursive dependency, we impose a blanket ban on using other
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 7ff2550..b89c85a 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -3534,6 +3534,16 @@ crbug.com/1463890 virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-dynamic-001.html [ Pass ] crbug.com/1463890 virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-no-001.html [ Pass ] +# Implement `text-spacing-trim`. +crbug.com/1463891 external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-001.html [ Failure ] +crbug.com/1463891 external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-colon-001.html [ Failure ] +crbug.com/1463891 external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-dot-001.html [ Failure ] +crbug.com/1463891 external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-chws-001.html [ Failure ] +crbug.com/1463891 virtual/css-text-autospace/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-001.html [ Pass ] +crbug.com/1463891 virtual/css-text-autospace/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-colon-001.html [ Pass ] +crbug.com/1463891 virtual/css-text-autospace/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-dot-001.html [ Pass ] +crbug.com/1463891 virtual/css-text-autospace/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-chws-001.html [ Pass ] + # Implement text-decoration correctly for vertical text crbug.com/1133806 external/wpt/css/css-text-decor/text-decoration-thickness-vertical-002.html [ Failure ] crbug.com/1133806 external/wpt/css/css-text-decor/text-underline-offset-vertical-002.html [ Failure ]
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 ebf1391..d4c2eb9 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
@@ -14985,6 +14985,15 @@ }, "canvas": { "element": { + "canvas-host": { + "2d.canvas.host.scaled-manual.html": [ + "acf3f9c7b344711b38326671a6a8edd332692606", + [ + null, + {} + ] + ] + }, "manual": { "drawing-paths-to-the-canvas": { "canvas_focus_drawFocusIfNeeded_AAPI_001-manual.html": [ @@ -15835,15 +15844,6 @@ ] ] }, - "the-canvas-element": { - "2d.scaled-manual.html": [ - "28daf0bca5e9c1f3cbc2342085ff188213963ae2", - [ - null, - {} - ] - ] - }, "the-iframe-element": { "iframe_sandbox_allow_top_navigation_by_user_activation-manual.html": [ "0fa9de7c125c3de5599edcddf2692f1f54356c32", @@ -281944,11 +281944,11 @@ "support": { ".cache": { "gitignore2.json": [ - "3145957fd7e6f6e3b67fe0d860c44cc8205561a2", + "2b1048f9f7a48677698a074ae749ec98baf1a981", [] ], "mtime.json": [ - "456216cd8ed21411844e1717e5418c3607681f02", + "a2a4f8a077b183d4216608c9d2b879e73b39bc81", [] ] }, @@ -338080,10 +338080,6 @@ "a2926b0e7942399fc62465e2446617eb99f796c9", [] ], - "transform-2d-getComputedStyle-001-expected.txt": [ - "0ccf5a9f79b8b6a43b2cb1b22e12f96baf643a11", - [] - ], "transform-2d-getComputedStyle-001.html.ini": [ "b75ec49732d20aec385032fb40645b7d13e1285f", [] @@ -346085,7 +346081,7 @@ [] ], "serialize-values-expected.txt": [ - "5cef13312978403727b6311d87a5ca09d4aa52c4", + "bdf6c69dc5e5933f462ed1b88ea2b2dd868788b0", [] ], "serialize-values.html.ini": [ @@ -349889,7 +349885,7 @@ ], "admin": { "index.md": [ - "f42d3075b6b7011ec3966ecb2b9cfd8ef54e5609", + "e0ec8b2b26caf0bde2ec2b1d5a0420170885fbc2", [] ], "pywebsocket3.rst": [ @@ -359418,7 +359414,7 @@ [] ], "trusted-bidding-signals.py": [ - "9602bd22f9667057c46d3900909ec9bcda832341", + "86e4db8ad448ade94b4c5885ea6b99b9f80e2871", [] ], "trusted-scoring-signals.py": [ @@ -360182,15 +360178,15 @@ ] }, "CanvasTest-ascent256.ttf": [ - "d5924fc2194a3ae0d9a4eca3c293b14909b2a44e", + "84ce51dee712d34c83e364ad09bd48c28f303a76", [] ], "CanvasTest-descent0.ttf": [ - "5887c0de8ddc89e4dcfa9027fa44a2d8a631c465", + "b0291dcf429bfe2ee99ebd733ded33abff4af2dd", [] ], "CanvasTest.ttf": [ - "9cdd0faf10818614202d397bb70b97a51a311fd4", + "6cdeccd10fe715d03d06a533a9d1397d111b72d8", [] ], "CanvasTest.ttf.headers": [ @@ -364779,6 +364775,116 @@ "707bafd3203610433808979232509d6a506dc3d5", [] ], + "canvas-host": { + "2d.canvas.host.scaled.png": [ + "875407769ff19385c8be8b1dfd4eafc8a2e285be", + [] + ], + "2d.canvas.host.size.attributes.parse.decimal.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.parse.em.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.parse.empty.png": [ + "a72d047556a72dc83654077f88bd5ba271dc1a36", + [] + ], + "2d.canvas.host.size.attributes.parse.exp.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.parse.junk.png": [ + "a72d047556a72dc83654077f88bd5ba271dc1a36", + [] + ], + "2d.canvas.host.size.attributes.parse.minus.png": [ + "a72d047556a72dc83654077f88bd5ba271dc1a36", + [] + ], + "2d.canvas.host.size.attributes.parse.octal.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.parse.onlyspace.png": [ + "a72d047556a72dc83654077f88bd5ba271dc1a36", + [] + ], + "2d.canvas.host.size.attributes.parse.percent.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.parse.plus.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.parse.space.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.parse.trailingjunk.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.parse.whitespace.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.decimal.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.em.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.empty.png": [ + "a72d047556a72dc83654077f88bd5ba271dc1a36", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.exp.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.junk.png": [ + "a72d047556a72dc83654077f88bd5ba271dc1a36", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.minus.png": [ + "a72d047556a72dc83654077f88bd5ba271dc1a36", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.octal.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.onlyspace.png": [ + "a72d047556a72dc83654077f88bd5ba271dc1a36", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.percent.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.plus.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.space.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.trailingjunk.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ], + "2d.canvas.host.size.attributes.setAttribute.whitespace.png": [ + "f8426733306293c70134e35f4704268b7a19a407", + [] + ] + }, "compositing": { "2d.composite.canvas.clear.png": [ "eeedd0ff05889ffd4468bf19a2e8e9e0a094201c", @@ -367338,7 +367444,7 @@ [] ], "gentest_union.py": [ - "bde7c1bc061d431cde3cc09122989760f13a9b04", + "38a37a81ac761e649f279a231f83e0a3f6999df9", [] ], "gentestutils.py": [ @@ -367350,15 +367456,15 @@ [] ], "name2dir-canvas.yaml": [ - "2ad5197d34c166a15f7f19db2e74affc9e8d8c77", + "1e0caff5b982da5ef914aaae6e376bf749ac412c", [] ], "name2dir-offscreen.yaml": [ - "807b09507b1cb137cef392be63a550f49bdd9725", + "c52acb793ba717f02a37fe8692e95941b2f7bf34", [] ], "name2dir.yaml": [ - "a56fc2ff488e80b78c2c40649869e08bf384fd68", + "ae69c153780ed2398466bfa12287462bf04c3bfa", [] ], "templates": { @@ -367398,21 +367504,21 @@ "yaml": { "element": { "meta.yaml": [ - "7b6f28f1713f19c601be350e7ffa12a76f08a42e", + "5fd8b68498ac3fa8e8bc79d58738c503e3517193", [] ], "the-canvas-element.yaml": [ - "d6d8cd801b410909fdee32b7e0c9f903fda469de", + "1ecf8ccdbf17b9d54798d64680fbc04c7c0135ed", [] ] }, "offscreen": { "meta.yaml": [ - "bd761937f40e8796f6192e09741c1c2bccf3df2d", + "7b44fd9f2677fc63ce974a426025f6646cf9e3c8", [] ], "the-offscreen-canvas.yaml": [ - "0bef18bf9d56acccb5a747a791bc038c61857f48", + "ccabe094b8a7f8a187feac5d93faf9ad8569ea82", [] ] } @@ -367475,7 +367581,7 @@ [] ], "text.yaml": [ - "9242b2ecf77e7be9a6b07487d3aed7f440c027d4", + "8bbc874f06f499ab1d9780114edb06d467ac9b4c", [] ], "the-canvas-state.yaml": [ @@ -368917,7 +369023,7 @@ [] ], "dir-auto-dynamic-changes.window-expected.txt": [ - "e4cb75545cd2092405a74984260bbda06cf8d501", + "7d67e3ba0ff2d31bc357ee0ffe7f4458455acc8e", [] ], "dir-auto-dynamic-changes.window.js.ini": [ @@ -376262,10 +376368,6 @@ ] }, "the-canvas-element": { - "2d.scaled.png": [ - "875407769ff19385c8be8b1dfd4eafc8a2e285be", - [] - ], "DIR_METADATA": [ "ab76b6227db42798d91c09a8f9f772f64ae67d9c", [] @@ -376302,58 +376404,6 @@ "47830c83ea9dfbcfdf6ea7aad64bce33097c06f7", [] ], - "size.attributes.parse.decimal.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.parse.em.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.parse.empty.png": [ - "a72d047556a72dc83654077f88bd5ba271dc1a36", - [] - ], - "size.attributes.parse.exp.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.parse.junk.png": [ - "a72d047556a72dc83654077f88bd5ba271dc1a36", - [] - ], - "size.attributes.parse.minus.png": [ - "a72d047556a72dc83654077f88bd5ba271dc1a36", - [] - ], - "size.attributes.parse.octal.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.parse.onlyspace.png": [ - "a72d047556a72dc83654077f88bd5ba271dc1a36", - [] - ], - "size.attributes.parse.percent.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.parse.plus.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.parse.space.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.parse.trailingjunk.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.parse.whitespace.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], "size.attributes.reflect.setcontent.png": [ "47830c83ea9dfbcfdf6ea7aad64bce33097c06f7", [] @@ -376370,58 +376420,6 @@ "47830c83ea9dfbcfdf6ea7aad64bce33097c06f7", [] ], - "size.attributes.setAttribute.decimal.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.setAttribute.em.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.setAttribute.empty.png": [ - "a72d047556a72dc83654077f88bd5ba271dc1a36", - [] - ], - "size.attributes.setAttribute.exp.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.setAttribute.junk.png": [ - "a72d047556a72dc83654077f88bd5ba271dc1a36", - [] - ], - "size.attributes.setAttribute.minus.png": [ - "a72d047556a72dc83654077f88bd5ba271dc1a36", - [] - ], - "size.attributes.setAttribute.octal.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.setAttribute.onlyspace.png": [ - "a72d047556a72dc83654077f88bd5ba271dc1a36", - [] - ], - "size.attributes.setAttribute.percent.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.setAttribute.plus.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.setAttribute.space.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.setAttribute.trailingjunk.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], - "size.attributes.setAttribute.whitespace.png": [ - "f8426733306293c70134e35f4704268b7a19a407", - [] - ], "size.attributes.style.png": [ "eeedd0ff05889ffd4468bf19a2e8e9e0a094201c", [] @@ -386513,7 +386511,7 @@ ] }, "lint.ignore": [ - "e0ba1ad4c0458e4a3e07c413207314ae65f258e8", + "1b03b0cdeb822dbe3caa7222d705c8b629ea2091", [] ], "loading": { @@ -391246,10 +391244,6 @@ [] ], "fcp-only": { - "fcp-document-opacity-image.html.ini": [ - "8c9c8b10f8e83d05d896415f9cab802a7cb24a55", - [] - ], "fcp-invisible-3d-rotate-descendant.html.ini": [ "02b791f74d4a477bdd166f3943dd110f17ed8932", [] @@ -397065,6 +397059,10 @@ "self-text-directive-iframe.html": [ "43573692ea8e186278f51dc7a4f8204f549c997e", [] + ], + "util.js": [ + "00e12929880c349ce3d8d52cb52e21b471465639", + [] ] }, "scroll-to-text-fragment-security.sub.html.ini": [ @@ -471239,7 +471237,7 @@ ] ], "mask-position-valid.html": [ - "c70e18c47a3d369b79acb0e51410a87c2fae8112", + "858bb4b68ac695a17c49e9e6d60416d432c77e67", [ null, {} @@ -481860,7 +481858,7 @@ ] ], "transform-2d-getComputedStyle-001.html": [ - "804b626126c9d404bda90965bd803e74d0266e11", + "c70cfa9cdc52d133fd57d13d64a0455d9d5ae8bf", [ null, {} @@ -488316,6 +488314,13 @@ {} ] ], + "getComputedStyle-insets-absolute-roundtrip.html": [ + "d89a22d86650371d31d90b3b6be728f3502c8db5", + [ + null, + {} + ] + ], "getComputedStyle-insets-absolute.html": [ "fae0a84a7b4a554b6cc182f48aee98bc7c196ad4", [ @@ -488634,7 +488639,7 @@ ] ], "serialize-values.html": [ - "1482e711897427585002abf13c33b3e5e74ac93b", + "2d20f263f4fd6db4134f6280af50c0037c06d41f", [ null, {} @@ -542662,6 +542667,318 @@ {} ] ], + "canvas-context": { + "2d.canvas.context.exists.html": [ + "1c44acbd549c71b80c386344339b6fb5d0b7004c", + [ + null, + {} + ] + ], + "2d.canvas.context.extraargs.cache.html": [ + "f4db40815dcc518a75f1568ab1cfc21ba0cf9db5", + [ + null, + {} + ] + ], + "2d.canvas.context.extraargs.create.html": [ + "6ae7f787c6adeceabc3dfe37a981cf07eb46de2e", + [ + null, + {} + ] + ], + "2d.canvas.context.invalid.args.html": [ + "cfa58266eacf75b9a68c1bdd958426e5427f0e87", + [ + null, + {} + ] + ], + "2d.canvas.context.prototype.html": [ + "5d5edc6864bc994a0b60a1fb80535598857fad40", + [ + null, + {} + ] + ], + "2d.canvas.context.shared.html": [ + "fd8deddec02204fca5aeed3f57427c1a6cc28001", + [ + null, + {} + ] + ], + "2d.canvas.context.type.exists.html": [ + "d25f009abbd049bfedf7b952e03fa15b0a93eced", + [ + null, + {} + ] + ], + "2d.canvas.context.type.extend.html": [ + "8d34d5310197bcc4727592aac35da349437385c8", + [ + null, + {} + ] + ], + "2d.canvas.context.type.prototype.html": [ + "a537fe5106cd7c3ddd5a0b91f1089493ae01ab3d", + [ + null, + {} + ] + ], + "2d.canvas.context.type.replace.html": [ + "ac3c40587d1ba73410b2de408fdcbb4b629b0ef2", + [ + null, + {} + ] + ], + "2d.canvas.context.unique.html": [ + "c7b1803856c9ad0b1bd55b8f34c5044b34af0b1d", + [ + null, + {} + ] + ] + }, + "canvas-host": { + "2d.canvas.host.initial.reset.2dstate.html": [ + "e1940011989c98b352a690f5218d349b56697747", + [ + null, + {} + ] + ], + "2d.canvas.host.readonly.html": [ + "cbbf32f2e2bd77ab112d6f80b6d2d578a9da0fc0", + [ + null, + {} + ] + ], + "2d.canvas.host.reference.html": [ + "6a4bdb65b082180b4af66d1cbe38f85446f0a894", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.decimal.html": [ + "0de11e235dc2d49c1ee37ed1f44a7bb78b87d046", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.em.html": [ + "315c8323fa23b36fe5f0ba06e15e3d74b187e824", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.empty.html": [ + "b9568712e7151aed44548f3161a29888812e4566", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.exp.html": [ + "208ddeceeb080d3dc8ca0a9592d20e86ccb139c6", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.hex.html": [ + "05f7030d47f89a7664945328c3d4395136debbf7", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.junk.html": [ + "3a55fd13dd04fea2b4a3eb26e79841771936050c", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.minus.html": [ + "da5f21ad0456de30a8f66f07e23dd46c2d9f81c8", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.octal.html": [ + "ccc7efaafa902ee2a3dd5aa492a6b4fd4452b0dc", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.onlyspace.html": [ + "da14fa25c0f07b8043a885863d656b9e461ac33a", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.percent.html": [ + "d699288f73fcd75824fe3c6889fe5fc23479853a", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.plus.html": [ + "58fb07f17942ed68b078da4c42f35d83574e57dc", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.space.html": [ + "52fadaad431536f5389b1e174176c7e572f7d12b", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.trailingjunk.html": [ + "b18167c5991da6247516b111cb1ae484452fab62", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.whitespace.html": [ + "79e81c1020a85279ee119ebd2757c32bf89c10cb", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.zero.html": [ + "b7fd499d1fb4eecd34b55fd98cf5aa518504b2d8", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.decimal.html": [ + "b6c2130bf0afec9b139d6b670c9ea2403d1e89ab", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.em.html": [ + "f70713fd8f686bdd986bd779279a2fa113be4d46", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.empty.html": [ + "fab2394fec29136e617f3a468d743c937cece6dc", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.exp.html": [ + "cfa11eb302ff7f4dfaa5ab158f53e0fcede30306", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.hex.html": [ + "80a1fbda602495340650c0793fc2877d83842a2d", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.junk.html": [ + "b583871f38a65b42c3bc0738b9cbd0baca37bdba", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.minus.html": [ + "90a31403e104ff9719b3079b27e98c294466b6f6", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.octal.html": [ + "c5b263bd5faa2556f2e245f23f72dbc7aae13e8a", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.onlyspace.html": [ + "ac4cdb001b96647e156e432ded75a4d65ce9699d", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.percent.html": [ + "5aebf5a0b1144c20d4e92858a0d67b35aa59987a", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.plus.html": [ + "60da44daf3256d7a01552ec63bac16fec521d506", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.space.html": [ + "fbfd4c33c0474a98c42b4794c53b42c1abb3afa1", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.trailingjunk.html": [ + "1d230bd654b2bca4019c4378d8fe893a05347fd8", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.whitespace.html": [ + "1aa86d6a9eb387fb5a95b1a5c0fa795fb8d8039c", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.setAttribute.zero.html": [ + "64b4811d79a0edb73dc426927da10b3b5be2abac", + [ + null, + {} + ] + ] + }, "compositing": { "2d.composite.canvas.clear.html": [ "cb805b692e2d61232f81bc603f17459c5091969c", @@ -549467,6 +549784,13 @@ {} ] ], + "2d.text.setFont.mathFont.html": [ + "370104f1b845238a7d2e098e97f2a14449151136", + [ + null, + {} + ] + ], "parent-style-relative-units.html": [ "b9a6b314c6ff2b8cff34740ef13d708ecdc976eb", [ @@ -549898,6 +550222,637 @@ {} ] ], + "canvas-context": { + "2d.canvas.context.arguments.missing.html": [ + "0c9fdc96393c7d192d5553bdf453753c7e3e14ac", + [ + null, + {} + ] + ], + "2d.canvas.context.arguments.missing.worker.js": [ + "1b5c857a793fd30acc983071a6f2baa593c86abc", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.worker.html", + {} + ] + ], + "2d.canvas.context.casesensitive.html": [ + "aed71a37e95efb8f6ccb37a107bc15fca6425bbf", + [ + null, + {} + ] + ], + "2d.canvas.context.casesensitive.worker.js": [ + "c1df3a9f8086a8baf9cd741930a3509bb4e944cd", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.worker.html", + {} + ] + ], + "2d.canvas.context.emptystring.html": [ + "10548a6b7c660f14db48ec49136efc0ac8d6976a", + [ + null, + {} + ] + ], + "2d.canvas.context.emptystring.worker.js": [ + "53a58c1f5dea79e4c58bfbd62b38940e1e5c1c77", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.worker.html", + {} + ] + ], + "2d.canvas.context.exists.html": [ + "41b5cfee311334cdb35e5721b88f4bc93a11e427", + [ + null, + {} + ] + ], + "2d.canvas.context.exists.worker.js": [ + "77a43530a04636635cca71221f577df7a56e5337", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.exists.worker.html", + {} + ] + ], + "2d.canvas.context.extraargs.cache.html": [ + "2bcf34490ea9ca75d49191ccdf7188eb8797d5f5", + [ + null, + {} + ] + ], + "2d.canvas.context.extraargs.cache.worker.js": [ + "14284a0a7d7c1c5931f0ff82ad6e02ca1274d7b9", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.worker.html", + {} + ] + ], + "2d.canvas.context.extraargs.create.html": [ + "029122355c9c8ccaff5e48fc50da707ff5baf236", + [ + null, + {} + ] + ], + "2d.canvas.context.extraargs.create.worker.js": [ + "b4208edba8cffa2ffdb249b80189aae88573582c", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.worker.html", + {} + ] + ], + "2d.canvas.context.shared.html": [ + "cb9501747eec2c5fde1a63eae5546a64154b1179", + [ + null, + {} + ] + ], + "2d.canvas.context.shared.worker.js": [ + "8e53475756329718e26e95d5c7d5127cce8a4ff7", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.shared.worker.html", + {} + ] + ], + "2d.canvas.context.unique.html": [ + "66e4a049baad4b090ca18664782f5197d842ebce", + [ + null, + {} + ] + ], + "2d.canvas.context.unique.worker.js": [ + "275e45fde64266a3b8d7474f93e8af615eec1ed9", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.unique.worker.html", + {} + ] + ], + "2d.canvas.context.unrecognised.badname.html": [ + "4313f408437e360a08c5d5264b87a46036b2a9ca", + [ + null, + {} + ] + ], + "2d.canvas.context.unrecognised.badname.worker.js": [ + "dd16f2fbe1108751f07d1d7a0d05064ffc849995", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.worker.html", + {} + ] + ], + "2d.canvas.context.unrecognised.badsuffix.html": [ + "c00afa686edd563972620ec5717f252cc57dd347", + [ + null, + {} + ] + ], + "2d.canvas.context.unrecognised.badsuffix.worker.js": [ + "5e684c92c72acd87b4c84d48ec6778dbd3553a62", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.worker.html", + {} + ] + ], + "2d.canvas.context.unrecognised.nullsuffix.html": [ + "0ce3d4195e0d19cd882e2019ec1455e83d01613f", + [ + null, + {} + ] + ], + "2d.canvas.context.unrecognised.nullsuffix.worker.js": [ + "2886010fb644a69ea5e3c96050560a450cb500f2", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.worker.html", + {} + ] + ], + "2d.canvas.context.unrecognised.unicode.html": [ + "316123675ad75e31a85c0286760d374c7f316e90", + [ + null, + {} + ] + ], + "2d.canvas.context.unrecognised.unicode.worker.js": [ + "46e562dd486835e28b41c6215273ebc8f8d4c21e", + [ + "html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.worker.html", + {} + ] + ], + "2d.getContext.options.any.js": [ + "930f7722ee0eae02674c6773751d04c69f4bb384", + [ + "html/canvas/offscreen/canvas-context/2d.getContext.options.any.html", + {} + ], + [ + "html/canvas/offscreen/canvas-context/2d.getContext.options.any.worker.html", + {} + ] + ] + }, + "canvas-host": { + "2d.canvas.host.initial.color.html": [ + "0793c74f398cff50cb234a4aff6ca2e058a04a10", + [ + null, + {} + ] + ], + "2d.canvas.host.initial.color.worker.js": [ + "11d6b9f098e7bed4c47c2aa9dbd9ace9f4b29764", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.html", + {} + ] + ], + "2d.canvas.host.initial.reset.2dstate.html": [ + "36230dab7735685ef0c4714aff07f42a3edd995e", + [ + null, + {} + ] + ], + "2d.canvas.host.initial.reset.2dstate.worker.js": [ + "df0bd9f63cb6e2df735b7d321f16e86c4adbe7b0", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.html", + {} + ] + ], + "2d.canvas.host.initial.reset.clip.html": [ + "fc5324079570839bc544a558e22a55265289dda0", + [ + null, + {} + ] + ], + "2d.canvas.host.initial.reset.clip.worker.js": [ + "80554b0a3fdf11bfda72bc92b4d2ce640f5f2395", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.html", + {} + ] + ], + "2d.canvas.host.initial.reset.different.html": [ + "3771a5e37a94b329f6c880ef33a0077b2e25d8f1", + [ + null, + {} + ] + ], + "2d.canvas.host.initial.reset.different.worker.js": [ + "6074d4f2a2c88eda4d8f91fd0b931fda6bbb7f01", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.html", + {} + ] + ], + "2d.canvas.host.initial.reset.gradient.html": [ + "387b4d1f1ed6037dc2cefd9fee3819edba30841c", + [ + null, + {} + ] + ], + "2d.canvas.host.initial.reset.gradient.worker.js": [ + "9029b48056fa03e60236505b159f067bb689d9d8", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.html", + {} + ] + ], + "2d.canvas.host.initial.reset.path.html": [ + "3a887a8f1ffe5148f2b4ef6e711787363d0d2fa6", + [ + null, + {} + ] + ], + "2d.canvas.host.initial.reset.path.worker.js": [ + "0ab12872aee4a3ce6b0e9122e7222661e543d38e", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.html", + {} + ] + ], + "2d.canvas.host.initial.reset.pattern.html": [ + "d822f90917fb7b58cd0ccbdee3307a7384643b0c", + [ + null, + {} + ] + ], + "2d.canvas.host.initial.reset.pattern.worker.js": [ + "c4870a6f998b9b63d90c37613dd2cbce5d0e3e02", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.html", + {} + ] + ], + "2d.canvas.host.initial.reset.same.html": [ + "19394def373c881d3ad9c35b51fa5a67a640db13", + [ + null, + {} + ] + ], + "2d.canvas.host.initial.reset.same.worker.js": [ + "48d24750ac4e85e638c8b6ad6e9386b3f68b61d3", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.html", + {} + ] + ], + "2d.canvas.host.initial.reset.transform.html": [ + "ee3b5abf107738b1d433ff3d9f59f9ffc93dc2a6", + [ + null, + {} + ] + ], + "2d.canvas.host.initial.reset.transform.worker.js": [ + "218e64fa5dc34070ec5b84b2f3b86edceadc256f", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.html", + {} + ] + ], + "2d.canvas.host.readonly.html": [ + "0e7e10cd242adf6d09ea41e0ca6df4f39d3182a9", + [ + null, + {} + ] + ], + "2d.canvas.host.readonly.worker.js": [ + "bbe50dcf61f461ceb3d7e1887d0c4049bf3292ae", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.html", + {} + ] + ], + "2d.canvas.host.reference.html": [ + "b5de73f403d88c2e4b3cad691c56c56c37464715", + [ + null, + {} + ] + ], + "2d.canvas.host.reference.worker.js": [ + "7a1f0c5ab498a3c7acb9cd17c71561fce0b73088", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.default.html": [ + "dc7b894b207356fd422333ec1a91f89d9aa68462", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.default.worker.js": [ + "78fce5aef8d510a1366cec79a6ace66c1e53cfbf", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.idl.html": [ + "7030103524caeb33d53d717624de77515924bfa1", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.idl.set.zero.html": [ + "347c460cd7ef44f8ea78658f0d8d923b9244cea0", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.idl.set.zero.worker.js": [ + "21535da0eb335eec3f73548d8350fc946d8e1726", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.idl.worker.js": [ + "a00201f18cc59687e75881b3763e1869b14c8ee8", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.decimal.html": [ + "c3fa3b4ba6674396ff12f9adfe55dd4400bc87bc", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.decimal.worker.js": [ + "1267bb205a94034bb790e7aa0910f0fcdfce763b", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.em.html": [ + "ea6f811b8ff5faa5f000887b57dfd6f3f861525d", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.em.worker.js": [ + "2f0642d99790ab1009709051bc6f5c9d61c8830a", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.empty.html": [ + "d38c159a6e3486c0d96a0b0abae938af1c2d771f", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.empty.worker.js": [ + "b1eee3a5b226f1627e243537e4f70f6c3ec72eb3", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.exp.html": [ + "2aa8245a49c7c1e111662a7ad67eb7751ab10610", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.exp.worker.js": [ + "8c8b4cc715efae513b7d5071b55084d5013d2361", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.hex.html": [ + "4b0e47b53f5112413e352c2c90a0d6d6ad503de5", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.hex.worker.js": [ + "b685aaffa2d9c5d99c8c03e6ee1b77a7ef832aa4", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.junk.html": [ + "a619651f781251fb3ae8945cd34795b78978f1a9", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.junk.worker.js": [ + "f4822f4bd954618d238c15fa2db7724d3649a8dc", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.minus.html": [ + "c7f12fdb021465e89e0c7fae8788429336cebf27", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.minus.worker.js": [ + "322b992eda24947c04e3eff3c5dec6e3133f37f7", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.octal.html": [ + "7bfb7658d4d479437ab724a8004ea5e6aecbe263", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.octal.worker.js": [ + "ce518e35c7ad6b4305c6c0dacec11630feb74835", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.onlyspace.html": [ + "16dace16ea96f83e09cd5eb10dc3a0d8548b591c", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.onlyspace.worker.js": [ + "c186a4c08bab5f604b843c9ebd936fe62202cc3d", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.percent.html": [ + "040a775ec7a2820347558f6bb9f0c1d34042e0f9", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.percent.worker.js": [ + "f38a1862d41aecfd3052f73d2df76eff0b0c8a15", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.plus.html": [ + "50c8467e2cdc5ff20e462b3271ac5e7d11cef846", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.plus.worker.js": [ + "bb45a1e4fa07954b54aa0b742e77571a99253ec0", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.space.html": [ + "cb1f3ae840ad554fd2932886e1561dca479d60a7", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.space.worker.js": [ + "967a0939d806700df42c67481dbdb71a79a2a8de", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.trailingjunk.html": [ + "8d8d481aefaadedb376a872a68b2bb11691350d9", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.trailingjunk.worker.js": [ + "ffebcd97f1ec2aab95c5caf3951ed0c45ba9a4b3", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.whitespace.html": [ + "f6e29d6cb61902db985c61dbfa72998a819b803d", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.whitespace.worker.js": [ + "fb7ba47975ae150e22e63908d9260ecb5a9660aa", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.parse.zero.html": [ + "07e924a6030a0b110047bbcd223931e5548dfde0", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.parse.zero.worker.js": [ + "1363bff7728a1e6a091818f3588b8026eb8efcac", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.reflect.setidl.html": [ + "d24b2cc49ff9bbac98f3fc3f7b51a0847b19f36f", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.reflect.setidl.worker.js": [ + "3b3ced124ab2bda792db0c00ce6dfc3e4fe18320", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.html", + {} + ] + ], + "2d.canvas.host.size.attributes.reflect.setidlzero.html": [ + "c4839afb0e4c9bbf7e12a6960b629e5665c09994", + [ + null, + {} + ] + ], + "2d.canvas.host.size.attributes.reflect.setidlzero.worker.js": [ + "d440a9d807a7877ce7af903f7de99112187fcc93", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.html", + {} + ] + ], + "2d.canvas.host.size.large.html": [ + "b220f8f2edea11803098283367b624f97ec56869", + [ + null, + {} + ] + ], + "2d.canvas.host.size.large.worker.js": [ + "a763704131a55f958c0971407c626d5437ec74ae", + [ + "html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.html", + {} + ] + ] + }, "compositing": { "2d.composite.canvas.clear.html": [ "eac9dbdef9acf93a7be8f7322eba552edff52b16", @@ -562377,635 +563332,6 @@ ] ] }, - "the-offscreen-canvas": { - "2d-getcontext-options.any.js": [ - "930f7722ee0eae02674c6773751d04c69f4bb384", - [ - "html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.html", - {} - ], - [ - "html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.worker.html", - {} - ] - ], - "2d.canvas.readonly.html": [ - "6bc6eef2efaabb9e7984e2ea701914cec584ca58", - [ - null, - {} - ] - ], - "2d.canvas.readonly.worker.js": [ - "068c2c2019d32dbe70f64ab6a8c0f8b2672f5425", - [ - "html/canvas/offscreen/the-offscreen-canvas/2d.canvas.readonly.worker.html", - {} - ] - ], - "2d.canvas.reference.html": [ - "c43afd816ae194940b4e1ffa8b9fb57a1b880c49", - [ - null, - {} - ] - ], - "2d.canvas.reference.worker.js": [ - "a1578af07c0bd5c710a0ae8c7cdc3eacf4f5dc40", - [ - "html/canvas/offscreen/the-offscreen-canvas/2d.canvas.reference.worker.html", - {} - ] - ], - "2d.getcontext.exists.html": [ - "73fc45c30969b3fb929fbb7267940e03a73e9612", - [ - null, - {} - ] - ], - "2d.getcontext.exists.worker.js": [ - "0ed6f242484b855ac6653d95532e44ae5bedd5ea", - [ - "html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.exists.worker.html", - {} - ] - ], - "2d.getcontext.extraargs.cache.html": [ - "2f57050a4d54293c5c4eefe402daa9dd3007dcb4", - [ - null, - {} - ] - ], - "2d.getcontext.extraargs.cache.worker.js": [ - "88540513ab36116bce0031b396199f5a5f82fdbd", - [ - "html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker.html", - {} - ] - ], - "2d.getcontext.extraargs.create.html": [ - "a2869c45f6a76ff503ed119c2d2f0dbdf75c3e6c", - [ - null, - {} - ] - ], - "2d.getcontext.extraargs.create.worker.js": [ - "21d4f8ce6ddcb0779ff938b4e0c6a45d660cae34", - [ - "html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker.html", - {} - ] - ], - "2d.getcontext.shared.html": [ - "c37664f9d370d788218e28a2f1e593e106d2cb1a", - [ - null, - {} - ] - ], - "2d.getcontext.shared.worker.js": [ - "936ca03c27b3de0d92426d2ae1326846ef127e26", - [ - "html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.shared.worker.html", - {} - ] - ], - "2d.getcontext.unique.html": [ - "945526c5d183593f254da38eb022a715df5efbea", - [ - null, - {} - ] - ], - "2d.getcontext.unique.worker.js": [ - "fbf8e3c68d28881b2f0e58ad100d940e18f9bdcf", - [ - "html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.unique.worker.html", - {} - ] - ], - "context.arguments.missing.html": [ - "4d5478e893a98bc1d0b4b50fb41ba377b164a220", - [ - null, - {} - ] - ], - "context.arguments.missing.worker.js": [ - "f20db3ad753516da2480c847d5530e657507c501", - [ - "html/canvas/offscreen/the-offscreen-canvas/context.arguments.missing.worker.html", - {} - ] - ], - "context.casesensitive.html": [ - "6183607aac5daab865f3e4556b40c17faedbf12d", - [ - null, - {} - ] - ], - "context.casesensitive.worker.js": [ - "a834a3e13f99a4daacd8035bcb14ba94dec910ce", - [ - "html/canvas/offscreen/the-offscreen-canvas/context.casesensitive.worker.html", - {} - ] - ], - "context.emptystring.html": [ - "b898698bb7e39ed1ec7d562207a4cae75f0e325e", - [ - null, - {} - ] - ], - "context.emptystring.worker.js": [ - "df7d06df0c793e020ca73254bba2b8d7e5d37724", - [ - "html/canvas/offscreen/the-offscreen-canvas/context.emptystring.worker.html", - {} - ] - ], - "context.unrecognised.badname.html": [ - "5460fe10796a34b8f944d994b2d798545b1ba492", - [ - null, - {} - ] - ], - "context.unrecognised.badname.worker.js": [ - "8dfee5498204b6694907e9dd3b7edc8d30db90c0", - [ - "html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badname.worker.html", - {} - ] - ], - "context.unrecognised.badsuffix.html": [ - "72624be12cb452e8cb904aa909bef22f746b2a9f", - [ - null, - {} - ] - ], - "context.unrecognised.badsuffix.worker.js": [ - "6cfcbc3c81b94080ab515f0370fe3e27ac0cf45f", - [ - "html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badsuffix.worker.html", - {} - ] - ], - "context.unrecognised.nullsuffix.html": [ - "f36f7583fb950b72c3fb967d9e58534fcf4e85d1", - [ - null, - {} - ] - ], - "context.unrecognised.nullsuffix.worker.js": [ - "d9b563db61d5ed743b655eeabe9c28616e0b2e94", - [ - "html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.nullsuffix.worker.html", - {} - ] - ], - "context.unrecognised.unicode.html": [ - "f8176f58dfb84f6e13842898305f9723c7128cb0", - [ - null, - {} - ] - ], - "context.unrecognised.unicode.worker.js": [ - "2d02a794563939fa012e670d58970e35638f49d0", - [ - "html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.unicode.worker.html", - {} - ] - ], - "initial.color.html": [ - "d89b01df6689292836b35a00e626511b404d3693", - [ - null, - {} - ] - ], - "initial.color.worker.js": [ - "c9705727d99b462edde414be0ca491917b5e5bb9", - [ - "html/canvas/offscreen/the-offscreen-canvas/initial.color.worker.html", - {} - ] - ], - "initial.reset.2dstate.html": [ - "55954fc421af4f8ad9750b18b13c648bd2a02fbc", - [ - null, - {} - ] - ], - "initial.reset.2dstate.worker.js": [ - "dc0d6ea00b71b2be4fe4354cbe2d6f94709eb3d5", - [ - "html/canvas/offscreen/the-offscreen-canvas/initial.reset.2dstate.worker.html", - {} - ] - ], - "initial.reset.clip.html": [ - "9b1354bdabff3963abe1c5ee4a9dacbd125946c1", - [ - null, - {} - ] - ], - "initial.reset.clip.worker.js": [ - "d774aad6c81009dff420aa8f07e114b9c86ed4c5", - [ - "html/canvas/offscreen/the-offscreen-canvas/initial.reset.clip.worker.html", - {} - ] - ], - "initial.reset.different.html": [ - "a5c891ff1443873a82ab7cb452cc746abd4a2464", - [ - null, - {} - ] - ], - "initial.reset.different.worker.js": [ - "dc8f4bd146d16da642c90ff951b15ef49a09641c", - [ - "html/canvas/offscreen/the-offscreen-canvas/initial.reset.different.worker.html", - {} - ] - ], - "initial.reset.gradient.html": [ - "8b734d19b4b00cecce8d443ca7e22b0e5b7bfa0c", - [ - null, - {} - ] - ], - "initial.reset.gradient.worker.js": [ - "dabc013fed6e0cc7a63e2d6cb3b2076c2d1beea4", - [ - "html/canvas/offscreen/the-offscreen-canvas/initial.reset.gradient.worker.html", - {} - ] - ], - "initial.reset.path.html": [ - "24b7ff22fb9dbc4b637552baed2fc1c7b7dbd25e", - [ - null, - {} - ] - ], - "initial.reset.path.worker.js": [ - "6535232414946a14d98eb475bca621c9a2357cf8", - [ - "html/canvas/offscreen/the-offscreen-canvas/initial.reset.path.worker.html", - {} - ] - ], - "initial.reset.pattern.html": [ - "2742d8fb5ff827433347ce67c97bedc81ba7c62c", - [ - null, - {} - ] - ], - "initial.reset.pattern.worker.js": [ - "a69f36e8736974b45286f6e00d37fa2e8e181b33", - [ - "html/canvas/offscreen/the-offscreen-canvas/initial.reset.pattern.worker.html", - {} - ] - ], - "initial.reset.same.html": [ - "137dcbd556eaf2131a7d633ba7324d060f3d4747", - [ - null, - {} - ] - ], - "initial.reset.same.worker.js": [ - "fd3c46482baddbadf5cb16c09689a16ac9aa84ba", - [ - "html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.worker.html", - {} - ] - ], - "initial.reset.transform.html": [ - "d09f8f928f47b699e22185ce844719f4ab8181df", - [ - null, - {} - ] - ], - "initial.reset.transform.worker.js": [ - "564a3bd82f4252eb4d18b146030cb5341c29740f", - [ - "html/canvas/offscreen/the-offscreen-canvas/initial.reset.transform.worker.html", - {} - ] - ], - "size.attributes.default.html": [ - "52ddf116e61f78dd0e7768827b974f5da6cb35e7", - [ - null, - {} - ] - ], - "size.attributes.default.worker.js": [ - "83e0271f1ab085fa7bec8e16a5deb0c0e4608ed6", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.default.worker.html", - {} - ] - ], - "size.attributes.idl.html": [ - "a815a7beb49e7e873dc6466693cb8a25b8443373", - [ - null, - {} - ] - ], - "size.attributes.idl.set.zero.html": [ - "5a069f3c014358c925557f80e9f9661ac3924468", - [ - null, - {} - ] - ], - "size.attributes.idl.set.zero.worker.js": [ - "d51258ac2a4639ea15be2c0f5aa12d08e10c298c", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.set.zero.worker.html", - {} - ] - ], - "size.attributes.idl.worker.js": [ - "931b95cb65c1a640886075e860aba273ffeed7a5", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.worker.html", - {} - ] - ], - "size.attributes.parse.decimal.html": [ - "688d80b2fa650127e0564b4dba0eafa085b7219f", - [ - null, - {} - ] - ], - "size.attributes.parse.decimal.worker.js": [ - "157bd613bbc0bc31ea2e29ab59823487ac9e5913", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.decimal.worker.html", - {} - ] - ], - "size.attributes.parse.em.html": [ - "2e5056aad0d4ba426afbed2ce3e6b62c99cd54d8", - [ - null, - {} - ] - ], - "size.attributes.parse.em.worker.js": [ - "b939765ee4e26834d0e872737357652b61b21adb", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.em.worker.html", - {} - ] - ], - "size.attributes.parse.empty.html": [ - "7755f9d0db2bc68fc01473390a540977abaf490b", - [ - null, - {} - ] - ], - "size.attributes.parse.empty.worker.js": [ - "72fcd9f6e5a2d7917952a9c6a5323c763db0f22f", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.empty.worker.html", - {} - ] - ], - "size.attributes.parse.exp.html": [ - "0a2f0125834f33bc1cc38be58522a78210001019", - [ - null, - {} - ] - ], - "size.attributes.parse.exp.worker.js": [ - "0b7d5f2b9759bf719ddf12f889adac2d5ce3813a", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.exp.worker.html", - {} - ] - ], - "size.attributes.parse.hex.html": [ - "5a8990183a4b002bbf8f014cbdc98711385e708c", - [ - null, - {} - ] - ], - "size.attributes.parse.hex.worker.js": [ - "1edd0edee65ac0815a04f11b7a9cb191dfb0b4f4", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.hex.worker.html", - {} - ] - ], - "size.attributes.parse.junk.html": [ - "10d2e20388fd013756f9422cd8183ddca32791d4", - [ - null, - {} - ] - ], - "size.attributes.parse.junk.worker.js": [ - "c7e18d12cb5d424865cafd6b205b9ff6138b1fcf", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.junk.worker.html", - {} - ] - ], - "size.attributes.parse.minus.html": [ - "2a7d5d1296839693ecd7eab5cf8120e819d945f1", - [ - null, - {} - ] - ], - "size.attributes.parse.minus.worker.js": [ - "9680f90776604b746c798eb6ec07171932421653", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.minus.worker.html", - {} - ] - ], - "size.attributes.parse.octal.html": [ - "3d9c2fb0443767ab81087f89c0ff9b38a4b98185", - [ - null, - {} - ] - ], - "size.attributes.parse.octal.worker.js": [ - "2925361e3b33b0c0659181af0293f0f749177568", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.octal.worker.html", - {} - ] - ], - "size.attributes.parse.onlyspace.html": [ - "821de438aa41cbe2a680f193784b90f9b635f7a4", - [ - null, - {} - ] - ], - "size.attributes.parse.onlyspace.worker.js": [ - "e5fadf13c8eef7c55a788a78dde0ffa5872848d3", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.onlyspace.worker.html", - {} - ] - ], - "size.attributes.parse.percent.html": [ - "58748103a4f876352315d6fb7fcc871478acf2cc", - [ - null, - {} - ] - ], - "size.attributes.parse.percent.worker.js": [ - "acbd2a1354814255d12cf59a61e8b1e8aae773b4", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.percent.worker.html", - {} - ] - ], - "size.attributes.parse.plus.html": [ - "45558293b6228b7ac06c4470ddd128665a2a2671", - [ - null, - {} - ] - ], - "size.attributes.parse.plus.worker.js": [ - "ecf67976769f06186527a4567b10c7688bc00c7f", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.plus.worker.html", - {} - ] - ], - "size.attributes.parse.space.html": [ - "b0d63a4694f3f0b047929a60620f059d3550412f", - [ - null, - {} - ] - ], - "size.attributes.parse.space.worker.js": [ - "11ac398b0d42e9e20f0f2165382ece487c7843f0", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.space.worker.html", - {} - ] - ], - "size.attributes.parse.trailingjunk.html": [ - "536ea901d0e8e7fc79249c774d5bc36b3ca870f8", - [ - null, - {} - ] - ], - "size.attributes.parse.trailingjunk.worker.js": [ - "1d1c5e7f28dcc58aff8e15696584e3aa206aeb39", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.trailingjunk.worker.html", - {} - ] - ], - "size.attributes.parse.whitespace.html": [ - "53a3a2e6055b3cf33190dc84e84ce09dfb69186f", - [ - null, - {} - ] - ], - "size.attributes.parse.whitespace.worker.js": [ - "26296e10234ff4701837726d5e33346832261fe8", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.whitespace.worker.html", - {} - ] - ], - "size.attributes.parse.zero.html": [ - "1af0d2a61e246fa9678c8dd86ad4a486fca16090", - [ - null, - {} - ] - ], - "size.attributes.parse.zero.worker.js": [ - "5348bf6a83c94f147bc9fbcf253067000712e096", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.zero.worker.html", - {} - ] - ], - "size.attributes.reflect.setidl.html": [ - "997bf974ad839bf0fb7a5305f3cc89a773969234", - [ - null, - {} - ] - ], - "size.attributes.reflect.setidl.worker.js": [ - "9555f665ab391f044366429a147bca78adee399b", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidl.worker.html", - {} - ] - ], - "size.attributes.reflect.setidlzero.html": [ - "50e9096fdd43063d52eb1dbac029dc28afe4a67e", - [ - null, - {} - ] - ], - "size.attributes.reflect.setidlzero.worker.js": [ - "e412b7a5142b780577679a0513a8f481a056dbbe", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidlzero.worker.html", - {} - ] - ], - "size.large.html": [ - "46b8a055bb3bde2f553fefdc19ad6fbd20e35e73", - [ - null, - {} - ] - ], - "size.large.worker.js": [ - "6a5bb5ee7e06719096b3a33f9acbff2768285e03", - [ - "html/canvas/offscreen/the-offscreen-canvas/size.large.worker.html", - {} - ] - ] - }, "transformations": { "2d.transformation.order.html": [ "d438c274338886941fd28d302316eca646a29349", @@ -574488,97 +574814,6 @@ {} ] ], - "2d.canvas.context.html": [ - "51cf0a2ec6d7d17731fc8407214cf3383adaac93", - [ - null, - {} - ] - ], - "2d.canvas.readonly.html": [ - "4b9e68108fe8f5faea7e6f9b343db9c973790a73", - [ - null, - {} - ] - ], - "2d.canvas.reference.html": [ - "182a0170a67b9a46f99829e2bf8a65b3330ccb30", - [ - null, - {} - ] - ], - "2d.getcontext.exists.html": [ - "a26bc4040c7d3940d5bb07ea358096fa9c630e7d", - [ - null, - {} - ] - ], - "2d.getcontext.extraargs.cache.html": [ - "eb47929a09f75d73743ccfd42041e575b36586ad", - [ - null, - {} - ] - ], - "2d.getcontext.extraargs.create.html": [ - "0683e459c4b37fea779de8314503710faf0b38ab", - [ - null, - {} - ] - ], - "2d.getcontext.invalid.args.html": [ - "c3407d0500352e4ec0edccf6527a4c6b062f67d4", - [ - null, - {} - ] - ], - "2d.getcontext.shared.html": [ - "54c1fd13fdedf29022153c4c7147289dbdfc25be", - [ - null, - {} - ] - ], - "2d.getcontext.unique.html": [ - "c6e8980a20c5ce596a95afaa5f5cd9f11a49df9e", - [ - null, - {} - ] - ], - "2d.type.exists.html": [ - "e2c09e60d742779e76b3da528d60e51382973b61", - [ - null, - {} - ] - ], - "2d.type.extend.html": [ - "151b40d36f493328f42ce7dc484221695963ed1a", - [ - null, - {} - ] - ], - "2d.type.prototype.html": [ - "24ee5068bd5823a85af101af9ee0ce15c3aab53d", - [ - null, - {} - ] - ], - "2d.type.replace.html": [ - "aa0ec1cff4d93b36d1a2bd1fb629147610d9c063", - [ - null, - {} - ] - ], "canvas-descendants-focusability-001.html": [ "327c9f49d6aeffc2b3eef49cc38c8a00ebf15f95", [ @@ -574705,13 +574940,6 @@ {} ] ], - "initial.reset.2dstate.html": [ - "a99cb5d3898e3ec9dd33e01aa9120e126931fcdf", - [ - null, - {} - ] - ], "initial.reset.clip.html": [ "ebf52bfa764a3431f11edea22ca485c6398aafb0", [ @@ -574936,111 +575164,6 @@ {} ] ], - "size.attributes.parse.decimal.html": [ - "613cf0e11a5821c7354f022bab7d028cf1b53252", - [ - null, - {} - ] - ], - "size.attributes.parse.em.html": [ - "21d9e6ab1e84504705c3c103ec466f7193eaf098", - [ - null, - {} - ] - ], - "size.attributes.parse.empty.html": [ - "7198ccd3abf8c32426a4a6cd7fe05d4cdec70e00", - [ - null, - {} - ] - ], - "size.attributes.parse.exp.html": [ - "c609939640b3820941b6cffedb1e71bf25874b46", - [ - null, - {} - ] - ], - "size.attributes.parse.hex.html": [ - "a00bb3c4ea2f1900a6fed23f38d5364d434a28e1", - [ - null, - {} - ] - ], - "size.attributes.parse.junk.html": [ - "7b4f837600dbd6ad9c3354a1e32e6bda10aa376b", - [ - null, - {} - ] - ], - "size.attributes.parse.minus.html": [ - "6d6560b8db92779896450033115abb4d489d0eb2", - [ - null, - {} - ] - ], - "size.attributes.parse.octal.html": [ - "e1f42ea18865f6a2fc8203761aff69e79949e7ec", - [ - null, - {} - ] - ], - "size.attributes.parse.onlyspace.html": [ - "20721dcc6fa2eefb187b8546accdef30b1e12b60", - [ - null, - {} - ] - ], - "size.attributes.parse.percent.html": [ - "860703c6c2e4172321c2ef5c975dfd12b4d21b39", - [ - null, - {} - ] - ], - "size.attributes.parse.plus.html": [ - "2b600941a8db2580d8cb19169e20a2d0486f6840", - [ - null, - {} - ] - ], - "size.attributes.parse.space.html": [ - "34cae4d4c90957740f8785b00bd1a2379d582505", - [ - null, - {} - ] - ], - "size.attributes.parse.trailingjunk.html": [ - "e2b92ee0aaed53d6bc7e941a55a7a250779f4635", - [ - null, - {} - ] - ], - "size.attributes.parse.whitespace.html": [ - "c7a76f967e249112941a7e8507c456eaf9026d0d", - [ - null, - {} - ] - ], - "size.attributes.parse.zero.html": [ - "0f7a0415a173a48db72bf7c8925e711ec6327dfd", - [ - null, - {} - ] - ], "size.attributes.reflect.setcontent.html": [ "a25c4b784a29b16708d6a8959151b1982dc8c7d3", [ @@ -575069,113 +575192,8 @@ {} ] ], - "size.attributes.setAttribute.decimal.html": [ - "9f0b4b1deb052aeda2966e605278b92bf0c8a1ce", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.em.html": [ - "df0eee7462e3253968994d97e55f18e1cdec3f43", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.empty.html": [ - "37e021424a086fb7be7d45d285333dde65b866ba", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.exp.html": [ - "943b98b9c3b7a627ad1d9ec475707d41742e9890", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.hex.html": [ - "a73ff5ec042dbabb9bcff7799caaaf34a3e58ae7", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.junk.html": [ - "607892d3f08e979e85a53a29846bb17225cf1122", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.minus.html": [ - "4fd49e5eccf200782a0440a6e9358188b70674b2", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.octal.html": [ - "d841413d3fe1f5ac85c9ffb74eeca779d96fa21e", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.onlyspace.html": [ - "7959c303d489fbf1602438d72bead3bf90e6999c", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.percent.html": [ - "6fed0cdae5a4c90907b026cd351c6f886e9276f3", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.plus.html": [ - "4be39bf19bdc817fbc209f893298d3ce244bc6f7", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.space.html": [ - "3cc00788ef7acde2c6c425f08db8bde7f733143e", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.trailingjunk.html": [ - "4c9b7ce54a2c43e1ab1616365f16c1ec0f40feac", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.whitespace.html": [ - "8f6ecc95b4a8f2b06a6f077fd2bc50a4798856fa", - [ - null, - {} - ] - ], - "size.attributes.setAttribute.zero.html": [ - "2bbad823537779286a4f52bf39252e45f09c8d51", - [ - null, - {} - ] - ], "size.attributes.style.html": [ - "31640c82f425a4ebaedbd3bde75d4125d0ddde79", + "aeb5c7ecb2ec1a71f83a8b68c2dd3298992d1ff8", [ null, {} @@ -628101,6 +628119,15 @@ } ] ], + "percent-encoding.html": [ + "696734b663d2cbd49adbb6a2a400d0747be5ebc6", + [ + null, + { + "testdriver": true + } + ] + ], "redirects.html": [ "5ad910affe55f6dd5ff63cdd3e019cf969fc6653", [ @@ -628111,7 +628138,7 @@ ] ], "same-document-tests.html": [ - "be9bed9fd8b6f58626866bff132634e8dc60d51c", + "85db2de0a227c694d2168e49dfb7f9cffb5d9eff", [ null, {}
diff --git a/third_party/blink/web_tests/external/wpt/css/css-masking/parsing/mask-position-valid.html b/third_party/blink/web_tests/external/wpt/css/css-masking/parsing/mask-position-valid.html index c70e18c..858bb4b 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-masking/parsing/mask-position-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-masking/parsing/mask-position-valid.html
@@ -11,28 +11,28 @@ </head> <body> <script> -test_valid_value("mask-position", "10%"); +test_valid_value("mask-position", "10%", "10% center"); test_valid_value("mask-position", "right 30% top 60px"); test_valid_value("mask-position", "-20% -30px"); -test_valid_value("mask-position", "30px center", "30px"); +test_valid_value("mask-position", "30px center", "30px center"); test_valid_value("mask-position", "40px top"); test_valid_value("mask-position", "bottom 10% right 20%", "right 20% bottom 10%"); test_valid_value("mask-position", "bottom right", "right bottom"); test_valid_value("mask-position", "center 50px"); -test_valid_value("mask-position", "center bottom", "bottom"); -test_valid_value("mask-position", "center left", "left"); -test_valid_value("mask-position", "left"); +test_valid_value("mask-position", "center bottom", "center bottom"); +test_valid_value("mask-position", "center left", "left center"); +test_valid_value("mask-position", "left", "left center"); test_valid_value("mask-position", "left bottom"); test_valid_value("mask-position", "right 40%"); -test_valid_value("mask-position", "top"); -test_valid_value("mask-position", "top center", "top"); -test_valid_value("mask-position", "center", "center"); +test_valid_value("mask-position", "top", "center top"); +test_valid_value("mask-position", "top center", "center top"); +test_valid_value("mask-position", "center", "center center"); test_valid_value("mask-position", "bottom left, right 20%", "left bottom, right 20%"); -test_valid_value("mask-position", "top, center, left"); +test_valid_value("mask-position", "top, center, left", "center top, center center, left center"); test_valid_value("mask-position", "20% 0%"); test_valid_value("mask-position", "0% 0%"); -test_valid_value("mask-position", "0%", ["0%", "0% center"]); -test_valid_value("mask-position", "0% center", ["0%", "0% center"]); +test_valid_value("mask-position", "0%", "0% center"); +test_valid_value("mask-position", "0% center"); test_valid_value("mask-position", "center 0%"); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/LICENSE.txt b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/LICENSE.txt new file mode 100644 index 0000000..d952d62 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/LICENSE.txt
@@ -0,0 +1,92 @@ +This Font Software is licensed under the SIL Open Font License, +Version 1.1. + +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font +creation efforts of academic and linguistic communities, and to +provide a free and open framework in which fonts may be shared and +improved in partnership with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply to +any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software +components as distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, +deleting, or substituting -- in part or in whole -- any of the +components of the Original Version, by changing formats or by porting +the Font Software to a new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, +modify, redistribute, and sell modified and unmodified copies of the +Font Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, in +Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the +corresponding Copyright Holder. This restriction only applies to the +primary font name as presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created using +the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/NotoSansCJKjp-Regular-subset-chws.otf b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/NotoSansCJKjp-Regular-subset-chws.otf new file mode 100644 index 0000000..18859d5e2 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/NotoSansCJKjp-Regular-subset-chws.otf Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/NotoSansCJKjp-Regular-subset-halt.otf b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/NotoSansCJKjp-Regular-subset-halt.otf new file mode 100644 index 0000000..7732822 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/NotoSansCJKjp-Regular-subset-halt.otf Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/README.md b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/README.md new file mode 100644 index 0000000..8ff42d0 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/fonts/README.md
@@ -0,0 +1,29 @@ +# Fonts + +Fonts in this directory help testing the `text-spacing-trim` property. + +## NotoSansCJKjp-Regular-subset-halt.otf + +This font is generated by the following command: +``` +pyftsubset NotoSansCJKjp-Regular.otf \ + --unicodes=20-7E,2018-201F,56FD,6C34,3000-301F,30FB,FF01-FF1F,FF5B-FF65 \ + --layout-features+=halt,vhal \ + --output-file=NotoSansCJKjp-Regular-subset-halt.otf +``` +where `pyftsubset` comes from https://github.com/fonttools/fonttools + +## NotoSansCJKjp-Regular-subset-chws.otf + +This font has `chws` and `vchw` in addition to the font above. + +This font is generated by the following command: +``` +pyftsubset NotoSansCJKjp-Regular.otf \ + --unicodes=20-7E,2018-201F,56FD,6C34,3000-301F,30FB,FF01-FF1F,FF5B-FF65 \ + --layout-features+=halt,vhal,chws,vchw \ + --output-file=NotoSansCJKjp-Regular-subset-chws.otf +``` +Note there are two variants of Noto CJK; one with `chws` and one without. +The input font for this command must be the one with `chws`, processed by the +[chws_tool](https://github.com/googlefonts/chws_tool).
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-001-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-001-ref.html new file mode 100644 index 0000000..34fe27eb --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-001-ref.html
@@ -0,0 +1,37 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<style> +@font-face { + font-family: halt-font; + src: url('support/fonts/NotoSansCJKjp-Regular-subset-halt.otf'); +} +#container { + font-family: halt-font; + font-size: 20px; + text-spacing-trim: space-all; +} +halt { + font-feature-settings: 'halt' 1; +} +</style> +<div id="container"> + <!-- Open + Open/Close/Middle --> + <div>国(<halt>(</halt>国</div> + <div>国(<halt>((</halt>国</div> + <div>国()国</div> + <div>国(・国</div> + <div>国( 国</div> + <!-- Close + Open/Close/Middle --> + <div>国)<halt>(</halt>国</div> + <div>国<halt>)</halt>)国</div> + <div>国<halt>))</halt>)国</div> + <div>国<halt>)</halt>・国</div> + <div>国<halt>)</halt> 国</div> + <!-- Middle + Open/Middle/Close --> + <div>国・<halt>(</halt>国</div> + <div>国・・国</div> + <div>国・)国</div> + <div>国 <halt>(</halt>国</div> + <div>国 国</div> + <div>国 )国</div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-001.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-001.html new file mode 100644 index 0000000..93518d0a --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-001.html
@@ -0,0 +1,35 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-trim-property"> +<link rel="match" href="text-spacing-trim-001-ref.html"> +<style> +@font-face { + font-family: halt-font; + src: url('support/fonts/NotoSansCJKjp-Regular-subset-halt.otf'); +} +#container { + font-family: halt-font; + font-size: 20px; +} +</style> +<div id="container"> + <!-- Open + Open/Close/Middle --> + <div>国((国</div> + <div>国(((国</div> + <div>国()国</div> + <div>国(・国</div> + <div>国( 国</div> + <!-- Close + Open/Close/Middle --> + <div>国)(国</div> + <div>国))国</div> + <div>国)))国</div> + <div>国)・国</div> + <div>国) 国</div> + <!-- Middle + Open/Middle/Close --> + <div>国・(国</div> + <div>国・・国</div> + <div>国・)国</div> + <div>国 (国</div> + <div>国 国</div> + <div>国 )国</div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-chws-001.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-chws-001.html new file mode 100644 index 0000000..1565c89 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-chws-001.html
@@ -0,0 +1,35 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-trim-property"> +<link rel="match" href="text-spacing-trim-001-ref.html"> +<style> +@font-face { + font-family: chws-font; + src: url('support/fonts/NotoSansCJKjp-Regular-subset-chws.otf'); +} +#container { + font-family: chws-font; + font-size: 20px; +} +</style> +<div id="container"> + <!-- Open + Open/Close/Middle --> + <div>国((国</div> + <div>国(((国</div> + <div>国()国</div> + <div>国(・国</div> + <div>国( 国</div> + <!-- Close + Open/Close/Middle --> + <div>国)(国</div> + <div>国))国</div> + <div>国)))国</div> + <div>国)・国</div> + <div>国) 国</div> + <!-- Middle + Open/Middle/Close --> + <div>国・(国</div> + <div>国・・国</div> + <div>国・)国</div> + <div>国 (国</div> + <div>国 国</div> + <div>国 )国</div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-colon-001-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-colon-001-ref.html new file mode 100644 index 0000000..33303f3f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-colon-001-ref.html
@@ -0,0 +1,28 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<style> +@font-face { + font-family: halt-font; + src: url('support/fonts/NotoSansCJKjp-Regular-subset-halt.otf'); +} +#container { + font-family: halt-font; + font-size: 20px; + text-spacing-trim: space-all; +} +halt { + font-feature-settings: 'halt' 1; +} +</style> +<div id="container"> + <!-- Colon + Open/Close/Middle --> + <div>国:<halt>(</halt>国</div> + <div>国:)国</div> + <div>国:・国</div> + <div>国: 国</div> + <!-- Open/Close/Middle + Colon --> + <div>国(:国</div> + <div>国<halt>)</halt>:国</div> + <div>国・:国</div> + <div>国 :国</div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-colon-001.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-colon-001.html new file mode 100644 index 0000000..2a7dfb1 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-colon-001.html
@@ -0,0 +1,26 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-trim-property"> +<link rel="match" href="text-spacing-trim-colon-001-ref.html"> +<style> +@font-face { + font-family: halt-font; + src: url('support/fonts/NotoSansCJKjp-Regular-subset-halt.otf'); +} +#container { + font-family: halt-font; + font-size: 20px; +} +</style> +<div id="container"> + <!-- Colon + Open/Close/Middle --> + <div>国:(国</div> + <div>国:)国</div> + <div>国:・国</div> + <div>国: 国</div> + <!-- Open/Close/Middle + Colon --> + <div>国(:国</div> + <div>国):国</div> + <div>国・:国</div> + <div>国 :国</div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-dot-001-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-dot-001-ref.html new file mode 100644 index 0000000..1bd62d3 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-dot-001-ref.html
@@ -0,0 +1,28 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<style> +@font-face { + font-family: halt-font; + src: url('support/fonts/NotoSansCJKjp-Regular-subset-halt.otf'); +} +#container { + font-family: halt-font; + font-size: 20px; + text-spacing-trim: space-all; +} +halt { + font-feature-settings: 'halt' 1; +} +</style> +<div id="container"> + <!-- Dot + Open/Close/Middle --> + <div>国。<halt>(</halt>国</div> + <div>国<halt>。</halt>)国</div> + <div>国<halt>。</halt>・国</div> + <div>国<halt>。</halt> 国</div> + <!-- Open/Close/Middle + Dot --> + <div>国(。国</div> + <div>国<halt>)</halt>。国</div> + <div>国・。国</div> + <div>国 。国</div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-dot-001.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-dot-001.html new file mode 100644 index 0000000..861ce87 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-dot-001.html
@@ -0,0 +1,26 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-trim-property"> +<link rel="match" href="text-spacing-trim-dot-001-ref.html"> +<style> +@font-face { + font-family: halt-font; + src: url('support/fonts/NotoSansCJKjp-Regular-subset-halt.otf'); +} +#container { + font-family: halt-font; + font-size: 20px; +} +</style> +<div id="container"> + <!-- Dot + Open/Close/Middle --> + <div>国。(国</div> + <div>国。)国</div> + <div>国。・国</div> + <div>国。 国</div> + <!-- Open/Close/Middle + Dot --> + <div>国(。国</div> + <div>国)。国</div> + <div>国・。国</div> + <div>国 。国</div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom/serialize-values-expected.txt b/third_party/blink/web_tests/external/wpt/css/cssom/serialize-values-expected.txt index 5cef133..bdf6c69 100644 --- a/third_party/blink/web_tests/external/wpt/css/cssom/serialize-values-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/cssom/serialize-values-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 687 tests; 664 PASS, 23 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 687 tests; 679 PASS, 8 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS background-attachment: scroll PASS background-attachment: fixed PASS background-attachment: inherit @@ -24,7 +24,7 @@ PASS background-position: 5% -1px PASS background-position: 5% -.1em PASS background-position: 5% top -FAIL background-position: 5% center assert_equals: background-position raw inline style declaration expected "5%" but got "5% center" +PASS background-position: 5% center PASS background-position: 5% bottom PASS background-position: .5% 5% PASS background-position: .5% .5% @@ -37,7 +37,7 @@ PASS background-position: .5% -1px PASS background-position: .5% -.1em PASS background-position: .5% top -FAIL background-position: .5% center assert_equals: background-position raw inline style declaration expected "0.5%" but got "0.5% center" +PASS background-position: .5% center PASS background-position: .5% bottom PASS background-position: -5% 5% PASS background-position: -5% .5% @@ -50,7 +50,7 @@ PASS background-position: -5% -1px PASS background-position: -5% -.1em PASS background-position: -5% top -FAIL background-position: -5% center assert_equals: background-position raw inline style declaration expected "-5%" but got "-5% center" +PASS background-position: -5% center PASS background-position: -5% bottom PASS background-position: -.5% 5% PASS background-position: -.5% .5% @@ -63,7 +63,7 @@ PASS background-position: -.5% -1px PASS background-position: -.5% -.1em PASS background-position: -.5% top -FAIL background-position: -.5% center assert_equals: background-position raw inline style declaration expected "-0.5%" but got "-0.5% center" +PASS background-position: -.5% center PASS background-position: -.5% bottom PASS background-position: 0px 5% PASS background-position: 0px .5% @@ -76,7 +76,7 @@ PASS background-position: 0px -1px PASS background-position: 0px -.1em PASS background-position: 0px top -FAIL background-position: 0px center assert_equals: background-position raw inline style declaration expected "0px" but got "0px center" +PASS background-position: 0px center PASS background-position: 0px bottom PASS background-position: 1px 5% PASS background-position: 1px .5% @@ -89,7 +89,7 @@ PASS background-position: 1px -1px PASS background-position: 1px -.1em PASS background-position: 1px top -FAIL background-position: 1px center assert_equals: background-position raw inline style declaration expected "1px" but got "1px center" +PASS background-position: 1px center PASS background-position: 1px bottom PASS background-position: .1em 5% PASS background-position: .1em .5% @@ -102,7 +102,7 @@ PASS background-position: .1em -1px PASS background-position: .1em -.1em PASS background-position: .1em top -FAIL background-position: .1em center assert_equals: background-position raw inline style declaration expected "0.1em" but got "0.1em center" +PASS background-position: .1em center PASS background-position: .1em bottom PASS background-position: -0px 5% PASS background-position: -0px .5% @@ -115,7 +115,7 @@ PASS background-position: -0px -1px PASS background-position: -0px -.1em PASS background-position: -0px top -FAIL background-position: -0px center assert_equals: background-position raw inline style declaration expected "0px" but got "0px center" +PASS background-position: -0px center PASS background-position: -0px bottom PASS background-position: -1px 5% PASS background-position: -1px .5% @@ -128,7 +128,7 @@ PASS background-position: -1px -1px PASS background-position: -1px -.1em PASS background-position: -1px top -FAIL background-position: -1px center assert_equals: background-position raw inline style declaration expected "-1px" but got "-1px center" +PASS background-position: -1px center PASS background-position: -1px bottom PASS background-position: -.1em 5% PASS background-position: -.1em .5% @@ -141,7 +141,7 @@ PASS background-position: -.1em -1px PASS background-position: -.1em -.1em PASS background-position: -.1em top -FAIL background-position: -.1em center assert_equals: background-position raw inline style declaration expected "-0.1em" but got "-0.1em center" +PASS background-position: -.1em center PASS background-position: -.1em bottom PASS background-position: left 5% PASS background-position: left .5% @@ -154,7 +154,7 @@ PASS background-position: left -1px PASS background-position: left -.1em PASS background-position: left top -FAIL background-position: left center assert_equals: background-position raw inline style declaration expected "left" but got "left center" +PASS background-position: left center PASS background-position: left bottom PASS background-position: center 5% PASS background-position: center .5% @@ -166,9 +166,9 @@ PASS background-position: center -0px PASS background-position: center -1px PASS background-position: center -.1em -FAIL background-position: center top assert_equals: background-position raw inline style declaration expected "top" but got "center top" -FAIL background-position: center center assert_equals: background-position raw inline style declaration expected "center" but got "center center" -FAIL background-position: center bottom assert_equals: background-position raw inline style declaration expected "bottom" but got "center bottom" +PASS background-position: center top +PASS background-position: center center +PASS background-position: center bottom PASS background-position: right 5% PASS background-position: right .5% PASS background-position: right -5% @@ -180,7 +180,7 @@ PASS background-position: right -1px PASS background-position: right -.1em PASS background-position: right top -FAIL background-position: right center assert_equals: background-position raw inline style declaration expected "right" but got "right center" +PASS background-position: right center PASS background-position: right bottom PASS background-position: inherit PASS background-repeat: repeat
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom/serialize-values.html b/third_party/blink/web_tests/external/wpt/css/cssom/serialize-values.html index 1482e711..2d20f263 100644 --- a/third_party/blink/web_tests/external/wpt/css/cssom/serialize-values.html +++ b/third_party/blink/web_tests/external/wpt/css/cssom/serialize-values.html
@@ -150,23 +150,7 @@ return null; } - // A more elegant way of doing this would be better, but for now this exception list handles cases where "center" must be omitted. var minimal_results = { - "background-position: 5% center": "5%", - "background-position: 0.5% center": "0.5%", - "background-position: -5% center": "-5%", - "background-position: -0.5% center": "-0.5%", - "background-position: 0px center": "0px", - "background-position: 1px center": "1px", - "background-position: 0.1em center": "0.1em", - "background-position: 0px center": "0px", - "background-position: -1px center": "-1px", - "background-position: -0.1em center": "-0.1em", - "background-position: left center": "left", - "background-position: center top": "top", - "background-position: center center": "center", - "background-position: center bottom": "bottom", - "background-position: right center": "right", }; function create_result(propertyName, actual, expected) {
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 f42d3075..e0ec8b2 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
@@ -76,11 +76,11 @@ - kyleju@google.com - pastithas@google.com - E-mail address: wpt.pr.bot@gmail.com - - smcgruer@google.com + - jamescscott@google.com - boaz@bocoup.com - mike@bocoup.com - [GitHub](https://github.com/): @wpt-pr-bot account - - smcgruer@google.com + - jamescscott@google.com - boaz@bocoup.com - mike@bocoup.com
diff --git a/third_party/blink/web_tests/external/wpt/fonts/CanvasTest-ascent256.ttf b/third_party/blink/web_tests/external/wpt/fonts/CanvasTest-ascent256.ttf index d5924fc..84ce51d 100644 --- a/third_party/blink/web_tests/external/wpt/fonts/CanvasTest-ascent256.ttf +++ b/third_party/blink/web_tests/external/wpt/fonts/CanvasTest-ascent256.ttf Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/fonts/CanvasTest-descent0.ttf b/third_party/blink/web_tests/external/wpt/fonts/CanvasTest-descent0.ttf index 5887c0de..b0291dcf 100644 --- a/third_party/blink/web_tests/external/wpt/fonts/CanvasTest-descent0.ttf +++ b/third_party/blink/web_tests/external/wpt/fonts/CanvasTest-descent0.ttf Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/fonts/CanvasTest.ttf b/third_party/blink/web_tests/external/wpt/fonts/CanvasTest.ttf index 9cdd0fa..6cdeccd 100644 --- a/third_party/blink/web_tests/external/wpt/fonts/CanvasTest.ttf +++ b/third_party/blink/web_tests/external/wpt/fonts/CanvasTest.ttf Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.exists.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.exists.html similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.exists.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.exists.html index a26bc40..1c44acb 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.exists.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.exists.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.getcontext.exists</title> +<title>Canvas test: 2d.canvas.context.exists</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.getcontext.exists</h1> +<h1>2d.canvas.context.exists</h1> <p class="desc">The 2D context is implemented</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.cache.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.extraargs.cache.html similarity index 92% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.cache.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.extraargs.cache.html index eb47929..f4db408 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.cache.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.extraargs.cache.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.getcontext.extraargs.cache</title> +<title>Canvas test: 2d.canvas.context.extraargs.cache</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.getcontext.extraargs.cache</h1> +<h1>2d.canvas.context.extraargs.cache</h1> <p class="desc">The 2D context doesn't throw with extra getContext arguments (cached)</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.create.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.extraargs.create.html similarity index 93% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.create.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.extraargs.create.html index 0683e45..6ae7f78 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.extraargs.create.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.extraargs.create.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.getcontext.extraargs.create</title> +<title>Canvas test: 2d.canvas.context.extraargs.create</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.getcontext.extraargs.create</h1> +<h1>2d.canvas.context.extraargs.create</h1> <p class="desc">The 2D context doesn't throw with extra getContext arguments (new context)</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.invalid.args.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.invalid.args.html similarity index 93% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.invalid.args.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.invalid.args.html index c3407d0..cfa58266 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.invalid.args.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.invalid.args.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.getcontext.invalid.args</title> +<title>Canvas test: 2d.canvas.context.invalid.args</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.getcontext.invalid.args</h1> +<h1>2d.canvas.context.invalid.args</h1> <p class="desc">Calling getContext with invalid arguments.</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.context.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.prototype.html similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.context.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.prototype.html index 51cf0a2..5d5edc686 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.context.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.prototype.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.canvas.context</title> +<title>Canvas test: 2d.canvas.context.prototype</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.canvas.context</h1> +<h1>2d.canvas.context.prototype</h1> <p class="desc">checks CanvasRenderingContext2D prototype</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.shared.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.shared.html similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.shared.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.shared.html index 54c1fd1..fd8dedd 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.shared.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.shared.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.getcontext.shared</title> +<title>Canvas test: 2d.canvas.context.shared</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.getcontext.shared</h1> +<h1>2d.canvas.context.shared</h1> <p class="desc">getContext('2d') returns objects which share canvas state</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.exists.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.exists.html similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.exists.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.exists.html index e2c09e6..d25f009 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.exists.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.exists.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.type.exists</title> +<title>Canvas test: 2d.canvas.context.type.exists</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.type.exists</h1> +<h1>2d.canvas.context.type.exists</h1> <p class="desc">The 2D context interface is a property of 'window'</p> <p class="notes">Defined in "Web IDL" (draft)
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.extend.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.extend.html similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.extend.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.extend.html index 151b40d..8d34d531 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.extend.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.extend.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.type.extend</title> +<title>Canvas test: 2d.canvas.context.type.extend</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.type.extend</h1> +<h1>2d.canvas.context.type.extend</h1> <p class="desc">Interface methods can be added</p> <p class="notes">Defined in "Web IDL" (draft)
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.prototype.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.prototype.html similarity index 94% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.prototype.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.prototype.html index 24ee5068..a537fe5 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.prototype.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.prototype.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.type.prototype</title> +<title>Canvas test: 2d.canvas.context.type.prototype</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.type.prototype</h1> +<h1>2d.canvas.context.type.prototype</h1> <p class="desc">window.CanvasRenderingContext2D.prototype are not [[Writable]] and not [[Configurable]], and its methods are [[Configurable]].</p> <p class="notes">Defined in "Web IDL" (draft)
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.replace.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.replace.html similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.replace.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.replace.html index aa0ec1cf..ac3c405 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.type.replace.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.type.replace.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.type.replace</title> +<title>Canvas test: 2d.canvas.context.type.replace</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.type.replace</h1> +<h1>2d.canvas.context.type.replace</h1> <p class="desc">Interface methods can be overridden</p> <p class="notes">Defined in "Web IDL" (draft)
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.unique.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.unique.html similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.unique.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.unique.html index c6e8980a20..c7b18038 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.getcontext.unique.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-context/2d.canvas.context.unique.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.getcontext.unique</title> +<title>Canvas test: 2d.canvas.context.unique</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.getcontext.unique</h1> +<h1>2d.canvas.context.unique</h1> <p class="desc">getContext('2d') returns the same object</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/initial.reset.2dstate.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.initial.reset.2dstate.html similarity index 96% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/initial.reset.2dstate.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.initial.reset.2dstate.html index a99cb5d3..e194001 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/initial.reset.2dstate.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.initial.reset.2dstate.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: initial.reset.2dstate</title> +<title>Canvas test: 2d.canvas.host.initial.reset.2dstate</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>initial.reset.2dstate</h1> +<h1>2d.canvas.host.initial.reset.2dstate</h1> <p class="desc">Resetting the canvas state resets 2D state variables</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.readonly.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.readonly.html similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.readonly.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.readonly.html index 4b9e6810..cbbf32f 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.readonly.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.readonly.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.canvas.readonly</title> +<title>Canvas test: 2d.canvas.host.readonly</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.canvas.readonly</h1> +<h1>2d.canvas.host.readonly</h1> <p class="desc">CanvasRenderingContext2D.canvas is readonly</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.reference.html similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.reference.html index 182a0170..6a4bdb65 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.reference.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.canvas.reference</title> +<title>Canvas test: 2d.canvas.host.reference</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.canvas.reference</h1> +<h1>2d.canvas.host.reference</h1> <p class="desc">CanvasRenderingContext2D.canvas refers back to its canvas</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.scaled-manual.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.scaled-manual.html similarity index 79% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.scaled-manual.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.scaled-manual.html index 28daf0b..acf3f9c7 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.scaled-manual.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.scaled-manual.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.scaled</title> +<title>Canvas test: 2d.canvas.host.scaled</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.scaled</h1> +<h1>2d.canvas.host.scaled</h1> <p class="desc">CSS-scaled canvases get drawn correctly</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="25" style="width: 100px; height: 50px"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="2d.scaled.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.scaled.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("CSS-scaled canvases get drawn correctly");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.scaled.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.scaled.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.scaled.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.scaled.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html index 613cf0e1..0de11e23 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.decimal</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.decimal</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.decimal</h1> +<h1>2d.canvas.host.size.attributes.parse.decimal</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="100.999" height="100.999"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.decimal.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.decimal.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.decimal.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.decimal.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.decimal.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.em.html similarity index 81% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.em.html index 21d9e6a..315c8323 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.em.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.em</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.em</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.em</h1> +<h1>2d.canvas.host.size.attributes.parse.em</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="100em" height="100em"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.em.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.em.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.em.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.em.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.em.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.empty.html similarity index 77% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.empty.html index 7198ccd..b9568712 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.empty.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.empty</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.empty</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.empty</h1> +<h1>2d.canvas.host.size.attributes.parse.empty</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="" height=""><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.empty.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.empty.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.empty.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.empty.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.empty.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.exp.html similarity index 81% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.exp.html index c609939..208ddec 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.exp.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.exp</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.exp</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.exp</h1> +<h1>2d.canvas.host.size.attributes.parse.exp</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="100e1" height="100e1"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.exp.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.exp.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.exp.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.exp.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.exp.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.hex.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.hex.html similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.hex.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.hex.html index a00bb3c..05f7030d4 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.hex.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.hex.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.hex</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.hex</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.hex</h1> +<h1>2d.canvas.host.size.attributes.parse.hex</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.junk.html similarity index 78% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.junk.html index 7b4f837..3a55fd1 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.junk.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.junk</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.junk</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.junk</h1> +<h1>2d.canvas.host.size.attributes.parse.junk</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="#!?" height="#!?"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.junk.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.junk.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.junk.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.junk.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.junk.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.minus.html similarity index 78% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.minus.html index 6d6560b..da5f21a 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.minus.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.minus</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.minus</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.minus</h1> +<h1>2d.canvas.host.size.attributes.parse.minus</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="-100" height="-100"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.minus.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.minus.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.minus.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.minus.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.minus.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.octal.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.octal.html index e1f42ea..ccc7efaa 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.octal.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.octal</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.octal</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.octal</h1> +<h1>2d.canvas.host.size.attributes.parse.octal</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="0100" height="0100"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.octal.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.octal.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.octal.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.octal.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.octal.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html similarity index 77% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html index 20721dcc..da14fa2 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.onlyspace</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.onlyspace</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.onlyspace</h1> +<h1>2d.canvas.host.size.attributes.parse.onlyspace</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width=" " height=" "><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.onlyspace.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.onlyspace.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.onlyspace.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.percent.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.percent.html index 860703c..d699288f 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.percent.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.percent</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.percent</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.percent</h1> +<h1>2d.canvas.host.size.attributes.parse.percent</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="100%" height="100%"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.percent.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.percent.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.percent.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.percent.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.percent.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.plus.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.plus.html index 2b600941..58fb07f 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.plus.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.plus</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.plus</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.plus</h1> +<h1>2d.canvas.host.size.attributes.parse.plus</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="+100" height="+100"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.plus.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.plus.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.plus.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.plus.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.plus.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.space.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.space.html index 34cae4d4..52fadaad 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.space.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.space</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.space</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.space</h1> +<h1>2d.canvas.host.size.attributes.parse.space</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width=" 100" height=" 100"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.space.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.space.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.space.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.space.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.space.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html similarity index 79% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html index e2b92ee..b18167c 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.trailingjunk</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.trailingjunk</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.trailingjunk</h1> +<h1>2d.canvas.host.size.attributes.parse.trailingjunk</h1> <p class="desc">Parsing of non-negative integers</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="100#!?" height="100#!?"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.trailingjunk.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.trailingjunk.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.trailingjunk.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html index c7a76f9..79e81c1 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.whitespace</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.whitespace</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.whitespace</h1> +<h1>2d.canvas.host.size.attributes.parse.whitespace</h1> <p class="desc">Parsing of non-negative integers</p> @@ -15,7 +15,7 @@ <canvas id="c" class="output" width="
 100" height="
 100"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.whitespace.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.parse.whitespace.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.zero.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.zero.html similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.zero.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.zero.html index 0f7a0415..b7fd499 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.zero.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.zero.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.parse.zero</title> +<title>Canvas test: 2d.canvas.host.size.attributes.parse.zero</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.parse.zero</h1> +<h1>2d.canvas.host.size.attributes.parse.zero</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.decimal.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.decimal.html index 9f0b4b1d..b6c2130b 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.decimal.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.decimal</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.decimal</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.decimal</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.decimal</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.decimal.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.decimal.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.decimal.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.decimal.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.decimal.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.em.html similarity index 81% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.em.html index df0eee7..f70713f 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.em.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.em</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.em</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.em</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.em</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.em.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.em.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.em.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.em.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.em.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.empty.html similarity index 78% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.empty.html index 37e02142..fab2394f 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.empty.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.empty</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.empty</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.empty</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.empty</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.empty.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.empty.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.empty.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.empty.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.empty.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.exp.html similarity index 81% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.exp.html index 943b98b..cfa11eb 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.exp.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.exp</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.exp</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.exp</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.exp</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.exp.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.exp.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.exp.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.exp.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.exp.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.hex.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.hex.html similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.hex.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.hex.html index a73ff5ec..80a1fbd 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.hex.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.hex.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.hex</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.hex</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.hex</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.hex</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.junk.html similarity index 78% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.junk.html index 607892d..b583871 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.junk.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.junk</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.junk</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.junk</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.junk</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.junk.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.junk.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.junk.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.junk.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.junk.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.minus.html similarity index 78% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.minus.html index 4fd49e5..90a31403 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.minus.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.minus</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.minus</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.minus</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.minus</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.minus.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.minus.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.minus.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.minus.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.minus.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.octal.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.octal.html index d841413..c5b263bd5 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.octal.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.octal</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.octal</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.octal</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.octal</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.octal.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.octal.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.octal.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.octal.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.octal.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.onlyspace.html similarity index 77% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.onlyspace.html index 7959c30..ac4cdb0 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.onlyspace.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.onlyspace</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.onlyspace</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.onlyspace</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.onlyspace</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.onlyspace.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.onlyspace.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.onlyspace.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.onlyspace.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.onlyspace.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.percent.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.percent.html index 6fed0cda..5aebf5a 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.percent.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.percent</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.percent</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.percent</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.percent</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.percent.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.percent.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.percent.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.percent.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.percent.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.plus.html similarity index 81% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.plus.html index 4be39bf1..60da44da 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.plus.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.plus</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.plus</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.plus</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.plus</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.plus.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.plus.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.plus.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.plus.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.plus.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.space.html similarity index 81% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.space.html index 3cc0078..fbfd4c33 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.space.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.space</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.space</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.space</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.space</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.space.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.space.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.space.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.space.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.space.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.trailingjunk.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.trailingjunk.html index 4c9b7ce..1d230bd 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.trailingjunk.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.trailingjunk</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.trailingjunk</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.trailingjunk</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.trailingjunk</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.trailingjunk.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.trailingjunk.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.trailingjunk.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.trailingjunk.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.trailingjunk.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.whitespace.html similarity index 80% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.whitespace.html index 8f6ecc9..1aa86d6 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.whitespace.html
@@ -1,19 +1,19 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.whitespace</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.whitespace</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.whitespace</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.whitespace</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p> <p class="output">Actual output:</p> <canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> -<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.whitespace.png" class="output expected" id="expected" alt=""> +<p class="output expectedtext">Expected output:<p><img src="2d.canvas.host.size.attributes.setAttribute.whitespace.png" class="output expected" id="expected" alt=""> <ul id="d"></ul> <script> var t = async_test("Parsing of non-negative integers in setAttribute");
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.png b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.whitespace.png similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.whitespace.png rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.whitespace.png Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.zero.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.zero.html similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.zero.html rename to third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.zero.html index 2bbad823..64b4811 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.setAttribute.zero.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/canvas-host/2d.canvas.host.size.attributes.setAttribute.zero.html
@@ -1,13 +1,13 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: size.attributes.setAttribute.zero</title> +<title>Canvas test: 2d.canvas.host.size.attributes.setAttribute.zero</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>size.attributes.setAttribute.zero</h1> +<h1>2d.canvas.host.size.attributes.setAttribute.zero</h1> <p class="desc">Parsing of non-negative integers in setAttribute</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html b/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.setFont.mathFont.html similarity index 65% copy from third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html copy to third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.setFont.mathFont.html index 182a0170..370104f1 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/2d.canvas.reference.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/element/text/2d.text.setFont.mathFont.html
@@ -1,14 +1,14 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>Canvas test: 2d.canvas.reference</title> +<title>Canvas test: 2d.text.setFont.mathFont</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> <link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css"> <body class="show_output"> -<h1>2d.canvas.reference</h1> -<p class="desc">CanvasRenderingContext2D.canvas refers back to its canvas</p> +<h1>2d.text.setFont.mathFont</h1> +<p class="desc">crbug.com/1212190, make sure offscreencanvas doesn't crash with Math Font</p> <p class="output">Actual output:</p> @@ -16,10 +16,10 @@ <ul id="d"></ul> <script> -var t = async_test("CanvasRenderingContext2D.canvas refers back to its canvas"); +var t = async_test("crbug.com/1212190, make sure offscreencanvas doesn't crash with Math Font"); _addTest(function(canvas, ctx) { - _assertSame(ctx.canvas, canvas, "ctx.canvas", "canvas"); + ctx.font = "math serif"; }); </script>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.arguments.missing.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.arguments.missing.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.html index 4d5478e8..0c9fdc9 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.arguments.missing.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: context.arguments.missing</title> +<title>OffscreenCanvas test: 2d.canvas.context.arguments.missing</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>context.arguments.missing</h1> +<h1>2d.canvas.context.arguments.missing</h1> <p class="desc"></p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.arguments.missing.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.worker.js similarity index 88% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.arguments.missing.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.worker.js index f20db3ad..1b5c857a7 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.arguments.missing.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:context.arguments.missing +// OffscreenCanvas test in a worker:2d.canvas.context.arguments.missing // Description: // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.casesensitive.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.html similarity index 87% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.casesensitive.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.html index 6183607..aed71a3 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.casesensitive.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: context.casesensitive</title> +<title>OffscreenCanvas test: 2d.canvas.context.casesensitive</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>context.casesensitive</h1> +<h1>2d.canvas.context.casesensitive</h1> <p class="desc">Context name "2D" is unrecognised; matching is case sensitive</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.casesensitive.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.worker.js similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.casesensitive.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.worker.js index a834a3e..c1df3a9 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.casesensitive.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:context.casesensitive +// OffscreenCanvas test in a worker:2d.canvas.context.casesensitive // Description:Context name "2D" is unrecognised; matching is case sensitive // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.emptystring.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.html similarity index 87% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.emptystring.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.html index b898698..10548a6 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.emptystring.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: context.emptystring</title> +<title>OffscreenCanvas test: 2d.canvas.context.emptystring</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>context.emptystring</h1> +<h1>2d.canvas.context.emptystring</h1> <p class="desc">getContext with empty string returns null</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.emptystring.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.worker.js similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.emptystring.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.worker.js index df7d06df..53a58c1 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.emptystring.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:context.emptystring +// OffscreenCanvas test in a worker:2d.canvas.context.emptystring // Description:getContext with empty string returns null // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.exists.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.html similarity index 88% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.exists.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.html index 73fc45c..41b5cfe 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.exists.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: 2d.getcontext.exists</title> +<title>OffscreenCanvas test: 2d.canvas.context.exists</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>2d.getcontext.exists</h1> +<h1>2d.canvas.context.exists</h1> <p class="desc">The 2D context is implemented</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.exists.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.worker.js similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.exists.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.worker.js index 0ed6f2424..77a4353 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.exists.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.getcontext.exists +// OffscreenCanvas test in a worker:2d.canvas.context.exists // Description:The 2D context is implemented // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.html similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.html index 2f57050a..2bcf344 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: 2d.getcontext.extraargs.cache</title> +<title>OffscreenCanvas test: 2d.canvas.context.extraargs.cache</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>2d.getcontext.extraargs.cache</h1> +<h1>2d.canvas.context.extraargs.cache</h1> <p class="desc">The 2D context doesn't throw with extra getContext arguments (cached)</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.worker.js similarity index 94% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.worker.js index 8854051..14284a0a 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.cache.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.getcontext.extraargs.cache +// OffscreenCanvas test in a worker:2d.canvas.context.extraargs.cache // Description:The 2D context doesn't throw with extra getContext arguments (cached) // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.html similarity index 93% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.html index a2869c4..0291223 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: 2d.getcontext.extraargs.create</title> +<title>OffscreenCanvas test: 2d.canvas.context.extraargs.create</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>2d.getcontext.extraargs.create</h1> +<h1>2d.canvas.context.extraargs.create</h1> <p class="desc">The 2D context doesn't throw with extra getContext arguments (new context)</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.worker.js similarity index 95% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.worker.js index 21d4f8ce..b4208edb 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs.create.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.getcontext.extraargs.create +// OffscreenCanvas test in a worker:2d.canvas.context.extraargs.create // Description:The 2D context doesn't throw with extra getContext arguments (new context) // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.shared.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.html similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.shared.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.html index c37664f..cb95017 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.shared.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: 2d.getcontext.shared</title> +<title>OffscreenCanvas test: 2d.canvas.context.shared</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>2d.getcontext.shared</h1> +<h1>2d.canvas.context.shared</h1> <p class="desc">getContext('2d') returns objects which share canvas state</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.shared.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.worker.js similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.shared.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.worker.js index 936ca03..8e53475 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.shared.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.getcontext.shared +// OffscreenCanvas test in a worker:2d.canvas.context.shared // Description:getContext('2d') returns objects which share canvas state // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.unique.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.html similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.unique.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.html index 945526c5..66e4a049 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.unique.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: 2d.getcontext.unique</title> +<title>OffscreenCanvas test: 2d.canvas.context.unique</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>2d.getcontext.unique</h1> +<h1>2d.canvas.context.unique</h1> <p class="desc">getContext('2d') returns the same object</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.unique.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.worker.js similarity index 92% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.unique.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.worker.js index fbf8e3c..275e45f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.unique.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.getcontext.unique +// OffscreenCanvas test in a worker:2d.canvas.context.unique // Description:getContext('2d') returns the same object // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badname.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.html similarity index 86% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badname.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.html index 5460fe1..4313f40 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badname.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: context.unrecognised.badname</title> +<title>OffscreenCanvas test: 2d.canvas.context.unrecognised.badname</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>context.unrecognised.badname</h1> +<h1>2d.canvas.context.unrecognised.badname</h1> <p class="desc">getContext with unrecognised context name returns null</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badname.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.worker.js similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badname.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.worker.js index 8dfee54..dd16f2f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badname.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:context.unrecognised.badname +// OffscreenCanvas test in a worker:2d.canvas.context.unrecognised.badname // Description:getContext with unrecognised context name returns null // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badsuffix.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badsuffix.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.html index 72624be..c00afa6 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badsuffix.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: context.unrecognised.badsuffix</title> +<title>OffscreenCanvas test: 2d.canvas.context.unrecognised.badsuffix</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>context.unrecognised.badsuffix</h1> +<h1>2d.canvas.context.unrecognised.badsuffix</h1> <p class="desc">Context name "2d" plus a suffix is unrecognised</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badsuffix.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badsuffix.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.worker.js index 6cfcbc3..5e684c9 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.badsuffix.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:context.unrecognised.badsuffix +// OffscreenCanvas test in a worker:2d.canvas.context.unrecognised.badsuffix // Description:Context name "2d" plus a suffix is unrecognised // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.nullsuffix.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.nullsuffix.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.html index f36f7583..0ce3d4195 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.nullsuffix.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: context.unrecognised.nullsuffix</title> +<title>OffscreenCanvas test: 2d.canvas.context.unrecognised.nullsuffix</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>context.unrecognised.nullsuffix</h1> +<h1>2d.canvas.context.unrecognised.nullsuffix</h1> <p class="desc">Context name "2d" plus a "\0" suffix is unrecognised</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.nullsuffix.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.nullsuffix.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.worker.js index d9b563db..2886010 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.nullsuffix.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:context.unrecognised.nullsuffix +// OffscreenCanvas test in a worker:2d.canvas.context.unrecognised.nullsuffix // Description:Context name "2d" plus a "\0" suffix is unrecognised // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.unicode.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.html similarity index 86% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.unicode.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.html index f8176f5..31612367 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.unicode.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: context.unrecognised.unicode</title> +<title>OffscreenCanvas test: 2d.canvas.context.unrecognised.unicode</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>context.unrecognised.unicode</h1> +<h1>2d.canvas.context.unrecognised.unicode</h1> <p class="desc">Context name which kind of looks like "2d" is unrecognised</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.unicode.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.worker.js similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.unicode.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.worker.js index 2d02a79..46e562dd 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/context.unrecognised.unicode.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:context.unrecognised.unicode +// OffscreenCanvas test in a worker:2d.canvas.context.unrecognised.unicode // Description:Context name which kind of looks like "2d" is unrecognised // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.getContext.options.any.js similarity index 100% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d-getcontext-options.any.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.getContext.options.any.js
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.color.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.color.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html index d89b01df..0793c74f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.color.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: initial.color</title> +<title>OffscreenCanvas test: 2d.canvas.host.initial.color</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>initial.color</h1> +<h1>2d.canvas.host.initial.color</h1> <p class="desc">Initial state is transparent black</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.color.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.color.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js index c9705727..11d6b9f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.color.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:initial.color +// OffscreenCanvas test in a worker:2d.canvas.host.initial.color // Description:Initial state is transparent black // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.2dstate.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html similarity index 95% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.2dstate.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html index 55954fc..36230da 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.2dstate.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: initial.reset.2dstate</title> +<title>OffscreenCanvas test: 2d.canvas.host.initial.reset.2dstate</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>initial.reset.2dstate</h1> +<h1>2d.canvas.host.initial.reset.2dstate</h1> <p class="desc">Resetting the canvas state resets 2D state variables</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.2dstate.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js similarity index 96% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.2dstate.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js index dc0d6ea..df0bd9f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.2dstate.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:initial.reset.2dstate +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.2dstate // Description:Resetting the canvas state resets 2D state variables // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.clip.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html similarity index 87% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.clip.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html index 9b1354bd..fc53240 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.clip.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: initial.reset.clip</title> +<title>OffscreenCanvas test: 2d.canvas.host.initial.reset.clip</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>initial.reset.clip</h1> +<h1>2d.canvas.host.initial.reset.clip</h1> <p class="desc">Resetting the canvas state resets the current clip region</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.clip.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.clip.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js index d774aad6..80554b0a 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.clip.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:initial.reset.clip +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.clip // Description:Resetting the canvas state resets the current clip region // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.different.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html similarity index 86% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.different.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html index a5c891ff..3771a5e3 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.different.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: initial.reset.different</title> +<title>OffscreenCanvas test: 2d.canvas.host.initial.reset.different</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>initial.reset.different</h1> +<h1>2d.canvas.host.initial.reset.different</h1> <p class="desc">Changing size resets canvas to transparent black</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.different.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.different.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js index dc8f4bd..6074d4f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.different.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:initial.reset.different +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.different // Description:Changing size resets canvas to transparent black // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.gradient.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html similarity index 88% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.gradient.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html index 8b734d19..387b4d1f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.gradient.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: initial.reset.gradient</title> +<title>OffscreenCanvas test: 2d.canvas.host.initial.reset.gradient</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>initial.reset.gradient</h1> +<h1>2d.canvas.host.initial.reset.gradient</h1> <p class="desc">Resetting the canvas state does not invalidate any existing gradients</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.gradient.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.gradient.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js index dabc013..9029b48 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.gradient.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:initial.reset.gradient +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.gradient // Description:Resetting the canvas state does not invalidate any existing gradients // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.path.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html similarity index 87% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.path.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html index 24b7ff22..3a887a8 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.path.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: initial.reset.path</title> +<title>OffscreenCanvas test: 2d.canvas.host.initial.reset.path</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>initial.reset.path</h1> +<h1>2d.canvas.host.initial.reset.path</h1> <p class="desc">Resetting the canvas state resets the current path</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.path.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.path.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js index 65352324..0ab12872 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.path.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:initial.reset.path +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.path // Description:Resetting the canvas state resets the current path // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.pattern.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html similarity index 88% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.pattern.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html index 2742d8f..d822f909 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.pattern.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: initial.reset.pattern</title> +<title>OffscreenCanvas test: 2d.canvas.host.initial.reset.pattern</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>initial.reset.pattern</h1> +<h1>2d.canvas.host.initial.reset.pattern</h1> <p class="desc">Resetting the canvas state does not invalidate any existing patterns</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.pattern.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js similarity index 92% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.pattern.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js index a69f36e..c4870a6 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.pattern.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:initial.reset.pattern +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.pattern // Description:Resetting the canvas state does not invalidate any existing patterns // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html similarity index 88% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html index 137dcbd5..19394de 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: initial.reset.same</title> +<title>OffscreenCanvas test: 2d.canvas.host.initial.reset.same</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>initial.reset.same</h1> +<h1>2d.canvas.host.initial.reset.same</h1> <p class="desc">Setting size (not changing the value) resets canvas to transparent black</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js index fd3c464..48d24750 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:initial.reset.same +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.same // Description:Setting size (not changing the value) resets canvas to transparent black // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.transform.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html similarity index 86% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.transform.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html index d09f8f92..ee3b5ab 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.transform.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: initial.reset.transform</title> +<title>OffscreenCanvas test: 2d.canvas.host.initial.reset.transform</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>initial.reset.transform</h1> +<h1>2d.canvas.host.initial.reset.transform</h1> <p class="desc">Resetting the canvas state resets the current transformation matrix</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.transform.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.transform.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js index 564a3bd..218e64f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/initial.reset.transform.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:initial.reset.transform +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.transform // Description:Resetting the canvas state resets the current transformation matrix // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.readonly.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.readonly.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html index 6bc6eef..0e7e10c 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.readonly.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: 2d.canvas.readonly</title> +<title>OffscreenCanvas test: 2d.canvas.host.readonly</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>2d.canvas.readonly</h1> +<h1>2d.canvas.host.readonly</h1> <p class="desc">canvas is readonly</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.readonly.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.readonly.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js index 068c2c2..bbe50dc 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.readonly.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.canvas.readonly +// OffscreenCanvas test in a worker:2d.canvas.host.readonly // Description:canvas is readonly // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.reference.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html similarity index 87% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.reference.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html index c43afd8..b5de73f40 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.reference.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: 2d.canvas.reference</title> +<title>OffscreenCanvas test: 2d.canvas.host.reference</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>2d.canvas.reference</h1> +<h1>2d.canvas.host.reference</h1> <p class="desc">canvas refers back to its canvas</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.reference.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js similarity index 90% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.reference.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js index a1578af..7a1f0c5 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.canvas.reference.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:2d.canvas.reference +// OffscreenCanvas test in a worker:2d.canvas.host.reference // Description:canvas refers back to its canvas // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.default.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.default.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html index 52ddf11..dc7b894b 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.default.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.default</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.default</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.default</h1> +<h1>2d.canvas.host.size.attributes.default</h1> <p class="desc">Default width/height when attributes are missing</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.default.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.default.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js index 83e0271f..78fce5a 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.default.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.default +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.default // Description:Default width/height when attributes are missing // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html similarity index 91% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html index a815a7be..7030103 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.idl</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.idl</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.idl</h1> +<h1>2d.canvas.host.size.attributes.idl</h1> <p class="desc">Getting/setting width/height IDL attributes</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.set.zero.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.set.zero.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html index 5a069f3c..347c460 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.set.zero.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.idl.set.zero</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.idl.set.zero</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.idl.set.zero</h1> +<h1>2d.canvas.host.size.attributes.idl.set.zero</h1> <p class="desc">Setting width/height IDL attributes to 0</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.set.zero.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.set.zero.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js index d51258a..21535da 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.set.zero.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.idl.set.zero +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.idl.set.zero // Description:Setting width/height IDL attributes to 0 // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js similarity index 94% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js index 931b95c..a00201f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.idl.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.idl +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.idl // Description:Getting/setting width/height IDL attributes // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.decimal.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html similarity index 84% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.decimal.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html index 688d80b..c3fa3b4 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.decimal.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.decimal</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.decimal</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.decimal</h1> +<h1>2d.canvas.host.size.attributes.parse.decimal</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.decimal.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.decimal.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js index 157bd61..1267bb2 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.decimal.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.decimal +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.decimal // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.em.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html similarity index 84% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.em.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html index 2e5056a..ea6f811 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.em.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.em</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.em</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.em</h1> +<h1>2d.canvas.host.size.attributes.parse.em</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.em.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js similarity index 88% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.em.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js index b939765..2f0642d9 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.em.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.em +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.em // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.empty.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.empty.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html index 7755f9d..d38c159a 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.empty.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.empty</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.empty</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.empty</h1> +<h1>2d.canvas.host.size.attributes.parse.empty</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.empty.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.empty.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js index 72fcd9f6..b1eee3a5 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.empty.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.empty +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.empty // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.exp.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.exp.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html index 0a2f012..2aa8245 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.exp.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.exp</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.exp</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.exp</h1> +<h1>2d.canvas.host.size.attributes.parse.exp</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.exp.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.exp.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js index 0b7d5f2..8c8b4cc7 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.exp.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.exp +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.exp // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.hex.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.hex.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html index 5a899018..4b0e47b 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.hex.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.hex</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.hex</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.hex</h1> +<h1>2d.canvas.host.size.attributes.parse.hex</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.hex.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.hex.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js index 1edd0ed..b685aaf 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.hex.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.hex +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.hex // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.junk.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html similarity index 83% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.junk.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html index 10d2e20..a619651f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.junk.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.junk</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.junk</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.junk</h1> +<h1>2d.canvas.host.size.attributes.parse.junk</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.junk.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js similarity index 87% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.junk.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js index c7e18d1..f4822f4 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.junk.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.junk +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.junk // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.minus.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html similarity index 83% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.minus.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html index 2a7d5d12..c7f12fd 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.minus.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.minus</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.minus</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.minus</h1> +<h1>2d.canvas.host.size.attributes.parse.minus</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.minus.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js similarity index 87% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.minus.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js index 9680f907..322b992e 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.minus.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.minus +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.minus // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.octal.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.octal.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html index 3d9c2fb..7bfb7658 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.octal.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.octal</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.octal</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.octal</h1> +<h1>2d.canvas.host.size.attributes.parse.octal</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.octal.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.octal.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js index 2925361..ce518e35 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.octal.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.octal +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.octal // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.onlyspace.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html similarity index 84% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.onlyspace.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html index 821de43..16dace1 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.onlyspace.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.onlyspace</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.onlyspace</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.onlyspace</h1> +<h1>2d.canvas.host.size.attributes.parse.onlyspace</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.onlyspace.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js similarity index 88% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.onlyspace.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js index e5fadf13..c186a4c 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.onlyspace.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.onlyspace +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.onlyspace // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.percent.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html similarity index 83% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.percent.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html index 58748103..040a775 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.percent.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.percent</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.percent</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.percent</h1> +<h1>2d.canvas.host.size.attributes.parse.percent</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.percent.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js similarity index 87% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.percent.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js index acbd2a1..f38a186 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.percent.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.percent +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.percent // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.plus.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.plus.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html index 4555829..50c8467e 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.plus.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.plus</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.plus</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.plus</h1> +<h1>2d.canvas.host.size.attributes.parse.plus</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.plus.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.plus.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js index ecf6797..bb45a1e4 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.plus.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.plus +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.plus // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.space.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.space.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html index b0d63a4..cb1f3ae8 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.space.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.space</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.space</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.space</h1> +<h1>2d.canvas.host.size.attributes.parse.space</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.space.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.space.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js index 11ac398..967a0939 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.space.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.space +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.space // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.trailingjunk.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html similarity index 82% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.trailingjunk.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html index 536ea90..8d8d481 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.trailingjunk.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.trailingjunk</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.trailingjunk</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.trailingjunk</h1> +<h1>2d.canvas.host.size.attributes.parse.trailingjunk</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.trailingjunk.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js similarity index 86% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.trailingjunk.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js index 1d1c5e7f..ffebcd97 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.trailingjunk.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.trailingjunk +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.trailingjunk // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.whitespace.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html similarity index 84% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.whitespace.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html index 53a3a2e..f6e29d6 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.whitespace.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.whitespace</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.whitespace</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.whitespace</h1> +<h1>2d.canvas.host.size.attributes.parse.whitespace</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.whitespace.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js similarity index 88% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.whitespace.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js index 26296e1..fb7ba47 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.whitespace.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.whitespace +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.whitespace // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.zero.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.zero.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html index 1af0d2a..07e924a 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.zero.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.parse.zero</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.zero</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.parse.zero</h1> +<h1>2d.canvas.host.size.attributes.parse.zero</h1> <p class="desc">Parsing of non-negative integers</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.zero.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.zero.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js index 5348bf6..1363bff 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.parse.zero.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.parse.zero +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.zero // Description:Parsing of non-negative integers // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidl.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html similarity index 85% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidl.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html index 997bf97..d24b2cc 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidl.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.reflect.setidl</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.reflect.setidl</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.reflect.setidl</h1> +<h1>2d.canvas.host.size.attributes.reflect.setidl</h1> <p class="desc">Setting IDL attributes updates IDL and content attributes</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidl.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidl.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js index 9555f66..3b3ced12 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidl.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.reflect.setidl +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.reflect.setidl // Description:Setting IDL attributes updates IDL and content attributes // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidlzero.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html similarity index 84% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidlzero.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html index 50e9096f..c4839afb 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidlzero.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.attributes.reflect.setidlzero</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.attributes.reflect.setidlzero</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.attributes.reflect.setidlzero</h1> +<h1>2d.canvas.host.size.attributes.reflect.setidlzero</h1> <p class="desc">Setting IDL attributes to 0 updates IDL and content attributes</p>
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidlzero.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidlzero.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js index e412b7a..d440a9d8 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.attributes.reflect.setidlzero.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.attributes.reflect.setidlzero +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.reflect.setidlzero // Description:Setting IDL attributes to 0 updates IDL and content attributes // Note:
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.large.html b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html similarity index 89% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.large.html rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html index 46b8a05..b220f8f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.large.html +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html
@@ -1,11 +1,11 @@ <!DOCTYPE html> <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> -<title>OffscreenCanvas test: size.large</title> +<title>OffscreenCanvas test: 2d.canvas.host.size.large</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/html/canvas/resources/canvas-tests.js"></script> -<h1>size.large</h1> +<h1>2d.canvas.host.size.large</h1> <p class="desc"></p> <p class="notes">Not sure how reasonable this is, but the spec doesn't say there's an upper limit on the size.
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.large.worker.js b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js similarity index 92% rename from third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.large.worker.js rename to third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js index 6a5bb5e..a7637041 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/size.large.worker.js +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js
@@ -1,5 +1,5 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -// OffscreenCanvas test in a worker:size.large +// OffscreenCanvas test in a worker:2d.canvas.host.size.large // Description: // Note:<p class="notes">Not sure how reasonable this is, but the spec doesn't say there's an upper limit on the size.
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/tools/gentest_union.py b/third_party/blink/web_tests/external/wpt/html/canvas/tools/gentest_union.py index bde7c1b..38a37a8 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/tools/gentest_union.py +++ b/third_party/blink/web_tests/external/wpt/html/canvas/tools/gentest_union.py
@@ -1,3 +1,3 @@ from gentestutilsunion import genTestUtils_union -genTestUtils_union('name2dir-canvas.yaml') +genTestUtils_union('name2dir.yaml')
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir-canvas.yaml b/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir-canvas.yaml index 2ad5197d..1e0caff 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir-canvas.yaml +++ b/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir-canvas.yaml
@@ -22,20 +22,5 @@ 2d.state: "the-canvas-state" 2d.scrollPathIntoView: "scroll" 2d.video: "video" -2d.canvas: "../../../html/semantics/embedded-content/the-canvas-element" -2d.getcontext: "../../../html/semantics/embedded-content/the-canvas-element" -2d.scaled: "../../../html/semantics/embedded-content/the-canvas-element" -2d.type: "../../../html/semantics/embedded-content/the-canvas-element" -context: "../../../html/semantics/embedded-content/the-canvas-element" -fallback: "../../../html/semantics/embedded-content/the-canvas-element" -initial: "../../../html/semantics/embedded-content/the-canvas-element" -security: "../../../html/semantics/embedded-content/the-canvas-element" -size: "../../../html/semantics/embedded-content/the-canvas-element" -toBlob: "../../../html/semantics/embedded-content/the-canvas-element" -toDataURL: "../../../html/semantics/embedded-content/the-canvas-element" -type: "../../../html/semantics/embedded-content/the-canvas-element" -2d.offscreencanvas: "the-offscreen-canvas" -2d.offscreencanva.getcontext: "the-offscreen-canvas" -2d.offscreencanva.context: "the-offscreen-canvas" -2d.offscreencanva.initial: "the-offscreen-canvas" -2d.offscreencanva.size: "the-offscreen-canvas" +2d.canvas.host: "canvas-host" +2d.canvas.context: "canvas-context"
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir-offscreen.yaml b/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir-offscreen.yaml index 807b095..c52acb7 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir-offscreen.yaml +++ b/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir-offscreen.yaml
@@ -18,8 +18,5 @@ 2d.coordinatespace: "conformance-requirements" 2d.missingargs: "conformance-requirements" 2d.voidreturn: "conformance-requirements" -2d.canvas: "the-offscreen-canvas" -2d.getcontext: "the-offscreen-canvas" -context: "the-offscreen-canvas" -initial: "the-offscreen-canvas" -size: "the-offscreen-canvas" +2d.canvas.host: "canvas-host" +2d.canvas.context: "canvas-context" \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir.yaml b/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir.yaml index a56fc2f..ae69c15 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir.yaml +++ b/third_party/blink/web_tests/external/wpt/html/canvas/tools/name2dir.yaml
@@ -21,10 +21,5 @@ 2d.state: "the-canvas-state" 2d.scrollPathIntoView: "scroll" 2d.video: "video" -2d.canvas: "../../../html/semantics/embedded-content/the-canvas-element" -2d.canvas.getcontext: "../../../html/semantics/embedded-content/the-canvas-element" -2d.canvas.scaled: "../../../html/semantics/embedded-content/the-canvas-element" -2d.canvas.type: "../../../html/semantics/embedded-content/the-canvas-element" -2d.canvas.initial: "../../../html/semantics/embedded-content/the-canvas-element" -2d.canvas.size: "../../../html/semantics/embedded-content/the-canvas-element" -2d.canvas.type: "../../../html/semantics/embedded-content/the-canvas-element" +2d.canvas.host: "canvas-host" +2d.canvas.context: "canvas-context"
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml-new/text.yaml b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml-new/text.yaml index 9242b2e..8bbc874 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml-new/text.yaml +++ b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml-new/text.yaml
@@ -1672,4 +1672,9 @@ ctx.font = "32px serif"; ctx.fillText("Hello World", 20, 100); +- name: 2d.text.setFont.mathFont + desc: crbug.com/1212190, make sure offscreencanvas doesn't crash with Math Font + code: | + ctx.font = "math serif"; + # TODO: shadows, alpha, composite, clip \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/element/meta.yaml b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/element/meta.yaml index 7b6f28f..5fd8b684 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/element/meta.yaml +++ b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/element/meta.yaml
@@ -42,7 +42,7 @@ # We need to replace \r with 
 because \r\n gets converted to \n in the HTML parser. htmlString = string.replace('\r', '
') tests.append( { - "name": "size.attributes.parse.%s" % name, + "name": "2d.canvas.host.size.attributes.parse.%s" % name, "desc": "Parsing of non-negative integers", "size": '%s, %s' % (htmlString, htmlString), "code": code, @@ -53,7 +53,7 @@ code = "canvas.setAttribute('width', %r);\ncanvas.setAttribute('height', %r);\n" % (string, string) code, expected = gen(name, string, exp, code) tests.append( { - "name": "size.attributes.setAttribute.%s" % name, + "name": "2d.canvas.host.size.attributes.setAttribute.%s" % name, "desc": "Parsing of non-negative integers in setAttribute", "size": '50, 50', "code": code, @@ -102,7 +102,7 @@ } ) tests.append( { - 'name': 'initial.reset.2dstate', + 'name': '2d.canvas.host.initial.reset.2dstate', 'desc': 'Resetting the canvas state resets 2D state variables', 'code': """canvas.width = 100;
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/element/the-canvas-element.yaml b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/element/the-canvas-element.yaml index d6d8cd80..1ecf8ccd 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/element/the-canvas-element.yaml +++ b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/element/the-canvas-element.yaml
@@ -1,9 +1,9 @@ -- name: 2d.getcontext.exists +- name: 2d.canvas.context.exists desc: The 2D context is implemented code: | @assert canvas.getContext('2d') !== null; -- name: 2d.getcontext.invalid.args +- name: 2d.canvas.context.invalid.args desc: Calling getContext with invalid arguments. code: | @assert canvas.getContext('') === null; @@ -16,7 +16,7 @@ @assert canvas.getContext('null') === null; @assert canvas.getContext('undefined') === null; -- name: 2d.getcontext.extraargs.create +- name: 2d.canvas.context.extraargs.create desc: The 2D context doesn't throw with extra getContext arguments (new context) code: | @assert document.createElement("canvas").getContext('2d', false, {}, [], 1, "2") !== null; @@ -26,7 +26,7 @@ @assert document.createElement("canvas").getContext('2d', null) !== null; @assert document.createElement("canvas").getContext('2d', Symbol.hasInstance) !== null; -- name: 2d.getcontext.extraargs.cache +- name: 2d.canvas.context.extraargs.cache desc: The 2D context doesn't throw with extra getContext arguments (cached) code: | @assert canvas.getContext('2d', false, {}, [], 1, "2") !== null; @@ -36,13 +36,13 @@ @assert canvas.getContext('2d', null) !== null; @assert canvas.getContext('2d', Symbol.hasInstance) !== null; -- name: 2d.type.exists +- name: 2d.canvas.context.type.exists desc: The 2D context interface is a property of 'window' notes: &bindings Defined in "Web IDL" (draft) code: | @assert window.CanvasRenderingContext2D; -- name: 2d.type.prototype +- name: 2d.canvas.context.type.prototype desc: window.CanvasRenderingContext2D.prototype are not [[Writable]] and not [[Configurable]], and its methods are [[Configurable]]. notes: *bindings @@ -58,7 +58,7 @@ delete window.CanvasRenderingContext2D.prototype.fill; @assert window.CanvasRenderingContext2D.prototype.fill === undefined; -- name: 2d.type.replace +- name: 2d.canvas.context.type.replace desc: Interface methods can be overridden notes: *bindings code: | @@ -73,7 +73,7 @@ @assert pixel 50,25 == 0,255,0,255; expected: green -- name: 2d.type.extend +- name: 2d.canvas.context.type.extend desc: Interface methods can be added notes: *bindings code: | @@ -87,12 +87,12 @@ @assert pixel 50,25 == 0,255,0,255; expected: green -- name: 2d.getcontext.unique +- name: 2d.canvas.context.unique desc: getContext('2d') returns the same object code: | @assert canvas.getContext('2d') === canvas.getContext('2d'); -- name: 2d.getcontext.shared +- name: 2d.canvas.context.shared desc: getContext('2d') returns objects which share canvas state code: | var ctx2 = canvas.getContext('2d'); @@ -102,7 +102,7 @@ @assert pixel 50,25 == 0,255,0,255; expected: green -- name: 2d.scaled +- name: 2d.canvas.host.scaled desc: CSS-scaled canvases get drawn correctly size: 50, 25 canvas: 'style="width: 100px; height: 50px"' @@ -121,12 +121,12 @@ cr.rectangle(0, 0, 50, 20) cr.fill() -- name: 2d.canvas.reference +- name: 2d.canvas.host.reference desc: CanvasRenderingContext2D.canvas refers back to its canvas code: | @assert ctx.canvas === canvas; -- name: 2d.canvas.readonly +- name: 2d.canvas.host.readonly desc: CanvasRenderingContext2D.canvas is readonly code: | var c = document.createElement('canvas'); @@ -135,7 +135,7 @@ ctx.canvas = c; @assert ctx.canvas === d; -- name: 2d.canvas.context +- name: 2d.canvas.context.prototype desc: checks CanvasRenderingContext2D prototype code: | @assert Object.getPrototypeOf(CanvasRenderingContext2D.prototype) === Object.prototype;
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/offscreen/meta.yaml b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/offscreen/meta.yaml index bd76193..7b44fd9f 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/offscreen/meta.yaml +++ b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/offscreen/meta.yaml
@@ -38,7 +38,7 @@ } ) tests.append( { - 'name': 'initial.reset.2dstate', + 'name': '2d.canvas.host.initial.reset.2dstate', 'desc': 'Resetting the canvas state resets 2D state variables', 'code': """canvas.width = 100; @@ -533,7 +533,7 @@ code = "" code, expected = gen(name, string, exp, code) tests.append( { - "name": "size.attributes.parse.%s" % name, + "name": "2d.canvas.host.size.attributes.parse.%s" % name, "desc": "Parsing of non-negative integers", "code": code, } )
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/offscreen/the-offscreen-canvas.yaml b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/offscreen/the-offscreen-canvas.yaml index 0bef18b..ccabe09 100644 --- a/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/offscreen/the-offscreen-canvas.yaml +++ b/third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml/offscreen/the-offscreen-canvas.yaml
@@ -1,10 +1,10 @@ -- name: 2d.canvas.reference +- name: 2d.canvas.host.reference desc: canvas refers back to its canvas code: | @assert ctx.canvas === canvas; t.done(); -- name: 2d.canvas.readonly +- name: 2d.canvas.host.readonly desc: canvas is readonly code: | var offscreenCanvas2 = new OffscreenCanvas(100, 50); @@ -14,14 +14,14 @@ @assert ctx.canvas === d; t.done(); -- name: 2d.getcontext.exists +- name: 2d.canvas.context.exists desc: The 2D context is implemented code: | var offscreenCanvas2 = new OffscreenCanvas(100, 50); @assert offscreenCanvas2.getContext('2d') !== null; t.done(); -- name: 2d.getcontext.extraargs.create +- name: 2d.canvas.context.extraargs.create desc: The 2D context doesn't throw with extra getContext arguments (new context) code: | @assert (new OffscreenCanvas(100, 50)).getContext('2d', false, {}, [], 1, "2") !== null; @@ -32,7 +32,7 @@ @assert (new OffscreenCanvas(100, 50)).getContext('2d', Symbol.hasInstance) !== null; t.done(); -- name: 2d.getcontext.extraargs.cache +- name: 2d.canvas.context.extraargs.cache desc: The 2D context doesn't throw with extra getContext arguments (cached) code: | @assert canvas.getContext('2d', false, {}, [], 1, "2") !== null; @@ -43,14 +43,14 @@ @assert canvas.getContext('2d', Symbol.hasInstance) !== null; t.done(); -- name: 2d.getcontext.unique +- name: 2d.canvas.context.unique desc: getContext('2d') returns the same object code: | var offscreenCanvas2 = new OffscreenCanvas(100, 50); @assert offscreenCanvas2.getContext('2d') === offscreenCanvas2.getContext('2d'); t.done(); -- name: 2d.getcontext.shared +- name: 2d.canvas.context.shared desc: getContext('2d') returns objects which share canvas state code: | var ctx2 = canvas.getContext('2d'); @@ -60,62 +60,62 @@ @assert pixel 50,25 == 0,255,0,255; t.done(); -- name: context.emptystring +- name: 2d.canvas.context.emptystring desc: getContext with empty string returns null code: | var offscreenCanvas2 = new OffscreenCanvas(100, 50); @assert throws TypeError offscreenCanvas2.getContext(""); t.done(); -- name: context.unrecognised.badname +- name: 2d.canvas.context.unrecognised.badname desc: getContext with unrecognised context name returns null code: | var offscreenCanvas2 = new OffscreenCanvas(100, 50); @assert throws TypeError offscreenCanvas2.getContext('This is not an implemented context in any real browser'); t.done(); -- name: context.unrecognised.badsuffix +- name: 2d.canvas.context.unrecognised.badsuffix desc: Context name "2d" plus a suffix is unrecognised code: | var offscreenCanvas2 = new OffscreenCanvas(100, 50); @assert throws TypeError offscreenCanvas2.getContext("2d#"); t.done(); -- name: context.unrecognised.nullsuffix +- name: 2d.canvas.context.unrecognised.nullsuffix desc: Context name "2d" plus a "\0" suffix is unrecognised code: | var offscreenCanvas2 = new OffscreenCanvas(100, 50); @assert throws TypeError offscreenCanvas2.getContext("2d\0"); t.done(); -- name: context.unrecognised.unicode +- name: 2d.canvas.context.unrecognised.unicode desc: Context name which kind of looks like "2d" is unrecognised code: | var offscreenCanvas2 = new OffscreenCanvas(100, 50); @assert throws TypeError offscreenCanvas2.getContext("2\uFF44"); t.done(); -- name: context.casesensitive +- name: 2d.canvas.context.casesensitive desc: Context name "2D" is unrecognised; matching is case sensitive code: | var offscreenCanvas2 = new OffscreenCanvas(100, 50); @assert throws TypeError offscreenCanvas2.getContext('2D'); t.done(); -- name: context.arguments.missing +- name: 2d.canvas.context.arguments.missing code: | var offscreenCanvas2 = new OffscreenCanvas(100, 50); @assert throws TypeError offscreenCanvas2.getContext(); @moz-todo t.done(); -- name: initial.color +- name: 2d.canvas.host.initial.color desc: Initial state is transparent black code: | @assert pixel 20,20 == 0,0,0,0; t.done(); -- name: initial.reset.different +- name: 2d.canvas.host.initial.reset.different desc: Changing size resets canvas to transparent black code: | ctx.fillStyle = '#f00'; @@ -125,7 +125,7 @@ @assert pixel 20,20 == 0,0,0,0; t.done(); -- name: initial.reset.same +- name: 2d.canvas.host.initial.reset.same desc: Setting size (not changing the value) resets canvas to transparent black code: | canvas.width = 100; @@ -136,7 +136,7 @@ @assert pixel 20,20 == 0,0,0,0; t.done(); -- name: initial.reset.path +- name: 2d.canvas.host.initial.reset.path desc: Resetting the canvas state resets the current path code: | canvas.width = 100; @@ -147,7 +147,7 @@ @assert pixel 20,20 == 0,0,0,0; t.done(); -- name: initial.reset.clip +- name: 2d.canvas.host.initial.reset.clip desc: Resetting the canvas state resets the current clip region code: | canvas.width = 100; @@ -159,7 +159,7 @@ @assert pixel 20,20 == 0,255,0,255; t.done(); -- name: initial.reset.transform +- name: 2d.canvas.host.initial.reset.transform desc: Resetting the canvas state resets the current transformation matrix code: | canvas.width = 100; @@ -170,7 +170,7 @@ @assert pixel 20,20 == 0,255,0,255; t.done(); -- name: initial.reset.gradient +- name: 2d.canvas.host.initial.reset.gradient desc: Resetting the canvas state does not invalidate any existing gradients code: | canvas.width = 50; @@ -185,7 +185,7 @@ @assert pixel 50,25 == 0,255,0,255; t.done(); -- name: initial.reset.pattern +- name: 2d.canvas.host.initial.reset.pattern desc: Resetting the canvas state does not invalidate any existing patterns code: | canvas.width = 30; @@ -200,7 +200,7 @@ @assert pixel 50,25 == 0,255,0,255; t.done(); -- name: size.attributes.idl.set.zero +- name: 2d.canvas.host.size.attributes.idl.set.zero desc: Setting width/height IDL attributes to 0 code: | canvas.width = 0; @@ -209,7 +209,7 @@ @assert canvas.height === 0; t.done(); -- name: size.attributes.idl +- name: 2d.canvas.host.size.attributes.idl desc: Getting/setting width/height IDL attributes webidl: - es-unsigned-long @@ -232,14 +232,14 @@ @assert canvas.height === 301; t.done(); -- name: size.attributes.default +- name: 2d.canvas.host.size.attributes.default desc: Default width/height when attributes are missing code: | @assert canvas.width === 100; @assert canvas.height === 50; t.done(); -- name: size.attributes.reflect.setidl +- name: 2d.canvas.host.size.attributes.reflect.setidl desc: Setting IDL attributes updates IDL and content attributes code: | canvas.width = 120; @@ -248,7 +248,7 @@ @assert canvas.height === 60; t.done(); -- name: size.attributes.reflect.setidlzero +- name: 2d.canvas.host.size.attributes.reflect.setidlzero desc: Setting IDL attributes to 0 updates IDL and content attributes code: | canvas.width = 0; @@ -257,7 +257,7 @@ @assert canvas.height === 0; t.done(); -- name: size.large +- name: 2d.canvas.host.size.large notes: Not sure how reasonable this is, but the spec doesn't say there's an upper limit on the size. code: | @@ -267,9 +267,3 @@ @assert canvas.width === n; @assert canvas.height === n; t.done(); - -- name: 2d.text.setFont.mathFont - desc: crbug.com/1212190, make sure offscreencanvas doesn't crash with Math Font - code: | - ctx.font = "math serif"; - t.done();
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.style.html b/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.style.html index 31640c8..aeb5c7ec 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.style.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-canvas-element/size.attributes.style.html
@@ -26,3 +26,4 @@ }); </script> +
diff --git a/third_party/blink/web_tests/external/wpt/lint.ignore b/third_party/blink/web_tests/external/wpt/lint.ignore index e0ba1ad4c..1b03b0cde 100644 --- a/third_party/blink/web_tests/external/wpt/lint.ignore +++ b/third_party/blink/web_tests/external/wpt/lint.ignore
@@ -89,7 +89,7 @@ CR AT EOL: html/syntax/charset/after-head-in-1kb-crlf.html # Intentional use of tabs -INDENT TABS: html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html +INDENT TABS: html/canvas/element/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html INDENT TABS: webvtt/parsing/file-parsing/tests/support/header-tab.vtt INDENT TABS: webvtt/parsing/file-parsing/tests/support/whitespace-chars.vtt
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/protocol/rtp-headerextensions.html b/third_party/blink/web_tests/external/wpt/webrtc/protocol/rtp-headerextensions.html index c377a61..d1d8bb6 100644 --- a/third_party/blink/web_tests/external/wpt/webrtc/protocol/rtp-headerextensions.html +++ b/third_party/blink/web_tests/external/wpt/webrtc/protocol/rtp-headerextensions.html
@@ -26,7 +26,7 @@ a=mid:audio a=rtpmap:111 opus/48000/2 a=setup:actpass -` + extmaps.audio.map(ext => SDPUtils.writeExtmap(ext)); +` + extmaps.audio.map(ext => SDPUtils.writeExtmap(ext)).join(''); } if (extmaps.video) { sdp += `m=video 9 RTP/SAVPF 112 @@ -36,7 +36,7 @@ a=mid:video a=rtpmap:112 VP8/90000 a=setup:actpass -` + extmaps.video.map(ext => SDPUtils.writeExtmap(ext)); +` + extmaps.video.map(ext => SDPUtils.writeExtmap(ext)).join(''); } return sdp; } @@ -98,4 +98,36 @@ assert_true(!!extensions.find(e => e.uri === answer_extension.uri)); } }, 'Negotiates the subset of supported extensions offered'); + +promise_test(async t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + + // Some implementations may refuse 15 as invalid id because of + // https://www.rfc-editor.org/rfc/rfc8285#section-4.2 + // which only applies to one-byte extensions with ids 0-14. + const sdp = createOfferSdp({audio: [{ + id: 15, uri: 'urn:ietf:params:rtp-hdrext:sdes:mid', + }]}); + await pc.setRemoteDescription({type: 'offer', sdp}); +}, 'Supports header extensions with id=15'); + +promise_test(async t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + + const sdp = createOfferSdp({audio: [{ + id: 16, uri: 'urn:ietf:params:rtp-hdrext:sdes:mid', + }, { + id: 17, uri: 'urn:ietf:params:rtp-hdrext:ssrc-audio-level', + }]}); + await pc.setRemoteDescription({type: 'offer', sdp}); + await pc.setLocalDescription(); + const answer_section = SDPUtils.splitSections(pc.localDescription.sdp)[1]; + const answer_extensions = SDPUtils.matchPrefix(answer_section, 'a=extmap:') + .map(line => SDPUtils.parseExtmap(line)); + assert_equals(answer_extensions.length, 2); + assert_true(!!answer_extensions.find(e => e.uri === 'urn:ietf:params:rtp-hdrext:sdes:mid')); + assert_true(!!answer_extensions.find(e => e.uri === 'urn:ietf:params:rtp-hdrext:ssrc-audio-level')); +}, 'Supports two-byte header extensions'); </script>
diff --git a/third_party/blink/web_tests/fast/events/inputevents/inputevent-ime.html b/third_party/blink/web_tests/fast/events/inputevents/inputevent-ime.html index 17a9744..27e81b7 100644 --- a/third_party/blink/web_tests/fast/events/inputevents/inputevent-ime.html +++ b/third_party/blink/web_tests/fast/events/inputevents/inputevent-ime.html
@@ -107,9 +107,9 @@ textInputController.setComposition('hello'); assert_array_equals(eventLog, [ 'compositionstart', + 'compositionupdate: data="hello"', 'beforeinput: isComposing=true, data="hello", ' + 'inputType=insertCompositionText', - 'compositionupdate: data="hello"', 'input: isComposing=true, data="hello", inputType=insertCompositionText', ]); }, 'setComposition with no composition open, non-empty text, no selection'); @@ -126,8 +126,8 @@ textInputController.setComposition(''); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=true, data="", inputType=insertCompositionText', 'compositionupdate: data=""', + 'beforeinput: isComposing=true, data="", inputType=insertCompositionText', 'textInput: data=""', 'input: isComposing=true, data="null", inputType=insertCompositionText', 'compositionend: data=""', @@ -146,9 +146,9 @@ textInputController.setComposition('hello world'); assert_array_equals(eventLog, [ + 'compositionupdate: data="hello world"', 'beforeinput: isComposing=true, data="hello world", ' + 'inputType=insertCompositionText', - 'compositionupdate: data="hello world"', 'input: isComposing=true, data="hello world", ' + 'inputType=insertCompositionText', ]); @@ -166,9 +166,9 @@ textInputController.insertText('hello world'); assert_array_equals(eventLog, [ + 'compositionupdate: data="hello world"', 'beforeinput: isComposing=true, data="hello world", ' + 'inputType=insertCompositionText', - 'compositionupdate: data="hello world"', 'textInput: data="hello world"', 'input: isComposing=true, data="hello world", ' + 'inputType=insertCompositionText', @@ -188,8 +188,8 @@ textInputController.insertText(''); assert_array_equals(eventLog, [ - 'beforeinput: isComposing=true, data="", inputType=insertCompositionText', 'compositionupdate: data=""', + 'beforeinput: isComposing=true, data="", inputType=insertCompositionText', 'textInput: data=""', 'input: isComposing=true, data="null", inputType=insertCompositionText', 'compositionend: data=""', @@ -255,9 +255,9 @@ textInputController.unmarkText(); assert_array_equals(eventLog, [ + 'compositionupdate: data="hello"', 'beforeinput: isComposing=true, data="hello", ' + 'inputType=insertCompositionText', - 'compositionupdate: data="hello"', 'textInput: data="h"', 'input: isComposing=true, data="h", inputType=insertCompositionText', 'compositionend: data="hello"', @@ -293,9 +293,9 @@ textInputController.unmarkAndUnselectText(); assert_array_equals(eventLog, [ + 'compositionupdate: data="hello"', 'beforeinput: isComposing=true, data="hello", ' + 'inputType=insertCompositionText', - 'compositionupdate: data="hello"', 'textInput: data="h"', 'input: isComposing=true, data="h", inputType=insertCompositionText', 'compositionend: data="hello"',
diff --git a/third_party/blink/web_tests/inspector-protocol/input/imeSetComposition-01-expected.txt b/third_party/blink/web_tests/inspector-protocol/input/imeSetComposition-01-expected.txt index fb35446..00177b5 100644 --- a/third_party/blink/web_tests/inspector-protocol/input/imeSetComposition-01-expected.txt +++ b/third_party/blink/web_tests/inspector-protocol/input/imeSetComposition-01-expected.txt
@@ -49,12 +49,12 @@ selectionStart: 0 selectionEnd: 1 -event: beforeinput +event: compositionupdate value: すしおに selectionStart: 0 selectionEnd: 1 -event: compositionupdate +event: beforeinput value: すしおに selectionStart: 0 selectionEnd: 1 @@ -64,12 +64,12 @@ selectionStart: 2 selectionEnd: 2 -event: beforeinput +event: compositionupdate value: オニしおに selectionStart: 0 selectionEnd: 2 -event: compositionupdate +event: beforeinput value: オニしおに selectionStart: 0 selectionEnd: 2
diff --git a/third_party/blink/web_tests/inspector-protocol/input/imeSetComposition-02-expected.txt b/third_party/blink/web_tests/inspector-protocol/input/imeSetComposition-02-expected.txt index 08fc5c6..bad54ae5 100644 --- a/third_party/blink/web_tests/inspector-protocol/input/imeSetComposition-02-expected.txt +++ b/third_party/blink/web_tests/inspector-protocol/input/imeSetComposition-02-expected.txt
@@ -21,12 +21,12 @@ selectionStart: 3 selectionEnd: 3 -event: beforeinput +event: compositionupdate value: abcd selectionStart: 3 selectionEnd: 3 -event: compositionupdate +event: beforeinput value: abcd selectionStart: 3 selectionEnd: 3 @@ -36,12 +36,12 @@ selectionStart: 4 selectionEnd: 4 -event: beforeinput +event: compositionupdate value: abcsd selectionStart: 3 selectionEnd: 4 -event: compositionupdate +event: beforeinput value: abcsd selectionStart: 3 selectionEnd: 4 @@ -51,12 +51,12 @@ selectionStart: 4 selectionEnd: 4 -event: beforeinput +event: compositionupdate value: abcすd selectionStart: 3 selectionEnd: 4 -event: compositionupdate +event: beforeinput value: abcすd selectionStart: 3 selectionEnd: 4
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/paint-timing/fcp-only/fcp-document-opacity-image-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/paint-timing/fcp-only/fcp-document-opacity-image-expected.txt deleted file mode 100644 index cac37a7..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.15/external/wpt/paint-timing/fcp-only/fcp-document-opacity-image-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL Test that FCP after opacity change is not a larger value than LCP assert_less_than_equal: LCP is not smaller than FCP expected a number less than or equal to 337.9 but got 337.9000000000233 -Harness: the test ran to completion. -
diff --git a/third_party/chromium-variations b/third_party/chromium-variations index a621459..c231464 160000 --- a/third_party/chromium-variations +++ b/third_party/chromium-variations
@@ -1 +1 @@ -Subproject commit a621459ab6c5e090cb2acacc9cd1b6a20456719c +Subproject commit c2314644ddd1e2a534324bc0f9105531d5d0471a
diff --git a/third_party/cros_system_api b/third_party/cros_system_api index c825bde..af6c292 160000 --- a/third_party/cros_system_api +++ b/third_party/cros_system_api
@@ -1 +1 @@ -Subproject commit c825bdec3d1f3f7fb19e83ba3c0126a45f31a889 +Subproject commit af6c292682cc02a8112f14d7112e96fc5a95a746
diff --git a/third_party/dawn b/third_party/dawn index 5e4add6..28d5970 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit 5e4add6919b4bdc626b3f6a37395097b8fd360fc +Subproject commit 28d5970cfe844d8627f5eba90b9838f7c493ecab
diff --git a/third_party/depot_tools b/third_party/depot_tools index 67e56f6..af369d8 160000 --- a/third_party/depot_tools +++ b/third_party/depot_tools
@@ -1 +1 @@ -Subproject commit 67e56f63826baa6cb218751e4da7d9727c398885 +Subproject commit af369d8962d91db619be7cad3cd44a054fac782f
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index 88a8222..07ad94e 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit 88a822273e94788edfe19d912122565cc7e8b2d1 +Subproject commit 07ad94e29d169d6849d3164143470848a9f2ef31
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index cba3d1f..43a373f 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit cba3d1f0b8f005be884136dd1015c455789ec590 +Subproject commit 43a373f3335ce57b5b154ee6065c38001d6361b6
diff --git a/third_party/opus/tests/resources/.gitignore b/third_party/opus/tests/resources/.gitignore index 6c502ffa4..c07b87d 100644 --- a/third_party/opus/tests/resources/.gitignore +++ b/third_party/opus/tests/resources/.gitignore
@@ -1 +1,2 @@ -**/*.pcm +*.pcm +!*.sha1
diff --git a/third_party/perfetto b/third_party/perfetto index ff0bba2..6bbbba9 160000 --- a/third_party/perfetto +++ b/third_party/perfetto
@@ -1 +1 @@ -Subproject commit ff0bba2e85ce2e2825d28083f1e83ecec6513df2 +Subproject commit 6bbbba9c6aeb4a4448a496d48fcfde141596285a
diff --git a/third_party/puffin/README.chromium b/third_party/puffin/README.chromium index bd8de01..18941e4 100644 --- a/third_party/puffin/README.chromium +++ b/third_party/puffin/README.chromium
@@ -2,9 +2,9 @@ Short Name: Puffin URL: https://android.googlesource.com/platform/external/puffin Version: 1.0.0 -Date: Tues May 10 13:55:00 2022 +Date: 2022-10-05 Revision: e0820dcfebfb4df925be2e37ad8f56c00dc624f5 -License: Chromium OS BSD +License: BSD 3-Clause License File: LICENSE Security Critical: yes Shipped: yes
diff --git a/third_party/skia b/third_party/skia index 5b2dae1..8d9e2cd 160000 --- a/third_party/skia +++ b/third_party/skia
@@ -1 +1 @@ -Subproject commit 5b2dae1a9b549aaa1d9d43103ff4e7db87a4b6d2 +Subproject commit 8d9e2cd32ec723b42c62bbcc2d88545424b3e223
diff --git a/tools/luci-go/.gitignore b/tools/luci-go/.gitignore index 588e4f1..da45d2f 100644 --- a/tools/luci-go/.gitignore +++ b/tools/luci-go/.gitignore
@@ -2,4 +2,4 @@ /isolate.exe /swarming /swarming.exe -.versions +/.versions/
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 0ff08bc..30f9dc2 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -45021,6 +45021,76 @@ <int value="8" label="Font file descriptor was cached"/> </enum> +<enum name="FetchLaterBrowserMetricType"> + <int value="0" + label="kAbortedByInitiator: FetchLater request is aborted by its + initiator"> + Recorded once every time a scheduled FetchLater request is aborted in the + browser process. It happens when JavaScript code explicitly aborts a + FetchLater request, and gets propagated to the browser process. + + This number should be compared with `kAbortedByUser` in + `FetchLater.Renderer.Metrics`. + </int> + <int value="1" + label="kStartedAfterInitiatorDisconnected: FetchLater request is started + after its initiator is disconnected"> + Recorded once every time a scheduled FetchLater request is started after its + initiator renderer is disconnected from browser. + + This number should be compared with `kContextDestroyed` in + `FetchLater.Renderer.Metrics`. + </int> + <int value="2" + label="kStartedByInitiator: FetchLater request is explicitly started by + its initiator"> + Recorded once every time a scheduled FetchLater request is explicitly asked + to started by its initiator renderer in the browser. + + This number should be compared with `kActivatedByTimeout` in + `FetchLater.Renderer.Metrics`, and it should <= + `FetchLater.Browser.Total.Started`. + </int> + <int value="3" + label="kCancelledAfterTimeLimit: FetchLater request is cancelled after + internal time limit"> + Recorded once every time a scheduled or a started FetchLater request is + cancelled by the browser after some internal time limit. + </int> +</enum> + +<enum name="FetchLaterRendererMetricType"> + <int value="0" label="kAbortedByUser: FetchLater request is aborted by user"> + Recorded once every time a scheduled FetchLater request is aborted in a + renderer process. It happens when JavaScript code explicitly aborts a + FetchLater request. + + This number should be compared with + `FetchLater.Browser.Metrics.AbortedByInitiator`. + </int> + <int value="1" + label="kContextDestroyed: FetchLater's context is destroyed (implying + activated by browser)"> + Recorded once every time a scheduled FetchLater request is aborted in a + renderer process. It happens when JavaScript code explicitly aborts a + FetchLater request. + + This number should be compared with + `FetchLater.Browser.Metrics.AbortedByInitiator`. + </int> + <int value="2" + label="kActivatedByTimeout: FetchLater request is activated by user + specified timeout"> + Recorded once every time a scheduled FetchLater request is terminated (and + then gets sent) due to context (renderer) destroyed. It is not equivalent to + the total number of internal "TERMINATED" states of a FetchLater + request, which can be terminated for other reasons like aborted by users. + + This number should be compared with + `FetchLater.Browser.Metrics.StartedAfterInitiatorDisconnected`. + </int> +</enum> + <enum name="FetchManagerLoaderCheckPoint"> <int value="0" label="FetchManager::Loader Constructor"/> <int value="1" label="FetchManager::Loader::Failed"/>
diff --git a/tools/metrics/histograms/metadata/borealis/histograms.xml b/tools/metrics/histograms/metadata/borealis/histograms.xml index 40d617e..e76354f 100644 --- a/tools/metrics/histograms/metadata/borealis/histograms.xml +++ b/tools/metrics/histograms/metadata/borealis/histograms.xml
@@ -148,7 +148,9 @@ <variant name="Foreground" summary="Times when a user is engaged and focuses on a Borealis GUI window."/> - <variant name="Total" summary="Should be same as BorealisTotal."/> + <variant name="Total" + summary="Total engagement time (including when Borealis isn't + running)."/> </token> </histogram>
diff --git a/tools/metrics/histograms/metadata/file/histograms.xml b/tools/metrics/histograms/metadata/file/histograms.xml index cf747c1..a9fa07b 100644 --- a/tools/metrics/histograms/metadata/file/histograms.xml +++ b/tools/metrics/histograms/metadata/file/histograms.xml
@@ -712,6 +712,20 @@ </summary> </histogram> +<histogram name="FileBrowser.GoogleDrive.DailyDSSAvailabilityPercentage" + units="%" expires_after="2024-06-01"> + <owner>simmonsjosh@google.com</owner> + <owner>src/ui/file_manager/OWNERS</owner> + <summary> + Percentage of Docs/Sheets/Slides that are available offline compared to the + total number of known Docs/Sheets/Slides by DriveFS. A file is considered + known if DriveFS has cached the metadata for the file. Docs offline can see + many more files then DriveFS so we prune the list of known files before + sending this metric. This is emitted after at least 1 day has elapsed since + the last time it was emitted. + </summary> +</histogram> + <histogram name="FileBrowser.GoogleDrive.DSSAvailabilityPercentage" units="%" expires_after="2024-06-01"> <owner>simmonsjosh@google.com</owner> @@ -722,7 +736,8 @@ known if DriveFS has cached the metadata for the file. Docs offline can see many more files then DriveFS so we prune the list of known files before sending this metric. This is emitted during the polling of Docs offline - which happens if at least one Files app window is open. + which happens if at least one Files app window is open and only emitted if + the values changed from the last update. </summary> </histogram>
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index ba9abfa..d37d9f0 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -6420,6 +6420,72 @@ </summary> </histogram> +<histogram name="FetchLater.Browser.Metrics" enum="FetchLaterBrowserMetricType" + expires_after="2024-03-31"> + <owner>mych@chromium.org</owner> + <owner>chrome-bfcache@google.com</owner> + <summary> + Records once every time a scheduled FetchLater request is either aborted or + started in browser. See the enum definition in + tools/metrics/histograms/enums.xml for details. + </summary> +</histogram> + +<histogram name="FetchLater.Browser.Total" enum="Boolean" + expires_after="2024-03-31"> + <owner>mych@chromium.org</owner> + <owner>chrome-bfcache@google.com</owner> + <summary> + Records true every time a new FetchLater request is scheduled by a browser. + It does NOT equal to the total number of JavaScript FetchLater API call, as + the latter can be immediately rejected with various JavaScript exceptions. + + This number should be compared with `FetchLater.Renderer.Total`, and it may + be >= the sum of `FetchLater.Browser.Metrics`, as a request may be + dropped for other undocumented reasons like browser killed or crashes. + </summary> +</histogram> + +<histogram name="FetchLater.Browser.Total.Started" enum="Boolean" + expires_after="2024-03-31"> + <owner>mych@chromium.org</owner> + <owner>chrome-bfcache@google.com</owner> + <summary> + Records once every time a scheduled FetchLater request is started in + browser. + + This number should be the sum of enum values "kStarted*" in + `FetchLater.Browser.Metrics`. + </summary> +</histogram> + +<histogram name="FetchLater.Renderer.Metrics" + enum="FetchLaterRendererMetricType" expires_after="2024-03-31"> + <owner>mych@chromium.org</owner> + <owner>chrome-bfcache@google.com</owner> + <summary> + Records once every time a scheduled FetchLater request is either aborted or + activated in renderer. See the enum definition in + tools/metrics/histograms/enums.xml for details. + </summary> +</histogram> + +<histogram name="FetchLater.Renderer.Total" enum="Boolean" + expires_after="2024-03-31"> + <owner>mych@chromium.org</owner> + <owner>chrome-bfcache@google.com</owner> + <summary> + Records true every time a new FetchLater request is scheduled by a renderer. + It does NOT equal to the total number of JavaScript FetchLater API call, as + the latter can be immediately rejected with various JavaScript exceptions. + + This metric is recorded to compare whether different behavior happens + between renderer and browser. This number should be compared with + `FetchLater.Browser.Total`, and it should be equal to the sum of + `FetchLater.Renderer.Metrics`. + </summary> +</histogram> + <histogram name="FirstPartySets.Database.InitStatus" enum="FirstPartySetsDatabaseInitStatus" expires_after="M124"> <owner>shuuran@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/web_rtc/histograms.xml b/tools/metrics/histograms/metadata/web_rtc/histograms.xml index 8abd5cf..62d919f 100644 --- a/tools/metrics/histograms/metadata/web_rtc/histograms.xml +++ b/tools/metrics/histograms/metadata/web_rtc/histograms.xml
@@ -1740,18 +1740,6 @@ </summary> </histogram> -<histogram name="WebRTC.PeerConnection.ValidBundledExtensionIds" - units="boolean" expires_after="2024-01-01"> - <owner>hta@chromium.org</owner> - <owner>webrtc-dev@chromium.org</owner> - <owner>phancke@microsoft.com</owner> - <summary> - Measures whether the remote description contains a RTP header extension id - collision that is not allowed by the IETFs BUNDLE specification. Recorded - for every remote description. - </summary> -</histogram> - <histogram name="WebRTC.PeerConnection.ValidBundledPayloadTypes" units="boolean" expires_after="2024-02-11"> <owner>hbos@chromium.org</owner>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index f03f3a2..2576bf2 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -5,8 +5,8 @@ "full_remote_path": "perfetto-luci-artifacts/v37.0/linux-arm64/trace_processor_shell" }, "win": { - "hash": "0da0643b99b5905b364c8e9e2deeced6ad1d2309", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/49ef5c5916fc1304549b681a1129a7a85c82db9f/trace_processor_shell.exe" + "hash": "38b4cba3514081c9363e1d5e24e05424698e9f65", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/ff0bba2e85ce2e2825d28083f1e83ecec6513df2/trace_processor_shell.exe" }, "linux_arm": { "hash": "4ad0dc8eeae3ad92d6a1da2f1653a81fb9e3c4c1",
diff --git a/tools/resultdb/.gitignore b/tools/resultdb/.gitignore index fb1958b8..0c93537 100644 --- a/tools/resultdb/.gitignore +++ b/tools/resultdb/.gitignore
@@ -1,3 +1,3 @@ /result_adapter /result_adapter.exe -.versions +/.versions/
diff --git a/ui/file_manager/BUILD.gn b/ui/file_manager/BUILD.gn index e63d115b..ab26ceb 100644 --- a/ui/file_manager/BUILD.gn +++ b/ui/file_manager/BUILD.gn
@@ -230,6 +230,7 @@ definitions = [ "//tools/typescript/definitions/chrome_event.d.ts", + "//tools/typescript/definitions/metrics_private.d.ts", "//tools/typescript/definitions/runtime.d.ts", "//tools/typescript/definitions/tabs.d.ts", ] @@ -383,6 +384,7 @@ copy("for_image_loader") { sources = [ "$target_gen_dir/tsc/file_manager/common/js/file_types_base.js", + "$target_gen_dir/tsc/file_manager/common/js/lru_cache.js", "file_manager/common/js/test_error_reporting.js", ] outputs = [ "$target_gen_dir/file_manager/common/js/{{source_file_part}}" ] @@ -437,6 +439,7 @@ # For Image Loader unittests: "file_manager/common/js/file_types_base.js", "file_manager/common/js/file_types_data.js", + "file_manager/common/js/lru_cache.js", "file_manager/common/js/test_error_reporting.js", ]
diff --git a/ui/file_manager/file_manager/BUILD.gn b/ui/file_manager/file_manager/BUILD.gn index 97941c9..1ced06c 100644 --- a/ui/file_manager/file_manager/BUILD.gn +++ b/ui/file_manager/file_manager/BUILD.gn
@@ -18,9 +18,6 @@ "main.html", "init_globals.js", - # For File Manager unittests: - "common/js/lru_cache.js", - # CSS: "foreground/css/combobutton.css", "foreground/css/combobutton_gm3.css",
diff --git a/ui/file_manager/file_manager/background/js/BUILD.gn b/ui/file_manager/file_manager/background/js/BUILD.gn index ee9413d..45e9ded 100644 --- a/ui/file_manager/file_manager/background/js/BUILD.gn +++ b/ui/file_manager/file_manager/background/js/BUILD.gn
@@ -25,7 +25,6 @@ ":file_operation_handler", ":file_operation_manager", ":file_operation_util", - ":metrics_start", ":progress_center", ":test_util", ] @@ -42,7 +41,6 @@ ":file_operation_manager", ":file_operation_util", ":launcher", - ":metrics_start", ":mock_progress_center", ":progress_center", ":runtime_loaded_test_util", @@ -103,7 +101,6 @@ ":progress_center", ":volume_manager_factory", "//ui/file_manager/file_manager/common/js:files_app_state", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:url_constants", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/common/js:volume_manager_types", @@ -184,10 +181,6 @@ deps = [ "//ui/file_manager/file_manager/common/js:util" ] } -js_library("metrics_start") { - deps = [ "//ui/file_manager/file_manager/common/js:metrics" ] -} - js_library("launcher") { deps = [ ":app_window_wrapper", @@ -241,7 +234,6 @@ ":volume_manager_factory", "//ash/webui/common/resources:assert", "//ui/file_manager/file_manager/common/js:error_counter", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:progress_center_common", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs/background:file_manager_base", @@ -253,7 +245,6 @@ deps = [ ":runtime_loaded_test_util", "//ash/webui/common/resources:assert", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/common/js:volume_manager_types", ]
diff --git a/ui/file_manager/file_manager/background/js/file_manager_base.js b/ui/file_manager/file_manager/background/js/file_manager_base.js index 01001c8..f534fe8 100644 --- a/ui/file_manager/file_manager/background/js/file_manager_base.js +++ b/ui/file_manager/file_manager/background/js/file_manager_base.js
@@ -6,7 +6,7 @@ import {resolveIsolatedEntries} from '../../common/js/api.js'; import {FilesAppState} from '../../common/js/files_app_state.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordInterval} from '../../common/js/metrics.js'; import {str, util} from '../../common/js/util.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {Crostini} from '../../externs/background/crostini.js'; @@ -408,6 +408,5 @@ /** * End recording of the background page Load.BackgroundScript metric. - * NOTE: This call must come after the call to metrics.clearUserId. */ -metrics.recordInterval('Load.BackgroundScript'); +recordInterval('Load.BackgroundScript');
diff --git a/ui/file_manager/file_manager/background/js/metrics_start.js b/ui/file_manager/file_manager/background/js/metrics_start.ts similarity index 73% rename from ui/file_manager/file_manager/background/js/metrics_start.js rename to ui/file_manager/file_manager/background/js/metrics_start.ts index e5ada6f..2abf4ce7 100644 --- a/ui/file_manager/file_manager/background/js/metrics_start.js +++ b/ui/file_manager/file_manager/background/js/metrics_start.ts
@@ -7,6 +7,6 @@ * this as the first script in main_background.js. */ -import {metrics} from '../../common/js/metrics.js'; +import {startInterval} from '../../common/js/metrics.js'; -metrics.startInterval('Load.BackgroundScript'); +startInterval('Load.BackgroundScript');
diff --git a/ui/file_manager/file_manager/background/js/runtime_loaded_test_util.js b/ui/file_manager/file_manager/background/js/runtime_loaded_test_util.js index ee6b238..45e4b28 100644 --- a/ui/file_manager/file_manager/background/js/runtime_loaded_test_util.js +++ b/ui/file_manager/file_manager/background/js/runtime_loaded_test_util.js
@@ -11,7 +11,7 @@ import {assert} from 'chrome://resources/ash/common/assert.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordEnum} from '../../common/js/metrics.js'; import {util} from '../../common/js/util.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {FileManagerBaseInterface} from '../../externs/background/file_manager_base.js'; @@ -1192,7 +1192,7 @@ * */ test.util.sync.recordEnumMetric = (name, value, validValues) => { - metrics.recordEnum(name, value, validValues); + recordEnum(name, value, validValues); return true; };
diff --git a/ui/file_manager/file_manager/common/js/BUILD.gn b/ui/file_manager/file_manager/common/js/BUILD.gn index 757bfa3b..810bc87e 100644 --- a/ui/file_manager/file_manager/common/js/BUILD.gn +++ b/ui/file_manager/file_manager/common/js/BUILD.gn
@@ -34,9 +34,6 @@ ":filtered_volume_manager", ":glitch", ":icon_util", - ":lru_cache", - ":metrics", - ":metrics_base", ":notifications", ":progress_center_common", ":recent_date_bucket", @@ -61,9 +58,6 @@ ":filtered_volume_manager", ":glitch", ":icon_util", - ":lru_cache", - ":metrics", - ":metrics_base", ":mock_entry", ":notifications", ":progress_center_common", @@ -139,7 +133,6 @@ } js_library("glitch") { - deps = [ ":metrics" ] } js_library("dialog_type") { @@ -223,26 +216,6 @@ ] } -js_library("lru_cache") { -} - -js_unittest("lru_cache_unittest") { - deps = [ - ":lru_cache", - "//chrome/test/data/webui/chromeos:chai_assert", - ] -} - -js_library("metrics") { - visibility = [] - visibility = [ "//ui/file_manager/file_manager/*" ] - deps = [ ":metrics_base" ] -} - -js_library("metrics_base") { - externs_list = [ "$externs_path/metrics_private.js" ] -} - js_library("mock_chrome") { testonly = true deps = [ "//ui/file_manager/file_manager/externs:file_manager_private" ] @@ -357,7 +330,6 @@ ":file_type_unittest", ":files_app_entry_types_unittest", ":filtered_volume_manager_unittest", - ":lru_cache_unittest", ":recent_date_bucket_unittest", ":storage_unittest", ":util_unittest", @@ -367,9 +339,12 @@ closure_flags = strict_error_checking_closure_args + [ "language_in=ECMASCRIPT_2020", - "js_module_root=./gen/ui", - "js_module_root=" + rebase_path("//ui", root_build_dir), + "js_module_root=./gen/ui/file_manager/tsc/", + "js_module_root=./gen/ui/file_manager/", + "js_module_root=" + rebase_path("//ui/file_manager", root_build_dir), "browser_resolver_prefix_replacements=\"chrome://webui-test/=./\"", "hide_warnings_for=third_party/", + "hide_warnings_for=gen/ui/file_manager/tsc/", ] + extra_deps = [ "//ui/file_manager:js_from_ts" ] }
diff --git a/ui/file_manager/file_manager/common/js/glitch.js b/ui/file_manager/file_manager/common/js/glitch.js index 6c73a36..32f37bc 100644 --- a/ui/file_manager/file_manager/common/js/glitch.js +++ b/ui/file_manager/file_manager/common/js/glitch.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 {metrics} from './metrics.js'; +import {recordEnum} from './metrics.js'; /** * Possible error metrics. We allow for errors intercepted by an error counter. @@ -30,5 +30,5 @@ * @param {!GlitchType} glitchType What type of glitch was it. */ export function reportGlitch(glitchType) { - metrics.recordEnum(`Glitch`, glitchType, Object.values(GlitchType)); + recordEnum(`Glitch`, glitchType, Object.values(GlitchType)); }
diff --git a/ui/file_manager/file_manager/common/js/lru_cache.js b/ui/file_manager/file_manager/common/js/lru_cache.ts similarity index 62% rename from ui/file_manager/file_manager/common/js/lru_cache.js rename to ui/file_manager/file_manager/common/js/lru_cache.ts index 4c44a16..85509208 100644 --- a/ui/file_manager/file_manager/common/js/lru_cache.js +++ b/ui/file_manager/file_manager/common/js/lru_cache.ts
@@ -4,49 +4,24 @@ /** * A linked-list node which holds data for cache entry such as key, value, size. - * @template T */ -class LRUCacheNode { - /** - * @param {string} key - * @param {T} value - * @param {number} size - */ - constructor(key, value, size) { - /** @type {string} */ - this.key = key; - - /** @type {T} */ - this.value = value; - - /** @type {number} */ - this.size = size; - - /** @type {LRUCacheNode} */ - this.next = null; - - /** @type {LRUCacheNode} */ - this.prev = null; - } +class LruCacheNode<T> { + public next: LruCacheNode<T>|null = null; + public prev: LruCacheNode<T>|null = null; + constructor(public key: string, public value: T, public size: number) {} } /** * Container of the list of cache nodes. */ -class LRUCacheList { - constructor() { - /** @private {!LRUCacheNode} */ - this.sentinelTail_ = new LRUCacheNode('sentinel', null, 0); - - /** @private {LRUCacheNode} */ - this.head_ = this.sentinelTail_; - } +class LruCacheList<T> { + private tail_: LruCacheNode<T>|null = null; + private head_: LruCacheNode<T>|null = null; /** * Removes a node from this list. - * @param {!LRUCacheNode} node */ - remove(node) { + remove(node: LruCacheNode<T>) { if (node.prev) { node.prev.next = node.next; } @@ -56,63 +31,56 @@ if (node === this.head_) { this.head_ = node.next; } + if (node === this.tail_) { + this.tail_ = node.prev; + } node.prev = null; node.next = null; } /** * Adds a node at the head of this list. - * @param {!LRUCacheNode} node */ - prepend(node) { + prepend(node: LruCacheNode<T>) { node.prev = null; node.next = this.head_; - node.next.prev = node; + if (node.next === null) { + this.tail_ = node; + } else { + node.next.prev = node; + } this.head_ = node; } /** * Returns the last node of the list, or null if the list has no nodes. - * @return {LRUCacheNode} */ - lastNode() { - return this.sentinelTail_.prev; + lastNode(): LruCacheNode<T>|null { + return this.tail_; } } /** * Cache management class implementing LRU algorithm. - * @template T */ -export class LRUCache { +export class LruCache<T> { + private totalSize_ = 0; + private list_ = new LruCacheList<T>(); + private nodes_: {[key: string]: LruCacheNode<T>} = {}; /** - * @param {number} maxSize Maximum total size of items this cache can hold. + * @param maxSize_ Maximum total size of items this cache can hold. * When items are put without specifying their sizes, their sizes are - * treated as 1 and the |maxSize| can be interpreted as the maximum number - * of items. If items are put with specifying their sizes in bytes, the - * |maxSize| can be interpreted as the maximum number of bytes. + * treated as 1 and the |maxSize_| can be interpreted as the maximum + * number of items. If items are put with specifying their sizes in bytes, + * the |maxSize_| can be interpreted as the maximum number of bytes. */ - constructor(maxSize) { - /** @private {number} */ - this.totalSize_ = 0; - - /** @private {number} */ - this.maxSize_ = maxSize; - - /** @private {!LRUCacheList} */ - this.list_ = new LRUCacheList(); - - /** @private {!Object<!LRUCacheNode>} */ - this.nodes_ = {}; - } + constructor(private maxSize_: number) {} /** * Returns a cached item corresponding to the given key. The referenced item * will be the most recently used item and won't be evicted soon. - * @param {string} key - * @return {T} */ - get(key) { + get(key: string): T|null { const node = this.nodes_[key]; if (!node) { return null; @@ -125,10 +93,8 @@ /** * Returns a cached item corresponding to the given key without making the * referenced item the most recently used item. - * @param {string} key - * @return {T} */ - peek(key) { + peek(key: string): T|null { const node = this.nodes_[key]; if (!node) { return null; @@ -139,10 +105,8 @@ /** * Returns true if the cache contains the key. - * @param {string} key - * @return {boolean} */ - hasKey(key) { + hasKey(key: string): boolean { return key in this.nodes_; } @@ -151,14 +115,13 @@ * item and won't be evicted soon. If an item with the same key already exists * in the cache, the existing item's value and size will be updated and the * item will become the most recently used item. - * @param {string} key Key to find the cached item later. - * @param {T} value Value of the item to be cached. - * @param {number=} opt_size Size of the put item. If not specified, the size + * @param key Key to find the cached item later. + * @param value Value of the item to be cached. + * @param size Size of the put item. If not specified, the size * is regarded as 1. If the size is larger than the |maxSize_|, put * operation will be ignored keeping cache state unchanged. */ - put(key, value, opt_size) { - const size = opt_size ? opt_size : 1; + put(key: string, value: T, size: number = 1) { if (size > this.maxSize_) { return; } @@ -175,16 +138,15 @@ this.updateNode_(node, value, size); this.moveNodeToHead_(node); } else { - node = new LRUCacheNode(key, value, size); + node = new LruCacheNode(key, value, size); this.prependNode_(node); } } /** * Removes an item from the cache. - * @param {string} key */ - remove(key) { + remove(key: string) { const node = this.nodes_[key]; if (node) { this.removeNode_(node); @@ -193,9 +155,8 @@ /** * Returns the cache size. - * @return {number} */ - size() { + size(): number { return this.totalSize_; } @@ -203,7 +164,7 @@ * Updates max size of the cache. * @param {number} value New max size. */ - setMaxSize(value) { + setMaxSize(value: number) { this.maxSize_ = value; while (this.totalSize_ > this.maxSize_) { this.evictLastNode_(); @@ -212,17 +173,15 @@ /** * Returns the max size of the cache. - * @return {number} */ - getMaxSize() { + getMaxSize(): number { return this.maxSize_; } /** * Evicts the oldest cache node. - * @private */ - evictLastNode_() { + private evictLastNode_() { const lastNode = this.list_.lastNode(); if (!lastNode) { throw new Error('No more nodes to evict.'); @@ -233,10 +192,8 @@ /** * Removes given node from this cache store completely. - * @param {!LRUCacheNode} node - * @private */ - removeNode_(node) { + private removeNode_(node: LruCacheNode<T>) { this.list_.remove(node); this.totalSize_ -= node.size; console.assert(this.totalSize_ >= 0); @@ -246,10 +203,8 @@ /** * Prepends given node to the head of list. - * @param {!LRUCacheNode} node - * @private */ - prependNode_(node) { + private prependNode_(node: LruCacheNode<T>) { this.list_.prepend(node); this.totalSize_ += node.size; console.assert(this.totalSize_ <= this.maxSize_); @@ -259,12 +214,8 @@ /** * Updates the given nodes size and value. - * @param {!LRUCacheNode} node - * @param {T} value - * @param {number} size - * @private */ - updateNode_(node, value, size) { + private updateNode_(node: LruCacheNode<T>, value: T, size: number) { this.totalSize_ += size - node.size; console.assert(this.totalSize_ >= 0 && this.totalSize_ <= this.maxSize_); node.value = value; @@ -273,10 +224,8 @@ /** * Moves the given node to the head of the linked list. - * @param {!LRUCacheNode} node - * @private */ - moveNodeToHead_(node) { + private moveNodeToHead_(node: LruCacheNode<T>) { this.list_.remove(node); this.list_.prepend(node); }
diff --git a/ui/file_manager/file_manager/common/js/lru_cache_unittest.js b/ui/file_manager/file_manager/common/js/lru_cache_unittest.ts similarity index 89% rename from ui/file_manager/file_manager/common/js/lru_cache_unittest.js rename to ui/file_manager/file_manager/common/js/lru_cache_unittest.ts index 685120ce..3afae06 100644 --- a/ui/file_manager/file_manager/common/js/lru_cache_unittest.js +++ b/ui/file_manager/file_manager/common/js/lru_cache_unittest.ts
@@ -4,10 +4,10 @@ import {assertEquals, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js'; -import {LRUCache} from './lru_cache.js'; +import {LruCache} from './lru_cache.js'; -export function testLRUCache() { - const cache = new LRUCache(3); +export function testLruCache() { + const cache = new LruCache<string>(3); // Querying by non-existent key will get null. assertEquals(null, cache.get('a')); @@ -77,7 +77,7 @@ } export function testLRUCacheWithIndividualSizes() { - const cache = new LRUCache(10); + const cache = new LruCache(10); // Querying by non-existent key will get null. assertEquals(null, cache.get('a')); @@ -121,18 +121,18 @@ } class RandomNumberGenerator { - /** @param {number} seed */ - constructor(seed) { - this.x = seed; + private x_: number; + constructor(seed: number) { + this.x_ = seed; } random() { - this.x = (32453 * this.x + 254119) % (1 << 24); - return this.x >> 4; + this.x_ = (32453 * this.x_ + 254119) % (1 << 24); + return this.x_ >> 4; } } -function generateRandom3letters(generator) { +function generateRandom3letters(generator: RandomNumberGenerator) { const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; let res = ''; for (let i = 0; i < 3; i++) { @@ -142,7 +142,7 @@ } export function testSizeCalculationByRandomInput() { - const cache = new LRUCache(10000); + const cache = new LruCache(10000); // We need fixed random number sequence to avoid test flakiness, so // RandomeNumberGenerator is used instead of Math.random() here. @@ -157,21 +157,21 @@ // Adding items won't make the cache's size exceed the max size. for (let i = 0; i < 10000; i++) { const size = generator.random() % 100 + 1; - const key = keys[generator.random() % keys.length]; + const key = keys[generator.random() % keys.length]!; cache.put(key, 'random item', size); assertTrue(cache.size() <= 10000); } // Removing all keys will make the cache's size exactly 0. - for (let i = 0; i < keys.length; i++) { - cache.remove(keys[i]); + for (const key of keys) { + cache.remove(key); } assertEquals(0, cache.size()); } export function testSetMaxSize() { - const cache = new LRUCache(10); + const cache = new LruCache(10); cache.put('a', 'valueA'); cache.put('b', 'valueB'); cache.put('c', 'valueC');
diff --git a/ui/file_manager/file_manager/common/js/metrics.js b/ui/file_manager/file_manager/common/js/metrics.js deleted file mode 100644 index 970c1c0..0000000 --- a/ui/file_manager/file_manager/common/js/metrics.js +++ /dev/null
@@ -1,27 +0,0 @@ -// Copyright 2012 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview Utility methods for accessing chrome.metricsPrivate API. - * - * To be included as a first script in main.html - */ - -import {metricsBase} from './metrics_base.js'; - -const metrics = metricsBase; - -/** - * Convert a short metric name to the full format. - * - * @param {string} name Short metric name. - * @return {string} Full metric name. - * @override - * @private - */ -metrics.convertName_ = name => { - return 'FileBrowser.' + name; -}; - -export {metrics};
diff --git a/ui/file_manager/file_manager/common/js/metrics.ts b/ui/file_manager/file_manager/common/js/metrics.ts new file mode 100644 index 0000000..91d14c4 --- /dev/null +++ b/ui/file_manager/file_manager/common/js/metrics.ts
@@ -0,0 +1,182 @@ +// Copyright 2014 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview Utility methods for accessing chrome.metricsPrivate API. + * + * To be included as a first script in main.html + */ + +/** + * A map from interval name to interval start timestamp. + */ +const intervals: Record<string, number> = {}; + +/** + * Start the named time interval. + * Should be followed by a call to recordInterval with the same name. + * + * @param name Unique interval name. + */ +export function startInterval(name: string) { + intervals[name] = Date.now(); +} + +/** Convert a short metric name to the full format. */ +function convertName(name: string) { + return 'FileBrowser.' + name; +} + +/** Wrapper method for calling chrome.fileManagerPrivate safely. */ +function callAPI(name: keyof typeof chrome.metricsPrivate, args: any[]) { + try { + const method = chrome.metricsPrivate[name] as Function; + method.apply(chrome.metricsPrivate, args); + } catch (e) { + console.error((e as Error).stack); + } +} + +/** + * Records a value than can range from 1 to 10,000. + * @param name Short metric name. + * @param value Value to be recorded. + */ +export function recordMediumCount(name: string, value: number) { + callAPI('recordMediumCount', [convertName(name), value]); +} + +/** + * Records a value than can range from 1 to 100. + * @param name Short metric name. + * @param value Value to be recorded. + */ +export function recordSmallCount(name: string, value: number) { + callAPI('recordSmallCount', [convertName(name), value]); +} + +/** + * Records an elapsed time of no more than 10 seconds. + * @param name Short metric name. + * @param time Time to be recorded in milliseconds. + */ +export function recordTime(name: string, time: number) { + callAPI('recordTime', [convertName(name), time]); +} + +/** + * Records a boolean value to the given metric. + * @param name Short metric name. + * @param value The value to be recorded. + */ +export function recordBoolean(name: string, value: boolean) { + callAPI('recordBoolean', [convertName(name), value]); +} + +/** + * Records an action performed by the user. + * @param {string} name Short metric name. + */ +export function recordUserAction(name: string) { + callAPI('recordUserAction', [convertName(name)]); +} + +/** + * Records an elapsed time of no more than 10 seconds. + * @param value Numeric value to be recorded in units that match the histogram + * definition (in histograms.xml). + */ +export function recordValue( + name: string, type: chrome.metricsPrivate.MetricTypeType, min: number, + max: number, buckets: number, value: number) { + callAPI('recordValue', [ + { + 'metricName': convertName(name), + 'type': type, + 'min': min, + 'max': max, + 'buckets': buckets, + }, + value, + ]); +} + +/** + * Complete the time interval recording. + * + * Should be preceded by a call to startInterval with the same name. + * + * @param {string} name Unique interval name. + */ +export function recordInterval(name: string) { + const start = intervals[name]; + if (start !== undefined) { + recordTime(name, Date.now() - start); + } else { + console.error('Unknown interval: ' + name); + } +} + +/** + * Complete the time interval recording into appropriate bucket. + * + * Should be preceded by a call to startInterval with the same |name|. + * + * @param name Unique interval name. + * @param numFiles The number of files in this current directory. + * @param buckets Array of numbers that correspond to a bucket value, this will + * be suffixed to |name| when recorded. + * @param tolerance Allowed tolerance for |value| to coalesce into a + * bucket. + */ +export function recordDirectoryListLoadWithTolerance( + name: string, numFiles: number, buckets: number[], tolerance: number) { + const start = intervals[name]; + if (start !== undefined) { + for (const bucketValue of buckets) { + const toleranceMargin = bucketValue * tolerance; + if (numFiles >= (bucketValue - toleranceMargin) && + numFiles <= (bucketValue + toleranceMargin)) { + recordTime(`${name}.${bucketValue}`, Date.now() - start); + return; + } + } + } else { + console.error('Interval not started:', name); + } +} + +/** + * Record an enum value. + * + * @param name Metric name. + * @param value Enum value. + * @param validValues Array of valid values or a boundary number + * (one-past-the-end) value. + */ +export function recordEnum(name: string, value: any, validValues: any[]) { + console.assert(validValues !== undefined); + + let index = validValues.indexOf(value); + const boundaryValue = validValues.length; + + // Collect invalid values in the overflow bucket at the end. + if (index < 0 || index >= boundaryValue) { + index = boundaryValue - 1; + } + + // Setting min to 1 looks strange but this is exactly the recommended way + // of using histograms for enum-like types. Bucket #0 works as a regular + // bucket AND the underflow bucket. + // (Source: UMA_HISTOGRAM_ENUMERATION definition in + // base/metrics/histogram.h) + const metricDescr = { + 'metricName': convertName(name), + 'type': chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LINEAR, + 'min': 1, + 'max': boundaryValue - 1, + 'buckets': boundaryValue, + }; + callAPI('recordValue', [metricDescr, index]); +}
diff --git a/ui/file_manager/file_manager/common/js/metrics_base.js b/ui/file_manager/file_manager/common/js/metrics_base.js deleted file mode 100644 index 942f1f8a..0000000 --- a/ui/file_manager/file_manager/common/js/metrics_base.js +++ /dev/null
@@ -1,229 +0,0 @@ -// Copyright 2014 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview Utility methods for accessing chrome.metricsPrivate API. - * - * To be included as a first script in main.html - */ - -const metricsBase = {}; - -/** - * A map from interval name to interval start timestamp. - */ -metricsBase.intervals = {}; - -/** - * A mapping of enum names to valid values. This object is consulted - * any time an enum value is being reported un-accompanied by a list - * of valid values. - * - * <p>Values mut be provided by base classes. Values should correspond exactly - * with values from histograms.xml. - * - * @private {!Object<!Array<*>|number>} - */ -metricsBase.validEnumValues_ = {}; - - -/** - * Start the named time interval. - * Should be followed by a call to recordInterval with the same name. - * - * @param {string} name Unique interval name. - */ -metricsBase.startInterval = name => { - metricsBase.intervals[name] = Date.now(); -}; - -/** - * Convert a short metric name to the full format. - * - * @param {string} name Short metric name. - * @return {string} Full metric name. - * @private - */ -metricsBase.convertName_ = name => { - throw new Error('metricsBase.convertName_() must be overrideen by subclass.'); -}; - -/** - * Wrapper method for calling chrome.fileManagerPrivate safely. - * @param {string} methodName Method name. - * @param {Array<Object>} args Arguments. - * @private - */ -metricsBase.call_ = (methodName, args) => { - try { - chrome.metricsPrivate[methodName].apply(chrome.metricsPrivate, args); - } catch (e) { - console.error(e.stack); - } - // Support writing metrics.log in manual testing to log method calls. - if (/** @type{{ log: (boolean|undefined) }} */ (metricsBase).log) { - console.log('chrome.metricsPrivate.' + methodName, args); - } -}; - -/** - * Records a value than can range from 1 to 10,000. - * @param {string} name Short metric name. - * @param {number} value Value to be recorded. - */ -metricsBase.recordMediumCount = (name, value) => { - metricsBase.call_( - 'recordMediumCount', [metricsBase.convertName_(name), value]); -}; - -/** - * Records a value than can range from 1 to 100. - * @param {string} name Short metric name. - * @param {number} value Value to be recorded. - */ -metricsBase.recordSmallCount = (name, value) => { - metricsBase.call_( - 'recordSmallCount', [metricsBase.convertName_(name), value]); -}; - -/** - * Records an elapsed time of no more than 10 seconds. - * @param {string} name Short metric name. - * @param {number} time Time to be recorded in milliseconds. - */ -metricsBase.recordTime = (name, time) => { - metricsBase.call_('recordTime', [metricsBase.convertName_(name), time]); -}; - -/** - * Records a boolean value to the given metric. - * @param {string} name Short metric name. - * @param {boolean} value The value to be recorded. - */ -metricsBase.recordBoolean = (name, value) => { - metricsBase.call_('recordBoolean', [metricsBase.convertName_(name), value]); -}; - -/** - * Records an action performed by the user. - * @param {string} name Short metric name. - */ -metricsBase.recordUserAction = name => { - metricsBase.call_('recordUserAction', [metricsBase.convertName_(name)]); -}; - -/** - * Records an elapsed time of no more than 10 seconds. - * @param {string} name Short metric name. - * @param {!chrome.metricsPrivate.MetricTypeType} type - * @param {number} min - * @param {number} max - * @param {number} buckets - * @param {number} value Numeric value to be recorded in units - * that match the histogram definition (in histograms.xml). - */ -metricsBase.recordValue = (name, type, min, max, buckets, value) => { - metricsBase.call_('recordValue', [ - { - 'metricName': metricsBase.convertName_(name), - 'type': type, - 'min': min, - 'max': max, - 'buckets': buckets, - }, - value, - ]); -}; - -/** - * Complete the time interval recording. - * - * Should be preceded by a call to startInterval with the same name. - * - * @param {string} name Unique interval name. - */ -metricsBase.recordInterval = name => { - if (name in metricsBase.intervals) { - metricsBase.recordTime(name, Date.now() - metricsBase.intervals[name]); - } else { - console.error('Unknown interval: ' + name); - } -}; - -/** - * Complete the time interval recording into appropriate bucket. - * - * Should be preceded by a call to startInterval with the same |name|. - * - * @param {string} name Unique interval name. - * @param {number} numFiles The number of files in this current directory. - * @param {!Array<number>} buckets Array of numbers that correspond to a bucket - * value, this will be suffixed to |name| when recorded. - * @param {number=} tolerance Allowed tolerance for |value| to coalesce into a - * bucket. - */ -metricsBase.recordDirectoryListLoadWithTolerance = - (name, numFiles, buckets, tolerance) => { - if (name in metricsBase.intervals) { - for (const bucketValue of buckets) { - const toleranceMargin = bucketValue * tolerance; - if (numFiles >= (bucketValue - toleranceMargin) && - numFiles <= (bucketValue + toleranceMargin)) { - metricsBase.recordTime( - `${name}.${bucketValue}`, - Date.now() - metricsBase.intervals[name]); - return; - } - } - } else { - console.error('Interval not started:', name); - } - }; - -/** - * Record an enum value. - * - * @param {string} name Metric name. - * @param {*} value Enum value. - * @param {Array<*>|number=} opt_validValues Array of valid values - * or a boundary number (one-past-the-end) value. - */ -metricsBase.recordEnum = (name, value, opt_validValues) => { - let boundaryValue; - let index; - - let validValues = opt_validValues; - if (metricsBase.validEnumValues_ && name in metricsBase.validEnumValues_) { - console.assert(validValues === undefined); - validValues = metricsBase.validEnumValues_[name]; - } - console.assert(validValues !== undefined); - - if (validValues.constructor.name == 'Array') { - index = validValues.indexOf(value); - boundaryValue = validValues.length; - } else { - index = /** @type {number} */ (value); - boundaryValue = validValues; - } - // Collect invalid values in the overflow bucket at the end. - if (index < 0 || index >= boundaryValue) { - index = boundaryValue - 1; - } - - // Setting min to 1 looks strange but this is exactly the recommended way - // of using histograms for enum-like types. Bucket #0 works as a regular - // bucket AND the underflow bucket. - // (Source: UMA_HISTOGRAM_ENUMERATION definition in base/metrics/histogram.h) - const metricDescr = { - 'metricName': metricsBase.convertName_(name), - 'type': chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LINEAR, - 'min': 1, - 'max': boundaryValue - 1, - 'buckets': boundaryValue, - }; - metricsBase.call_('recordValue', [metricDescr, index]); -}; - -export {metricsBase};
diff --git a/ui/file_manager/file_manager/common/js/mock_chrome.js b/ui/file_manager/file_manager/common/js/mock_chrome.js index 8b09aafd..1de7fec5 100644 --- a/ui/file_manager/file_manager/common/js/mock_chrome.js +++ b/ui/file_manager/file_manager/common/js/mock_chrome.js
@@ -9,10 +9,13 @@ export function installMockChrome(mockChrome) { /** @suppress {const|checkTypes} */ window.chrome = window.chrome || {}; + mockChrome.metricsPrivate = mockChrome.metricsPrivate || new MockMetrics(); + const chrome = window.chrome; for (const [key, value] of Object.entries(mockChrome)) { - const target = chrome[key] || {}; + const target = chrome[key] || value; Object.assign(target, value); + chrome[key] = target; } } @@ -255,3 +258,87 @@ } } } + +/** + * Mock for chrome.metricsPrivate. + * + * It records the method calls made to chrome.metricsPrivate. + * + * Typical usage: + * const mockMetrics = new MockMetrics(); + * + * // NOTE: installMockChrome() mocks metricsPrivate by default, which useful + * when you don't want to check the calls to metrics. + * installMockChrome({ + * metricsPrivate: mockMetrics, + * }); + * + * // Run the code under test: + * Then check the calls made to metrics private using either: + * mockMetrics.apiCalls + * mockMetrics.metricCalls + */ +export class MockMetrics { + constructor() { + /** + * Maps the API name to every call which is an array of the call arguments. + * @type {!Object<undefined|!Array<*>>} + * */ + this.apiCalls = {}; + + /** + * Maps the metric names to every call with its arguments, similar to + * `apiCalls` but recorded by metric instead of API method. + * @type {!Object<undefined|!Array<*>>} + * */ + this.metricCalls = {}; + + // The API has this enum which referenced in the code. + this.MetricTypeType = { + 'HISTOGRAM_LINEAR': 'HISTOGRAM_LINEAR', + }; + } + + call(apiName, args) { + console.log(apiName, args); + this.apiCalls[apiName] = this.apiCalls[apiName] || []; + this.apiCalls[apiName].push(args); + if (args.length > 0) { + let metricName = args[0]; + // Ignore the first position because it's the metric name. + let metricArgs = args.slice(1); + // Some APIs uses `metricName` instead of first argument. + if (metricName.metricName) { + metricArgs = [metricName, ...metricArgs]; + metricName = metricName.metricName; + } + this.metricCalls[metricName] = this.metricCalls[metricName] || []; + this.metricCalls[metricName].push(metricArgs); + } + } + + recordMediumCount(...args) { + this.call('recordMediumCount', args); + } + recordSmallCount(...args) { + this.call('recordSmallCount', args); + } + recordTime(...args) { + this.call('recordTime', args); + } + recordBoolean(...args) { + this.call('recordBoolean', args); + } + recordUserAction(...args) { + this.call('recordUserAction', args); + } + recordValue(...args) { + this.call('recordValue', args); + } + recordInterval(...args) { + this.call('recordInterval', args); + } + recordEnum(...args) { + this.call('recordEnum', args); + } +}
diff --git a/ui/file_manager/file_manager/common/js/trash.ts b/ui/file_manager/file_manager/common/js/trash.ts index 5d6c503..090b810e 100644 --- a/ui/file_manager/file_manager/common/js/trash.ts +++ b/ui/file_manager/file_manager/common/js/trash.ts
@@ -29,7 +29,7 @@ import {parseTrashInfoFiles, startIOTask} from './api.js'; import {isFileSystemDirectoryEntry, isFileSystemFileEntry} from './entry_utils.js'; import {FakeEntryImpl} from './files_app_entry_types.js'; -import {metrics} from './metrics.js'; +import {recordMediumCount} from './metrics.js'; import {str} from './util.js'; import {VolumeManagerCommon} from './volume_manager_types.js'; @@ -552,7 +552,7 @@ } // Record the amount of files seen for this particularly directory reader. - metrics.recordMediumCount( + recordMediumCount( /*name=*/ `TrashFiles.${this.config_.volumeType}`, result.length); }
diff --git a/ui/file_manager/file_manager/containers/breadcrumb_container.ts b/ui/file_manager/file_manager/containers/breadcrumb_container.ts index 0b9c2967..126ff90 100644 --- a/ui/file_manager/file_manager/containers/breadcrumb_container.ts +++ b/ui/file_manager/file_manager/containers/breadcrumb_container.ts
@@ -4,7 +4,7 @@ import '../widgets/xf_breadcrumb.js'; -import {metrics} from '../common/js/metrics.js'; +import {recordUserAction} from '../common/js/metrics.js'; import {SEARCH_RESULTS_KEY} from '../common/js/url_constants.js'; import {str} from '../common/js/util.js'; import {PathComponent, PropStatus, State} from '../externs/ts/state.js'; @@ -115,6 +115,6 @@ const fileKey = this.pathKeys_[index]; this.store_.dispatch(changeDirectory({toKey: fileKey as FileKey})); - metrics.recordUserAction('ClickBreadcrumbs'); + recordUserAction('ClickBreadcrumbs'); } }
diff --git a/ui/file_manager/file_manager/containers/directory_tree_container.ts b/ui/file_manager/file_manager/containers/directory_tree_container.ts index f5b1b4d6..a3a6aad 100644 --- a/ui/file_manager/file_manager/containers/directory_tree_container.ts +++ b/ui/file_manager/file_manager/containers/directory_tree_container.ts
@@ -8,7 +8,7 @@ import {maybeShowTooltip} from '../common/js/dom_utils.js'; import {isEntryInsideComputers, isEntryInsideDrive, isEntryInsideMyDrive, isGrandRootEntryInDrives, isMyFilesEntry, isTrashEntry, isVolumeEntry} from '../common/js/entry_utils.js'; import {EntryList, FakeEntryImpl, VolumeEntry} from '../common/js/files_app_entry_types.js'; -import {metrics} from '../common/js/metrics.js'; +import {recordEnum, recordUserAction} from '../common/js/metrics.js'; import {str, strf, util} from '../common/js/util.js'; import {VolumeManagerCommon} from '../common/js/volume_manager_types.js'; import {FileData, FileKey, NavigationKey, NavigationRoot, NavigationType, PropStatus, State} from '../externs/ts/state.js'; @@ -776,8 +776,7 @@ const rootType = fileData.rootType ?? 'unknown'; const level = fileData.isRootEntry ? 'TopLevel' : 'NonTopLevel'; const metricName = `Location.OnEntryExpandedOrCollapsed.${level}`; - metrics.recordEnum( - metricName, rootType, VolumeManagerCommon.RootTypesForUMA); + recordEnum(metricName, rootType, VolumeManagerCommon.RootTypesForUMA); } /** Record UMA for tree item selected. */ @@ -785,8 +784,7 @@ const rootType = fileData.rootType ?? 'unknown'; const level = fileData.isRootEntry ? 'TopLevel' : 'NonTopLevel'; const metricName = `Location.OnEntrySelected.${level}`; - metrics.recordEnum( - metricName, rootType, VolumeManagerCommon.RootTypesForUMA); + recordEnum(metricName, rootType, VolumeManagerCommon.RootTypesForUMA); } /** Activate the directory behind the item. */ @@ -827,7 +825,7 @@ if (navigationRootData?.type === NavigationType.SHORTCUT) { const onEntryResolved = (resolvedEntry: Entry) => { - metrics.recordUserAction('FolderShortcut.Navigate'); + recordUserAction('FolderShortcut.Navigate'); this.store_.dispatch( changeDirectory({toKey: resolvedEntry.toURL()})); };
diff --git a/ui/file_manager/file_manager/containers/directory_tree_container_unittest.ts b/ui/file_manager/file_manager/containers/directory_tree_container_unittest.ts index 9a6281e..787fb85 100644 --- a/ui/file_manager/file_manager/containers/directory_tree_container_unittest.ts +++ b/ui/file_manager/file_manager/containers/directory_tree_container_unittest.ts
@@ -7,7 +7,6 @@ import {MockVolumeManager} from '../background/js/mock_volume_manager.js'; import {EntryList, FakeEntryImpl, VolumeEntry} from '../common/js/files_app_entry_types.js'; -import {metrics} from '../common/js/metrics.js'; import {installMockChrome} from '../common/js/mock_chrome.js'; import {MockFileSystem} from '../common/js/mock_entry.js'; import {waitUntil} from '../common/js/test_error_reporting.js'; @@ -62,14 +61,6 @@ } /** - * Mock metrics. - */ -metrics.recordEnum = function() {}; -metrics.recordSmallCount = function() {}; -metrics.startInterval = function() {}; -metrics.recordInterval = function() {}; - -/** * Returns a mock MetadataModel. */ function createMockMetadataModel(): MetadataModel {
diff --git a/ui/file_manager/file_manager/containers/search_container.ts b/ui/file_manager/file_manager/containers/search_container.ts index 3c94208..e3e7521 100644 --- a/ui/file_manager/file_manager/containers/search_container.ts +++ b/ui/file_manager/file_manager/containers/search_container.ts
@@ -5,7 +5,7 @@ import {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js'; import {queryRequiredElement} from '../common/js/dom_utils.js'; -import {metrics} from '../common/js/metrics.js'; +import {recordUserAction} from '../common/js/metrics.js'; import {str, strf} from '../common/js/util.js'; import {VolumeManagerCommon} from '../common/js/volume_manager_types.js'; import {CurrentDirectory, PropStatus, SearchData, SearchLocation, SearchOptions, SearchRecency, State} from '../externs/ts/state.js'; @@ -442,7 +442,7 @@ this.store_.dispatch( changeDirectory({toKey: this.pathComponents_[index] as FileKey})); - metrics.recordUserAction('ClickBreadcrumbs'); + recordUserAction('ClickBreadcrumbs'); } /**
diff --git a/ui/file_manager/file_manager/foreground/js/BUILD.gn b/ui/file_manager/file_manager/foreground/js/BUILD.gn index 63d84d9..46b7d5b 100644 --- a/ui/file_manager/file_manager/foreground/js/BUILD.gn +++ b/ui/file_manager/file_manager/foreground/js/BUILD.gn
@@ -58,7 +58,6 @@ ":main_window_component", ":metadata_box_controller", ":metadata_update_controller", - ":metrics_start", ":mock_actions_model", ":mock_directory_model", ":mock_folder_shortcut_data_model", @@ -175,7 +174,6 @@ "//ash/webui/common/resources:assert", "//ash/webui/common/resources:cr_deprecated", "//ash/webui/common/resources:event_target", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs:volume_manager", @@ -208,7 +206,6 @@ "//ash/webui/common/resources:event_target", "//chrome/test/data/webui/chromeos:chai_assert", "//ui/file_manager/file_manager/background/js:mock_volume_manager", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:mock_chrome", "//ui/file_manager/file_manager/common/js:mock_entry", "//ui/file_manager/file_manager/common/js:test_error_reporting", @@ -317,7 +314,6 @@ "//ash/webui/common/resources:assert", "//ash/webui/common/resources:util", "//ui/file_manager/file_manager/common/js:dialog_type", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs:volume_manager", @@ -333,7 +329,6 @@ "//ash/webui/common/resources:cr_deprecated", "//ash/webui/common/resources:event_target", "//ui/file_manager/file_manager/common/js:async_util", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs:files_app_entry_interfaces", @@ -367,7 +362,6 @@ "//ash/webui/common/resources:cr_deprecated", "//ash/webui/common/resources:event_target", "//ui/file_manager/file_manager/common/js:async_util", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs:entries_changed_event", @@ -397,7 +391,6 @@ js_library("navigation_uma") { deps = [ - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs:volume_manager", ] @@ -548,7 +541,6 @@ "//ui/file_manager/file_manager/common/js:files_app_entry_types", "//ui/file_manager/file_manager/common/js:files_app_state", "//ui/file_manager/file_manager/common/js:filtered_volume_manager", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:progress_center_common", "//ui/file_manager/file_manager/common/js:storage", "//ui/file_manager/file_manager/common/js:util", @@ -590,7 +582,6 @@ "//ui/file_manager/file_manager/common/js:dialog_type", "//ui/file_manager/file_manager/common/js:file_type", "//ui/file_manager/file_manager/common/js:files_app_entry_types", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:progress_center_common", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/common/js:volume_manager_types", @@ -700,7 +691,6 @@ deps = [ ":directory_model", "ui:a11y_announce", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/externs:directory_change_event", "//ui/file_manager/file_manager/externs:files_app_entry_interfaces", @@ -716,7 +706,6 @@ "//ash/webui/common/resources:load_time_data.m", "//chrome/test/data/webui/chromeos:chai_assert", "//ui/file_manager/file_manager/common/js:files_app_entry_types", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:mock_chrome", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs:directory_change_event", @@ -740,7 +729,6 @@ "//ui/file_manager/file_manager/common/js:api", "//ui/file_manager/file_manager/common/js:async_util", "//ui/file_manager/file_manager/common/js:filtered_volume_manager", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs/ts:store", @@ -779,7 +767,6 @@ js_library("holding_space_util") { deps = [ "//ash/webui/common/resources:load_time_data.m", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:volume_manager_types", ] } @@ -800,7 +787,6 @@ "metadata:thumbnail_model", "//ash/webui/common/resources:assert", "//ash/webui/common/resources:event_target", - "//ui/file_manager/file_manager/common/js:lru_cache", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs:volume_manager", ] @@ -831,7 +817,6 @@ [ "//ui/webui/resources/cr_components/color_change_listener:build_ts" ] deps = [ ":file_manager", - ":metrics_start", "//ui/file_manager/file_manager/common/js:glitch", "//ui/file_manager/file_manager/common/js:util", ] @@ -849,7 +834,6 @@ "ui:file_tap_handler", "ui:list_container", "//ui/file_manager/file_manager/common/js:dialog_type", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs:directory_change_event", @@ -883,10 +867,6 @@ ] } -js_library("metrics_start") { - deps = [ "//ui/file_manager/file_manager/common/js:metrics" ] -} - js_library("naming_controller") { deps = [ ":directory_contents", @@ -1020,7 +1000,6 @@ "//ash/webui/common/resources:assert", "//ui/file_manager/file_manager/common/js:dialog_type", "//ui/file_manager/file_manager/common/js:file_type", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs:volume_manager", ] @@ -1033,7 +1012,6 @@ ":file_selection", ":spinner_controller", "ui:list_container", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:volume_manager_types", ] }
diff --git a/ui/file_manager/file_manager/foreground/js/actions_model.js b/ui/file_manager/file_manager/foreground/js/actions_model.js index 772ba922..0e9110ea 100644 --- a/ui/file_manager/file_manager/foreground/js/actions_model.js +++ b/ui/file_manager/file_manager/foreground/js/actions_model.js
@@ -6,7 +6,7 @@ import {dispatchSimpleEvent} from 'chrome://resources/ash/common/cr_deprecated.js'; import {NativeEventTarget as EventTarget} from 'chrome://resources/ash/common/event_target.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordBoolean} from '../../common/js/metrics.js'; import {str, strf, util} from '../../common/js/util.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {VolumeManager} from '../../externs/volume_manager.js'; @@ -247,10 +247,10 @@ // Check the result of pinning. entryPinned: () => { error = !!chrome.runtime.lastError; - metrics.recordBoolean('DrivePinSuccess', !error); + recordBoolean('DrivePinSuccess', !error); if (this.metadataModel_.getCache([currentEntry], ['hosted'])[0] .hosted) { - metrics.recordBoolean('DriveHostedFilePinSuccess', !error); + recordBoolean('DriveHostedFilePinSuccess', !error); } if (error && this.value_) { this.metadataModel_.get([currentEntry], ['size']).then(results => {
diff --git a/ui/file_manager/file_manager/foreground/js/actions_model_unittest.js b/ui/file_manager/file_manager/foreground/js/actions_model_unittest.js index 484b1ec..1dd2475a 100644 --- a/ui/file_manager/file_manager/foreground/js/actions_model_unittest.js +++ b/ui/file_manager/file_manager/foreground/js/actions_model_unittest.js
@@ -7,8 +7,7 @@ import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js'; import {MockVolumeManager} from '../../background/js/mock_volume_manager.js'; -import {metrics} from '../../common/js/metrics.js'; -import {installMockChrome, MockCommandLinePrivate} from '../../common/js/mock_chrome.js'; +import {installMockChrome, MockCommandLinePrivate, MockMetrics} from '../../common/js/mock_chrome.js'; import {MockDirectoryEntry, MockFileEntry} from '../../common/js/mock_entry.js'; import {reportPromise} from '../../common/js/test_error_reporting.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; @@ -35,6 +34,17 @@ */ let providedFileSystem; +/** @type {!MockMetrics} */ +let mockMetrics; + +/** + * @param {string} metricName + * @returns {number} total number of calls for that metric. + */ +function countMetricCalls(metricName) { + const calls = mockMetrics.metricCalls; + return (calls[metricName] || []).length; +} /** * @returns {!FolderShortcutsDataModel} @@ -91,8 +101,10 @@ let ui; export function setUp() { + mockMetrics = new MockMetrics(); // Mock Chrome APIs. const mockChrome = { + metricsPrivate: mockMetrics, runtime: { lastError: null, }, @@ -100,20 +112,6 @@ installMockChrome(mockChrome); new MockCommandLinePrivate(); - /** - * Mock metrics.recordBoolean. - * @param {string} name Short metric name. - * @param {boolean} value The value to be recorded. - */ - metrics.recordBoolean = (name, value) => { - metrics.calls[name]++; - }; - - metrics.calls = { - DrivePinSuccess: 0, - DriveHostedFilePinSuccess: 0, - }; - // Setup Drive file system. volumeManager = new MockVolumeManager(); let type = VolumeManagerCommon.VolumeType.DRIVE; @@ -268,8 +266,9 @@ assertTrue(metadataModel.properties.pinned); assertEquals(1, invalidated); - assertEquals(1, metrics.calls['DrivePinSuccess']); - assertEquals(0, metrics.calls['DriveHostedFilePinSuccess']); + assertEquals(1, countMetricCalls('FileBrowser.DrivePinSuccess')); + assertEquals( + 0, countMetricCalls('FileBrowser.DriveHostedFilePinSuccess')); // The model is invalidated, as list of actions have changed. // Recreated the model and check that the actions are updated. @@ -387,8 +386,9 @@ assertTrue(!!metadataModel.getCache([testDocument])[0].pinned); assertTrue(!!metadataModel.getCache([testFile])[0].pinned); - assertEquals(2, metrics.calls['DrivePinSuccess']); - assertEquals(1, metrics.calls['DriveHostedFilePinSuccess']); + assertEquals(2, countMetricCalls('FileBrowser.DrivePinSuccess')); + assertEquals( + 1, countMetricCalls('FileBrowser.DriveHostedFilePinSuccess')); model = new ActionsModel( volumeManager, metadataModel, shortcutsModel, ui, @@ -496,8 +496,9 @@ assertFalse(!!metadataModel.getCache([testDocument])[0].pinned); assertTrue(!!metadataModel.getCache([testFile])[0].pinned); - assertEquals(1, metrics.calls['DrivePinSuccess']); - assertEquals(0, metrics.calls['DriveHostedFilePinSuccess']); + assertEquals(1, countMetricCalls('FileBrowser.DrivePinSuccess')); + assertEquals( + 0, countMetricCalls('FileBrowser.DriveHostedFilePinSuccess')); model = new ActionsModel( volumeManager, metadataModel, shortcutsModel, ui,
diff --git a/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js b/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js index d0f7e2f..77709db9 100644 --- a/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js +++ b/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js
@@ -6,7 +6,7 @@ import {$} from 'chrome://resources/ash/common/util.js'; import {DialogType, isFolderDialogType} from '../../common/js/dialog_type.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordEnum} from '../../common/js/metrics.js'; import {str, UserCanceledError, util} from '../../common/js/util.js'; import {AllowedPaths, VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {VolumeManager} from '../../externs/volume_manager.js'; @@ -272,7 +272,7 @@ // Record the root types of chosen files in OPEN dialog. if (this.dialogType_ == DialogType.SELECT_OPEN_FILE || this.dialogType_ == DialogType.SELECT_OPEN_MULTI_FILE) { - metrics.recordEnum( + recordEnum( 'OpenFiles.RootType', currentRootType, VolumeManagerCommon.RootTypesForUMA); }
diff --git a/ui/file_manager/file_manager/foreground/js/directory_contents.js b/ui/file_manager/file_manager/foreground/js/directory_contents.js index f35bcf1..2ac450f 100644 --- a/ui/file_manager/file_manager/foreground/js/directory_contents.js +++ b/ui/file_manager/file_manager/foreground/js/directory_contents.js
@@ -12,7 +12,7 @@ import {isEntryInsideDrive} from '../../common/js/entry_utils.js'; import {FileType} from '../../common/js/file_type.js'; import {EntryList} from '../../common/js/files_app_entry_types.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordInterval, recordMediumCount, startInterval} from '../../common/js/metrics.js'; import {getEarliestTimestamp} from '../../common/js/recent_date_bucket.js'; import {createTrashReaders} from '../../common/js/trash.js'; import {util} from '../../common/js/util.js'; @@ -91,7 +91,7 @@ return; } - metrics.startInterval('DirectoryScan'); + startInterval('DirectoryScan'); const reader = this.entry_.createReader(); const readEntries = () => { reader.readEntries(entries => { @@ -102,7 +102,7 @@ if (entries.length === 0) { // All entries are read. - metrics.recordInterval('DirectoryScan'); + recordInterval('DirectoryScan'); successCallback(); return; } @@ -253,7 +253,7 @@ */ makeFileSearchPromise_(params, metricVariant) { return new Promise((resolve, reject) => { - metrics.startInterval(`Search.${metricVariant}.Latency`); + startInterval(`Search.${metricVariant}.Latency`); chrome.fileManagerPrivate.searchFiles( params, /** @@ -267,7 +267,7 @@ util.FileError.NOT_READABLE_ERR, chrome.runtime.lastError.message)); } else { - metrics.recordInterval(`Search.${metricVariant}.Latency`); + recordInterval(`Search.${metricVariant}.Latency`); resolve(entries); } }); @@ -300,7 +300,7 @@ }); }); return new Promise((resolve, reject) => { - metrics.startInterval(`Search.${metricVariant}.Latency`); + startInterval(`Search.${metricVariant}.Latency`); const collectedEntries = []; let workLeft = 1; util.readEntriesRecursively( @@ -330,7 +330,7 @@ collectedEntries.push(...modified.filter(e => e !== null)); workLeft -= modified.length; if (workLeft <= 0) { - metrics.recordInterval(`Search.${metricVariant}.Latency`); + recordInterval(`Search.${metricVariant}.Latency`); resolve(collectedEntries); } }); @@ -339,14 +339,14 @@ // All entries read callback. () => { if (--workLeft <= 0) { - metrics.recordInterval(`Search.${metricVariant}.Latency`); + recordInterval(`Search.${metricVariant}.Latency`); resolve(collectedEntries); } }, // Error callback. () => { if (!this.cancelled_ && collectedEntries.length >= maxResults) { - metrics.recordInterval(`Search.${metricVariant}.Latency`); + recordInterval(`Search.${metricVariant}.Latency`); resolve(collectedEntries); } else { reject(); @@ -482,7 +482,7 @@ const searchType = this.driveSearchTypeMap_.get(this.rootType_) || chrome.fileManagerPrivate.SearchType.ALL; return new Promise((resolve, reject) => { - metrics.startInterval('Search.Drive.Latency'); + startInterval('Search.Drive.Latency'); chrome.fileManagerPrivate.searchDriveMetadata( { query: this.query_, @@ -501,7 +501,7 @@ } else if (!results) { reject(createDOMError(util.FileError.INVALID_MODIFICATION_ERR)); } else { - metrics.recordInterval('Search.Drive.Latency'); + recordInterval('Search.Drive.Latency'); resolve(results.map(r => r.entry)); } }); @@ -605,7 +605,7 @@ } } successCallback(); - metrics.recordMediumCount('Search.ResultCount', resultCount); + recordMediumCount('Search.ResultCount', resultCount); }); } }
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model.js b/ui/file_manager/file_manager/foreground/js/directory_model.js index dc0d062..dcf5fbbc 100644 --- a/ui/file_manager/file_manager/foreground/js/directory_model.js +++ b/ui/file_manager/file_manager/foreground/js/directory_model.js
@@ -8,7 +8,7 @@ import {Aggregator, AsyncQueue} from '../../common/js/async_util.js'; import {EntryList, GuestOsPlaceholder, VolumeEntry} from '../../common/js/files_app_entry_types.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordMediumCount} from '../../common/js/metrics.js'; import {util} from '../../common/js/util.js'; import {isNative, VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {FileOperationManager} from '../../externs/background/file_operation_manager.js'; @@ -1014,8 +1014,7 @@ volumeInfo.volumeType === VolumeManagerCommon.VolumeType.DOWNLOADS && locationInfo.isRootEntry) { - metrics.recordMediumCount( - 'DownloadsCount', dirContents.getFileListLength()); + recordMediumCount('DownloadsCount', dirContents.getFileListLength()); } }
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js index c90f233..3e8425e 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -21,7 +21,7 @@ import {FakeEntryImpl} from '../../common/js/files_app_entry_types.js'; import {FilesAppState} from '../../common/js/files_app_state.js'; import {FilteredVolumeManager} from '../../common/js/filtered_volume_manager.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordEnum, recordInterval, startInterval} from '../../common/js/metrics.js'; import {ProgressItemState} from '../../common/js/progress_center_common.js'; import {TrashRootEntry} from '../../common/js/trash.js'; import {str, util} from '../../common/js/util.js'; @@ -587,10 +587,10 @@ * @private */ async startInitSettings_() { - metrics.startInterval('Load.InitSettings'); + startInterval('Load.InitSettings'); this.appStateController_ = new AppStateController(this.dialogType); await this.appStateController_.loadInitialViewOptions(); - metrics.recordInterval('Load.InitSettings'); + recordInterval('Load.InitSettings'); } /** @@ -894,14 +894,14 @@ this.dialogDom_ = dialogDom; this.document_ = this.dialogDom_.ownerDocument; - metrics.startInterval('Load.InitDocuments'); + startInterval('Load.InitDocuments'); // importElements depend on loadTimeData which is initialized in the // initBackgroundPagePromise_. await this.initBackgroundPagePromise_; await importElements(); - metrics.recordInterval('Load.InitDocuments'); + recordInterval('Load.InitDocuments'); - metrics.startInterval('Load.InitUI'); + startInterval('Load.InitUI'); this.document_.documentElement.classList.add('files-ng'); this.dialogDom_.classList.add('files-ng'); @@ -925,7 +925,7 @@ const store = getStore(); store.init(getEmptyState()); this.initUIFocus_(); - metrics.recordInterval('Load.InitUI'); + recordInterval('Load.InitUI'); chrome.fileManagerPrivate.onDeviceConnectionStatusChanged.addListener( this.updateDeviceConnectionState_.bind(this)); @@ -976,7 +976,7 @@ * @private */ async startInitBackgroundPage_() { - metrics.startInterval('Load.InitBackgroundPage'); + startInterval('Load.InitBackgroundPage'); this.fileBrowserBackground_ = /** @type {!ForegroundWindow} */ (window).background; @@ -995,7 +995,7 @@ this.fileBrowserBackground_.fileOperationManager; this.crostini_ = this.fileBrowserBackground_.crostini; - metrics.recordInterval('Load.InitBackgroundPage'); + recordInterval('Load.InitBackgroundPage'); } /** @@ -1039,7 +1039,7 @@ // array enumerating the types. It must be in sync with // FileDialogType enum in tools/metrics/histograms/histogram.xml. const metricName = 'SWA.Create'; - metrics.recordEnum(metricName, this.dialogType, [ + recordEnum(metricName, this.dialogType, [ DialogType.SELECT_FOLDER, DialogType.SELECT_UPLOAD_FOLDER, DialogType.SELECT_SAVEAS_FILE, @@ -1432,7 +1432,7 @@ // query, and select it if exists. const searchQuery = this.launchParams_.searchQuery; if (searchQuery) { - metrics.startInterval('Load.ProcessInitialSearchQuery'); + startInterval('Load.ProcessInitialSearchQuery'); this.store_.dispatch(updateSearch({ query: searchQuery, status: PropStatus.STARTED, @@ -1448,7 +1448,7 @@ nextCurrentDirEntry = queryMatchedDirEntry; } hideSpinnerCallback(); - metrics.recordInterval('Load.ProcessInitialSearchQuery'); + recordInterval('Load.ProcessInitialSearchQuery'); } // Resolve the currentDirectoryURL to currentDirectoryEntry (if not done by
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js index b5384ed..a5c8c345 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
@@ -12,7 +12,7 @@ import {getFocusedTreeItem, isDirectoryTree, isDirectoryTreeItem} from '../../common/js/dom_utils.js'; import {FileType} from '../../common/js/file_type.js'; import {EntryList} from '../../common/js/files_app_entry_types.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordEnum, recordUserAction} from '../../common/js/metrics.js'; import {deleteIsForever, RestoreFailedType, RestoreFailedTypesUMA, RestoreFailedUMA, shouldMoveToTrash, TrashEntry} from '../../common/js/trash.js'; import {str, strf, util} from '../../common/js/util.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; @@ -747,7 +747,7 @@ * @param {CommandHandler.MenuCommandsForUMA} menuItem The selected menu item. */ CommandHandler.recordMenuItemSelected = menuItem => { - metrics.recordEnum( + recordEnum( 'MenuItemSelected', menuItem, CommandHandler.ValidMenuCommandsForUMA); }; @@ -1019,7 +1019,7 @@ targetDirectory, newName, {create: true, exclusive: true})) .then( (newDirectory) => { - metrics.recordUserAction('CreateNewFolder'); + recordUserAction('CreateNewFolder'); // Select new directory and start rename operation. if (executedFromDirectoryTree) { @@ -1485,7 +1485,7 @@ if (failedParents && failedParents.length > 0) { // Only a single item is being trashed and the parent doesn't exist. if (failedParents.length === 1 && infoEntries.length === 0) { - metrics.recordEnum( + recordEnum( RestoreFailedUMA, RestoreFailedType.SINGLE_ITEM, RestoreFailedTypesUMA); fileManager.ui.alertDialog.show( @@ -1499,7 +1499,7 @@ p => p.parentName === failedParents[0].parentName); // All the items were from the same parent folder. if (isParentFolderSame) { - metrics.recordEnum( + recordEnum( RestoreFailedUMA, RestoreFailedType.MULTIPLE_ITEMS_SAME_PARENTS, RestoreFailedTypesUMA); fileManager.ui.alertDialog.show(strf( @@ -1508,7 +1508,7 @@ return; } // All the items are from different parent folders. - metrics.recordEnum( + recordEnum( RestoreFailedUMA, RestoreFailedType.MULTIPLE_ITEMS_DIFFERENT_PARENTS, RestoreFailedTypesUMA); @@ -1518,7 +1518,7 @@ } // A mix of items with parents and without parents are attempting to be // restored. - metrics.recordEnum( + recordEnum( RestoreFailedUMA, RestoreFailedType.MULTIPLE_ITEMS_MIXED, RestoreFailedTypesUMA); fileManager.ui.alertDialog.show(str('CANT_RESTORE_SOME_ITEMS'));
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager_commands_unittest.js b/ui/file_manager/file_manager/foreground/js/file_manager_commands_unittest.js index a01c689..4e5f819 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager_commands_unittest.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager_commands_unittest.js
@@ -6,8 +6,7 @@ import {MockVolumeManager} from '../../background/js/mock_volume_manager.js'; import {FakeEntryImpl} from '../../common/js/files_app_entry_types.js'; -import {metrics} from '../../common/js/metrics.js'; -import {installMockChrome} from '../../common/js/mock_chrome.js'; +import {installMockChrome, MockMetrics} from '../../common/js/mock_chrome.js'; import {MockDirectoryEntry, MockEntry} from '../../common/js/mock_entry.js'; import {waitUntil} from '../../common/js/test_error_reporting.js'; import {util} from '../../common/js/util.js'; @@ -19,20 +18,16 @@ import {CommandHandler} from './file_manager_commands.js'; -/** - * Mock metrics.recordEnum. - * @param {string} name - * @param {*} value - * @param {Array<*>|number=} opt_validValues - */ -metrics.recordEnum = function(name, value, opt_validValues) { - if (!Array.isArray(metrics.recordEnumCalls[name])) { - metrics.recordEnumCalls[name] = []; - } - metrics.recordEnumCalls[name].push(value); -}; +/** @type {!MockMetrics} */ +let mockMetrics; -metrics.recordEnumCalls = {}; +/** + * @param {number} metricIndex + * @returns {string|undefined} + */ +function getMetricName(metricIndex) { + return CommandHandler.ValidMenuCommandsForUMA[metricIndex]; +} /** * Checks that the `toggle-holding-space` command is appropriately enabled/ @@ -50,7 +45,9 @@ * @type {!Object} */ let itemUrls = []; + mockMetrics = new MockMetrics(); const mockChrome = { + metricsPrivate: mockMetrics, fileManagerPrivate: { getHoldingSpaceState: (callback) => { callback({itemUrls}); @@ -244,17 +241,21 @@ }; // Reset cache of metrics recorded. - metrics.recordEnumCalls['MenuItemSelected'] = []; + mockMetrics.metricCalls['FileBrowser.MenuItemSelected'] = []; // Verify `command.execute()` results in expected mock API interactions. command.execute(event, fileManager); assertTrue(didInteractWithMockPrivateApi); // Verify metrics recorded. - assertArrayEquals( - metrics.recordEnumCalls['MenuItemSelected'], - [testCase.expect.isAdd ? 'pin-to-holding-space' : - 'unpin-from-holding-space']); + const calls = mockMetrics.metricCalls['FileBrowser.MenuItemSelected'] || []; + assertTrue(calls.length > 0); + // The index is 2nd position argument, we're only checking the first call. + const metricIndex = calls[0][1]; + assertEquals( + getMetricName(metricIndex), + testCase.expect.isAdd ? 'pin-to-holding-space' : + 'unpin-from-holding-space'); } done();
diff --git a/ui/file_manager/file_manager/foreground/js/file_tasks.ts b/ui/file_manager/file_manager/foreground/js/file_tasks.ts index 066ec98..fc52206 100644 --- a/ui/file_manager/file_manager/foreground/js/file_tasks.ts +++ b/ui/file_manager/file_manager/foreground/js/file_tasks.ts
@@ -13,7 +13,7 @@ import {AsyncQueue} from '../../common/js/async_util.js'; import {type AnnotatedTask, annotateTasks, getDefaultTask, INSTALL_LINUX_PACKAGE_TASK_DESCRIPTOR, isFilesAppId, parseActionId} from '../../common/js/file_tasks.js'; import {FileType} from '../../common/js/file_type.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordEnum, recordTime} from '../../common/js/metrics.js'; import {ProgressCenterItem, ProgressItemState, ProgressItemType} from '../../common/js/progress_center_common.js'; import {LEGACY_FILES_EXTENSION_ID} from '../../common/js/url_constants.js'; import {str, strf, util} from '../../common/js/util.js'; @@ -177,11 +177,11 @@ */ private static recordEnumWithOnlineAndOffline_( volumeManager: VolumeManager, name: string, value: any, values: any[]) { - metrics.recordEnum(name, value, values); + recordEnum(name, value, values); if (FileTasks.isOffline_(volumeManager)) { - metrics.recordEnum(name + '.Offline', value, values); + recordEnum(name + '.Offline', value, values); } else { - metrics.recordEnum(name + '.Online', value, values); + recordEnum(name + '.Online', value, values); } } @@ -242,7 +242,7 @@ default: root = 'Other'; } - metrics.recordTime(`ZipMountTime.${root}`, time); + recordTime(`ZipMountTime.${root}`, time); } /** @@ -290,9 +290,9 @@ break; } - metrics.recordEnum( + recordEnum( histogramName, fileHandler, - Object.keys(OfficeFileHandlersHistogramValues).length); + Object.values(OfficeFileHandlersHistogramValues)); } /** Returns true if the descriptor is for an internal task. */ @@ -579,11 +579,11 @@ const isBulkPinningEnabled = !!getStore().getState()?.preferences?.driveFsBulkPinningEnabled; for (const entry of this.entries_) { - metrics.recordEnum( + recordEnum( 'DriveOfflineOpen.Unavailable', FileTasks.getViewFileType(entry), UMA_INDEX_KNOWN_EXTENSIONS as string[]); if (isBulkPinningEnabled) { - metrics.recordEnum( + recordEnum( 'GoogleDrive.BulkPinning.OfflineOpen', FileTasks.getViewFileType(entry), UMA_INDEX_KNOWN_EXTENSIONS as string[]);
diff --git a/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.ts b/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.ts index d3cadee7..afc75628 100644 --- a/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.ts +++ b/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.ts
@@ -7,8 +7,7 @@ import {createCrostiniForTest} from '../../background/js/mock_crostini.js'; import {MockProgressCenter} from '../../background/js/mock_progress_center.js'; -import {metrics} from '../../common/js/metrics.js'; -import {installMockChrome} from '../../common/js/mock_chrome.js'; +import {installMockChrome, MockMetrics} from '../../common/js/mock_chrome.js'; import {MockFileEntry, MockFileSystem} from '../../common/js/mock_entry.js'; import {ProgressItemState} from '../../common/js/progress_center_common.js'; import {LEGACY_FILES_EXTENSION_ID} from '../../common/js/url_constants.js'; @@ -31,64 +30,13 @@ import {ImportCrostiniImageDialog} from './ui/import_crostini_image_dialog.js'; import {InstallLinuxPackageDialog} from './ui/install_linux_package_dialog.js'; -/** Utility function that appends value under a given name in the store. */ -function record<T>(store: Map<string, T[]>, name: string, value: T) { - let recorded = store.get(name); - if (!recorded) { - recorded = []; - store.set(name, recorded); - } - recorded.push(value); -} - -/** - * A map from histogram name to all enums recorded for it. - */ -const enumMap = new Map(); - -/** - * A map from histogram name to all counts recorded for it. - */ -const countMap = new Map(); - -/** - * A map from histogram name to all times recorded for it. - */ -const timeMap = new Map(); - let passwordDialog: XfPasswordDialog; -/** Mock metrics.recordEnum. */ -// @ts-ignore: Remove ignore once metrics_base.recordEnum() is in TS and the -// signature is compatible. -metrics.recordEnum = function<T>(name: string, value: T, valid: T[]): void { - assertTrue(valid.includes(value)); - record(enumMap, name, value); -}; +/** Mock chrome APIs. */ +let mockChrome: any; -/** - * Mock metrics.recordSmallCount. - * @param {string} name Short metric name. - * @param {number} value Value to be recorded. - */ -metrics.recordSmallCount = function(name: string, value: number) { - record(countMap, name, value); -}; - -/** - * Mock metrics.recordTime. - * @param {string} name Short metric name. - * @param {number} time Time to be recorded in milliseconds. - */ -metrics.recordTime = function(name: string, time: number) { - record(timeMap, name, time); -}; - -/** - * Mock chrome APIs. - * @type {!Object} - */ -let mockChrome; +/** Mock to keep track of the calls to metricsPrivate. */ +let mockMetrics: MockMetrics; /** Mock task history. */ const mockTaskHistory = { @@ -137,8 +85,11 @@ isGenericFileHandler: true, } as unknown as chrome.fileManagerPrivate.FileTask; + mockMetrics = new MockMetrics(); + // Mock chome APIs. mockChrome = { + metricsPrivate: mockMetrics, fileManagerPrivate: { getFileTasks: function( _entries: Entry[], _sourceUrls: string[], @@ -159,9 +110,6 @@ }; installMockChrome(mockChrome); - enumMap.clear(); - countMap.clear(); - timeMap.clear(); } /** @@ -636,7 +584,7 @@ undefined, fileManager.progressCenter.getItemById(errorZipMountPanelId)); // Check: a zip mount time UMA has been recorded. - assertTrue(timeMap.has('ZipMountTime.Other')); + assertTrue('FileBrowser.ZipMountTime.Other' in mockMetrics.metricCalls); done(); } @@ -675,7 +623,7 @@ // Check: no zip mount time UMA has been recorded since mounting the archive // failed. - assertFalse(timeMap.has('ZipMountTime.Other')); + assertFalse('FileBrowser.ZipMountTime.Other' in mockMetrics.metricCalls); done(); } @@ -719,7 +667,7 @@ // Check: no zip mount time UMA has been recorded since the mount has been // cancelled. - assertFalse(timeMap.has('ZipMountTime.Other')); + assertFalse('FileBrowser.ZipMountTime.Other' in mockMetrics.metricCalls); done(); }
diff --git a/ui/file_manager/file_manager/foreground/js/file_type_filters_controller.js b/ui/file_manager/file_manager/foreground/js/file_type_filters_controller.js index f84572e..e4338ac 100644 --- a/ui/file_manager/file_manager/foreground/js/file_type_filters_controller.js +++ b/ui/file_manager/file_manager/foreground/js/file_type_filters_controller.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import {createChild} from '../../common/js/dom_utils.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordEnum} from '../../common/js/metrics.js'; import {str, strf, util} from '../../common/js/util.js'; import {DirectoryChangeEvent} from '../../externs/directory_change_event.js'; import {FakeEntry} from '../../externs/files_app_entry_interfaces.js'; @@ -155,8 +155,7 @@ chrome.fileManagerPrivate.FileCategory.DOCUMENT, // 4 ]); Object.freeze(FileTypeFiltersForUMA); - metrics.recordEnum( - 'Recent.FilterByType', fileCategory, FileTypeFiltersForUMA); + recordEnum('Recent.FilterByType', fileCategory, FileTypeFiltersForUMA); } /**
diff --git a/ui/file_manager/file_manager/foreground/js/file_type_filters_controller_unittest.js b/ui/file_manager/file_manager/foreground/js/file_type_filters_controller_unittest.js index f3d4452..c6c12a5c 100644 --- a/ui/file_manager/file_manager/foreground/js/file_type_filters_controller_unittest.js +++ b/ui/file_manager/file_manager/foreground/js/file_type_filters_controller_unittest.js
@@ -6,7 +6,7 @@ import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js'; import {EntryList, FakeEntryImpl} from '../../common/js/files_app_entry_types.js'; -import {metrics} from '../../common/js/metrics.js'; +import {installMockChrome} from '../../common/js/mock_chrome.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {DirectoryChangeEvent} from '../../externs/directory_change_event.js'; import {FakeEntry} from '../../externs/files_app_entry_interfaces.js'; @@ -40,17 +40,10 @@ */ let fileTypeFiltersController; -/** - * Mock metrics. - * @param {string} name - * @param {*} value - * @param {Array<*>|number=} opt_validValues - */ -metrics.recordEnum = function(name, value, opt_validValues) {}; - const TOTAL_FILTER_BUTTON_COUNT = 5; export function setUp() { + installMockChrome({}); class MockDirectoryModel extends EventTarget { constructor() { super();
diff --git a/ui/file_manager/file_manager/foreground/js/folder_shortcuts_data_model.js b/ui/file_manager/file_manager/foreground/js/folder_shortcuts_data_model.js index 30cc8c1a..613f813 100644 --- a/ui/file_manager/file_manager/foreground/js/folder_shortcuts_data_model.js +++ b/ui/file_manager/file_manager/foreground/js/folder_shortcuts_data_model.js
@@ -7,7 +7,7 @@ import {getPreferences} from '../../common/js/api.js'; import {AsyncQueue, Group} from '../../common/js/async_util.js'; import {FilteredVolumeManager} from '../../common/js/filtered_volume_manager.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordSmallCount, recordUserAction} from '../../common/js/metrics.js'; import {util} from '../../common/js/util.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {addFolderShortcut, refreshFolderShortcut, removeFolderShortcut} from '../../state/ducks/folder_shortcuts.js'; @@ -201,7 +201,7 @@ try { const shortcutPaths = await this.getPersistedShortcutPaths_(); // Record metrics. - metrics.recordSmallCount('FolderShortcut.Count', shortcutPaths.length); + recordSmallCount('FolderShortcut.Count', shortcutPaths.length); // Resolve and add the entries to the model. this.processEntries_(shortcutPaths); // Runs within a queue. @@ -315,7 +315,7 @@ add(value) { const result = this.addInternal_(value); this.store_.dispatch(addFolderShortcut({entry: value})); - metrics.recordUserAction('FolderShortcut.Add'); + recordUserAction('FolderShortcut.Add'); this.save_(); return result; } @@ -368,7 +368,7 @@ if (result !== -1) { this.store_.dispatch(removeFolderShortcut({key: value.toURL()})); this.save_(); - metrics.recordUserAction('FolderShortcut.Remove'); + recordUserAction('FolderShortcut.Remove'); } return result; }
diff --git a/ui/file_manager/file_manager/foreground/js/holding_space_util.js b/ui/file_manager/file_manager/foreground/js/holding_space_util.js index 8eaa63d..c2e9129 100644 --- a/ui/file_manager/file_manager/foreground/js/holding_space_util.js +++ b/ui/file_manager/file_manager/foreground/js/holding_space_util.js
@@ -6,7 +6,7 @@ * @fileoverview Utility methods for the holding space feature. */ -import {metrics} from '../../common/js/metrics.js'; +import {recordValue} from '../../common/js/metrics.js'; import {storage} from '../../common/js/storage.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; @@ -109,7 +109,7 @@ // respectively. const oneSecondInMillis = 1000; const oneDayInMillis = 24 * 60 * 60 * 1000; - metrics.recordValue( + recordValue( /*name=*/ 'HoldingSpace.TimeFromFirstWelcomeBannerShowToFirstPin', chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LOG, /*min=*/ oneSecondInMillis,
diff --git a/ui/file_manager/file_manager/foreground/js/list_thumbnail_loader.js b/ui/file_manager/file_manager/foreground/js/list_thumbnail_loader.js index 572e392c..78c46653 100644 --- a/ui/file_manager/file_manager/foreground/js/list_thumbnail_loader.js +++ b/ui/file_manager/file_manager/foreground/js/list_thumbnail_loader.js
@@ -5,7 +5,7 @@ import {assert} from 'chrome://resources/ash/common/assert.js'; import {NativeEventTarget as EventTarget} from 'chrome://resources/ash/common/event_target.js'; -import {LRUCache} from '../../common/js/lru_cache.js'; +import {LruCache} from '../../common/js/lru_cache.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {VolumeManager} from '../../externs/volume_manager.js'; @@ -62,9 +62,9 @@ this.active_ = {}; /** - * @private {LRUCache<!ListThumbnailLoader.ThumbnailData>} + * @private {LruCache<!ListThumbnailLoader.ThumbnailData>} */ - this.cache_ = new LRUCache(ListThumbnailLoader.CACHE_SIZE); + this.cache_ = new LruCache(ListThumbnailLoader.CACHE_SIZE); /** * @private {number}
diff --git a/ui/file_manager/file_manager/foreground/js/main_window_component.js b/ui/file_manager/file_manager/foreground/js/main_window_component.js index 374a739..2dc543f 100644 --- a/ui/file_manager/file_manager/foreground/js/main_window_component.js +++ b/ui/file_manager/file_manager/foreground/js/main_window_component.js
@@ -6,7 +6,7 @@ import {DialogType, isFolderDialogType} from '../../common/js/dialog_type.js'; import {getFocusedTreeItem, getKeyModifiers} from '../../common/js/dom_utils.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordEnum} from '../../common/js/metrics.js'; import {TrashEntry} from '../../common/js/trash.js'; import {str, util} from '../../common/js/util.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; @@ -376,8 +376,7 @@ // explicitly show the tooltip. this.ui_.filesTooltip.updateTooltipText( /** @type {!HTMLElement} */ (this.ui_.toggleViewButton)); - metrics.recordEnum( - 'ToggleFileListType', listType, ListContainer.ListTypesForUMA); + recordEnum('ToggleFileListType', listType, ListContainer.ListTypesForUMA); } /**
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/BUILD.gn b/ui/file_manager/file_manager/foreground/js/metadata/BUILD.gn index b3953d5..493e20d 100644 --- a/ui/file_manager/file_manager/foreground/js/metadata/BUILD.gn +++ b/ui/file_manager/file_manager/foreground/js/metadata/BUILD.gn
@@ -48,11 +48,13 @@ js_type_check("closure_compile_jsmodules") { closure_flags = default_closure_args + [ "language_in=ECMASCRIPT_2020", + "js_module_root=gen/ui/file_manager/tsc/", "js_module_root=gen/ui/file_manager/", "js_module_root=" + rebase_path("//ui/file_manager/", root_build_dir), "browser_resolver_prefix_replacements=\"chrome://file-manager/=./file_manager/\"", "browser_resolver_prefix_replacements=\"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/=./image_loader/\"", + "hide_warnings_for=gen/ui/file_manager/tsc/", ] deps = [ @@ -79,6 +81,7 @@ ":mpeg_parser", ":multi_metadata_provider", ":thumbnail_model", + "//ui/file_manager:js_from_ts", ] } @@ -366,6 +369,7 @@ closure_flags = strict_error_checking_closure_args + [ "language_in=ECMASCRIPT_2020", "js_module_root=./gen/ui", + "js_module_root=./gen/ui/file_manager/tsc/", "js_module_root=" + rebase_path("//ui/file_manager/", root_build_dir), "js_module_root=./gen/ui/file_manager/", @@ -373,5 +377,7 @@ "browser_resolver_prefix_replacements=\"chrome://file-manager/=./file_manager/\"", "browser_resolver_prefix_replacements=\"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/=./image_loader/\"", "hide_warnings_for=third_party/", + "hide_warnings_for=gen/ui/file_manager/tsc/", ] + extra_deps = [ "//ui/file_manager:js_from_ts" ] }
diff --git a/ui/file_manager/file_manager/foreground/js/metrics_start.js b/ui/file_manager/file_manager/foreground/js/metrics_start.js index 65991c7a..d54ac1e 100644 --- a/ui/file_manager/file_manager/foreground/js/metrics_start.js +++ b/ui/file_manager/file_manager/foreground/js/metrics_start.js
@@ -8,7 +8,7 @@ * define the metrics namespace). */ -import {metrics} from '../../common/js/metrics.js'; +import {startInterval} from '../../common/js/metrics.js'; -metrics.startInterval('Load.Total'); -metrics.startInterval('Load.Script'); +startInterval('Load.Total'); +startInterval('Load.Script');
diff --git a/ui/file_manager/file_manager/foreground/js/navigation_uma.js b/ui/file_manager/file_manager/foreground/js/navigation_uma.js index 6bbb7421..900d9f69 100644 --- a/ui/file_manager/file_manager/foreground/js/navigation_uma.js +++ b/ui/file_manager/file_manager/foreground/js/navigation_uma.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 {metrics} from '../../common/js/metrics.js'; +import {recordEnum} from '../../common/js/metrics.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {VolumeManager} from '../../externs/volume_manager.js'; @@ -34,7 +34,7 @@ exportRootType_(entry, name) { const locationInfo = this.volumeManager_.getLocationInfo(entry); if (locationInfo) { - metrics.recordEnum( + recordEnum( name, locationInfo.rootType, VolumeManagerCommon.RootTypesForUMA); } }
diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_uma.js b/ui/file_manager/file_manager/foreground/js/quick_view_uma.js index befee9c..9835a66 100644 --- a/ui/file_manager/file_manager/foreground/js/quick_view_uma.js +++ b/ui/file_manager/file_manager/foreground/js/quick_view_uma.js
@@ -6,7 +6,7 @@ import {DialogType} from '../../common/js/dialog_type.js'; import {FileType} from '../../common/js/file_type.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordEnum} from '../../common/js/metrics.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {VolumeManager} from '../../externs/volume_manager.js'; @@ -50,7 +50,7 @@ } else if (UMA_INDEX_KNOWN_EXTENSIONS.indexOf(extension) < 0) { extension = 'unknown extension'; } - metrics.recordEnum(name, extension, UMA_INDEX_KNOWN_EXTENSIONS); + recordEnum(name, extension, UMA_INDEX_KNOWN_EXTENSIONS); } /** @@ -70,15 +70,13 @@ */ onOpened(entry, wayToOpen) { this.exportFileType_(entry, 'QuickView.FileTypeOnLaunch'); - metrics.recordEnum( - 'QuickView.WayToOpen', wayToOpen, QuickViewUma.WayToOpenValues_); + recordEnum('QuickView.WayToOpen', wayToOpen, QuickViewUma.WayToOpenValues_); const volumeInfo = this.volumeManager_.getVolumeInfo(entry); const volumeType = volumeInfo && volumeInfo.volumeType; if (volumeType) { if (QuickViewUma.VolumeType.includes(volumeType)) { - metrics.recordEnum( - 'QuickView.VolumeType', volumeType, QuickViewUma.VolumeType); + recordEnum('QuickView.VolumeType', volumeType, QuickViewUma.VolumeType); } else { console.warn('Unknown volume type: ' + volumeType); } @@ -87,7 +85,7 @@ } // Record stats of dialog types. It must be in sync with // FileDialogType enum in tools/metrics/histograms/enums.xml. - metrics.recordEnum('QuickView.DialogType', this.dialogType_, [ + recordEnum('QuickView.DialogType', this.dialogType_, [ DialogType.SELECT_FOLDER, DialogType.SELECT_UPLOAD_FOLDER, DialogType.SELECT_SAVEAS_FILE,
diff --git a/ui/file_manager/file_manager/foreground/js/scan_controller.js b/ui/file_manager/file_manager/foreground/js/scan_controller.js index 9e1de35..9ce5f6e 100644 --- a/ui/file_manager/file_manager/foreground/js/scan_controller.js +++ b/ui/file_manager/file_manager/foreground/js/scan_controller.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 {metrics} from '../../common/js/metrics.js'; +import {recordDirectoryListLoadWithTolerance, startInterval} from '../../common/js/metrics.js'; import {util} from '../../common/js/util.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {Store} from '../../externs/ts/store.js'; @@ -90,7 +90,7 @@ if (volumeInfo && (volumeInfo.volumeType === VolumeManagerCommon.VolumeType.DOWNLOADS || volumeInfo.volumeType === VolumeManagerCommon.VolumeType.MY_FILES)) { - metrics.startInterval( + startInterval( `DirectoryListLoad.${VolumeManagerCommon.RootType.MY_FILES}`); } @@ -144,7 +144,7 @@ volumeInfo.volumeType === VolumeManagerCommon.VolumeType.MY_FILES)) { const metricName = `DirectoryListLoad.${VolumeManagerCommon.RootType.MY_FILES}`; - metrics.recordDirectoryListLoadWithTolerance( + recordDirectoryListLoadWithTolerance( metricName, this.directoryModel_.getFileList().length, [10, 100, 1000], /*tolerance=*/ 0.2); }
diff --git a/ui/file_manager/file_manager/foreground/js/task_controller.ts b/ui/file_manager/file_manager/foreground/js/task_controller.ts index 68eae189..d2d00d0b 100644 --- a/ui/file_manager/file_manager/foreground/js/task_controller.ts +++ b/ui/file_manager/file_manager/foreground/js/task_controller.ts
@@ -11,7 +11,7 @@ import {getMimeType, startIOTask} from '../../common/js/api.js'; import {type AnnotatedTask, getDefaultTask} from '../../common/js/file_tasks.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordDirectoryListLoadWithTolerance, startInterval} from '../../common/js/metrics.js'; import {str, strf, util} from '../../common/js/util.js'; import {Crostini} from '../../externs/background/crostini.js'; import {ProgressCenter} from '../../externs/background/progress_center.js'; @@ -419,7 +419,7 @@ try { const metricName = 'UpdateAvailableApps'; - metrics.startInterval(metricName); + startInterval(metricName); const tasks = await this.getFileTasks(); // Update the DOM. this.display_(tasks); @@ -429,7 +429,7 @@ if (window.IN_TEST) { this.ui_.taskMenuButton.toggleAttribute('get-tasks-completed', true); } - metrics.recordDirectoryListLoadWithTolerance( + recordDirectoryListLoadWithTolerance( metricName, openTaskItems.length, [10, 100], /*tolerance=*/ 0.8); } catch (error: any) { if (error) {
diff --git a/ui/file_manager/file_manager/foreground/js/task_controller_unittest.ts b/ui/file_manager/file_manager/foreground/js/task_controller_unittest.ts index 95483c4..685eb25 100644 --- a/ui/file_manager/file_manager/foreground/js/task_controller_unittest.ts +++ b/ui/file_manager/file_manager/foreground/js/task_controller_unittest.ts
@@ -8,7 +8,6 @@ import {createCrostiniForTest} from '../../background/js/mock_crostini.js'; import {queryDecoratedElement} from '../../common/js/dom_utils.js'; -import {metrics} from '../../common/js/metrics.js'; import {installMockChrome} from '../../common/js/mock_chrome.js'; import {MockFileEntry, MockFileSystem} from '../../common/js/mock_entry.js'; import {reportPromise} from '../../common/js/test_error_reporting.js'; @@ -34,12 +33,6 @@ import {FileManagerUI} from './ui/file_manager_ui.js'; import {FilesMenuItem} from './ui/files_menu.js'; - -/** Mock metrics. */ -metrics.recordEnum = function( - _name: string, _value: any, _valid?: any[]|number) {}; -metrics.recordDirectoryListLoadWithTolerance = function() {}; - /** Mock chrome APIs. */ let mockChrome: any;
diff --git a/ui/file_manager/file_manager/foreground/js/ui/BUILD.gn b/ui/file_manager/file_manager/foreground/js/ui/BUILD.gn index b8e24bd1..e873cbb 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/BUILD.gn +++ b/ui/file_manager/file_manager/foreground/js/ui/BUILD.gn
@@ -243,7 +243,6 @@ "//ui/file_manager/file_manager/common/js:file_type", "//ui/file_manager/file_manager/common/js:files_app_entry_types", "//ui/file_manager/file_manager/common/js:icon_util", - "//ui/file_manager/file_manager/common/js:metrics", "//ui/file_manager/file_manager/common/js:util", "//ui/file_manager/file_manager/common/js:volume_manager_types", "//ui/file_manager/file_manager/externs:files_app_entry_interfaces", @@ -824,6 +823,7 @@ "language_in=ECMASCRIPT_2020", "generate_exports=false", "js_module_root=./gen/ui", + "js_module_root=./gen/ui/file_manager/tsc/", "js_module_root=" + rebase_path("//ui/file_manager/", root_build_dir), "js_module_root=./gen/ui/file_manager/", @@ -832,5 +832,7 @@ "browser_resolver_prefix_replacements=\"chrome://file-manager/=./file_manager/\"", "browser_resolver_prefix_replacements=\"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/=./image_loader/\"", "hide_warnings_for=third_party/", + "hide_warnings_for=gen/ui/file_manager/tsc/", ] + extra_deps = [ "//ui/file_manager:js_from_ts" ] }
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/google_one_offer_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/google_one_offer_banner.ts index 46ddecb..e137af5c 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/google_one_offer_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/google_one_offer_banner.ts
@@ -9,7 +9,7 @@ * @suppress {checkTypes} */ -import {metrics} from '../../../../common/js/metrics.js'; +import {recordUserAction} from '../../../../common/js/metrics.js'; import {VolumeManagerCommon} from '../../../../common/js/volume_manager_types.js'; import {EducationalBanner} from './educational_banner.js'; @@ -77,14 +77,14 @@ * Called when the banner gets shown in the UI. */ override onShow() { - metrics.recordUserAction(UserActions.SHOWN); + recordUserAction(UserActions.SHOWN); } /** * Called when the get perk button gets clicked. */ private onGetPerkButtonClickHandler_() { - metrics.recordUserAction(UserActions.GET_PERK); + recordUserAction(UserActions.GET_PERK); } /** @@ -99,7 +99,7 @@ return; } - metrics.recordUserAction(UserActions.DISMISS); + recordUserAction(UserActions.DISMISS); } }
diff --git a/ui/file_manager/file_manager/foreground/js/ui/directory_tree.js b/ui/file_manager/file_manager/foreground/js/ui/directory_tree.js index 0a29a0c..98ff5e2f 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/directory_tree.js +++ b/ui/file_manager/file_manager/foreground/js/ui/directory_tree.js
@@ -10,7 +10,7 @@ import {isEntryInsideDrive} from '../../../common/js/entry_utils.js'; import {FileType} from '../../../common/js/file_type.js'; import {vmTypeToIconName} from '../../../common/js/icon_util.js'; -import {metrics} from '../../../common/js/metrics.js'; +import {recordEnum, recordInterval, recordSmallCount, recordUserAction, startInterval} from '../../../common/js/metrics.js'; import {str, strf, util} from '../../../common/js/util.js'; import {VolumeManagerCommon} from '../../../common/js/volume_manager_types.js'; import {FileOperationManager} from '../../../externs/background/file_operation_manager.js'; @@ -148,8 +148,7 @@ metricName = 'Location.OnEntryExpandedOrCollapsed.NonTopLevel'; } - metrics.recordEnum( - metricName, rootType, VolumeManagerCommon.RootTypesForUMA); + recordEnum(metricName, rootType, VolumeManagerCommon.RootTypesForUMA); }; Object.freeze(DirectoryItemTreeBaseMethods); @@ -552,7 +551,7 @@ const rootType = this.rootType; const metricName = rootType ? (`DirectoryTree.Expand.${rootType}`) : 'DirectoryTree.Expand.unknown'; - metrics.startInterval(metricName); + startInterval(metricName); if (this.supportDriveSpecificIcons && !this.onMetadataUpdateBound_) { this.onMetadataUpdateBound_ = this.onMetadataUpdated_.bind(this); @@ -569,11 +568,11 @@ .concat(constants.DLP_METADATA_PREFETCH_PROPERTY_NAMES)); } - metrics.recordInterval(metricName); + recordInterval(metricName); }, () => { this.expanded = false; - metrics.recordInterval(metricName); + recordInterval(metricName); }); e.stopPropagation(); @@ -1376,7 +1375,7 @@ const reader = sharedDriveGrandRoot.createReader(); reader.readEntries((results) => { - metrics.recordSmallCount('TeamDrivesCount', results.length); + recordSmallCount('TeamDrivesCount', results.length); // Only create grand root if there is at least 1 child/result. if (results.length) { if (index !== undefined) { @@ -1442,7 +1441,7 @@ const reader = computerGrandRoot.createReader(); reader.readEntries((results) => { - metrics.recordSmallCount('ComputersCount', results.length); + recordSmallCount('ComputersCount', results.length); // Only create grand root if there is at least 1 child/result. if (results.length) { if (index !== undefined) { @@ -1756,7 +1755,7 @@ const onEntryResolved = (entry) => { // Changes directory to the model item's root directory if needed. if (!util.isSameEntry(directoryModel.getCurrentDirEntry(), entry)) { - metrics.recordUserAction('FolderShortcut.Navigate'); + recordUserAction('FolderShortcut.Navigate'); directoryModel.changeDirectoryEntry(entry); } };
diff --git a/ui/file_manager/file_manager/foreground/js/ui/directory_tree_unittest.js b/ui/file_manager/file_manager/foreground/js/ui/directory_tree_unittest.js index c007c38..db81e3b1 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/directory_tree_unittest.js +++ b/ui/file_manager/file_manager/foreground/js/ui/directory_tree_unittest.js
@@ -9,7 +9,6 @@ import {MockVolumeManager} from '../../../background/js/mock_volume_manager.js'; import {DialogType} from '../../../common/js/dialog_type.js'; import {EntryList} from '../../../common/js/files_app_entry_types.js'; -import {metrics} from '../../../common/js/metrics.js'; import {installMockChrome, MockCommandLinePrivate} from '../../../common/js/mock_chrome.js'; import {MockDirectoryEntry} from '../../../common/js/mock_entry.js'; import {reportPromise, waitUntil} from '../../../common/js/test_error_reporting.js'; @@ -47,20 +46,6 @@ /** @type {!FileSystem} */ let driveFileSystem; -/** - * Mock metrics.recordEnum. - * @param {string} name - * @param {*} value - * @param {Array<*>|number=} opt_validValues - */ -metrics.recordEnum = function(name, value, opt_validValues) {}; - -/** - * Mock metrics.recordSmallCount. - * @param {string} name Short metric name. - * @param {number} value Value to be recorded. - */ -metrics.recordSmallCount = function(name, value) {}; /** * Mock Chrome APIs
diff --git a/ui/file_manager/file_manager/lib/actions_producer_unittest.ts b/ui/file_manager/file_manager/lib/actions_producer_unittest.ts index ab1d4cb..e7b9b40 100644 --- a/ui/file_manager/file_manager/lib/actions_producer_unittest.ts +++ b/ui/file_manager/file_manager/lib/actions_producer_unittest.ts
@@ -3,6 +3,7 @@ // found in the LICENSE file. import {assertEquals, assertNotReached, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js'; +import {installMockChrome} from '../common/js/mock_chrome.js'; import {waitUntil} from '../common/js/test_error_reporting.js'; import {ConcurrentActionInvalidatedError} from './actions_producer.js'; @@ -10,6 +11,9 @@ import {keepLatest, keyedKeepFirst} from './concurrency_models.js'; import {setupTestStore} from './for_tests.js'; +export function setUp() { + installMockChrome({}); +} /** * Helper to accumulate all produced actions from the ActionsProducer. */
diff --git a/ui/file_manager/file_manager/state/ducks/all_entries.ts b/ui/file_manager/file_manager/state/ducks/all_entries.ts index 25ebea5..134384a 100644 --- a/ui/file_manager/file_manager/state/ducks/all_entries.ts +++ b/ui/file_manager/file_manager/state/ducks/all_entries.ts
@@ -6,7 +6,7 @@ import {isDriveRootEntryList, isFakeEntryInDrives, isGrandRootEntryInDrives, isVolumeEntry, sortEntries} from '../../common/js/entry_utils.js'; import {FileType} from '../../common/js/file_type.js'; import {EntryList, VolumeEntry} from '../../common/js/files_app_entry_types.js'; -import {metrics} from '../../common/js/metrics.js'; +import {recordInterval, recordSmallCount, startInterval} from '../../common/js/metrics.js'; import {str, util} from '../../common/js/util.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; import {EntryLocation} from '../../externs/entry_location.js'; @@ -718,7 +718,7 @@ // Track time for reading sub directories if metric for tracking is passed. if (metricNameForTracking) { - metrics.startInterval(metricNameForTracking); + startInterval(metricNameForTracking); } // Type casting here because TS can't exclude the invalid entry types via the @@ -744,7 +744,7 @@ // Track time for reading sub directories if metric for tracking is passed. if (metricNameForTracking) { - metrics.recordInterval(metricNameForTracking); + recordInterval(metricNameForTracking); } // Read sub directories for children when recursive is true. @@ -810,7 +810,7 @@ // show them when there's at least one child entries inside. const grandChildEntries = await readChildEntriesForDirectoryEntry(childEntry); - metrics.recordSmallCount( + recordSmallCount( metricNameMap[childEntry.fullPath]!, grandChildEntries.length); if (grandChildEntries.length > 0) { filteredChildren.push(childEntry);
diff --git a/ui/file_manager/file_manager/state/ducks/all_entries_unittest.ts b/ui/file_manager/file_manager/state/ducks/all_entries_unittest.ts index b0081a9..5feba8db 100644 --- a/ui/file_manager/file_manager/state/ducks/all_entries_unittest.ts +++ b/ui/file_manager/file_manager/state/ducks/all_entries_unittest.ts
@@ -6,7 +6,7 @@ import {fakeMyFilesVolumeId, MockVolumeManager} from '../../background/js/mock_volume_manager.js'; import {EntryList, FakeEntryImpl, GuestOsPlaceholder, VolumeEntry} from '../../common/js/files_app_entry_types.js'; -import {metrics} from '../../common/js/metrics.js'; +import {installMockChrome} from '../../common/js/mock_chrome.js'; import {MockFileSystem} from '../../common/js/mock_entry.js'; import {waitUntil} from '../../common/js/test_error_reporting.js'; import {VolumeManagerCommon} from '../../common/js/volume_manager_types.js'; @@ -29,6 +29,7 @@ // changeDirectory() reducer uses the VolumeManager. // sortEntries() requires the directoryModel on the window.fileManager. setUpFileManagerOnWindow(); + installMockChrome({}); store = setupStore(); @@ -43,11 +44,6 @@ '/dir-2/file-2.txt', '/dir-3/', ]); - - // Mock metrics.recordSmallCount. - metrics.recordSmallCount = function() {}; - metrics.startInterval = function() {}; - metrics.recordInterval = function() {}; } /** Generate MyFiles entry with fake entry list. */
diff --git a/ui/file_manager/file_names.gni b/ui/file_manager/file_names.gni index 1711330075..85dfb09 100644 --- a/ui/file_manager/file_names.gni +++ b/ui/file_manager/file_names.gni
@@ -20,7 +20,6 @@ "file_manager/background/js/file_operation_manager.js", "file_manager/background/js/file_operation_util.js", "file_manager/background/js/launcher.js", - "file_manager/background/js/metrics_start.js", # TODO(lucmult): Check if we can move those mocks to the test files section. "file_manager/background/js/mock_crostini.js", @@ -49,9 +48,6 @@ "file_manager/common/js/files_app_state.js", "file_manager/common/js/filtered_volume_manager.js", "file_manager/common/js/icon_util.js", - "file_manager/common/js/lru_cache.js", - "file_manager/common/js/metrics.js", - "file_manager/common/js/metrics_base.js", "file_manager/common/js/mock_chrome.js", "file_manager/common/js/mock_entry.js", "file_manager/common/js/notifications.js", @@ -230,6 +226,8 @@ "file_manager/common/js/entry_utils.ts", "file_manager/common/js/file_tasks.ts", "file_manager/common/js/file_types_base.ts", + "file_manager/common/js/metrics.ts", + "file_manager/common/js/lru_cache.ts", "file_manager/common/js/script_loader.ts", "file_manager/common/js/trash.ts", "file_manager/common/js/trusted_script_url_policy_util.ts", @@ -309,6 +307,7 @@ "file_manager/background/js/crostini.ts", "file_manager/background/js/drive_sync_handler.ts", "file_manager/background/js/entry_location_impl.ts", + "file_manager/background/js/metrics_start.ts", "file_manager/background/js/volume_info_impl.ts", # Foreground. @@ -365,6 +364,7 @@ # Common. "file_manager/common/js/entry_utils_unittest.ts", "file_manager/common/js/file_types_base_unittest.ts", + "file_manager/common/js/lru_cache_unittest.ts", "file_manager/common/js/mock_util.ts", # Containers @@ -489,7 +489,6 @@ "file_manager/common/js/util_unittest.js", "file_manager/common/js/filtered_volume_manager_unittest.js", "file_manager/common/js/file_type_unittest.js", - "file_manager/common/js/lru_cache_unittest.js", "file_manager/common/js/files_app_entry_types_unittest.js", "file_manager/common/js/recent_date_bucket_unittest.js", "file_manager/common/js/storage_unittest.js",
diff --git a/ui/file_manager/image_loader/BUILD.gn b/ui/file_manager/image_loader/BUILD.gn index 4e51e70..b70da04 100644 --- a/ui/file_manager/image_loader/BUILD.gn +++ b/ui/file_manager/image_loader/BUILD.gn
@@ -12,10 +12,12 @@ closure_flags = default_closure_args + [ "language_in=ECMASCRIPT_2020", "jscomp_error=strictCheckTypes", + "js_module_root=gen/ui/file_manager/tsc/", "js_module_root=gen/ui/file_manager/", "js_module_root=" + rebase_path("//ui/file_manager/", root_build_dir), "browser_resolver_prefix_replacements=\"chrome://file-manager/=./file_manager/\"", + "hide_warnings_for=gen/ui/file_manager/tsc/", ] deps = [ ":background", @@ -27,6 +29,7 @@ ":load_image_request", ":piex_loader", ":scheduler", + "//ui/file_manager:js_from_ts", ] } @@ -78,10 +81,7 @@ } js_library("image_loader_client") { - deps = [ - ":load_image_request", - "//ui/file_manager/file_manager/common/js:lru_cache", - ] + deps = [ ":load_image_request" ] externs_list = [ "$externs_path/chrome.js", "$externs_path/chrome_extensions.js", @@ -151,12 +151,15 @@ closure_flags = strict_error_checking_closure_args + [ "language_in=ECMASCRIPT_2020", "js_module_root=./gen/ui", + "js_module_root=./gen/ui/file_manager/tsc/", "js_module_root=" + rebase_path("//ui/file_manager/", root_build_dir), "js_module_root=./gen/ui/file_manager/", "browser_resolver_prefix_replacements=\"chrome://webui-test/=./\"", "browser_resolver_prefix_replacements=\"chrome://file-manager/=./file_manager/\"", + "hide_warnings_for=gen/ui/file_manager/tsc/", ] + extra_deps = [ "//ui/file_manager:js_from_ts" ] } group("closure_compile") {
diff --git a/ui/file_manager/image_loader/image_loader_client.js b/ui/file_manager/image_loader/image_loader_client.js index 40253c9..43efc228 100644 --- a/ui/file_manager/image_loader/image_loader_client.js +++ b/ui/file_manager/image_loader/image_loader_client.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 {LRUCache} from 'chrome://file-manager/common/js/lru_cache.js'; +import {LruCache} from 'chrome://file-manager/common/js/lru_cache.js'; import {LoadImageRequest, LoadImageResponse, LoadImageResponseStatus} from './load_image_request.js'; @@ -25,7 +25,7 @@ /** * LRU cache for images. - * @type {!LRUCache.<{ + * @type {!LruCache.<{ * timestamp: ?number, * width: number, * height: number, @@ -34,7 +34,7 @@ * }>} * @private */ - this.cache_ = new LRUCache(ImageLoaderClient.CACHE_MEMORY_LIMIT); + this.cache_ = new LruCache(ImageLoaderClient.CACHE_MEMORY_LIMIT); } /**
diff --git a/url/url_canon_unittest.cc b/url/url_canon_unittest.cc index d2707d56..4a4f8bb3 100644 --- a/url/url_canon_unittest.cc +++ b/url/url_canon_unittest.cc
@@ -8,7 +8,6 @@ #include <stddef.h> #include <string_view> -#include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "base/test/gtest_util.h" #include "base/test/metrics/histogram_tester.h" @@ -120,12 +119,12 @@ {0x10FFFF, "\xF4\x8F\xBF\xBF"}, }; std::string out_str; - for (size_t i = 0; i < std::size(utf_cases); i++) { + for (const auto& utf_case : utf_cases) { out_str.clear(); StdStringCanonOutput output(&out_str); - AppendUTF8Value(utf_cases[i].input, &output); + AppendUTF8Value(utf_case.input, &output); output.Complete(); - EXPECT_EQ(utf_cases[i].output, out_str); + EXPECT_EQ(utf_case.output, out_str); } } @@ -172,27 +171,27 @@ }; std::string out_str; - for (size_t i = 0; i < std::size(utf_cases); i++) { - if (utf_cases[i].input8) { + for (const auto& utf_case : utf_cases) { + if (utf_case.input8) { out_str.clear(); StdStringCanonOutput output(&out_str); - size_t input_len = strlen(utf_cases[i].input8); + size_t input_len = strlen(utf_case.input8); bool success = true; for (size_t ch = 0; ch < input_len; ch++) { - success &= AppendUTF8EscapedChar(utf_cases[i].input8, &ch, input_len, - &output); + success &= + AppendUTF8EscapedChar(utf_case.input8, &ch, input_len, &output); } output.Complete(); - EXPECT_EQ(utf_cases[i].expected_success, success); - EXPECT_EQ(std::string(utf_cases[i].output), out_str); + EXPECT_EQ(utf_case.expected_success, success); + EXPECT_EQ(std::string(utf_case.output), out_str); } - if (utf_cases[i].input16) { + if (utf_case.input16) { out_str.clear(); StdStringCanonOutput output(&out_str); std::u16string input_str( - test_utils::TruncateWStringToUTF16(utf_cases[i].input16)); + test_utils::TruncateWStringToUTF16(utf_case.input16)); size_t input_len = input_str.length(); bool success = true; for (size_t ch = 0; ch < input_len; ch++) { @@ -200,18 +199,17 @@ &output); } output.Complete(); - EXPECT_EQ(utf_cases[i].expected_success, success); - EXPECT_EQ(std::string(utf_cases[i].output), out_str); + EXPECT_EQ(utf_case.expected_success, success); + EXPECT_EQ(std::string(utf_case.output), out_str); } - if (utf_cases[i].input8 && utf_cases[i].input16 && - utf_cases[i].expected_success) { + if (utf_case.input8 && utf_case.input16 && utf_case.expected_success) { // Check that the UTF-8 and UTF-16 inputs are equivalent. // UTF-16 -> UTF-8 - std::string input8_str(utf_cases[i].input8); + std::string input8_str(utf_case.input8); std::u16string input16_str( - test_utils::TruncateWStringToUTF16(utf_cases[i].input16)); + test_utils::TruncateWStringToUTF16(utf_case.input16)); EXPECT_EQ(input8_str, base::UTF16ToUTF8(input16_str)); // UTF-8 -> UTF-16 @@ -243,36 +241,36 @@ std::string out_str; - for (size_t i = 0; i < std::size(scheme_cases); i++) { - int url_len = static_cast<int>(strlen(scheme_cases[i].input)); + for (const auto& scheme_case : scheme_cases) { + int url_len = static_cast<int>(strlen(scheme_case.input)); Component in_comp(0, url_len); Component out_comp; out_str.clear(); StdStringCanonOutput output1(&out_str); - bool success = CanonicalizeScheme(scheme_cases[i].input, in_comp, &output1, - &out_comp); + bool success = + CanonicalizeScheme(scheme_case.input, in_comp, &output1, &out_comp); output1.Complete(); - EXPECT_EQ(scheme_cases[i].expected_success, success); - EXPECT_EQ(std::string(scheme_cases[i].expected), out_str); - EXPECT_EQ(scheme_cases[i].expected_component.begin, out_comp.begin); - EXPECT_EQ(scheme_cases[i].expected_component.len, out_comp.len); + EXPECT_EQ(scheme_case.expected_success, success); + EXPECT_EQ(std::string(scheme_case.expected), out_str); + EXPECT_EQ(scheme_case.expected_component.begin, out_comp.begin); + EXPECT_EQ(scheme_case.expected_component.len, out_comp.len); // Now try the wide version. out_str.clear(); StdStringCanonOutput output2(&out_str); - std::u16string wide_input(base::UTF8ToUTF16(scheme_cases[i].input)); + std::u16string wide_input(base::UTF8ToUTF16(scheme_case.input)); in_comp.len = static_cast<int>(wide_input.length()); success = CanonicalizeScheme(wide_input.c_str(), in_comp, &output2, &out_comp); output2.Complete(); - EXPECT_EQ(scheme_cases[i].expected_success, success); - EXPECT_EQ(std::string(scheme_cases[i].expected), out_str); - EXPECT_EQ(scheme_cases[i].expected_component.begin, out_comp.begin); - EXPECT_EQ(scheme_cases[i].expected_component.len, out_comp.len); + EXPECT_EQ(scheme_case.expected_success, success); + EXPECT_EQ(std::string(scheme_case.expected), out_str); + EXPECT_EQ(scheme_case.expected_component.begin, out_comp.begin); + EXPECT_EQ(scheme_case.expected_component.len, out_comp.len); } // Test the case where the scheme is declared nonexistent, it should be @@ -330,15 +328,15 @@ {"Goo%2a*goo.com", L"Goo%2a*goo.com", "goo%2A%2Agoo.com", Component(0, 16), CanonHostInfo::NEUTRAL, -1, ""}, // Exciting different types of spaces! - {NULL, L"GOO\x00a0\x3000goo.com", "goo%20%20goo.com", Component(0, 16), + {nullptr, L"GOO\x00a0\x3000goo.com", "goo%20%20goo.com", Component(0, 16), CanonHostInfo::NEUTRAL, -1, ""}, // Other types of space (no-break, zero-width, zero-width-no-break) are // name-prepped away to nothing. - {NULL, L"GOO\x200b\x2060\xfeffgoo.com", "googoo.com", Component(0, 10), + {nullptr, L"GOO\x200b\x2060\xfeffgoo.com", "googoo.com", Component(0, 10), CanonHostInfo::NEUTRAL, -1, ""}, // Ideographic full stop (full-width period for Chinese, etc.) should be // treated as a dot. - {NULL, + {nullptr, L"www.foo\x3002" L"bar.com", "www.foo.bar.com", Component(0, 15), CanonHostInfo::NEUTRAL, -1, ""}, @@ -608,34 +606,34 @@ // CanonicalizeHost() non-verbose. std::string out_str; - for (size_t i = 0; i < std::size(host_cases); i++) { + for (const auto& host_case : host_cases) { // Narrow version. - if (host_cases[i].input8) { - int host_len = static_cast<int>(strlen(host_cases[i].input8)); + if (host_case.input8) { + int host_len = static_cast<int>(strlen(host_case.input8)); Component in_comp(0, host_len); Component out_comp; out_str.clear(); StdStringCanonOutput output(&out_str); - bool success = CanonicalizeHost(host_cases[i].input8, in_comp, &output, - &out_comp); + bool success = + CanonicalizeHost(host_case.input8, in_comp, &output, &out_comp); output.Complete(); - EXPECT_EQ(host_cases[i].expected_family != CanonHostInfo::BROKEN, - success) << "for input: " << host_cases[i].input8; - EXPECT_EQ(std::string(host_cases[i].expected), out_str) << - "for input: " << host_cases[i].input8; - EXPECT_EQ(host_cases[i].expected_component.begin, out_comp.begin) << - "for input: " << host_cases[i].input8; - EXPECT_EQ(host_cases[i].expected_component.len, out_comp.len) << - "for input: " << host_cases[i].input8; + EXPECT_EQ(host_case.expected_family != CanonHostInfo::BROKEN, success) + << "for input: " << host_case.input8; + EXPECT_EQ(std::string(host_case.expected), out_str) + << "for input: " << host_case.input8; + EXPECT_EQ(host_case.expected_component.begin, out_comp.begin) + << "for input: " << host_case.input8; + EXPECT_EQ(host_case.expected_component.len, out_comp.len) + << "for input: " << host_case.input8; } // Wide version. - if (host_cases[i].input16) { + if (host_case.input16) { std::u16string input16( - test_utils::TruncateWStringToUTF16(host_cases[i].input16)); + test_utils::TruncateWStringToUTF16(host_case.input16)); int host_len = static_cast<int>(input16.length()); Component in_comp(0, host_len); Component out_comp; @@ -647,46 +645,43 @@ &out_comp); output.Complete(); - EXPECT_EQ(host_cases[i].expected_family != CanonHostInfo::BROKEN, - success); - EXPECT_EQ(std::string(host_cases[i].expected), out_str); - EXPECT_EQ(host_cases[i].expected_component.begin, out_comp.begin); - EXPECT_EQ(host_cases[i].expected_component.len, out_comp.len); + EXPECT_EQ(host_case.expected_family != CanonHostInfo::BROKEN, success); + EXPECT_EQ(std::string(host_case.expected), out_str); + EXPECT_EQ(host_case.expected_component.begin, out_comp.begin); + EXPECT_EQ(host_case.expected_component.len, out_comp.len); } } // CanonicalizeHostVerbose() - for (size_t i = 0; i < std::size(host_cases); i++) { + for (const auto& host_case : host_cases) { // Narrow version. - if (host_cases[i].input8) { - int host_len = static_cast<int>(strlen(host_cases[i].input8)); + if (host_case.input8) { + int host_len = static_cast<int>(strlen(host_case.input8)); Component in_comp(0, host_len); out_str.clear(); StdStringCanonOutput output(&out_str); CanonHostInfo host_info; - CanonicalizeHostVerbose(host_cases[i].input8, in_comp, &output, - &host_info); + CanonicalizeHostVerbose(host_case.input8, in_comp, &output, &host_info); output.Complete(); - EXPECT_EQ(host_cases[i].expected_family, host_info.family); - EXPECT_EQ(std::string(host_cases[i].expected), out_str); - EXPECT_EQ(host_cases[i].expected_component.begin, - host_info.out_host.begin); - EXPECT_EQ(host_cases[i].expected_component.len, host_info.out_host.len); - EXPECT_EQ(std::string(host_cases[i].expected_address_hex), + EXPECT_EQ(host_case.expected_family, host_info.family); + EXPECT_EQ(std::string(host_case.expected), out_str); + EXPECT_EQ(host_case.expected_component.begin, host_info.out_host.begin); + EXPECT_EQ(host_case.expected_component.len, host_info.out_host.len); + EXPECT_EQ(std::string(host_case.expected_address_hex), BytesToHexString(host_info.address, host_info.AddressLength())); - if (host_cases[i].expected_family == CanonHostInfo::IPV4) { - EXPECT_EQ(host_cases[i].expected_num_ipv4_components, + if (host_case.expected_family == CanonHostInfo::IPV4) { + EXPECT_EQ(host_case.expected_num_ipv4_components, host_info.num_ipv4_components); } } // Wide version. - if (host_cases[i].input16) { + if (host_case.input16) { std::u16string input16( - test_utils::TruncateWStringToUTF16(host_cases[i].input16)); + test_utils::TruncateWStringToUTF16(host_case.input16)); int host_len = static_cast<int>(input16.length()); Component in_comp(0, host_len); @@ -697,15 +692,14 @@ CanonicalizeHostVerbose(input16.c_str(), in_comp, &output, &host_info); output.Complete(); - EXPECT_EQ(host_cases[i].expected_family, host_info.family); - EXPECT_EQ(std::string(host_cases[i].expected), out_str); - EXPECT_EQ(host_cases[i].expected_component.begin, - host_info.out_host.begin); - EXPECT_EQ(host_cases[i].expected_component.len, host_info.out_host.len); - EXPECT_EQ(std::string(host_cases[i].expected_address_hex), + EXPECT_EQ(host_case.expected_family, host_info.family); + EXPECT_EQ(std::string(host_case.expected), out_str); + EXPECT_EQ(host_case.expected_component.begin, host_info.out_host.begin); + EXPECT_EQ(host_case.expected_component.len, host_info.out_host.len); + EXPECT_EQ(std::string(host_case.expected_address_hex), BytesToHexString(host_info.address, host_info.AddressLength())); - if (host_cases[i].expected_family == CanonHostInfo::IPV4) { - EXPECT_EQ(host_cases[i].expected_num_ipv4_components, + if (host_case.expected_family == CanonHostInfo::IPV4) { + EXPECT_EQ(host_case.expected_num_ipv4_components, host_info.num_ipv4_components); } } @@ -1189,34 +1183,30 @@ {"ftp://me\\mydomain:pass@foo.com/", "", Component(0, -1), Component(0, -1), true}, }; - for (size_t i = 0; i < std::size(user_info_cases); i++) { - int url_len = static_cast<int>(strlen(user_info_cases[i].input)); + for (const auto& user_info_case : user_info_cases) { + int url_len = static_cast<int>(strlen(user_info_case.input)); Parsed parsed; - ParseStandardURL(user_info_cases[i].input, url_len, &parsed); + ParseStandardURL(user_info_case.input, url_len, &parsed); Component out_user, out_pass; std::string out_str; StdStringCanonOutput output1(&out_str); - bool success = CanonicalizeUserInfo(user_info_cases[i].input, - parsed.username, - user_info_cases[i].input, - parsed.password, - &output1, - &out_user, - &out_pass); + bool success = CanonicalizeUserInfo(user_info_case.input, parsed.username, + user_info_case.input, parsed.password, + &output1, &out_user, &out_pass); output1.Complete(); - EXPECT_EQ(user_info_cases[i].expected_success, success); - EXPECT_EQ(std::string(user_info_cases[i].expected), out_str); - EXPECT_EQ(user_info_cases[i].expected_username.begin, out_user.begin); - EXPECT_EQ(user_info_cases[i].expected_username.len, out_user.len); - EXPECT_EQ(user_info_cases[i].expected_password.begin, out_pass.begin); - EXPECT_EQ(user_info_cases[i].expected_password.len, out_pass.len); + EXPECT_EQ(user_info_case.expected_success, success); + EXPECT_EQ(std::string(user_info_case.expected), out_str); + EXPECT_EQ(user_info_case.expected_username.begin, out_user.begin); + EXPECT_EQ(user_info_case.expected_username.len, out_user.len); + EXPECT_EQ(user_info_case.expected_password.begin, out_pass.begin); + EXPECT_EQ(user_info_case.expected_password.len, out_pass.len); // Now try the wide version out_str.clear(); StdStringCanonOutput output2(&out_str); - std::u16string wide_input(base::UTF8ToUTF16(user_info_cases[i].input)); + std::u16string wide_input(base::UTF8ToUTF16(user_info_case.input)); success = CanonicalizeUserInfo(wide_input.c_str(), parsed.username, wide_input.c_str(), @@ -1226,12 +1216,12 @@ &out_pass); output2.Complete(); - EXPECT_EQ(user_info_cases[i].expected_success, success); - EXPECT_EQ(std::string(user_info_cases[i].expected), out_str); - EXPECT_EQ(user_info_cases[i].expected_username.begin, out_user.begin); - EXPECT_EQ(user_info_cases[i].expected_username.len, out_user.len); - EXPECT_EQ(user_info_cases[i].expected_password.begin, out_pass.begin); - EXPECT_EQ(user_info_cases[i].expected_password.len, out_pass.len); + EXPECT_EQ(user_info_case.expected_success, success); + EXPECT_EQ(std::string(user_info_case.expected), out_str); + EXPECT_EQ(user_info_case.expected_username.begin, out_user.begin); + EXPECT_EQ(user_info_case.expected_username.len, out_user.len); + EXPECT_EQ(user_info_case.expected_password.begin, out_pass.begin); + EXPECT_EQ(user_info_case.expected_password.len, out_pass.len); } } @@ -1258,39 +1248,33 @@ {"80", PORT_UNSPECIFIED, ":80", Component(1, 2), true}, }; - for (size_t i = 0; i < std::size(port_cases); i++) { - int url_len = static_cast<int>(strlen(port_cases[i].input)); + for (const auto& port_case : port_cases) { + int url_len = static_cast<int>(strlen(port_case.input)); Component in_comp(0, url_len); Component out_comp; std::string out_str; StdStringCanonOutput output1(&out_str); - bool success = CanonicalizePort(port_cases[i].input, - in_comp, - port_cases[i].default_port, - &output1, - &out_comp); + bool success = CanonicalizePort( + port_case.input, in_comp, port_case.default_port, &output1, &out_comp); output1.Complete(); - EXPECT_EQ(port_cases[i].expected_success, success); - EXPECT_EQ(std::string(port_cases[i].expected), out_str); - EXPECT_EQ(port_cases[i].expected_component.begin, out_comp.begin); - EXPECT_EQ(port_cases[i].expected_component.len, out_comp.len); + EXPECT_EQ(port_case.expected_success, success); + EXPECT_EQ(std::string(port_case.expected), out_str); + EXPECT_EQ(port_case.expected_component.begin, out_comp.begin); + EXPECT_EQ(port_case.expected_component.len, out_comp.len); // Now try the wide version out_str.clear(); StdStringCanonOutput output2(&out_str); - std::u16string wide_input(base::UTF8ToUTF16(port_cases[i].input)); - success = CanonicalizePort(wide_input.c_str(), - in_comp, - port_cases[i].default_port, - &output2, - &out_comp); + std::u16string wide_input(base::UTF8ToUTF16(port_case.input)); + success = CanonicalizePort(wide_input.c_str(), in_comp, + port_case.default_port, &output2, &out_comp); output2.Complete(); - EXPECT_EQ(port_cases[i].expected_success, success); - EXPECT_EQ(std::string(port_cases[i].expected), out_str); - EXPECT_EQ(port_cases[i].expected_component.begin, out_comp.begin); - EXPECT_EQ(port_cases[i].expected_component.len, out_comp.len); + EXPECT_EQ(port_case.expected_success, success); + EXPECT_EQ(std::string(port_case.expected), out_str); + EXPECT_EQ(port_case.expected_component.begin, out_comp.begin); + EXPECT_EQ(port_case.expected_component.len, out_comp.len); } } @@ -1496,34 +1480,34 @@ {"q=\"asdf\"", L"q=\"asdf\"", "?q=%22asdf%22"}, }; - for (size_t i = 0; i < std::size(query_cases); i++) { + for (const auto& query_case : query_cases) { Component out_comp; - if (query_cases[i].input8) { - int len = static_cast<int>(strlen(query_cases[i].input8)); + if (query_case.input8) { + int len = static_cast<int>(strlen(query_case.input8)); Component in_comp(0, len); std::string out_str; StdStringCanonOutput output(&out_str); - CanonicalizeQuery(query_cases[i].input8, in_comp, NULL, &output, + CanonicalizeQuery(query_case.input8, in_comp, nullptr, &output, &out_comp); output.Complete(); - EXPECT_EQ(query_cases[i].expected, out_str); + EXPECT_EQ(query_case.expected, out_str); } - if (query_cases[i].input16) { + if (query_case.input16) { std::u16string input16( - test_utils::TruncateWStringToUTF16(query_cases[i].input16)); + test_utils::TruncateWStringToUTF16(query_case.input16)); int len = static_cast<int>(input16.length()); Component in_comp(0, len); std::string out_str; StdStringCanonOutput output(&out_str); - CanonicalizeQuery(input16.c_str(), in_comp, NULL, &output, &out_comp); + CanonicalizeQuery(input16.c_str(), in_comp, nullptr, &output, &out_comp); output.Complete(); - EXPECT_EQ(query_cases[i].expected, out_str); + EXPECT_EQ(query_case.expected, out_str); } } @@ -1531,7 +1515,8 @@ std::string out_str; StdStringCanonOutput output(&out_str); Component out_comp; - CanonicalizeQuery("a \x00z\x01", Component(0, 5), NULL, &output, &out_comp); + CanonicalizeQuery("a \x00z\x01", Component(0, 5), nullptr, &output, + &out_comp); output.Complete(); EXPECT_EQ("?a%20%00z%01", out_str); } @@ -1568,27 +1553,27 @@ {"#asdf", L"#asdf", "##asdf", Component(1, 5), true}, }; - for (size_t i = 0; i < std::size(ref_cases); i++) { + for (const auto& ref_case : ref_cases) { // 8-bit input - if (ref_cases[i].input8) { - int len = static_cast<int>(strlen(ref_cases[i].input8)); + if (ref_case.input8) { + int len = static_cast<int>(strlen(ref_case.input8)); Component in_comp(0, len); Component out_comp; std::string out_str; StdStringCanonOutput output(&out_str); - CanonicalizeRef(ref_cases[i].input8, in_comp, &output, &out_comp); + CanonicalizeRef(ref_case.input8, in_comp, &output, &out_comp); output.Complete(); - EXPECT_EQ(ref_cases[i].expected_component.begin, out_comp.begin); - EXPECT_EQ(ref_cases[i].expected_component.len, out_comp.len); - EXPECT_EQ(ref_cases[i].expected, out_str); + EXPECT_EQ(ref_case.expected_component.begin, out_comp.begin); + EXPECT_EQ(ref_case.expected_component.len, out_comp.len); + EXPECT_EQ(ref_case.expected, out_str); } // 16-bit input - if (ref_cases[i].input16) { + if (ref_case.input16) { std::u16string input16( - test_utils::TruncateWStringToUTF16(ref_cases[i].input16)); + test_utils::TruncateWStringToUTF16(ref_case.input16)); int len = static_cast<int>(input16.length()); Component in_comp(0, len); Component out_comp; @@ -1598,9 +1583,9 @@ CanonicalizeRef(input16.c_str(), in_comp, &output, &out_comp); output.Complete(); - EXPECT_EQ(ref_cases[i].expected_component.begin, out_comp.begin); - EXPECT_EQ(ref_cases[i].expected_component.len, out_comp.len); - EXPECT_EQ(ref_cases[i].expected, out_str); + EXPECT_EQ(ref_case.expected_component.begin, out_comp.begin); + EXPECT_EQ(ref_case.expected_component.len, out_comp.len); + EXPECT_EQ(ref_case.expected, out_str); } } @@ -1674,21 +1659,21 @@ }; // clang-format on - for (size_t i = 0; i < std::size(cases); i++) { - int url_len = static_cast<int>(strlen(cases[i].input)); + for (const auto& i : cases) { + int url_len = static_cast<int>(strlen(i.input)); Parsed parsed; - ParseStandardURL(cases[i].input, url_len, &parsed); + ParseStandardURL(i.input, url_len, &parsed); Parsed out_parsed; std::string out_str; StdStringCanonOutput output(&out_str); bool success = CanonicalizeStandardURL( - cases[i].input, url_len, parsed, - SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION, NULL, &output, &out_parsed); + i.input, url_len, parsed, SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION, + nullptr, &output, &out_parsed); output.Complete(); - EXPECT_EQ(cases[i].expected_success, success); - EXPECT_EQ(cases[i].expected, out_str); + EXPECT_EQ(i.expected_success, success); + EXPECT_EQ(i.expected, out_str); } } @@ -1715,8 +1700,8 @@ "filesystem://a:b@google.com:22/foo?baz@cat"}, }; - for (size_t i = 0; i < std::size(replace_cases); i++) { - const ReplaceCase& cur = replace_cases[i]; + for (const auto& replace_case : replace_cases) { + const ReplaceCase& cur = replace_case; int base_len = static_cast<int>(strlen(cur.base)); Parsed parsed; ParseStandardURL(cur.base, base_len, &parsed); @@ -1738,12 +1723,12 @@ std::string out_str; StdStringCanonOutput output(&out_str); Parsed out_parsed; - ReplaceStandardURL(replace_cases[i].base, parsed, r, - SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION, NULL, + ReplaceStandardURL(replace_case.base, parsed, r, + SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION, nullptr, &output, &out_parsed); output.Complete(); - EXPECT_EQ(replace_cases[i].expected, out_str); + EXPECT_EQ(replace_case.expected, out_str); } // The path pointer should be ignored if the address is invalid. @@ -1762,7 +1747,7 @@ StdStringCanonOutput output1(&out_str1); Parsed new_parsed; ReplaceStandardURL(src, parsed, r, - SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION, NULL, + SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION, nullptr, &output1, &new_parsed); output1.Complete(); EXPECT_STREQ("http://www.google.com/", out_str1.c_str()); @@ -1772,7 +1757,7 @@ std::string out_str2; StdStringCanonOutput output2(&out_str2); ReplaceStandardURL(src, parsed, r, - SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION, NULL, + SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION, nullptr, &output2, &new_parsed); output2.Complete(); EXPECT_STREQ("http://www.google.com/", out_str2.c_str()); @@ -1815,8 +1800,8 @@ nullptr, nullptr, nullptr, "file:///C:/gaba?query#ref"}, }; - for (size_t i = 0; i < std::size(replace_cases); i++) { - const ReplaceCase& cur = replace_cases[i]; + for (const auto& replace_case : replace_cases) { + const ReplaceCase& cur = replace_case; SCOPED_TRACE(cur.base); int base_len = static_cast<int>(strlen(cur.base)); Parsed parsed; @@ -1836,10 +1821,10 @@ std::string out_str; StdStringCanonOutput output(&out_str); Parsed out_parsed; - ReplaceFileURL(cur.base, parsed, r, NULL, &output, &out_parsed); + ReplaceFileURL(cur.base, parsed, r, nullptr, &output, &out_parsed); output.Complete(); - EXPECT_EQ(replace_cases[i].expected, out_str); + EXPECT_EQ(replace_case.expected, out_str); } } @@ -1884,8 +1869,8 @@ "filesystem:http://bar.com:40/t/gaba?query#ref"}, }; - for (size_t i = 0; i < std::size(replace_cases); i++) { - const ReplaceCase& cur = replace_cases[i]; + for (const auto& replace_case : replace_cases) { + const ReplaceCase& cur = replace_case; int base_len = static_cast<int>(strlen(cur.base)); Parsed parsed; ParseFileSystemURL(cur.base, base_len, &parsed); @@ -1904,10 +1889,10 @@ std::string out_str; StdStringCanonOutput output(&out_str); Parsed out_parsed; - ReplaceFileSystemURL(cur.base, parsed, r, NULL, &output, &out_parsed); + ReplaceFileSystemURL(cur.base, parsed, r, nullptr, &output, &out_parsed); output.Complete(); - EXPECT_EQ(replace_cases[i].expected, out_str); + EXPECT_EQ(replace_case.expected, out_str); } } @@ -1928,8 +1913,8 @@ nullptr, nullptr, "data:"}, }; - for (size_t i = 0; i < std::size(replace_cases); i++) { - const ReplaceCase& cur = replace_cases[i]; + for (const auto& replace_case : replace_cases) { + const ReplaceCase& cur = replace_case; int base_len = static_cast<int>(strlen(cur.base)); Parsed parsed; ParsePathURL(cur.base, base_len, false, &parsed); @@ -1951,36 +1936,46 @@ ReplacePathURL(cur.base, parsed, r, &output, &out_parsed); output.Complete(); - EXPECT_EQ(replace_cases[i].expected, out_str); + EXPECT_EQ(replace_case.expected, out_str); } } TEST(URLCanonTest, ReplaceMailtoURL) { ReplaceCase replace_cases[] = { // Replace everything - {"mailto:jon@foo.com?body=sup", "mailto", NULL, NULL, NULL, NULL, "addr1", "to=tony", NULL, "mailto:addr1?to=tony"}, + {"mailto:jon@foo.com?body=sup", "mailto", nullptr, nullptr, nullptr, + nullptr, "addr1", "to=tony", nullptr, "mailto:addr1?to=tony"}, // Replace nothing - {"mailto:jon@foo.com?body=sup", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "mailto:jon@foo.com?body=sup"}, + {"mailto:jon@foo.com?body=sup", nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, "mailto:jon@foo.com?body=sup"}, // Replace the path - {"mailto:jon@foo.com?body=sup", NULL, NULL, NULL, NULL, NULL, "jason", NULL, NULL, "mailto:jason?body=sup"}, + {"mailto:jon@foo.com?body=sup", nullptr, nullptr, nullptr, nullptr, + nullptr, "jason", nullptr, nullptr, "mailto:jason?body=sup"}, // Replace the query - {"mailto:jon@foo.com?body=sup", NULL, NULL, NULL, NULL, NULL, NULL, "custom=1", NULL, "mailto:jon@foo.com?custom=1"}, + {"mailto:jon@foo.com?body=sup", nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, "custom=1", nullptr, "mailto:jon@foo.com?custom=1"}, // Replace the path and query - {"mailto:jon@foo.com?body=sup", NULL, NULL, NULL, NULL, NULL, "jason", "custom=1", NULL, "mailto:jason?custom=1"}, + {"mailto:jon@foo.com?body=sup", nullptr, nullptr, nullptr, nullptr, + nullptr, "jason", "custom=1", nullptr, "mailto:jason?custom=1"}, // Set the query to empty (should leave trailing question mark) - {"mailto:jon@foo.com?body=sup", NULL, NULL, NULL, NULL, NULL, NULL, "", NULL, "mailto:jon@foo.com?"}, + {"mailto:jon@foo.com?body=sup", nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, "", nullptr, "mailto:jon@foo.com?"}, // Clear the query - {"mailto:jon@foo.com?body=sup", NULL, NULL, NULL, NULL, NULL, NULL, "|", NULL, "mailto:jon@foo.com"}, + {"mailto:jon@foo.com?body=sup", nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, "|", nullptr, "mailto:jon@foo.com"}, // Clear the path - {"mailto:jon@foo.com?body=sup", NULL, NULL, NULL, NULL, NULL, "|", NULL, NULL, "mailto:?body=sup"}, + {"mailto:jon@foo.com?body=sup", nullptr, nullptr, nullptr, nullptr, + nullptr, "|", nullptr, nullptr, "mailto:?body=sup"}, // Clear the path + query - {"mailto:", NULL, NULL, NULL, NULL, NULL, "|", "|", NULL, "mailto:"}, + {"mailto:", nullptr, nullptr, nullptr, nullptr, nullptr, "|", "|", + nullptr, "mailto:"}, // Setting the ref should have no effect - {"mailto:addr1", NULL, NULL, NULL, NULL, NULL, NULL, NULL, "BLAH", "mailto:addr1"}, + {"mailto:addr1", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, "BLAH", "mailto:addr1"}, }; - for (size_t i = 0; i < std::size(replace_cases); i++) { - const ReplaceCase& cur = replace_cases[i]; + for (const auto& replace_case : replace_cases) { + const ReplaceCase& cur = replace_case; int base_len = static_cast<int>(strlen(cur.base)); Parsed parsed; ParseMailtoURL(cur.base, base_len, &parsed); @@ -2002,7 +1997,7 @@ ReplaceMailtoURL(cur.base, parsed, r, &output, &out_parsed); output.Complete(); - EXPECT_EQ(replace_cases[i].expected, out_str); + EXPECT_EQ(replace_case.expected, out_str); } } @@ -2092,31 +2087,31 @@ #endif // _WIN32 }; - for (size_t i = 0; i < std::size(cases); i++) { - int url_len = static_cast<int>(strlen(cases[i].input)); + for (const auto& i : cases) { + int url_len = static_cast<int>(strlen(i.input)); Parsed parsed; - ParseFileURL(cases[i].input, url_len, &parsed); + ParseFileURL(i.input, url_len, &parsed); Parsed out_parsed; std::string out_str; StdStringCanonOutput output(&out_str); - bool success = CanonicalizeFileURL(cases[i].input, url_len, parsed, NULL, + bool success = CanonicalizeFileURL(i.input, url_len, parsed, nullptr, &output, &out_parsed); output.Complete(); - EXPECT_EQ(cases[i].expected_success, success); - EXPECT_EQ(cases[i].expected, out_str); + EXPECT_EQ(i.expected_success, success); + EXPECT_EQ(i.expected, out_str); // Make sure the spec was properly identified, the file canonicalizer has // different code for writing the spec. EXPECT_EQ(0, out_parsed.scheme.begin); EXPECT_EQ(4, out_parsed.scheme.len); - EXPECT_EQ(cases[i].expected_host.begin, out_parsed.host.begin); - EXPECT_EQ(cases[i].expected_host.len, out_parsed.host.len); + EXPECT_EQ(i.expected_host.begin, out_parsed.host.begin); + EXPECT_EQ(i.expected_host.len, out_parsed.host.len); - EXPECT_EQ(cases[i].expected_path.begin, out_parsed.path.begin); - EXPECT_EQ(cases[i].expected_path.len, out_parsed.path.len); + EXPECT_EQ(i.expected_path.begin, out_parsed.path.begin); + EXPECT_EQ(i.expected_path.len, out_parsed.path.len); } } @@ -2141,20 +2136,20 @@ {"FilEsysteM:htTp:E=/.", "filesystem:http://e=//", false}, }; - for (size_t i = 0; i < std::size(cases); i++) { - int url_len = static_cast<int>(strlen(cases[i].input)); + for (const auto& i : cases) { + int url_len = static_cast<int>(strlen(i.input)); Parsed parsed; - ParseFileSystemURL(cases[i].input, url_len, &parsed); + ParseFileSystemURL(i.input, url_len, &parsed); Parsed out_parsed; std::string out_str; StdStringCanonOutput output(&out_str); - bool success = CanonicalizeFileSystemURL(cases[i].input, url_len, parsed, - NULL, &output, &out_parsed); + bool success = CanonicalizeFileSystemURL(i.input, url_len, parsed, nullptr, + &output, &out_parsed); output.Complete(); - EXPECT_EQ(cases[i].expected_success, success); - EXPECT_EQ(cases[i].expected, out_str); + EXPECT_EQ(i.expected_success, success); + EXPECT_EQ(i.expected, out_str); // Make sure the spec was properly identified, the filesystem canonicalizer // has different code for writing the spec. @@ -2180,26 +2175,26 @@ {"javascript:\uFFFF", "javascript:%EF%BF%BF"}, }; - for (size_t i = 0; i < std::size(path_cases); i++) { - int url_len = static_cast<int>(strlen(path_cases[i].input)); + for (const auto& path_case : path_cases) { + int url_len = static_cast<int>(strlen(path_case.input)); Parsed parsed; - ParsePathURL(path_cases[i].input, url_len, true, &parsed); + ParsePathURL(path_case.input, url_len, true, &parsed); Parsed out_parsed; std::string out_str; StdStringCanonOutput output(&out_str); - bool success = CanonicalizePathURL(path_cases[i].input, url_len, parsed, + bool success = CanonicalizePathURL(path_case.input, url_len, parsed, &output, &out_parsed); output.Complete(); EXPECT_TRUE(success); - EXPECT_EQ(path_cases[i].expected, out_str); + EXPECT_EQ(path_case.expected, out_str); EXPECT_EQ(0, out_parsed.host.begin); EXPECT_EQ(-1, out_parsed.host.len); // When we end with a colon at the end, there should be no path. - if (path_cases[i].input[url_len - 1] == ':') { + if (path_case.input[url_len - 1] == ':') { EXPECT_EQ(0, out_parsed.GetContent().begin); EXPECT_EQ(-1, out_parsed.GetContent().len); } @@ -2218,20 +2213,20 @@ {"\uFFFF", L"\uFFFF", "%EF%BF%BF"}, }; - for (size_t i = 0; i < std::size(path_cases); i++) { + for (const auto& path_case : path_cases) { // 8-bit string input std::string out_str; StdStringCanonOutput output(&out_str); url::Component out_component; - CanonicalizePathURLPath(path_cases[i].input.data(), - Component(0, path_cases[i].input.size()), &output, + CanonicalizePathURLPath(path_case.input.data(), + Component(0, path_case.input.size()), &output, &out_component); output.Complete(); - EXPECT_EQ(path_cases[i].expected, out_str); + EXPECT_EQ(path_case.expected, out_str); EXPECT_EQ(0, out_component.begin); - EXPECT_EQ(path_cases[i].expected.size(), + EXPECT_EQ(path_case.expected.size(), static_cast<size_t>(out_component.len)); // 16-bit string input @@ -2239,16 +2234,16 @@ StdStringCanonOutput output16(&out_str16); url::Component out_component16; std::u16string input16( - test_utils::TruncateWStringToUTF16(path_cases[i].input16.data())); + test_utils::TruncateWStringToUTF16(path_case.input16.data())); CanonicalizePathURLPath(input16.c_str(), - Component(0, path_cases[i].input16.size()), - &output16, &out_component16); + Component(0, path_case.input16.size()), &output16, + &out_component16); output16.Complete(); - EXPECT_EQ(path_cases[i].expected, out_str16); + EXPECT_EQ(path_case.expected, out_str16); EXPECT_EQ(0, out_component16.begin); - EXPECT_EQ(path_cases[i].expected.size(), + EXPECT_EQ(path_case.expected.size(), static_cast<size_t>(out_component16.len)); } } @@ -2443,148 +2438,209 @@ const char* resolved; // What we expect in the result when resolving. } rel_cases[] = { // Basic absolute input. - {"http://host/a", true, false, "http://another/", true, false, false, NULL}, - {"http://host/a", true, false, "http:////another/", true, false, false, NULL}, + {"http://host/a", true, false, "http://another/", true, false, false, + nullptr}, + {"http://host/a", true, false, "http:////another/", true, false, false, + nullptr}, // Empty relative URLs should only remove the ref part of the URL, // leaving the rest unchanged. - {"http://foo/bar", true, false, "", true, true, true, "http://foo/bar"}, - {"http://foo/bar#ref", true, false, "", true, true, true, "http://foo/bar"}, - {"http://foo/bar#", true, false, "", true, true, true, "http://foo/bar"}, + {"http://foo/bar", true, false, "", true, true, true, "http://foo/bar"}, + {"http://foo/bar#ref", true, false, "", true, true, true, + "http://foo/bar"}, + {"http://foo/bar#", true, false, "", true, true, true, "http://foo/bar"}, // Spaces at the ends of the relative path should be ignored. - {"http://foo/bar", true, false, " another ", true, true, true, "http://foo/another"}, - {"http://foo/bar", true, false, " . ", true, true, true, "http://foo/"}, - {"http://foo/bar", true, false, " \t ", true, true, true, "http://foo/bar"}, + {"http://foo/bar", true, false, " another ", true, true, true, + "http://foo/another"}, + {"http://foo/bar", true, false, " . ", true, true, true, "http://foo/"}, + {"http://foo/bar", true, false, " \t ", true, true, true, + "http://foo/bar"}, // Matching schemes without two slashes are treated as relative. - {"http://host/a", true, false, "http:path", true, true, true, "http://host/path"}, - {"http://host/a/", true, false, "http:path", true, true, true, "http://host/a/path"}, - {"http://host/a", true, false, "http:/path", true, true, true, "http://host/path"}, - {"http://host/a", true, false, "HTTP:/path", true, true, true, "http://host/path"}, + {"http://host/a", true, false, "http:path", true, true, true, + "http://host/path"}, + {"http://host/a/", true, false, "http:path", true, true, true, + "http://host/a/path"}, + {"http://host/a", true, false, "http:/path", true, true, true, + "http://host/path"}, + {"http://host/a", true, false, "HTTP:/path", true, true, true, + "http://host/path"}, // Nonmatching schemes are absolute. - {"http://host/a", true, false, "https:host2", true, false, false, NULL}, - {"http://host/a", true, false, "htto:/host2", true, false, false, NULL}, + {"http://host/a", true, false, "https:host2", true, false, false, + nullptr}, + {"http://host/a", true, false, "htto:/host2", true, false, false, + nullptr}, // Absolute path input - {"http://host/a", true, false, "/b/c/d", true, true, true, "http://host/b/c/d"}, - {"http://host/a", true, false, "\\b\\c\\d", true, true, true, "http://host/b/c/d"}, - {"http://host/a", true, false, "/b/../c", true, true, true, "http://host/c"}, - {"http://host/a?b#c", true, false, "/b/../c", true, true, true, "http://host/c"}, - {"http://host/a", true, false, "\\b/../c?x#y", true, true, true, "http://host/c?x#y"}, - {"http://host/a?b#c", true, false, "/b/../c?x#y", true, true, true, "http://host/c?x#y"}, + {"http://host/a", true, false, "/b/c/d", true, true, true, + "http://host/b/c/d"}, + {"http://host/a", true, false, "\\b\\c\\d", true, true, true, + "http://host/b/c/d"}, + {"http://host/a", true, false, "/b/../c", true, true, true, + "http://host/c"}, + {"http://host/a?b#c", true, false, "/b/../c", true, true, true, + "http://host/c"}, + {"http://host/a", true, false, "\\b/../c?x#y", true, true, true, + "http://host/c?x#y"}, + {"http://host/a?b#c", true, false, "/b/../c?x#y", true, true, true, + "http://host/c?x#y"}, // Relative path input - {"http://host/a", true, false, "b", true, true, true, "http://host/b"}, - {"http://host/a", true, false, "bc/de", true, true, true, "http://host/bc/de"}, - {"http://host/a/", true, false, "bc/de?query#ref", true, true, true, "http://host/a/bc/de?query#ref"}, - {"http://host/a/", true, false, ".", true, true, true, "http://host/a/"}, - {"http://host/a/", true, false, "..", true, true, true, "http://host/"}, - {"http://host/a/", true, false, "./..", true, true, true, "http://host/"}, - {"http://host/a/", true, false, "../.", true, true, true, "http://host/"}, - {"http://host/a/", true, false, "././.", true, true, true, "http://host/a/"}, - {"http://host/a?query#ref", true, false, "../../../foo", true, true, true, "http://host/foo"}, + {"http://host/a", true, false, "b", true, true, true, "http://host/b"}, + {"http://host/a", true, false, "bc/de", true, true, true, + "http://host/bc/de"}, + {"http://host/a/", true, false, "bc/de?query#ref", true, true, true, + "http://host/a/bc/de?query#ref"}, + {"http://host/a/", true, false, ".", true, true, true, "http://host/a/"}, + {"http://host/a/", true, false, "..", true, true, true, "http://host/"}, + {"http://host/a/", true, false, "./..", true, true, true, "http://host/"}, + {"http://host/a/", true, false, "../.", true, true, true, "http://host/"}, + {"http://host/a/", true, false, "././.", true, true, true, + "http://host/a/"}, + {"http://host/a?query#ref", true, false, "../../../foo", true, true, true, + "http://host/foo"}, // Query input - {"http://host/a", true, false, "?foo=bar", true, true, true, "http://host/a?foo=bar"}, - {"http://host/a?x=y#z", true, false, "?", true, true, true, "http://host/a?"}, - {"http://host/a?x=y#z", true, false, "?foo=bar#com", true, true, true, "http://host/a?foo=bar#com"}, + {"http://host/a", true, false, "?foo=bar", true, true, true, + "http://host/a?foo=bar"}, + {"http://host/a?x=y#z", true, false, "?", true, true, true, + "http://host/a?"}, + {"http://host/a?x=y#z", true, false, "?foo=bar#com", true, true, true, + "http://host/a?foo=bar#com"}, // Ref input - {"http://host/a", true, false, "#ref", true, true, true, "http://host/a#ref"}, - {"http://host/a#b", true, false, "#", true, true, true, "http://host/a#"}, - {"http://host/a?foo=bar#hello", true, false, "#bye", true, true, true, "http://host/a?foo=bar#bye"}, + {"http://host/a", true, false, "#ref", true, true, true, + "http://host/a#ref"}, + {"http://host/a#b", true, false, "#", true, true, true, "http://host/a#"}, + {"http://host/a?foo=bar#hello", true, false, "#bye", true, true, true, + "http://host/a?foo=bar#bye"}, // Non-hierarchical base: no relative handling. Relative input should // error, and if a scheme is present, it should be treated as absolute. - {"data:foobar", false, false, "baz.html", false, false, false, NULL}, - {"data:foobar", false, false, "data:baz", true, false, false, NULL}, - {"data:foobar", false, false, "data:/base", true, false, false, NULL}, + {"data:foobar", false, false, "baz.html", false, false, false, nullptr}, + {"data:foobar", false, false, "data:baz", true, false, false, nullptr}, + {"data:foobar", false, false, "data:/base", true, false, false, nullptr}, // Non-hierarchical base: absolute input should succeed. - {"data:foobar", false, false, "http://host/", true, false, false, NULL}, - {"data:foobar", false, false, "http:host", true, false, false, NULL}, + {"data:foobar", false, false, "http://host/", true, false, false, + nullptr}, + {"data:foobar", false, false, "http:host", true, false, false, nullptr}, // Non-hierarchical base: empty URL should give error. - {"data:foobar", false, false, "", false, false, false, NULL}, + {"data:foobar", false, false, "", false, false, false, nullptr}, // Invalid schemes should be treated as relative. - {"http://foo/bar", true, false, "./asd:fgh", true, true, true, "http://foo/asd:fgh"}, - {"http://foo/bar", true, false, ":foo", true, true, true, "http://foo/:foo"}, - {"http://foo/bar", true, false, " hello world", true, true, true, "http://foo/hello%20world"}, - {"data:asdf", false, false, ":foo", false, false, false, NULL}, - {"data:asdf", false, false, "bad(':foo')", false, false, false, NULL}, + {"http://foo/bar", true, false, "./asd:fgh", true, true, true, + "http://foo/asd:fgh"}, + {"http://foo/bar", true, false, ":foo", true, true, true, + "http://foo/:foo"}, + {"http://foo/bar", true, false, " hello world", true, true, true, + "http://foo/hello%20world"}, + {"data:asdf", false, false, ":foo", false, false, false, nullptr}, + {"data:asdf", false, false, "bad(':foo')", false, false, false, nullptr}, // We should treat semicolons like any other character in URL resolving - {"http://host/a", true, false, ";foo", true, true, true, "http://host/;foo"}, - {"http://host/a;", true, false, ";foo", true, true, true, "http://host/;foo"}, - {"http://host/a", true, false, ";/../bar", true, true, true, "http://host/bar"}, + {"http://host/a", true, false, ";foo", true, true, true, + "http://host/;foo"}, + {"http://host/a;", true, false, ";foo", true, true, true, + "http://host/;foo"}, + {"http://host/a", true, false, ";/../bar", true, true, true, + "http://host/bar"}, // Relative URLs can also be written as "//foo/bar" which is relative to // the scheme. In this case, it would take the old scheme, so for http // the example would resolve to "http://foo/bar". - {"http://host/a", true, false, "//another", true, true, true, "http://another/"}, - {"http://host/a", true, false, "//another/path?query#ref", true, true, true, "http://another/path?query#ref"}, - {"http://host/a", true, false, "///another/path", true, true, true, "http://another/path"}, - {"http://host/a", true, false, "//Another\\path", true, true, true, "http://another/path"}, - {"http://host/a", true, false, "//", true, true, false, "http:"}, + {"http://host/a", true, false, "//another", true, true, true, + "http://another/"}, + {"http://host/a", true, false, "//another/path?query#ref", true, true, + true, "http://another/path?query#ref"}, + {"http://host/a", true, false, "///another/path", true, true, true, + "http://another/path"}, + {"http://host/a", true, false, "//Another\\path", true, true, true, + "http://another/path"}, + {"http://host/a", true, false, "//", true, true, false, "http:"}, // IE will also allow one or the other to be a backslash to get the same // behavior. - {"http://host/a", true, false, "\\/another/path", true, true, true, "http://another/path"}, - {"http://host/a", true, false, "/\\Another\\path", true, true, true, "http://another/path"}, + {"http://host/a", true, false, "\\/another/path", true, true, true, + "http://another/path"}, + {"http://host/a", true, false, "/\\Another\\path", true, true, true, + "http://another/path"}, #ifdef WIN32 // Resolving against Windows file base URLs. - {"file:///C:/foo", true, true, "http://host/", true, false, false, NULL}, - {"file:///C:/foo", true, true, "bar", true, true, true, "file:///C:/bar"}, - {"file:///C:/foo", true, true, "../../../bar.html", true, true, true, "file:///C:/bar.html"}, - {"file:///C:/foo", true, true, "/../bar.html", true, true, true, "file:///C:/bar.html"}, + {"file:///C:/foo", true, true, "http://host/", true, false, false, + nullptr}, + {"file:///C:/foo", true, true, "bar", true, true, true, "file:///C:/bar"}, + {"file:///C:/foo", true, true, "../../../bar.html", true, true, true, + "file:///C:/bar.html"}, + {"file:///C:/foo", true, true, "/../bar.html", true, true, true, + "file:///C:/bar.html"}, // But two backslashes on Windows should be UNC so should be treated // as absolute. - {"http://host/a", true, false, "\\\\another\\path", true, false, false, NULL}, + {"http://host/a", true, false, "\\\\another\\path", true, false, false, + nullptr}, // IE doesn't support drive specs starting with two slashes. It fails // immediately and doesn't even try to load. We fix it up to either // an absolute path or UNC depending on what it looks like. - {"file:///C:/something", true, true, "//c:/foo", true, true, true, "file:///C:/foo"}, - {"file:///C:/something", true, true, "//localhost/c:/foo", true, true, true, "file:///C:/foo"}, + {"file:///C:/something", true, true, "//c:/foo", true, true, true, + "file:///C:/foo"}, + {"file:///C:/something", true, true, "//localhost/c:/foo", true, true, + true, "file:///C:/foo"}, // Windows drive specs should be allowed and treated as absolute. - {"file:///C:/foo", true, true, "c:", true, false, false, NULL}, - {"file:///C:/foo", true, true, "c:/foo", true, false, false, NULL}, - {"http://host/a", true, false, "c:\\foo", true, false, false, NULL}, + {"file:///C:/foo", true, true, "c:", true, false, false, nullptr}, + {"file:///C:/foo", true, true, "c:/foo", true, false, false, nullptr}, + {"http://host/a", true, false, "c:\\foo", true, false, false, nullptr}, // Relative paths with drive letters should be allowed when the base is // also a file. - {"file:///C:/foo", true, true, "/z:/bar", true, true, true, "file:///Z:/bar"}, + {"file:///C:/foo", true, true, "/z:/bar", true, true, true, + "file:///Z:/bar"}, // Treat absolute paths as being off of the drive. - {"file:///C:/foo", true, true, "/bar", true, true, true, "file:///C:/bar"}, - {"file://localhost/C:/foo", true, true, "/bar", true, true, true, "file://localhost/C:/bar"}, - {"file:///C:/foo/com/", true, true, "/bar", true, true, true, "file:///C:/bar"}, + {"file:///C:/foo", true, true, "/bar", true, true, true, + "file:///C:/bar"}, + {"file://localhost/C:/foo", true, true, "/bar", true, true, true, + "file://localhost/C:/bar"}, + {"file:///C:/foo/com/", true, true, "/bar", true, true, true, + "file:///C:/bar"}, // On Windows, two slashes without a drive letter when the base is a file // means that the path is UNC. - {"file:///C:/something", true, true, "//somehost/path", true, true, true, "file://somehost/path"}, - {"file:///C:/something", true, true, "/\\//somehost/path", true, true, true, "file://somehost/path"}, + {"file:///C:/something", true, true, "//somehost/path", true, true, true, + "file://somehost/path"}, + {"file:///C:/something", true, true, "/\\//somehost/path", true, true, + true, "file://somehost/path"}, #else // On Unix we fall back to relative behavior since there's nothing else // reasonable to do. - {"http://host/a", true, false, "\\\\Another\\path", true, true, true, "http://another/path"}, + {"http://host/a", true, false, "\\\\Another\\path", true, true, true, + "http://another/path"}, #endif // Even on Windows, we don't allow relative drive specs when the base // is not file. - {"http://host/a", true, false, "/c:\\foo", true, true, true, "http://host/c:/foo"}, - {"http://host/a", true, false, "//c:\\foo", true, true, true, "http://c/foo"}, + {"http://host/a", true, false, "/c:\\foo", true, true, true, + "http://host/c:/foo"}, + {"http://host/a", true, false, "//c:\\foo", true, true, true, + "http://c/foo"}, // Cross-platform relative file: resolution behavior. - {"file://host/a", true, true, "/", true, true, true, "file://host/"}, - {"file://host/a", true, true, "//", true, true, true, "file:///"}, - {"file://host/a", true, true, "/b", true, true, true, "file://host/b"}, - {"file://host/a", true, true, "//b", true, true, true, "file://b/"}, + {"file://host/a", true, true, "/", true, true, true, "file://host/"}, + {"file://host/a", true, true, "//", true, true, true, "file:///"}, + {"file://host/a", true, true, "/b", true, true, true, "file://host/b"}, + {"file://host/a", true, true, "//b", true, true, true, "file://b/"}, // Ensure that ports aren't allowed for hosts relative to a file url. // Although the result string shows a host:port portion, the call to // resolve the relative URL returns false, indicating parse failure, // which is what is required. - {"file:///foo.txt", true, true, "//host:80/bar.txt", true, true, false, "file://host:80/bar.txt"}, + {"file:///foo.txt", true, true, "//host:80/bar.txt", true, true, false, + "file://host:80/bar.txt"}, // Filesystem URL tests; filesystem URLs are only valid and relative if // they have no scheme, e.g. "./index.html". There's no valid equivalent // to http:index.html. - {"filesystem:http://host/t/path", true, false, "filesystem:http://host/t/path2", true, false, false, NULL}, - {"filesystem:http://host/t/path", true, false, "filesystem:https://host/t/path2", true, false, false, NULL}, - {"filesystem:http://host/t/path", true, false, "http://host/t/path2", true, false, false, NULL}, - {"http://host/t/path", true, false, "filesystem:http://host/t/path2", true, false, false, NULL}, - {"filesystem:http://host/t/path", true, false, "./path2", true, true, true, "filesystem:http://host/t/path2"}, - {"filesystem:http://host/t/path/", true, false, "path2", true, true, true, "filesystem:http://host/t/path/path2"}, - {"filesystem:http://host/t/path", true, false, "filesystem:http:path2", true, false, false, NULL}, + {"filesystem:http://host/t/path", true, false, + "filesystem:http://host/t/path2", true, false, false, nullptr}, + {"filesystem:http://host/t/path", true, false, + "filesystem:https://host/t/path2", true, false, false, nullptr}, + {"filesystem:http://host/t/path", true, false, "http://host/t/path2", + true, false, false, nullptr}, + {"http://host/t/path", true, false, "filesystem:http://host/t/path2", + true, false, false, nullptr}, + {"filesystem:http://host/t/path", true, false, "./path2", true, true, + true, "filesystem:http://host/t/path2"}, + {"filesystem:http://host/t/path/", true, false, "path2", true, true, true, + "filesystem:http://host/t/path/path2"}, + {"filesystem:http://host/t/path", true, false, "filesystem:http:path2", + true, false, false, nullptr}, // Absolute URLs are still not relative to a non-standard base URL. - {"about:blank", false, false, "http://X/A", true, false, true, ""}, - {"about:blank", false, false, "content://content.Provider/", true, false, true, ""}, + {"about:blank", false, false, "http://X/A", true, false, true, ""}, + {"about:blank", false, false, "content://content.Provider/", true, false, + true, ""}, }; - for (size_t i = 0; i < std::size(rel_cases); i++) { - const RelativeCase& cur_case = rel_cases[i]; - + for (const auto& cur_case : rel_cases) { Parsed parsed; int base_len = static_cast<int>(strlen(cur_case.base)); if (cur_case.is_base_file) @@ -2614,7 +2670,7 @@ bool succeed_resolve = ResolveRelativeURL( cur_case.base, parsed, cur_case.is_base_file, cur_case.test, - relative_component, NULL, &output, &resolved_parsed); + relative_component, nullptr, &output, &resolved_parsed); output.Complete(); EXPECT_EQ(cur_case.succeed_resolve, succeed_resolve); @@ -2664,7 +2720,7 @@ Parsed repl_parsed; std::string repl_str; StdStringCanonOutput repl_output(&repl_str); - ReplaceFileURL(src, parsed, repl, NULL, &repl_output, &repl_parsed); + ReplaceFileURL(src, parsed, repl, nullptr, &repl_output, &repl_parsed); repl_output.Complete(); // Generate the expected string and check. @@ -2692,7 +2748,7 @@ {"WSS", PORT_UNSPECIFIED}, }; - for (auto& test_case : cases) { + for (const auto& test_case : cases) { SCOPED_TRACE(test_case.scheme); EXPECT_EQ(test_case.expected_port, DefaultPortForScheme(test_case.scheme, strlen(test_case.scheme)));
diff --git a/v8 b/v8 index e3538e4..848018e 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit e3538e4e0e62b275515a23b9c5c49a3957d612e3 +Subproject commit 848018e98242a6244389bf82bb73a07239c3aa22